Presentation is loading. Please wait.

Presentation is loading. Please wait.

Election algorithm Who wins? God knows.

Similar presentations


Presentation on theme: "Election algorithm Who wins? God knows."— Presentation transcript:

1 election algorithm Who wins? God knows

2 what is leader election problem?
coordinator node/process goes down or crashes in distributed system. all process are in contention for leadership. Who wins? Election algorithm at rescue.

3 what is election algorithm? [static networks]
Eventually there is a leader. There should be no more than one leader.

4 Types of election algorithm [static networks]
bully algorithm ring algorithm

5 assumptions one process per node each process has unique id.
each process has process number.

6 bully algorithm devised by Garcia-Molina in 1982.
process P initiates election. sends ‘election’ message to all the process with higher process number. if no answer – P is ‘leader’ if answer - P work’s over and waits. sender takes over and continues till victor found.

7 example 2 2 1 1 2 1 e 4 5 5 a 4 5 e a 6 6 e e 6 7 7 3 3 7 3 crashed 2 1 2 1 4 5 4 5 e e L a e 6 6 7 3 7 3

8 ring algorithm 5 6 2 1 2 3 2 5 3 6 7 4 crashed 6 5 5

9 other proposed ring algo
P sends election message to next neighbor Q in clockwise direction. Whichever loses becomes relay node. And the winner continues until it finds itself as its neighbor.

10 example 2 1 3 3 7 4 crashed 6 5 Relay processors

11 tree algorithm It is divided into 3 stages 1st - growing.
2nd- shrinking 3rd - leader

12 Example growing 10 5 e B D B D e e A A 3 e C F C F e e 2 7 B D A e e C

13 Continued… shrinking & leader
B A(D,10) D A C F A(F,7) B D B D L(D,10) A(D,10) A A A(F,7) C F C F L(D,10)

14 Mobile adhoc network why different algorithm needed?
constantly changing number and position of nodes. partitioning as well as merging of clusters. most valued node must be selected as leader.

15 Modified tree algorithm
2 new message probe – to determine if the child node is active. reply – response to probe msg.

16 Variables maintained at nodes
Binary variable to indicate if the node is currently in election or not. Id of the parent node Binary variable to indicate whether the node has sent its parent acknowledge message. Leader of cluster. List of current neighbors List of nodes from which acknowledge message is being awaited. Computation index

17 Computation index present in election message
it is used to identify an election. syntax: (num, id) num – number of times the node has initiated a election. id – identification number of node.

18 example Z B A G C H Z B A G C H <3,D> <2,B> <2,B>

19 example of algorithm B B C C A A G G Z H Z H

20 continued… B B Ldr(C) C C Ldr(C) Ldr(H) G G Z H Z H

21 continued… B Ldr(H) C G Z H

22 partitioning and merging


Download ppt "Election algorithm Who wins? God knows."

Similar presentations


Ads by Google