SlideShare una empresa de Scribd logo
1 de 17
1 
AGREEMENT 
PROTOCOLS 
Part of unit-2 
BY PROF. MAYANK JAIN
2 
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.
3 
System Model 
• Agreement Problems have been studied under 
following System Model: 
1. ‘n’ processors and at most ‘m’ of the processors 
can be faulty 
2. Processors can directly communicate with other 
processors by message passing. 
3. Receiver knows the identity of the sender 
4. Communication medium is reliabble. 
5. Only Processors are prone to failures
4 
Synchronous VS Asynchronous 
Computation 
• 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. 
Synchronous Models of Computations are Assumed here.
5 
Model of processor Failures 
• Processor Can Fail in three modes: 
1. Crash Fault : 
(i) Processor stops and never resumes operation. 
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
6 
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 
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.
7 
Performance Aspects of 
Agreement Protocols 
• Following Metrics are used : 
1. Time: No of rounds needed to reach an agreement 
2. Message Traffic : Number of messages exchanged 
to reach an agreement. 
3. Storage Overhead : Amount of information that 
needs to stored at processors during execution 
of the protocol.
8 
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..
9 
Classification of Agreement 
Problems cont… 
• In All the previous mentioned problems, all non 
faulty processors must reach an agreement 
• In Byzantine and Consensus problems , 
agreement is on a single value 
• In Interactive Consistency problem , agreement 
is on a set of common values. 
• In Byzantine agreement problem ,only one 
processor initializes the value where as in other 
two cases, every processor has its own initial 
value.
10 
Byzantine Agreement Problem 
• Source Processor [ Any arbitrarily chosen 
processor] broadcasts its values to others. 
• Solution must meet following objectives: 
1. Agreement : All non-faulty processors agree on 
the same value. 
2. Validity : If source is nonfaulty, then the 
common agreed value must be the value supplied 
by the source processor. 
“If source is faulty then all non- faulty processors 
can agree on any common value”. 
“Value agreed upon by faulty processors is 
irrelevant”
11 
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”
Interactive Consistency Problem 
12 
• 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 vector (v1,v2,…vn). 
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”. 
“Value agreed upon by faulty processors is 
irrelevant”
13 
Solution for Byzantine Agreement 
Problem 
• First Defined and solved by lamport. 
• 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. 
• No of faulty processors should not exceed certain limit. 
• Pease showed that in a fully connected network, it is 
impossible to reach an agreement if number faulty 
processors ‘m’ exceeds (n-1)/3. n = number of processors
Lamport-Shostak-Pease Algorithm 
14 
• 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) 
1. Source processor sends its values to every 
processor 
2. Each processor uses the value it receives from 
source. [If no value is received default value 0 
is used] 
• Algorithm OM(m), m>0 
1. The source processor sends its value to every 
processor.
15 
Cont… 
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 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.”
Byzantine Agreement Can not be reached among three 
16 
processors if one processor is faulty 
P0 is NON-Faulty 
P0 
P1 P2 
0 
1 
1 
1 
P0 is Faulty 
P0 
P1 P2 
0 
0 
1 
1 
P0 is source processor
17 
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. 
2. Atomic Commit in DDBS 
• DDBS sites must agree whether to commit or abort 
the transaction 
• Agreement protocols may help to reach a 
consensus.

Más contenido relacionado

La actualidad más candente

Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
Saeed Siddik
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architecture
AbDul ThaYyal
 

La actualidad más candente (20)

CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systems
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
9 fault-tolerance
9 fault-tolerance9 fault-tolerance
9 fault-tolerance
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency Model
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architecture
 
Distributed System - Security
Distributed System - SecurityDistributed System - Security
Distributed System - Security
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Distributed File Systems
Distributed File Systems Distributed File Systems
Distributed File Systems
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
 
Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...
 

Destacado

Distributes objects and Rmi
Distributes objects and RmiDistributes objects and Rmi
Distributes objects and Rmi
Mayank Jain
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
Anuj Modi
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
karan2190
 

Destacado (10)

Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
 
Time Triggered Protocol
Time Triggered ProtocolTime Triggered Protocol
Time Triggered Protocol
 
Scheduling in distributed systems - Andrii Vozniuk
Scheduling in distributed systems - Andrii VozniukScheduling in distributed systems - Andrii Vozniuk
Scheduling in distributed systems - Andrii Vozniuk
 
Distributes objects and Rmi
Distributes objects and RmiDistributes objects and Rmi
Distributes objects and Rmi
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
The byzantine generals problem
The byzantine generals problemThe byzantine generals problem
The byzantine generals problem
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Distributed process and scheduling
Distributed process and scheduling Distributed process and scheduling
Distributed process and scheduling
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
 

Similar a Aggrement protocols

Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdf
Amanuelmergia
 
Process Synchronization -1.ppt
Process Synchronization -1.pptProcess Synchronization -1.ppt
Process Synchronization -1.ppt
jayverma27
 
Osi model
Osi model Osi model
Osi model
maha tce
 
BlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptxBlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptx
RajChauhan226834
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
Nilu Desai
 

Similar a Aggrement protocols (20)

1. Consensus and agreement algorithms - Introduction.pdf
1. Consensus and agreement algorithms - Introduction.pdf1. Consensus and agreement algorithms - Introduction.pdf
1. Consensus and agreement algorithms - Introduction.pdf
 
Randomized Byzantine Problem by Rabin
Randomized Byzantine Problem by RabinRandomized Byzantine Problem by Rabin
Randomized Byzantine Problem by Rabin
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout Whitepaper
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Fault Tolerant and Distributed System
Fault Tolerant and Distributed SystemFault Tolerant and Distributed System
Fault Tolerant and Distributed System
 
Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore Second Mule Meetup on Error Handling in Mule 4
 
Fault tolerance-omer-rana
Fault tolerance-omer-ranaFault tolerance-omer-rana
Fault tolerance-omer-rana
 
Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdf
 
Transaction management transparencies
Transaction management transparenciesTransaction management transparencies
Transaction management transparencies
 
Hyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsHyperledger Consensus Algorithms
Hyperledger Consensus Algorithms
 
Process Synchronization -1.ppt
Process Synchronization -1.pptProcess Synchronization -1.ppt
Process Synchronization -1.ppt
 
Distributed System
Distributed System Distributed System
Distributed System
 
Solutions to byzantine agreement problem
Solutions to byzantine agreement problem Solutions to byzantine agreement problem
Solutions to byzantine agreement problem
 
Osi model
Osi model Osi model
Osi model
 
BlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptxBlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptx
 
Error correction and detection th
Error correction and detection thError correction and detection th
Error correction and detection th
 
Unit_4_Fault_Tolerance.pptx
Unit_4_Fault_Tolerance.pptxUnit_4_Fault_Tolerance.pptx
Unit_4_Fault_Tolerance.pptx
 
Client server model
Client server modelClient server model
Client server model
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 

Más de Mayank Jain (8)

C, C++, Java, Android
C, C++, Java, AndroidC, C++, Java, Android
C, C++, Java, Android
 
C++ functions
C++ functionsC++ functions
C++ functions
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
2 computer network - basic concepts
2   computer network - basic concepts2   computer network - basic concepts
2 computer network - basic concepts
 
1 introduction-to-computer-networking
1 introduction-to-computer-networking1 introduction-to-computer-networking
1 introduction-to-computer-networking
 
Ds ppt imp.
Ds ppt imp.Ds ppt imp.
Ds ppt imp.
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and models
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagram
 

Último

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Último (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 

Aggrement protocols

  • 1. 1 AGREEMENT PROTOCOLS Part of unit-2 BY PROF. MAYANK JAIN
  • 2. 2 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.
  • 3. 3 System Model • Agreement Problems have been studied under following System Model: 1. ‘n’ processors and at most ‘m’ of the processors can be faulty 2. Processors can directly communicate with other processors by message passing. 3. Receiver knows the identity of the sender 4. Communication medium is reliabble. 5. Only Processors are prone to failures
  • 4. 4 Synchronous VS Asynchronous Computation • 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. Synchronous Models of Computations are Assumed here.
  • 5. 5 Model of processor Failures • Processor Can Fail in three modes: 1. Crash Fault : (i) Processor stops and never resumes operation. 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
  • 6. 6 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 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.
  • 7. 7 Performance Aspects of Agreement Protocols • Following Metrics are used : 1. Time: No of rounds needed to reach an agreement 2. Message Traffic : Number of messages exchanged to reach an agreement. 3. Storage Overhead : Amount of information that needs to stored at processors during execution of the protocol.
  • 8. 8 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..
  • 9. 9 Classification of Agreement Problems cont… • In All the previous mentioned problems, all non faulty processors must reach an agreement • In Byzantine and Consensus problems , agreement is on a single value • In Interactive Consistency problem , agreement is on a set of common values. • In Byzantine agreement problem ,only one processor initializes the value where as in other two cases, every processor has its own initial value.
  • 10. 10 Byzantine Agreement Problem • Source Processor [ Any arbitrarily chosen processor] broadcasts its values to others. • Solution must meet following objectives: 1. Agreement : All non-faulty processors agree on the same value. 2. Validity : If source is nonfaulty, then the common agreed value must be the value supplied by the source processor. “If source is faulty then all non- faulty processors can agree on any common value”. “Value agreed upon by faulty processors is irrelevant”
  • 11. 11 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”
  • 12. Interactive Consistency Problem 12 • 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 vector (v1,v2,…vn). 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”. “Value agreed upon by faulty processors is irrelevant”
  • 13. 13 Solution for Byzantine Agreement Problem • First Defined and solved by lamport. • 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. • No of faulty processors should not exceed certain limit. • Pease showed that in a fully connected network, it is impossible to reach an agreement if number faulty processors ‘m’ exceeds (n-1)/3. n = number of processors
  • 14. Lamport-Shostak-Pease Algorithm 14 • 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) 1. Source processor sends its values to every processor 2. Each processor uses the value it receives from source. [If no value is received default value 0 is used] • Algorithm OM(m), m>0 1. The source processor sends its value to every processor.
  • 15. 15 Cont… 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 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.”
  • 16. Byzantine Agreement Can not be reached among three 16 processors if one processor is faulty P0 is NON-Faulty P0 P1 P2 0 1 1 1 P0 is Faulty P0 P1 P2 0 0 1 1 P0 is source processor
  • 17. 17 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. 2. Atomic Commit in DDBS • DDBS sites must agree whether to commit or abort the transaction • Agreement protocols may help to reach a consensus.