The Byzantine Generals Problem Leslie Lamport , Robert Shostak , - - PowerPoint PPT Presentation

the byzantine generals problem
SMART_READER_LITE
LIVE PREVIEW

The Byzantine Generals Problem Leslie Lamport , Robert Shostak , - - PowerPoint PPT Presentation

The Byzantine Generals Problem Leslie Lamport , Robert Shostak , Marshall Pease ACM Transactions on Programming Languages and Systems (TOPLAS), v.4 n.3, p.382-401, July 1982 Citation Count: 734 The aim : to make a reliable computer system


slide-1
SLIDE 1

The Byzantine Generals Problem

Leslie Lamport , Robert Shostak , Marshall Pease

ACM Transactions on Programming Languages and Systems (TOPLAS), v.4 n.3, p.382-401, July 1982

Citation Count: 734

slide-2
SLIDE 2

The aim: to make a reliable computer system

reliable* !

: able to be trusted to do or provide what is needed : able to be relied on : able to be believed : likely to be true or correct

* http://www.merriam-webster.com/dictionary/reliable

slide-3
SLIDE 3
  • 1. INTRODUCTION
slide-4
SLIDE 4

A reliable computer system

  • must handle malfunctioning

components that give conflicting information to different parts of the system i.e.

  • must be able to cope (manage in spite of

difficulty) with the failures of one or more

  • f its components (conflicting feedback

information; no feedback at all)

The problem is expressed abstractly as the Byzantine Generals Problem.

slide-5
SLIDE 5
  • several divisions of the Byzantine army are

camped outside an enemy city.

  • each division commanded by its own general.
  • the generals can communicate with one

another only by messenger.

  • after observing the enemy, they must decide upon a

common plan of action.

The Byzantine Generals Problem (BGP)

THE PROBLEM: some of the generals may be traitors, trying to prevent the loyal generals from reaching agreement.

slide-6
SLIDE 6

The necessary conditions of BGP:

  • A. All loyal generals decide upon the

same plan of action.

The loyal generals will all do what the algorithm says they should, but the traitors may do anything they wish. The loyal generals should not only reach agreement, but should agree upon a reasonable plan. We therefore also want to insure that

  • B. A small number of traitors cannot

cause the loyal generals to adopt a “bad plan”.

slide-7
SLIDE 7
  • A. All loyal generals decide upon the same plan of action.

(A) by having all generals use the same method for combining the information

  • B. A small number of traitors cannot cause the loyal generals to

adopt a “bad plan”

(B) by using a robust method (based upon a majority vote*)

* A small number of traitors can affect the decision only if the loyal generals were almost equally divided between the two possibilities, in which case neither decision could be called bad.

How the conditions A and B can be achieved?

slide-8
SLIDE 8
  • 1. Every loyal general must obtain the same

information v(1), v(2), .. , v(n).

The generals may have different values of v(i) from the traitor i, as he may send different values to different generals.

1'. Any two loyal generals use the same value of v(i).

  • 2. If the ith general is loyal, then the value that

he sends must be used by every loyal general as the value of v(i).

The conditions for A to be satisfied:

slide-9
SLIDE 9

Byzantine Generals Problem

A commanding general must send an order to his (n - 1) lieutenant generals s.t. the Interactive Consistency conditions (IC) hold:

  • IC1. All loyal lieutenants obey the same
  • rder.
  • IC2. If the commanding general is loyal,

then every loyal lieutenant obeys the order he sends.

slide-10
SLIDE 10
  • 2. IMPOSSIBILITY

RESULTS

slide-11
SLIDE 11

IMPOSSIBILITY RESULTS

If the generals can send only oral messages*, then

NO SOLUTION will work UNLESS > 2/3 of the generals are LOYAL.

3 generals, 1 traitor = 2/3 => NO SOLUTION! (see the example)

* An oral message is one whose contents are completely under the control of the sender, so a traitorous sender can transmit any possible message. Such a message corresponds to the type of message that computers normally send to one another.

slide-12
SLIDE 12

* Lieutenant 2 is a traitor

v1 ATTACK v2 RETREAT What to do??? (?) Is it obvious for L1 that L2 is the traitor? IC2: I must obey the order of the commander (ATTACK) IC1: I need obey the same order as L2 has (RETREAT)

slide-13
SLIDE 13

* Commander is a traitor

v1 ATTACK v2 RETREAT What to do???

The same for L1!!! While L2 now is Loyal. So 2 of them are loyal, 1 traitor -> NO DECISION!!!! (?) Is it obvious for L1 that L2 is a traitor? NO!!! We don’t know for sure who is the traitor!

v1 RETREAT v2 ATTACK What to do???

slide-14
SLIDE 14

IMPOSSIBILITY RESULTS

(another notation of >2/3)

NO SOLUTION with fewer than 3m+1 generals can cope with m traitors*.

* The proof by contradiction - see the paper pp.385-386

slide-15
SLIDE 15

Reaching approximate agreement is just as hard as reaching exact agreement

Assumptions: the generals must agree only upon an approximate time of attack. The commander orders the time of the attack, and we require the following two conditions to hold: IC1'. All loyal lieutenants attack within 10 minutes of one another. IC2'. If the commanding general is loyal, then every loyal lieutenant attacks within 10 minutes of the time given in the commander's order. (We assume that the orders are given and processed the day before the attack and that the time at which an order is received is irrelevant - only the attack time given in the order matters)

This problem is unsolvable unless > 2/3 of the generals are loyal.

**skip**

slide-16
SLIDE 16

The example

Suppose the commander orders an attack at 1:00 and orders a retreat at 2:00. Each lieutenant follows the algorithm: (1) After receiving the attack time from the commander, a lieutenant does one of the following: (a) If the time is 1:10 or earlier, then attack. (b) If the time is 1:50 or later, then retreat. (c) Otherwise, continue to step (2). 2) Ask the other lieutenant what decision he reached in step (1). (a) If the other lieutenant reached a decision, then make the same decision he did. (b) Otherwise, retreat.

**skip**

slide-17
SLIDE 17
  • 3. A SOLUTION WITH

ORAL MESSAGES

slide-18
SLIDE 18

The assumptions of the oral messages system:

  • A1. Every message that is sent is delivered

correctly

  • The traitor cannot interfere with the messages they do send.
  • A2. The receiver of a message knows who sent

it

  • The traitor cannot confuse their intercourse by introducing spurious messages

with the names of other generals

  • A3. The absence of a message can be detected
  • This will foil a traitor who tries to prevent a decision by simply not sending

messages.

slide-19
SLIDE 19

The additional assumption for the 3rd and 4th sections: (A*). each general is able to send messages directly to every other general. There is no such requirement for the 5th section.

slide-20
SLIDE 20

Prevention of the crash: If there is no messages from the commander-traitor: let RETREAT be the default

  • rder for the loyal lieutenants.
slide-21
SLIDE 21

What information to take? Choose:

  • 1. The majority(v1, v2,.., vn) value

among the vi if it exists, otherwise the value RETREAT;

  • 2. The median of the vi, assuming

that they come from an ordered set.

slide-22
SLIDE 22

ORAL MESSAGE ALGORITHMS Algorithm OM(0), i.e. no traitors: (1) The commander sends his value to every lieutenant. (2) Each lieutenant uses the value he receives from the commander, or uses the value RETREAT if he receives no value.

slide-23
SLIDE 23

ORAL MESSAGE ALGORITHMS Algorithm OM(m), m > 0 - there are the traitors.

(1) The commander sends his value to every lieutenant. (2) For each i, let vi be the value Lieutenant i receives from the commander, or else be RETREAT if he receives no value. Lieutenant i acts as the commander in Algorithm OM(m-1) to send the value vi to each of the n - 2 other lieutenants. (3) For each i, and each j != i, let vj be the value Lieutenant i received from Lieutenant j in step (2) (using Algorithm OM(m - 1)), or else RETREAT if he received no such value. Lieutenant i uses the value majority(v1, v2,.., vn-1)

slide-24
SLIDE 24

n = 4 m = 1 (L3)

OM(1) 1.The commander sends v to all 2.send (L1 -> L2; v) using OM(0); send (L3 -> L1; x) using OM(0); L2 has not send anything yet. 3.L2 has: v1 = v2 = v and v3 = x, so he obtains the correct value v = majority(v, v, x).

* Lieutenant 3 is a traitor

slide-25
SLIDE 25

* Commander is a traitor

OM(1) 1.The commander sends false x, y, z 2.Everyone sends their vi from the commander to all 3.L1-L2 all has the same info: v1 = x; v2 = y; v3 = z, so they all obtain the same value majority(x, y, z) -> the commander is the traitor -> RETREAT.

slide-26
SLIDE 26

The correctness of OM(m) LEMMA 1. For any m and k, Algorithm OM (m) satisfies IC2 if there are more than 2k + m generals and at most k traitors. THEOREM 1. For any m, Algorithm OM (m) satisfies conditions IC1 and IC2 if there are more than 3m generals and at most m traitors.

slide-27
SLIDE 27
  • 4. A SOLUTION WITH

SIGNED MESSAGES

slide-28
SLIDE 28

The traitor’s ability to lie makes the BGP difficult. What if we can restrict this traitor’s ability?

The solution: sending of the unforgeable signed messages (we add A4)

slide-29
SLIDE 29

Additional assumption A4: (a) A loyal general's signature cannot be forged, and any alteration

  • f the contents of his signed

messages can be detected. (b) Anyone can verify the authenticity of a general's signature.

* We don’t care about a traitorous general's signature

slide-30
SLIDE 30

With signed messages, our constraints about the possible number of traitors no longer holds. In fact, a three-general solution does exist. We now give an algorithm that copes with m traitors for any number of generals. (The problem is vacuous if there are fewer than m + 2 generals.)

slide-31
SLIDE 31

Our algorithm assumes a function choice which is applied to a set of orders to obtain a single one. The only requirements we make for this function are

  • 1. If the set V consists of the single element v, then

choice(V) = v.

  • 2. choice(0) = RETREAT, where 0 is the empty set.

One possible definition is to let choice(V) be the median element of V, assuming that there is an

  • rdering of the elements.
slide-32
SLIDE 32

SIGNED MESSAGE ALGORITHM SM(m)

Initially Vi = 0. (1) The commander signs and sends his value to every lieutenant. (2) For each i: (A) If Lieutenant i receives a message of the form v:0 from the commander and he has not yet received any order, then (i) he lets Vi equal {v}; (ii) he sends the message v:0:i to every other lieutenant.

slide-33
SLIDE 33

SIGNED MESSAGE ALGORITHM SM(m)

(B) If Lieutenant i receives a message of the form v:0:j1:j2:..:jk and v is not in the set Vi, then (i) he adds v to Vi; (ii) if k < m, then he sends the message v: 0:j1:j2:..:jk:i to every lieutenant other than j1:j2:..:jk. (3) For each i: When Lieutenant i will receive no more messages [one message of the form v: 0:j1:j2:..:jk or time-out], he obeys the order choice(Vi).

slide-34
SLIDE 34

Each lieutenant i maintains a set Vi, containing the set of properly signed orders he has received so far. If the commander is loyal, then this set Vi should never contain more than a single element.

* Do not confuse Vi, the set of orders he has received, with the set of messages that he has received. There may be many different messages with the same order.

general 0

  • the commander
slide-35
SLIDE 35

Note that

In step (2), Lieutenant i ignores any message

  • containing an order v that is

already in the set Vi.

  • that do not have the proper form
  • f a value followed by a string of

signatures.

slide-36
SLIDE 36

The correctness of SM(m) THEOREM 2. For any m, Algorithm SM(m) solves the BGP if there are at most m traitors.

slide-37
SLIDE 37
  • 5. MISSING

COMMUNICATION PATHS

slide-38
SLIDE 38

No more that additional assumption: each general is able to send messages directly to every other general.

We suppose that physical barriers place some restrictions

  • n who can send messages to

whom.

slide-39
SLIDE 39

We consider the generals to form the nodes of a simple*,finite undirected graph G, where an arc between two nodes indicates that those two generals can send messages. Thus we need an extension to OM(m) and SM(m)!

* A simple graph is one in which there is at most one arc joining any two nodes, and every arc connects two distinct nodes.

slide-40
SLIDE 40

Two generals are said to be neighbors if they are joined by an arc. Definition 1. (a) A set of nodes (i1, ..., ip} is said to be a regular set of neighbors of a node i if: (i) each ij is a neighbor of i, and (ii) for any general k different from i, there exist paths yj,k from ij to k not passing through i such that any two different paths yj,k have no node in common other than k. (b) The graph G is said to be p-regular if every node has a regular set of neighbors consisting of p distinct nodes.

slide-41
SLIDE 41

an example of a simple 3-regular graph. an example of a graph that is not 3-regular (because the central node has no regular set of neighbors containing three nodes)

slide-42
SLIDE 42

The extension of OM(m) in the presence of m traitors if the graph G of generals is 3m- regular. (Note that a 3m-regular graph must contain at least 3m + 1 nodes.) For all positive integers m and p, we define the algorithm OM(m, p) as follows when the graph G of generals is p-regular. (OM(m,p) is not defined if G is not p-regular.) The definition uses induction on m.

slide-43
SLIDE 43

ORAL MESSAGE ALGORITHM EXTENSION OM(m,p):

(0) Choose a regular set N of neighbors of the commander consisting of p lieutenants. (1) The commander sends his value to every lieutenant in N. (2) For each i in N, let vi be the value Lieutenant i receives from the commander, or else RETREAT if he receives no value. Lieutenant i sends vi to every other lieutenant k as follows: (A) If m = 1, then by sending the value along the path yi,k whose existence is guaranteed by part (a)(ii) of Definition 1.

slide-44
SLIDE 44

ORAL MESSAGE ALGORITHM EXTENSION OM(m,p):

(B) If m > 1, then by acting as the commander in the algorithm OM(m-1, p-1), with the graph of generals obtained by removing the original commander from G. 3) For each k, and each i in N with i != k, let vi be the value Lieutenant k received from Lieutenant i in step (2), or RETREAT if he received no value. Lieutenant k uses the value majority(vi1,..,vip,), where N = {i1,..,ip}.

slide-45
SLIDE 45

The correctness of OM(m,p) LEMMA 2. For any m > 0 and any p >= 2k + m, Algorithm OM (m, p) satisfies IC2 if there are at most k traitors. THEOREM 3. For any m > 0 and any p >= 3m, Algorithm OM(m, p) solves the BGP if there are at most m traitors.

slide-46
SLIDE 46

The correctness of extended SM(m) THEOREM 4. For any m and d, if there are at most m traitors and the subgraph of loyal generals has diameter d, then modified Algorithm SM(m + d - 1) solves the BGP.

  • COROLLARY. If the graph of loyal generals is

connected, then modified SM(n - 2) solves the BGP for n generals.