Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb 201654.

Similar presentations


Presentation on theme: "Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb 201654."— Presentation transcript:

1 Fault tolerance and related issues in distributed computing Shmuel Zaks zaks@cs.technion.ac.il GSSI - Feb 201654

2 Part 0: Part 0: An overview Part 1: Part 1: Lower bounds Part 2: Part 2: Computing in spite of faults Part 3: Part 3: Detecting faults Part 4: Part 4: Self-stabilization 55 GSSI - Feb 2016

3 message passing (fifo) asynchronous 9 4 5 8 6 x x x x 56GSSI - Feb 2016 A. Leader election – basic algorithms and upper bounds Leader election = maximum finding

4 Unidirectional ring phases, unique execution 5 2 8 4 1 6 3 7 GSSI - Feb 201657

5 Bidirectional ring 5 2 8 4 1 6 3 7 sense of direction L R L L L L L L L R R R R R R R GSSI - Feb 201658

6 Sense of Direction : For each process p in a bidirectional ring, its left and right neighbors are termed left(p) and right(p) respectively. If right(left(p)) = p for every p, then there is a sense of direction (otherwise – no sense of direction) GSSI - Feb 201659

7 Bidirectional ring 5 2 8 4 1 6 3 7 no sense of direction R R L L L L L L L R R L R R R R GSSI - Feb 2016 60

8 From now: only unidirectional rings 5 2 8 4 1 6 3 7 The first algorithm that comes to mind is … GSSI - Feb 201661

9 LeLann’s algorithm GSSI - Feb 201662 “All processors send and forward all id’s, until everyone sees its id (and all other id’s). The one whose id is the maximum is the leader”

10 state := candidate; send (my_id); receive (nid); while nid ≠ my_id do if nid > my_id then state:=no_leader; send (nid); receive (nid); od; if state=candidate then state:=leader. GSSI - Feb 201663

11 5 2 8 4 1 6 3 7 messages: 64 time: 8 My_id nid 1 5 send (my_id); receive (nid); GSSI - Feb 201664 My_id nid 5

12 Theorem: LeLann’s algorithm terminates, and exactly one processor is in state= leader. Message complexity: O(n 2 ) (worst and average) Time complexity: O(n) GSSI - Feb 201665

13 The first algorithm that comes to mind. GSSI - Feb 201666 Chang and Roberts’ algorithm “All processors send their id’s, and then forward only id’s higher than their own. The processor that receives its own id is the leader”

14 state := candidate; send (my_id); receive (nid); while nid ≠ my_id do if nid > my_id then [ state:=no_leader; send (nid); receive (nid);] od; if state=candidate then state:=leader. GSSI - Feb 201667

15 5 2 8 4 1 6 3 7 messages: 2+1+8+2+1+1+4+1= 20 time: 8 GSSI - Feb 201668

16 Theorem: Chang and Roberts’s algorithm terminates, and exactly one processor is in state= leader. Message complexity: O(n 2 ) (worst) Time complexity: O(n) GSSI - Feb 201669

17 Theorem: The average message complexity of Chang and Roberts’s algorithm is O(n log n). assume all rings equally probably for the proof – assume id’s 1,2,…, n GSSI - Feb 201670

18 GSSI - Feb 201671 k-1 values < i i x P(i,k) = probability that id i makes exactly k steps x > i k=4

19 GSSI - Feb 201672 Avg number of messages: for i=nfor i<n

20 GSSI - Feb 201673

21 Theorem (Pachl, Korach,Rotem): For every algorithm A for maximum finding in asynchronous unidirectional rings, when n is unknown, and every set I of n identities, GSSI - Feb 2016 74 b. Leader election – lower bound on a ring

22 1 3 5 4 ring (4, 1, 3, 5 ) (1, 3, 5, 4 ) (3, 5, 4, 1 ) (5, 4, 1, 3 ) GSSI - Feb 201675

23 messages (4 ) (4,1 ) (4, 1, 3 ) 1 3 5 4 GSSI - Feb 201676

24 Sequence Prefix of a sequence Concatenation of sequences subsequence of if s.t. C(s) = all cyclic permutations of s |C(s)| = length (s) GSSI - Feb 201677

25 { (4, 1, 3, 5 ), (1, 3, 5, 4 ), (3, 5, 4, 1 ), (5, 4, 1, 3 ) } s = (4, 1, 3, 5 ) C(s) = length (s) = 4 (4,1,3) is a prefix of s (1,3) is a subsequence of s 1 3 5 4 GSSI - Feb 201678

26 Lemma: In every execution of a maximum finding algorithm A, at least one processor must see its own value Proof: assume not. Suppose that in a certain ring s processor a decides it is the maximum without getting such message. Recall: same messages in every execution GSSI - Feb 201679

27 Assume that in the ring (3,5,4,1) 5 decides it is the maximum without 5 seeing itself. So, may be (5), (5.4),(5,4,1) were sent, but (5,4,1,3) was not. (4 ) (4,1 ) (4,1,3 ) 1 3 5 4 GSSI - Feb 201680

28 In every execution of a maximum finding algorithm A, at least one processor must see its own value In a ring labeled s, at least one message in C(s) is sent by A (4 ) (4,1 ) (4,1,3 ) 1 3 5 4 (4,1,3,5 ) GSSI - Feb 201681

29 – set of all finite sequences of distinct integers For GSSI - Feb 201682

30 s = (4, 1, 3, 5 ) 1 3 5 4 E={(4,5),(3,5),(5,4,1),(3),(6,2),(5,4) } N(s,E) = 4 N 1 (s,E) = 1 N 2 (s,E) = 2 N 3 (s,E) = 1 N k (s,E) = 0 for k ≥ 4 GSSI - Feb 201683

31 Definition: A setis exhaustive if it has the following two properties:  Prefix property: if then for every prefix s of u.  Cyclic permutation property: GSSI - Feb 201684

32 is exhaustive: Prefix property: if then for every prefix s of u.  Cyclic permutation property: Example: the set GSSI - Feb 201685

33 1 3 5 4 E contains also the following: (4), (4,1),(4,1,3), (1), (3), (5),(5,4),(5,4,1),(5,4,1,3) Q: What is E? A: E is the set of messages sent by the Chang & Roberts’ algorithm! GSSI - Feb 201686

34 Lemma: Let such that is a prefix of and, and let A be a maximum finding algorithm. If in the execution of A on ring a message is sent, then in the execution of A on ring a message is sent. st u u GSSI - Feb 201687

35 Theorem: For every maximum finding algorithm A for unidirectional rings, there exists an exhaustive set E(A), such that, for every ring s, A sends at least N(s,E(A)) messages on s. Proof: Let GSSI - Feb 2016 88 E(A) = { s  D | a message s is sent when A executes on ring s. }

36 1. E(A) is exhaustive 1a. Prefix property GSSI - Feb 2016 89 E(A) = { s  D | a message s is sent when A executes on ring s. }

37 1. E(A) is exhaustive 1b. Cyclic permutation property GSSI - Feb 201690 E(A) = { s  D | a message s is sent when A executes on ring s. }

38 2. At least N(s,E(A)) messages sent by A on s GSSI - Feb 201691 E(A) = { s  D | a message s is sent when A executes on ring s. } End of Proof.

39 GSSI - Feb 201692

40 Theorem: For every maximum finding algorithm A for unidirectional rings, and a set of n identities I, we have: GSSI - Feb 201693

41 GSSI - Feb 201694

42 Lemma: GSSI - Feb 201695

43 1 32 3 21 3 12 2 13 2 31 1 23 GSSI - Feb 201696

44 Theorem: In a unidirectional ring whose size n is unknown, the Chang & Roberts’ algorithm has an optimal average message complexity of GSSI - Feb 2016 97

45 - What if n is known? - What if the network is synchronous? Same lower bound of Ω(n log n) messages applies, under some assumptions. GSSI - Feb 201698

46 Asynchronous network G(V,E) |V| = n processors G is complete : every two processors are connected Distinct ID’s Each processor knows only its ID GSSI - Feb 201699 c. Leader election – lower bound on a clique

47 GSSI - Feb 2016100

48 GSSI - Feb 2016101 Theorem (Korach, Moran, Zaks): The message complexity of the leader election problem on a clique is Ω(n log n).

49 f(n) – maximal number of messages for a clique network of size n Informal proof GSSI - Feb 2016102

50 GSSI - Feb 2016103

51 n n 1 GSSI - Feb 2016104

52 n n 1 f(n) GSSI - Feb 2016105

53 nn 1 f(n) GSSI - Feb 2016106

54 n n 1 O(n) GSSI - Feb 2016107

55 GSSI - Feb 2016108

56 n n 1 1 0 GSSI - Feb 2016109

57 1 1 0 0 0 1 1 0 GSSI - Feb 2016110

58 n n 1 1 0 GSSI - Feb 2016111 xixi yjyj yiyi xjxj  (n 2 ) disjoint squares, one message on each, hence a  (n 2 ) lower bound

59 GSSI - Feb 2016112 d. Lower bound on bit complexity

60 GSSI - Feb 2016113 References Gerard Le Lann, Distributed Systems - Towards a Formal Approach, IFIP 1977. E. Chang and R. Roberts, An improved algorithm for decentralized extrema-finding in circular configurations of processes, CACM, 1979. J. Pachl, E. Korach and D. Rotem, Lower bounds for distributed maximum-finding algorithm, JACM, 1984. E. Korach, S. Moran and S. Zaks, Optimal lower bounds for some distributed algorithms for a complete network of processors, 1987


Download ppt "Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb 201654."

Similar presentations


Ads by Google