Title: FaultTolerant Consensus
1Fault-Tolerant Consensus
2Communication Model
- Complete graph
- Synchronous, network
3Broadcast
a
a
a
a
Send a message to all processors in one round
4a
a
a
a
At the end of round everybody receives a
5Broadcast
a
b
a
b
a
a
b
b
Two or more processes can broadcast at the same
round
6a,b
b
a,b
a,b
a
7Crash Failures
a
Faulty processor
a
a
a
8a
Faulty processor
a
Some of the messages are lost, they are never
received
9a
Faulty processor
a
10Round 1
Round 2
Round 3
Round 4
Round 5
Failure
After failure the process disappears from the
network
11Consensus
0
Start
1
4
3
2
Everybody has an initial value
123
Finish
3
3
3
3
Everybody must decide the same value
13Validity condition
If everybody starts with the same value they must
decide that value
Finish
Start
14A simple algorithm
Each processor
- Broadcast value to all processors
- Decide on the minimum
(only one round is needed)
15Start
0
1
4
3
2
16Broadcast values
0,1,2,3,4
0
0,1,2,3,4
0,1,2,3,4
1
4
0,1,2,3,4
3
2
0,1,2,3,4
17Decide on minimum
0,1,2,3,4
0
0,1,2,3,4
0,1,2,3,4
0
0
0,1,2,3,4
0
0
0,1,2,3,4
18Finish
0
0
0
0
0
19This algorithm satisfies the validity condition
Finish
Start
If everybody starts with the same initial
value, everybody decides on that value (minimum)
20Consensus with Crash Failures
The simple algorithm doesnt work
Each processor
- Broadcast value to all processors
- Decide on the minimum
21Start
fail
0
0
1
0
4
3
2
The failed processor doesnt broadcast Its value
to all processors
22Broadcasted values
fail
0
0,1,2,3,4
1,2,3,4
1
4
0,1,2,3,4
1,2,3,4
3
2
23Decide on minimum
fail
0
0,1,2,3,4
1,2,3,4
0
1
0,1,2,3,4
1,2,3,4
0
1
24Finish
fail
0
0
1
0
1
No Consensus!!!
25If an alforithm solves consensus for f failed
process we say it is
an f-resilient consensus algorithm
26Example
The input and output of a 3-resilient consensus
algorithm
27New validity condition
if all non-faulty processes start with the same
value then all non-faulty processes decide that
value
28An f-resilient algorithm
Round 1 Broadcast my value Round 2 to round
f1 Broadcast any new received values
End of round f1 Decide on the minimum
value received
29Example f1 failures, f1 2 rounds needed
Start
0
1
4
3
2
30Example f1 failures, f1 2 rounds needed
Round 1
0
fail
0
0,1,2,3,4
1,2,3,4
1
0
4
(new values)
0,1,2,3,4
1,2,3,4
3
2
Broadcast all values to everybody
31Example f1 failures, f1 2 rounds needed
Round 2
0,1,2,3,4
0,1,2,3,4
1
4
0,1,2,3,4
0,1,2,3,4
3
2
Broadcast all new values to everybody
32Example f1 failures, f1 2 rounds needed
Finish
0,1,2,3,4
0,1,2,3,4
0
0
0,1,2,3,4
0,1,2,3,4
0
0
Decide on minimum value
33Example f2 failures, f1 3 rounds needed
Start
0
1
4
3
2
Another example execution with 3 failures
34Example f2 failures, f1 3 rounds needed
Round 1
0
Failure 1
1,2,3,4
1,2,3,4
1
0
4
0,1,2,3,4
1,2,3,4
3
2
Broadcast all values to everybody
35Example f2 failures, f1 3 rounds needed
Round 2
0
Failure 1
0,1,2,3,4
1,2,3,4
1
4
0,1,2,3,4
1,2,3,4
3
2
Failure 2
Broadcast new values to everybody
36Example f2 failures, f1 3 rounds needed
Round 3
0
Failure 1
0,1,2,3,4
O, 1,2,3,4
1
4
0,1,2,3,4
0,1,2,3,4
3
2
Failure 2
Broadcast new values to everybody
37Example f2 failures, f1 3 rounds needed
Finish
0
Failure 1
0,1,2,3,4
O, 1,2,3,4
0
0
0,1,2,3,4
0,1,2,3,4
3
0
Failure 2
Decide on the minimum value
38Example f2 failures, f1 3 rounds needed
Start
0
1
4
3
2
Another example execution with 3 failures
39Example f2 failures, f1 3 rounds needed
Round 1
0
Failure 1
1,2,3,4
1,2,3,4
1
0
4
0,1,2,3,4
1,2,3,4
3
2
Broadcast all values to everybody
40Example f2 failures, f1 3 rounds needed
Round 2
0
Failure 1
0,1,2,3,4
0,1,2,3,4
1
4
0,1,2,3,4
0,1,2,3,4
3
2
Broadcast new values to everybody
Remark
At the end of this round all processes know about
all the other values
41Example f2 failures, f1 3 rounds needed
Round 3
0
Failure 1
0,1,2,3,4
0,1,2,3,4
1
4
0,1,2,3,4
0,1,2,3,4
3
2
Failure 2
Broadcast new values to everybody
(no new values are learned in this round)
42Example f2 failures, f1 3 rounds needed
Finish
0
Failure 1
0,1,2,3,4
0,1,2,3,4
0
0
0,1,2,3,4
0,1,2,3,4
3
0
Failure 2
Decide on minimum value
43If there are f failures and f1 rounds then
there is a round with no failed process
2
3
4
5
6
1
Round
Example 5 failures, 6 rounds
No failure
44In the algorithm, at the end of the round with no
failure
- Every (non faulty) process knows
- about all the values of all other
- participating processes
- This knowledge doesnt change until
- the end of the algorithm
45Therefore, at the end of the round with no
failure
everybody would decide the same value
However, we dont know the exact position of this
round, so we have to let the algorithm execute
for f1 rounds
46Validity of algorithm
when all processes start with the same input
value then the consensus is that value
This holds, since the value decided from each
process is some input value
47A Lower Bound
Any f-resilient consensus algorithm requires at
least f1 rounds
Theorem
48Proof sketch
Assume for contradiction that f or less rounds
are enough
Worst case scenario
There is a process that fails in each round
49Worst case scenario
Round
1
a
before process fails, it sends its value a
to only one process
50Worst case scenario
2
Round
1
a
before process fails, it sends value a to
only one process
51Worst case scenario
2
f
3
Round
1
a
At the end of round f only one process knows
about value a
52Worst case scenario
decide
2
f
3
Round
1
b
a
Process may decide a, and all other
processes may decide another value (b)
53Worst case scenario
decide
2
f
3
Round
1
b
a
Therefore f rounds are not enough At least f1
rounds are needed