Académique Documents
Professionnel Documents
Culture Documents
Byzantine Failures
Faulty processor p 1 c a
p2
b a
p3
p5
p4
Faulty processor p 1
p2 p3
a
p5
p4
Round
Round
Round
Round
Round Round
p1 p2
p3 p4 p5
p1 p2 p3 p4 p5
p1
p1 p2 p3 p4 p5
p1 p2 p3 p4 p5
p1 p2 p3 p4 p5
p2 p3 p4 p5
Failure
Failure
Start 1 4
Finish 0 2 3 3 3
6
3 3
Validity condition: if all processes start with the same value then all non-faulty processes decide that value Start 1 1 1 Finish 1 1 1 1
7
1 1
Lower bound on number of rounds Theorem: Any f-resilient consensus algorithm requires at least f+1 rounds
Upper bound on failed processes Theorem: There is no f -resilient algorithm for n processes, where
n f 3
Proof: First we prove the 3 process case, and then the general case
9
Proof: Assume for contradiction that there is a 1-resilient algorithm for 3 processes
10
p0 p1 p2
C(0)
B(1)
Initial value
11
p0 p1
1
p2
1
Decision value
12
A(0)
C(1)
p3
B(0) p4
p2
B(1) p1
C(0) A(1) p0 p5
A(0)
C(1)
p3
B(0) p4
p2
B(1) p1 B(1) p1 A(1) p0
C(1) C(0)
C(0) A(1) p0 p5
p2
faulty
14
A(0)
C(1)
p3
B(0) p4
p2
B(1) p1 1 p1 1
C(0) A(1) p0 p5
p0
p2
faulty
(validity condition)
15
A(0)
C(1)
p3
B(0) p4 B(0) p1
A(0)
p2
B(1) p1
p0
faulty
A(1)
C(0) p2
C(0) A(1) p0 p5 1
p0
16
A(0)
C(1)
p3
B(0) p4 0 p1
p2
B(1) p1
C(0) A(1) p0 p5 0 p2 1
p0
faulty
p0
(validity condition)
17
A(0)
C(1)
p3
B(0) p4
p2
B(1) p1
p0
p1 faulty
18
A(0)
C(1)
p3
B(0) p4
p2
B(1) p1
C(0) A(1) p0 p5 0 p2 1 0 1 p0
p0
p2
p1 faulty
19
p2
p1 faulty
20
Therefore: There is no algorithm that solves consensus for 3 processes in which 1 is a byzantine process
21
The n processes case Assume for contradiction that there is an f -resilient algorithm A for n processes, where f n
We will use algorithm A to solve consensus for 3 processes and 1 failure (contradiction)
22
p1 p2
finish 1
1 1 pn
23
p1 p2
q1
q3
p 2 n K pn
3 +1
p1 K pn
3
q2
pn K p2n
3 +1 3
Each process
q simulates algorithm A
24
n on of p processes 3
q1
q3
p 2 n K pn
3 +1
p1 K pn
3
q2
fails
pn K p2n
3 +1 3
When a
q fails
25
Finish of algorithm A
q1
kk k k k k k
p1 K pn
3
k k k k k k
all decide k
pn K p2n
3 +1 3
q3
p 2 n K pn
3 +1
q2
fails
Final decision
q1
q3
k
q2
fails
n f 3
28
A Consensus Algorithm
The King algorithm solves consensus with n processes and f failures, where f <
n 4
29
f + 1 phases
Each phase has two rounds In each phase there is a different king
30
Faulty
31
King 1
King 2
King 3
33
Phase k
pi : vi
34
Phase k
pk :
pi :
35
The King algorithm End of Phase f+1: Each process decides on preferred value
36
king 1
Faulty
37
Phase 1, Round 1
2,1,1,1,0,0 2,1,1,0,0,0
0
2,1,1,0,0,0
1 1 0 1 2 0
2,1,1,0,0,0
0 1 1
2,1,1,1,0,0
king 1
Everybody broadcasts
38
0 0
Phase 1, Round 2 1 0 0 0 1 1 1 0 1 0 2
king 1
Phase 1, Round 2 0 0 1 1
king 1
1 2
Phase 2, Round 1
2,1,1,1,0,0 2,1,1,0,0,0
0
2,1,1,0,0,0
1 1 0 1 2 0
2,1,1,0,0,0
king 2
0 1 1
2,1,1,1,0,0
Everybody broadcasts
42
2,1,1,1,0,0
n 3 + f = 4 2
43
Phase 2, Round 2 1 0 0 0 1 0 1 0
0 0
king 2
Phase 2, Round 2 0 0 0 1 0 0
king 2
In general: In the round where the the king is non-faulty, everybody will chose the kings value v After that round, the majority will remain value v with majority population at least
n n f > + f 2
46