1 / 122

Fault-Tolerant Consensus

Fault-Tolerant Consensus. Communication Model. Complete graph Synchronous, network. Broadcast. a. a. a. a. Send a message to all processors in one round. a. a. a. a. At the end of round: everybody receives a. Broadcast. a. b. a. b. a. a. b. b.

curtsinger
Download Presentation

Fault-Tolerant Consensus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fault-Tolerant Consensus

  2. Communication Model • Complete graph • Synchronous, network

  3. Broadcast a a a a Send a message to all processors in one round

  4. a a a a At the end of round: everybody receives a

  5. Broadcast a b a b a a b b Two or more processes can broadcast at the same round

  6. a,b b a,b a,b a

  7. Crash Failures a Faulty processor a a a

  8. a Faulty processor a Some of the messages are lost, they are never received

  9. a Faulty processor a

  10. Round 1 Round 2 Round 3 Round 4 Round 5 Failure After failure the process disappears from the network

  11. Consensus 0 Start 1 4 3 2 Everybody has an initial value

  12. 3 Finish 3 3 3 3 Everybody must decide the same value

  13. 1 1 1 1 1 1 1 1 1 1 Validity condition: If everybody starts with the same value they must decide that value Finish Start

  14. A simple algorithm Each processor: • Broadcast value to all processors • Decide on the minimum (only one round is needed)

  15. Start 0 1 4 3 2

  16. Broadcast values 0,1,2,3,4 0 0,1,2,3,4 0,1,2,3,4 1 4 0,1,2,3,4 3 2 0,1,2,3,4

  17. Decide on minimum 0,1,2,3,4 0 0,1,2,3,4 0,1,2,3,4 0 0 0,1,2,3,4 0 0 0,1,2,3,4

  18. Finish 0 0 0 0 0

  19. 1 1 1 1 1 1 1 1 1 1 This algorithm satisfies the validity condition Finish Start If everybody starts with the same initial value, everybody decides on that value (minimum)

  20. Consensus with Crash Failures The simple algorithm doesn’t work Each processor: • Broadcast value to all processors • Decide on the minimum

  21. Start fail 0 0 1 0 4 3 2 The failed processor doesn’t broadcast Its value to all processors

  22. Broadcasted values fail 0 0,1,2,3,4 1,2,3,4 1 4 0,1,2,3,4 1,2,3,4 3 2

  23. Decide on minimum fail 0 0,1,2,3,4 1,2,3,4 0 1 0,1,2,3,4 1,2,3,4 0 1

  24. Finish fail 0 0 1 0 1 No Consensus!!!

  25. If an alforithm solves consensus for f failed process we say it is: an f-resilient consensus algorithm

  26. 0 1 2 Finish Start 1 3 4 1 Example: The input and output of a 3-resilient consensus algorithm

  27. An f-resilient algorithm Round 1: Broadcast my value Round 2 to round f+1: Broadcast any new received values End of round f+1: Decide on the minimum value received

  28. Example: f=1 failures, f+1 = 2 rounds needed Start 0 1 4 3 2

  29. Example: f=1 failures, f+1 = 2 rounds needed Round 1 0 fail 0 0,1,2,3,4 1,2,3,4 1 0 4 (new values) 0,1,2,3,4 1,2,3,4 3 2 Broadcast all values to everybody

  30. Example: f=1 failures, f+1 = 2 rounds needed Round 2 0,1,2,3,4 0,1,2,3,4 1 4 0,1,2,3,4 0,1,2,3,4 3 2 Broadcast all new values to everybody

  31. Example: f=1 failures, f+1 = 2 rounds needed Finish 0,1,2,3,4 0,1,2,3,4 0 0 0,1,2,3,4 0,1,2,3,4 0 0 Decide on minimum value

  32. Example: f=2 failures, f+1 = 3 rounds needed Start 0 1 4 3 2 Another example execution with 3 failures

  33. Example: f=2 failures, f+1 = 3 rounds needed Round 1 0 Failure 1 1,2,3,4 1,2,3,4 1 0 4 0,1,2,3,4 1,2,3,4 3 2 Broadcast all values to everybody

  34. Example: f=2 failures, f+1 = 3 rounds needed Round 2 0 Failure 1 0,1,2,3,4 1,2,3,4 1 4 0,1,2,3,4 1,2,3,4 3 2 Failure 2 Broadcast new values to everybody

  35. Example: f=2 failures, f+1 = 3 rounds needed Round 3 0 Failure 1 0,1,2,3,4 O, 1,2,3,4 1 4 0,1,2,3,4 0,1,2,3,4 3 2 Failure 2 Broadcast new values to everybody

  36. Example: f=2 failures, f+1 = 3 rounds needed Finish 0 Failure 1 0,1,2,3,4 O, 1,2,3,4 0 0 0,1,2,3,4 0,1,2,3,4 3 0 Failure 2 Decide on the minimum value

  37. Example: f=2 failures, f+1 = 3 rounds needed Start 0 1 4 3 2 Another example execution with 3 failures

  38. Example: f=2 failures, f+1 = 3 rounds needed Round 1 0 Failure 1 1,2,3,4 1,2,3,4 1 0 4 0,1,2,3,4 1,2,3,4 3 2 Broadcast all values to everybody

  39. Example: f=2 failures, f+1 = 3 rounds needed Round 2 0 Failure 1 0,1,2,3,4 0,1,2,3,4 1 4 0,1,2,3,4 0,1,2,3,4 3 2 Broadcast new values to everybody Remark: At the end of this round all processes know about all the other values

  40. Example: f=2 failures, f+1 = 3 rounds needed Round 3 0 Failure 1 0,1,2,3,4 0,1,2,3,4 1 4 0,1,2,3,4 0,1,2,3,4 3 2 Failure 2 Broadcast new values to everybody (no new values are learned in this round)

  41. Example: f=2 failures, f+1 = 3 rounds needed Finish 0 Failure 1 0,1,2,3,4 0,1,2,3,4 0 0 0,1,2,3,4 0,1,2,3,4 3 0 Failure 2 Decide on minimum value

  42. If there are f failures and f+1 rounds then there is a round with no failed process 2 3 4 5 6 1 Round Example: 5 failures, 6 rounds No failure

  43. In the algorithm, at the end of the round with no failure: • Every (non faulty) process knows • about all the values of all other • participating processes • This knowledge doesn’t change until • the end of the algorithm

  44. Therefore, at the end of the round with no failure: everybody would decide the same value However, we don’t know the exact position of this round, so we have to let the algorithm execute for f+1 rounds

  45. Validity of algorithm: when all processes start with the same input value then the consensus is that value This holds, since the value decided from each process is some input value

  46. A Lower Bound Theorem: Any f-resilient consensus algorithm requires at least f+1 rounds

  47. Proof sketch: Assume for contradiction that f or less rounds are enough Worst case scenario: There is a process that fails in each round

  48. Worst case scenario Round 1 a before process fails, it sends its value a to only one process

  49. Worst case scenario 2 Round 1 a before process fails, it sends value a to only one process

  50. Worst case scenario 2 3 f Round 1 ……… a At the end of round f only one process knows about value a

More Related