SlideShare a Scribd company logo
Agreement Protocol
Saif Ali Khan
31703213
Computer Engineering(Cyber Security)
Guided By:
Prof. A.K. Singh
Deptt of Computer Engineering
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 1
Contents
1. What is agreement in distributed system and why agreement?
2. Synchronous and Asynchronous communication
3. Assumptions.
4. What is Agreement Problem(consensus problem) in Distributed
System?
5. Solutions to agreement problems in case of Synchronous system.
1.Lamport algo for crash failure
2.pease upper bound on faluty processes ‘f’
3. Lamport-Shostake –pease algo(oral message) OM(m).
4.Phase king Algorithm.(polynomial time message exachange)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 2
content
6. Agreement solution in case of Asynchronous system
1. FLP impossibility of consensus in asynchronous system(1985)
2. Conversion of consensus into weaker version problem.
3. Terminating Reliable Broadcast
4.k-set Consensus
5. Approximate Agreement
7.Application of Agreement in Real life.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 3
What is Agreement in DC(Basic Intro)
• A kind of co–operation or unity or accordance among processes.
• As we know that all the nodes in a distributed system are working
together in a cooperation to achieve a commom goals. Hence co-
operation among the process is very necessary .
• There are some standard agreement problem in DC. We will see each
problem and try to find find some protocol or algorithm to solve the
agreement problem.
• Agreement protocol is used to ensure that DS is able to achieve the
common goal even after occurance of various failures in Distributed
system.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 4
Why agreement protocol in DC
• To achieve some common goal in Distributed system
• To deal with Various faulty processess which might produce wrong
results and send wrong information to other processes
• To achieve reliability of Distributed system
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 5
Problem which require Agreement
• Leader Election
• Distributed Transaction
• Mutual exclusion
• Any many more ….
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 6
When agreement is required?
• Agreement is always requird to achieve a common goal in distributed
system.
• When there are some types of faulty processes present in the
distributed system at that time we need to make sure that
performance of distributed system should not be affected at that time
we implement some agreement protocol (algo) ,so that output of
distributed should not be incorrect.or should not be affected
• Thres are some standard agreement problem we have, our job is to
study various agreement solution proposed by researchers to deal
with these agreement problem.
• Let’s Discuss some Assumptions used in Consensu Algorithm
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 7
Assumption Used in Areement protocol
• Failure models
• Synchronous/ Asynchronous communication
• Network connectivity
• Sender identication
• Channel reliability
• Authenticated vs. non-authenticatedmessages
• Agreement variable
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 8
Various Failures in Distributed System
A processor can fail in three modes:
• Crash fault : a processor stops functioning and never resumes
operation .
• Omission fault : a processor "omits" to send messages to some
processors.
• Malicious fault (Byzantine faults): most dangerous one
a processor behaves randomly and arbitarly. That means it does not
send correct information. It can be disloyal at any time we don’t know.
We cant trust on this .
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 9
We will find agreement solution in two mode
of communication under various failure
• Synchronous mode: Finite message delay(lockup step manner)
A process receives messages (1 round), performs a computation
(2 round), and send messages to other processes (3 round).
Message has not been sent can be recognized by intended recipient.
• Asynchronous mode: infinite message delay(non lockup step
manner)
The computation at processes does not proceed in lock steps. A
process can send and receive messages and perform computation at
any time.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 10
Cont’d
Network Connectivity: The system is fully connected .Any process can
send message to any other processs.
Sender indetification:- That means a receiver is always aware about
idetitiy of sender.
Channel reliability: Channel is reliable. Only process can fail.
Aunthenticated vs Non Autheticated message:-
We will assume that message used in agreement protocol is
Unauthenticated message.
1)It can forge the message and claim that it has come from another
process.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 11
Cont’d
• Agreement varibles:-
Varibales used in agreement can be Boolean or multivalued and need
not be an integer
But we generally used Boolean varibales….
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 12
Agreement protocol Inspiration .
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 13
Byzatine General problem(inspired from
byzantine empire)
There was byzantine empire in middle ages ….there were some army
generals who were protecting the city. Now all general have to make an
agreement or some negotiation to invade the city . If any general is
found to be traitors they will not be able to protect the city .hence they
have to agree on some common terms and then only they can protect
the byzantine empire
Present part of byzantine empire is knowns Turkey (Istanbul)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 14
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 15
1.Crash Free
2.Crash Failure
3.Byzatine failure
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 16
(Imp)Agreement problem=Byzantine problem+(Consensus
problem+ Interactive consistency )
Synchronous System Asynchronous System
Agreement problem(Byzantine problem)
Byzantine problem:
An arbitrarily chosen processor, called the source processor, broadcasts
its initial value to all other processors.
Agreement :All nonfaulty processors agree on the same value.
Validity:If the source processor is nonfaulty, then the common agreed
upon value by all nonfaulty processors must be same as the initial value
of the source.
Termination: Each non-faulty processor must eventually decide on a
value.
cont--NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 17
Agreement problem Types
• Byzantine agreement problem
• There are two flavoure of byzantine agrrement problem.
1.The consensus problem.
2.The interactive Consistency Problem.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 18
Cont’d
If source is faulty then all non- faulty processes can agree on any
common value”.
“Value agreed upon by faulty processors is irrelevant
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 19
Threre are two variants of Byzantine problem
1. The consensus problem
2. The Interactive Consistency problem
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 20
The consensus problem
Here all process have some initial value they broadcast their initial
values to all others process and satisy the following condition:
Agreement:All non-faulty processes must agree on same single values
Validity: if all non faulty processes have the same initial value , then
the agreed value by all the non-faulty processes must be that same
value.
Termination: Each non-faulty process must eventually decide on a
value.
cont--
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 21
Cont’d
“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”
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 22
The Interactive consistency problem
Every processor broadcasts its initial value to all other processors. The
initial values of the processors may be different .
A protocol for the interactive consistency problem should meet the
following conditions:
Agreement: All non-faulty processes must agree on the same array of
values A[v1 : : : vn].
Validity: If process i is non-faulty and its initial value is vi , then all non-
faulty processes agree on vi as the ith element of the array A. If process
j is faulty, then the non-faulty processes can agree on any value for A[j].
Termination: Each non-faulty process must eventually decide on the
array A.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 23
This was all about agreement problem in
Distributed System
• Now we will discuss its solution in various failure model in
synchrounous mode and asynchronous mode.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 24
Now lets Discuss the solution of agreement
problem in various failure model in synchronous
1.No failure
2. Crash failure
3.Byzantine failure
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 25
Agreement algorithm for No-failure
Agreement can easily achieved in constant no of message exchange
Both synchronous and asynchrounus mode will always achieve
agreement .Because when all process are working fine then they are
eventually satisfying the property of Distrubed system and with
constant no of message exchange we can achieve i.e all nodes in a
distributed system are working in a cooperation to achieve some
commone goal.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 26
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 27
Agreement Protocol
Synchronous System Asynchronous System
Important notes: Please write everyone in
your notebook
• There are some solution that solve agreement problems by satisfying all
condition of agreement problem in case of synchronous system.
• But in case of asynchronous models , agrerment problem are not solvable.
However we can solve agreement problem in asynchronous System after
converting agreement problem in its weaker version. That means
agreement problem are reduce to some weaker verison .
Weaker version of agreement problem are:
1.k-set consensus
2.Approximate consensus
3.Renaming problem
4.Terminating reliable broadcast ( it is a kind of problem which require
consensus.)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 28
*Agreement protocal in crash failure process
• This is the first algo given by Lamport to solve agreement problem.
• Source Broadcasts its initial value to all other processors.
• Processors send their values to other processors and also relay
received values to others.
• During Execution faulty processors may confuse by sending conflicting
values.
• However if faulty processors dominate in number, they can prevent
non-faulty processors from reaching an agreement.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 29
Algorithm
• (global constants)
• integer: f ; // maximum number of crash failures tolerated
• (local variables)
• integer: x - local value;
• Process Pi (1 < i< n) executes the Consensus algorithm for up to f crash failures:
• for round from 1 to f + 1 do
• if the current value of x has not been broadcast then
• broadcast(x);
• yj  value (if any) received from process j in this round;
• x  min(x; yj );
• output x as the consensus value.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 30
Agreement algorithm for crash failure process
• f=no of crash failure process out total ‘n’ process
• Up to f (< n) crash failures possible.
• In f + 1 rounds, at least one round has no failures.
• Now justify: agreement, validity, termination conditions are satised.
• Complexity: O(f + 1)n2 messages
• f + 1 is lower bound on number of rounds
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 31
Pease Algorithm for upper bound on faulty
processor .
• Pease basically discuss that there is limit on the no of faulty processor
That means if f= no of faulty processor out of ‘n’ process
Then
f less than or equal to ( n - 1) / 3
That means pease want to say that for f=1 and n=3 we can’t achieve
agreement in
This is very very important for exam point of view.
Let’s see prove on the next page
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 32
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 33
(Imp) Let us study two majority Based algorithm
to solve Consensus Problem
1. Lamport -Shostake -Pease (in the textebook it is mentioned as
Byzantine agreement tree algorithm : exponential Synschronous
algorithm )
2.Phase King Algorithm: polynomial (synchronous system)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 34
Lamport-Shostak-Pease Algorithm (Majority)
• The Oral Message (OM(m)) algorithm with m > 0 (some faulty
processor(s)) solves the Byzantine agreement problem for 3m + 1
processors with at most m faulty processors
• The initiator sends n - 1 messages to everyone else to start the
algorithm
• Everyone else begins OM( m - 1) activity, sending messages to n - 2
processors
• Each of these messages causes OM (m - 2) activity, etc., until
OM(0) is reached when the algorithm stops
• When the algorithm stops each processor has input from all others
and chooses the majority value as its value
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 35
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 36
B
Coor
dina
tor
A
Cont’d
At the end we have to take majority.
Fox example if process p have (1,0,0,0,0) as you can see that zero is in
the majority. Hence when algorithm terminates each process and they
will eventually agreed on majority values.
Ex (1,1,1,1,1,0,0,0)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 37
Cont’d
Round Aim to tolerate failure Each message get sent to total message excahneg
1 f n-1 n-1
2 f-1 n-1 (n-1)(n-2)
F+1 0 n-f-1 (n-1)(n-2)(n-f-1)
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 38
Complexity analysis
• Total message exachange n+ (n-1)(n-2)+ (n-1)(n-2)……………..+(n-1)(n-
2)…….(n-f-1).
• O(n^f). This is exponential time. Hence this is not very feasible.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 39
In the red book
• In the red book, this algorithm has implemented in two ways
1. Iterative
2. Recursion
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 40
Cont’d
• The algorithm has O(nm) message complexity, with m + 1 rounds of
message exchange, where n  (3m + 1)
• Recursion unfolding:- process acts as a source and sends its values to
each other process.
• Recursion folding:-Each process uses the values it receives from the
other sources ,and uses that values as the agreement value. If no
values is received , a default values is Assumed.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 41
Phase King Algorithm for Agreement protocol
• Algorithm was by proposed by berman and garay
• Problem of previous algo is that it required exponential number of
message exchange with (f+1) round of message exchange.
• But in case of phase king algo, it required (f+1) phase with
polynomial number of message exchange that is the main advantage
of using phase king algo.
• It can tolerate only f< ceal of (n4), where n it total no of nodes
and f is no of faulty node.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 42
Cont’d
• Each phase has 2 rounds
– Round 1:
• Each process broadcasts its estimate of the consensus to all others
and awaits the values broadcast by others
• Counts the number of 1 votes and 0 votes
• If either number > n/2, then it sets majority to that value and sets
mult to the number of votes received for the majority value
• If neither number of votes is greater than n/2, a default value is used
for majority value. It will occur in case of malicious process.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 43
Round 2:
• The phase king for phase k is Pk
• Pk broadcasts its majority value which serves as a tiebreaker for
those which have a mult value less than n/2+ f
• When a process receives the tie‐breaker from the king,
– If mult > n/2 + f then it updates its estimate of the decision variable v
to its majority value
– Otherwise it updates its estimate of the decision variable v to the
tie‐breaker value
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 44
Complexity
• This algo take two round for every phase and total no of message
exchange is (f+1)[(n-1)(n+1)] message.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 45
A comparision b/w LSP and King Algorithm
LSP Algorithm Phase King Algorithm
1. Exponetial message complexity 1.Polynomial Message complexity
O(n^f)
(f+1)(n-1)(n+1)
2.F<= floor of (n-1)3 2. F < Ceal of (n4)
1. Take f+1 phase total 3.it takes f+1 phases with each
take takes two 2 round.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 46
Now lets Disscus agreement solution in case of
Asynchrounous models
• IN 1985 ,THREE Scientist FLP(fisher ,lynch and patterrson exaplained
in their research paper that impossibility of Agreement in
asynchronous system)
• That’s it is also called FLP impossibility.
• Fisher has explained that there is impossibility of reaching agreement
In an asynchrounous (message passing system). Even if a single process
Is allowed to have a crash failure.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 47
Cont’d
• Because of time constrain I am not explaining proof of FLP impossblity
Plesase refer to research paper of FLP impossibility published in 1985,I
am leaving for you as an exercise.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 48
Theses are the problem requires Agreement
protocol but are not solvable in asyn
• The leader Election Problem
• Terminating Reliable Broadcost
• Atomic Broadcost.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 49
Terminating Reliable Broadcast problem
This is problem wich state that a correct process always gets a
messages even if the sender process get crashes while sending the
message.
Formal description
Validity: If the sender of a broadcast message m is non-faulty, then all
correct processes eventually deliver m.
Agreement: If a correct process delivers a message m, then all correct
processes deliver m.
Integrity: Each correct process delivers at most one message. Further, if
it delivers a message dierent from the null message, then the sender
must have broadcast m.
Termination: Every correct process eventually delivers some message.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 50
Not Solvable
• There exists no algorithm that can solve TRB
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 51
Reduction from Agreement to TRB
• Commander sends its value using TRB.
• Receiver decides on 0 or 1 based on value it receives. If it receives a
"null"
• message, it decides on default value.
• But, as consensus is not solvable, hence there exist no algorithm to
implement TRB.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 52
Weaker version of RTB
• Reliable Broadcast is RTB without terminating condition.
• RTB requires eventual delivery of messages, even if sender fails
before sending. In this case, a null message needs to get sent.
• In RB, this condition is not there.
• RTB requires recognition of a failure, even if no msg is sent
• Crux: RTB is required to distinguish between a failed process and a
slow process.
• RB is solvable under crashfailures; O(n2) messages
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 53
solution
• Process P0 initiates Reliable Broadcast:
• (1a) broadcast message M to all processes.
• (2) A process Pi ,1 <=i <=n, receives message M:
• (2a) if M was not received earlier then
• (2b) broadcast M to all processes;
• (2c) deliver M to the application.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 54
K-Set consensus( A weaker version of Agrrement
• AS we have already explained that agreement (consensus) is not
solvable in asynchronous system ,However we will solve a weaker
version of Agreement problem called K- set consensus will be solvable
provided that no of crash falure ‘f’is less than parameter k .
• K- parameter:-it indicate that the non-faulty agree on the different
values ,as long as size of the the set of the values agreed upon is
bounded by k.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 55
cont’d
k-Agreement: All non-faulty processes must make a decision, and the
set of values that the processes decide on can contain up to k (> f )
values.
Validity: If a non-faulty process decides on some value, then that value
must have been proposed by some process.
Termination: Each non-faulty process must eventually decide on a
value.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 56
Example from Red Book
Let n=10,f=2,k=3 then 3-set is (8,9,10).
Algo.(Solution)
• (variables)
• integer: v  initial value;
• A process Pi , 1 <= i<= n, initiates k-set consensus:
• broadcast v to all processes.
• await values from |N| -f processes and add them to set V;
• ( decide on max(V).
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 57
Asynchronous Renaming
• The renaming problem assigns to each process Pi , a name mi from a
domain M, and is formally specied as follows.
Agreement: For non-faulty processes Pi and Pj , mi not equal mj .
Termination: Each non-faulty process is eventually assigned a name mi
Validity: The name mi belongs to M.
Anonymity: The code executed by any process must not depend on its
initial identifier.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 58
Approximate agreement(epsilon consensus)
Another weaker version to solve consensus problem in async system
under crash failure is approximate algo.
epsilon-Agreement: All non-faulty processes must make a decision and
the values decided upon by any two non-faulty processes must be
within range of each other.
Validity: If a non-faulty process Pi decides on some value vi , then that
value must be within the range of values initially proposed by the
processes.
Termination: Each non-faulty process must eventually decide on a
value.
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 59
Application of Agreement protocol
• It is used in fault tolerance clock synchronization which you will study
in chapter 15 of Red Book.
• It is also very frequently used in Atomic distributed database commit.
• Control of UAV(drone)
• Smart power grid
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 60
References
• “Distribute Computing” Ajay D.Kshemkalyani And Mukesh Singhal.
• Slides of Prof. Mayank Jain
NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 61

More Related Content

PPT
Distributed Transaction
PPT
Chapter 4 a interprocess communication
PPTX
Parallel computing and its applications
PPT
Aggrement protocols
PPTX
Logics for non monotonic reasoning-ai
PPTX
Artificial Intelligence Notes Unit 4
PPTX
Fault tolerance in distributed systems
PPT
Chapter 12 transactions and concurrency control
Distributed Transaction
Chapter 4 a interprocess communication
Parallel computing and its applications
Aggrement protocols
Logics for non monotonic reasoning-ai
Artificial Intelligence Notes Unit 4
Fault tolerance in distributed systems
Chapter 12 transactions and concurrency control

What's hot (20)

PPTX
Distributed design alternatives
PPTX
Transactions and Concurrency Control
PPTX
Distributed Shared Memory
PPTX
Distributed Mutual Exclusion and Distributed Deadlock Detection
PPT
message passing
PPTX
Advanced topics in artificial neural networks
PDF
Deadlock in Distributed Systems
PPTX
Fragmentation and types of fragmentation in Distributed Database
PDF
Agreement Protocols, distributed File Systems, Distributed Shared Memory
PPT
fault-tolerance-slide.ppt
DOC
Distributed Mutual exclusion algorithms
PPTX
Solutions to byzantine agreement problem
PPT
Clock synchronization in distributed system
PDF
Distributed Operating System_1
PPT
protocol architecture
PPTX
Query processing in Distributed Database System
PPTX
Distributed Transactions(flat and nested) and Atomic Commit Protocols
PDF
T9. Trust and reputation in multi-agent systems
PPTX
Multicast routing protocols in adhoc networks
PPTX
Distributed system architecture
Distributed design alternatives
Transactions and Concurrency Control
Distributed Shared Memory
Distributed Mutual Exclusion and Distributed Deadlock Detection
message passing
Advanced topics in artificial neural networks
Deadlock in Distributed Systems
Fragmentation and types of fragmentation in Distributed Database
Agreement Protocols, distributed File Systems, Distributed Shared Memory
fault-tolerance-slide.ppt
Distributed Mutual exclusion algorithms
Solutions to byzantine agreement problem
Clock synchronization in distributed system
Distributed Operating System_1
protocol architecture
Query processing in Distributed Database System
Distributed Transactions(flat and nested) and Atomic Commit Protocols
T9. Trust and reputation in multi-agent systems
Multicast routing protocols in adhoc networks
Distributed system architecture
Ad

Similar to Agreement protocol (20)

PDF
Distributed Computing On Topics of: Leader election + Byzantine algorithms)
PDF
1. Consensus and agreement algorithms - Introduction.pdf
PPT
Fault tolerance-omer-rana
PPT
Coordination and Agreement .ppt
PPTX
Unit_4_Fault_Tolerance.pptx
PDF
Fault tolerance review by tsegabrehan zerihun
PPT
Chapter 7-Fault Tolerance.ppt
PDF
Impossibility
PDF
From Mainframe to Microservice: An Introduction to Distributed Systems
PPTX
fault tolerance1.pptx
PPT
운영체제론 Ch16
PDF
PPT
L14.C3.FA18.ppt
PPTX
L16.A.FA1ggggggggggggggggggggggggg6.pptx
PPTX
PDF
Mutual exclusion
PPT
Chapter 18 - Distributed Coordination
PDF
Chapter 11d coordination agreement
PPTX
Randomized Byzantine Problem by Rabin
PPT
Introduction to Distributed Systems
Distributed Computing On Topics of: Leader election + Byzantine algorithms)
1. Consensus and agreement algorithms - Introduction.pdf
Fault tolerance-omer-rana
Coordination and Agreement .ppt
Unit_4_Fault_Tolerance.pptx
Fault tolerance review by tsegabrehan zerihun
Chapter 7-Fault Tolerance.ppt
Impossibility
From Mainframe to Microservice: An Introduction to Distributed Systems
fault tolerance1.pptx
운영체제론 Ch16
L14.C3.FA18.ppt
L16.A.FA1ggggggggggggggggggggggggg6.pptx
Mutual exclusion
Chapter 18 - Distributed Coordination
Chapter 11d coordination agreement
Randomized Byzantine Problem by Rabin
Introduction to Distributed Systems
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Modernizing your data center with Dell and AMD
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
A Presentation on Artificial Intelligence
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Modernizing your data center with Dell and AMD
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Machine learning based COVID-19 study performance prediction
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Agreement protocol

  • 1. Agreement Protocol Saif Ali Khan 31703213 Computer Engineering(Cyber Security) Guided By: Prof. A.K. Singh Deptt of Computer Engineering NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 1
  • 2. Contents 1. What is agreement in distributed system and why agreement? 2. Synchronous and Asynchronous communication 3. Assumptions. 4. What is Agreement Problem(consensus problem) in Distributed System? 5. Solutions to agreement problems in case of Synchronous system. 1.Lamport algo for crash failure 2.pease upper bound on faluty processes ‘f’ 3. Lamport-Shostake –pease algo(oral message) OM(m). 4.Phase king Algorithm.(polynomial time message exachange) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 2
  • 3. content 6. Agreement solution in case of Asynchronous system 1. FLP impossibility of consensus in asynchronous system(1985) 2. Conversion of consensus into weaker version problem. 3. Terminating Reliable Broadcast 4.k-set Consensus 5. Approximate Agreement 7.Application of Agreement in Real life. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 3
  • 4. What is Agreement in DC(Basic Intro) • A kind of co–operation or unity or accordance among processes. • As we know that all the nodes in a distributed system are working together in a cooperation to achieve a commom goals. Hence co- operation among the process is very necessary . • There are some standard agreement problem in DC. We will see each problem and try to find find some protocol or algorithm to solve the agreement problem. • Agreement protocol is used to ensure that DS is able to achieve the common goal even after occurance of various failures in Distributed system. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 4
  • 5. Why agreement protocol in DC • To achieve some common goal in Distributed system • To deal with Various faulty processess which might produce wrong results and send wrong information to other processes • To achieve reliability of Distributed system NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 5
  • 6. Problem which require Agreement • Leader Election • Distributed Transaction • Mutual exclusion • Any many more …. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 6
  • 7. When agreement is required? • Agreement is always requird to achieve a common goal in distributed system. • When there are some types of faulty processes present in the distributed system at that time we need to make sure that performance of distributed system should not be affected at that time we implement some agreement protocol (algo) ,so that output of distributed should not be incorrect.or should not be affected • Thres are some standard agreement problem we have, our job is to study various agreement solution proposed by researchers to deal with these agreement problem. • Let’s Discuss some Assumptions used in Consensu Algorithm NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 7
  • 8. Assumption Used in Areement protocol • Failure models • Synchronous/ Asynchronous communication • Network connectivity • Sender identication • Channel reliability • Authenticated vs. non-authenticatedmessages • Agreement variable NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 8
  • 9. Various Failures in Distributed System A processor can fail in three modes: • Crash fault : a processor stops functioning and never resumes operation . • Omission fault : a processor "omits" to send messages to some processors. • Malicious fault (Byzantine faults): most dangerous one a processor behaves randomly and arbitarly. That means it does not send correct information. It can be disloyal at any time we don’t know. We cant trust on this . NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 9
  • 10. We will find agreement solution in two mode of communication under various failure • Synchronous mode: Finite message delay(lockup step manner) A process receives messages (1 round), performs a computation (2 round), and send messages to other processes (3 round). Message has not been sent can be recognized by intended recipient. • Asynchronous mode: infinite message delay(non lockup step manner) The computation at processes does not proceed in lock steps. A process can send and receive messages and perform computation at any time. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 10
  • 11. Cont’d Network Connectivity: The system is fully connected .Any process can send message to any other processs. Sender indetification:- That means a receiver is always aware about idetitiy of sender. Channel reliability: Channel is reliable. Only process can fail. Aunthenticated vs Non Autheticated message:- We will assume that message used in agreement protocol is Unauthenticated message. 1)It can forge the message and claim that it has come from another process. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 11
  • 12. Cont’d • Agreement varibles:- Varibales used in agreement can be Boolean or multivalued and need not be an integer But we generally used Boolean varibales…. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 12
  • 13. Agreement protocol Inspiration . NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 13
  • 14. Byzatine General problem(inspired from byzantine empire) There was byzantine empire in middle ages ….there were some army generals who were protecting the city. Now all general have to make an agreement or some negotiation to invade the city . If any general is found to be traitors they will not be able to protect the city .hence they have to agree on some common terms and then only they can protect the byzantine empire Present part of byzantine empire is knowns Turkey (Istanbul) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 14
  • 15. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 15
  • 16. 1.Crash Free 2.Crash Failure 3.Byzatine failure NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 16 (Imp)Agreement problem=Byzantine problem+(Consensus problem+ Interactive consistency ) Synchronous System Asynchronous System
  • 17. Agreement problem(Byzantine problem) Byzantine problem: An arbitrarily chosen processor, called the source processor, broadcasts its initial value to all other processors. Agreement :All nonfaulty processors agree on the same value. Validity:If the source processor is nonfaulty, then the common agreed upon value by all nonfaulty processors must be same as the initial value of the source. Termination: Each non-faulty processor must eventually decide on a value. cont--NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 17
  • 18. Agreement problem Types • Byzantine agreement problem • There are two flavoure of byzantine agrrement problem. 1.The consensus problem. 2.The interactive Consistency Problem. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 18
  • 19. Cont’d If source is faulty then all non- faulty processes can agree on any common value”. “Value agreed upon by faulty processors is irrelevant NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 19
  • 20. Threre are two variants of Byzantine problem 1. The consensus problem 2. The Interactive Consistency problem NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 20
  • 21. The consensus problem Here all process have some initial value they broadcast their initial values to all others process and satisy the following condition: Agreement:All non-faulty processes must agree on same single values Validity: if all non faulty processes have the same initial value , then the agreed value by all the non-faulty processes must be that same value. Termination: Each non-faulty process must eventually decide on a value. cont-- NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 21
  • 22. Cont’d “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” NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 22
  • 23. The Interactive consistency problem Every processor broadcasts its initial value to all other processors. The initial values of the processors may be different . A protocol for the interactive consistency problem should meet the following conditions: Agreement: All non-faulty processes must agree on the same array of values A[v1 : : : vn]. Validity: If process i is non-faulty and its initial value is vi , then all non- faulty processes agree on vi as the ith element of the array A. If process j is faulty, then the non-faulty processes can agree on any value for A[j]. Termination: Each non-faulty process must eventually decide on the array A. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 23
  • 24. This was all about agreement problem in Distributed System • Now we will discuss its solution in various failure model in synchrounous mode and asynchronous mode. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 24
  • 25. Now lets Discuss the solution of agreement problem in various failure model in synchronous 1.No failure 2. Crash failure 3.Byzantine failure NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 25
  • 26. Agreement algorithm for No-failure Agreement can easily achieved in constant no of message exchange Both synchronous and asynchrounus mode will always achieve agreement .Because when all process are working fine then they are eventually satisfying the property of Distrubed system and with constant no of message exchange we can achieve i.e all nodes in a distributed system are working in a cooperation to achieve some commone goal. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 26
  • 27. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 27 Agreement Protocol Synchronous System Asynchronous System
  • 28. Important notes: Please write everyone in your notebook • There are some solution that solve agreement problems by satisfying all condition of agreement problem in case of synchronous system. • But in case of asynchronous models , agrerment problem are not solvable. However we can solve agreement problem in asynchronous System after converting agreement problem in its weaker version. That means agreement problem are reduce to some weaker verison . Weaker version of agreement problem are: 1.k-set consensus 2.Approximate consensus 3.Renaming problem 4.Terminating reliable broadcast ( it is a kind of problem which require consensus.) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 28
  • 29. *Agreement protocal in crash failure process • This is the first algo given by Lamport to solve agreement problem. • Source Broadcasts its initial value to all other processors. • Processors send their values to other processors and also relay received values to others. • During Execution faulty processors may confuse by sending conflicting values. • However if faulty processors dominate in number, they can prevent non-faulty processors from reaching an agreement. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 29
  • 30. Algorithm • (global constants) • integer: f ; // maximum number of crash failures tolerated • (local variables) • integer: x - local value; • Process Pi (1 < i< n) executes the Consensus algorithm for up to f crash failures: • for round from 1 to f + 1 do • if the current value of x has not been broadcast then • broadcast(x); • yj  value (if any) received from process j in this round; • x  min(x; yj ); • output x as the consensus value. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 30
  • 31. Agreement algorithm for crash failure process • f=no of crash failure process out total ‘n’ process • Up to f (< n) crash failures possible. • In f + 1 rounds, at least one round has no failures. • Now justify: agreement, validity, termination conditions are satised. • Complexity: O(f + 1)n2 messages • f + 1 is lower bound on number of rounds NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 31
  • 32. Pease Algorithm for upper bound on faulty processor . • Pease basically discuss that there is limit on the no of faulty processor That means if f= no of faulty processor out of ‘n’ process Then f less than or equal to ( n - 1) / 3 That means pease want to say that for f=1 and n=3 we can’t achieve agreement in This is very very important for exam point of view. Let’s see prove on the next page NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 32
  • 33. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 33
  • 34. (Imp) Let us study two majority Based algorithm to solve Consensus Problem 1. Lamport -Shostake -Pease (in the textebook it is mentioned as Byzantine agreement tree algorithm : exponential Synschronous algorithm ) 2.Phase King Algorithm: polynomial (synchronous system) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 34
  • 35. Lamport-Shostak-Pease Algorithm (Majority) • The Oral Message (OM(m)) algorithm with m > 0 (some faulty processor(s)) solves the Byzantine agreement problem for 3m + 1 processors with at most m faulty processors • The initiator sends n - 1 messages to everyone else to start the algorithm • Everyone else begins OM( m - 1) activity, sending messages to n - 2 processors • Each of these messages causes OM (m - 2) activity, etc., until OM(0) is reached when the algorithm stops • When the algorithm stops each processor has input from all others and chooses the majority value as its value NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 35
  • 36. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 36 B Coor dina tor A
  • 37. Cont’d At the end we have to take majority. Fox example if process p have (1,0,0,0,0) as you can see that zero is in the majority. Hence when algorithm terminates each process and they will eventually agreed on majority values. Ex (1,1,1,1,1,0,0,0) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 37
  • 38. Cont’d Round Aim to tolerate failure Each message get sent to total message excahneg 1 f n-1 n-1 2 f-1 n-1 (n-1)(n-2) F+1 0 n-f-1 (n-1)(n-2)(n-f-1) NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 38
  • 39. Complexity analysis • Total message exachange n+ (n-1)(n-2)+ (n-1)(n-2)……………..+(n-1)(n- 2)…….(n-f-1). • O(n^f). This is exponential time. Hence this is not very feasible. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 39
  • 40. In the red book • In the red book, this algorithm has implemented in two ways 1. Iterative 2. Recursion NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 40
  • 41. Cont’d • The algorithm has O(nm) message complexity, with m + 1 rounds of message exchange, where n  (3m + 1) • Recursion unfolding:- process acts as a source and sends its values to each other process. • Recursion folding:-Each process uses the values it receives from the other sources ,and uses that values as the agreement value. If no values is received , a default values is Assumed. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 41
  • 42. Phase King Algorithm for Agreement protocol • Algorithm was by proposed by berman and garay • Problem of previous algo is that it required exponential number of message exchange with (f+1) round of message exchange. • But in case of phase king algo, it required (f+1) phase with polynomial number of message exchange that is the main advantage of using phase king algo. • It can tolerate only f< ceal of (n4), where n it total no of nodes and f is no of faulty node. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 42
  • 43. Cont’d • Each phase has 2 rounds – Round 1: • Each process broadcasts its estimate of the consensus to all others and awaits the values broadcast by others • Counts the number of 1 votes and 0 votes • If either number > n/2, then it sets majority to that value and sets mult to the number of votes received for the majority value • If neither number of votes is greater than n/2, a default value is used for majority value. It will occur in case of malicious process. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 43
  • 44. Round 2: • The phase king for phase k is Pk • Pk broadcasts its majority value which serves as a tiebreaker for those which have a mult value less than n/2+ f • When a process receives the tie‐breaker from the king, – If mult > n/2 + f then it updates its estimate of the decision variable v to its majority value – Otherwise it updates its estimate of the decision variable v to the tie‐breaker value NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 44
  • 45. Complexity • This algo take two round for every phase and total no of message exchange is (f+1)[(n-1)(n+1)] message. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 45
  • 46. A comparision b/w LSP and King Algorithm LSP Algorithm Phase King Algorithm 1. Exponetial message complexity 1.Polynomial Message complexity O(n^f) (f+1)(n-1)(n+1) 2.F<= floor of (n-1)3 2. F < Ceal of (n4) 1. Take f+1 phase total 3.it takes f+1 phases with each take takes two 2 round. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 46
  • 47. Now lets Disscus agreement solution in case of Asynchrounous models • IN 1985 ,THREE Scientist FLP(fisher ,lynch and patterrson exaplained in their research paper that impossibility of Agreement in asynchronous system) • That’s it is also called FLP impossibility. • Fisher has explained that there is impossibility of reaching agreement In an asynchrounous (message passing system). Even if a single process Is allowed to have a crash failure. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 47
  • 48. Cont’d • Because of time constrain I am not explaining proof of FLP impossblity Plesase refer to research paper of FLP impossibility published in 1985,I am leaving for you as an exercise. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 48
  • 49. Theses are the problem requires Agreement protocol but are not solvable in asyn • The leader Election Problem • Terminating Reliable Broadcost • Atomic Broadcost. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 49
  • 50. Terminating Reliable Broadcast problem This is problem wich state that a correct process always gets a messages even if the sender process get crashes while sending the message. Formal description Validity: If the sender of a broadcast message m is non-faulty, then all correct processes eventually deliver m. Agreement: If a correct process delivers a message m, then all correct processes deliver m. Integrity: Each correct process delivers at most one message. Further, if it delivers a message dierent from the null message, then the sender must have broadcast m. Termination: Every correct process eventually delivers some message. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 50
  • 51. Not Solvable • There exists no algorithm that can solve TRB NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 51
  • 52. Reduction from Agreement to TRB • Commander sends its value using TRB. • Receiver decides on 0 or 1 based on value it receives. If it receives a "null" • message, it decides on default value. • But, as consensus is not solvable, hence there exist no algorithm to implement TRB. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 52
  • 53. Weaker version of RTB • Reliable Broadcast is RTB without terminating condition. • RTB requires eventual delivery of messages, even if sender fails before sending. In this case, a null message needs to get sent. • In RB, this condition is not there. • RTB requires recognition of a failure, even if no msg is sent • Crux: RTB is required to distinguish between a failed process and a slow process. • RB is solvable under crashfailures; O(n2) messages NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 53
  • 54. solution • Process P0 initiates Reliable Broadcast: • (1a) broadcast message M to all processes. • (2) A process Pi ,1 <=i <=n, receives message M: • (2a) if M was not received earlier then • (2b) broadcast M to all processes; • (2c) deliver M to the application. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 54
  • 55. K-Set consensus( A weaker version of Agrrement • AS we have already explained that agreement (consensus) is not solvable in asynchronous system ,However we will solve a weaker version of Agreement problem called K- set consensus will be solvable provided that no of crash falure ‘f’is less than parameter k . • K- parameter:-it indicate that the non-faulty agree on the different values ,as long as size of the the set of the values agreed upon is bounded by k. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 55
  • 56. cont’d k-Agreement: All non-faulty processes must make a decision, and the set of values that the processes decide on can contain up to k (> f ) values. Validity: If a non-faulty process decides on some value, then that value must have been proposed by some process. Termination: Each non-faulty process must eventually decide on a value. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 56
  • 57. Example from Red Book Let n=10,f=2,k=3 then 3-set is (8,9,10). Algo.(Solution) • (variables) • integer: v  initial value; • A process Pi , 1 <= i<= n, initiates k-set consensus: • broadcast v to all processes. • await values from |N| -f processes and add them to set V; • ( decide on max(V). NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 57
  • 58. Asynchronous Renaming • The renaming problem assigns to each process Pi , a name mi from a domain M, and is formally specied as follows. Agreement: For non-faulty processes Pi and Pj , mi not equal mj . Termination: Each non-faulty process is eventually assigned a name mi Validity: The name mi belongs to M. Anonymity: The code executed by any process must not depend on its initial identifier. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 58
  • 59. Approximate agreement(epsilon consensus) Another weaker version to solve consensus problem in async system under crash failure is approximate algo. epsilon-Agreement: All non-faulty processes must make a decision and the values decided upon by any two non-faulty processes must be within range of each other. Validity: If a non-faulty process Pi decides on some value vi , then that value must be within the range of values initially proposed by the processes. Termination: Each non-faulty process must eventually decide on a value. NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 59
  • 60. Application of Agreement protocol • It is used in fault tolerance clock synchronization which you will study in chapter 15 of Red Book. • It is also very frequently used in Atomic distributed database commit. • Control of UAV(drone) • Smart power grid NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 60
  • 61. References • “Distribute Computing” Ajay D.Kshemkalyani And Mukesh Singhal. • Slides of Prof. Mayank Jain NIT KKR,CYBER SECURITY,1ST YEAR,SAIF ALI KHAN,31703213 61