Ring Coordinator Election Algorithm using GUI (Java)
1. Implement the Ring Coordinator Election Algorithm using socket programming for inter-process communication
1. 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. Make this interval different for each
process so that they do not initially all start an election at the same time.
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. Manually stop communication by the current coordinator.
ii. An election will be initiated by a process that does not see the token when expected.
iii. The election should proceed according to the ring algorithm given in Chapter 6
c. The crashed process should be brought back up and it should initiate an election.
d. Set the timers so that two elections (by processes 2 & 5) run at the same time and show that
they still work.
2. You need to clearly show the communication between processes.
The program should clearly show the following:
1 – Using sockets for inter-process communication
2 – All processes start up correctly
3 – Shut down the coordinator communication
4 – Election initiated when the coordinator stops communicating
5 – The correct process wins the election
6 – Correct messages communicated and shown on each process
7 – Multiple elections work correctly