Objectives
1. Implement the Ring Coordinator Election Algorithm
2. More experience with socket programming for inter-process communication
Project Specification
1. You are to implement the Ring Coordinator Election Algorithm over sockets. More specifically,
your program needs to simulate the following scenarios:
a. Initially, all processes start up and communicate in a ring organization. They should display
the messages being passed so that we can observe the process. They should pass a “token”
around the ring. You should build delays into the process so that you can clearly
demonstrate the working of the algorithm. Processes are numbered. Each process should
receive the token at some small, predetermined interval. Initially start the election from any of
the processes in the ring.
b. When a process does not see the token in the expected interval it will initiate an election.
After the system elects a coordinator you will need to demonstrate the following scenario:
i. An election will be initiated by a process that does not see the token when expected.
ii. The election should proceed according to the ring algorithm
c. The crashed process should be brought back up and it should initiate an election.
d. Set the timers so that two elections run at the same time and show that
they still work.
2. You need to clearly show the communication between processes.
3. As the algorithm used here assumes that the ring structure is known to each process, for
implementation you can assume the ip address and port numbers for each process.