distributed maintenance of spanning tree using labeled tree encoding
DESCRIPTION
Distributed Maintenance of Spanning Tree using Labeled Tree Encoding. Vijay K. Garg Anurag Agarwal PDSL Lab University of Texas at Austin. Outline. Previous work and System model “Core” and “Non-core” strategy Neville’s code Self-stabilizing spanning tree algorithm Conclusion. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/1.jpg)
1
Distributed Maintenance of Spanning Tree using Labeled Tree Encoding
Vijay K. GargAnurag Agarwal
PDSL LabUniversity of Texas at Austin
![Page 2: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/2.jpg)
2
Outline
Previous work and System model “Core” and “Non-core” strategy Neville’s code Self-stabilizing spanning tree algorithm Conclusion
![Page 3: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/3.jpg)
3
Motivation
Maintaining spanning trees in distributed fashion Broadcast Convergecast
Self Stabilization [Dijkstra 74] is a powerful fault-tolerance paradigm Design algorithms to tolerate transient data faults Despite faults, algorithm converges to a good
state
![Page 4: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/4.jpg)
4
Previous Work
Many self-stabilizing algorithms for spanning trees Breadth-first spanning tree: [DIM90, AK93] Depth-first spanning tree: [CD94] Minimum spanning tree: [AS97]
Our work makes stronger assumptions but achieves better bounds
![Page 5: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/5.jpg)
5
Comparison with Previous Work Popular model assumes all communication
registers can be read/written in one time step In a completely connected topology, it
amounts to doing O(n) work in one time step Our model assumes processes take one
communication step In our model, the previous algorithms would
have at least O(n) time complexity
![Page 6: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/6.jpg)
6
System Model
System with n nodes labeled 1 … n Nodes form a completely connected graph Topology is static Computation step
Internal computation One communication event
A message is ready to be delivered in one time step
![Page 7: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/7.jpg)
7
“Core and Non-Core” Strategy for Self Stabilization Maintain “Core” and “Non-Core” data
structures Core structures are always correct Non-core structures can be derived from Core
structures
Core Structure Non-Core Structure
Index of permutation
1 … n!
Permutation
![Page 8: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/8.jpg)
8
“Core and Non-Core” strategy for Self Stabilization Strategy: Always assume Non-Core structures got
corrupted and align it with Core structures
Core Structure Non-Core Structure
Index of permutation
2
Permutation
n = 4
1 2 4 3
![Page 9: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/9.jpg)
9
“Core and Non-Core” strategy for Self Stabilization Strategy: Always assume Non-Core structures got
corrupted and align it with Core structures
Core Structure Non-Core Structure
Index of permutation
2
Permutation
n = 4
1 2 4 31 2 3 4
![Page 10: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/10.jpg)
10
“Core and Non-Core” strategy for Self Stabilization Strategy: Always assume Non-Core structures got
corrupted and align it with Core structures
Challenge lies in efficient detection and correction
Core Structure Non-Core Structure
Index of permutation
2
Permutation
n = 4
1 2 4 31 1 2 3 4
![Page 11: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/11.jpg)
11
Neville’s Code [Neville 53]
Similar to Prufer code Each labeled tree with n nodes has one to
one correspondence with a Neville’s code Code is a sequence of n - 2 numbers from
the set {1,…,n} code[i] denotes the ith number in the code
sequence
![Page 12: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/12.jpg)
12
Neville’s Code: Example
Code = 7768338
8
6 3
47
12
5
![Page 13: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/13.jpg)
13
Spanning Tree → Neville’s Code x = least node with degree 1 for i = 1 to n-1
code[i] = parent[x] Delete edge between x and parent[x] if (degree[parent[x]] = 1 && parent[x] ≠ n)
x = parent[x]
else x = least node with degree 1
![Page 14: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/14.jpg)
14
Neville’s Code: Example
code = 7code = 77code = 776code = 7768code = 7768338
8
6 3
47
12
5
x = least node with degree 1 for i = 1 to n-1
code[i] = parent[x] Delete edge between x and
parent[x] if (degree[parent[x]] = 1 &&
parent[x] ≠ n) x = parent[x]
else x = least node with degree 1
x = 1x = 2x = 7x = 6
![Page 15: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/15.jpg)
15
Self Stabilization using Neville’s code Need to maintain “parent” (Non-core) for
each node Auxiliary data structures for efficiency
code[i] : Neville’s code f[i] : Iteration in which node i is chosen as “x” z[i] : last occurrence of node i in code
Node i maintains ith components of data structures
Put constraints on these data structures so that the parent pointers give a valid tree
![Page 16: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/16.jpg)
16
Constraints Three constraint sets provide different
guarantees on the structure of the resulting spanning tree with respect to the tree generated by Neville’s code
Spanning Tree (R) Isomorphic (C) Identical
Efficiency
![Page 17: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/17.jpg)
17
Constraints for R
(R1) For all i: code[f[i]] = parent[i] Follows from the code building procedure
8
6 3
47
12
5
Node 7 was chosen as “x” in iteration 3. So f[7] = 3
code[f[7]] = code[3] = 6 = parent[7]
code = 7768338
![Page 18: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/18.jpg)
18
Constraints for R
Simple restrictions on the range of the structures (R2) For 1 ≤ i ≤ n – 2: 1 ≤ code[i] ≤ n
and code[n – 1] = n (R3) (i) For 1 ≤ i ≤ n – 1: 1 ≤ f[i] ≤ n – 1
(R4) For all i: z[i] = max j such that code[j] = i Definition of z
![Page 19: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/19.jpg)
19
Constraints for R
(R5) For all i: z[i] ≠ 0 f[i] = z[i] + 1 Captures preference given to parent when its
degree becomes one
8
6 3
47
12
5
Node 7 occurs last in code at position 2. Hence, z[7] = 2.Also, f[7] = 3.
f[7] = z[7] + 1
code = 7768338
![Page 20: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/20.jpg)
20
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 2 3
2 3 4
3 0 1
4 0 1
5 2 5
![Page 21: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/21.jpg)
21
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 2 3
2 3 4
3 0 1
4 0 1
5 2 5
(E1) code ?
4
![Page 22: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/22.jpg)
22
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 2 3
2 3 4
3 0 1
4 0 1
5 2 5
(E1)E1
violated !
![Page 23: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/23.jpg)
23
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 0 3
2 3 4
3 0 1
4 0 1
5 2 5
(E1)
![Page 24: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/24.jpg)
24
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 0 3
2 3 4
3 0 1
4 0 1
5 2 5
(E2)
check z ≥ 3
check z ≥ 4
z = max {0,3,4}
![Page 25: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/25.jpg)
25
Maintaining R - Constraint R4 For all i: z[i] = maximum j such that code[j] = i
Split the constraint into two different constraints (E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
2
5
1
3
4
z code
1 4 3
2 3 4
3 0 1
4 0 1
5 2 5
(E2)
![Page 26: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/26.jpg)
26
Maintaining R - Other Constraints Local checks: Can be checked and corrected
without contacting any other node (R2) , (R3) (i), (R5)
(R1) For all i: code[f[i]] = parent[i] Inquire node f[i] to get code[f[i]] and match with
parent[i] On mismatch, reset parent[i] to agree with
code[f[i]]
![Page 27: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/27.jpg)
27
Analysis of Algorithm for maintaining R Theorem: The algorithm requires O(1) time
per node and O(1) messages per node on average in one cycle
Theorem: The algorithm stabilizes in O(d) time, where d is the upper bound on the number of times a node appears in the code With high probability, a random code assignment
would have d = O(log n/ log log n)
![Page 28: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/28.jpg)
28
Conclusion
Self stabilization algorithm for spanning tree Requires O(1) messages per node on average Provides fast stabilization Allows changing root node and systematic
modification of the tree
![Page 29: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/29.jpg)
29
Future Work
Remove the restriction on topology and labels
Apply the strategy of core and non-core states to other problems
![Page 30: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/30.jpg)
30
Questions ?
![Page 31: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/31.jpg)
31
Neville’s code → Spanning Tree x = least node with degree 1 for i = 1 to n-1
parent[x] = code[i] degree[x]--; degree[parent[x]]--; If (degree[parent[x]] == 1)
x = code[i]
else x = least node with degree 1
![Page 32: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/32.jpg)
32
Round vs Bounded Delivery Time Round: Every process takes atleast one step Definition allows one process to send/receive
multiple messages in one time unit
![Page 33: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/33.jpg)
33
Self Stabilization using Neville’s code Need to maintain “parent” for each node Auxiliary data structures for efficient detection
code[i] : Neville’s code f[i] : Iteration in which node i was selected as x z[i] : last occurrence of node i in code
Node i maintains ith components of data structures
Put constraints on these data structures so that the parent pointers give a valid tree
![Page 34: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/34.jpg)
34
Constraints
(R1) For all i: code[f[i]] = parent[i] (R2) 1 <= i <= n-2, 1 <= code[i] <= n
and code[n – 1] = n (R3) (i) 1 <= f[i] <= n – 1
(ii) f is a permutation on [1…n] (R4) For all i: z[i] = max. j such that code[j] = i (R5) For all i: z[i] != 0 => f[i] = z[i] + 1
![Page 35: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/35.jpg)
35
Two sets of constraints
R = { R1, R2, R3(1), R4, R5} Resulting spanning tree may differ from the one
given by code in the leaves Self-stabilization is easier and more efficient
C = { R1, R2, R3, R4, R5} Resulting spanning tree is isomorphic to the one
given by code Self-stabilization is harder and becomes inefficient
![Page 36: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/36.jpg)
36
One interesting constraint
For all i: z[i] = maximum j such that code[j] = I Split the constraint into two different constraints
(E1) z[i] ≠ 0 code[z[i]] = i (E2) code[j] = i z[i] ≥ j
For (E1), node i queries the node z[i] to get code[z[i]] and matches it against iFor (E2),
every node j with code[j] = i sends a message to node i containing jNode i then sets z[i] = max { z[i], j }
![Page 37: Distributed Maintenance of Spanning Tree using Labeled Tree Encoding](https://reader036.vdocuments.us/reader036/viewer/2022062409/568150a7550346895dbeb2a9/html5/thumbnails/37.jpg)
37
References1. Y. Afek, S. Kutten, and M. Yung. Memory-efficient self stabilizing protocols for general networks.In Proc. of the 4th Int’l Workshop on Distributed Algorithms, pages 15–28. Springer-Verlag, 1991.2. S. Aggarwal and S. Kutten. Time optimal self-stabilizing spanning tree algorithm. In Proc.of the 13th Conference on Foundations of Software Technology and Theoretical ComputerScience, pages 400–410, 1993.3. G. Antonoiu and P. Srimani. Distributed self-stabilizing algorithm for minimum spanningtree construction. In European Conference on Parallel Processing, pages 480–487, 1997.4. A. Arora and M. Gouda. Distributed reset. IEEE Transactions on Computers, 43(9):1026–1038, 1994.5. B. Awerbuch, B. Patt-Shamir, and G. Varghese. Self-stabilization by local checking andcorrection (extended abstract). In IEEE Symposium on Foundations of Computer Science,pages 268–277, 1991.6. Z. Collin and S. Dolev. Self-stabilizing depth-first search. Information Processing Letters,49(6):297–301, 1994.8. E. W. Dijkstra. Self-stabilizing systems in spite of distributed control. Communications ofthe ACM, 17:643–644, 1974.9. S. Dolev, A. Israeli, and S. Moran. Self-stabilization of dynamic systems assuming onlyread/write atomicity. In Proc. of the ninth annual ACM symposium on Principles of DistributedComputing, pages 103–117. ACM Press, 1990.10. S. Huang and N. Chen. A self stabilizing algorithm for constructing breadth first trees.Information Processing Letters, 41:109–117, 1992.11. C. Johnen. Memory efficient, self-stabilizing algorithm to construct bfs spanning trees. InProc. of the sixteenth annual ACM symposium on Principles of Distributed Computing, page288. ACM Press, 1997.12. E. H. Neville. The codifying of tree-structure. Proceedings of Cambridge PhilosophicalSociety, 49:381–385, 1953.