yo-yo leader election lijie wang 6982704 1. using spin used to detect design error in applications;...
TRANSCRIPT
![Page 1: YO-YO Leader Election Lijie Wang 6982704 1. Using SPIN Used to detect design error in applications; descriptions of distributed algorithms. 2](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/1.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/11.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/16.jpg)
-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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/18.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/19.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/20.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/21.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/23.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/24.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b376b550346d41a8b51fd/html5/thumbnails/25.jpg)
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