Title: Byzantine Failures
1Byzantine Failures
2Byzantine Failures
a
Faulty processor
b
a
c
Different processes receive different values
3Some messages may be lost
a
Faulty processor
a
A Byzantine process can behave like a
Crashed-failed process
4Round 1
Round 2
Round 3
Round 4
Round 5
Round 6
Failure
Failure
After failure the process continues Functioning
in the network
5Consensus with Byzantine Failures
f-resilient consensus algorithm
solves consensus for f failed processes
6Example
The input and output of a 1-resilient consensus
algorithm
Finish
Start
3
3
3
3
7Validity condition
if all non-faulty processes start with the same
value then all non-faulty processes decide that
value
Finish
Start
1
1
1
1
8Lower bound on number of rounds
Any f-resilient consensus algorithm with
byzantine failures requires at least f1 rounds
Theorem
Proof
follows from the crash failure lower bound
9A Consensus Algorithm
The King algorithm
solves consensus with
processes and failures, where
10The King algorithm
There are phases Each phase has two
broadcast rounds In each phase there is a
different king
11Example 12 processes, 2 faults, 3 kings
initial values
0
1
1
2
2
1
0
0
0
1
1
0
Faulty
12Example 12 processes, 2 faults, 3 kings
initial values
0
1
1
2
2
1
0
0
0
1
1
0
King 1
King 2
King 3
Remark There is a king that is not faulty
13The King algorithm
Each processor has a preferred value
In the beginning, the preferred value is set to
the initial value
14The King algorithm
Phase k
Round 1, processor
- Broadcast preferred value
- Let be the majority
- of received values (including )
(in case of tie pick an arbitrary value)
15The King algorithm
Phase k
Round 2, king
Broadcast new preferred value
Round 2, process
If had majority of less than
then set
16The King algorithm
End of Phase f1
Each process decides on preferred value
17Example 6 processes, 1 fault
0
1
0
2
king 2
1
1
king 1
Faulty
18Phase 1, Round 1
2,1,1,0,0,0
2,1,1,1,0,0
0
1
2,1,1,0,0,0
2,1,1,0,0,0
0
1
0
2
0
0
1
1
1
2,1,1,1,0,0
king 1
Everybody broadcasts
19Phase 1, Round 1
Chose the majority
1
0
0
0
1
1
2,1,1,1,0,0
king 1
Each majority vote was
On round 2, everybody will chose the kings value
20Phase 1, Round 2
1
0
1
0
0
0
0
2
1
1
1
king 1
The king broadcasts
21Phase 1, Round 2
0
1
0
2
1
1
king 1
Everybody chooses the kings value
22Phase 2, Round 1
2,1,1,0,0,0
2,1,1,1,0,0
0
1
2,1,1,0,0,0
2,1,1,0,0,0
0
1
0
2
0
king 2
0
1
1
1
2,1,1,1,0,0
Everybody broadcasts
23Phase 2, Round 1
Chose the majority
1
0
0
0
king 2
1
1
2,1,1,1,0,0
Each majority vote was
On round 2, everybody will chose the kings value
24Phase 2, Round 2
1
0
0
0
0
0
0
king 2
0
0
1
1
The king broadcasts
25Phase 2, Round 2
0
0
0
0
king 2
1
0
Everybody chooses the kings value
Final decision
26Theorem
In the phase where the the king is
non-faulty, every non-faulty processor decides
the same value
Proof
Consider phase
27At the end of round 1, we examine two cases
Case 1 some node has chosen its
preferred value with strong
majority ( votes)
Case 2
No node has chosen its preferred value
with strong majority
28Case 1 suppose node has chosen its
preferred value with
strong majority ( votes)
At the end of round 1, every other node must have
preferred value
(including the king)
Explanation
At least non-faulty nodes must
have broadcasted at start of round 1
29At end of round 2
If a node keeps its own value then
decides
If a node gets the value of the king then
it decides , since the king has
decided
Therefore Every non-faulty node decides
30Case 2
No node has chosen its preferred value
with strong majority ( votes)
Every non-faulty node will adopt the value of
the king, thus all decide on same value
END of PROOF
31Let be the value decided at the end of
phase
After , value will always be preferred with
strong majority, since the number of non-faulty
processors is
(since )
32Thus, from until the end of phase Every
non-faulty processor decides
33An Impossibility Result
There is no -resilient algorithm for
processes, where
Theorem
Proof
First we prove the 3 process case, and then the
general case
34The 3 processes case
There is no 1-resilient algorithm for 3 processes
Lemma
Proof
Assume for contradiction that there is a
1-resilient algorithm for 3 processes
35A(0)
Local algorithm
B(1)
C(0)
Initial value
361
1
1
Decision value
37A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
Assume processes are in a ring
Processes think they are in a triangle
38A(0)
C(1)
B(1)
B(0)
B(1)
A(1)
C(0)
A(1)
C(1)
C(0)
faulty
39A(0)
C(1)
B(1)
B(0)
1
A(1)
C(0)
1
faulty
(validity condition)
40A(0)
C(1)
B(1)
B(0)
B(0)
A(1)
C(0)
C(0)
A(0)
1
A(1)
faulty
41A(0)
C(1)
B(1)
B(0)
0
A(1)
C(0)
0
1
faulty
(validity condition)
42A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
0
1
A(1)
C(0)
B(1)
B(0)
faulty
43A(0)
C(1)
B(1)
B(0)
0
A(1)
C(0)
B(0)
B(1)
1
C(1)
C(0)
A(0)
A(1)
0
1
A(1)
C(0)
C(0)
A(1)
faulty
faulty
B(1)
B(0)
faulty
44A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
0
1
1
0
faulty
45Impossible!!! since the algorithm is 1-resilient
1
0
faulty
46Therefore There is no algorithm that
solves consensus for 3 processes in which 1 is a
byzantine process
47The n processes case
Assume for contradiction that there is an
-resilient algorithm A for processes, where
We will use algorithm A to solve consensus for 3
processes and 1 failure
(contradiction)
48algorithm A
0
1
1
2
2
1
0
0
0
1
1
start
failures
1
1
1
1
1
1
1
finish
49Each process simulates algorithm A on
of processes
50fails
When a fails then of processes
fail too
51Finish of algorithm A
k
k
k
k
all decide k
k
k
k
k
k
k
k
k
k
fails
algorithm A tolerates failures
52Final decision
k
k
fails
We reached consensus with 1 failure
Impossible!!!
53Threrefore
There is no -resilient algorithm for
processes, where
54Randomized Byzantine Agreement
There is a trustworthy processor which at every
round throws a random coin and informs every
other processor
Coin heads (probability )
Coin tails (probability )
55Each processor has a preferred value
In the beginning, the preferred value is set to
the initial value
Assume that initial value is binary
56The algorithm tolerates Byzantine
processors
There are three threshold values
57In each round, processor executes
Broadcast
Receive values from all processors
majority value
occurrences of
If coinheads then
else
If then
else
then decision is reached
If
58Analysis
Examine two cases in a round
Termination
There is a processor with
Other cases
Case 1
Two processors and have different
Case 2
All processors have same
59Termination
There is a processor with
Since faulty processors are at most
processor received at least
votes for from good processors
60Therefore, every processor
will have
with
Consequently, at the end of the round all the
good processors will have the same preferred
value
61Observation
If in the beginning of a round all the good
processors have same preferred value then the
algorithm terminates in that round
This holds since for every processor the
termination condition
will be true in that round
62Therefore, if the termination condition is true
for one processor at a round, then, the
termination condition will be true for all
processors at next round.
63Case 1
Two processors and have different
It has to be that
and
And therefore
Thus, every processor chooses 0, and the
algorithm terminates in next round
64Suppose (for sake of contradiction) that
Then at least
Good processors have voted
Consequently,
Contradiction!
65All processors have same
Case 2
Then for any two processors and it holds
that
Since otherwise, the number of faulty Processors
would exceed
66Let be the processor with
67Sub-case 1
If
(this occurs with probability )
then, for any processor it holds
68And therefore
Thus, every processor chooses 0, and the
algorithm terminates in next round
(this occurs with probability )
69Sub-case 2
If
(this occurs with probability )
then, for any processor it holds
70And therefore
Thus, every processor chooses , and the
algorithm terminates in next round
(this occurs with probability )