Agreement Protocols - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Agreement Protocols

Description:

In the absence of failures or faulty processors, values (that is to be decided) ... Processes run in lock step manner, or in rounds. ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 16
Provided by: Prab52
Category:

less

Transcript and Presenter's Notes

Title: Agreement Protocols


1
Agreement Protocols
  • Examples
  • Agreeing whether to commit or to abort a
    transaction in a distributed database management
    system.
  • Agreeing on a common clock value in a distributed
    system.
  • In the absence of failures or faulty processors,
    values (that is to be decided) can be exchanged.
    A vote can be taken and decision/agreement can be
    made based on majority, minimum vote, mean, etc.
  • Presence of failure processors can fail or
    misbehave intentionally. Several rounds of
    message exchanges might be needed before
    agreement can be reached.

2
System Model
  • n processors in the system with at most m of them
    being faulty.
  • Processors can exchange messages directly (no
    need to go through another processor).
  • Receiver knows the identity of the sender.
  • Communication medium is reliable messages are
    delivered without errors.

3
Synchronous Computation
  • Processes run in lock step manner, or in rounds.
  • In each step/round i, processes receive messages
    that were sent in the previous step/round i-1.
  • Processes then do some computation and send out
    messages, that will be received in step/round
    i1.
  • Message delays or a slow processor slows down the
    whole system.
  • Agreement protocols to be discussed assume
    synchronous computation.
  • Asynchronous computation A process can send,
    receive, and perform computation at any time.

4
Other Assumptions/Models
  • Processor can fail in 3 modes
  • Crash fault functioning stops (timeouts can be
    used).
  • Omission fault a processor forgets or omits
    actions, e.g., misses to send a message to 2 out
    of 5 processors.
  • Malicious fault a processor can send fictitious
    messages or modify values in a message,
    intentionally. Also called Byzantine faults.
  • Type of messages
  • Authenticated messages a faulty processor cannot
    modify/forge a message.
  • Non-authenticated messages messages can be
    forged.

5
Types of Agreement Problems
  • Byzantine Agreement Problem
  • A single value is to be agreed upon.
  • Initial value to be proposed by an arbitrary
    processor all non-faulty processors need to
    agree on that value.
  • Consensus Problem
  • Every processor has its own initial value.
  • All non-faulty processors agree on a common
    value.
  • Interactive Consistency Problem
  • Every processor has its own initial value.
  • All non-faulty processors agree on a set of
    common values (or) a vector.
  • Above three types are closely related. Byzantine
    agreement problem forms the basis of other 2
    types. We focus on Byzantine agreement.

6
Byzantine Agreement Problem
  • An arbitrary source processor broadcasts its
    initial value to all others.
  • If the source processor is faulty, other
    non-faulty processor can agree on any common
    value.
  • Faulty processors values and agreements do not
    matter.
  • If faulty processors are in majority, then
    non-faulty processors cannot reach an agreement.
  • Number of faulty processors, m, cannot exceed
    trunc(n-1)/3.
  • This bound can be relaxed for systems using
    authenticated messages.

7
Impossible Scenario
  • Consider a system with 3 processors p0, p1, p2.
  • Two possibilities
  • Case 1 p0 (source) is not faulty. p2 is faulty.
    p1 should agree upon 1 as the value. Not
    possible.
  • Case 2 p0 is faulty. p1 may agree on 1 and p2 on
    0.

Case 2
Case 1
p2
p0
1
1
1
1
1
0
p1
p1
p0
p2
0
0
8
Lamports Algorithm
  • Referred to as Oral Message Algorithm OM(m), m gt
    0.
  • For 3m 1 or more processors of which m are
    faulty.
  • Recursive Algorithm
  • Algorithm OM(0)
  • Source processor sends its value to every
    processor.
  • Each processor uses the value it receives from
    source. (If no value received, default value of 0
    assumed).
  • Algorithm OM(m), m gt 0
  • Source processor sends its value to every
    processor.
  • For each processor, let vi be the value received
    by processor i (from the source). Processor i
    acts as new source. Initiates OM(m-1). Sends vi
    to each of other n-2 processors.
  • Let vj be the value received by Pi from Pj in
    above step. (If no value received, vj is assumed
    to be 0). Pi uses majority (v1, v2, ..vn-1).

9
Lamports Algorithm ...
  • Processors are successively divided into smaller
    groups in step 2 where OM(m-1) is executed.
  • Step 3 is executed during the folding phases of
    recursion where a majority function selects the
    agreed value (among those received in step 2).
  • Note majority returns 0 if one does not exist.
  • Number of messages
  • OM(m) n- 1 executions of OM(m-1)
  • OM(m-1) n-2 executions of OM(m-2)....
  • (n-1)(n-2)(n-3)... (n-k) executions of OM(m-k), k
    1,2,3,...,m1.
  • Message complexity O(n power m).

10
Lamports Algorithm Example 1
  • System with 4 processors p0, p1, p2, p3. p0 is
    source, p2 is faulty.
  • Assumption possible values are only 1 and 0.
  • Step 1 p0 initiates the initial value to be 1.
    (Algorithm OM(1), m 1).
  • Step 2 OM(0). p1 sends 1 to p2, p3. p3 sends 1
    to p1,p2
  • p2 (the faulty one) sends 1 to p1 and 0 to p3.
  • Step 3 majority function at p1 and p3 is 1,
    which is the desired result. (Not bothered about
    p2, the faulty one).

p0
p0
1
1
1
1
1
1
1
0
p1
p1
p3
p3
p2
p2
1
1
1
1
11
Lamports Algorithm Example 2
  • System with 4 processors p0, p1, p2, p3. p0 is
    source, and is faulty.
  • Assumption possible values are only 1 and 0.
  • Step 1 p0 initiates the initial value to be 1
    for p1 and p3. For p2, it sends a 0(Algorithm
    OM(1), m 1).
  • Step 2 OM(0). p1 sends 1 to p2, p3. p3 sends 1
    to p1,p2
  • p2 sends 0 to p1 and p3.
  • Step 3 majority function at p1, p2, p3 is still
    the same (1), which is the desired result.

p0
1
1
0
1
0
p1
p3
p2
1
0
1
1
12
Fault-tolerant Clock Sync
  • Synchronizing distributed clocks
  • At any time, values of clocks of all non-faulty
    processes must be approximately equal.
  • There is a small bound on amount by which the
    clock of a non-faulty process is changed during
    re-synchronization.
  • Assumptions
  • A1 All clocks are synchronized to approximately
    the same values.
  • A2 A nonfaulty processs clock run at
    approximately the same rate. (No such assumptions
    about faulty clocks).
  • A3 A nonfaulty process can read the clock value
    of another nonfaulty process with at most a small
    error e.

13
Interactive Convergence
  • Each process reads the values of others clocks
    and sets its clock to the average of these
    values.
  • If a clock value differs from its own clock by
    more than d, it replaces that by its clock for
    taking average. (Takes care of faulty clocks).
  • Example Let 2 processes p and q, use Cpr and Cqr
    as clock values of a 3rd process r.
  • If r is nonfaulty, then Cpr Cqr. If r is
    faulty, then Cpr - Cqr lt 3 d. Why? Let Cq Cp
    - d Cpr Cp d Cqr Cq - d. So Cpr - Cqr
    Cp d - (Cp - d) - d 3 d.
  • (Difference in clock values of any 2 processes is
    bounded by d.)
  • For n processes with m faulty ones p and q use
    identical values of n-m nonfaulty processes and
    different values for m faulty processes that is
    bounded by 3 d.
  • So, Cp and Cq differ by at most (3m/n) d.
  • Since n gt 3m, this difference (3m/n) d is
    always less than d.

14
Interactive Convergence ...
  • Assumptions
  • All processes execute the algorithm
    simultaneously.
  • Error in reading another processs clock is 0.
  • This problem (with the assumptions) can be
    marginalized to a certain extent by
  • Rather than using absolute clock values, compute
    the average of difference in clock values.
  • Increment local value by this average.
  • Clock differences gt d, are replaced by 0.
  • Added assumption A nonfaulty process can read
    the difference between the clock value of another
    nonfaulty process, and its own with at most a
    small error of e.
  • If the clock reading error is e, difference in
    clock values read by a process can be as large as
    d e. Clock differences larger than d e are
    replaced by 0, while computing the average
    increment.

15
Interactive Consistency
  • Improvements
  • Median of clock values rather than the mean.
  • More strict conditions for clock reading
  • Any 2 processes obtain approximately the same
    value for a process ps clock.
  • Every nonfaulty process obtains approximately the
    correct value of another nonfaulty processs
    clock.
  • If majority of the processes are nonfaulty,
    median of all clock values is either
    approximately equal to a good clocks value (or)
    lies between the values of 2 good clocks.
Write a Comment
User Comments (0)
About PowerShow.com