Unit-3A - Aggrement Protocols
Unit-3A - Aggrement Protocols
1 Vijay S. Katta
2 Vijay S. Katta
1
AGREEMENT PROTOCOLS
3 Vijay S. Katta
Introduction
Processes/Sites in distributed systems often compete as well
as cooperate to achieve a common goal.
4 Vijay S. Katta
2
Introduction Cont…
When there is no failure, reaching an agreement is
easy.
5 Vijay S. Katta
Synchronous Computation
1. Processes run in lock step manner [ Process receives a message sent to
it earlier, performs computation and sends a message to other process ] .
2. Step of Synchronous computation is called round.
Asynchronous Computation
1. Computation does not proceed in lock step.
2. Process can send receive messages and perform computation at any
time.
3
System Model
Agreement Problems have been studied under following System
Model:
7 Vijay S. Katta
2. Omission Fault :
(i) Processor Omits to send message to some processors.
3. Malicious Fault :
(i) Also known as Byzantine Faults.
(ii) Processor may send fictitious values/message to other processes to
confuse them.
(iii) Tough to detect/correct.
8 Vijay S. Katta
4
Authenticated VS Non-Authenticated Messages
Authenticated Messages:
1. Also known as signed Message.
2. Processor can not forge/change a received message.
3. Processor can verify the authenticity of the message.
4. It is easier to reach on an agreement in this case.
Non-Authenticated Messages:
1. Also known as Oral Message/unregistered message.
2. Processor can forge/change a received message and claims to have
received it from others.
3. Processor can not verify the authenticity of the message in this case.
9 Vijay S. Katta
10 Vijay S. Katta
5
Agreement Issue
1 1
P2
0
1
P1 P3
0
1= Commit
0= Abort/ Do not commit
11 Vijay S. Katta
2. Consensus Problem:
Cont..
12 Vijay S. Katta
6
Classification of Agreement Problems
There are three well known agreement problems in distributed
systems:
1. Byzantine Agreement Problem :
A single Value is to be agreed upon.
Agreed Value is initialized by an arbitrary processor and all non faulty
processors have to agree on that value.
2. Consensus Problem:
Every processor has its own initial value and all non faulty processors
must agree on a single common value.
3. Interactive Consistency Problem:
Every processor has its own initial value and all non faulty processors
must agree on a set of common values.
Cont..
13 Vijay S. Katta
In All the previous mentioned problems, all non faulty processors must
reach an agreement
14 Vijay S. Katta
7
Byzantine Agreement Problem
Source Processor [ Any arbitrarily chosen processor] broadcasts its
values to others.
“If source is faulty then all non- faulty processors can agree on any common
value”.
“Value agreed upon by faulty processors is irrelevant”
Consensus Problem
Every Processor broadcasts its initial value to all other processors.
Initial Values may be different for different processors.
Protocol must meet following objectives:
1. Agreement : All non-faulty processors agree on the same single value.
2. Validity : If initial value of every non-faulty processor is v , then the
common agreed value by all non-faulty processors must be v.
“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”
16 Vijay S. Katta
8
Interactive Consistency Problem
2. 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”.
18 Vijay S. Katta
9
Lamport-Shostak-Pease Algorithm
This algorithm also known as Oral Message Algorithm OM(m) where
m is the number of faulty processors.
19 Vijay S. Katta
2. For each i, let vi be the value processor i receives from source.[ Default
value 0 if no value received]
3. 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.
4. For each i and j (not i), let vj be the value processor j received from
processor i in STEP 3. Processor j uses the value majority(v1,v2….vn-1).
20 Vijay S. Katta
10
Po non faulty source and P2 is faulty
21 Vijay S. Katta
P0 is source processor
P0 is NON-Faulty P0 is Faulty
P0
P0
1 0
1 1
1
1 P1 P2
P1 P2
0
1
22 Vijay S. Katta
11
Applications of Agreement Algorithms
1. Fault-Tolerant Clock Synchronization
Distributed Systems require physical clocks to synchronized.
Physical clocks have drift problem.
Agreement Protocols may help to reach a common clock value.
23 Vijay S. Katta
24 Vijay S. Katta
12
Fault –Tolerant Clock Synchronization
Satisfy following two condition
A. At any time, the value of clocks of all non-faulty
processors are approximately the same value.
25 Vijay S. Katta
26 Vijay S. Katta
13
Interactive Convergence Algorithm
27 Vijay S. Katta
28 Vijay S. Katta
14
(2) Interactive Consistency algorithm
Use median of clock value rather than mean.
When faulty values are less median provide good
approximation.
29 Vijay S. Katta
30 Vijay S. Katta
15