Coordination and Agreement

Slides:



Advertisements
Similar presentations
CS542 Topics in Distributed Systems Diganta Goswami.
Advertisements

CMPT 431 Lecture IX: Coordination And Agreement. 2 CMPT 431 © A. Fedorova A Replicated Service client servers network client master slave W W WR R W write.
CS 542: Topics in Distributed Systems Diganta Goswami.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Failure Detection The ping-ack failure detector in a synchronous system satisfies – A: completeness – B: accuracy – C: neither – D: both.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Lab 2 Group Communication Andreas Larsson
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture IX: Coordination And Agreement.
CS 582 / CMPE 481 Distributed Systems
Distributed Systems Fall 2009 Coordination and agreement, Multicast, and Message ordering.
Group Communication Phuong Hoai Ha & Yi Zhang Introduction to Lab. assignments March 24 th, 2004.
1 Principles of Reliable Distributed Systems Lecture 5: Failure Models, Fault-Tolerant Broadcasts and State-Machine Replication Spring 2005 Dr. Idit Keidar.
Synchronization in Distributed Systems. Mutual Exclusion To read or update shared data, a process should enter a critical region to ensure mutual exclusion.
Distributed Algorithms: Agreement Protocols. Problems of Agreement l A set of processes need to agree on a value (decision), after one or more processes.
Consensus and Related Problems Béat Hirsbrunner References G. Coulouris, J. Dollimore and T. Kindberg "Distributed Systems: Concepts and Design", Ed. 4,
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Election Algorithms and Distributed Processing Section 6.5.
1DT066 D ISTRIBUTED I NFORMATION S YSTEM Time, Coordination and Agreement 1.
Coordination and Agreement, Multicast, and Message Ordering.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
Slides for Chapter 8: Coordination and Agreement From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education.
Lab 2 Group Communication Farnaz Moradi Based on slides by Andreas Larsson 2012.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Coordination and Agreement. Topics Distributed Mutual Exclusion Leader Election.
1 Coordination and Agreement. 3 Failure model zAssumptions: Independent processes, reliable channels, no Byzantine errors. zFailure detector: yMay be.
November 2005Distributed systems: distributed algorithms 1 Distributed Systems: Distributed algorithms.
Farnaz Moradi Based on slides by Andreas Larsson 2013.
Synchronization Chapter 5.
Lecture 11-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) September 28, 2010 Lecture 11 Leader Election.
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 9 Consensus I Section Klara Nahrstedt.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion & Leader Election Steve Ko Computer Sciences and Engineering University.
Exercises for Chapter 15: COORDINATION AND AGREEMENT From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Distributed Systems Topic 5: Time, Coordination and Agreement
Lecture 10: Coordination and Agreement (Chap 12) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Election Distributed Systems. Algorithms to Find Global States Why? To check a particular property exist or not in distributed system –(Distributed) garbage.
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
Lecture 12-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) October 4, 2012 Lecture 12 Mutual Exclusion.
Lecture 7- 1 CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 7 Distributed Mutual Exclusion Section 12.2 Klara Nahrstedt.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 15: Coordination.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Systems Lecture 9 Leader election 1. Previous lecture Middleware RPC and RMI – Marshalling 2.
Distributed Systems Lecture 7 Multicast 1. Previous lecture Global states – Cuts – Collecting state – Algorithms 2.
Lecture 11: Coordination and Agreement Central server for mutual exclusion Election – getting a number of processes to agree which is “in charge” CDK4:
Distributed Systems 31. Theoretical Foundations of Distributed Systems - Coordination Simon Razniewski Faculty of Computer Science Free University of Bozen-Bolzano.
Exercises for Chapter 11: COORDINATION AND AGREEMENT
CSE 486/586 Distributed Systems Leader Election
Coordination and Agreement
Distributed Consensus
Active replication for fault tolerance
EEC 688/788 Secure and Dependable Computing
Outline Distributed Mutual Exclusion Introduction Performance measures
CSE 486/586 Distributed Systems Leader Election
Consensus in Synchronous Systems: Byzantine Generals Problem
CSE 486/586 Distributed Systems Mutual Exclusion
EEC 688/788 Secure and Dependable Computing
Lecture 10: Coordination and Agreement
Synchronization (2) – Mutual Exclusion
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Lecture 11: Coordination and Agreement
Distributed Mutual eXclusion
CSE 486/586 Distributed Systems Mutual Exclusion
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Coordination and Agreement This powerpoint presentation has been adapted from: web.njit.edu/~gblank/.../Coordination%20and%20Agreement.ppt

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Coordination and Agreement Introduction How processes coordinate their actions? Main assumptions in coordination: Each pair of processes is connected by reliable channels Processes independent from each other Processes fail only by crashing

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Coordination and Agreement Distributed Mutual Exclusion Distributed processes require a mechanism that can coordinate their activities because they share a resource or collection of resources Mutual exclusion is required to prevent interference ensure consistency when accessing the resources Mutual exclusion: the process of ensuring that no more than one process is at critical section at one time Process 2 Process 1 Process 3 Process n … Shared resource

Coordination and Agreement Distributed Mutual Exclusion Algorithms for mutual exclusion Requirements for mutual exclusion are: Safety - At most one process may execute in the critical section (CS) at a time. Liveness - Requests to enter and exit the critical section eventually succeed. Ordering - If one request to enter the CS happened-before another, then entry to the CS is granted in that order.

Coordination and Agreement Distributed Mutual Exclusion Algorithms for mutual exclusion The criteria: the bandwidth consumed, which is proportional to the number of messages sent in each entry and exit operation; the client delay incurred by a process at each entry and exit operation; the algorithm’s effect upon the throughput of the system. Some examples of algorithms: The central server algorithm Ring-Based Algorithm Multicast and Logical Clocks Maekawa’s Voting Algorithm

Coordination and Agreement Distributed Mutual Exclusion The central server algorithm Employs a server that grants permission to enter the critical section.

Coordination and Agreement Distributed Mutual Exclusion Ring-Based Algorithm Arrange the processes in a logical ring

Coordination and Agreement Distributed Mutual Exclusion Multicast and Logical Clocks processes that require entry to a critical section multicast a request message, and can enter it only when all the other processes have replied to this message

Coordination and Agreement Distributed Mutual Exclusion Maekawa’s Voting Algorithm Processes need to obtain permission to enter from subsets of their peers, as long as the subsets used by any two processes overlap Not all of the peers Must collect sufficient votes to enter to the critical section

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Coordination and Agreement Election An algorithm for choosing a unique process to play a particular role a process pi can be a participant : is engaged in some run of the election algorithm a non-participant : is not currently engaged in any election Some examples of election algorithms A ring-based election algorithm The bully algorithm

Coordination and Agreement Election A ring-based election algorithm To elect a single process known as the coordinator (the process with the largest identifier) The algorithm: Every process is marked as a non-participant in an election. Any process can begin an election by marking itself as a participant, placing its identifier in an election message and sending it to its clockwise neighbour When a process receives an election message, it compares the identifier in the message with its own. If the arrived identifier is greater, then it forwards the message to its neighbour. If the arrived identifier is smaller and the receiver is not a participant, then it substitutes its own identifier in the message and forwards it; but it does not forward the message if it is already a participant. On forwarding an election message in any case, the process marks itself as a participant.

Coordination and Agreement Election

Coordination and Agreement Election The Bully algorithm Allows processes to crash during an election, although it assumes that message delivery between processes is reliable It assumes that the system is synchronous (uses timeouts to detect a process failure) It assumes that each process knows which processes have higher identifiers, and that it can communicate with all such processes 3 types of message used in this algorithm an election message - is sent to announce an election; an answer message - is sent in response to an election message a coordinator message - is sent to announce the identity of the elected process

Coordination and Agreement Election

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Coordination and Agreement Coordination and Agreement in Group Communication Each of a group of processes must receive copies of the messages sent to the group Group communication requires: Coordination Agreement: on the set of messages that is received and on the delivery ordering This chapter will discuss multicast communication of processes whose membership is known (static groups)

Coordination and Agreement Coordination and Agreement in Group Communication System: contains a collection of processes, which can communicate reliably over one-to-one channels Processes: members of groups, may fail only by crashing Closed group Open group

Coordination and Agreement Coordination and Agreement in Group Communication Primitives: multicast(g, m): sends the message m to all members of group g deliver(m) : delivers the message m to the calling process sender(m) : unique identifier of the process that sent the message m group(m): unique identifier of the group to which the message m was sent

Coordination and Agreement Coordination and Agreement in Group Communication Algorithms for coordination and agreement in group communication Basic Multicast Reliable Multicast Ordered Multicast

Coordination and Agreement Coordination and Agreement in Group Communication Basic Multicast Guarantee that a correct process will eventually deliver the message as long as the multicaster does not crash Primitives: B_multicast, B_deliver Implementation: Use a reliable one-to-one communication Unreliable: Acknowledgments may be dropped

Coordination and Agreement Coordination and Agreement in Group Communication Reliable Multicast Integrity: A correct process P delivers the message m at most once Properties to satisfy: Validity: If a correct process multicasts a message m, then it will eventually deliver m Agreement: If a correct process delivers the message m, then all other correct processes in group(m) will eventually deliver m Primitives: R_multicast, R_deliver

Coordination and Agreement Coordination and Agreement in Group Communication Implementation Initialization Correct algorithm, but inefficient (each message is sent |g| times to each process) msgReceived := {}; R-multicast(g, m) by p B-multicast(g, m); // p g B-deliver(m) by q with g = group(m) If (m  msgReceived) Then msgReceived := msgReceived  {m}; If (q  p) Then B-multicast(g, m); R-deliver(m);

Coordination and Agreement Coordination and Agreement in Group Communication Ordered Multicast Categories of ordering: FIFO ordering Causal ordering Total Ordering

Coordination and Agreement Coordination and Agreement in Group Communication Ordered Multicast FIFO ordering If a correct process issues multicast(g, m1) and then multicast(g, m2), then every correct process that delivers m2 will deliver m1 before m2 Process 1 Process 2 Process 3 m2 m3 Time

Coordination and Agreement Coordination and Agreement in Group Communication Ordered Multicast Total Ordering If a correct process delivers message m2 before it delivers m1, then any correct process that delivers m1 will deliver m2 before m1 Process 1 Process 2 Process 3 m1 m2 Time

Coordination and Agreement Coordination and Agreement in Group Communication Ordered Multicast FIFO ordering Causal ordering Total Ordering

Coordination and Agreement Coordination and Agreement in Group Communication Ordered Multicast Causal ordering If multicast(g, m1)  multicast(g, m3), then any correct process that delivers m3 will deliver m1 before m3 Process 1 Process 2 Process 3 m1 m2 m3 Time

Contents Introduction Distributed mutual exclusion Elections Coordination and agreement Consensus and related problems

Coordination and Agreement Consensus and Related Problems Make agreement in a distributed manner Mutual exclusion: who can enter the critical region Totally ordered multicast: the order of message delivery Byzantine generals: attack or retreat? Consensus (agreement ) problem Agree on a value after one or more of the processes has proposed what the value should be

Coordination and Agreement Consensus and Related Problems System model and problem definition The system model comprises a collection of processes pi ( i = 1, 2, , , , N ) communicating by message passing To reach consensus, every process pi begins in the undecided state and proposes a single value vi , drawn from a set D ( i = 1, 2, , , , N ) The processes communicate with one another, exchanging values. Each process then sets the value of a decision variable, di . In doing so it enters the decided state, in which it may no longer change di ( i = 1, 2, , , , N )

Coordination and Agreement Consensus and Related Problems System model and problem definition

Coordination and Agreement Consensus and Related Problems Requirements for consensus: Termination—eventually every correct process sets its decision variable Agreement—the decision value of all correct processes is the same Integrity—if the correct processes all proposed the same value, then any correct process in the decided state has that value. Consensus problems: The Byzantine generals problem Interactive consistency problem

Coordination and Agreement Consensus and Related Problems The Byzantine generals problem The Byzantine Empire was fraught by frequent infighting among rival military leaders for control of the empire. Several generals had to cooperate to achieve an objective, a treacherous general could weaken or even eliminate a rival by retreating and encouraging another general to retreat while encouraging the rival to attack. Without expected support, the rival was likely to be defeated. The Byzantine Generals problem concerns decision making in anticipation of an attack.

Coordination and Agreement Consensus and Related Problems Here is the Byzantine Generals problem: Three or more generals must agree to attack or retreat One general, the commander, issues the order Other generals, the lieutenants, must decide to attack or retreat One or more generals may be treacherous A treacherous general tells one general to attack and another to retreat Difference from consensus is that a single process supplies the value to agree on

Coordination and Agreement Consensus and Related Problems Interactive consistency problem A problem related to the Byzantine Generals problem is interactive consistency. In this, all correct processes agree on a vector of values, one for each process. This is called the decision vector

Coordination and Agreement Consensus and Related Problems Consensus (C), Byzantine Generals (BG), and Interactive Consistency (IC) are all problems concerned with making decisions in the context of arbitrary or crash failures. Solutions can be generated for one problem in terms of another. IC can be derived from BG by running BG N times, once for each process with that process acting as commander. C can be derived from IC by running IC to produce a vector of values at each process, then applying a function to the vector’s values to derive a single value. BG can be derived from C by Commander sends proposed value to itself and each remaining process All processes run C with received values They derive BG from the vector of C values

End of the Chapter…