Byzantine General Problem by indrajitsah

VIEWS: 156 PAGES: 18

									       BYZANTINE GENERAL
            PROBLEM
                 PRESENTED BY:

                 INDRAJIT SAHA

         SUBJECT: DISTRIBUTED COMPUTING
                     ITM - 709

             UNDER THE GUIDANCE OF

          DR. DEBAJYOTI MUKHOPADHYAY

PROFESSOR AND HEAD OF INFORMATION TECHNOLOGY AND
     MANAGEMENT INFORMATION SYSTEM CLUSTER

            CALCUTTA BUSINESS SCHOOL
                             Faults

 A system fails when it cannot meet its promises
    (specifications)
   An error is part of a system state that may lead to a
    failure
   A fault is the cause of the error
   Fault-Tolerance: the system can provide services
    even in the presence of faults
   Faults can be:
     Transient (appear once and disappear)
     Intermittent (appear-disappear-reappear behavior)

     Permanent (appear and persist until repaired)
                    Failure Types

 Fail-Stop: Fails by stopping. No output is produced.


 Consistent Output: All users see the same wrong
 output.

 Byzantine Failure: No consistency is guaranteed:
 different users may see different values of the output.
       Distributed (Byzantine) Agreement

Assumption: unicast communication, synchronous &
  ordered

Problem: The correct participants agree on the values of all
  other participants in the system.

Main result: Assuming arbitrary failure semantics, we need
 3k + 1 group members to survive the attacks of k faulty
 members
       Note: This is also known as Byzantine agreement problem.
               Byzantine Generals Problem

 The Byzantine army is besieging a city, each division
  commanded by its own general. The commander-in-
  chief coordinates the divisions.
 There could be traitors among these commanders.
 The c-in-c has two alternatives:
    Attack
    Retreat
 If the actions taken by each division is not consistent
  with that of the others, the army will be defeated.
 Commands are sent in the form of two-party oral
  messages. Assume messages are not lost.
               Requirements for Success

 The decision algorithm must satisfy the following
 conditions of interactive consistency:

    IC1 All loyal generals must agree on the same plan of action.
    IC2. If the c-in-c is loyal, the loyal generals must obey his
     order.
                 Impossibility Result

 Try to solve the problem with the c-in-c and two
  divisional generals, A and B.
 Case 1. The c-in-c is a traitor: tells A to attack and B to
  retreat.

 Case 2. The c-in-c is loyal but A is a traitor. He tells both
  A and B to attack; however, A tells B that his orders from
  the c-in-c are to retreat. What should B do?

 Conclusion: The problem cannot be solved for a 3-node
  system with one Byzantine failure.
        Byzantine generals problem

Byzantine generals problem: N generals aim to attack a
  castle. Each general observers the situation in the field (eg.,
  troop strength) After sending each other messengers with
  their observations:
 All loyal generals must reach the same decision
 The decision should be the one proposed by the majority of
  loyal generals (based on data gathered from everyone)

Another formulation: A commanding general must send
  “attack” or “retreat” orders to his N-1 lieutenants such that:
 C1: All loyal lieutenants act the same
 C2: If the commanding general is loyal then all loyal
  lieutenants obey the order he sends.
                  Byzantine Agreement




The Byzantine generals problem for 3 loyal generals and 1 traitor.
a)   The generals announce their troop strengths (in units of 1 kilosoldiers).
b)   The vectors that each general assembles based on (a)
c)   The vectors that each general receives in step 3.
     Byzantine Agreement




 The same as in previous slide, except now with
  2 loyal generals and one traitor. (Not Feasible)
                                Case 1

  Traitor lieutenant tries to foil consensus by refusing to
    participate                      “white hats” == loyal or “good guys”
                                     “black hats” == traitor or “bad guys”

Round 1: Commanding
General sends “Retreat”       Commanding General 1
Round 2: L3 sends “Retreat”
to L2, but L2 sends nothing                       Loyal lieutenant obeys
                                 R     R          commander. (good)
Decide: L3 decides “Retreat”

                                                      Lieutenant 3
      Lieutenant 2                                     decides to retreat
                                           R
                               Case 2a

  Traitor lieutenant tries to foil consensus by lying
    about order sent by general
Round 1: Commanding
General sends “Retreat”    Commanding General 1
Round 2: L3 sends “Retreat”
to L2; L2 sends “Attack” to L2                 Loyal lieutenant obeys
                                   R   R       commander. (good)
Decide: L3 decides “Retreat”

                                                   Lieutenant 3
      Lieutenant 2                                  decides to retreat
                                           R
                               A
                                Case 2b

  Traitor lieutenant tries to foil consensus by lying
    about order sent by general
Round 1: Commanding
General sends “Attack”     Commanding General 1
Round 2: L3 sends “Attack” to
L2; L2 sends “Retreat” to L2                    Loyal lieutenant disobeys
                                    A   A       commander. (bad)
Decide: L3 decides “Retreat”

                                                    Lieutenant 3
      Lieutenant 2                                   decides to retreat
                                            A
                                R
                                 Case 3
    Traitor General tries to foil consensus by sending
     different orders to loyal lieutenants
Round 1: General sends
“Attack” to L2 and
“Retreat” to L3               Commanding General 1
Round 2: L3 sends “Retreat”
to L2; L2 sends “Attack” to L2                   Loyal lieutenants obey
Decide: L2 decides “Attack”          A   R       commander. (good)
and L3 decides “Retreat”                         Decide differently (bad)

                                                     Lieutenant 3
       Lieutenant 2                                   decides to retreat
       decides to attack                     R
                                 A
                   Example: f = 1, n = 4
   Loyal General, 1 traitor lieutenant
Step 1: Commander sends same    Commander 1
value, v, to all
Step 2: Each of L2, L3, L4
executes OM(0) as commander,     v       v
but L2 sends arbitrary values        v
Step 3: Decide
L3 has {v,v,x},
L4 has {v,v,y},                 v             v
Both choose v.
                         x             v
              L2                      L3      v   L4
                     y
                     Example: f = 1, n = 4
    Traitor General, all lieutenants loyal
Step 1: Commander sends           Commander 1
different value, x,y,z, to each
                                                All loyal
Step 2: Each of L2, L3, L4                      lieutenants get
executes OM(0) as commander,       x       z    same result.
sending value they received            y
Step 3: Decide
L2 has {x,y,z}
L3 has {x,y,z},                   y                z
L4 has {x,y,x},
                            x            y
               L2                       L3         z         L4
                        x
                                Problem

 Lots of messages required to handle even 1 faulty process
 Need minimum 4 processes to handle 1 fault, 7 to handle 2
  faults, etc.
     But as system gets larger, probability of a fault also increases


 If we use signed messages, instead of oral messages, can
  handle f faults with 2f+1 processes
     Simple majority requirement
     Still lots of messages sent though, plus cost of signing
     Thank You



For Any Queries, Mail To:




    indrajitsah@gmail.com

								
To top