Question: Implemented it in java, if you don't want to write the code, please tell me your idea of how to implement it. Just the general
Implemented it in java, if you don't want to write the code, please tell me your idea of how to implement it. Just the general step
1.1 Part 1
Implement a distributed system consisting of n nodes, numbered 0 to n ? 1, arranged in a certain topology. The topology and information about other parameters will be provided in a configuration file.
All channels in the system are bidirectional, reliable and satisfy the first-in-first-out (FIFO) property. You can implement a channel using a reliable socket connection (with TCP or SCTP). For each channel, the socket connection should be created at the beginning of the program and should stay intact until the end of the program. All messages between neighboring nodes are exchanged over these connections.
All nodes execute the following protocol:
Initially, each node in the system is either active or passive. At least one node must be active at the beginning of the protocol.
While a node is active, it sends anywhere from minPerActive to maxPerActive messages, and then turns passive. For each message, it makes a uniformly random selection of one of its neighbors as the destination. Also, if the node stays active after sending a message, then it waits for at least minSendDelay time units before sending the next message.
Only an active node can send a message.
A passive node, on receiving a message, becomes active if it has sent fewer than maxNumber messages (summed over all active intervals). Otherwise, it stays passive. We refer to the protocol described above as the MAP protocol
1.2 Part 2
Implement the Chandy and Lamports protocol for recording a consistent global snapshot as discussed in the class. Assume that the snapshot protocol is always initiated by node 0 and all channels in the topology are bidirectional. Use the snapshot protocol to detect the termination of the MAP protocol described in Part 1. The MAP protocol terminates when all nodes are passive and all channels are empty. To detect termination of the MAP protocol, augment the Chandy and Lamports snapshot protocol to collect the information recorded at each node at node 0 using a converge-cast operation over a spanning tree. The tree can be built once in the beginning or on-the-fly for an instance using MARKER messages.
Note that, in this project, the messages exchanged by the MAP protocol are application messages and the messages exchanged by the snapshot protocol are control messages. The rules of the MAP protocol (described in Part 1) only apply to application messages. They do not apply to control messages.
Testing Correctness of the Snapshot Protocol Implementation
To test that your implementation of the Chandy and Lamports snapshot protocol is correct, implement Fidge/Matterns vector clock protocol described in the class. The vector clock of a node is part of the local state of the node and its value is also recorded whenever a node records its local state. Node 0, on receiving the information recorded by all the nodes, uses these vector timestamps to verify that the snapshot is indeed consistent. Note that only application messages will carry vector timestamps.
1.3 Part 3
Design and implement a protocol for bringing all nodes to a halt after node 0 has detected termination of the MAP protocol.
3 Configuration Format Your program should run using a configuration file in the following format:
The configuration file will be a plain-text formatted file no more than 100kB in size. Only lines which begin with an unsigned integer are considered to be valid. Lines which are not valid should be ignored. The configuration file will contain 2n + 1 valid lines. The first valid line of the onfiguration file contains six tokens. The first token is the number of nodes in the system. The second and third tokens are values of minPerActive, and maxPerActive respectively. The fourth and fifth tokens are values of minSendDelay and snapshotDelay, in milliseconds. snapshotDelay is the amount of time to wait between initiating snapshots in the Chandy-Lamport algorithm. The sixth token is the value of maxNumber. After the first valid line, the next n lines consist of three tokens. The first token is the node ID. The second token is the host-name of the machine on which the node runs. The third token is the port on which the node listens for incoming connections. After the first n + 1 valid lines, the next n lines consist of a space delimited list of at most n ? 1 tokens. The k th valid line after the first line is a space delimited list of node IDs which are the neighbor of node k. Your parser should be written so as to be robust concerning leading and trailing white space or extra lines at the beginning or end of file, as well as interleaved with valid lines. The # character will denote a comment. On any valid line, any characters after a # character should be ignored.
Listing 1: Example configuration file
# six global parameters()
5 6 10 100 2000 15
0 dc02 1234 # nodeID hostName listen port
1 dc03 1233
2 dc04 1233
3 dc05 1232
4 dc06 1233
1 4 # space delimited list of neighbors for node 0
2 3 4 # space delimited list of neighbors for node 1
0 1 3 # . . . node
2 0 4 # . . . node 3
1 3 # . . . node 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
