Lecture 10: Coordination and Agreement (Chap 12) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

Slides:



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

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.
DISTRIBUTED SYSTEMS II FAULT-TOLERANT BROADCAST Prof Philippas Tsigas Distributed Computing and Systems Research Group.
CS542 Topics in Distributed Systems Diganta Goswami.
Lab 2 Group Communication Andreas Larsson
CS 582 / CMPE 481 Distributed Systems
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
1 Chapter 11: Coordination and Agreement From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001.
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.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 9: Time, Coordination and Replication Dr. Michael R. Lyu Computer.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Distributed Mutual Exclusion Béat Hirsbrunner References G. Coulouris, J. Dollimore and T. Kindberg "Distributed Systems: Concepts and Design", Ed. 4,
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
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.
Election Algorithms. Topics r Issues r Detecting Failures r Bully algorithm r Ring algorithm.
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.
Fault-Tolerant Broadcast Terminology: broadcast(m) a process broadcasts a message to the others deliver(m) a process delivers a message to itself 1.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 8 Leader Election Section 12.3 Klara Nahrstedt.
November 2005Distributed systems: distributed algorithms 1 Distributed Systems: Distributed algorithms.
Farnaz Moradi Based on slides by Andreas Larsson 2013.
1 Chapter 7: Clock Synchronization, Coordination &Agreement.
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.
Lecture 10 – Mutual Exclusion Distributed Systems.
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 (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
SysRép / 2.5A. SchiperEté The consensus problem.
Distributed Systems Topic 5: Time, Coordination and Agreement
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.
DISTRIBUTED SYSTEMS II FAULT-TOLERANT BROADCAST Prof Philippas Tsigas Distributed Computing and Systems Research Group.
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.
Lecture 4-1 Computer Science 425 Distributed Systems (Fall2009) Lecture 4 Chandy-Lamport Snapshot Algorithm and Multicast Communication Reading: Section.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 15: Coordination.
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:
CS 425 / ECE 428 Distributed Systems Fall 2015 Indranil Gupta (Indy) Oct 1, 2015 Lecture 12: Mutual Exclusion All slides © IG.
Distributed Systems 31. Theoretical Foundations of Distributed Systems - Coordination Simon Razniewski Faculty of Computer Science Free University of Bozen-Bolzano.
Slides for Chapter 11: Coordination and Agreement From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Distributed systems II Fault-Tolerant Broadcast
Exercises for Chapter 11: COORDINATION AND AGREEMENT
Distributed Systems Course Coordination and Agreement
Coordination and Agreement
CSE 486/586 Distributed Systems Leader Election
Coordination and Agreement
CSE 486/586 Distributed Systems Leader Election
CSE 486/586 Distributed Systems Mutual Exclusion
Lecture 10: Coordination and Agreement
Prof. Leonardo Mostarda University of Camerino
Lecture 11: Coordination and Agreement
Distributed Systems Course Coordination and Agreement
CSE 486/586 Distributed Systems Mutual Exclusion
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Lecture 10: Coordination and Agreement (Chap 12) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002

2 Contents Introduction Distributed mutual exclusion Elections Multicast communication

3 Introduction  This chapter covers other types of coordination and agreement such as mutual exclusion, elections and consensus.  Failure assumptions: –a network partition –Asymmetric –Intransitive:  Failure detector: a service that processes query about a particular process has failed. –Unreliable: unsuspected or suspected –Reliable: unsuspected or failed

4 Figure 11.1 A network partition A collection of processes is split into several groups that cannot communicate.

5 Unreliable failure detector  “p is here” to all others per Ts;  D is the maximum time of message transmission.  If q.detector does not receive a “p is here” within T+Ds, reports “p is suspected”

6 Distributed mutual exclusion  Critical section: –Enter() –ResourceAccesses() –Exit()  Mutual exclusion –ME1: (safety) At most one is executing in the critical section at a time. –ME2: ( liveness) Requests eventually succeed. –ME3: (-> ordering) Happened-before is granted at entries for requests.  Evaluation: –Bandwidth –Client delay –Synchronization delay

7 Algorithms  The Central Server Algorithm –Send a request to a server to get a token.  A ring-based algorithm –A token is created somewhere.  An algorithm using multicast and logical clocks –(Ricart and Agrawala’s algorithm) –Multicast a request –When all others reply, it can enter.

8 The Central Server Algorithm ME1:OK ME2:OK ME3: No Send a request to a server to get a token. If the token is available, the request is granted. Else the request is queued.

9 A ring of processes transferring a mutual exclusion token ME1:OK ME2:OK ME3: No A token is created somewhere. The token is turn around in a logical ring. If the process need to access the shared resource, take it and use it. Else turn it in to the next process.

10 Ricart and Agrawala’s algorithm On initialization state := RELEASED; To enter the section state := WANTED; Multicast request to all processes;request processing deferred here T := request’s timestamp; Wait until (number of replies received = (N – 1)); state := HELD; On receipt of a request at p j (i ≠ j) if (state = HELD or (state = WANTED and (T, p j ) < (T i, p i ))) then queue request from p i without replying; else reply immediately to p i ; end if To exit the critical section state := RELEASED; reply to any queued requests;

11 Figure 11.5 Multicast synchronization p 3 34 Reply p 1 p 2 Reply ME1:OK ME2:OK ME3: OK

12 Elections  Choosing a unique process to play a particular role. –Is called an election  Requirements (┴ means not yet defined) –E1: (safety) A particular process p i has elected i = ┴ or elected i =P, where P is chosen as the non-crashed process at the end of the run with the largest identifier. –E2: (liveness) Every process p i participates and eventually sets elected i ≠┴ or crash.

13 Algorithms  A ring-based election algorithm –Send a election message –If get a message, compare the ID, if greater, forward; if less, substitute the ID and forward; –If the ID is the same, send a “coordinator” message.

14 A ring-based election in progress Note: The election was started by process 17. The highest process identifier encountered so far is 24. Participant processes are shown darkened E1: OK E2: OK Tolerates no failure

15 The bully algorithm  Synchronous, the upper bound for message response is T = 2T trans +T process  Pi knows which are higher;  Messages: –Election –Answer –Coordinator  Send a election message, If timeout (>T), sends another coordinator message;  The process elects itself if it is the highest, sends the coordinator message  The process getting a election message sends an answer and other election messages.

16 Figure 11.8 The bully algorithm The election of coordinator p 2, after the failure of p 4 and then p 3 E1: OK? No if a crashed process is replaced. There are might be two coordinator messages. E2: OK

17 Revision of IP multicast (section page154)  IP multicast – an implementation of group communication –built on top of IP (note IP packets are addressed to computers) –allows the sender to transmit a single IP packet to a set of computers that form a multicast group (a class D internet address with first 4 bits 1110) –Dynamic membership of groups. Can send to a group with or without joining it –To multicast, send a UDP datagram with a multicast address –To join, make a socket join a group (s.joinGroup(group) - Fig 4.17) enabling it to receive messages to the group  Multicast routers –Local messages use local multicast capability. Routers make it efficient by choosing other routers on the way.  Failure model –Omission failures  some but not all members may receive a message.  e.g. a recipient may drop message, or a multicast router may fail –IP packets may not arrive in sender order, group members can receive messages in different orders

18 Introduction to multicast  Multicast communication requires coordination and agreement. The aim is for members of a group to receive copies of messages sent to the group  Many different delivery guarantees are possible –e.g. agree on the set of messages received or on delivery ordering  A process can multicast by the use of a single operation instead of a send to each member –For example in IP multicast aSocket.send(aMessage) –The single operation allows for:  efficiency I.e. send once on each link, using hardware multicast when available, e.g. multicast from a computer in Toronto to two in Beijing  delivery guarantees e.g. can’t make a guarantee if multicast is implemented as multiple sends and the sender fails. Ordering is also a problem.

19 System model  The system consists of a collection of processes which can communicate reliably over 1-1 channels  Processes fail only by crashing (no arbitrary failures)  Processes are members of groups - which are the destinations of multicast messages  In general, process p can belong to more than one group  Operations –multicast(g, m) sends message m to all members of process group g –deliver (m) is called to get a multicast message delivered. It is different from receive as it may be delayed to allow for ordering or reliability.  Multicast message m carries the id of the sending process sender(m) and the id of the destination group(m)  We assume there is no falsification of the origin and destination of messages

20 Open and closed groups  Closed groups –only members can send to group, a member delivers to itself –they are useful for coordination of groups of cooperating servers  Open –they are useful for notification of events to groups of interested processes Figure 11.9 Does IP multicast support open and closed groups?

21 Reliability of one-to-one communication(Ch.2 page 57)  The term reliable 1-1 communication is defined in terms of validity and integrity as follows:  validity : –any message in the outgoing message buffer is eventually delivered to the incoming message buffer;  integrity : –the message received is identical to one sent, and no messages are delivered twice. How do we achieve validity? integrity  by use checksums, reject duplicates (e.g. due to retries).  If allowing for malicious users, use security techniques How do we achieve integrity? validity - by use of acknowledgements and retries

Basic multicast  A correct process will eventually deliver the message provided the multicaster does not crash –note that IP multicast does not give this guarantee  The primitives are called B-multicast and B-deliver  A straightforward but ineffective method of implementation: –use a reliable 1-1 send (i.e. with integrity and validity as above) To B-multicast(g,m): for each process p  g, send(p, m); On receive (m) at p: B-deliver (m) at p  Problem –if the number of processes is large, the protocol will suffer from ack-implosion A practical implementation of Basic Multicast may be achieved over IP multicast.

Reliable multicast  The protocol is correct even if the multicaster crashes  it satisfies criteria for validity, integrity and agreement  it provides operations R-multicast and R-deliver  Integrity - a correct process, p delivers m at most once. Also p  group(m) and m was supplied to a multicast operation by sender(m)  Validity - if a correct process multicasts m, it will eventually deliver m  Agreement - if a correct process delivers m then all correct processes in group(m) will eventually deliver m integrity as for 1-1 communication validity - simplify by choosing sender as the one process agreement - all or nothing - atomicity, even if multicaster crashes

24 Reliable multicast algorithm over basic multicast  processes can belong to several closed groups Figure primitives R-multicast and R-deliver to R-multicast a message, a process B-multicasts it to processes in the group including itself when a message is B-delivered, the recipient B-multicasts it to the group, then R-delivers it. Duplicates are detected. Validity - a correct process will B-deliver to itself Integrity - because the reliable 1-1 channels used for B-multicast guarantee integrity Agreement - every correct process B-multicasts the message to the others. If p does not R-deliver then this is because it didn’t B-deliver - because no others did either.

25 Summary  Mutual exclusion –Central server –Ring-based –Using multicast  Elections –Ring-based –Bully  Multicast communication can specify requirements for reliability and ordering, in terms of integrity, validity and agreement

26 Summary  B-multicast –a correct process will eventually deliver a message provided the multicaster does not crash  reliable multicast –in which the correct processes agree on the set of messages to be delivered; –we showed two implementations: over B-multicast and IP multicast