A Look at Byzantine Generals Problem - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

A Look at Byzantine Generals Problem

Description:

Imagine a city under siege. How do the leaders of the forces outside decide whether to attack or wait? ... Question: If all the loyal forces attack, can they ... – PowerPoint PPT presentation

Number of Views:625
Avg rating:3.0/5.0
Slides: 37
Provided by: Walt180
Category:

less

Transcript and Presenter's Notes

Title: A Look at Byzantine Generals Problem


1
A Look at Byzantine Generals Problem
  • R J Walters

2
Outline
  • Introduce BGP, and OM(x)
  • Some discussion about which algorithm to use
  • Some results
  • Conclusion

3
Byzantine Generals Problem
  • A classic distributed agreement problem
  • Imagine a city under siege
  • How do the leaders of the forces outside decide
    whether to attack or wait?
  • What is the effect if some of these leaders are
    traitors?

4
What to do?
  • Question If all the loyal forces attack, can
    they overwhelm the city?
  • Suppose they can, but only just
  • If the traitors can get some forces to attack and
    others no to, the city will stand
  • The Loyal Generals need to vote on what to do and
    then act on the outcome

5
Solving BGP
  • A method for a single loyal General to
    communicate their decision is all you need
  • Solution depends on the type of message
  • Written signed by the sender
  • Oral can be altered by anyone who handles it
  • Im only looking at oral messages

6
Example of the problem
7
Example of the problem
What is C to think of A? Is A loyal, if so
whats his vote?
8
The Solution
  • A scheme whereby messages are forwarded
  • Get this right and your fellow loyal players will
    be able to calculate the correct message, no
    matter what a few traitors do
  • (Remember we are now concerned with one loyal
    General passing their opinion to the other loyal
    Generals)

9
More on OM solution
  • The OM(x) algorithm
  • There must be at least 2x 1 Loyal Generals
  • x is the maximum number of traitors

10
Introduction to OM(x)
11
First round I say x
12
What 2 sends (round 2)
13
What 2 hears about 1s view
(I say) he said y
14
This is OM(1)
  • Considering J, they get
  • The message from H direct
  • Five reports of that message
  • There is nothing one traitor acting alone can do
    to interfere with the meaning received by J
  • (Loyal Generals report what they hear accurately)
  • And the same applies for the others (K-O)
  • (Obvious?)

15
Next round
  • For OM(2) messages are forwarded again
  • This is necessary if you are to guarantee the
    right result when there are two traitors

16
(I say) he says he said z
17
What 3 receives
18
What about these messages?
  • Now each player has a bunch of third hand
    reports of each of the second hand messages
  • They use these to arrive at the correct versions
    of the second hand messages
  • And then deduce the original message
  • (As before)

19
Whats happening?
  • My diagrams have reached their limit
  • In each round, each player passes on what they
    hear to all of the others
  • They dont send messages back to people who have
    already seen them
  • So, first round 6 messages
  • Then 5 more for each of those 6
  • And 4 more for each of the 30

20
Shortcomings of the solution
  • The number of messages is exploding
  • Round 1 6,
  • Round 2 6 x 5 30,
  • Round 3 6 X 5 x 4 120.
  • Remember we are just looking at one. There are 6
    other Generals who have to pass on their view

21
Total number of messages
  • 7 Generals
  • OM(0) 7 x 6 42
  • OM(1) 7 x (6 6x5) 252
  • OM(2) 7 x (6 6x5 6x5x4) 1092
  • OM(3)

22
Shortcomings of the solution
  • In order to apply it you need to know how many
    traitors are present
  • What if there are more?
  • Or less?
  • How can you possibly know?

23
So what do you do?
  • Anything works if there are no traitors
  • Use OM(1) and you are safe from the actions of a
    single traitor
  • Use OM(2) and you guarantee safety from the
    actions of as many as two traitors
  • OM(3) ? Does it work?

24
So, how many traitors?
  • We dont know who they are
  • We could guess (estimate)
  • How?
  • Probability of failure?
  • Whatever, we cannot guarantee the result.

25
So what?
  • Amongst 7 Generals, if the probability of bad
    behaviour is 5
  • The chance of zero traitors is quite good
  • The chance of no more than 1 is even better
  • The chance of exactly 2 is tiny
  • 3 or more is very unlikely

26
The Numbers for failure at 5
27
So what?
  • OM(2) requires more than four times the effort to
    perform
  • In effect, the extra work and messages of OM(2)
    guarantee the result if there are exactly two
    traitors
  • Is it worth it?

28
Implementation
  • I couldnt understand the Lamport paper so I
    built an implementation of the OM algorithm using
  • VB and MSMQ
  • It didnt behave quite as I expected

29
Observation
  • You get agreement where the guarantees apply
  • But you also get agreement pretty often when it
    is not guaranteed
  • Two types of traitor. Both ignore what they
    receive
  • A always sends the same value
  • B sends a random value

30
General Behaviour
  • Decide if you are loyal or not
  • If loyal, pick your value
  • Otherwise
  • A picks value to go in every message
  • B reselects value each time it sends a message
  • Run the algorithm and report your conclusion
  • (Uses the random number generator)

31
Result of 1000 runs
32
Result of 1000 runs
33
My conclusion
  • Not surprisingly, the B behaviour is more
    disruptive
  • In the situation I looked at
  • Unless it is vital you agree in the presence of
    two or less traitors, or you expect traitors to
    be disruptive or to collude
  • Its not worth the effort of doing OM(2)
  • BGP fully described by Lamport, Shostak and Pease
    in their 1982 paper

34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com