Upload
umed
View
46
Download
0
Tags:
Embed Size (px)
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 Presentation
Citation preview
1
Distributed Maintenance of Spanning Tree using Labeled Tree Encoding
Vijay K. GargAnurag Agarwal
PDSL LabUniversity of Texas at Austin
2
Outline
Previous work and System model “Core” and “Non-core” strategy Neville’s code Self-stabilizing spanning tree algorithm Conclusion
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
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
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
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
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
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
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
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
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
12
Neville’s Code: Example
Code = 7768338
8
6 3
47
12
5
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
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
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
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
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
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
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
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
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
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 !
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)
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}
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)
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]]
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)
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
29
Future Work
Remove the restriction on topology and labels
Apply the strategy of core and non-core states to other problems
30
Questions ?
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
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
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
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
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
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 }
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.