Title: Leader Election in Rings
1Leader Election in Rings
2An Lower Bound
Assume we have algorithms in which
- the maximum identifier is elected leader
- all the nodes must know the leader
- the size of the network is not known
We will prove
at least messages are needed
3open edge
No message is delivered on an open edge
Messages may be kept on the adjacent nodes
4We will show, that there is an execution with
nodes such that
- at least messages are received
where
5Proof by induction
The case
x
y
If then is the leader
6open edge
The case
x
y
If then is the leader
7The case
From induction hypothesis we have
open edge
nodes
messages
8The case
From induction hypothesis we have
open edges
nodes
nodes
messages
9The case
max id
All nodes in should learn about
10The case
Possibility 1
open edge
max id
nodes
Messages are sent
11The case
Possibility 2
max id
nodes
open edge
Messages are sent
12The case
Worst case scenario
open edge?
max id
nodes
Messages are sent
13The case
Worst case scenario
open edge
max id
nodes
At least messages are sent
14The case
Worst case scenario
open edge
max id
Total messages
15The case
Worst case scenario
open edge
max id
Total messages
16The case
Worst case scenario
open edge
max id
Total messages
17We can complete an execution by letting messages
traverse an open edge
open edge
max id
18We can complete an execution by letting messages
traverse an open edge
max id
Total messages
19An Synchronous Algorithm
is known
The node with smallest id is elected leader
There are rounds
- If in round there is a node with id
- this is the new leader
- the algorithm terminates
20Round 1 ( time steps) no message sent
48
9
22
15
nodes
16
33
24
57
21Round 2 ( time steps) no message sent
48
9
22
15
nodes
16
33
24
57
22Round 9
new leader
48
9
22
15
nodes
16
33
24
57
23Round 9 ( time steps) messages sent
new leader
48
9
22
15
nodes
16
33
24
57
24Round 9 ( time steps) messages sent
new leader
48
9
22
15
nodes
16
33
24
57
Algorithm Terminates
25Round 9 ( time steps) messages sent
new leader
48
9
22
15
nodes
16
33
24
57
Total number of messages
26Another Synchronous Algorithm
is not known
The node with smallest id is elected leader
27The algorithm
- Each node injects a message at time 0
- Message with id is transferred
-
- with rate
- Nodes which have seen smaller id
- absord higher id messages
28Time 1
0
0
4
2
5
6
3
1
7
29Time 2
0
4
2
5
0
6
3
1
7
1
30Time 3
0
4
2
5
6
3
0
1
7
1
31Time 4
0
4
2
5
6
3
1
1
7
0
32Time 5
0
4
2
5
6
3
1
0
7
33Time 6
0
4
2
5
6
0
3
1
7
34Time 8
0
0
4
2
5
6
3
1
7
35Time 8
New leader
0
0
4
2
5
6
3
1
7
36Message complexity
Assume leader has id
Total time of algorithm
37Take the node with immediately higher id
Total number of messages
38Take the node with immediately higher id
Total number of messages
39messages
id
lower
higher
40Total number of messages