Agreement Problem (Chapter 8)


A g r e e e m e n t t P r o t t o c o l l s s


Need for Agreement Algorithms

Processor failures only with synchronous computation

 Crash fault

Omission fault

Malicious fault

Byzantine fault

Synchronous vs. asynchronous computation

A process knows all the messages it expects (synchronous)

Agreement problem is not solvable in an asynchronous system

 We will solve the agreement problem assuming synchronous computation

Clock synchronization

Atomic commit in DDBS


Byzantine Agreement Problem

An arbitrarily chosen processor (source processor) will broadcast its initial value to all other processors.

 All non-faulty processors agree on the same value

If the source processor is non-faulty, then the common agreed upon value by all non-faulty processors should be the initial value of the source.

 If the source processor is faulty, then all non-faulty processors can agree on any common value

 It is irrelevant what value faulty processors agree on or whether they agree on a value at all.


Solution to the Byzantine agreement problem.

 The upper bound on the number of faulty processors.

 In order to reach an agreement on a common value, non-faulty processors need to be free from the influence of faulty processors.

 If faulty processors dominate in number, they can prevent non-faulty processors from reaching a consensus.

 It is impossible to reach a consensus if the number of faulty processors, m, exceeds (n-1)/3.


Lamport-Shostak-Pease Algorithm ( OM(m) )

 Requires m+1 rounds of message exchanges.

Assumes fully connected network.

 Solves the Byzantine problem for 3m+1 or more processors in the presence of at most m faulty processors.


The recursive algorithm

 Algorithm OM(0).

 The source processor sends its value to every processor.

Each processor uses the value it receives from the source.

Algorithm OM(m), m>0.

The source processor sends its value to every processor.

 For each i, let v i

be the value processor i receives from the source. Processor i acts as the new source and initiates Algorithm OM(m-1) wherein it sends the value v i

to each of the n-2 other processors.

 For each i and each j (!= i), let v j

be the value processor i received from processor j in the above step using Algorithm OM(m-1). Processor i uses the value majority (v


, v


, v


, … , v n-1




 O (n m ) message complexity.

 Dolev et al.’s Algorithm


Application of Agreement Algorithms in Fault-Tolerant Clock


 Sites maintain physical clocks that are closely synchronized with one another even in presence of Byzantine failures

 Periodic resynchronization



All clocks are initially synchronized to approximately the same value

 A nonfaulty process’s clocks runs at approximately the correct rate

 A non-faulty process can read the clock value of another non-faulty process with at most a small error.

Clock synchronization algorithm must satisfy:

 At any time, the value of the clocks of all non-faulty processes must be approximately equal

There is a small bound on the amount by which the clock of a non-faulty process is changed during each resynchronization


Interactive Convergence Algorithm

 Assumptions:

 Clocks are initially synchronized

Clocks are resynchronized often enough so that two non-faulty clocks never differ by more than

 Each process reads the value of all other processes’ clocks and sets its clock value to the average of these clock values

If a clock value differs from its own clock by more than

, it replaces that value by its own clock value when taking the average


 This algorithm brings the clocks of non-faulty processes closer

 Assumptions:

 All processes execute the algorithm instantaneously

 The error in reading another process’ clock is zero


Interactive Consistency Algorithm

 Improves the Interactive Convergence Algorithm by:

 Any two processes will compute approximately the same value for a process clock by taking the median of the clock values rather than the mean

 If a process is non-faulty, then every non-faulty process obtains approximately the correct value for this processes clock

 Therefore, if a majority of processes are non-faulty, the median of all the clock values is either approximately equal to a good clock

’s value or it lies between the values of two good clocks


Application of Agreement Algorithms in Atomic Commit in

Distributed Data Bases

Use of the Byzantine agreement protocol in two-phase commit algorithm