Professional Documents
Culture Documents
Continued
An
Assume we have algorithms in which: the maximum identifier is elected leader all the nodes must know the leader the size of the network We will prove: at least
n is not known
1 5
8 2 6
3 7
open edge
No message is delivered on an open edge Messages may be kept on the adjacent nodes
3
We will show, that there is an execution with n nodes such that: there is an open edge at least where
n=2
If
M ( 2) = 1
6
The case
n=2
x
open edge y
If
The case
n>2
n nodes 2
open edge
n messages M 2
8
The case
n>2
n nodes 2
n M 2
open edges
n nodes 2
n M 2
9
messages
The case
n>2
max id
R1
R2
All nodes in
The case
n>2
Possibility 1
max id
open edge
R1
n nodes 2
n 2
The case
n>2
Possibility 2
max id
R1
open edge
n nodes 2
n 2
The case
n>2
Worst case scenario
open edge?
max id
R1
n nodes 2
n 2
The case
n>2
Worst case scenario
max id
open edge
R1
n nodes 2
14
The case
n>2
Worst case scenario
max id
open edge
n M 2
n M 2
n + Mn + n Total messages: M 2 2 4
15
The case
n>2
Worst case scenario
max id
open edge
n M 2
n M 2
n + n Total messages: M ( n) = 2 M 2 4
16
The case
n>2
Worst case scenario
max id
open edge
n M 2
n M 2
Total messages:
M (n) = (n log n)
17
max id
open edge
18
max id
Total messages:
M (n) = (n log n)
19
Synchronous Rings
Asynchronous Ring- delaying messages for arbitrarily long periods Synchronous Model- message delay is fixed Information can be obtained not only by receiving a message but also by not receiving a message in a certain round
20
n is known
The node with smallest id is elected leader
There are rounds: If in round i there is a node with id this is the new leader the algorithm terminates
21
Round 1 (
15
n nodes
16
33 57 24
22
no message sent
9 15
22
n nodes
16
33 57 24
23
n nodes
16
33 57 24
24
Round 9 (
n time steps):
48
n messages sent
new leader 9 15
22
n nodes
16
33 57 24
25
Round 9 (
n time steps):
48
n messages sent
new leader 9 15
22
n nodes
16
33 57 Algorithm Terminates 24
26
Round 9 (
n time steps):
48
n messages sent
new leader 9 15
22
n nodes
16
33 57 24
27
n is not known
The node with smallest id is elected leader
28
The algorithm: Each node injects a message at time 0 Message with id with rate
i is transferred
Time 1 4 5 6 3 7 1
30
Time 2 4 5 0 2
0
6 3 7 1
1
31
Time 3 4 5 6 3 7 1
1
32
0 2
Time 4 4 5 6 3
1
0 2
1
0
33
Time 5 4 5 6 3
0
0 2
1
34
Time 6 4 5
0
0 2
6 3 7 1
35
Time 8
0
4 5
0 2
6 3 7 1
36
Time 8
0
New leader 0 2
4 5
6 3 7 1
37
i n2
i
38
k >i
Total number of messages:
l >k >i
Total number of messages:
n2
n < l 4 2
40
id lower
messages
i
k
n
n/2 n/4
higher
KK
41
n n n + + + L 2n 2 4
Total number of messages:
O ( n)
42