text
stringlengths
2
132k
source
dict
to process 𝑝 𝑖 , belongs to Class Ω if it satisfies the following property: let leader 𝑖 ( ) 𝜏 be the value returned to process 𝑝 𝑖 by function leader 𝑖 ( ) at time τ, then there is a time 𝜏 ′ and some process 𝑝 𝑙 ∈ Correct such that for all 𝜏 ≥ 𝜏 ′ and for all 𝑝 𝑖 ∈ Correct , 𝐷 . 𝑙 𝑒 𝑎 𝑑 𝑒 𝑟 𝑖 ( ) 𝜏 = 𝑝 𝑙 . 4. Reliable FIFO order broadcast (RFLOB) We introduce, in this section, a broadcast primitive called reliable FIFO local order broadcast (RFLOB), used for inter-process communication in system S. This RFLOB primitive, as we will show, does not strengthen the model of system S and it is used in this paper to simplify the consensus algorithm proposed in Section 5. We define the RFLOB primitive for a Byzantine system. Hence, since our degenerative Byzantine failure model is a particular case of Byzantine failures, we can use it in our system S. 4.1. Definition of the RFLOB primitive The RFLOB primitive guarantees that correct processes deliver the same sequence of messages if they were broadcast by the same (correct or not) process, and that messages broadcast by each process 𝑝 𝑘 are delivered by all correct processes in the causal order they were sent by 𝑝 𝑘 . More formally: Definition 2 RFLOB The reliable FIFO local order broadcast (RFLOB) primitive, when invoked by a process 𝑝 𝑖 , has two operations: RFLOB _ broadcast 𝑖 ( ) and RFLOB _ delivered 𝑖 ( ) , which preserve the following five properties: • Validity: A correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) at most once. If RFLOB _ delivered 𝑖 ( 𝑚 )
{ "page_id": null, "source": 7323, "title": "from dpo" }
was due to a correct process 𝑝 𝑘 , then RFLOB _ broadcast 𝑘 ( 𝑚 ) must have been executed previously by 𝑝 𝑘 . • Termination: If a correct process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( 𝑚 ) , then each correct process 𝑝 𝑘 will execute RFLOB _ delivered 𝑘 ( 𝑚 ) . • Agreement: If a correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) first and, later, RFLOB _ delivered 𝑖 ( 𝑚 ′ ) due to the same process 𝑝 𝑘 , then every correct process 𝑝 𝑗 must execute RFLOB _ delivered 𝑗 ( 𝑚 ) first, and RFLOB _ delivered 𝑗 ( 𝑚 ′ ) later. • FIFO Order: If a correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) first and, later, RFLOB _ delivered 𝑖 ( 𝑚 ′ ) both due to the same correct process 𝑝 𝑘 , then 𝑝 𝑘 must have executed RFLOB _ broadcast 𝑘 ( 𝑚 ) first and RFLOB _ broadcast 𝑘 ( 𝑚 ′ ) later. • Local Order: If a correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) first and RFLOB _ broadcast 𝑖 ( 𝑚 ′ ) later, then every correct process 𝑝 𝑗 executes RFLOB _ delivered 𝑗 ( 𝑚 ) first and RFLOB _ delivered 𝑗 ( 𝑚 ′ ) later. Observe that Definition 2 forces all correct processes to deliver the same sequence of messages sent by the same process 𝑝 𝑘 , regardless of whether 𝑝 𝑘 is correct or not (Agreement), but only enforces FIFO order to messages sent by correct processes. Besides, it enforces causal order to every message sent by the same process (Local Order). Observe also that a message cannot
{ "page_id": null, "source": 7323, "title": "from dpo" }
be lost if it was sent by a correct process (Termination), but the RFLOB primitive does not guarantee that a message sent by a faulty process is delivered. The RFLOB primitive in a system with Byzantine failures has been previously defined in the literature , but, to our knowledge, it has not been previously implemented in a system with degenerative Byzantine failures and unknown membership. Following, we present (and prove the correctness of) an implementation of the RFLOB primitive as a useful tool to solve consensus in S. 4.2. The asynchronous Byzantine system B Let B be a system such as S but with the only difference that faulty processes are Byzantine . A process 𝑝 𝑖 is Byzantine if it deviates from its algorithm by executing arbitrary operations whenever it wants. The set of Byzantine processes is denoted by Byz. Note that, unlike the mortal Byzantine processes of S, a Byzantine process in B might never crash. 4.3. Implementation of RFLOB in B Algorithm 𝐴 RFLOB , presented in Fig. 1, works in the following way. Each message m sent using the RFLOB _ broadcast 𝑖 ( 𝑚 ) function is acknowledged by all processes which receive it. When enough processes have acknowledged that message, all of them execute RFLOB _ delivered 𝑖 ( 𝑚 ) . Download: Download high-res image (173KB) Download: Download full-size image Fig. 1. RFLOB primitive in system B (code for process pi). In order to satisfy FIFO and Local Order, Algorithm 𝐴 RFLOB uses the known vector clock technique , (which is and extension of logical clocks ). Thus, each process 𝑝 𝑖 keeps three variables: members 𝑖 (which stores the processes known by process 𝑝 𝑖 ), seq 𝑖 (which stores the number of messages sent by process 𝑝 𝑖 )
{ "page_id": null, "source": 7323, "title": "from dpo" }
and next 𝑖 (which stores the vector clock of process 𝑝 𝑖 ). Since the membership is not known a priori, each time a new process is known, it is included in members 𝑖 and its expected sequence number is added to the vector clock next 𝑖 and set to 1. Note that next 𝑖 is a hash vector indexed by process identifiers. Since membership is unknown, different processes may have different sets of keys. Abusing of notation, in the algorithm, we use next 𝑘 [ 𝑗 ] ∉ next 𝑖 to test, in an easy way, if key j is not a key in next 𝑖 . Algorithm 𝐴 RFLOB is an event-driven algorithm. Events are triggered by the invocation of a primitive or the arrival of messages. When a process 𝑝 𝑖 invokes RFLOB _ broadcast 𝑖 ( 𝑚 ) , it increases its sequence number seq 𝑖 and executes broadcast 𝑖 ( MSG , 𝑚 , seq 𝑖 , next 𝑖 , 𝑖 ) . When messages arrive, they are processed in two steps: first they are processed by task T1 and then by task T2. Thus, the reception of a message may trigger multiple events in a predefined sequence. Each when clause is executed atomically, i.e., two when clauses may not be executed concurrently. Task T1 (Lines 9–13) is executed for every message received to update the known membership and add the new processes (those processes for which there is an entry in the vector clock next 𝑘 that comes in the message but for which there is no entry in the local vector clock next 𝑖 ) to the local vector clock. Each clause in task T2 is asynchronously executed whenever its condition is satisfied. When process 𝑝 𝑖 receives a ( MSG , −
{ "page_id": null, "source": 7323, "title": "from dpo" }
, 𝑠 𝑘 , − , 𝑘 ) message from process 𝑝 𝑘 for the first time, it executes broadcast 𝑖 ( ACK , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) , where m and next 𝑘 are the message and vector clock, respectively, received from process 𝑝 𝑘 (Lines 14–16). When process 𝑝 𝑖 has received a ( ACK , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) message from 𝑛 − 𝑓 different processes, it broadcasts a ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) message (Lines 17–18). When process 𝑝 𝑖 has received 𝑓 + 1 of these AGREE messages from different processes, at least one of them comes from a correct process, so it rebroadcasts them to help reaching a number of 𝑛 − 𝑓 such messages from different processes (Lines 19–20). Finally, when 𝑛 − 𝑓 ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) messages from different processes are received and all messages which must be delivered before m (to satisfy both FIFO order and local order) have already been delivered by process 𝑝 𝑖 (i.e., 𝑠 𝑘 = next 𝑖 [ 𝑘 ] and for all 𝑟 ∈ members 𝑖 , next 𝑘 [ 𝑟 ] ∉ next 𝑘 ∨ next 𝑖 [ 𝑟 ] ≥ next 𝑘 [ 𝑟 ] ), process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) and updates its vector clock accordingly (Lines 21–23). Note that the condition of Line 21 can always be evaluated since every message received has been previously processed by task T1, so if there is an entry for process 𝑝 𝑗 in next 𝑘 , then there is an entry for process 𝑝 𝑗 in next 𝑖
{ "page_id": null, "source": 7323, "title": "from dpo" }
. 4.4. Correctness of algorithm 𝐴 RFLOB Lemma 1 Algorithm 𝐴 RFLOB satisfies the Validity property of the RFLOB primitive when 𝑓 < 𝑛 / 3 . Proof Note first that RFLOB _ delivered 𝑖 ( 𝑚 ) is only executed at Line 22, and it is executed only once for each process 𝑝 𝑘 and sequence number next 𝑖 [ 𝑘 ] , since next 𝑖 [ 𝑘 ] is incremented at Line 23. Recall that communication channels in our system are reliable. Hence, messages cannot be altered during transmission. Thus, if RFLOB _ delivered 𝑖 ( 𝑚 ) is executed by process 𝑝 𝑖 (at Line 22), then 𝑝 𝑖 must have received 𝑛 − 𝑓 ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) messages from different processes. Since 𝑓 < 𝑛 / 3 , more than 𝑛 / 3 came from correct processes. Correct processes may only send these messages at Lines 20 or 18. At Line 20, it must hold that 𝑓 + 1 previous ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) messages have already been received by the process which executes this line. Thus, at least one correct process must have previously sent an ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) message at Line 20 or Line 18. Line 18 can only be executed by a correct process if it has already received 𝑛 − 𝑓 ( ACK , 𝑚 , next 𝑘 , 𝑘 ) messages (Line 17), more than 𝑛 / 3 from correct processes. Since ( ACK , 𝑚 , next 𝑘 , 𝑘 ) messages are only sent by correct processes at Line 16, a ( MSG , 𝑚 , 𝑠 𝑘 , next
{ "page_id": null, "source": 7323, "title": "from dpo" }
𝑘 , 𝑘 ) message must have been previously received by more than 𝑛 / 3 correct processes. Correct processes may only send this message at Line 8 as a consequence of executing RFLOB _ broadcast 𝑘 ( 𝑚 ) . Hence, If RFLOB _ delivered 𝑖 ( 𝑚 ) was due to a correct process 𝑝 𝑘 , then RFLOB _ broadcast 𝑘 ( 𝑚 ) must have been executed previously by 𝑝 𝑘 . Lemma 2 Algorithm 𝐴 RFLOB satisfies the Termination property of the RFLOB primitive when 𝑓 < 𝑛 / 3 . Proof If a correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) (at Line 22), then 𝑝 𝑖 must have received at least 𝑛 − 𝑓 ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) messages from different processes (more than 𝑛 / 3 of them from correct processes). If more than 𝑛 / 3 correct processes sent the ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) message (recall that 𝑓 < 𝑛 / 3 ), then the condition of Line 19 must hold for all correct processes, so all of them will send the ( AGREE , 𝑚 , 𝑠 𝑘 , next 𝑘 , 𝑘 ) message at Line 20. Thus, every correct process will receive at least 𝑛 − 𝑓 such messages (all of them coming from correct processes). Hence, the condition of Line 21 will hold for every correct process and all of them will execute RFLOB _ delivered 𝑖 ( 𝑚 ) . Lemma 3 Algorithm 𝐴 RFLOB satisfies the Agreement property of the RFLOB primitive when 𝑓 < 𝑛 / 3 . Proof Note that a correct process expects messages from other processes in a deterministic
{ "page_id": null, "source": 7323, "title": "from dpo" }
sequence. When process 𝑝 𝑖 receives a message from process 𝑝 𝑘 for the first time, it sets its expected sequence number next 𝑖 [ 𝑘 ] to 1 (see Lines 9–13). Then, each time it delivers a message from 𝑝 𝑘 (at Line 22), it increments its expected sequence number (Line 23). Thus, messages from a process 𝑝 𝑘 are delivered in increasing order of their sequence number. Hence, if a correct process 𝑝 𝑖 executes RFLOB _ delivered 𝑖 ( 𝑚 ) before it executes RFLOB _ delivered 𝑖 ( 𝑚 ′ ) , both due to the same process 𝑝 𝑘 , then the sequence number of m must be smaller than that of 𝑚 ′ . Since all correct processes deliver messages from each correct sending process in increasing order of their sequence number, any other correct process 𝑝 𝑗 must execute RFLOB _ delivered 𝑗 ( 𝑚 ) before RFLOB _ delivered 𝑗 ( 𝑚 ′ ) . Lemma 4 Algorithm 𝐴 RFLOB satisfies the FIFO Order property of the RFLOB primitive when 𝑓 < 𝑛 / 3 . Proof Assume that a correct process 𝑝 𝑖 executes (at Line 22) RFLOB _ delivered 𝑖 ( 𝑚 ) first and RFLOB _ delivered 𝑖 ( 𝑚 ′ ) later, both due to the same correct process 𝑝 𝑘 . Then, the sequence number associated with m must be smaller than that of 𝑚 ′ (recall that messages from the same process 𝑝 𝑘 are delivered in increasing order of the sequence number). The sequence number is assigned when the message is broadcast, i.e. the sender sets the sequence number (Lines 6–8) and, if it is a correct process, these sequence numbers are assigned in increasing order. Hence, 𝑝 𝑘 must have executed RFLOB _ broadcast
{ "page_id": null, "source": 7323, "title": "from dpo" }
𝑖 ( 𝑚 ) before RFLOB _ broadcast 𝑖 ( 𝑚 ′ ) . Lemma 5 Algorithm 𝐴 RFLOB satisfies the Local Order property of the RFLOB primitive when 𝑓 𝑠 𝑘 when 𝑝 𝑖 executed broadcast 𝑖 ( MSG , 𝑚 ′ , seq 𝑖 , next 𝑖 , 𝑖 ) and either next 𝑘 did not contain an entry for 𝑝 𝑖 , or next 𝑘 [ 𝑖 ] ≤ next 𝑖 [ 𝑖 ] . Consider now the behavior 𝑝 𝑗 . When 𝑝 𝑗 executes RFLOB _ delivered 𝑗 ( 𝑚 ′ ) , it must have received 𝑛 − 𝑓 ( AGREE , 𝑚 ′ , 𝑠 𝑖 , next 𝑖 , 𝑖 ) messages from different processes and, for each process r for which there is an entry in next 𝑖 , next 𝑖 [ 𝑟 ] ≤ next 𝑗 [ 𝑟 ] (as
{ "page_id": null, "source": 7323, "title": "from dpo" }
required by Line 21). However, since process 𝑝 𝑗 has not executed RFLOB _ delivered 𝑗 ( 𝑚 ) yet, next 𝑗 [ 𝑘 ] must be less or equal than 𝑠 𝑘 . Hence, next 𝑗 [ 𝑘 ] < next 𝑖 [ 𝑘 ] and we reach a contradiction, so 𝑝 𝑗 must execute RFLOB _ delivered 𝑗 ( 𝑚 ) before executing RFLOB _ delivered 𝑗 ( 𝑚 ′ ) . Theorem 1 Algorithm 𝐴 RFLOB correctly implements the RFLOB primitive when 𝑓 < 𝑛 / 3 . Proof Direct from Lemma 1, Lemma 2, Lemma 3, Lemma 4, Lemma 5. 5. Consensus in S with Ω and RFLOB As we have previously mentioned, Consensus cannot be solved in asynchronous systems when processes can crash . To circumvent this impossibility result, we enrich the asynchronous system S with a failure detector D of Class Ω. By definition, D can be whatever algorithm that preserves the properties of Definition 1. We denote by 𝑆 [ Ω ] the asynchronous system S empowered with any failure detector D of the Ω failure detector class. As we have also mentioned earlier, for the sake of simplicity, in the algorithm proposed to solve consensus in 𝑆 [ Ω ] , inter-process communication will be realized using the RFLOB primitive. 5.1. Definition of Consensus There are several definitions of Consensus in systems where processes can have a Byzantine behavior (i.e., when there are processes in the system that can behave arbitrarily). From all of them, we consider in this paper one of the most common . In this type of consensus, each correct process initially proposes a value and, eventually, all correct processes decide the same value. More formally, Definition 3 Consensus Each correct process proposes a value, and the decision taken
{ "page_id": null, "source": 7323, "title": "from dpo" }
by each correct process must preserve the following three properties: • Validity The value v must be decided by each correct process when all correct processes propose the same value v. • Termination Every correct process eventually decides a value. • Agreement All correct processes decide the same value. The value proposed by a correct process can be whatever. Then, the set of proposed values can have an arbitrary size. This version of Consensus is also called multi-valued . Observe that a mortal Byzantine process cannot be forced to propose a value because it can avoid to make the proposal on purpose, due to the fact that it can behave arbitrarily. 5.2. Implementing Consensus in 𝑆 [ Ω ] with RFLOB In Fig. 2, we propose Algorithm 𝐴 𝐶 to solve Consensus in 𝑆 [ Ω ] (the asynchronous system S enriched with the failure detector Ω). Note that the processes in S know the size n of the system but they do not know the membership. The failure model of S includes processes that, when they start failing, they degrade and eventually will make failures forever (by crashing or omitting communication operations permanently), and the maximum number of faulty processes in S is less than one third, i.e. | Faulty | = 𝑓 < 𝑛 / 3 . Download: Download high-res image (255KB) Download: Download full-size image Fig. 2. Algorithm 𝐴 𝐶 for solving Consensus in S[Ω], i.e., in an asynchronous system enriched with a failure detector of Class Ω, with unknown membership, degenerative Byzantine failures, and where f < n/3 (code of pi). 5.2.1. Description of the Consensus Algorithm 𝐴 𝐶 Algorithm 𝐴 𝐶 , shown in Fig. 2, is implemented by function propose( 𝑣 𝑖 ) which is executed by each process 𝑝 𝑖 . This function
{ "page_id": null, "source": 7323, "title": "from dpo" }
uses the following three local variables: 𝑟 𝑖 to store the current round of Task T1, est 𝑖 to store the value to be proposed by process 𝑝 𝑖 at round 𝑟 𝑖 and decided 𝑖 to know if this process 𝑝 𝑖 has already diffused its wish to take a decision. Function 𝐷 . leader 𝑖 ( ) is used by process 𝑝 𝑖 to invoke the failure detector D of Class Ω to get its leader process in round 𝑟 𝑖 . The algorithm runs two different tasks: T1 and T2. Task T1 is run iteratively in asynchronous rounds until process 𝑝 𝑖 is able to take a decision, while T2 is an event-driven task activated by the reception of enough ( DEC , 𝑣 ) messages to make a decision (Line 27). Once process 𝑝 𝑖 makes a decision v in task T2 (Line 29), it never changes this decided value v. Rounds start at 0 and est 𝑖 is set to 𝑝 𝑖 's proposal 𝑣 𝑖 (Line 1). In each round, process 𝑝 𝑖 sends its proposal in 𝑒 𝑠 𝑡 𝑖 to all the processes in the system (Line 6) and waits until proposals from 𝑛 − 𝑓 different processes are delivered to this process (Line 7). The current estimation est 𝑖 is set to the most common value received at Line 7. In case of a tie, a value is chosen by all correct processes in a deterministic way among all the values with the greatest cardinality. Then it is diffused at Line 10 with the trace which proves that est 𝑖 was indeed the most common value found. Then it waits, at Line 11, for the BEST message from the leader process. Messages with invalid traces are discarded to avoid being cheated
{ "page_id": null, "source": 7323, "title": "from dpo" }
by Byzantine processes. Note also that, eventually, a correct process will be chosen as the leader and all messages RFLOB_broadcast by correct processes are eventually RFLOB_delivered by every correct process, so a correct process will eventually stop waiting at Line 11. During the COMMIT phase, processes RFLOB_broadcast the estimations they got from their leader processes (Line 12) and wait until 𝑛 − 𝑓 COMMIT messages from different processes have been RFLOB_delivered (at Line 13). In case 𝑝 𝑖 has already diffused its wish to take a decision (Line 19), it will not change it (i.e., 𝑒 𝑠 𝑡 𝑖 will never be changed again). So, process 𝑝 𝑖 proceeds directly to the next round. In case 𝑝 𝑖 has not diffused its wish to take a decision yet (i.e., 𝑝 𝑖 has not executed Line 19 yet), it tests if there is a value which has been committed by 𝑛 − 𝑓 processes. In such a case, a majority of the correct processes must have chosen that value as best, so 𝑝 𝑖 diffuses its wish to make a decision on that value and broadcasts it (Lines 16–19). In case there is a value v that has been chosen as best by a majority of the 𝑛 − 𝑓 processes, that value v is adopted for next round (Lines 21–22). Finally, if 𝑓 + 1 different processes inform process 𝑝 𝑖 of their wish to take a decision v (Line 27), then 𝑝 𝑖 stops task T1 (Line 28) and decides v (Line 29). Since there are at most f mortal Byzantine processes, it is guaranteed that at least one correct process has broadcast its wish of taking this decision at Line 19. 5.2.2. Correctness of 𝐴 𝐶 First we prove some basic remarks that will help proving that Algorithm
{ "page_id": null, "source": 7323, "title": "from dpo" }
𝐴 𝐶 is valid to solve Consensus. Remark 1 At each round r, all correct processes receive the same sets of ( PROP , 𝑟 , − , − ) and ( COMMIT , 𝑟 , − ) messages, although each of them might consider a different subset at Lines 7 and 13 respectively. Proof At each round r, each correct process sends one ( PROP , 𝑟 , − , − ) / ( COMMIT , 𝑟 , − ) message, and, from the Termination property of RFLOB (see Definition 2), all these messages are received by all correct processes. From the Agreement property of RFLOB, messages sent by the same (correct or not) process 𝑝 𝑘 are received in the same order by each correct process 𝑝 𝑖 . Note that only mortal Byzantine processes may send more than one ( PROP , 𝑟 , − , − ) / ( COMMIT , 𝑟 , − ) message even with different values. If this happens, only the first one received will be processed by each correct process 𝑝 𝑖 at Lines 7 and 13. Hence, 𝑝 𝑖 will never pick up a ( PROP , 𝑟 , 𝑣 ′ , 𝑘 ) / ( COMMIT , 𝑟 , 𝑒 ′ ) message if a previous ( PROP , 𝑟 , 𝑣 , 𝑘 ) / ( COMMIT , 𝑟 , 𝑒 ) message has been received from the same process 𝑝 𝑘 . Therefore, at each round r, all correct processes receive the same sets of ( PROP , 𝑟 , − , 𝑝 𝑘 ) and ( COMMIT , 𝑟 , − ) messages. Note that two correct processes might consider different sets of messages at Lines 7 or 13 since a process might receive up to
{ "page_id": null, "source": 7323, "title": "from dpo" }
n messages per round and phase, but only 𝑛 − 𝑓 messages are considered by the correct processes at Lines 7 and 13 respectively. Corollary 1 Among any two correct processes, the sets of messages they consider at Lines 7 and 13 have at least 𝑛 − 2 𝑓 common messages. Proof From Remark 1, all correct processes receive the same set of messages at the same round. Since they may receive up to n messages and they only consider 𝑛 − 𝑓 of them, the worst case arises when at most f messages not considered by a process are considered by another process at the expense of other f messages. Hence, the two subsets must have at least 𝑛 − 2 𝑓 common messages. Corollary 2 The sets of messages considered by two correct processes at Lines 7 and 13 at the same round may only differ in up to 2f messages. Proof Direct from Remark 1 and Corollary 1. Remark 2 The consistency of a ( BEST , 𝑟 , est , trace ) message can be verified by every correct process. Proof From the definition of the RFLOB primitive, by the time a correct process delivers a ( BEST , 𝑟 , est , trace ) message, it must have delivered the PROP messages whose content is present in trace, prior to the reception of the BEST message. If a correct process has not delivered those PROP messages (or the values are not the same), then it can discard the BEST message for having a fake trace. Remark 3 If, at round r, all correct processes have the same estimation est, they do not change that estimation. Proof If all ( 𝑛 − 𝑓 ) correct processes have the same estimation est at round r, then all
{ "page_id": null, "source": 7323, "title": "from dpo" }
of them propose that estimation in Line 6. Since there are at most f estimations which differ from est (those of the faulty processes), all of them will choose est as their best value (at Line 8) and diffuse it at Line 10. From Remark 2, BEST messages from Byzantine processes may be validated by every correct process, and may be discarded for inconsistency. Hence, only BEST messages whose estimation is est are accepted by correct processes and all of them will broadcast a ( COMMIT , 𝑟 , est ) at Line 12, so all of them will deliver at least 𝑛 − 2 𝑓 such messages. Thus, the assignment at Line 22 will keep the previous value of est 𝑖 . Remark 4 Let 𝑣 ≠ 𝑣 ′ . If a correct process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) in Line 19 at round r, then no other correct process 𝑝 𝑗 may execute RFLOB _ broadcast 𝑗 ( DEC , 𝑣 ′ ) in Line 19 at the same round r. Proof By the way of contradiction, assume that 𝑣 ≠ 𝑣 ′ and, at round r, process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) in Line 19 while process 𝑝 𝑗 executes RFLOB _ broadcast 𝑗 ( DEC , 𝑣 ′ ) in Line 19. If 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) , then it must have considered 𝑛 − 𝑓 ( COMMIT , 𝑟 , 𝑣 ) messages at Line 13. On the contrary, if 𝑝 𝑗 executes RFLOB _ broadcast 𝑗 ( DEC , 𝑣 ′ ) , then it must have considered 𝑛 − 𝑓 ( COMMIT , 𝑟 , 𝑣 ′ ) messages at Line
{ "page_id": null, "source": 7323, "title": "from dpo" }
13. From Corollary 2, the sets of messages considered by processes 𝑝 𝑖 and 𝑝 𝑗 at Line 13 may only differ in up to 2f messages. However, since 𝑛 − 𝑓 > 2 𝑓 , this contradicts the initial hypothesis, and, hence, we reach a contradiction. Remark 5 If, at round r, a process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) at Line 19, then every correct process detects at least 𝑛 − 2 𝑓 ( COMMIT , 𝑟 , 𝑣 ) messages with the same value v and sets its estimation to v. Proof If a process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) at Line 19 at round r, then it must have detected at least 𝑛 − 𝑓 ( COMMIT , 𝑟 , 𝑣 ) messages with the same value v at Line 13 and, from Corollary 1, every other correct process must have at least 𝑛 − 2 𝑓 common messages. Hence, any other correct process 𝑝 𝑗 must detect at least 𝑛 − 2 𝑓 ( COMMIT , 𝑟 , 𝑣 ) messages, and will set its estimation to v at Line 22. Remark 6 Eventually, all faulty processes stop sending messages. Proof In the case of mortal Byzantine processes, they eventually crash, so they stop sending messages. In the case of mute processes, they eventually are unable to send messages. Finally, in the case of a deaf process, it will eventually be unable to complete the wait sentences of Lines 7, 11 or 13. Thus, it will also stop sending messages because it will get blocked waiting forever to receive messages at Lines 7, 11 or 13. Lemma 6 Validity: The value v must be decided by each correct process when all correct
{ "page_id": null, "source": 7323, "title": "from dpo" }
processes propose the same value v. Proof If all correct processes propose the same value v, then, from Remark 3, they will not change it. If all the faulty processes store other values (either the same or different) than v, then it is possible that the condition of Line 16 would not hold until all the faulty processes either crash or become mute but, from Remark 6, eventually, all faulty processes stop sending messages. When, no faulty process is able to send messages, the condition of Line 16 will hold for all correct process. When that happens, all of them send the corresponding ( DEC , 𝑣 ) message, and all of them receive at least 𝑓 + 1 such messages at Line 27. Hence, they will decide v (Line 29). Lemma 7 Agreement: All correct processes decide the same value. Proof By the way of contradiction, let 𝑣 ≠ 𝑣 ′ and assume that two correct processes 𝑝 𝑖 and 𝑝 𝑗 execute RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) and RFLOB _ broadcast 𝑗 ( DEC , 𝑣 ′ ) respectively at Line 19. From Remark 4, that cannot happen at the same round. Then, assume, without loss of generality, that 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) at round r and 𝑝 𝑗 executes RFLOB _ broadcast 𝑗 ( DEC , 𝑣 ′ ) at round 𝑟 ′ , 𝑟 ′ > 𝑟 . However, from Remark 5, if a process 𝑝 𝑖 executes RFLOB _ broadcast 𝑖 ( DEC , 𝑣 ) at Line 19, then every correct process sets its estimation to v. Then, all correct processes will propose v in the following round and, from Lemma 6, all correct processes will eventually decide v, what contradicts the
{ "page_id": null, "source": 7323, "title": "from dpo" }
initial assumption. Thus, it is impossible that two correct processes decide different values. Lemma 8 Termination: Every correct process eventually has to decide a value. Proof Note first that every wait sentence in the algorithm of Fig. 2 ends in a finite time since there are 𝑛 − 𝑓 correct processes and, from the definition of Ω, 𝐷 . leader 𝑖 ( ) eventually returns the same correct process to every correct process 𝑝 𝑖 . Hence, at some round r, all correct processes get the same estimation v in Line 11. Then, all of them broadcast COMMIT messages with estimation v in Line 12. Thus, even if Byzantine processes broadcast COMMIT messages with different estimations in Line 12, every correct process will get at least 𝑛 − 2 𝑓 COMMIT messages with estimation v in Line 13. If a correct process gets 𝑛 − 𝑓 such messages, it will assume that estimation v for the following round at Line 17. Otherwise, it will get at least 𝑛 − 2 𝑓 such messages and it will assume that estimation at Line 22. Then, two cases arise: first, if at least 𝑓 + 1 processes execute Line 19, then all correct processes will eventually satisfy the condition of Line 27 and will decide v at Line 29; second, since all correct processes have the same estimation for the following round, then, from Lemma 6, all correct processes will eventually decide v. Theorem 2 The algorithm 𝐴 𝐶 of Fig. 2 solves Consensus in 𝑆 [ 𝛺 ] . Proof From Lemma 6, Lemma 7 and Lemma 8, validity, agreement and termination properties are satisfied. Therefore, from Definition 3, Algorithm 𝐴 𝐶 solves consensus. 6. On the implementability of Ω in a system with degenerative Byzantine failures The aim of this section
{ "page_id": null, "source": 7323, "title": "from dpo" }
is to find weak conditions to implement Ω. No failure detector can be implemented in asynchronous systems under the (benign or not) crash failure model . Thus, we need to include synchronization assumptions in the system S in order to make the implementation of a failure detector (of Class Ω) possible. We first consider a traditional synchronous system 𝑆 𝑠 where the membership is known and there are no mortal Byzantine processes. Then, we study in Section 6.1 the minimum number of different types of links in 𝑆 𝑠 necessary for a failure detector of Class Ω to be implementable. Due to its wide use in the literature , , , , , we consider the system 𝑆 𝑠 focusing on two types of links: eventually-timely and lossy-asynchronous. Later, we present in Section 6.2 an implementation of a failure detector of Class Ω fulfilling the minimal condition achieved in Section 6.1, in a system 𝑆 𝑝 with degenerative Byzantine failures as in S, where up to n processes can be faulty, with partial synchrony, and where the membership is unknown. 6.1. Minimal conditions on the links In this section we prove that an Ω failure detector cannot be implemented in 𝑆 𝑠 if: a) there is not a path of eventually-timely links between some correct process 𝑝 𝑙 and the other correct processes, and b) there is not a path of eventually-timely links between some other correct process and this process 𝑝 𝑙 . This impossibility holds even if there are not any mortal Byzantine processes and the membership is known. 6.1.1. The synchronous system 𝑆 𝑠 Let 𝑆 𝑠 be a system such as S but with the following differences. To add generality for the impossibility result, 𝑆 𝑠 is synchronous , that is, the maximum time needed by
{ "page_id": null, "source": 7323, "title": "from dpo" }
each process 𝑝 𝑖 in 𝑆 𝑠 to execute a step is bounded and known by every process, and the time needed to receive a sent message is bounded and also known. We also assume that the clocks of all processes are synchronized. We assume that, in system 𝑆 𝑠 , there may be any number of faulty processes (i.e., 𝑓 ≤ 𝑛 ), and there are not any mortal Byzantine processes. Regarding membership in 𝑆 𝑠 , each process 𝑝 𝑖 initially knows the identity of all the processes in Π and, hence, 𝑝 𝑖 also knows the size n of the system. 𝑆 𝑠 has two types of links: eventually-timely and lossy-asynchronous . In eventually-timely links, there is an unknown bound Δ on message delays and an unknown (system-wide) global stabilization time T such that, if a message is sent through any of these links at a time 𝑡 ≥ 𝑇 , then this message is received by time 𝑡 + Δ . In lossy-asynchronous links, messages can be lost or arbitrarily delayed. Every message sent through a lossy-asynchronous link may be lost, but every message that is not lost is delivered in a finite but unknown time. Let 𝐺 ( 𝑋 ) be the directed graph obtained from 𝑆 𝑠 with the vertex set formed by the processes in X and the set of eventually-timely links that connect processes of X as the arc set. For example, 𝐺 ( Correct ) is the directed graph from 𝑆 𝑠 with the vertex set formed by Correct and the set of eventually-timely links that connect processes of Correct as the arc set. Then, 𝑆 𝑠 must preserve the following property for a failure detector of Class Ω to be implementable in such system. Property 1 There is a process
{ "page_id": null, "source": 7323, "title": "from dpo" }
𝑝 𝑙 ∈ Correct such that: a) There is a path in 𝐺 ( Correct ) from 𝑝 𝑙 to every process 𝑝 𝑐 ∈ Correct (i.e. 𝑝 𝑙 can reach every process in Correct). b) There exists a process 𝑝 𝑘 ∈ Correct , 𝑝 𝑘 ≠ 𝑝 𝑙 , such that there is a path in 𝐺 ( Correct ) from 𝑝 𝑘 to 𝑝 𝑙 (i.e. there is a process in Correct which can reach 𝑝 𝑙 ). The following lemma shows the necessity condition of Part a) of Property 1. It is an adaptation of Theorem 1 in . Lemma 9 There is no algorithm 𝐴 that implements a failure detector D of Class Ω in system 𝑆 𝑠 without preserving that there is a process 𝑝 𝑙 ∈ Correct such that there is a path in 𝐺 ( Correct ) from 𝑝 𝑙 to every process 𝑝 𝑐 ∈ Correct . Proof By the way of contradiction, let us assume that there is an algorithm 𝐴 that implements a failure detector D of Class Ω in system 𝑆 𝑠 without preserving that there is a process 𝑝 𝑙 ∈ Correct such that there is a path in 𝐺 ( Correct ) from 𝑝 𝑙 to every process 𝑝 𝑐 ∈ Correct (i.e. 𝑝 𝑙 can reach every process in Correct). Thus no correct process is able to reach every correct process. Let us also assume an execution E of 𝐴 in which all the messages sent through lossy-asynchronous links are lost. From Definition 1 of Ω, there is a correct process 𝑝 𝑙 and a time 𝜏 ′ such that, for all 𝜏 ≥ 𝜏 ′ , for each correct process 𝑝 𝑐 , 𝐷 . leader 𝑐 𝜏 ( ) returns 𝑝 𝑙 permanently.
{ "page_id": null, "source": 7323, "title": "from dpo" }
Let U be the set of correct processes that cannot be reached from 𝑝 𝑙 in 𝐺 ( Correct ) . Recall that, from the initial hypothesis, this set is not empty. Let us consider now another execution 𝐸 ′ of 𝐴 analogous to E except that process 𝑝 𝑙 is a non-correct process (i.e., it can be a deaf, mute, autistic or crashed process). Note that no process in U can possibly distinguish E from 𝐸 ′ since they do not receive messages from 𝑝 𝑙 nor from any other process in Correct ∖ 𝑈 . Hence, every process in U can behave exactly as in E and, for each correct process 𝑝 𝑢 ∈ 𝑈 , 𝐷 . leader 𝑢 𝜏 ( ) returns 𝑝 𝑙 permanently for all 𝜏 ≥ 𝜏 ′ , what violates Definition 1 since 𝑝 𝑙 is a non-correct process, and we reach a contradiction. The following lemma shows that, if a process 𝑝 𝑙 is the leader of the failure detector D implemented in 𝑆 𝑠 , then there must be a path of eventually-timely links from 𝑝 𝑙 to every correct process of 𝑆 𝑠 . Lemma 10 Let D be a failure detector of Class Ω. If there is a time 𝜏 ′ such that, for all 𝜏 ≥ 𝜏 ′ , 𝐷 . leader 𝑖 𝜏 ( ) = 𝑝 𝑙 for every process 𝑝 𝑖 ∈ Correct , then there must be a path in 𝐺 ( Correct ) from 𝑝 𝑙 to every other correct process (i.e. 𝑝 𝑙 must be able to reach every correct process). Proof By the way of contradiction, assume that there is an execution E of a failure detector D of Class Ω in which there is a time 𝜏 ′ such
{ "page_id": null, "source": 7323, "title": "from dpo" }
that for all 𝜏 ≥ 𝜏 ′ 𝐷 . leader 𝑖 𝜏 ( ) = 𝑝 𝑙 for every correct process 𝑝 𝑖 , but 𝑝 𝑙 is not able to reach any process in 𝑈 ⊆ Correct in 𝐺 ( Correct ) . Note that, from the initial assumption, 𝑈 ≠ ∅ . Let us also assume that, in E, all the messages sent through lossy-asynchronous links are lost. Let us consider now another execution 𝐸 ′ of D analogous to E except that process 𝑝 𝑙 is a non-correct process (i.e., it can be a deaf, mute, autistic or crashed process). Note that no process in U can possibly distinguish E from 𝐸 ′ since they do not receive messages from 𝑝 𝑥 nor from any other process in Correct ∖ 𝑈 . Hence, every process in U can behave exactly as in E and, for each correct process 𝑝 𝑢 ∈ 𝑈 , 𝐷 . leader 𝑢 𝜏 ( ) returns 𝑝 𝑙 for all 𝜏 ≥ 𝜏 ′ , what violates Definition 1 since 𝑝 𝑙 is a non-correct process, and we reach a contradiction. The following lemma shows the necessity of Part b) of Property 1. Lemma 11 There is no algorithm 𝐴 that implements a failure detector D of Class Ω in system 𝑆 𝑠 without preserving that there exists a process 𝑝 𝑘 ∈ Correct , such that there is a path in 𝐺 ( Correct ) from 𝑝 𝑘 to another correct process 𝑝 𝑙 from which there is a path in 𝐺 ( Correct ) to every correct process. Proof Let us assume, by the way of contradiction, that there is an execution E of an algorithm 𝐴 that implements a failure detector D of Class Ω in system 𝑆 𝑠
{ "page_id": null, "source": 7323, "title": "from dpo" }
not preserving that there is a correct process 𝑝 𝑘 which can reach another process 𝑝 𝑙 which can reach every correct process. Let us also assume that, in E, all the messages sent through lossy-asynchronous links are lost. Since 𝐴 implements a failure detector of Class Ω, then from Definition 1, there is a process 𝑝 𝑙 and a time 𝜏 ′ such that for all 𝜏 ≥ 𝜏 ′ 𝐷 . leader 𝑖 𝜏 ( ) = 𝑝 𝑙 for every correct process 𝑝 𝑖 . Besides, from the initial assumption, either 𝑝 𝑙 is not able to reach every other correct process, or no other correct process can reach 𝑝 𝑙 . However, from Lemma 10, there must be a path in 𝐺 ( Correct ) from 𝑝 𝑙 to every correct process, so there is nopath in 𝐺 ( Correct ) from any correct process to 𝑝 𝑙 . Let us consider now another execution 𝐸 ′ of D analogous to E except that process 𝑝 𝑙 is a deaf process. Note that 𝑝 𝑙 can only be sure that it is not a deaf process if it eventually receives messages permanently from some process. Since there is no correct process that is able to reach process 𝑝 𝑙 , then it does not have any possibility of distinguishing E from 𝐸 ′ , since process 𝑝 𝑙 does not receive messages permanently. Note also that all processes in Correct can behave exactly as in E, and they cannot distinguish E from 𝐸 ′ since process 𝑝 𝑙 sends them the same messages in both executions. Hence, for all 𝜏 ≥ 𝜏 ′ , 𝐷 . leader 𝑖 𝜏 ( ) = 𝑝 𝑙 for every correct process 𝑝 𝑖 . Since 𝑝 𝑙 is a
{ "page_id": null, "source": 7323, "title": "from dpo" }
deaf process, this violates Definition 1, and we reach a contradiction. Theorem 3 There is no algorithm 𝐴 that implements a failure detector D of Class Ω in a system 𝑆 𝑠 without preserving Property 1. Proof Direct from Lemma 9 and Lemma 11. 6.2. Implementing Ω in 𝑆 𝑝 We present in this section an algorithm (called 𝐴 Ω ) which implements a failure detector of Class Ω fulfilling weak assumptions with respect to the number of faulty processes, synchrony, knowledge of membership and the number of eventually-timely links. Thus, 𝐴 Ω works in a system (we call it 𝑆 𝑝 ) with degenerative Byzantine failures as in S, where up to n processes can be faulty, with partial synchrony, where the membership is unknown, and preserving Property 1 (which is minimal with respect to the number of eventually-timely links). 6.2.1. The Partially Synchronous System 𝑆 𝑝 Let 𝑆 𝑝 be a system such as S but with the following differences. 𝑆 𝑝 is partially synchronous , that is, the maximum time needed by each process 𝑝 𝑖 ∈ 𝑆 𝑝 to execute a step is bounded but unknown by every process, and the time needed to receive a sent message is bounded but also unknown. We assume that in system 𝑆 𝑝 there may be any number of faulty processes (i.e., 𝑓 ≤ 𝑛 ). Regarding membership, 𝑆 𝑝 is weaker than S in the sense that, similarly to S, in 𝑆 𝑝 each process 𝑝 𝑖 has no initial information about any other process but itself. However, unlike S, processes do not know the size n of the system. 𝑆 𝑝 has two types of links: eventually-timely and lossy-asynchronous . We consider that, in 𝑆 𝑝 , every process 𝑝 𝑖 can send messages to every other
{ "page_id": null, "source": 7323, "title": "from dpo" }
process 𝑝 𝑘 , 𝑝 𝑘 ≠ 𝑝 𝑖 , using a different and unidirectional link. Note that, unlike S, and for the sake of generalization and avoiding a trivial solution, we eliminate the possibility that a process 𝑝 𝑖 sends messages to itself. Thus, we prevent a process 𝑝 𝑖 from trivially knowing if it is a deaf or mute process. Recall that, in 𝑆 𝑝 , 𝐺 ( Correct ) needs not be a complete graph of eventually-timely links. Hence, rebroadcasts are necessary to effectively reach the destination of each message (if possible). However, we assume that every process can irrefutably validate the legitimacy of every message no matter it has been rebroadcast. This can be enforced by using digital signatures with asymmetric encryption. Each message could include in its header both the signature and the public key necessary to verify the signature. Thus, if a mortal Byzantine process tries to alter a legitimate message during a rebroadcast, it would not be able to correctly sign the altered message and a correct process will detect the attack and discard the altered message upon reception. Finally, we also assume that 𝑆 𝑝 satisfies Property 1, which was proved in Theorem 3 to be a necessary condition for the implementability of a failure detector of Class Ω. 6.2.2. Description of Algorithm 𝐴 Ω in 𝑆 𝑝 Fig. 3 presents Algorithm 𝐴 Ω which implements a failure detector D of Class Ω in system 𝑆 𝑝 , as we will prove below. The algorithm is based on information processes diffuse about their suspicions on the processes they know. Download: Download high-res image (251KB) Download: Download full-size image Fig. 3. Algorithm 𝐴 Ω for implementing a failure detector D of Class Ω in System Sp, i.e., in a partially synchronous system with
{ "page_id": null, "source": 7323, "title": "from dpo" }
unknown membership, degenerative Byzantine failures and where f ≤ n (code of pi). Each process uses some variables to record its current knowledge of the state of the system. In order to simplify the algorithm, these variables are considered dynamic in the sense that space is allocated and initialized as needed the first time some particular value is accessed. In particular, variable susp 𝑖 is a two dimensional matrix used by process 𝑝 𝑖 to store, at each row j, the suspicions process 𝑝 𝑗 has of every other process 𝑝 𝑘 known by 𝑝 𝑗 . Variable correct 𝑖 stores the set of processes which process 𝑝 𝑖 considers to be correct. Process 𝑝 𝑖 considers that process 𝑝 𝑗 is correct if 𝑝 𝑖 periodically receives messages form 𝑝 𝑗 and those messages are consistent with the messages previously received from 𝑝 𝑗 . If process 𝑝 𝑖 receives a message form 𝑝 𝑗 which is inconsistent with the previous messages received from 𝑝 𝑗 , then 𝑝 𝑗 must be a Byzantine process. Byzantine processes are stored in variable known _ byzantine 𝑖 . When a Byzantine process is detected, it will never again be considered to be correct. A process 𝑝 𝑖 uses Task T1 to propagate ( HB , next _ seq 𝑖 [ 𝑖 ] , susp 𝑖 [ 𝑖 ] , 𝑖 ) messages periodically (each η units of time) reporting, to all processes, the system status as known by process 𝑝 𝑖 (Lines 6–8). These messages are heartbeats (HB) which tell each receiver process that 𝑝 𝑖 is a non-crashed process, so the receiver can update its view of the system status. These messages diffuse the current suspicions of process 𝑝 𝑖 in susp 𝑖 [ 𝑖 ] , and include their
{ "page_id": null, "source": 7323, "title": "from dpo" }
sequence number next _ seq 𝑖 [ 𝑖 ] . A process 𝑝 𝑖 uses Task T2 (roughly) to learn and report about the identity of processes and the status known by the processes that form the membership (Lines 9–27), to acknowledge the sender heartbeats (Lines 28–33), to increase the level of suspicions of processes from which 𝑝 𝑖 does not receive heartbeats on time (Lines 34–38), and to compute and return the leader process (Lines 39–46). Each ( HB , next _ seq 𝑘 , susp _ 𝑝 𝑘 , 𝑘 ) message received has a sequence number next _ seq 𝑘 which starts from 1 and is increased each time the HB with the previous sequence number is acknowledged by some other process in the system (done at Line 32). Thus, it is possible to know that a HB message is newer than the last one received from the same process 𝑝 𝑘 (as checked at Line 16). Note that only new HB messages are taken into consideration. Note also that process 𝑝 𝑖 stores in next _ seq 𝑖 [ 𝑘 ] , 𝑘 ≠ 𝑖 the sequence number of the newest HB message received from process 𝑝 𝑘 (Line 24). Since the time of reception of these heartbeats by each process 𝑝 𝑖 is bounded but variable and unknown (due to the fact that 𝑆 𝑝 is partially synchronous), 𝑝 𝑖 may temporarily (and erroneously) believe that it does not receive HB messages from 𝑝 𝑘 on time because 𝑝 𝑘 is a non-correct process. Each process 𝑝 𝑖 uses susp 𝑖 [ 𝑘 ] to count the number of times that process 𝑝 𝑘 has suspected each other process to be a non-correct process. Each process 𝑝 𝑖 keeps in variable Timeout 𝑖 [ 𝑘
{ "page_id": null, "source": 7323, "title": "from dpo" }
] the time to wait for a HB message from 𝑝 𝑘 . Each time it receives a HB message from process 𝑝 𝑘 (not in known _ byzantine 𝑖 , what is tested at Line 16) on time, it updates 𝑝 𝑘 suspicions, adds it to correct 𝑖 , sends back an acknowledgment, updates the sequence number of the last HB message received and resets the timer associated with process 𝑝 𝑘 (Lines 20–26). Each time the timer associated with 𝑝 𝑘 expires (Lines 34–38), 𝑝 𝑘 is removed from correct 𝑖 , its suspicions are increased as well as its corresponding timeout, and the timer is reset to the new timeout value. When process 𝑝 𝑖 receives a ( HB , next _ seq 𝑘 , susp 𝑘 , 𝑘 ) message, it relays it trying to reach all processes (Line 10). To avoid messages being permanently in the network, each message is only forwarded once (Line 9). Finally, Function leader 𝑖 ( ) (Lines 39–46) returns the current leader of process 𝑝 𝑖 each time it is invoked. The leader will be the process with the minimum value of suspicions in susp 𝑖 among the processes in 𝑐 𝑜 𝑟 𝑟 𝑒 𝑐 𝑡 𝑖 , and, in case of a tie, we use the minimum identity of these processes with the minimum suspicions. To clarify the code, we use the auxiliary variable punish 𝑖 to temporarily store these minimum values per process. 6.2.3. Correctness of Algorithm 𝐴 Ω in 𝑆 𝑝 In this section we prove the correctness of Algorithm 𝐴 Ω . We start proving that, eventually, mute, deaf, autistic and mortal Byzantine processes are not considered correct anymore. Lemma 12 Eventually, no correct process 𝑝 𝑖 considers a mute, deaf, autistic or mortal Byzantine
{ "page_id": null, "source": 7323, "title": "from dpo" }
process to be correct. Proof Note that mute processes eventually stop sending heartbeats, so there is a time after which their timers expire forever. Thus, at Line 35 they will be removed from correct 𝑖 by all correct processes, and Line 22 will never again be executed. Deaf processes will eventually stop receiving ACK_HB messages from other processes. Hence, they will stop increasing their sequence numbers since they will never reach Line 32. Hence, all their future HB messages will have the same sequence number. Then, when a correct process receives their HB messages, the condition of Line 16 will never again be satisfied, so their timers will always expire. Thus, every correct process 𝑝 𝑖 will remove them from correct 𝑖 at Line 35. Recall that autistic processes are both mute and deaf, so the previous arguments also apply to autistic processes. Finally, mortal Byzantine processes will eventually stop sending messages (when they crash). Hence, after they crash, they will be permanently removed from correct 𝑖 at Line 35, since their timers will expire forever after. Lemma 13 Let 𝑝 𝑖 and 𝑝 𝑘 be any two correct processes. Eventually, every HB message from 𝑝 𝑘 is received by 𝑝 𝑖 before timer 𝑖 ( 𝑘 ) expires. Proof Since every time timer 𝑖 ( 𝑘 ) expires, Timeout 𝑖 [ 𝑘 ] is increased (at Line 37) and, in System 𝑆 𝑝 , the time required by a message to arrive to its destination is bounded, eventually, Timeout 𝑖 [ 𝑘 ] will be enough to allow the reception of every message from process 𝑝 𝑘 before timer 𝑖 ( 𝑘 ) expires. Corollary 3 Eventually, suspicions on correct processes stop increasing. Proof From Lemma 13, eventually, all processes receive the HB messages from all processes before their
{ "page_id": null, "source": 7323, "title": "from dpo" }
timers expire. Since suspicions are only increased at Line 36 (when timers expire), eventually, suspicions on correct processes stop increasing. Theorem 4 Algorithm 𝐴 𝛺 of Fig. 3 implements a failure detector D of Class Ω in 𝑆 𝑝 . Proof From Lemma 12, eventually, no correct process 𝑝 𝑖 considers a mute, deaf, autistic or mortal Byzantine process to be correct. Hence, eventually, the leader process returned by Function leader 𝑖 ( ) at every correct process will be a correct process. Besides, from Corollary 3, eventually, suspicions on correct processes stop increasing. Thus, there is a time after which all the HB messages sent by a process with successive sequence numbers have the same suspicions. Hence, there is a time after which the suspicions collected by all correct processes are the same, so all of them will choose the same leader when Function leader 𝑖 ( ) is invoked. 7. Conclusions In this paper we have studied consensus in asynchronous systems with unknown membership under a failure model with 𝑓 < 𝑛 / 3 degenerative Byzantine failures. In this model, every faulty process is a Byzantine process (i.e., it deviates from its specification) such that eventually degenerates and makes a physical or a transmission failure permanently. A physical failure is that in which the process crashes permanently, and a transmission failure happens when a process (intentionally or unintentionally) omits a communication operation. The main advantage of this degenerative Byzantine failure model with respect to the classical Byzantine model is that Consensus can be solved in an pure asynchronous system augmented with a failure detector such that both of them are totally decoupled. This independence between consensus and failure detectors allows simplifying the design, development, correctness and maintenance of the algorithms because the designers can focus on
{ "page_id": null, "source": 7323, "title": "from dpo" }
the properties the consensus algorithm must preserve, based only on the properties supplied by the failure detector. From a practical point of view, several examples where this failure model is useful have been previously given in . In this paper we have presented a consensus algorithm 𝐴 𝐶 which is simple and optimal with respect to the maximum number of faulty processes. It is optimal because 𝐴 𝐶 solves Consensus when 𝑓 < 𝑛 / 3 , being f the maximum number of faulty processes and n the number of processes in the system , . Trying to make 𝐴 𝐶 simple, it uses a failure detector of Class Ω and a broadcast primitive (RFLOB) to communicate messages among processes. To our knowledge, 𝐴 𝐶 is the first algorithm that solves Consensus with a decoupled failure detector, unknown membership and the degenerative Byzantine failures. We have also introduced a definition of Ω adapted from the crash failure model of to our failure model with degenerative Byzantine failures, and an algorithm 𝐴 Ω which implements a failure detector of Class Ω. Furthermore, we have proven in this paper that 𝐴 Ω can be implemented with unknown membership and minimum connectivity requirements (i.e., the minimum communication reliability and synchrony properties) in a system with degenerative Byzantine failures. To our knowledge, all failure detector classes in systems with Byzantine failures, present in the literature prior to this paper, cannot be implemented when the membership is unknown. Thus, 𝐴 Ω covers this gap. Finally, to simplify the consensus algorithm, we have introduced the RFLOB primitive which guarantees that correct processes deliver the same sequence of messages if they were broadcast by the same process, and the messages broadcast by each process are delivered by all correct processes following the same FIFO and local
{ "page_id": null, "source": 7323, "title": "from dpo" }
order . We have described and proven the correctness of algorithm 𝐴 RFLOB which implements this RFLOB primitive for systems with unknown membership and 𝑓 < 𝑛 / 3 classical Byzantine processes . Also, to our knowledge, this algorithm 𝐴 RFLOB is the first implementation of a broadcast primitive with reliability properties, FIFO and local reception and unknown membership in a system with the classical Byzantine processes of (note that our degenerative Byzantine failure model is a subset of this classical Byzantine failure model). Thus we show that Consensus is implementable using an Ω failure detector and the RFLOB broadcast primitive, in a system with degenerative Byzantine failures even with unknown membership. Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. References Marcos K. Aguilera, Carole Delporte-Gallet, Hugues Fauconnier, Sam Toueg On implementing omega in systems with weak reliability and synchrony assumptions Distrib. Comput., 21 (4) (2008), pp. 285-314 CrossrefView in ScopusGoogle Scholar Marcos Kawazoe Aguilera, Carole Delporte-Gallet, Hugues Fauconnier, Sam Toueg Stable leader election Distributed Computing, Proceedings of the 15th International Conference DISC 2001, Lisbon, Portugal, October 3–5, 2001 (2001), pp. 108-122 Google Scholar Gabriel Bracha Asynchronous byzantine agreement protocols Inf. Comput., 75 (2) (1987), pp. 130-143 View PDF View articleView in ScopusGoogle Scholar Gabriel Bracha, Sam Toueg Asynchronous consensus and broadcast protocols J. ACM, 32 (4) (1985), pp. 824-840 View in ScopusGoogle Scholar Tushar Deepak Chandra, Vassos Hadzilacos, Sam Toueg The weakest failure detector for solving consensus J. ACM, 43 (4) (July 1996), pp. 685-722 View in ScopusGoogle Scholar Tushar Deepak Chandra, Sam Toueg Unreliable failure detectors for reliable distributed systems J. ACM, 43 (2) (March 1996), pp. 225-267 View
{ "page_id": null, "source": 7323, "title": "from dpo" }
in ScopusGoogle Scholar Siobhàn Clarke, Elisa Baniassad Aspect-Oriented Analysis and Design Addison-Wesley Professional (2005) Google Scholar Miguel Correia, Giuliana Santos Veronese, Nuno Ferreira Neves, Paulo Verissimo Byzantine consensus in asynchronous message-passing systems: a survey Int. J. Critical Comput.-Based Syst., 2 (2) (2011), pp. 141-161 CrossrefView in ScopusGoogle Scholar Edsger W. Dijkstra On the role of scientific thought Selected Writings on Computing: A Personal Perspective, Springer (1982), pp. 60-66 CrossrefGoogle Scholar Danny Dolev, Cynthia Dwork, Larry Stockmeyer On the minimal synchronism needed for distributed consensus J. ACM, 34 (1) (January 1987), pp. 77-97 View in ScopusGoogle Scholar Assia Doudou, Benoît Garbinato, Rachid Guerraoui, André Schiper Muteness failure detectors: specification and implementation Proceedings of the Third European Dependable Computing Conference on Dependable Computing, EDCC-3, Springer-Verlag, London, UK (1999), pp. 71-87 CrossrefView in ScopusGoogle Scholar Assia Doudou, André Schiper Muteness detectors for consensus with byzantine processes Proceedings of the Seventeenth Annual ACM Symposium on Principles of Distributed Computing, PODC '98, ACM, New York, NY, USA (1998), p. 315 Google Scholar Antonio Fernández, Ernesto Jiménez, Sergio Arévalo Minimal system conditions to implement unreliable failure detectors 12th IEEE Pacific Rim International Symposium on Dependable Computing, PRDC 2006, 18–20 December, 2006, University of California, Riverside, USA (2006), pp. 63-72 2006 Google Scholar Colin J. Fidge Logical time in distributed computing systems IEEE Computer, 24 (8) (1991), pp. 28-33 View in ScopusGoogle Scholar Michael J. Fischer, Nancy A. Lynch, Michael S. Paterson Impossibility of distributed consensus with one faulty process J. ACM, 32 (2) (April 1985), pp. 374-382 View in ScopusGoogle Scholar Roy Friedman, Achour Mostefaoui, Michel Raynal Simple and efficient oracle-based consensus protocols for asynchronous byzantine systems IEEE Trans. Dependable Secure Comput., 2 (1) (January 2005), pp. 46-56 View in ScopusGoogle Scholar Vassos Hadzilacos, Sam
{ "page_id": null, "source": 7323, "title": "from dpo" }
Toueg A modular approach to fault-tolerant broadcasts and related problems Technical Report Ithaca, NY, USA (1994) Google Scholar Jackson Daniel Software Abstractions: Logic, Language, and Analysis MIT Press (2012) Google Scholar Ernesto Jiménez, Sergio Arévalo, Antonio Fernández Implementing unreliable failure detectors with unknown membership Inf. Process. Lett., 100 (2) (October 2006), pp. 60-63 View PDF View articleView in ScopusGoogle Scholar Kim Potter Kihlstrom, Louise E. Moser, P.M. Melliar-Smith Solving consensus in a byzantine environment using an unreliable fault detector Alain Bui, Marc Bui, Vincent Villain (Eds.), On Principles Of Distributed Systems, Proceedings of the 1997 International Conference, Chantilly, France, December 10–12, 1997, Hermes (1997), pp. 61-76 Google Scholar Leslie Lamport Time, clocks, and the ordering of events in a distributed system Commun. ACM, 21 (7) (1978), pp. 558-565 View in ScopusGoogle Scholar Leslie Lamport, Robert Shostak, Marshall Pease The byzantine generals problem ACM Trans. Program. Lang. Syst., 4 (3) (July 1982), pp. 382-401 View in ScopusGoogle Scholar Dahlia Malkhi, Michael K. Reiter A high-throughput secure reliable multicast protocol J. Comput. Secur., 5 (2) (1997), pp. 113-128 View in ScopusGoogle Scholar Dahlia Malkhi, Michael K. Reiter Unreliable intrusion detection in distributed computations 10th Computer Security Foundations Workshop, CSFW '97, Rockport, Massachusetts, USA, June 10–12, 1997, IEEE Computer Society (1997), pp. 116-125 Google Scholar Friedemann Mattern Virtual time and global states of distributed systems Parallel and Distributed Algorithms, North-Holland (1988), pp. 215-226 Google Scholar Achour Mostéfaoui, Michel Raynal Signature-free broadcast-based intrusion tolerance: never decide a byzantine value Principles of Distributed Systems - Proceedings of the 14th International Conference, OPODIS 2010, Tozeur, Tunisia, December 14–17, 2010 (2010), pp. 143-158 CrossrefView in ScopusGoogle Scholar Achour Mostéfaoui, Michel Raynal Intrusion-tolerant broadcast and agreement abstractions in the presence of byzantine processes IEEE Trans. Parallel Distrib. Syst.,
{ "page_id": null, "source": 7323, "title": "from dpo" }
27 (4) (2016), pp. 1085-1098 View in ScopusGoogle Scholar M. Pease, R. Shostak, L. Lamport Reaching agreement in the presence of faults J. ACM, 27 (2) (April 1980), pp. 228-234 View in ScopusGoogle Scholar Kenneth J. Perry, Sam Toueg Distributed agreement in the presence of processor and communication faults IEEE Trans. Softw. Eng., 12 (3) (1986), pp. 477-482 View in ScopusGoogle Scholar Michel Raynal Communication and Agreement Abstractions for Fault-Tolerant Asynchronous Distributed Systems Synthesis Lectures on Distributed Computing Theory, Morgan & Claypool Publishers (2010) Google Scholar Michael K. Reiter Secure agreement protocols: reliable and atomic group multicast in rampart CCS '94, Proceedings of the 2nd ACM Conference on Computer and Communications Security, Fairfax, Virginia, USA, November 2–4, 1994. (1994), pp. 68-80 View in ScopusGoogle Scholar T.K. Srikanth, Sam Toueg Simulating authenticated broadcasts to derive simple fault-tolerant algorithms Distrib. Comput., 2 (2) (1987), pp. 80-94 View in ScopusGoogle Scholar Sam Toueg Randomized byzantine agreements Proceedings of the Third Annual ACM Symposium on Principles of Distributed Computing, Vancouver, B.C., Canada, August 27–29, 1984 (1984), pp. 163-178 View in ScopusGoogle Scholar Josef Widder, Martin Biely, Günther Gridling, Bettina Weiss, Jean-Paul Blanquart Consensus in the presence of mortal byzantine faulty processes Distrib. Comput., 24 (6) (2012), pp. 299-321 CrossrefView in ScopusGoogle Scholar Cited by (1) An in-depth and insightful exploration of failure detection in distributed systems 2024, Computer Networks Show abstract ☆ This work has been partially funded by the Ministry of Economy and Competitiveness (MINECO) under project CloudDB (TIN2016-80350), and by the Regional Government of Madrid (CM) under project EDGEDATA (P2018/TCS-4499). © 2019 Elsevier Inc. Recommended articles The complexity of planar Boolean #CSP with complex weights Journal of Computer and System Sciences, Volume 107, 2020, pp. 1-27 Heng Guo, Tyson Williams View PDF Collision-free network exploration
{ "page_id": null, "source": 7323, "title": "from dpo" }
Journal of Computer and System Sciences, Volume 86, 2017, pp. 70-81 Jurek Czyzowicz, …, Dominik Pająk View PDF Exploiting hidden structure in selecting dimensions that distinguish vectors Journal of Computer and System Sciences, Volume 82, Issue 3, 2016, pp. 521-535 Vincent Froese, …, Manuel Sorge View PDF Show 3 more articles Article Metrics Citations Citation Indexes 1 Captures Mendeley Readers 7 View details About ScienceDirect Remote access Advertise Contact and support Terms and conditions Privacy policy Cookies are used by this site. Cookie Settings All content on this site: Copyright © 2025 Elsevier B.V., its licensors, and contributors. All rights are reserved, including those for text and data mining, AI training, and similar technologies. For all open access content, the relevant licensing terms apply. × Chat with an article Save up to 50% of your literature research time by asking your questions to an article. Try for free
{ "page_id": null, "source": 7323, "title": "from dpo" }
Title: Chapter 6: Message Ordering and Group Communication URL Source: Markdown Content: ## Chapter 6: Message Ordering and Group Communication Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems Cambridge University Press A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 1 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Outline and Notations Outline > I Message orders: non-FIFO, FIFO, causal order, synchronous order > I Group communication with multicast: causal order, total order > I Expected behaviour semantics when failures occur > I Multicasts: application layer on overlays; also at network layer Notations > I Network ( N, L); event set ( E , ≺) > I message mi : send and receive events si and r i > I send and receive events: s and r . > I M, send (M), and receive (M) > I Corresponding events : a ∼ b denotes a and b occur at the same process > I send-receive pairs T = {(s, r ) ∈ Ei × Ej | s corresponds to r } > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 2 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Asynchronous and FIFO Executions (b) srs PP r r r rs ss mmmmm 1 21 21 21 2 32 1 331212 (a) Figure 6.1: (a) A-execution that is FIFO (b) A-execution that is not FIFO Asynchronous executions A-execution: ( E , ≺) for which the causality relation is a partial order. no causality cycles on any logical link, not necessarily FIFO delivery, e.g., network layer IPv4 connectionless service All physical links obey FIFO FIFO executions an A-execution in which: for all ( s, r ) and ( s′, r ′) ∈ T ,(s
{ "page_id": null, "source": 7325, "title": "from dpo" }
∼ s′ and r ∼ r ′ and s ≺ s′) = ⇒ r ≺ r ′ Logical link inherently non-FIFO Can assume connection-oriented service at transport layer, e.g., TCP To implement FIFO over non-FIFO link: use 〈 seq num, conn id 〉 per message. Receiver uses buffer to order messages. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 3 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Causal Order: Definition Causal order (CO) A CO execution is an A-execution in which, for all ( s, r ) and ( s′, r ′) ∈ T ,(r ∼ r ′ and s ≺ s′) = ⇒ r ≺ r ′ If send events s and s′ are related by causality ordering (not physical time ordering) , their corresponding receive events r and r ′ occur in the same order at all common dests. If s and s′ are not related by causality, then CO is vacuously satisfied. 1ssr rr(a) (b) (c) (d) s r rrss sss ssssrrrrr mm mmmmmmmmm P1 P2 P3 1 231332213 1 3 113r > 33311133322222222 m 21 1 Figure 6.2: (a) Violates CO as s1 ≺ s3; r 3 ≺ r 1 (b) Satisfies CO. (c) Satisfies CO. No send events related by causality. (d) Satisfies CO. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 4 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Causal Order: Definition from Implementation Perspective CO alternate definition If send (m1) ≺ send (m2) then for each common destination d of messages m1 and m2, deliver d (m1) ≺ deliver d (m2) must be satisfied. Message arrival vs. delivery: > I message m that arrives in OS buffer at Pi may have to be delayed until
{ "page_id": null, "source": 7325, "title": "from dpo" }
the messages that were sent to Pi causally before m was sent (the “overtaken” messages) have arrived! > I The event of an application processing an arrived message is referred to as a delivery event (instead of as a receive event). no message overtaken by a chain of messages between the same (sender, receiver) pair. In Fig. 6.1(a), m1 overtaken by chain 〈m2, m3〉. CO degenerates to FIFO when m1, m2 sent by same process Uses: updates to shared data, implementing distributed shared memory, fair resource allocation; collaborative applications, event notification systems, distributed virtual environments > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 5 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Causal Order: Other Characterizations (1) Message Order (MO) A-execution in which, for all ( s, r ) and ( s′, r ′) ∈ T , s ≺ s′ =⇒ ¬ (r ′ ≺ r ) Fig 6.2(a): s1 ≺ s3 but ¬(r 3 ≺ r 1) is false ⇒ MO not satisfied m cannot be overtaken by a chain 1ssr rr(a) (b) (c) (d) s r rrss sss ssssrrrrr mm mmmmmmmmm P1 P 2 P3 1 231332213 1 3 113r 3 3 31 1 133322222 222 m 21 1 Figure 6.2: (a) Violates CO as s1 ≺ s3; r 3 ≺ r 1 (b) Satisfies CO. (c) Satisfies CO. No send events related by causality. (d) Satisfies CO. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 6 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Causal Order: Other Characterizations (2) 1ssr rr(a) (b) (c) (d) s r rrss sss ssssrrrrr mm mmmmmmmmm > P1 > P2 > P3123133221313113 r > 33311133322222222 > m211 Figure 6.2: (a) Violates CO as s1 ≺ s3;
{ "page_id": null, "source": 7325, "title": "from dpo" }
r 3 ≺ r 1 (b) Satisfies CO. (c) Satisfies CO. No send events related by causality. (d) Satisfies CO. Empty-Interval (EI) property (E , ≺) is an EI execution if for each ( s, r ) ∈ T , the open interval set {x ∈ E | s ≺ x ≺ r } in the partial order is empty. Fig 6.2(b). Consider M2. No event x such that s2 ≺ x ≺ r 2. Holds for all messages ⇒ EI For EI 〈s, r 〉, there exists some linear extension 1 A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 7 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Causal Order: Other Characterizations (3) CO 6 =⇒ all messages can be drawn as vertical arrows in the same space-time diagram (otherwise all 〈s, r 〉 intervals empty in the same linear extension; synchronous execution). Common Past and Future An execution ( E , ≺) is CO iff for each pair ( s, r ) ∈ T and each event e ∈ E , Weak common past: e ≺ r =⇒ ¬ (s ≺ e) Weak common future: s ≺ e =⇒ ¬ (e ≺
{ "page_id": null, "source": 7325, "title": "from dpo" }
r ) If the past of both s and r are identical (analogously for the future), viz., e ≺ r =⇒ e ≺ s and s ≺ e =⇒ r ≺ e, we get a subclass of CO executions, called synchronous executions . > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 8 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Synchronous Executions (SYNC) 3 PPP 123 (b) r rrrrs s s s sm m mmmsssm 33 2222 6666r 444555 s 411 r1141s rr5 (a) 5s3r 462m 3 5 6 s mr 1m 2 r 3 mmm Figure 6.3: (a) Execution in an async system (b) Equivalent sync execution. Handshake between sender and receiver Instantaneous communication ⇒ modified definition of causality, where s, r are atomic and simultaneous, neither preceding the other. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 9 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Synchronous Executions: Definition Causality in a synchronous execution. The synchronous causality relation on E is the smallest transitive relation that satisfies the following. S1. If x occurs before y at the same process, then x y S2. If ( s, r ) ∈ T , then for all x ∈ E , [( x s ⇐⇒ x r ) and (s x ⇐⇒ r x)] S3. If x y and y z, then x z Synchronous execution (or S-execution). An execution ( E , ) for which the causality relation is a partial order. Timestamping a synchronous execution. An execution ( E , ≺) is synchronous iff there exists a mapping from E to T (scalar timestamps) | for any message M, T (s(M)) = T (r (M)) for each process Pi , if ei ≺
{ "page_id": null, "source": 7325, "title": "from dpo" }
e′ > i then T (ei ) i ) > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 10 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Asynchronous Execution with Synchronous Communication Will a program written for an asynchronous system ( A-execution) run correctly if run with synchronous primitives? Process i Process j ... ... Send (j) Send (i) Receive (j) Receive (i)... ... Figure 6.4: A-execution deadlocks when using synchronous primitives. An A-execution that is realizable under synchronous communication is a realizable with synchronous communication (RSC) execution. 3 PPP 123 sss sssrrrr rrr 1123322 222111 (a) (b) (c) 3r 1s s 3mmmm m 222m m11 m 13 Figure 6.5: Illustration of non-RSC A-executions. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 11 / 52 Distributed Computing: Principles, Algorithms, and Systems ## RSC Executions Non-separated linear extension of ( E , ≺) A linear extension of ( E , ≺) such that for each pair ( s, r ) ∈ T , the interval { x ∈ E | s ≺ x ≺ r } is empty. Exercise: Identify a non-separated and a separated linear extension in Figs 6.2(d) and 6.3(b) RSC execution An A-execution ( E , ≺) is an RSC execution iff there exists a non-separated linear extension of the partial order ( E , ≺). Checking for all linear extensions has exponential cost! Practical test using the crown characterization > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 12 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Crown: Definition Crown Let E be an execution. A crown of size k in E is a sequence 〈 (si ,r i ), i ∈
{ "page_id": null, "source": 7325, "title": "from dpo" }
{ 0, . . . , k-1 }〉 of pairs of corresponding send and receive events such that: s0 ≺ r 1, s1 ≺ r 2, . . . . . . sk−2 ≺ r k−1, sk−1 ≺ r 0.3 PPP 123 sss sssrrrr rrr 1123322 222111 (a) (b) (c) 3r 1s s 3mmmm m 222m m11 m 13 Figure 6.5: Illustration of non-RSC A-executions and crowns. Fig 6.5(a): crown is 〈(s1, r 1), (s2, r 2)〉 as we have s1 ≺ r 2 and s2 ≺ r 1 Fig 6.5(b) (b) crown is 〈(s1, r 1), (s2, r 2)〉 as we have s1 ≺ r 2 and s2 ≺ r 1 Fig 6.5(c): crown is 〈(s1, r 1), (s3, r 3), (s2, r 2)〉 as we have s1 ≺ r 3 and s3 ≺ r 2 and s2 ≺ r 1 Fig 6.2(a): crown is 〈(s1, r 1), (s2, r 2), (s3, r 3)〉 as we have s1 ≺ r 2 and s2 ≺ r 3 and s3 ≺ r 1. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 13 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Crown: Characterization of RSC Executions 3 PPP 123 sss sssrrrr rrr 1123322 222111 (a) (b) (c) 3r 1s s 3mmmm m 222m m11 m 13 Figure 6.5: Illustration of non-RSC A-executions and crowns. Fig 6.5(a): crown is 〈(s1, r 1), (s2, r 2)〉 as we have s1 ≺ r 2 and s2 ≺ r 1 Fig 6.5(b) (b) crown is 〈(s1, r 1), (s2, r 2)〉 as we have s1 ≺ r 2 and s2 ≺ r 1 Fig 6.5(c): crown is 〈(s1, r 1), (s3, r 3), (s2, r 2)〉 as we have s1 ≺ r 3 and s3 ≺ r 2
{ "page_id": null, "source": 7325, "title": "from dpo" }
and s2 ≺ r 1 Fig 6.2(a): crown is 〈(s1, r 1), (s2, r 2), (s3, r 3)〉 as we have s1 ≺ r 2 and s2 ≺ r 3 and s3 ≺ r 1. Some observations In a crown, si and r i+1 may or may not be on same process Non-CO execution must have a crown CO executions (that are not synchronous) have a crown (see Fig 6.2(b)) Cyclic dependencies of crown ⇒ cannot schedule messages serially ⇒ not RSC > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 14 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Crown Test for RSC executions > 1 Define the ↪→: T × T relation on messages in the execution ( E , ≺) as follows. Let ↪→ ([ s, r ], [s′, r ′]) iff s ≺ r ′. Observe that the condition s ≺ r ′ (which has the form used in the definition of a crown) is implied by all the four conditions: (i) s ≺ s′, or (ii) s ≺ r ′, or (iii) r ≺ s′, and (iv) r ≺ r ′. > 2 Now define a directed graph G↪→ = ( T , ↪ →), where the vertex set is the set of messages T and the edge set is defined by ↪→.Observe that ↪→: T × T is a partial order iff G↪→ has no cycle, i.e., there must not be a cycle with respect to ↪→ on the set of corresponding ( s, r ) events. > 3 Observe from the defn. of a crown that G↪→ has a directed cycle iff ( E , ≺) has a crown. Crown criterion An A-computation is RSC, i.e., it can be realized on a system with synchronous communication,
{ "page_id": null, "source": 7325, "title": "from dpo" }
iff it contains no crown. Crown test complexity: O(|E |) (actually, # communication events) Timestamps for a RSC execution Execution ( E , ≺) is RSC iff there exists a mapping from E to T (scalar timestamps) such that for any message M, T (s(M)) = T (r (M)) for each ( a, b) in ( E × E ) \ T , a ≺ b =⇒ T (a) A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 15 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Hierarchy of Message Ordering Paradigms (a) SYNC CO FIFO AAFIFO CO SYNC (b) Figure 6.7: Hierarchy of message ordering paradigms. (a) Venn diagram (b) Example executions. An A-execution is RSC iff A is an S-execution. RSC ⊂ CO ⊂ FIFO ⊂ A . More restrictions on the possible message orderings in the smaller classes. The degree of concurrency is most in A, least in SYN C . A program using synchronous communication easiest to develop and verify. A program using non-FIFO communication, resulting in an A-execution, hardest to design and verify. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 16 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Simulations: Async Programs on Sync Systems RSC execution: schedule events as per a non-separated linear extension adjacent ( s, r ) events sequentially partial order of original A-execution unchanged If A-execution is not RSC: partial order has to be changed; or model each Ci,j by control process Pi,j and use sync communication (see Fig 6.8) m’ # PPiPji,j j,i P m mm’ Figure 6.8: Modeling channels as processes to simulate an execution using asynchronous primitives on an synchronous system. Enables decoupling of sender from receiver. This implementation
{ "page_id": null, "source": 7325, "title": "from dpo" }
is expensive. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 17 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Simulations: Synch Programs on Async Systems Schedule msgs in the order in which they appear in S-program partial order of S-execution unchanged Communication on async system with async primitives When sync send is scheduled: > I wait for ack before completion > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 18 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Sync Program Order on Async Systems Deterministic program: repeated runs produce same partial order Deterministic receive ⇒ deterministic execution ⇒ (E , ≺) is fixed Nondeterminism (besides due to unpredictable message delays): Receive call does not specify sender Multiple sends and receives enabled at a process; can be executed in interchangeable order ∗[G1 −→ CL 1 || G2 −→ CL 2 || · · · || Gk −→ CL k ]Deadlock example of Fig 6.4 If event order at a process is permuted, no deadlock! How to schedule (nondeterministic) sync communication calls over async system? Match send or receive with corresponding event Binary rendezvous (implementation using tokens) Token for each enabled interaction Schedule online, atomically, in a distributed manner Crown-free scheduling (safety); also progress to be guaranteed Fairness and efficiency in scheduling > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 19 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Bagrodia’s Algorithm for Binary Rendezvous (1) Assumptions Receives are always enabled Send, once enabled, remains enabled To break deadlock, PIDs used to introduce asymmetry Each process schedules one send at a time Message types: M, ack (M), request (M), permission (M)Process blocks when it knows it can successfully synchronize the
{ "page_id": null, "source": 7325, "title": "from dpo" }
current message P M ack(M) permission(M) Mrequest(M) (b) (a) higher priority lower priority jPi Fig 6.: Rules to prevent message cyles. (a) High priority process blocks. (b) Low priority process does not block. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 20 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Bagrodia’s Algorithm for Binary Rendezvous: Code (message types) M, ack(M) , request(M) , permission(M) 1 Pi wants to execute SEND(M) to a lower priority process Pj : Pi executes send(M) and blocks until it receives ack(M) from Pj . The send event SEND(M) now completes. Any M’ message (from a higher priority processes) and request(M’) request for synchronization (from a lower priority processes) received during the blocking period are queued. 2 Pi wants to execute SEND(M) to a higher priority process Pj : 1 Pi seeks permission from Pj by executing send(request(M)) .// to avoid deadlock in which cyclically blocked processes queue messages. 2 While Pi is waiting for permission, it remains unblocked. 1 If a message M′ arrives from a higher priority process Pk , Pi accepts M′ by scheduling a RECEIVE(M’) event and then executes send(ack(M’)) to Pk . 2 If a request(M’) arrives from a lower priority process Pk , Pi executes send(permission(M’)) to Pk and blocks waiting for the message M′. When M′ arrives, the RECEIVE(M’) event is executed. 3 When the permission(M) arrives, Pi knows partner Pj is synchronized and Pi executes send(M) . The SEND(M) now completes. 3 Request(M) arrival at Pi from a lower priority process Pj : At the time a request(M) is processed by Pi , process Pi executes send(permission(M)) to Pj and blocks waiting for the message M. When M arrives, the RECEIVE(M) event is executed and the process unblocks. 4 Message
{ "page_id": null, "source": 7325, "title": "from dpo" }
M arrival at Pi from a higher priority process Pj : At the time a message M is processed by Pi , process Pi executes RECEIVE(M) (which is assumed to be always enabled) and then send(ack(M)) to Pj . 5 Processing when Pi is unblocked: When Pi is unblocked, it dequeues the next (if any) message from the queue and processes it as a message arrival (as per Rules 3 or 4). A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 21 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Bagrodia’s Algorithm for Binary Rendezvous (2) Higher prio Pi blocks on lower prio Pj to avoid cyclic wait (whether or not it is the intended sender or receiver of msg being scheduled) Before sending M to Pi , Pj requests permission in a nonblocking manner. While waiting: > I M′ arrives from another higher prio process. ack (M′) is returned > I request (M′) arrives from lower prio process. Pj returns permission (M′) and blocks until M′ arrives. Note: receive (M′) gets permuted with the send (M) event blocking period Pi PjkP(highest priority) (lowest priority) (a) (b) M, sent to lower priority process request(M) ack(M) permission(M) M, sent to higher priority process Figure 6.10: Scheduling messages with sync communication. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 22 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Group Communication Unicast vs. multicast vs. broadcast Network layer or hardware-assist multicast cannot easily provide: > I Application-specific semantics on message delivery order > I Adapt groups to dynamic membership > I Multicast to arbitrary process set at each send > I Provide multiple fault-tolerance semantics Closed group (source part of group) vs. open group # groups can be O(2
{ "page_id": null, "source": 7325, "title": "from dpo" }
n)(a) P1 P2 PP > 1 R1 R2 R3 R3 > 2 R1 R2 m mm1 m1 m2 m2 (c) (b) Figure 6.11: (a) Updates to 3 replicas. (b) Causal order (CO) and total order violated. (c) Causal order violated. If m did not exist, (b,c) would not violate CO. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 23 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Raynal-Schiper-Toueg (RST) Algorithm (local variables) array of int SENT [1 . . . n, 1 . . . n] array of int DELIV [1 . . . n] // DELIV [k] = # messages sent by k that are delivered locally (1) send event , where Pi wants to send message M to Pj :(1a) send (M, SENT ) to Pj ;(1b) SENT [i, j] ←− SENT [i, j] + 1. (2) message arrival, when ( M, ST ) arrives at Pi from Pj :(2a) deliver M to Pi when for each process x,(2b) DELIV [x] ≥ ST [x, i]; (2c) ∀x, y , SENT [x, y ] ←− max( SENT [x, y ], ST [x, y ]); (2d) DELIV [j] ←− DELIV [j] + 1. How does algorithm simplify if all msgs are broadcast? Assumptions/Correctness FIFO channels. Safety: Step (2a,b). Liveness: assuming no failures, finite propagation times Complexity n2 ints/ process n2 ints/ msg Time per send and rcv event: n2 > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 24 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Principles Mi,a: ath multicast message sent by Pi Delivery Condition for correctness: Msg M∗ that carries information “ d ∈ M.Dests ”, where message M was sent to d in the causal past
{ "page_id": null, "source": 7325, "title": "from dpo" }
of Send (M∗), is not delivered to d if M has not yet been delivered to d. Necessary and Sufficient Conditions for Optimality: For how long should the information “ d ∈ Mi,a.Dests ” be stored in the log at a process, and piggybacked on messages? as long as and only as long as > I (Propagation Constraint I: ) it is not known that the message Mi,a is delivered to d, and > I (Propagation Constraint II: ) it is not known that a message has been sent to d in the causal future of Send (Mi,a), and hence it is not guaranteed using a reasoning based on transitivity that the message Mi,a will be delivered to d in CO. ⇒ if either (I) or (II) is false, “ d ∈ M.Dests ” must not be stored or propagated, even to remember that (I) or (II) has been falsified. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 25 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Principles e7 id e8 e6 e4 e3 e2 e5 e‘ e‘‘ e border of causal future of corresponding event event at which message is sent to d, and there is no such info "d is a dest. of M" must exist for correctness info "d is a dest. of M" must not exist for optimality message sent to d event on any causal path between event e and this event Deliver(M) M e1 “d ∈ Mi,a.Dests ” must be available in the causal future of event ei,a, but not in the causal future of Deliver d (Mi,a), and not in the causal future of ek,c , where d ∈ Mk,c .Dests and there is no other message sent causally between
{ "page_id": null, "source": 7325, "title": "from dpo" }
Mi,a and Mk,c to the same destination d. In the causal future of Deliver d (Mi,a), and Send (Mk,c ), the information is redundant; elsewhere, it is necessary. Information about what messages have been delivered (or are guaranteed to be delivered without violating CO) is necessary for the Delivery Condition. > I For optimality, this cannot be stored. Algorithm infers this using set-operation logic. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 26 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Principles e7 id e8 e6 e4 e3 e2 e5 e‘ e‘‘ e border of causal future of corresponding event event at which message is sent to d, and there is no such info "d is a dest. of M" must exist for correctness info "d is a dest. of M" must not exist for optimality message sent to d event on any causal path between event e and this event Deliver(M) M e1 “d ∈ M.Dests ” must exist at e1 and e2 because (I) and (II) are true. must not exist at e3 because (I) is false must not exist at e4, e5, e6 because (II) is false must not exist at e7, e8 because (I) and (II) are false Info about messages (i) not known to be delivered and (ii) not guaranteed to be delivered in CO, is explicitly tracked using (source, ts, dest ). Must be deleted as soon as either (i) or (ii) becomes false. Info about messages already delivered and messages guaranteed to be delivered in CO is implicitly tracked without storing or propagating it: > I derived from the explicit information. > I used for determining when (i) or (ii) becomes false for the explicit information being stored/piggybacked. > A.
{ "page_id": null, "source": 7325, "title": "from dpo" }
Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 27 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Code (1) (local variables) clock j ←− 0; // local counter clock at node jSR j [1 ... n] ←− 0; // SR j [i] is the timestamp of last msg. from i delivered to jLOG j = {(i, clock i , Dests )} ← − {∀ i, (i, 0, ∅)};// Each entry denotes a message sent in the causal past, by i at clock i . Dests is the set of remaining destinations // for which it is not known that Mi,clock i (i) has been delivered, or (ii) is guaranteed to be delivered in CO. SND: j sends a message M to Dests : 1 clock j ←− clock j + 1; 2 for all d ∈ M.Dests do : OM ←− LOG j ; // OM denotes OMj,clock j for all o ∈ OM , modify o.Dests as follows: if d 6 ∈ o.Dests then o.Dests ←− (o.Dests \ M.Dests ); if d ∈ o.Dests then o.Dests ←− (o.Dests \ M.Dests ) ⋃{d};// Do not propagate information about indirect dependencies that are // guaranteed to be transitively satisfied when dependencies of M are satisfied. for all os ,t ∈ OM do if os ,t .Dests = ∅ ∧ (∃o′ s,t′ ∈ OM | t < t′) then OM ←− OM \ { os ,t };// do not propagate older entries for which Dests field is ∅ send (j, clock j , M, Dests , OM ) to d; 3 for all l ∈ LOG j do l.Dests ←− l.Dests \ Dests ;// Do not store information about indirect dependencies that are guaranteed // to be transitively satisfied when dependencies
{ "page_id": null, "source": 7325, "title": "from dpo" }
of M are satisfied. Execute PURGE NULL ENTRIES (LOG j ); // purge l ∈ LOG j if l.Dests = ∅ 4 LOG j ←− LOG j ⋃{(j, clock j , Dests )}.A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 28 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Code (2) RCV: j receives a message (k, tk , M, Dests , OM ) from k: 1 // Delivery Condition; ensure that messages sent causally before M are delivered. for all om ,tm ∈ OM do if j ∈ om .tm .Dests wait until tm ≤ SR j [m]; 2 Deliver M; SR j [k] ←− tk ; 3 OM ←− { (k, tk , Dests )} ⋃ OM ; for all om ,tm ∈ OM do om ,tm .Dests ←− om ,tm .Dests \ { j};// delete the now redundant dependency of message represented by om ,tm sent to j 4 // Merge OM and LOG j by eliminating all redundant entries. // Implicitly track “already delivered” & “guaranteed to be delivered in CO” messages. for all om ,t ∈ OM and ls,t′ ∈ LOG j such that s = m do if t < t′ ∧ ls ,t 6 ∈ LOG j then mark om ,t ;// ls ,t had been deleted or never inserted, as ls ,t .Dests = ∅ in the causal past if t′ < t ∧ om,t′ 6 ∈ OM then mark ls,t′ ;// om,t′ 6 ∈ OM because ls,t′ had become ∅ at another process in the causal past Delete all marked elements in OM and LOG j ; // delete entries about redundant information for all ls,t′ ∈ LOG j and om ,t ∈ OM , such that s =
{ "page_id": null, "source": 7325, "title": "from dpo" }
m ∧ t′ = t do ls,t′ .Dests ←− ls,t′ .Dests ⋂ om ,t .Dests ; // delete destinations for which Delivery // Condition is satisfied or guaranteed to be satisfied as per om ,t Delete om ,t from OM ; // information has been incorporated in ls,t′ LOG j ←− LOG j ⋃ OM ; // merge nonredundant information of OM into LOG j 5 PURGE NULL ENTRIES (LOG j ). // Purge older entries l for which l.Dests = ∅ PURGE NULL ENTRIES( Log j ): // Purge older entries l for which l.Dests = ∅ is implicitly inferred for all ls ,t ∈ Log j do if ls ,t .Dests = ∅ ∧ (∃l′ s,t′ ∈ Log j | t I (Type 1:) ∃d ∈ Mi,a.Dests | d 6 ∈ li,a.Dests ∨ d 6 ∈ oi,a.Dests > F When li,a.Dests = ∅ or oi,a.Dests = ∅? > F Entries of the form li,ak for k = 1 , 2, . . . will accumulate > F Implemented in Step (2d) > I (Type 2:) if a1 F entries of the form li,a1 .Dests = ∅ can be inferred by their absence, and should not be stored > F Implemented in Step (2d) and PURGE
{ "page_id": null, "source": 7325, "title": "from dpo" }
NULL ENTRIES > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 30 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Optimal KS Algorithm for CO: Example M P1 P2 P3 P4 P5 P6MMMM 4,3 4,3 2,2 4,2 M 4,2 5,1 M 11111 causal past contains event (6,1) 21 3 42322 M 2,3 M 3,3 432 332 of multicast at event (5,1) propagates as piggybacked information and in Logs information about P as a destination 6 5 M 3,3 M 5,2 6,2 5,1 M6 M5,1 to P M4,2 to P 3,P 22,2 M to P 1 M6,2 to P 1 M4,3 to P 6 M4,3 to P 3 M5,2 to P 6 M2,3 to P M 13,3 to P 2,P 6 {P 4 {P 6 {P 6 {P 4 {P 6 {} {P , 4 P6 {P {} }}}}} 64 P }Message to dest. piggybacked M5,1 .Dests , 6 ,P } Figure 6.13: Tracking of information about M5,1.Dests > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 31 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Total Message Order Total order For each pair of processes Pi and Pj and for each pair of messages Mx and My that are delivered to both the processes, Pi is delivered Mx before My if and only if Pj is delivered Mx before My . Same order seen by all Solves coherence problem (a) > P1P2 > PP > 1R1 R2 R3 R3 > 2 > R1 R2 mmm1 m1 m2 m2 (c) (b) Fig 6.11: (a) Updates to 3 replicas. (b) Total order violated. (c) Total order not violated. Centralized algorithm (1) When Pi wants to multicast M to group G :(1a) send M(i, G ) to coordinator. (2)
{ "page_id": null, "source": 7325, "title": "from dpo" }
When M(i, G ) arrives from Pi at coordinator: (2a) send M(i, G ) to members of G .(3) When M(i, G ) arrives at Pj from coordinator: (3a) deliver M(i, G ) to application. Time Complexity: 2 hops/ transmission Message complexity: n > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 32 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Total Message Order: 3-phase Algorithm Code record Q entry M: int ; // the application message tag : int ; // unique message identifier sender id : int ; // sender of the message timestamp : int ; // tentative timestamp assigned to message deliverable : boolean ; // whether message is ready for delivery (local variables) queue of Q entry : temp Q , delivery Q int : clock // Used as a variant of Lamport’s scalar clock int : priority // Used to track the highest proposed timestamp (message types) REVISE TS (M, i, tag , ts ) // Phase 1 message sent by Pi , with initial timestamp ts PROPOSED TS (j, i, tag , ts ) // Phase 2 message sent by Pj , with revised timestamp, to PiFINAL TS (i, tag , ts ) // Phase 3 message sent by Pi , with final timestamp (1) When process Pi wants to multicast a message M with a tag tag :(1a) clock = clock + 1; (1b) send REVISE TS (M, i, tag , clock ) to all processes; (1c) temp ts = 0; (1d) await PROPOSED TS (j, i, tag , ts j ) from each process Pj ;(1e) ∀j ∈ N, do temp ts = max( temp ts , ts j ); (1f) send FINAL TS (i, tag , temp ts ) to all processes; (1g)
{ "page_id": null, "source": 7325, "title": "from dpo" }
clock = max (clock , temp ts ). (2) When REVISE TS (M, j, tag , clk ) arrives from Pj :(2a) priority = max (priority + 1 , clk ); (2b) insert (M, tag , j, priority , undeliverable ) in temp Q ; // at end of queue (2c) send PROPOSED TS (i, j, tag , priority ) to Pj .(3) When FINAL TS (j, tag , clk ) arrives from Pj :(3a) Identify entry Q entry (tag ) in temp Q , corresponding to tag ;(3b) mark qtag as deliverable; (3c) Update Q entry .timestamp to clk and re-sort temp Q based on the timestamp field; (3d) if head (temp Q ) = Q entry (tag ) then (3e) move Q entry (tag ) from temp Q to delivery Q ;(3f) while head (temp Q ) is deliverable do (3g) move head (temp Q ) from temp Q to delivery Q .(4) When Pi removes a message ( M, tag , j, ts , deliverable ) from head (delivery Q i ): (4a) clock = max( clock , ts ) + 1. A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 33 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Total Order: Distributed Algorithm: Example and Complexity REVISE_TS A BC D 77710 9999temp_Q delivery_Q temp_Q (9,u) (10,u) (7,u) (9,u) delivery_Q PROPOSED_TS (a) max(9,9)=9 A BC D 9temp_Q delivery_Q temp_Q delivery_Q 10 10 9(9,u) (10,d) (10,u) (9,d) max(7,10)=10 FINAL_TS (b) Figure 6.14: (a) A snapshot for PROPOSED TS and REVISE TS messages. The dashed lines show the further execution after the snapshot. (b) The FINAL TS messages. Complexity: Three phases 3( n − 1) messages for n − 1 dests Delay: 3 message hops Also implements causal order A. Kshemkalyani and M.
{ "page_id": null, "source": 7325, "title": "from dpo" }
Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 34 / 52 Distributed Computing: Principles, Algorithms, and Systems ## A Nomenclature for Multicast 4 classes of source-dest relns for open groups: SSSG: Single source and single dest group MSSG: Multiple sources and single dest group SSMG: Single source and multiple, possibly overlapping, groups MSMG: Multiple sources and multiple, possibly overlapping, groups (d) Multiple Sources Multiple Groups (a) Single Source Single Group (c) Single Source Multiple Groups (b) Multiple Sources Single Group Fig 6.15 : Four classes of source-dest relationships for open-group multicasts. For closed-group multicasts, the sender needs to be part of the recipient group. SSSG, SSMG: easy to implement MSSG: easy. E.g., Centralized algorithm MSMG: Semi-centralized propagation tree approach > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 35 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast: Definitions set of groups G = {G1 . . . Gg } set of meta-groups MG = {MG 1, . . . MG h} with the following properties. > I Each process belongs to a single meta-group, and has the exact same group membership as every other process in that meta-group. > I No other process outside that meta-group has that exact group membership. MSMG to groups → MSSG to meta-groups A distinguished node in each meta-group acts as its manager. For each user group Gi , one of its meta-groups is chosen to be its primary meta-group (PM) , denoted PM (Gi ). All meta-groups are organized in a propagation forest/tree satisfying: > I For user group Gi , PM (Gi ) is at the lowest possible level (i.e., farthest from root) of the tree such that all meta-groups whose destinations contain any nodes of Gi belong to subtree
{ "page_id": null, "source": 7325, "title": "from dpo" }
rooted at PM (Gi ). Propagation tree is not unique! > I Exercise: How to construct propagation tree? > I Metagroup with members from more user groups as root ⇒ low tree height > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 36 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast: Properties > 1 The primary meta-group PM (G ) is the ancestor of all the other meta-groups of G in the propagation tree. > 2 PM (G ) is uniquely defined. > 3 For any meta-group MG, there is a unique path to it from the PM of any of the user groups of which the meta-group MG is a subset. > 4 Any PM (G1) and PM (G2) lie on the same branch of a tree or are in disjoint trees. In the latter case, their groups membership sets are disjoint. Key idea: Multicasts to Gi are sent first to the meta-group PM (Gi ) as only the subtree rooted at PM (Gi ) can contain the nodes in Gi . The message is then propagated down the subtree rooted at PM (Gi ). MG 1 subsumes MG 2 if MG 1 is a subset of each user group G of which MG 2 is a subset. MG 1 is joint with MG 2 if neither subsumes the other and there is some group G such that MG 1, MG 2 ⊂ G . > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 37 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast: Example D ABC AB AAC C CE EDBCD BD BC BCD DE FEF ABC A B C AB AC BC BCD BD CD D
{ "page_id": null, "source": 7325, "title": "from dpo" }
DE E CE EF F PM(C) PM(D) PM(E) PM(F) (a) (b) PM(A),PM(B), AEFCB Fig 6.16: Example illustrating a propagation tree. Meta-groups in boldface. (a) Groups A, B, C , D, E and F ,and their meta-groups. (b) A propagation tree , with the primary meta-groups labeled. 〈ABC 〉, 〈AB 〉, 〈AC 〉, and 〈A〉 are meta-groups of user group 〈A〉. 〈ABC 〉 is PM (A), PM (B), PM (C ). 〈B, C , D〉 is PM (D). 〈D, E 〉 is PM (E ). 〈E , F 〉 is PM (F ). 〈ABC 〉 is joint with 〈CD 〉. Neither subsumes the other and both are a subset of C . Meta-group 〈ABC 〉 is the primary meta-group PM (A), PM (B), PM (C ). Meta-group 〈BCD 〉 is the primary meta-group PM (D). A multicast to D is sent to 〈BCD 〉. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 38 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast: Logic Each process knows the propagation tree Each meta-group has a distinguished process ( manager ) SV i [k] at each Pi : # msgs multicast by Pi that will traverse PM (Gk ). Piggybacked on each multicast by Pi . RV manager (PM (Gz )) [k]: # msgs sent by Pk received by PM (Gz ) At manager (PM (Gz )): process M from Pi if SV i [z] = RV manager (PM (Gz )) [i]; else buffer M until condition becomes true At manager of non-primary meta-group: msg order already determined, as it never receives msg directly from sender of multicast. Forward (2d-2g). Correctness for Total Order: Consider MG 1, MG 2 ⊂ Gx , Gy ⇒ PM (Gx ), PM (Gy ) both subsume MG
{ "page_id": null, "source": 7325, "title": "from dpo" }
1, MG 2 and lie on the same branch of the propagation tree to either MG 1 or MG 2 order seen by the ”lower-in-the-tree” primary meta-group (+ FIFO) = order seen by processes in meta-groups subsumed by it > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 39 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast (CO and TO): Code (local variables) array of integers: SV [1 . . . h]; //kept by each process. h is #(primary meta-groups), h ≤ |G| array of integers: RV [1 . . . n]; //kept by each primary meta-group manager. n is #(processes) set of integers: PM set ; //set of primary meta-groups through which message must traverse (1) When process Pi wants to multicast message M to group G :(1a) send M(i, G , SV i ) to manager of PM (G ), primary meta-group of G ;(1b) PM set ←− { primary meta-groups through which M must traverse };(1c) for all PM x ∈ PM set do (1d) SV i [x] ←− SV i [x] + 1. (2) When Pi , the manager of a meta-group MG receives M(k, G , SV k ) from Pj :// Note: Pi may not be a manager of any meta-group (2a) if MG is a primary meta-group then (2b) buffer the message until (SV k [i] = RV i [k]); (2c) RV i [k] ←− RV i [k] + 1; (2d) for each child meta-group that is subsumed by MG do (2e) send M(k, G , SV k ) to the manager of that child meta-group; (2f) if there are no child meta-groups then (2g) send M(k, G , SV k ) to each process in this meta-group. > A. Kshemkalyani and
{ "page_id": null, "source": 7325, "title": "from dpo" }
M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 40 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Propagation Trees for Multicast: Correctness for CO 2 Pk PkP Pi iPM(G’) PM(G) iiP1 234123 4PM(G) PM(G’) 122 31 Case(a) Case (b) Case (c) Case (d) PM(G) PM(G’) PM(G’) PM(G) P Fig 6.17: The four cases for the correctness of causal ordering . The sequence numbers indicate the order in which the msgs are sent. M and M′ multicast to G and G ′, resp. Consider G ∩ G ′ Senders of M, M′ are different. Pi in G receives M, then sends M′. ⇒ ∀ MG q ∈ G ∩ G ′, PM (G ), PM (G ′) are both ancestors of metagroup of Pi I (a) PM (G ′) processes M before M′ I (b) PM (G ) processes M before M′ FIFO ⇒ CO guaranteed for all in G ∩ G ′ Pi sends M to G , then sends M′ to G ′.Test in lines (2a)-(2c) ⇒ I PM (G ′) will not process M′ before M I PM (G ) will not process M′ before M FIFO ⇒ CO guaranteed for all in G ∩ G ′ A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 41 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Classification of Application-Level Multicast Algorithms Destinations privilege rotates Senders Destinations Senders rotates token Sequencers Senders Destinations Fixed sequencer Senders Destinations (d) Destination agreement (a) Privilege−based (b) Moving sequencer (c) Fixed sequencer Communication-history based: RST, KS, Lamport, NewTop Privilege-based: Token-holder multicasts > I processes deliver msgs in order of seq no . > I Typically closed groups, and CO & TO. > I E.g., Totem, On-demand. Moving sequencer: E.g., Chang-Maxemchuck, Pinwheel > I Sequencers’
{ "page_id": null, "source": 7325, "title": "from dpo" }
token has seq no and list of msgs for which seq no has been assigned (these are sent msgs). > I On receiving token, sequencer assigns seq no s to received but unsequenced msgs, and sends the newly sequenced msgs to dests. > I Dests deliver in order of seq no Fixed Sequencer: simplifies moving sequencer approach. E.g., propagation tree, ISIS, Amoeba, Phoenix, Newtop-asymmetric Destination agreement: > I Dests receive limited ordering info. > I (i) Timestamp-based (Lamport’s 3-phase) > I (ii) Agreement-based, among dests. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 42 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Semantics of Fault-Tolerant Multicast (1) Multicast is non-atomic! Well-defined behavior during failure ⇒ well-defined recovery actions if one correct process delivers M, what can be said about the other correct processes and faulty processes being delivered M? if one faulty process delivers M, what can be said about the other correct processes and faulty processes being delivered M? For causal or total order multicast, if one correct or faulty process delivers M, what can be said about other correct processes and faulty processes being delivered M? (Uniform) specifications: specify behavior of faulty processes (benign failure model) Uniform Reliable Multicast of M. Validity. If a correct process multicasts M, then all correct processes will eventually deliver M.(Uniform ) Agreement. If a correct ( or faulty ) process delivers M, then all correct processes will eventually deliver M.(Uniform ) Integrity. Every correct ( or faulty ) process delivers M at most once, and only if M was previously multicast by sender (M). > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 43 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Semantics of Fault-Tolerant Multicast (2)
{ "page_id": null, "source": 7325, "title": "from dpo" }
(Uniform ) FIFO order. If a process broadcasts M before it broadcasts M′, then no correct ( or faulty ) process delivers M′ unless it previously delivered M.(Uniform ) Causal Order. If a process broadcasts M causally before it broadcasts M′,then no correct ( or faulty ) process delivers M′ unless it previously delivered M.(Uniform ) Total Order. If correct ( or faulty ) processes a and b both deliver M and M′,then a delivers M before M′ if and only if b delivers M before M′.Specs based on global clock or local clock (needs clock synchronization) (Uniform ) Real-time ∆-Timeliness. For some known constant ∆, if M is multicast at real-time t, then no correct ( or faulty ) process delivers M after real-time t + ∆. (Uniform ) Local ∆-Timeliness. For some known constant ∆, if M is multicast at local time tm, then no correct ( or faulty ) process delivers M after its local time tm + ∆. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 44 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Reverse Path Forwarding (RPF) for Constrained Flooding Network layer multicast exploits topology, e.g., bridged LANs use spannint trees for learning dests and distributing information, IP layer RPF approximates DVR/ LSR-like algorithms at lower cost Broadcast gets curtailed to approximate a spanning tree Approx. to rooted spanning tree is identified without being computed/stored # msgs closer to |N| than to |L| (1) When Pi wants to multicast M to group Dests :(1a) send M(i, Dests ) on all outgoing links. (2) When a node i receives M(x, Dests ) from node j:(2a) if Next hop (x) = j then // this will necessarily be a new message (2b) forward M(x, Dests ) on all
{ "page_id": null, "source": 7325, "title": "from dpo" }
other incident links besides ( i, j); (2c) else ignore the message. > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 45 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Steiner Trees Steiner tree Given a weighted graph ( N, L) and a subset N′ ⊆ N, identify a subset L′ ⊆ L such that ( N′, L′) is a subgraph of ( N, L) that connects all the nodes of N′.A minimal Steiner tree is a minimal weight subgraph ( N′, L′). NP-complete ⇒ need heuristics Cost of routing scheme R: Network cost: ∑ cost of Steiner tree edges Destination cost: 1 N′ ∑ i∈N′ cost (i), where cost (i) is cost of path ( s, i) > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 46 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Kou-Markowsky-Berman Heuristic for Steiner Tree Input: weighted graph G = ( N, L), and N′ ⊆ N, where N′ is the set of Steiner points > 1 Construct the complete undirected distance graph G ′ = ( N′, L′) as follows. L′ = {(vi , vj ) | vi , vj in N′}, and wt (vi , vj ) is the length of the shortest path from vi to vj in ( N, L). > 2 Let T ′ be the minimal spanning tree of G ′. If there are multiple minimum spanning trees, select one randomly. > 3 Construct a subgraph Gs of G by replacing each edge of the MST T ′ of G ′, by its corresponding shortest path in G . If there are multiple shortest paths, select one randomly. > 4 Find the minimum spanning tree Ts of Gs . If there are multiple minimum
{ "page_id": null, "source": 7325, "title": "from dpo" }
spanning trees, select one randomly. > 5 Using Ts , delete edges as necessary so that all the leaves are the Steiner points N′. The resulting tree, TSteiner , is the heuristic’s solution. Approximation ratio = 2 (even without steps (4) and (5) added by KMB) Time complexity: Step (1): O(|N′| · | N|2), Step (2): O(|N′|2), Step (3): O(|N|), Step (4): O(|N|2), Step (5): O(|N|). Step (1) dominates, hence O(|N′| · | N|2). > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 47 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Constrained (Delay-bounded) Steiner Trees C(l) and D(l): cost, integer delay for edge l ∈ L Definition For a given delay tolerance ∆, a given source s and a destination set Dest , where {s} ∪ Dest = N′ ⊆ N, identify a spanning tree T covering all the nodes in N′,subject to the constraints below. ∑ l∈T C (l) is minimized, subject to ∀v ∈ N′, ∑ l∈path (s,v ) D(l) A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 48 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Constrained (Delay-Bounded) Steiner Trees: Algorithm C(l), D(l); // cost, delay of edge l T ; // constrained spanning tree to be constructed P(x, y ); // path from x to y PC (x, y ), PD (x, y ); // cost, delay of constrained cheapest path from x to y Cd (x, y ); // cost of
{ "page_id": null, "source": 7325, "title": "from dpo" }
the cheapest path with delay exactly d Input: weighted graph G = ( N, L), and N′ ⊆ N, where N′ is the set of Steiner points and source s; ∆ is the constraint on delay. 1 Compute the closure graph G ′ on ( N′, L), to be the complete graph on N′. The closure graph is computed using the all-pairs constrained cheapest paths using a dynamic programming approach analogous to Floyd’s algorithm. For any pair of nodes x, y ∈ N′: I Pc (x, y ) = min d<∆ Cd (x, y ) This selects the cheapest constrained path, satisfying the condition of ∆, among the various paths possible between x and y . The various Cd (x, y ) can be calculated using DP as follows. I Cd (x, y ) = min z∈N {C d−D (z,y )(x, z) + C(z, y )} For a candidate path from x to y passing through z, the path with weight exactly d must have a delay of d − D (z, y ) for x to z when the edge ( z, y ) has delay D(z, y ). In this manner, the complete closure graph G ′ is computed. PD (x, y ) is the constrained cheapest path that corresponds to PC (x, y ). 2 Construct a constrained spanning tree of G ′ using a greedy approach that sequentially adds edges to the subtree of the constrained spanning tree T (thus far) until all the Steiner points are included. The initial value of T is the singleton s. Consider that node u is in the tree and we are considering whether to add edge ( u, v ). The following two edge selection criteria (heuristics) can be used to decide whether to include edge ( u, v
{ "page_id": null, "source": 7325, "title": "from dpo" }
) in the tree. I Heuristic CST CD : fCD (u, v ) =  C(u,v )∆−(PD (s,u)+ D(u,v )) , if PD (s, u) + D(u, v ) A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 50 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Constrained (Delay-Bounded) Steiner Trees: Heuristics,
{ "page_id": null, "source": 7325, "title": "from dpo" }
Time Complexity Heuristic CST CD : Tries to choose low-cost edges, while also trying to maximize the remaining allowable delay. Heuristic CST C : Minimizes the cost while ensuring that the delay bound is met. step (1) which finds the constrained cheapest shortest paths over all the nodes costs O(n3∆). Step (2) which constructs the constrained MST on the closure graph having k nodes costs O(k3). Step (3) which expands the constrained spanning tree, involves expanding the k edges to up to n − 1 edges each and then eliminating loops. This costs O(kn ). Dominating step is step (1). > A. Kshemkalyani and M. Singhal (Distributed Computing) Message Ordering and Group Commnication CUP 2008 51 / 52 Distributed Computing: Principles, Algorithms, and Systems ## Core-based Trees Multicast tree constructed dynamically, grows on demand. Each group has a core node(s) > 1 A node wishing to join the tree as a receiver sends a unicast join message to the core node. > 2 The join marks the edges as it travels; it either reaches the core node, or some node already part of the tree. The path followed by the join till the core/multicast tree is grafted to the multicast tree. > 3 A node on the tree multicasts a message by using a flooding on the core tree. > 4 A node not on the tree sends a message towards the core node; as soon as the message reaches any node on the tree, it is flooded on the tree.
{ "page_id": null, "source": 7325, "title": "from dpo" }
Title: URL Source: Markdown Content: # Distributed Algorithms Fall 2020 ## Reliable & Causal Broadcast - solutions 1st exercise session, 28/09/2020 Matteo Monti Jovan Komatovic 1Reliable broadcast Specification: ● Validity : If a correct process broadcasts m, then it eventually delivers m.● Integrity : m is delivered by a process at most once, and only if it was previously broadcast. ● Agreement : If a correct process delivers m, then all correct processes eventually deliver m. > 2 ## Algorithm: Lazy Reliable Broadcast Strong accuracy: No correct process is ever suspected: Strong completeness: Eventually, every faulty process is permanently suspected by every correct process: Where: ● crashed(F) is the set of crashed processes. ● correct(F) is the set of correct processes. ● H(p, t) is the output of the failure detector of process p at time t. 3Exercise 1 Implement a reliable broadcast algorithm without using any failure detector, i.e., using only BestEffort-Broadcast(BEB) . > 4 ## Exercise 1 (Solution) Use a step of all-to-all communication. In particular, very process that gets a message relays it immediately. Recall that in the original algorithm, processes were relaying messages from a process p only if p crashes. > 5 upon initialization do delivered := {} upon RB-broadcast(m) do send(m) to Π \ {p} RB-deliver(m) upon BEB-receive(m) from q do if not m ∈ delivered send (m) to Π \ {p, q} RB-deliver(m) delivered := delivered ∪ m Agreement : Before RB-delivering m, a correct process p forwards m to all processes. By the properties of perfect channels and the fact that p is correct, all correct processes will eventually receive m and RB-deliver it. Exercise 2 The reliable broadcast algorithm presented in class has the processes continuously fill their different buffers without emptying them. Modify it to remove (i.e. garbage collect)
{ "page_id": null, "source": 7325, "title": "from dpo" }
unnecessary messages from the buffers: A. from , and B. delivered > 6 ## Exercise 2 (Solution) A. The from buffer is used only to store messages that are relayed in the case of a failure. Therefore, messages from the from buffer can be removed as soon as they are relayed. B. Messages from the delivered array cannot be removed. Consider this scenario: If a process crashes and its messages are retransmitted by two different processes, then a process might RB-deliver the same message twice if it empties the delivered buffer in the meantime. This is a violation of the “no duplication” property. > 7 ## Uniform reliable broadcast Specification: ● Validity : If a correct process broadcasts m, then it eventually delivers m.● Integrity : m is delivered by a process at most once, and only if it was previously broadcast. ● Uniform Agreement : If a correct process delivers m, then all correct processes eventually deliver m. > 8 ## Algorithm: All-Ack Uniform Reliable Broadcast > 9 ## Exercise 3 What happens in the reliable broadcast and uniform reliable broadcast algorithms if the: A. accuracy, or B. completeness property of the failure detector is violated? > 10 ## Exercise 3 (Solution 1/2) Reliable broadcast: 1. Suppose that accuracy is violated. Then, the processes might be relaying messages when this is not really necessary. This wastes resource, but does not impact correctness. 2. Suppose that completeness is violated. Then, the processes might not be relaying messages they should be relaying. This may violate agreement. For instance, assume that only a single process p 1 BEB-delivers (hence RB-delivers) a message m from a crashed process p 2 . If a failure detector (at p 1 ) does not ever suspect p 2 , no other correct process will deliver m
{ "page_id": null, "source": 7325, "title": "from dpo" }
(agreement is violated). > 11 ## Exercise 3 (Solution 2/2) Uniform Reliable broadcast: Consider a system of three processes p 1 , p 2 and p 3 . Assume that p 1URB-broadcasts the message m. 1. Suppose that accuracy is violated. Assume that p 1 falsely suspects p 2 and p 3to have crashed. p 1 eventually URB-delivers m. Assume that p 1 crashes afterwards. It may happen that p 2 and p 3 never BEB-deliver m and have no knowledge about m (uniform agreement is violated). 2. Suppose that completeness is violated. p 1 might never URB-deliver m if either p 2 or p 3 crashes and p 1 never detects their crash. Hence, p 1 would wait indefinitely for p 2 and p 3 to relay m (validity property violation) > 12 ## Exercise 4 Implement a uniform reliable broadcast algorithm without using any failure detector, i.e., using only BestEffort-Broadcast(BEB) . > 13 ## Exercise 4 (Solution) Just modify the “candeliver” function. > Function candeliver(m) returns Boolean is return #(ack[m]) > N / 2 Uniform agreement: Suppose that a correct process delivers m. That means that at least one correct process p “acknowledged” m (rebroadcast m using BestEffortBroadcast). Consequently, all correct processes eventually deliver m from BestEffortBroadcast broadcast by p and rebroadcast m themselves (if they have not done that yet). Hence, every correct process eventually collects at least N/2 acknowledgements and delivers m. > 14 ## Causal Broadcast Definition (Happens-before): We say that an event e happens-before an event e’ , and we write e → e’ , if one of the following three cases holds (is true): (e and e’ are executed by the same process) (e and e’ are send/receive events of a message respectively) (i.e. → is transitive) > 15 ## Causal Broadcast Specification:
{ "page_id": null, "source": 7325, "title": "from dpo" }
It has the same specification of reliable broadcast, with the additional ordering constraint of causal order. More precisely (causal order): Which means that: If the broadcast of a message m happens-before the broadcast of a message m’ , then no process delivers m’ unless it has previously delivered m. > 16 ## Exercise 5 Can we devise a broadcast algorithm that does not ensure the causal delivery property but only (in) its non-uniform variant: No correct process p i delivers a message m 2 unless p i has already delivered every message m 1 such that m 1 → m 2 ? > 17 ## Exercise 5 (Solution) No! Assume that some algorithm does not ensure the causal delivery property but ensures its non-uniform variant. Assume also that m 1 → m 2 .This means that a correct process has to deliver m 1 before delivering m 2 , but a faulty process is allowed to deliver m 2 and not deliver m 1 .However, a process doesn’t know that is faulty in advance (i.e., before it crashes). So, no algorithm can “treat faulty processes in a special way”, i.e., a process has to behave correctly until it crashes. Reminder (Causal delivery property): For any message m 1 that potentially caused a message m 2 , i.e., m1 → m2, no process delivers m 2 unless it has already delivered m 1 . 18 Exercise 6 Suggest a memory optimization of the garbage collection scheme of the following algorithm: No-Waiting Causal Broadcast Garbage-Collection of Causal Past in the “No-Waiting Causal Broadcast” > left is > 19 ## Exercise 6 (Solution) When removing a message m from the past, we can also remove all the messages that causally precede this message — and then recursively those that causally precede these. >
{ "page_id": null, "source": 7325, "title": "from dpo" }
20 ## Exercise 7 Can we devise a Best-effort Broadcast algorithm that satisfies the causal delivery property, without being a causal broadcast algorithm, i.e., without satisfying the agreement property of a reliable broadcast? > 21 ## Exercise 7 (Solution 1/2) No! Assume that some broadcast algorithm ensures the causal delivery property and is not reliable, but best-effort; define an instance co of the corresponding abstraction, where processes co -broadcast and co -deliver messages. The only way for an algorithm to be best-effort broadcast but not reliable broadcast is to violate the agreement property: there must be some execution of the algorithm where some correct process p co -delivers a message m that some other process q does not ever co -deliver. This is possible in a best-effort broadcast algorithm, in fact this can only happen if the process s that co -broadcasts the message m is faulty (and crashes during the broadcast of m). > 22 ## Exercise 7 (Solution 2/2) Assume now that after co -delivering m, process p co-broadcasts a message m’. Given that p is correct and that the broadcast is best-effort, all correct processes, including q, will co-deliver m’. Given that m precedes m’ (in causal order), q must have co-delivered m as well, a contradiction. Hence, any best-effort broadcast that satisfies the causal delivery property satisfies agreement and is, thus, also a reliable broadcast. > 23 > In a nutshell: s > p > q > m > m’ But should have delivered m before! ## Exercise 8 In the “Waiting Causal Broadcast”, we say that V ≤ W if, for every i = 1, …, N, it holds that V[i] ≤ W[i]. Question: Why do we not use “ 24 ## Exercise 8 (Solution) Let V be encoding of the
{ "page_id": null, "source": 7325, "title": "from dpo" }
past of process q, and W be the encoding of the sender s at the moment of sending a message m. “V[p] = W[p]” means that q is not “missing” any messages from p that s had delivered before it sent m. Hence, q should not wait for any other messages with sender p and should deliver m. Example: Suppose that s broadcasts m with the vector clock [0, …, 0]. Then, no process delivers m if we use “<” instead of “≤”.
{ "page_id": null, "source": 7325, "title": "from dpo" }
Title: URL Source: Published Time: 2006-03-01T08:11:00.000Z Markdown Content: # The Failure Detector Abstraction Felix C. Freiling, University of Mannheim and Rachid Guerraoui, EPFL and MIT CSAIL and Petr Kouznetsov, MPI-SWS University of Mannheim Faculty of Mathematics and Computer Science D-68131 Mannheim, Germany Technical Report TR 2006-003 Feb. 10, 2006 This paper surveys the failure detector concept through two dimensions. First we study fail-ure detectors as building blocks to simplify the design of reliable distributed algorithms. More specifically, we illustrate how failure detectors can factor out timing assumptions to detect fail-ures in distributed agreement algorithms. Second, we study failure detectors as computability benchmarks. That is, we survey the weakest failure detector question and illustrate how failure detectors can be used to classify problems. We also highlights some limitations of the failure detector abstraction along each of the dimensions. Categories and Subject Descriptors: A.1 [ General Literature ]: Introductory and Survey; C.4 [Computer Systems Organization ]: Performance of Systems— fault tolerance; modeling tech-niques; reliability, availability, and serviceability General Terms: Algorithms, Design, Reliability, Theory Additional Key Words and Phrases: distributed system, agreement problem, consensus, atomic commit fault tolerance, liveness, message passing, safety, synchrony The first author’s work was supported by the Deutsche Forschungsgemeinschaft (DFG) as part of the Emmy Noether programme. Contact author’s address: University of Mannheim, Department of Computer Science, D-68131 Mannheim, Germany, contact author email: fcg@acm.org 2 · Freiling, Guerraoui, Kouznetsov Contents 1 Introduction 12 Failure detector as a programming building block 1 2.1 Failure Detection using Timeouts . . . . . . . . . . . . . . . . . . . . 22.1.1 Non-Blocking Atomic Commit . . . . . . . . . . . . . . . . . 22.1.2 Three-Phase Commit . . . . . . . .
{ "page_id": null, "source": 7326, "title": "from dpo" }
. . . . . . . . . . . . . . 32.1.3 Three-Phase Commit with Timeouts . . . . . . . . . . . . . . 32.1.4 Correctness of Timeout-Based Solutions . . . . . . . . . . . . 42.1.5 Synchronous Systems . . . . . . . . . . . . . . . . . . . . . . 52.1.6 Asynchronous Model . . . . . . . . . . . . . . . . . . . . . . . 62.1.7 Timeouts in the Asynchronous Model . . . . . . . . . . . . . 62.1.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Failure Detectors as Useful Distributed Services . . . . . . . . . . . . 72.2.1 Perfect Failure Detectors . . . . . . . . . . . . . . . . . . . . 72.2.2 Asynchronous Models with Failure Detectors . . . . . . . . . 82.2.3 Non-Blocking Atomic Commit with a Perfect Failure Detector 82.2.4 Solving Consensus using Failure Detectors . . . . . . . . . . . 92.2.5 Unreliable Failure Detectors . . . . . . . . . . . . . . . . . . . 10 2.2.6 Other Failure Detectors . . . . . . . . . . . . . . . . . . . . . 11 2.2.7 Justifying Unreliable Failure Detectors . . . . . . . . . .
{ "page_id": null, "source": 7326, "title": "from dpo" }
. . . 12 2.2.8 Using and Combining Different Failure Detector Abstractions 12 2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 Failure Detectors as a Computability Benchmark 14 3.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.2 The weakest failure detector for consensus . . . . . . . . . . . . . . . 18 3.2.1 Overview of the reduction algorithm . . . . . . . . . . . . . . 18 3.2.2 Building a DAG . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2.3 Simulation trees . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.2.4 Tags and valences . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2.5 Stabilization . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.6 Critical index . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.7 Handling a univalent critical index . . . . . .
{ "page_id": null, "source": 7326, "title": "from dpo" }
. . . . . . . . . 21 3.2.8 Handling a bivalent critical index . . . . . . . . . . . . . . . . 22 3.2.9 The reduction algorithm . . . . . . . . . . . . . . . . . . . . . 24 3.3 The weakest failure detector for a register . . . . . . . . . . . . . . . 25 3.3.1 Read/write shared memory . . . . . . . . . . . . . . . . . . . 26 3.3.2 The sufficiency part . . . . . . . . . . . . . . . . . . . . . . . 26 3.3.3 The reduction algorithm . . . . . . . . . . . . . . . . . . . . . 26 3.3.4 Solving consensus in all environments . . . . . . . . . . . . . 28 3.4 Solving Non-Blocking Atomic Commit . . . . . . . . . . . . . . . . . 28 3.4.1 Failure detector Ψ . . . . . . . . . . . . . . . . . . . . . . . . 28 3.4.2 Using (Ψ , FS ) to solve NBAC . . . . . . . . . . . . . . . . . . 28 3.4.3 The weakest failure detector to solve NBAC . . . . . . . . . . 29 3.5 Summary . . . . . . . . . . . . . . . . . .
{ "page_id": null, "source": 7326, "title": "from dpo" }
. . . . . . . . . . . . . . . 30 The Failure Detector Abstraction · 3 4 Limitations of Failure Detectors 30 4.1 What is not a Failure Detector? . . . . . . . . . . . . . . . . . . . . . 30 4.2 Do Failure Detectors make sense outside of the crash model? . . . . 31 4.3 Can Randomization be used to implement Failure Detectors? . . . . 32 4.4 Can Failure Detectors be used to Reason about Real-Time? . . . . . 33 5 Summary 33 The Failure Detector Abstraction · 1 1. INTRODUCTION Advances in computing are typically achieved through the identification of abstrac-tions that factor out specifics of an actual processor or machine. In the early times, abstractions like record, set or arrays helped the emancipation from assemblies and machine languages. In the area of concurrent computing for instance, abstractions like threads, semaphores and monitors were very helpful in understanding concurrent programs and reasoning about their correctness. In the area of distributed computation, the remote procedure call abstraction helped factor out the details of the network and was a key to the popularity of standard distributed middleware infrastructures. In short, the remote procedure call abstraction hides the possible differences between languages and operating systems on different machines, and encapsulate serializa-tion and de-serialization mechanisms to transfer data over the wire. This abstraction does not however help capture another fundamental character-istic of distributed systems: partial failures. Basically, if a process of some machine remotely invokes an operation on a process performing on a different machine, and the latter machine fails, an exception is raised. The way the failure is detected is usually achieved using a timeout mechanism. Typically, a timeout
{ "page_id": null, "source": 7326, "title": "from dpo" }
delay is associ-ated with the operation and when it expires, the exception is raised. Programming with timeouts is however difficult as the adequate way of choosing the duration of a timeout might vary from a system to another one, and might even dynamically depend on the load of the system. Basically, failure detectors are abstract devices that offer abstract information about the operational status of processes in a distributed system [Chandra and Toueg 1996]. We believe that the failure abstraction is a fundamental one and should sit as a first class citizen of a distributed programming library. In fact, and as we survey in this paper, the failure abstraction can also help classify problems in distributed computing [Chandra et al. 1996]. This paper is structured into three parts which can be read independently: the first part (Section 2) looks at failure detectors from an engineering point of view and discusses the advantages of using failure detectors in the design, programming and analysis of distributed algorithms. The second part (Section 3) takes a more theoretical perspective and discusses the role that failure detectors can play to compare and distinguish problem spec-ifications in distributed systems. We define here the notion of a failure detector in a precise manner. Our representation is pretty intuitive and is “time-free”. It is in this sense more coarse-grained than in [Chandra et al. 1996]. Basically, our definition of a failure pattern is simpler and does not take into account when ex-actly failures occur. For the purpose of our survey, we believe it to be sufficient to consider a “time-free” representation. In the third part (Section 4), we take some perspective to underly some limita-tions of the failure detector abstraction . 2. FAILURE DETECTOR AS A PROGRAMMING BUILDING BLOCK Information about the operational state of remote processes is
{ "page_id": null, "source": 7326, "title": "from dpo" }
often necessary to implement reliable distributed services. In this section we argue that the failure 2 · Freiling, Guerraoui, Kouznetsov detector abstraction is a sensible one from an engineering point of view. In Section 2.1 we first review the standard methods of implementing failure de-tection (based on timeouts) and discuss their problems. In Section 2.2 we then informally introduce the failure detector abstraction and argue that it has several advantages over explicit use of timeouts: (1) It separates the concerns of reason-ing about failures and reasoning about time and therefore makes programs simpler to write and analyze; (2) It allows to express information about failures in a way which is closer to the control logic of many applications, so it allows to write simpler and more elegant programs; (3) It allows independent implementation and service sharing and therefore even has the potential of building more efficient applications. 2.1 Failure Detection using Timeouts 2.1.1 Non-Blocking Atomic Commit. Consider the omnipresent problem of non-blocking atomic commit in a distributed database [Bernstein et al. 1987, Chapter 7]. In a distributed database, data is stored at multiple sites, usually close to the location where it is used so that read and write operations on the data can be performed more efficiently. A distributed transaction groups a sequence of read and write operations together and ensures that either all are executed or none of them. For example, a bank might choose to store customer account data at the local branch closest to the customer’s home. A debit of, say, $100 then involves a read and a write of the local data, but it may be accompanied by a log update for statistical purposes or the query of a customer’s clearance at a central server. A transaction ensures that these operations are executed atomically despite site
{ "page_id": null, "source": 7326, "title": "from dpo" }
or communication failures. For simplicity, we will identify a site of the distributed database with the process of the database management system running on that site. More precisely, at the end of the transaction each participating process votes yes (“I am willing to commit”) or no (“we must abort”), and eventually processes must reach a common decision, commit or abort . A non-blocking atomic commit protocol ensures that the following properties hold: (1) All processes which manage to reach a decision on the outcome of the transac-tion agree on the decision. (2) A process cannot reverse its decision. (3) A commit decision can only be reached if all processes vote yes .(4) If all processes vote yes and there are no failures, then the decision must be commit .(5) Assuming that there are only expected failures, every (surviving) process must eventually reach a decision. The terms “expected failures” and “surviving process” in the fifth clause refer to the particular failure assumption made by the system designers. In practical settings, this often translates to rarely occurring benign crash failures of processes with subsequent repair and recovery . For simplicity, unless explicitly stated otherwise, we will disregard recovery i.e., we assume that a failed process simply stops to execute steps of its algorithm and does not send or receive messages anymore (messages The Failure Detector Abstraction · 3 sent to crashed processes are lost). We will call a process which does not crash a correct process. 2.1.2 Three-Phase Commit. Three-phase commit (3PC) is a well-known proto-col to implement non-blocking atomic commit. 3PC refines the popular two-phase commit (2PC) protocol, which is widely used in distributed databases (although 2PC is a blocking protocol, i.e., it does not satisfy the final termination property of non-blocking atomic commit in every execution). 3PC makes use of
{ "page_id": null, "source": 7326, "title": "from dpo" }
a particular coordinator process. ¿From now on, assume that there are n processes called p1, p 2, . . . , p n (n > 1) and that process p1 plays the role of the coordinator. In general, 3PC works as follows [Bernstein et al. 1987, p. 242]: (1) The coordinator p1 sends a vote request to all other processes. (2) When a process receives a vote request, it responds with either yes or no ,depending on its vote. If it sends no it decides abort , and stops. (3) The coordinator collects his own vote and the vote messages from all other processes. If any of these votes was no then the coordinator decides abort ,sends an abort message to all processes which votes yes , and stops. Otherwise the coordinator sends a pre-commit message to all processes. (4) A process which votes yes waits for a pre-commit message or an abort message. If it receives an abort message, it decides abort and stops. If it receives a pre-commit message, it responds with an acknowledgement to the coordinator. (5) The coordinator collects the acknowledgements from all processes. When they have all been received, he decides commit , sends a commit message to all pro-cesses, and stops. (6) Other processes wait for the commit message from the coordinator. When they receive this message, they decide commit , and stop. In the absence of failures, it is rather easy to see that the protocol satisfies the five requirements of the non-blocking atomic commit problem. However, there are several points in the protocol in which crash failures can cause a process to wait indefinitely for a message and hinder correct processes from reaching a decision. In practice, this is prevented using timeouts .2.1.3 Three-Phase Commit with Timeouts. It makes no sense to
{ "page_id": null, "source": 7326, "title": "from dpo" }
wait for a mes-sage from a crashed process. So how can we find out whether a remote process is still operational or not? A pragmatic way is to monitor the time it takes for a process to send a reply. The round-trip delay is a network parameter which denotes the time it takes to send a message to a remote process and receive an answer from that process. Usually it is safe to assume a time interval ρ as an upper bound on the round-trip delay, meaning that if a reply has not arrived after ρ time has elapsed since sending, then the remote process is not operational anymore. In this case we say that the process times out after ρ time units and ρ is the timeout interval (or simply timeout ). In the 3PC algorithm there are several places which should be enhanced with a timeout mechanism. For example, in step 2, processes wait for a vote request from the coordinator. The relevant part of the algorithm is depicted at the top of Fig. 1. 4 · Freiling, Guerraoui, Kouznetsov > wait for 〈vote request 〉from p1 > timeout := clock +ρ > while timeout >clock ∧ ¬〈 vote request arrived from p1〉do skip endwhile if ¬〈 vote request arrived from p1〉then > 〈decide abort 〉 > endif > Fig. 1. Adding explicit timeout actions to potentially blocking program statements in three-phase commit. If a process fails to receive such a message, it can unilaterally decide abort since it could have forced this decision through its own vote anyway. In the algorithm, the process needs to monitor the time and wait until the timeout period ρ has elapsed. In case this happens, a timeout action is activated. This is shown at the bottom of Fig. 1 where the
{ "page_id": null, "source": 7326, "title": "from dpo" }
variable clock refers to the value of the real-time clock of that process. From the figure it should be clear that adding explicit timeouts to the algorithm quickly obscures the code and makes correctness arguments much more tricky. Every statement in the 3PC algorithm which could potentially block needs to be enhanced with a similar timeout construct. Choosing the correct action upon timeout is rather tricky in some cases. For example, if a process times out on either a pre-commit message (in step 4) or the final commit message (in step 6) from the coordinator, it needs to communicate with the other processes since the coordinator has presumably failed. In this case, a termination protocol is invoked: All surviving processes elect a new coordinator which collects the individual states of all participating processes and enforces a consistent decision. Election is based on some pre-determined order on processes (like the process identifier). The ter-mination protocol is reentrant: if the newly elected coordinator fails within the termination protocol, the same protocol is started anew. In the end, either one correct process will eventually survive and enforce a decision or all processes will fail. 2.1.4 Correctness of Timeout-Based Solutions. The timeout intervals are usu-ally real-time instances obtained from analyzing the characteristics of the underly-ing network. In fixing the timeout value ρ, there is a notorious tradeoff between correctness and efficiency. In order to not time out too early (i.e., when the remote process is not crashed), we would like to set ρ very conservatively, i.e., make it very large. However, a large value of ρ means that the protocol blocks for a very long time before making progress again in case of failure. The guideline is to make ρ as large as necessary but as small as possible. Determining good timeout values still
{ "page_id": null, "source": 7326, "title": "from dpo" }
poses problems even to experienced engi-neers. The main reason for this is that ρ can only be determined with certainty in networks which offer certain real-time guarantees and most networks in use today (like local area Ethernets or the global Internet) do not fall into this category. As an extreme example, measurements of round-trip delays on the Internet for many The Failure Detector Abstraction · 5 years [Long et al. 1991; Paxson and Adams 2002] consistently show that there is a large temporal and spatial variation in round-trip delays and the distribution is asymmetric with a long tail on the right hand side. This means that fixing a large timeout value does not necessarily always guarantee correctness of timeout-based reasoning, it merely decreases the probability of making mistakes. However, the usefulness and efficiency of the timeout-based 3PC algorithm above crucially de-pend on good reasoning via timeouts. Continued premature expiration of a too small timeout may prevent any transaction from commiting successfully. For ex-ample, it makes sense to wait longer (i.e., have larger timeout values) during the beginning of the 3PC algorithm in order to increase the probability of all processes voting yes ; for this to happen, they shouldn’t time out prematurely on the vote request from the coordinator. Towards the end of the algorithm, e.g., when the coordinator is about to broadcast the commit message, shorter timeouts are feasi-ble since the result of the transaction has been determined already. In this case, a wrong but quick suspicion of a slow coordinator may even speed up the transaction if that coordinator is replaced by a very fast one. 2.1.5 Synchronous Systems. It is possible to characterize those systems in which timeout-based reasoning is always correct. These systems are characterized by bounds on the two critical system parameters: the message delivery
{ "page_id": null, "source": 7326, "title": "from dpo" }
delay and the relative processing speed difference. We will denote these bounds by δ (processing speed bound) and ∆ (message delivery delay bound) and assume that time is mea-sured in the number of steps which a process has executed. This abstraction does not limit the generality of the following statements since it is possible to relate the number of steps of a process to real-time intervals in practice. The bounds δ and ∆ have the following meaning: —Processing speeds: In the time it takes for any process to take δ steps, all other processes must take at least one step. —Message delivery delay: If a process sends a message m at some point k in the execution, then m must be delivered after at most ∆ execution steps of the sending process following k.A bound ρ on the round-trip delay between two processes p and q can be computed from δ and ∆ as follows: ρ = ∆ + δ + δ · ∆First, it takes at most ∆ steps of the sending process p for the message to travel from p to q. Then, after at most δ steps of process p the receiving process must have executed at least one step (which should include receiving the message and sending a reply). Finally, after at most δ steps of process q the message must arrive back at p. Since q may operate much slower than p and δ is measured in steps of q, we need to multiply δ with ∆, yielding an upper bound on the time it takes for q to execute δ steps. Because of the bound ∆ on relative processing speeds it is possible for any process to give bounds on the number of steps any other process in the system has executed. This means
{ "page_id": null, "source": 7326, "title": "from dpo" }
that there exists a notion of global time in the system. Because of this, these systems are called synchronous . If a system can be characterized as synchronous, then timeout-based reasoning always leads to correct conclusions. 6 · Freiling, Guerraoui, Kouznetsov In practice, the beforementioned synchrony conditions are usually expressed in terms of real time. For this it is assumed that events in the system can be related to some external source of real time. Then the bound δ is the real-time interval in which processes have to take at least one step, and ∆ refers to that real-time interval within which every message must be delivered. Concerning processing speeds, it is sometimes assumed that processes have access to local hardware clocks and that δ is a bound on the drift rate of these clocks. However this does not mean that the system is synchronous in the sense above [Cristian and Fetzer 1999]. That local clocks advance at a steady rate does not mean that processes advance equally within their local algorithms. 2.1.6 Asynchronous Model. As mentioned above, having a synchronous system is not realistic in many practical situations. In fact, from an engineering perspec-tive it makes sense to make very little assumptions about the underlying network characteristics because this achieves the highest assumption coverage [Powell 1992]. Assumption coverage refers to the probability that the assumptions about the un-derlying network hold in a particular mission environment. More and stronger assumptions (e.g., about synchrony) achieve less assumption coverage, and only a high assumption coverage ensures that the algorithms (e.g., reasoning with time-outs) work as expected in practice. The highest assumption coverage (with respect to synchrony) is achieved by system models which have no timing assumptions whatsoever. These systems are usually refered to as time-free [Cristian and Fetzer 1999] or asynchronous [Fischer
{ "page_id": null, "source": 7326, "title": "from dpo" }
et al. 1985] (see Schneider for a discussion of these models). They can be characterized by the following basic statements: —A system is modeled as a set of processes connected by reliable communication channels. —Communication is by point-to-point message passing using send and receive prim-itives. —Usually it is assumed that the network is fully connected, i.e., every process can directly send messages to every other process. —There is no order on delivery of messages through the channels. —Receive and send are distinct atomic operations. —There is no bound on relative processing speeds of processes and on the message delivery delays. These points result in two things: Firstly, messages can take an arbitrary (but finite) time to travel from one process to the other. This means that a message sent at some point k during the execution of an algorithm will be received at its destination after arbitrarily (but finitely) many execution steps following k. Secondly, processes can be arbitrarily slow, meaning that in the time it takes a process p to take a single step, another process q can take any finite number of steps. The Internet is usually modeled as an asynchronous system. 2.1.7 Timeouts in the Asynchronous Model. Unfortunately, because of the ab-sence of any synchrony assumptions, it is impossible to do timeout-based reasoning The Failure Detector Abstraction · 7 in asynchronous systems. To see this, consider a process p which monitors the op-erational state of a process q using timeouts. Since there are no bounds δ and ∆ we cannot use the formula above to calculate a timeout bound ρ. So even if p sets its timeout to a very large (finite) value the round-trip time to q can exceed any finite value. It is merely guaranteed that (if q does not crash), the reply will
{ "page_id": null, "source": 7326, "title": "from dpo" }
eventually arrive at p so at least p will eventually learn that it might have performed incorrect timeout-based reasoning [Garg and Mitchell 1998a]. 2.1.8 Summary. In many practical situations (like in atomic transactions) it is necessary to know the operational state of a remote process. The most com-mon way to get this information is to use timeout-based reasoning. Algorithms which use explicit timeouts quickly become very ugly. Moreover, timeout-based reasoning is only valid in systems with strict timing guarantees. In other types of systems, timeout-based reasoning is uncertain or even impossible. This is unfortu-nate since this weakens the usefulness of timeout-based reasoning exactly in those (asynchronous) systems which are considered most common in practice. A path out of this dilemma is to introduce the abstraction of a failure detector , which we discuss in the following sections. 2.2 Failure Detectors as Useful Distributed Services In the previous sections we have already talked about using the synchrony bounds for detecting crash failures of other processes. However, this perspective has mixed two separate concerns: (1) the abstract functionality of detecting process crashes, and (2) a way to implement this abstract functionality using synchrony bounds. As we show later, we could write a correct 3PC algorithm in systems without any explicit synchrony assumptions as long as we have a means to still detect process crashes. Separating these concerns is at the heart of the concept of failure detectors ,which has been introduced by Chandra and Toueg . Failure detectors are oracles that produce (possibly incomplete and unreliable) information about the operational state of processes. 2.2.1 Perfect Failure Detectors. In the understanding of Chandra and Toueg , a failure detector is composed of several failure detector modules, one at each process. To introduce the concept, consider a process p which is equipped with a
{ "page_id": null, "source": 7326, "title": "from dpo" }
failure detector module which indicates the operational state ( up /down ) of a process q. If the failure detector responds with down , we say that the failure detector at p suspects q.Similar to other types of detectors in distributed systems (such as termination detectors [Dijkstra et al. 1983] or general predicate detectors [Chandy and Misra 1988; Arora and Kulkarni 1998]) the failure detector module at p should guarantee two things: —It never suspects q unless q has actually crashed, and —if q has crashed, then the failure detector module at p will eventually permanently suspect q to have crashed. 8 · Freiling, Guerraoui, Kouznetsov Obviously, the failure detector can be extended to the two process case by simply adding a failure detector module to q and requiring that each module detect the crash of the other process. Similarly, the definition of such a failure detector can be extended to the n process case. Here it is important to note that every failure detector module at every process is responsible for checking the operational states of all other processes in the system. This means that the output of such a failure detector module is a general predicate involving all other processes. The failure detectors introduced by Chandra and Toueg output a list of suspected processes, but other forms have also been proposed (as will be seen later). For an n process system, the first requirement of the failure detector is a compo-sition of all safety requirements of the individual failure detector modules. It can be read like this: —for all processes p: for all processes q:the failure detector module at p does not suspect q unless q has crashed. The liveness requirement can be reformulated as: —for all processes p: for all processes q:if q crashes, then the
{ "page_id": null, "source": 7326, "title": "from dpo" }
failure detector module at p will eventually permanently suspect q.When referring to failure detectors, Chandra and Toueg call the above safety property strong accuracy and the liveness property strong completeness . A failure detector satisfying strong accuracy and strong completeness is called a perfect failure detector . The class of all perfect failure detectors is usually denoted by P. If there is no confusion, we sometimes also denote by P some failure detector from this class. A perfect failure detector makes no wrong suspicions and eventually detects every crash. 2.2.2 Asynchronous Models with Failure Detectors. It is important to stress that a failure detector is merely defined through the service it offers, not by the way it is implemented. Because of this, a failure detector is often called an oracle . Of course, failure detection will most probably be implemented using timeouts in practice, but the failure detector cleanly hides the details of the underlying system model and its synchrony bounds behind its service interface. The interface of the failure detector “looks time-free” and so it makes sense to combine the asynchronous model with failure detectors and design algorithms in this new model. Of course, this model is not purely asynchronous anymore (many authors therefore write that the asynchronous model is augmented with failure detectors), but it allows to describe and analyze algorithms as if they were running in an asynchronous model. Afailure detector can therefore be regarded as a device which encapsulates synchrony assumptions in an asynchronous interface. 2.2.3 Non-Blocking Atomic Commit with a Perfect Failure Detector. As an ex-ample on how to write algorithms using failure detectors, Figure 2 shows the part of the 3PC algorithm from Fig. 1 using a perfect failure detector. The failure de-tector abstraction simplifies the text of the protocol. Now the code
{ "page_id": null, "source": 7326, "title": "from dpo" }
is similar to the descriptions commonly found in books on concurrency control (like the one by The Failure Detector Abstraction · 9 Bernstein et al. ). There, every receive (or wait for ) statement is accom-panied by an on timeout clause specifying what to do when the timer for this statement elapses. In a sense, these algorithm descriptions already use a failure detector abstraction to simplify the writing of the protocols without naming it. Note that now the correctness of the protocol can be analyzed without refering to timeouts or synchrony bounds. For example, if there are no crashes, the strong accuracy property of the failure detector ensures that no process will be suspected and so the protocol behaves like the 3PC protocol for the fault-free case. Similarly, if the coordinator crashes before sending out vote requests, the strong completeness of the failure detector guarantees that every process will eventually stop waiting for a message from the coordinator and advance in the protocol. Overall, reasoning about the correctness of the algorithm becomes much simpler if the type of failure detector is used. > wait for 〈vote request arrived from p1or p1∈ P〉 > if p1∈ P then > 〈decide abort 〉 > endif > Fig. 2. Algorithm code from Fig. 1 using a perfect failure detector P. 2.2.4 Solving Consensus using Failure Detectors. To illustrate another advan-tages of failure detectors, consider the problem of consensus (see Barborak et al. and Turek and Shasha for surveys on consensus). Like non-blocking atomic commit, consensus belongs to the class of agreement problems where pro-cesses must take a consistent decision starting from inconsistent values. The con-sensus problem is defined using two primitives called propose and decide . Both take an argument from a fixed set of decision values (usually {0, 1}). If
{ "page_id": null, "source": 7326, "title": "from dpo" }
a process invokes propose (u) we say that it proposes u. Analogously, if it invokes decide (v) we say that it decides v. A process may decide at most once. In general, an algorithm which solves the consensus problem must guarantee three properties: —(Agreement) No two processes decide different values. —(Termination) Every correct process eventually decides. —(Validity) The decided value must have been proposed by some process. The Validity property is a non-triviality property, meaning that it has been added to exclude trivial solutions where processes do not communicate (e.g., algorithms where every process always decides 1). More specifically, the above consensus spec-ification is called uniform consensus [Hadzilacos and Toueg 1994] because it man-dates that all processes (i.e., even the faulty ones) do not disagree on the decision value. Similar to non-blocking atomic commit, consensus can be solved rather easily using a perfect failure detector. However, consensus can be solved even if the failure detector is “imperfect”, i.e., if it can make mistakes. An example of such a failure detector is the eventually perfect failure detector (denoted 3P), a failure detector which is only perfect after some finite time (before this time it can behave arbitrarily). The idea of the algorithm is to be conservative, i.e., maintain the 10 · Freiling, Guerraoui, Kouznetsov safety aspect of consensus (Agreement and Validity) always, and only terminate if the failure detector stops making mistakes. Such algorithms are called indugent [Guerraoui 2000]. The indulgent consensus algorithms from the literature [Chandra and Toueg 1996; Dwork et al. 1988; Schiper 1997a; 1997b; Hurfin and Raynal 1999; Brasileiro et al. 2000] operate in a sequence of rounds. Every round is like the first round of the 3PC algorithm sketched above: a coordinator tries to impose a decision value on all other processes, only that the role of
{ "page_id": null, "source": 7326, "title": "from dpo" }
the coordinator changes every round in round-robin fashion. This protects against relying on some crashed process to be the coordinator. However, due to the unreliability of the failure detector, a correct process may not get its chance to succeed in imposing a value on the rest of the system (the others might have suspected him and advanced to the next round with a different coordinator). In this situation it must be ensured that no two processes can impose different decision values onto the system (and cause disagreement). To prevent this, the algorithms require a coordinator to “lock” a value before decision. Locking a value ensures that no other value can become the decision value and can be achieved by “extinguishing” all other values from the system. To lock a value, it is necessary that a majority of processes are correct. It is rather easy to show that there is no indugent consensus algorithm if more than half of the processes can be faulty [Chandra and Toueg 1996; Guerraoui 2000]. A set of n processes can become “virtually partitioned” by information resulting from wrong suspicions by the failure detector. This means that there can be two small subsets of processes that suspect all other processes (including those of the other set) to have crashed. In such a case, each partition can decide different values, thus violating safety. This situation cannot arise if we have the algorithm guarantee that every deciding partition must include the majority of processes. In this way no two partitions can decide differently because they must have a common process in both. In a sense, requiring a correct majority is the price you have to pay for making mistakes in detecting crashes. Interestingly, consensus can even be solved with a failure detector which (in a precise sense which
{ "page_id": null, "source": 7326, "title": "from dpo" }
is defined later in this article) is even weaker than 3P [Chandra and Toueg 1996]. Like 3P, this failure detector, called “eventually strong” (denoted 3S), belongs to the class of unreliable failure detectors introduced next. 2.2.5 Unreliable Failure Detectors. The existence of a perfect failure detector is a very strong assumption which makes the model no more realistic than one where explicit synchrony bounds are added. As shown above, a perfect failure detector is also not always necessary. This motivates looking for weaker assumptions about the failure detector modules. A systematic way to weaken the specification is to try different combinations of quantors. For example, where strong accuracy read “ ∀p : ∀q : . . . ” we could write “∀p : ∃q : . . . ”. Among these weaker variants it turns out that the combination ∃q : ∀p for safety and ∀q : ∃p for liveness are useful for solving consensus. What do these combinations mean? —∃ a correct process q : ∀p : the failure detector module at p does not suspect q unless q has crashed. This means there is a correct process which all processes will not falsely suspect. The Failure Detector Abstraction · 11 So every process except one may be infinitely often falsely suspected to have crashed. This property is called weak accuracy [Chandra and Toueg 1996] and is even useful if it only holds eventually (this is termed eventual weak accuracy ). —∀q : ∃ a correct process p : if q crashes then the failure detector module at p will eventually suspect q.In terms of liveness this means that for every crash, there is a process which will detect this crash. This is termed weak completeness [Chandra and Toueg 1996]. Obviously, if at least one process eventually detects the
{ "page_id": null, "source": 7326, "title": "from dpo" }
crash of some process q, then eventually all processes can be made to detect that crash by simply disseminating the information throughout the network. Thus it is possible to turn a weakly complete failure detector into a strongly complete failure detector if there are means to reliably disseminate information in the network. A failure detector satisfying weak completeness and eventual weak accuracy is called an eventually weak failure detector . All other combinations of failure detectors and their names are depicted in Table I. All failure detectors which are allowed to make mistakes fall into the category of unreliable failure detectors . > accuracy strong weak eventually strong eventually weak strong completeness perfect Pstrong Seventually perfect 3Peventually strong 3S > weak completeness weak Weventually weak 3W > Table I. The failure detector classes of Chandra and Toueg . Interestingly (as will be discussed in Section 3), the eventually strong failure detector 3S is the weakest failure detector for solving consensus, given that a majority of processes are correct. Intuitively, this means that it provides the least level of timing information to make consensus solvable. Hence, systems which offer much less timing guarantees than a perfect failure detector can be used to implement consensus abstractions. Since the underlying failure detector 3S is in this sense connected to the problem of consensus, there are implementations of 3S which are optimized with respect to efficiently solving consensus [Larrea et al. 2000; Chen et al. 2000; Sergent et al. 1999]. This will be important later when we talk about combining different failure detectors in a single application. 2.2.6 Other Failure Detectors. Other failure detectors have been defined with different motivations. We give here a brief selection: Chandra et al. in-troduced the failure detector Ω which eventually outputs the identity of a correct process
{ "page_id": null, "source": 7326, "title": "from dpo" }