Presentation is loading. Please wait.

Presentation is loading. Please wait.

A C OMBINATORIAL C HARACTERIZATION OF THE D ISTRIBUTED 1-S OLVABLE T ASKS Ofer Biran, Shlomo Moran, Shmuel Zaks Presented by Ami Paz Technion, Haifa, Israel.

Similar presentations


Presentation on theme: "A C OMBINATORIAL C HARACTERIZATION OF THE D ISTRIBUTED 1-S OLVABLE T ASKS Ofer Biran, Shlomo Moran, Shmuel Zaks Presented by Ami Paz Technion, Haifa, Israel."— Presentation transcript:

1 A C OMBINATORIAL C HARACTERIZATION OF THE D ISTRIBUTED 1-S OLVABLE T ASKS Ofer Biran, Shlomo Moran, Shmuel Zaks Presented by Ami Paz Technion, Haifa, Israel January 2011

2 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

3 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

4 1-S OLVABLE T ASKS – I NFORMAL Asynchronies system. N processors p 1,…, p N. All the processes are connected to one another. There are no limitations on the messages (number or size). But: One process may Crash during the run. Only a fault crash is allowed. Which problems can be solved?

5 E XAMPLE 1: W EAK C ONSENSUS Each processor has initial value of 0 or 1. Should all decide on 0 or 1. 1 1 0 0 1 0 0 0 0 0

6 C ONSENSUS A LG.: T AKE I Algorithm: if someone has 0, all decide 0. 1 1 0

7 C ONSENSUS A LG.: T AKE I Algorithm: if someone has 0, all decide 0. 0 0 0

8 C ONSENSUS A LG.: T AKE II Algorithm: if someone has 0, all decide 0. 1 1

9 C ONSENSUS A LG.: TAKE II Algorithm: if someone has 0, all decide 0. ? ?

10 C ONSENSUS A LG.: T AKE II Algorithm: if someone has 0, all decide 0. Let’s go for 1 He’s dead?

11 C ONSENSUS A LG.: T AKE II Algorithm: if someone has 0, all decide 0. 1 1

12 C ONSENSUS A LG.: T AKE III Algorithm: if someone has 0, all decide 0. 1 1 Zzz…

13 C ONSENSUS A LG.: T AKE III Algorithm: if someone has 0, all decide 0. ? ? Zzz…

14 C ONSENSUS A LG.: T AKE III Algorithm: if someone has 0, all decide 0. Let’s go for 1 He’s dead? Zzz…

15 C ONSENSUS A LG.: T AKE III Algorithm: if someone has 0, all decide 0. 1 1 Zzz… 0 Guys?

16 E XAMPLE 2: O RDER P RESERVING R ENAMING Each processor starts with a rational value. Rename to values 1…10, while preserving order. -3 1 7 1000 20 1 3 4 9 5

17 OPR A LG.: T AKE I -3 12 16

18 OPR A LG.: T AKE I 2 5 8

19 OPR A LG.: T AKE II -2 12

20 OPR A LG.: T AKE II ? ?

21 Never mind He’s dead?

22 OPR A LG.: T AKE II 2 5

23 OPR A LG.: T AKE III -3 12 Zzz… (16)

24 OPR A LG.: T AKE III ? ? Zzz… (16)

25 OPR A LG.: T AKE III Never mind He’s dead? Zzz… (16)

26 Zzz… (16) OPR A LG.: T AKE III 2 5 16 I decide: 7

27 OPR A LG.: T AKE IV -3 12 Zzz… (9)

28 OPR A LG.: T AKE IV 2 5 Zzz… (9) 9 I decide: 3 What if we had to rename to values 1…3? 1...4?

29 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

30 A SYNCHRONOUS D ISTRIBUTED N ETWORK N –processes, N ≥3. Unique identities, Mutually known. Also: may not be mutually known. Massages pass along communication lines: Arrive with no error. Arrive in finite, unbounded and unpredictable time. Complete network. Also: bi-connected network (connected even after removing one process).

31 D ECISION T ASK A mapping of possible inputs to allowable outputs. Let X be a set of input values. Let D be a set of output values. A distributed decision task T is a function: Where X T ⊆ X N is the set of allowable inputs of T. Maps each allowed vector to a set of legal outputs

32 E XAMPLE 1: W EAK C ONSENSUS - R EVISED Each processors has initial value of 0 or 1. Should all decide on 0 or 1. Task formulation: This does not rule out trivial solutions

33 E XAMPLE 1.5: S TRONG C ONSENSUS Each processor has initial value of 0 or 1. Should all decide on 0 or 1. Starting with consensus, should end up with the same value. Task formulation:

34 W HY D O W E C ARE A BOUT C ONSENSUS ? Xor is a consensus task Majority is a consensus task Consensus can be done by leader election. So, impossibility of consensus implies impossibility of leader election. Can leader election be done by consensus?

35 E XAMPLE 2: O RDER P RESERVING R ENAMING - R EVISED Each processors start with a rational value. Rename to values 1… k, while preserving order. Task formulation:

36 P ROTOCOLS AND S OLVABILITY A Protocol α for a given network is a set of N programs, each associated with a processor. A protocol α solves a task T if for any input vector x ∈ X T, it satisfies: 1. All execution are complete. 2. All Execution outputs are legal.

37 F AULTS A processor P is faulty in an execution e if all messages sent by P during e after a certain time are never received. This is called a crash fault. No Byzantine faults here…

38 1-S OLVABILITY A protocol α 1-solves a Task T if: 1. If no processor is faulty, it solves the task. 2. If in an execution a processor is faulty, then all other processors eventually decide. If there exist such a protocol, we say the task T is 1-solvable.

39 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

40 A DJACENCY G RAPH Letfor some set A. Two vectors in A are adjacent if they differ only in one entry. The adjacency graph of S is denoted by G ( S ). (1,2,4)(1,3,4)(2,3,4)(2,3,5)(2,4,5)(1,2,4)(1,3,4)(2,3,4)(2,3,5)(2,4,5) S S G(S)

41 C ONNECTIVITY T HM. [MW] If, for a task T : The input graph is connected A protocol α 1-solves T Then: The output graph of α is connected.

42 C ONNECTIVITY – E XAMPLE 1: W EAK C ONSENSUS α for all P i : decide “1”. Input graph (0,0,1) (0,0,0) (0,1,0) (1,0,0) (0,1,1) (1,0,1) (1,1,0) (1,1,1) Output graph α

43 C ONNECTIVITY – E XAMPLE 2: S TRONG C ONSENSUS Is there a protocol α which 1-solves T ? Input graph (0,0,1) (0,0,0) (0,1,0) (1,0,0) (0,1,1) (1,0,1) (1,1,0) (1,1,1) α Output graph (0,0,0) Input graph is connected, α 1-solves T, But: The output graph of α is not connected! Input graph is connected, α 1-solves T, But: The output graph of α is not connected!

44 T HE C ONNECTIVITY C ONDITION Let T be a decision task. For any set of allowable inputs C, if: G(C) is a connected subgraph of the input graph A protocol α 1-solves T Then: The output graph of α induced by running α on the inputs in C is connected. Easy to deduce from the last Thm.: Define a new task with input C, and the output induced by α and C. Easy to deduce from the last Thm.: Define a new task with input C, and the output induced by α and C.

45 C ONNECTIVITY – E XAMPLE 3: S TRONG C ONSENSUS WITH M AJORITY Can we solve Strong Consensus, if we have a promise that there is a majority ? α Input graph (0,0,0,0) (0,0,0,1) (0,0,1,0) (0,1,0,0) (1,0,0,0) (1,1,1,1) (1,1,1,0) (1,1,0,1) (1,0,1,1) (0,1,1,1) (1,1,1,1) (0,0,0,0) Output graph The connectivity condition does not deny such a protocol

46 I NDUCED T ASK Let α be a protocol that solves a task T. We denote by T α the task induced by α and X T. T α is defined by: X T α = X T The allowable outputs of T α are all the possible outputs of α and X T.

47 E XAMPLE : S TRONG C ONSENSUS Task formulation: T : Protocol α: every P i chooses by majority. T α :

48 P OINTWISE C ONNECTIVITY A task T is pointwise connected if G ( T ( x )) is connected for each x ∈ X T. i.e., the output graph for each input vector is connected. So, from the connectivity condition we get the following corollary: Let α be a protocol that 1-solves a task T, then T α is pointwise connected.

49 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

50 V ECTORS AND E XECUTIONS A partial vector is a vector in which one of its’ entries is not specified. For a vector s =(s 1,…,s N ), We denote: s i =(s 1,…,s i -1,*,s i +1,…,s N ). s is an extension of s i. Let x i be a partial input vector, and d i a partial decision vector of a task T. d i is a covering vector of x i if: For each extension of x i to a legal input vector x, there is an extension of d i to a decision vector d, such that d is a legal decision vector of T on x.

51 I -S LEEPING E XECUTION Let α be a protocol that 1-solves T. An i -sleeping execution of α is an execution in which all messages sent by P i are delayed until all other processors decide. Zzz… We know that such an execution exists, since: 1.α 1-solves T. 2.Sleeping P i is indistinguishable from faulty P i.

52 T HE E XTENDIBILITY C ONDITION Let α be a protocol that 1-solves a task T, than in T α (the task induced by α and X T ) : For each partial input vector, there is a covering vector. Why looking in T α rather then T ? - Because we’re only interested in the possible outputs of α.

53 E XTENDIBILITY – E XAMPLE OPR OPR (Order Preserving Renaming): N = 3 processors. Each processors start with a rational value. Rename to values 1 to k =4, while preserving order. 12 10 13 2 1 4

54 E XTENDIBILITY – E XAMPLE OPR (2) Let v 3 =(10,12,*) be a partial input vector. Can it have a covering vector? Extensions of v 3 and their possible outputs: T ((10,12,13))={ (1,2,3), (1,2,4), (1,3,4), (2,3,4) } T ((10,12,11))={ (1,3,2), (1,4,2), (1,4,3), (2,4,3) } T ((10,12, 9))={ (2,1,3), (2,4,1), (3,4,1), (3,4,2) } Partial output vectors: T ((10,12,13)) 3 ={ (1,2,*), (1,3,*), (2,3,*) } T ((10,12,11)) 3 ={ (1,3,*), (1,4,*), (2,4,*) } T ((10,12, 9)) 3 ={ (2,1,*), (2,4,*), (3,4,*) } Note : T ((10,12,13)) 3 ∩ T ((10,12,11)) 3 ∩ T ((10,12, 9)) 3 = ∅.

55 E XTENDIBILITY – E XAMPLE OPR (3) Let v 3 =(10,12,*) be a partial input vector. Can it have a covering vector? Assuming a protocol α solving OPR. By the extendibility condition, v 3 has a covering vector. This covering vector should be a legal output of T on any extension of v 3. but: T ((10,12,13)) 3 ∩ T ((10,12,11)) 3 ∩ T ((10,12, 9)) 3 = ∅. Hence, no such covering vector, and no such protocol.

56 T HE E XTENDIBILITY C ONDITION (2) Let α be a protocol that 1-solves a task T, than in T α : For each partial input vector x i, there is a covering vector d i. Proof: Let x i = (x 1,…,x i -1,*,x i +1,…,x N ) be a part. input vector. Consider an i -sleeping execution of α on x i. Let d i = (d 1,…,d i -1,*,d i +1,…,d N ) be the partial output vector. We will show that d i is a covering vector for x i.

57 T HE E XTENDIBILITY C ONDITION (3) Proof (cont’d): Let x i = (x 1,…,x i -1,*,x i +1,…,x N ) partial input vector. Let d i = (d 1,…,d i -1,*,d i +1,…,d N ) output vector. d i is a covering vector for x i : Let y = (x 1,…,x i -1,y i,x i +1,…,x N ) be a legal extension of x i. Assume y is the actual input vector for α, and that P i is eventually awakened. So P i finally decides on some d i. d = (d 1,…,d i,…,d N ) is the desired extension of d i.

58 A NCHORS A vector d is an i -anchor of an input vector x if: d is a legal output for T on x. d i is a covering vector for x i. The vector d = (d 1,…,d i,…,d N ) we saw in the last proof was an anchor for y = (x 1,…,x i -1,y i,x i +1,…,x N ).

59 E XTENDIBILITY – E XAMPLE CONT ’ D We saw that OPR with N =3 and k =4 is impossible in the presence of one fault. Actually, we saw that (10,12,13) has no 3-anchor: For each d which is a legal output for T on x, d 3 is not a covering vector for x 3.

60 E XTENDIBILITY – E XAMPLE 2 We saw that OPR with N =3 and k =4 is impossible in the presence of one fault. What about OPR with N =3 and k =5 ? For the partial input vector v 3 =(10,12,*) and for the same extensions of it, partial output vectors are: T ((10,12,13)) 3 ={(1,2,*) (1,3,*) (2,3,*) (1,4,*) (2,4,*) (3,4,*)} T ((10,12,11)) 3 ={(1,3,*) (1,4,*) (2,4,*) (1,5,*) (2,5,*) (3,5,*)} T ((10,12,9)) 3 ={(2,3,*) (2,4,*) (3,4,*) (2,5,*) (3,5,*) (4,5,*)} This time: T ((10,12,13)) 3 ∩ T ((10,12,11)) 3 ∩ T ((10,12, 9)) 3 ={(2,4,*)}

61 E XTENDIBILITY – E XAMPLE 2 CONT ’ D OPR with N =3 and k =5. Actually, for all the extensions of v 3 =(10,12,*), the vector d 3 =(2,4,*) is the only covering vector. In this task, if a processor P i is sleeping, the other processors may eventually decide on 2 and 4. When P i awakes, no matter what is its’ input, it can always extend the partial decision vector by deciding on 1,3 or 5. (2,4,1) is a 3-anchor for (10,12,9). Is this 3-anchor unique? Yes. Is it always unique? No.

62 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

63 T ASK R ESTRICTION A task T’ is a restriction of a task T if: They have the same set of legal inputs For every legal input x : The allowable outputs of T’ on x are also allowable outputs of T on x. Note: for T’ which is a restriction of T, if a protocol α 1-solves T’, it also 1-solves T. In particular, T α, the task induced by T and α, is a restriction of T.

64 N ECESSARY & S UFFICIENT C ONDITIONS FOR 1- SOLVABILITY A task T is 1-solvable if and only if there exists a restriction T’ of T satisfying: a) T’ is pointwise connected b) For each partial input vector x i, there is a covering vector d i in T’ ; Moreover, there is a (centralized) algorithm that on an input x i outputs such a d i.

65 N ECESSITY OF THE C ONDITIONS - P ROOF Let T be a 1-solvable task, and α a protocol which 1-solvaes T. Take T’ to be T α. Then: a) By the corollary of the connectivity condition, T α is pointwise connected. b) By the extendibility condition, T α contains a covering vector for each partial input vector x i. Moreover, for each x i the corresponding d i can be calculated by simulating an i -sleeping run of α.

66 N ECESSITY OF THE C ONDITIONS A N E XAMPLE : OPR OPR with N =3 and k =5. take T’ = T. a) T’ is pointwise connected: Take x =(10,12,13) ∈ X T. Is G ( T’ ( x )) connected? G ( T’ ( x )) (1,3,4) (1,2,3) (1,2,5) (1,2,4) (1,3,5) (1,4,5) (2,3,4) (2,3,5) (2,4,5) (3,4,5) T’ ( x )

67 N ECESSITY OF THE C ONDITIONS A N E XAMPLE : OPR ( CONT ’ D ) OPR with N =3 and k =5. take T’ = T. b) For each partial input vector x i, there is a covering vector d i in T’ : Take x 3 = (10,12,*) ∈ X T. d 3 = (2,4,*) is a covering vector. Moreover, there is a (centralized) algorithm that on an input x i outputs such a d i : Set 2 and 4 to the non-sleeping processors, preserving their initial order.

68 S UFFICIENCY OF THE C ONDITIONS : A U NIVERSAL A LGORITHM Let T be a task which has a restriction T’ satisfying (a) and (b). By (a), G ( T’ ( x )) is connected. Hence, for a given finite set S x of i -anchors of x, there is a finite tree TR x in G ( T’ ( x )) that contains S x. For T’ there are the algorithms: a) TREE ( x, S x ) – for an input x and a finite set S x of i -anchors of x, outputs TR x and a root r x which is an arbitrary vertex in TR x. b) COVER ( x i ) – for a partial input vector x i, outputs a partial covering vector, d i.

69 A U NIVERSAL A LGORITHM We assume all the processors have copies of the algorithms TREE and COVER. The protocol, for P k : First, broadcast your value x k, and try to find out x. When you know all the values but x i, broadcast x i. If you get N -1 partial vectors (including yours) which are equal (to x i ), calculate d i = COVER(x i ). Decide on (d i ) k. Broadcast the decision on d i and halt. As far as P k knows, P i is dead. P k decides on a legal vector, which P i could extend if he wakes up.

70 A U NIVERSAL A LGORITHM ( CONT ’ D ) The protocol, for P k (cnot’d): If you get N -1 partial vectors that are not equal, deduce x from them. Compute N anchors A 1,…,A N. A i is an extension of d i = COVER(x i ) to an i -anchor of x. Compute the tree TR x = TREE ( x, A 1,…,A N ). Decide, with all other processors, on a vertex on TR x. Every P k calculates the same tree This is done by phases: each processor suggests a vertex, and if there is a disagreement, all the processors move towards the root.

71 U NIVERSAL A LGORITHM – R UNNING E XAMPLE 0 0 16 3 3 20 Zzz (16) Zzz (16) 0 0 3 3 20 (0,3,*,20) (2,4,*,6) 2 2 4 4 6 6 Broadcast x k Try to find out x Broadcast x i calculate d i = COVER (x i ) Decide (d i ) k Broadcast the decision Halt

72 U NIVERSAL A LGORITHM – R UNNING E XAMPLE 0 0 16 3 3 20 Zzz (16) Zzz (16) 0 0 3 3 20 (0,3,*,20) Broadcast x k Try to find out x Broadcast x i deduce x Compute TR x 16 (0,3,16,*) (0,3,16,20)

73 U NIVERSAL A LGORITHM – R UNNING E XAMPLE 0 0 16 3 3 20 Compute TR x (1,3,4,6) (2,3,4,6) (2,3,5,6) (2,4,5,6) (2,4,5,7) (1,2,4,6)(2,4,6,7) Decide, with all other processors, on a vertex on TR x. (2,4,*,6) (2,4,5,6) Decide: 5 (2,4,5,6)

74 R OADMAP Informal definition of 1-Solvability Examples Introduction Tasks & Protocols Solvability & 1-Solvability Model & Definitions Connectivity condition Extendibility condition 1-Solvability conditions 1-Solvability iff conditions A universal protocol Necessary & sufficient cond’s

75 A CKNOWLEDGMENT Bug drawing adopted from Maurice Herlihy, “The Art of Multiprocessor Programming”. 1 1 1

76 R EFERENCE O. Biran, S. Moran and S. Zaks, A Combinatorial Characterization of the Distributed Tasks Which Are Solvable in the Presence of One Faulty Processor, J. of Algorithms, 1990.

77


Download ppt "A C OMBINATORIAL C HARACTERIZATION OF THE D ISTRIBUTED 1-S OLVABLE T ASKS Ofer Biran, Shlomo Moran, Shmuel Zaks Presented by Ami Paz Technion, Haifa, Israel."

Similar presentations


Ads by Google