Byzantine Failures - PowerPoint PPT Presentation

1 / 70
About This Presentation
Title:

Byzantine Failures

Description:

Example: 12 processes, 2 faults, 3 kings. Remark: There is a king that is not faulty ... There are three threshold values: 57. In each round, processor executes: ... – PowerPoint PPT presentation

Number of Views:359
Avg rating:3.0/5.0
Slides: 71
Provided by: costas
Category:

less

Transcript and Presenter's Notes

Title: Byzantine Failures


1
Byzantine Failures

2
Byzantine Failures
a
Faulty processor
b
a
c
Different processes receive different values
3
Some messages may be lost
a
Faulty processor
a
A Byzantine process can behave like a
Crashed-failed process
4
Round 1
Round 2
Round 3
Round 4
Round 5
Round 6
Failure
Failure
After failure the process continues Functioning
in the network
5
Consensus with Byzantine Failures
f-resilient consensus algorithm
solves consensus for f failed processes
6
Example
The input and output of a 1-resilient consensus
algorithm
Finish
Start
3
3
3
3
7
Validity 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
8
Lower 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
9
A Consensus Algorithm
The King algorithm
solves consensus with
processes and failures, where
10
The King algorithm
There are phases Each phase has two
broadcast rounds In each phase there is a
different king
11
Example 12 processes, 2 faults, 3 kings
initial values
0
1
1
2
2
1
0
0
0
1
1
0
Faulty
12
Example 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
13
The King algorithm
Each processor has a preferred value
In the beginning, the preferred value is set to
the initial value
14
The 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)
  • Set

15
The King algorithm
Phase k
Round 2, king
Broadcast new preferred value
Round 2, process
If had majority of less than
then set
16
The King algorithm
End of Phase f1
Each process decides on preferred value
17
Example 6 processes, 1 fault
0
1
0
2
king 2
1
1
king 1
Faulty
18
Phase 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
19
Phase 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
20
Phase 1, Round 2
1
0
1
0
0
0
0
2
1
1
1
king 1
The king broadcasts
21
Phase 1, Round 2
0
1
0
2
1
1
king 1
Everybody chooses the kings value
22
Phase 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
23
Phase 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
24
Phase 2, Round 2
1
0
0
0
0
0
0
king 2
0
0
1
1
The king broadcasts
25
Phase 2, Round 2
0
0
0
0
king 2
1
0
Everybody chooses the kings value
Final decision
26
Theorem
In the phase where the the king is
non-faulty, every non-faulty processor decides
the same value
Proof
Consider phase
27
At 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
28
Case 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
29
At 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
30
Case 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
31
Let 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 )
32
Thus, from until the end of phase Every
non-faulty processor decides
33
An Impossibility Result
There is no -resilient algorithm for
processes, where
Theorem
Proof
First we prove the 3 process case, and then the
general case
34
The 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
35
A(0)
Local algorithm
B(1)
C(0)
Initial value
36
1
1
1
Decision value
37
A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
Assume processes are in a ring
Processes think they are in a triangle
38
A(0)
C(1)
B(1)
B(0)
B(1)
A(1)
C(0)
A(1)
C(1)
C(0)
faulty
39
A(0)
C(1)
B(1)
B(0)
1
A(1)
C(0)
1
faulty
(validity condition)
40
A(0)
C(1)
B(1)
B(0)
B(0)
A(1)
C(0)
C(0)
A(0)
1
A(1)
faulty
41
A(0)
C(1)
B(1)
B(0)
0
A(1)
C(0)
0
1
faulty
(validity condition)
42
A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
0
1
A(1)
C(0)
B(1)
B(0)
faulty
43
A(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
44
A(0)
C(1)
B(1)
B(0)
A(1)
C(0)
0
1
1
0
faulty
45
Impossible!!! since the algorithm is 1-resilient
1
0
faulty
46
Therefore There is no algorithm that
solves consensus for 3 processes in which 1 is a
byzantine process
47
The 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)
48
algorithm A
0
1
1
2
2
1
0
0
0
1
1
start


failures
1
1
1
1
1
1
1
finish


49
Each process simulates algorithm A on
of processes
50
fails
When a fails then of processes
fail too
51
Finish of algorithm A
k
k
k
k
all decide k
k
k
k
k
k
k
k
k
k
fails
algorithm A tolerates failures
52
Final decision
k
k
fails
We reached consensus with 1 failure
Impossible!!!
53
Threrefore
There is no -resilient algorithm for
processes, where
54
Randomized 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 )
55
Each processor has a preferred value
In the beginning, the preferred value is set to
the initial value
Assume that initial value is binary
56
The algorithm tolerates Byzantine
processors
There are three threshold values
57
In 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
58
Analysis
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
59
Termination
There is a processor with
Since faulty processors are at most
processor received at least
votes for from good processors
60
Therefore, every processor
will have
with
Consequently, at the end of the round all the
good processors will have the same preferred
value
61
Observation
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
62
Therefore, 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.
63
Case 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
64
Suppose (for sake of contradiction) that
Then at least
Good processors have voted
Consequently,
Contradiction!
65
All processors have same
Case 2
Then for any two processors and it holds
that
Since otherwise, the number of faulty Processors
would exceed
66
Let be the processor with
67
Sub-case 1
If
(this occurs with probability )
then, for any processor it holds
68
And therefore
Thus, every processor chooses 0, and the
algorithm terminates in next round
(this occurs with probability )
69
Sub-case 2
If
(this occurs with probability )
then, for any processor it holds
70
And therefore
Thus, every processor chooses , and the
algorithm terminates in next round
(this occurs with probability )
Write a Comment
User Comments (0)
About PowerShow.com