Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jacob Gardner & Chuan Guo

Similar presentations


Presentation on theme: "Jacob Gardner & Chuan Guo"— Presentation transcript:

1 Jacob Gardner & Chuan Guo
Byzantine Agreement Jacob Gardner & Chuan Guo

2 What is agreement?

3 What is agreement? Attack, or Retreat?

4 What is agreement? Attack! Attack, or Retreat? Attack! Attack!

5 What is agreement? Attack! Attack, or Retreat? Attack! Attack!

6 What is agreement? Retreat! Attack, or Retreat? Retreat! Retreat!

7 What is agreement? Retreat! Attack, or Retreat? Retreat! Retreat!

8 What is agreement? Attack! Attack, or Retreat? Retreat! Retreat!

9 What is agreement? Attack! Attack, or Retreat? Retreat! Retreat!

10 All generals decide upon the same plan of action.
What is agreement? All generals decide upon the same plan of action. Caveat: This is not a paper about military strategy.

11 All generals decide upon the same plan of action.
What is agreement? All generals decide upon the same plan of action. What basic tools do we need to achieve agreement? Caveat: This is not a paper about military strategy.

12 Assumptions (p 387) All messages are delivered correctly.
All recipients can verify who sent each message. The absence of a message can be detected. “Oral Messages”

13 Agreement A! A Attack, or Retreat? A! R! A R

14 Agreement A! A Attack, or Retreat? A! R! A A R

15 Agreement A! A R Attack, or Retreat? A! R! A R A R

16 Agreement A! A R Attack, or Retreat? A! R! A R A R

17 Agreement Attack! A R Attack, or Retreat? Attack! Attack! A R A R

18 Agreement Observation (p 384)
Attack! A R Attack, or Retreat? Observation (p 384) We can restrict our consideration to the problem of how a single general sends his value to the others. Attack! Attack! v(1) A R A R

19 Reformulation Attack, or Retreat?

20 Reformulation Attack, or Retreat?

21 Reformulation A! Attack, or Retreat?

22 Reformulation A! Attack, or Retreat? Attack! Attack!

23 Reformulation A! Attack, or Retreat? Attack! Attack! Attack! Attack!

24 Reformulation A! Attack, or Retreat? Attack! Attack! Attack! Attack!
How does this differ from Paxos?

25

26 All generals decide upon the same plan of action.
What is agreement? All generals decide upon the same plan of action. Caveat: This is not a paper about military strategy.

27 All generals decide upon the same plan of action.
What is agreement? Loyal v All generals decide upon the same plan of action. Caveat: This is not a paper about military strategy.

28 All generals decide upon the same plan of action.
What is agreement? Loyal v All generals decide upon the same plan of action. Why? Caveat: This is not a paper about military strategy.

29 What could go wrong? Attack, or Retreat?

30 What could go wrong? Attack, or Retreat? Attack! Retreat!

31 What could go wrong? Attack, or Retreat? Attack! Retreat! Attack!

32 What could go wrong? Attack, or Retreat? Attack! Retreat! Attack!

33 What could go wrong? Attack, or Retreat? Attack! Retreat! Attack!
He said attack!

34 What could go wrong? Attack, or Retreat? Attack! Retreat! Attack!
I’m confused! He said attack!

35 What could go wrong? Attack, or Retreat?

36 What could go wrong? Attack, or Retreat? Attack! Attack!

37 What could go wrong? Attack, or Retreat? Attack! Attack!
He said retreat!

38 What could go wrong? Attack, or Retreat? Attack! Attack! I’m confused!
He said retreat!

39 What could go wrong? Attack, or Retreat? Retreat! Retreat!

40 What could go wrong? Attack, or Retreat? Retreat! Retreat!
He said attack!

41 What could go wrong? Attack, or Retreat? Retreat! Retreat!
I’m confused! Retreat! He said attack!

42 A B Retreat! He said attack! Attack! Retreat! He said attack!

43 Coping with 1 traitor requires more than 3 generals.
B Retreat! He said attack! Attack! Retreat! He said attack! Result: Coping with 1 traitor requires more than 3 generals.

44 >3 Generals Attack, or Retreat?

45 >3 Generals Attack, or Retreat?

46 >3 Generals Attack, or Retreat?

47 >3 Generals Attack, or Retreat?

48 No solution with fewer than 3𝑚+1 generals can cope with 𝑚 traitors.
Attack, or Retreat? Result: No solution with fewer than 3𝑚+1 generals can cope with 𝑚 traitors.

49 OM(0) A! Number of traitors assumed

50 OM(0) A! Number of traitors assumed A

51 OM(0) A! Number of traitors assumed A A

52 OM(0) A! Number of traitors assumed A A A

53 OM(0) A! Number of traitors assumed A A A

54 OM(1) Number of traitors assumed A A R

55 OM(1) Number of traitors assumed A A A R

56 OM(1) Number of traitors assumed A A A R

57 OM(1) Number of traitors assumed A R A R A R

58 OM(1) Number of traitors assumed A R A R A R

59 OM(1) A! Number of traitors assumed A A ??

60 OM(1) A! Number of traitors assumed A A R

61 OM(1) A! Number of traitors assumed A A ?? R

62 OM(1) A! Number of traitors assumed A A ?? R

63 OM(1) A! Number of traitors assumed A R A R ?? R

64 OM(1) A! Number of traitors assumed A R A R ?? R

65 OM(2) Number of traitors assumed

66 OM(2) Number of traitors assumed

67 OM(2) Number of traitors assumed

68 OM(2) Number of traitors assumed

69 OM(2) Number of traitors assumed

70 OM(2) Number of traitors assumed What are some drawbacks of this?

71 Assumptions (p 387) All messages are delivered correctly.
All recipients can verify who sent each message. The absence of a message can be detected. “Oral Messages”

72 Assumptions (p 391) “Signed Messages”
All messages are delivered correctly. All recipients can verify who sent each message. The absence of a message can be detected. A loyal general's signature cannot be forged, alterations can be detected, and anyone can verify authenticity of signatures. “Signed Messages”

73 SM(0) A A A A

74 SM(0) A A A A A

75 SM(0) A A A A A A

76 SM(0) A A A A A A

77 SM(1) R A A A R A R R

78 SM(1) What’s different here? R A A A R A R R

79 SM(1) What’s different here? R A A A R A R R

80 SM(1) R A A R What are some drawbacks of this? What’s different here?

81 Relation to State Machine Replication
All messages are delivered correctly. All recipients can verify who sent each message.

82 Relation to State Machine Replication
All messages are delivered correctly. Communication lines can fail, and we treat each failure as a node failure. All recipients can verify who sent each message.

83 Relation to State Machine Replication
All messages are delivered correctly. Communication lines can fail, and we treat each failure as a node failure. All recipients can verify who sent each message. Messages need to be sent directly rather than using packet switching. Alternatively, we can use digital signatures or message authentication codes (MACs) to ensure authenticity.

84 Relation to State Machine Replication
The absence of a message can be detected. A loyal general’s signature cannot be forged, alternations can be detected, and anyone can verify authenticity of signatures.

85 Relation to State Machine Replication
The absence of a message can be detected. Use a synchronized clock and set timeout for incoming messages. A loyal general’s signature cannot be forged, alternations can be detected, and anyone can verify authenticity of signatures.

86 Relation to State Machine Replication
The absence of a message can be detected. Use a synchronized clock and set timeout for incoming messages. A loyal general’s signature cannot be forged, alternations can be detected, and anyone can verify authenticity of signatures. Use digital signatures (e.g. RSA, DSA). Question: Why not use MACs?

87 Efficiency Issues OM(m) is impractical since the message complexity is 𝑂 𝑛 𝑚 for n nodes SM(m) has message complexity 𝑂( 𝑛 2 ), but each node needs to send and verify 𝑂 𝑛 signatures for every request Time measurements for a 64-byte message with 1024-bit key Signature generation: 43ms Signature verification: 0.6ms Very high response time!

88 Practical Byzantine Fault Tolerance
Miguel Castro and Barbara Liskov, OSDI 1999 Semi-synchronous Operates asynchronously until a view change (to be defined later) occurs Requires 𝑛=3𝑚+1 nodes to tolerate m failures 3% slower than non-tolerant implementation of a network file system

89 Practical Byzantine Fault Tolerance
Basic Idea: Commander sends 𝑣(𝑖) to lieutenant 𝑖 Every lieutenant sends commander’s order to every other lieutenant Lieutenant 𝑖 waits for at least 2𝑚−1 messages of 𝑣(𝑖) from different lieutenants before committing

90 Practical Byzantine Fault Tolerance
Why does this work? Suppose lieutenant 𝑖 commits 𝑣 𝑖 and lieutenant 𝑗 commits 𝑣(𝑗) Since at most 𝑚 generals are Byzantine, at least 𝑚+1 loyal generals (including 𝑖 himself) have sent 𝑣(𝑖) Same argument for 𝑣(𝑗) There are only 2𝑚+1 loyal generals, so some loyal general must have sent both 𝑣(𝑖) and 𝑣(𝑗). Hence 𝑣 𝑖 =𝑣(𝑗) Question: Liveness?

91 Practical Byzantine Fault Tolerance
To ensure liveness Use a local timer to check for timeouts Cycle between generals (i.e. nodes) to operate as commander (i.e. primary node), called views Initiate a synchronous view change consensus protocol if timeout occurs Full protocol involves many stages, too complicated to explain

92 Efficiency Asynchronous part does not require signatures
Use MACs to ensure authenticity of message MACs can be computed 3 orders of magnitude faster than digital signatures! Synchronous view change protocol requires digital signatures Happens rarely in realistic settings Faulty node can only cause view change if it is the primary node

93 Follow-ups Many papers built on top of PBFT
2000: Castro and Liskov – Proactive Recovery in a Byzantine-fault-tolerant System 2005: Abd-El-Malek et al. – Fault-scalable Byzantine Fault Tolerant Services. 2009: Kotla et al. – Zyzzyva: Speculative Byzantine Fault Tolerance 2009: Clement et al. – Making Byzantine Fault Tolerant Systems Tolerate Byzantine Faults 2010: Guerraoui et al. – The Next 700 BFT Protocols 2013: Aublin et al. – RBFT: Redundant Byzantine Fault Tolerance 2013: Veronese et al. – Efficient Byzantine Fault-Tolerance 2015: Bahsoun et al. – Making BFT Protocols Really Adaptive

94 Authenticated Messages
Review 𝑚= number of faults tolerated 𝑛= number of replicas needed Today Thursday Synchronous Semi-Synchronous Asynchronous Oral Messages Sufficient 𝑛≥3𝑚+1 [LSP80] Impossible 𝑛≤3𝑚 [LSP80] 𝑚≥1 [FLP82] Authenticated Messages 1≤𝑛 [LSP80] 𝑛≥3𝑚+1 [CL99] Credit: Eleanor Birrell, CS 6410, Fall 2010


Download ppt "Jacob Gardner & Chuan Guo"

Similar presentations


Ads by Google