Originally Posted by
Ibrahim
Thank you very much, the main aim of my implementation is to reduce the load on leader. So as soon as the leader sends a proposal message to followers, I need each follower to send ACK (Acknonwlegment) to all followers including the leader (ACK means agreement upon the proposal). In this case, each follower will commits the proposal, no need to wait for commit from the leader.
This communcation usually in state-machine replication protocol. The protocol cosists of three phases to manage execution of update requests. Phase 1 leader sends proposal (update request) to all followers. phase 2 when followers receive proposal they send ACK (means agree on change) to leader. phase 3 as soon as leader receice the majority of ACK from the followers, leader sends commit message to followers to deliver the update requests (means to apply the repuset in thier memory of disk).
So in this scanario leader get much of work, therfore I need to reduce to load on leader and distribute among the followers. I come up with different designs. But now I need to make the follower (client) be able to send and receive ACK from other followers.
I hope it is clear. Any idea to make follower able to send and receive a mesage from other followers?
Thank you alot.
You could investigate different network schemes and find a suitable design for your layout. For example round robin -type so that way you could organize the network of machines not to have connection from each peer to each peer but one peer to one other and so on.
For example:
Lets say your clients are A, B, C and D.
If you want full p2p A would have to serve B, C and D. B would have to serve A, C and D and so on.
But if you round robin it so that A serves B, B serves C and C serves D you'd only need to "ack" A to start the chain. You'll save alot of connections for a tiny price of latency.
There might be other even more suitable network architectures depending on size and possible timing issues of the network. As for java side, i believe you will have to use the serversocket-socket structure for TCP/IP connection if the UDP isn't reliable for your needs. But you could implement some kind of light handshake protocol ( send ack -> wait for ack to ack -> if not recieved send another ack etc.. ) to strenghten the reliability of UDP.
Edit: You might want to look in to this as well:
http://docs.oracle.com/javase/tutori...adcasting.html
Anyway, good luck to your project