Jaap-Henk Hoepman
Digital Security (DS) Radboud University Nijmegen, the Netherlands
@xotoxot // * jhh@cs.ru.nl // 8 www.cs.ru.nl/~jhh
Advanced Network Security
- 6. Agreement and consensus II:
Byzantine failures
Advanced Network Security 6. Agreement and consensus II: Byzantine - - PowerPoint PPT Presentation
Advanced Network Security 6. Agreement and consensus II: Byzantine failures Jaap-Henk Hoepman Digital Security (DS) Radboud University Nijmegen, the Netherlands @xotoxot // * jhh@cs.ru.nl // 8 www.cs.ru.nl/~jhh Byzantine failures are real
Jaap-Henk Hoepman
Digital Security (DS) Radboud University Nijmegen, the Netherlands
@xotoxot // * jhh@cs.ru.nl // 8 www.cs.ru.nl/~jhh
Advanced Network Security
Byzantine failures
Jaap-Henk Hoepman // Radboud University Nijmegen //
Byzantine failures are real
29-2-2016 // Fault Tolerance - Byzantine Generals 2
9
↳
1 -7 teshdd
'
Jaap-Henk Hoepman // Radboud University Nijmegen //
The consensus problem (again)
n All processes have a binary input value (0 or 1)
n Consistency condition
processors must decide ! (Validity)
n Termination condition
n Now tolerating " < $/& byzantine failures
29-2-2016 // Fault Tolerance - Byzantine Generals 4
Jaap-Henk Hoepman // Radboud University Nijmegen //
Consensus for Byzantine failures
n Remember: Byzantine processors may lie… n So: what goes wrong in the protocol for crash failures?
29-2-2016 // Fault Tolerance - Byzantine Generals 5
(
essential
strategy
:gossip ( for
crash
failure )
(
problem
:the
gossip
mag
be
a
lle
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness proof of protocol for crash failures
n Lemma: suppose both processors ' and ( are correct (i.e don’t fail). Then if ) ∈ +
, then ) ∈ +
, then ) = )/ , for some 0 with ' ∉ σ
«If ' ∈ 0, i.e. 0 = 3; '; 5 then ' sent ) = 67;,
,
and hence ) = )7
, too, with ' ∉ 3
, = ) to q and then )/;,
so ) ∈ +
that )7
< = )/ , Then at round 3 + 1 processor ; sent ) = )7 < to ( as well
(as message ) = 67;<
6
1-
Jaap-Henk Hoepman // Radboud University Nijmegen //
Byzantine failures: " < $/& is necessary
n Suppose > = 3 and 8 = 1 (and two rounds)
29-2-2016 // Fault Tolerance - Byzantine Generals 8
⑧
goud
②
baat
byzantijnen
①
a②
a③
%
@ µ
.° @rmiarym.amia
"ËËË
.
@
÷
.
.
b
mis
⑥
b
Mb
C
b Mb
C
⇒
tube
It
allo
must
decide
I
are
must
I
b
seek
decided
decide
gameuserset
§
⇒
decide
1
Jaap-Henk Hoepman // Radboud University Nijmegen //
A protocol tolerating " < $/& byzantine failures
n Again each processor ' builds the following tree E
,
29-2-2016 // Fault Tolerance - Byzantine Generals 10
)-F,-G,..,-H
,
means: (Itold ', that (IJKtold (I, …. that (K’s value is ) Initially all ⊥ )M
, = N ' . O>
)M
,
)K
,
)-
,
)P
,
)P,K
,
)P,PJK
,
)K,Q
,
)K,P
,
Level 0 Level 1 Level 2 Level R Level 8 + 1 )/
,
Level R + 1 )/;S
,
for all T ∉ 0, i.e. > − 0 = > − R children
Jaap-Henk Hoepman // Radboud University Nijmegen //
Byzantine failures: decision more complex
n Associate a decision value V/
, to each node in the tree
values bottom up
, is the value for N ' . VWXOYOZ> that ' decides on
n Define [\TZRO]^ _ be the value that occurs most in a set _, using some constant ⊥ to break ties
29-2-2016 // Fault Tolerance - Byzantine Generals 11
Jaap-Henk Hoepman // Radboud University Nijmegen //
Lamport’s OM protocol for building the tree
n We write `[/
,(O, )) to make clear processor ' executes this to
propagate ) and to keep track of ‘stack trace’ 0
paper)
, O, ) is executed by ' for all 0 s.t. |0| = 8 − O and ' ∉ 0
, to all nodes ( (as message 6/;,
and instructs them to propagate the value through recursion
processors; together with the other `[/
at 0 are built.
,(8, N ' . O>) for all '
29-2-2016 // Fault Tolerance - Byzantine Generals 12
Jaap-Henk Hoepman // Radboud University Nijmegen //
m-1 rounds
Lamport’s OM protocol
n `[/
, 0, ) :
, as 6/;,
, = [\TZRO]^( V/;- , |( ∉ 0 )
n `[/
, O, ) for 0 < O ≤ 8
« Or rather: when receiving 6/;-
,
execute `[/;-
, (O − 1, 6/;- , ) if ' ∉ 0; (
, = [\TZRO]^( V/;- , |( ∉ 0 )
n Start as `[M
,(8, N ' . O>) for all ' in round 0
, 29-2-2016 // Fault Tolerance - Byzantine Generals 13
Here 0; ' = 8 + 1
Jaap-Henk Hoepman // Radboud University Nijmegen //
A protocol tolerating " < $/& byzantine failures
n Again each processor ' builds the following tree E
,
29-2-2016 // Fault Tolerance - Byzantine Generals 14
)-F,-G,..,-H
,
means: (Itold ', that (IJKtold (I, …. that (K’s value is ) Initially all ⊥ )M
, = N ' . O>
)M
,
)K
,
)-
,
)P
,
)P,K
,
)P,PJK
,
)K,Q
,
)K,P
,
Level 0 Level 1 Level 2 Level R Level 8 + 1 )/
,
Level R + 1 )/;S
,
for all T ∉ 0, i.e. > − 0 = > − R children `[M
,
`[K,P
,
`[K
,
Jaap-Henk Hoepman // Radboud University Nijmegen //
One step in detail
29-2-2016 // Fault Tolerance - Byzantine Generals 15
)K,P
,
`[K,P
,
Level 0 Level 1 Level 2 Level 3 `[K
P
)K
P
6K,P
,
6K,P
PJK
)K,P,,
K
)M
K
6K,P,,
Jaap-Henk Hoepman // Radboud University Nijmegen //
So building the tree is the same protocol as for crash failures.
n Before round 1
, =⊥ and )M , = N ' . O>
n Round R, 1 ≤ R ≤ 8 + 1
, to all processors ( (including
')
«Call this message 6/;,
,
addressed to ' and store in )/;y
,
«By the protocol z ∉ 0 so ' receives > − (R − 1) such messages from each z
29-2-2016 // Fault Tolerance - Byzantine Generals 16
)-F,-G,..,-H
,
means: (Itold ', that (IJKtold (I, …. that (K’s value is ) Initially all ⊥ )M
, = N ' . O>
Jaap-Henk Hoepman // Radboud University Nijmegen //
Deciding on a value
n Work from the leaves upwards
, = )/ , for 0 = 8 + 1
, = [\TZRO]^( V/;- , |( ∉ 0 ) otherwise
,
29-2-2016 // Fault Tolerance - Byzantine Generals 17
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness
n Lemma 1: If ', (, R are non faulty, then for all 0 we have )/;|
,
= )/;|
n Set V/
, = )/ , for all leaves, ie 0 = 8 + 1
29-2-2016 // Fault Tolerance - Byzantine Generals 18
We reason over all trees
✓
is
correct
,so
it
seeds
ten
same
value
to
p
de
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness
n Lemma 1: If ', (, R are non faulty, then for all 0 we have )/;|
,
= )/;|
a value ) such that for all non faulty p we have V/;|
,
= )/;|
,
= ).
29-2-2016 // Fault Tolerance - Byzantine Generals 20
inductie
tart
inductieve
tortilla
lont
level k
VI
f
In
level
ten
levert
II
,
'i.
⇒(
tweeten
'
n .er :p
dfr.tv
amajoin
Anodes
have
div
n
&
⇒
df.ru
> zf
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness
n Lemma 1: If ', (, R are non faulty, then for all 0 we have )/;|
,
= )/;|
value ) such that for all non faulty p we have V/;|
,
= )/;|
,
= ).
have V/;|
,
= )/;|
,
.
same value )/;|
,
= ). Then all non-faulty processors ' ∉ 0; R send ) as 6/;|;,
all other processors (. If non faulty, ( sets )/;|;,
Ñ V/;|;,
0 ) = ) as required
29-2-2016 // Fault Tolerance - Byzantine Generals 22
Jaap-Henk Hoepman // Radboud University Nijmegen //
Validity
n Theorem: If all non faulty processors have input ) they decide on )
29-2-2016 // Fault Tolerance - Byzantine Generals 23
alt
noup have
value
vher
send
U
to
an
man
q
In
te
firstround
⇒
✓ {
=v
for
an
correct
p
d
9-
.2
die
for
an
correct
plot
⇒
af
=Maij
( Edit
brand )
=v
Jaap-Henk Hoepman // Radboud University Nijmegen //
Agreement
n Definition 1. 0 is common if V/
, = V/
n Definition 2. A subset N of nodes in a tree E is a path cover of E if all paths from the leaves to the root visit at least one node in N. n Definition 3. A path cover N is common if all nodes in N are common.
, = V/Ç
29-2-2016 // Fault Tolerance - Byzantine Generals 25
cover
Jaap-Henk Hoepman // Radboud University Nijmegen //
Agreement
n Lemma 3. There exists a common path covering of the tree constructed by the consensus algorithm
8 + 1.
,
= V/’;|
and on the path
29-2-2016 // Fault Tolerance - Byzantine Generals 26
Jaap-Henk Hoepman // Radboud University Nijmegen //
Agreement
n Lemma 4. Let 0 be a node. If there is a common path covering of the subtree rooted at 0, then 0 is common itself.
subtree rooted at 0. If 0 ∈ N we are done. If not, then the trees rooted in all children have a common path covering and by the induction hypothesis then all children 0; R of 0 are common.
,
= V/;|
, = [\TZRO]^á
à É Ñ V/;|
, |R ∉
= [\TZRO]^ V|
= V/
n Theorem: All non faulty nodes decide on the same value
29-2-2016 // Fault Tolerance - Byzantine Generals 27
Using authentication
29-2-2016 // Fault Tolerance - Byzantine Generals 30
Jaap-Henk Hoepman // Radboud University Nijmegen //
Signing messages
n Every processor ' has a private signing key. The corresponding signature verification key is known to all processors. n Signatures of correct processors cannot be forged n Let us write 6 , for a message 6 signed by '. Write 6 / for … 6 ,. . | with 0 = '; … ; R n Processors reject any messages with incorrect signatures.
value from a correct processor
Jaap-Henk Hoepman // Radboud University Nijmegen //
Using authentication to tolerate Byzantine failures
n Could the protocol for crash failures by used to toleratean arbitrary number if Byzantine failures?
forge information?
29-2-2016 // Fault Tolerance - Byzantine Generals 32
Valluik
:If
an
processor
have
An
some
inputvalue
v
,ken
v
must
be
the
de
"
(
is the
default
must
decision
value
decide
←
①
①
①
① ①
1-
!
{ No
⇒
Vp
= kon ) →decision
=te
default
=Jaap-Henk Hoepman // Radboud University Nijmegen //
(Re)onsider the weak broadcast protocol
n One server ' holds a bit
n Consistency condition:
n Termination condition:
n Assumptions
29-2-2016 // Fault Tolerance - Byzantine Generals 34
Jaap-Henk Hoepman // Radboud University Nijmegen //
(Binary) Broadcast (aka agreement)
n Sender ' in round 1
n Other nodes (
«If you receive a valid 1 / message (note 0 = R) with 0 = '; 0′ then send 1 / , = 1 /;- to all, decide on 1 and terminate
29-2-2016 // Fault Tolerance - Byzantine Generals 35
fan
?
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness
n Agreement
received a valid 1 / message.
1 / , = 1 /;- message to all correct ( who therefore decide on 1 too.
sent a valid 1 /å;- message to all correct nodes that therefore decided
n
29-2-2016 // Fault Tolerance - Byzantine Generals 36
Jaap-Henk Hoepman // Radboud University Nijmegen //
Correctness
n Validity
1 in round 1.
node receives a valid 1 / message, so all correct nodes decide 0 in round 8 + 1
29-2-2016 // Fault Tolerance - Byzantine Generals 37
Jaap-Henk Hoepman // Radboud University Nijmegen //
Using agreement to reach consensus
n Use Byzantine agreement as a subprotocol
broadcast its input value to all other nodes. This takes at most 8 + 1 rounds
vector of input values
deterministic way)
this value.
29-2-2016 // Fault Tolerance - Byzantine Generals 38
Jaap-Henk Hoepman // Radboud University Nijmegen //
Strong validity condition yields 8 < >/2
n Consider weak validity
is the decision value
n Then the algorithm for crash failures strengthened with authentication becomes a consensus algorithm for Byzantine failures for arbitrary 8 < >
29-2-2016 // Fault Tolerance - Byzantine Generals 39