25
YO-YO Leader Election Lijie Wang 6982704 1

YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Embed Size (px)

Citation preview

Page 1: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

YO-YO Leader Election

Lijie Wang6982704

1

Page 2: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Using SPIN Used to detect design error in

applications; descriptions of distributed

algorithms.

2

Page 3: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

YO-YO Algorithm Minimum finding

Leader(smallest id node) Consists two parts

Preprocessing Iterations

3

Page 4: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Basic Components Node

Id Neighbor

s

4

Edge Between nodes Voting through

Page 5: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Preprocessing Node

Exchange its id with neighbors

5

Edge Direction

Small->large (id)

Page 6: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

DAG

6

Page 7: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Direction goes down

using different ico

7

Page 8: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Candidates Local minima

->source ->candidate

8

Preprocessing completed

Second part start…

Page 9: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Iteration Remove candidates

Leave the only one

9

Two phases YO- -YO

Page 10: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

10

Source: ⊙->id-> out neighbors Internal: ->all in neighbors-> ⊙->min->out neighbors Sink: ->all in neighbors-> ⊙

All sink done -> YO- end…

Page 11: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

11

-YO start… Sink: ⊙->Y ->min; ⊙-> N->others Internal: ->all out neighbors-> ⊙

Receive at least one N: ⊙->N-> all in neighbors Receive all Y: ⊙->Y->min; ⊙->N->others

Source: all out neighbors -> ⊙

Page 12: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Eliminate candidates

Receive at least one N No longer a candidate

How?...

12

Receive all Y Survives (this

time)

Page 13: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Reverse N-edge Receive at least one N

No longer a candidate Become sink or

internal

13

Modify DAG Flip the link

with N

With reversing Sink and internal not

become candidate

less candidate

Page 14: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Drag down the dead candidates

14

And start over…

Page 15: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

YO- [2]

15

Page 16: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

-YO [2]

16

Page 17: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Flip [2]

17

Page 18: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Termination?

18

Count the only one candidate Become the leader

Pruning

To reduce the message To detect termination

Only left one source

Additional mechanism

Page 19: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Pruning

19

Eliminate leaf

Eliminate redundant route

Page 20: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

20Pruning [1]

Page 21: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

21

Pruning [2]

Page 22: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

22

Pruning more [2]

Page 23: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

23

Pruning [3]

Page 24: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

Complexity

24

Without pruning Each phase: 2 messages each link Number of phase: log (number of sources) Total: 2*m*log(s)

With pruning Though we do not know the exact number

of reduced message in each iteration. Surely, the communication cost will be less

remarkable Total: 2*

Page 25: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2

For the spin result

25

Fail to intall Ispin on the 64-bit system Try to use the Virtual Machine with a 32-

bit system

Ispin result will be show in the final report

THANK YOU