distributed systems the byzantine generals problem · byzantine generals problem commander must...
TRANSCRIPT
![Page 1: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/1.jpg)
Distributed systems:
The Byzantine Generals Problem
Matej Pavlovič
Distributed Programming Laboratory
![Page 2: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/2.jpg)
System model so far
• n processes, message passing
• Process crashes• Algorithms become non-trivial
• Additional assumptions required (P, correct majority…)
• What if processes could lie?
![Page 3: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/3.jpg)
Leslie Lamport: The Byzantine Generals Problem
![Page 4: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/4.jpg)
![Page 5: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/5.jpg)
Retreat
Retreat
Attack
![Page 6: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/6.jpg)
Retreat
Retreat!
Retreat!
![Page 7: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/7.jpg)
Attack
Attack!
Attack!
![Page 8: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/8.jpg)
Retreat
Retreat!
Retreat!
![Page 9: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/9.jpg)
RetreatAttackRetreat
RetreatAttackRetreat
RetreatAttackRetreat
![Page 10: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/10.jpg)
RetreatAttackRetreat
RetreatAttackRetreat
RetreatAttackRetreat
Retreat!
Retreat!
Retreat!
![Page 11: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/11.jpg)
Traitor
![Page 12: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/12.jpg)
Attack!
Retreat!
Traitor
![Page 13: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/13.jpg)
AttackAttackRetreat
RetreatAttackRetreat
Traitor
![Page 14: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/14.jpg)
Traitor
Attack!
Retreat!
Retreat!
AttackAttackRetreat
RetreatAttackRetreat
![Page 15: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/15.jpg)
Requirements
• All loyal generals choose the same plan (Attack / Retreat)
• A few traitors cannot impose a bad plan on the loyal generals
![Page 16: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/16.jpg)
Let’s formalize
![Page 17: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/17.jpg)
v3 = Retreat
v1 = Retreat
v2 = Attack
1
2
3
![Page 18: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/18.jpg)
Let’s formalize
• n generals
• vi = i-th general’s opinion (value: Attack / Retreat)
• generals only exchange oral messages
… 2 conditions …
![Page 19: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/19.jpg)
Recall: Requirements
• All loyal generals choose the same plan (Attack / Retreat)
• A few traitors cannot impose a bad plan on the loyal generals
![Page 20: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/20.jpg)
Let’s formalize
• n generals
• vi = i-th general’s opinion (value: Attack / Retreat)
• generals only exchange oral messages
1) Every loyal general makes his decision based on the same information (d1,…,dn)
![Page 21: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/21.jpg)
1
2
3
Traitord1: Retreatd2: Attackd3: Retreat
d1: Retreatd2: Attackd3: Retreat
don’t care
![Page 22: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/22.jpg)
Recall: Requirements
• All loyal generals choose the same plan (Attack / Retreat)
• A few traitors cannot impose a bad plan on the loyal generals
![Page 23: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/23.jpg)
1
2
3
Traitord1: Attackd2: Attackd3: Attack
d1: Attackd2: Attackd3: Attack
don’t care
![Page 24: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/24.jpg)
1
2
3
Traitord1: Attackd2: Attackd3: Attack
d1: Attackd2: Attackd3: Attack
don’t care
v3 = Retreat
v2 = Retreat
![Page 25: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/25.jpg)
Let’s formalize
• n generals
• vi = i-th general’s opinion (value: Attack / Retreat)
• generals only exchange oral messages
1) Every loyal general makes his decision based on the same information (d1,…,dn)
2) If i-th general is loyal, every loyal general must base his decision on di = vi
![Page 26: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/26.jpg)
Let’s formalize
• n generals
• vi = i-th general’s opinion (value: Attack / Retreat)
• generals only exchange oral messages
1) Every loyal general makes his decision based on the same information (d1,…,dn) Every loyal general uses same value as di
2) If i-th general is loyal, every loyal general must base his decision on di = vi
![Page 27: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/27.jpg)
Commander and Lieutenants
• Solve once for each general i:• 1 commander (general i)
• n – 1 lieutenants (other generals)
• commander i sends value vi to lieutenants
![Page 28: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/28.jpg)
Byzantine Generals Problem
Commander must send an order to n – 1 lieutenants, such that:
BG1: All loyal lieutenants obey the same order
BG2: If commander is loyal, then every loyallieutenant obeys commander’s order
In our case, command is “Use ‘Attack’ / ‘Retreat’ as di”
![Page 29: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/29.jpg)
3 generals, 1 of them traitor
![Page 30: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/30.jpg)
Commander
Lieutenant 1 Lieutenant 2
“Commander said ‘Retreat!’”
“Attack!”Traitor
“Attack!”
To satisfy BG2, Lieutenant 1 must obey “Attack!”.
Attack!
![Page 31: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/31.jpg)
Commander
Lieutenant 1 Lieutenant 2
“Commander said ‘Attack!’”
“Retreat!”Traitor
“Retreat!”
To satisfy BG2, Lieutenant 1 must obey “Retreat!”.
Retreat!
![Page 32: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/32.jpg)
3 generals, 1 of them traitor
To satisfy BG2, a loyal lieutenant must obey the order directly received from the commander.
![Page 33: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/33.jpg)
Commander
Lieutenant 1 Lieutenant 2
“Commander said ‘Attack!’”
“Attack!”
Traitor
“Retreat!”
BG1 violated!
“Commander said ‘Retreat!’”
Retreat!Attack!
![Page 34: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/34.jpg)
3 generals, 1 of them traitor
To satisfy BG2, a loyal lieutenant must obey the order directly received from the commander.
If commander is a traitor, BG1 is violated.
No algorithm can satisfy BG1 and BG2 for 3 generals and 1 possible traitor.
![Page 35: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/35.jpg)
Impossibility result
• No algorithm can solve the “Byzantine Generals Problem” for 3 generals, if one of them can be a traitor.
• Generalization: There is no algorithm for 3f generals, if f or more of them can be traitors.(proof by reduction from 3 generals, 1 traitor)
![Page 36: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/36.jpg)
3f generals, f of them traitors
• Proof by contradiction:1. Assume a solution for BGP(3f, f) for some f
2. Use it to solve BGP(3,1)
Contradiction with “there is no solution to BGP(3,1)”
![Page 37: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/37.jpg)
Albanian generalsf Albanian generals
f Albanian generals
f Albanian generals
Some algorithmfor BGP(3f,f)
(exists by assumption)
![Page 38: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/38.jpg)
Albanian generalsf Albanian generals
f Albanian generals
f Albanian generals
Some algorithmfor BGP(3f,f)
(exists by assumption)simulates
simulates
simulates
Traitor f traitors
![Page 39: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/39.jpg)
Unsolvability for BGP(3f,f)
If algorithm for BGP(3f,f) existed
Could use it to solve BGP(3,1)
Contradiction to unsolvability of BGP(3,1)
Conclusion: No alg. for BGP(3f,f) exists.
![Page 40: Distributed systems The Byzantine Generals Problem · Byzantine Generals Problem Commander must send an order to n –1 lieutenants, such that: BG1: All loyal lieutenants obey the](https://reader035.vdocuments.site/reader035/viewer/2022071610/6148f9fe9241b00fbd6742d0/html5/thumbnails/40.jpg)
Conclusion
• If faulty processes can lie (not only crash)• Correct majority is not enough!
• Even two thirds are not enough!
• True for any synchrony assumptions
• What can we do? (next lecture)• Stronger assumption: > 2/3 are correct
• Use signed messages