Professional Documents
Culture Documents
Introduction
Processes/Sites in distributed systems often compete as well as cooperate to achieve a common goal. Mutual Trust/agreement is very much required. In Distributed Data bases, there may be a situation where data managers have to decide Whether to commit or Abort the Transaction When there is no failure, reaching an agreement is easy. However, in case of failures, processes must exchange their values with other processes and relay the values received from others several times to isolate the effect of faulty processor. Agreement Protocols helps to reach an agreement in presence of failures.
2
System Model
1. 2. 3. 4. 5. Agreement Problems have been studied under following System Model: n processors and at most m of the processors can be faulty Processors can directly communicate with other processors by message passing. Receiver knows the identity of the sender Communication medium is reliabble. Only Processors are prone to failures
2. 1. 2.
3.
4.
1. 2. 3.
2. 3.
If source is faulty then all non- faulty processors can agree on any common value. Value agreed upon by faulty processors is irrelevant
10
Consensus Problem
1. Every Processor broadcasts its initial value to all other processors. Initial Values may be different for different processors. Protocol must meet following objectives: Agreement : All non-faulty processors agree on the same single value. Validity : If initial value of every non-faulty processor is v , then the common agreed value by all non-faulty processors must be v.
2.
If initial value of non-faulty processors are different then all non- faulty processors can agree on any common value. Value agreed upon by faulty processors is irrelevant
11
1.
2.
Every Processor broadcasts its initial value to all other processors. Initial Values may be different for different processors. Protocol must meet following objectives: Agreement : All non-faulty processors agree on the same vector (v1,v2,vn). Validity : If ith processor is non-faulty and its initial value is vi, then the ith value agreed by all non-faulty processors must be vi. If jth processor is faulty then all non- faulty processors can agree on any common value vj. Value agreed upon by faulty processors is irrelevant
12
Lamport-Shostak-Pease Algorithm
1. 2. This algorithm also known as Oral Message Algorithm OM(m) where m is the number of faulty processors n = Number of processors and n >= 3m+1 Algorithm is Recursively defined as follows: Algorithm OM(0) Source processor sends its values to every processor Each processor uses the value it receives from source. [If no value is received default value 0 is used] Algorithm OM(m), m>0 The source processor sends its value to every processor.
14
1.
Cont
2. 3. 4. For each i, let vi be the value processor i receives from source.[ Default value 0 if no value received] Processor I acts as the new source and initiates Algorithm OM(m-1) where it sends the value vi to each of the n-2 other processors. For each i and j (not i), let vj be the value processor i received from processor j in STEP 3. Processor I uses the value majority(v1,v2.vn-1). The function majority(v1,v2.vn-1) computes the majority value if exists otherwise it uses default value 0.
15
Byzantine Agreement Can not be reached among three processors if one processor is faulty
P0 is source processor
P0 is NON-Faulty
P0 1 P1 1 0
P0 is Faulty
P0
1
P2
1 P1 1 0
0
P2
16
17