Professional Documents
Culture Documents
Bismita Srichandan
Leader Election
• What is Leader Election
• Why Leader election is needed
• Different design topologies
• Algorithms used
– Bully Algorithm
– Ring Algorithm
– Invitation Algorithm
• References
What is Leader Election?
Election Synchronization
• In election, all participants • In synchronization, the
must know who owns the nontoken holders only
token(i.e. who is the need to know that they do
leader). not hold the token.
Complete Topology:
• Each process in the group can reach any other process in the same group
in one message hop.
• Assumptions taken
– All process ids are unique and known to every process
– Second assumption is communication network is reliable and only the communicating
processes may fail.
– Process takes a known finite amount of time to handle a message, in other words, the
process is considered as crashed if it doesn’t respond within specified time-out period.
*Note – Bully algorithm is based on the assumptions of complete topology
Bully Algorithm(Author : Tanenbaum)
• This is an extrema-finding algorithm.
• In this algorithm, the highest-numbered process becomes coordinator. Thus
the biggest guy in town always wins, hence the name “Bully Algorithm.”
• Bully algorithm makes note of time of by which the process should respond.
Initiation:
1. Process 4 sends an ELECTION message to
its successor (or next alive process) with its
ID
2. Each process adds its own ID and
forwards the ELECTION message
Ring Algorithm contd…
Leader Election:
1. Message comes back to initiator, here the initiator is 4.
2. Initiator announces the winner by sending another message
around the ring
Tree Topology
• To construct a logical ring structure is easy if the underlying
network supports broadcast facilities.
• A tree is used as representative topological structure.
• Each node is considered an autonomous entity that
exchanges messages with adjacent nodes
• A minimum-weight spanning tree(MST) is used for leader
election in tree topology
• Gallager, Humbelt, and Spira’s algorithm is based on searching
and combining.
• It works by merging fragments, starting from each node and
attaching level by level till it ends up with the MST
• A leader can be designated as the last node that merges and
yields to the final MST.
Invitation Algorithm
• Invitation algorithm is a strong algorithm and it is basically designed for
asynchronous systems.
– Bully algorithm strongly uses the facts that timeouts can accurately
detect failed processors.
– An arbitrary timing glitch (lost messages, overfull buffers, temporary
overloads etc) , the bully algorithm can elect two leaders.
– Another possibility can be the node that fails to respond might not
have failed.
Invitation Algorithm contd…
• Each node in a group periodically checks whether the leader
is alive or not, by sending a message to the leader and waits
for reply.
• If the node does not reply within a timeout period, the node
invokes a Recovery procedure.
• The recovery procedure puts node i into a singleton group
with node i as the leader.
• periodically, each leader i calls a check procedure, which
sends messages to every other node asking whether that
node is a leader.
• If many nodes responds that it is a leader, node i pauses for
some time and then calls for a merge procedure.
Invitation Algorithm contd…
Merge procedure sends message to all the
leaders, inviting them to join a new group
with the inviting node as leader.
• [2] http://www.cs.wustl.edu/~kjg/CS333_SP97/leader.html
• [3] http://www.risc.uni-linz.ac.at/software/daj/Invitation/
• [4] http://ieeexplore.ieee.org
• [6] http://www.cs.indiana.edu/pub/techreports/TR521.pdf
• [7] Distributed Systems principles and paradigms by Andrew S. Tanenbaum, Maarten van Steen, 2002.
• [8] M.F. Kaashoek and A.S. Tanenbaum, “Group Communication in the Amoeba Distributed Operating
System,” Proc. IEEE 11th Int'l Conf. Distributed Computing Systems (ICDCS), pp. 222-230, 1991.
References
Ring Algorithm
• [9] http://rocw.raifoundation.org/computing/BCA/distributedcomputing/lecture-notes/lecture-18.pdf
• [10]Vasudevan, S.; DeCleene, B.; Immerman, N.; Kurose, J.; Towsley, D.; “Leader election algorithms for
wireless ad hoc networks”, DARPA Information Survivability Conference and Exposition, 2003.
Proceedings
•
[11] Optimal Leader Election Scheme for Peer-to-Peer Applications
Networking, 2007. ICN '07. Sixth International Conference on Volume , Issue , 22-28 April 2007
http://ieeexplore.ieee.org/xpl/RecentCon.jsp?punumber=4196186
Thank You!
Questions