Presentation is loading. Please wait.

Presentation is loading. Please wait.

Self-stabilization. Technique for spontaneous healing after transient failure or perturbation. Non-masking tolerance (Forward error recovery). Guarantees.

Similar presentations


Presentation on theme: "Self-stabilization. Technique for spontaneous healing after transient failure or perturbation. Non-masking tolerance (Forward error recovery). Guarantees."— Presentation transcript:

1 Self-stabilization

2 Technique for spontaneous healing after transient failure or perturbation. Non-masking tolerance (Forward error recovery). Guarantees eventual safety following failures. Feasibility demonstrated by Dijkstra in his Communications of the ACM 1974)

3 Self-stabilizing systems Recover from any initial configuration to a legitimate configuration in a bounded number of steps, as long as the codes are not corrupted. The ability to spontaneously recover from any initial state implies that no initialization is ever required. Such systems can be deployed ad hoc, and are guaranteed to function properly in bounded time

4 Self-stabilizing systems

5 Recall some of the old examples of clock phase synchronization or graph coloring discussed in the class. They were all self-stabilizing. Why? (See the lecture of September 3, pages 8 and 14. The example in page 8 was not self-stabilizing, but the example in page 14 was so.)

6 Example 1: Stabilizing mutual exclusion (Dijkstra 1974) 0 1 62 4 7 53 N-1 Consider a unidirectional ring of processes. In the legal configuration, exactly one token will circulate in the network

7 Stabilizing mutual exclusion 0 {Process 0} do x[0] = x[N-1]  x[0] := x[0] + 1 od {Process j > 0} do x[j] ≠ x[j -1]  x[j] := x[j-1] od The state of process j is x[j]  {0, 1, 2, K-1} (TOKEN = ENABLED GUARD) Hand-execute this first, before reading further. Start the system from an arbitrary initial configuration

8 Stabilizing mutual exclusion 0 {Process 0} do x[0] = x[N-1]  x[0] := x[0] + 1 mod K od {Process j > 0} do x[j] ≠ x[j-1]  x[j] := x[j-1] od The state of process j is x[j]  {0, 1, 2, K-1} (TOKEN = ENABLED GUARD)

9 Stabilizing mutual exclusion Why will it work? Here is a quick summary of the arguments: As long as K > N, there is at least one value x (O ≤ x ≤ K-1) that is NOT the initial state of any nod. Observe the following facts: There is no deadlock Number of tokens never increases (closure) Processes 1..N-1 acquire their states from their left neighbor Eventually process 0 attains the state x Thereafter in N-1 steps, all processes attain the state x. This is a legal configuration (only process 0 has a token) (convergence). So the system stabilizes.

10 Example 2: Stabilizing spanning tree Given a connected graph G = (V,E) and a root r, design an algorithm for maintaining a spanning tree in presence of transient failures that may corrupt the local states of processes. Let n = |V|

11 An ilustration 0 1 2 5 4 3 0 1 2 5 4 3 1 2 3 4 5 The parent pointer of node 2 is corrupted

12 Definitions Each process i has two variables: L(i) = Distance from the root via tree edges P(i) = parent of process i N(i) denotes the neighbors of i By definition L(r) = 0, and P(r) is undefined. Also, 0 ≤ L(i) ≤ n. In a legal state  i  V: i ≠ r:: L(i) ≠ n and L(i) = L(P(i)) +1.

13 The algorithm do (L(i) ≠ n)  (L(i) ≠ L(P(i)) +1)  (L(P(i)) ≠ n)  L(i) :=L(P(i)) + 1 [] (L(i)  n)  (L(P(i)) =n)  L(i):=n [] (L(i) =n)  (  k  N(i):L(k) < n-1)  L(i) :=L(k)+1; P(i):=k od 0 1 2 5 4 3 P(2) is corrupted 0 1 2 3 4 5 The blue labels denote the values of L

14 Proof of stabilization Define an edge from i to P(i) to be well-formed, when L(i) ≠ n, L(P(i) ≠ n and L(i) = L(P(i)) +1. In any configuration, the well-formed edges form a spanning forest. Delete all edges that are not well- formed. Each tree T(k) in the forest is identified by k, the lowest value of L in that tree.

15 Example In the sample graph shown earlier, the original spanning tree is decomposed into two well-formed trees T(0) = {0, 1} T(2) = {2, 3, 4, 5} Let F(k) denote the number of T(k)’s in the forest. Define a tuple F= (F(0), F(1), F(2) …, F(n)). For the sample graph, F = (1, 0, 1, 0, 0, 0) after node 2’s has a transient failure.

16 Skeleton of the proof Minimum F = (1,0,0,0,0,0) {legal configuration} Maximum F = (1, n-1, 0, 0, 0, 0). With each action of the algorithm, F decreases lexicographically. Verify the claim! This proves that eventually F becomes (1,0,0,0,0,0) and the spanning tree stabilizes. What is the time complexity of this algorithm?


Download ppt "Self-stabilization. Technique for spontaneous healing after transient failure or perturbation. Non-masking tolerance (Forward error recovery). Guarantees."

Similar presentations


Ads by Google