Download presentation
Presentation is loading. Please wait.
1
Systems of Distributed systems Module 2 - Distributed algorithms Teaching unit 2 – Properties of distributed algorithms Ernesto Damiani University of Bozen Lesson 5 – Formal properties
2
A lower bound Theorem –There is no algorithm that solves the consensus problem in less than f + 1 rounds in the presence of f crash failures, if n f + 2 Prove special case f = 1 to study proof technique
3
Views Definition –Let be an execution and let p i be a process. The view of p i in , denoted by |p i, is the subsequence of computation and message receive events that occur in p i together with the state of p i in the initial configuration of
4
Similarity
5
Single-Failure Case Theorem –There is no algorithm that solves the consensus problem in less than 2 rounds in the presence of 1 crash failures, if n 3
6
The idea WLOG assume each process sends message to every other process Proceed by contradiction: –Consider an executionin which each process proposes 0. What is the decision value? –Consider another execution in which each process proposes 1. What is the decision value? –Show that there is a chain of admissible similar executions that relate the two executions –So what?
7
The Proof (1) Definition – i is the admissible execution of the algorithm in which no failures occur processes p 0, …, p i-1 propose 1
8
The Proof (2)
9
The Proof (3)
10
The executions 1 0 0 0 1 p0p0 pipi p n-1 p i+1 p i-1 1 0 0 0 1 p0p0 pipi p n-1 p i+1 p i-1 … 1 0 0 0 1 p0p0 pipi p n-1 p i+1 p i-1
11
Indistinguishibility 0 p0p0 pipi p n-1 p i+1 p i-1 1 1 1 1 1 0 0 0 0 0 0 p0p0 pipi p n-1 p i+1 p i-1 1 1 1 1 1 1 0 0 0 0
12
The Terminating Reliable Broadcast problem Termination –Every correct process eventually delivers some message Validity –If a correct process broadcasts a message m, then all correct processes eventually deliver m Agreement –If a correct process delivers a message m, then all correct processes eventually deliver m Integrity –Every correct process delivers at most one message, and, if it delivers m SF, then some process must have broadcast m
13
Reliable Broadcast for Benign Failures Sender in round 1: 1:send m to all Process p in round k, 1 k f+1 1:if delivered m in round k-1 and p sender then 2:send m to all 3:halt 4:receive round k messages 5:if received m then 6:deliver(m) 7:if k = f+1 then halt 8:else if k = f+1 9:deliver(SF) 10:halt Terminates in f + 1 rounds even if failures only in round 1 even if no failures! Can we do better? find a protocol whose time complexity is proportional to t ---the number of failures that actually occurred--- rather than to f---the max number of failures that may occur What is the danger?
14
The Reliable Broadcast for benign failures (1) Terminates in f + 1 rounds –even if failures only in round 1 –even if no failures! Can we do better? –find a protocol whose time complexity is proportional to t -- -the number of failures that actually occurred--- rather than to f---the max number of failures that may occur What is the danger?
15
The Reliable Broadcast for benign failures (2)
16
Crying Wolf The danger is a dangerous chain For a dangerous chain to be a possibility at the end of round i, at least i processes must be faulty round 1 round 2 rounds 3…i-1 round i p0p0 p1p1 p2p2 p i-1 pipi p*p* p*p* p*p* p*p*
17
Early stopping: the idea What if a process p could detect how many process have failed by the end of round i ? Call faulty(p,i) the set containing the faulty processes detected by p If l faulty(p,i) l<i, there can be no active dangerous chains, and p can safely deliver SF What properties should the failure detector have to make this work? How can we implement such failure detector?
18
Early stopping: the protocol Let |faulty(p,k)| be the set of processes that have failed to send a message to p in any round 1…k 1:if p = sender then value := m else value:= ? Process p in round k, 1 k f+1 2:send value to all 3:if value ?then halt 4:receive round k values from all 5: |faulty(p,k)| := |faulty(p,k - 1)|U {q | p received no value from q in round k} 6:if received value v ? then 7:value := v 8:deliver(value) 9:else if k = f+1 or |faulty(p,k)| < k then 10:value := SF 11:deliver(value) 12: if k = f+1 then halt
19
Termination (1) If in any round a process receives a value, then it delivers the value in that round If a process has only received “?” for f + 1 rounds, then it delivers SF in round f + 1
20
Termination (2) Let |faulty(p,k)| be the set of processes that have failed to send a message to p in any round 1…k 1:if p = sender then value := m else value:= ? Process p in round k, 1 k f+1 2:send value to all 3:if value ?then halt 4:receive round k values from all 5:|faulty(p,k)| := |faulty(p,k - 1)|U {q | p received no value from q in round k} 6:if received value v ? then 7:value := v 8:deliver(value) 9:else if k = f+1 or |faulty(p,k)| < k then 10:value := SF 11:deliver(value) 12: if k = f+1 then halt
21
Validity (1) If the sender is correct then it sends m to all in round 1 By Validity of the underlying send and receive, every correct process will receive m by the end of round 1 By the protocol, every correct process will deliver m by the end of round 1
22
Validity (2) Let |faulty(p,k)| be the set of processes that have failed to send a message to p in any round 1…k 1:if p = sender then value := m else value:= ? Process p in round k, 1 k f+1 2:send value to all 3:if value ?then halt 4:receive round k values from all 5:|faulty(p,k)| := |faulty(p,k - 1)|U {q | p received no value from q in round k} 6:if received value v ? then 7:value := v 8:deliver(value) 9:else if k = f+1 or |faulty(p,k)| < k then 10:value := SF 11:deliver(value) 12: if k = f+1 then halt FINE
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.