Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty ::

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Chapter 13 Leader Election. Breaking the symmetry in system Similar to distributed mutual exclusion problems, the first process to enter the CS can be.
UBE529 Distributed Coordination. 2 Leader Election Gerard LeLann posed the Election problem in a famous paper 1977 Many distributed systems are client.
Leader Election Breaking the symmetry in a system.
Lecture 8: Asynchronous Network Algorithms
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Chapter 15 Basic Asynchronous Network Algorithms
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
Distributed Computing 2. Leader Election – ring network Shmuel Zaks ©
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Lecture 7: Synchronous Network Algorithms
Minimum Spanning Trees
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 7 Instructor: Haifeng YU.
Università degli Studi dell’Aquila Academic Year 2009/2010 Course: Algorithms for Distributed Systems Instructor: Prof. Guido Proietti Time: Monday:
1 Complexity of Network Synchronization Raeda Naamnieh.
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Leader Election in Rings
Maximal Independent Set Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Chapter 14 Synchronizers. Synchronizers : Introduction Simulate a synchronous network over an asynchronous underlying network Possible in the absence.
Election Algorithms and Distributed Processing Section 6.5.
Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
Broadcast & Convergecast Downcast & Upcast
Distributed Computing 5. Synchronization Shmuel Zaks ©
Why do we need models? There are many dimensions of variability in distributed systems. Examples: interprocess communication mechanisms, failure classes,
Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 8 Instructor: Haifeng YU.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
The Complexity of Distributed Algorithms. Common measures Space complexity How much space is needed per process to run an algorithm? (measured in terms.
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Minimum Spanning Tree. Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
Leader Election (if we ignore the failure detection part)
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
1 Review Questions Define n variables, types of shared variables, message-passing, shared-memory system, system topology n program-counter/guarded command.
Hwajung Lee. Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.   i,j  V  i,j are non-faulty ::
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Self-stabilization. Technique for spontaneous healing after transient failure or perturbation. Non-masking tolerance (Forward error recovery). Guarantees.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
Distributed Systems Lecture 9 Leader election 1. Previous lecture Middleware RPC and RMI – Marshalling 2.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
1 Traversal Algorithms  sequential polling algorithm  traversing connected networks (tree construction) complexity measures tree terminology tarry’s.
CSE 486/586 Distributed Systems Leader Election
Advanced Topics in Concurrency and Reactive Programming: Time and State Majeed Kassis.
Distributed Processing Election Algorithm
Lecture 9: Asynchronous Network Algorithms
Self-stabilization.
Leader Election (if we ignore the failure detection part)
MST GALLAGER HUMBLET SPIRA ALGORITHM
Alternating Bit Protocol
Parallel and Distributed Algorithms
Minimum Spanning Tree.
CSE 486/586 Distributed Systems Leader Election
MST GALLAGER HUMBLET SPIRA ALGORITHM
Lecture 8: Synchronous Network Algorithms
Physical clock synchronization
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Distributed Systems and Concurrency: Synchronization in Distributed Systems Majeed Kassis.
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty :: L(i)  V and L(i) = L(j) and L(i) is non-faulty Often reduces to maxima (or minima) finding problem.

Bully algorithm (Assumes that the topology is completely connected) 1. Send election message (I want to be the leader) to processes with larger id 2. Give up if a process with larger id sends a reply message (means no, you cannot be the leader). In that case, wait for the leader message (I am the leader). Otherwise elect yourself the leader and send a leader message 3. If no reply is received, then elect yourself the leader, and broadcast a leader message. 4. If you receive a reply, but later don’t receive a leader message from a process of larger id (i.e the leader-elect has crashed), then re-initiate election by sending election message. The worst-case message complexity = O(n 3 ) WHY? (This is bad)

Maxima finding on a unidirectional ring Chang-Roberts algorithm. Initially all initiator processes are red. {For each initiator i} do token  j < i  skip ÿtoken  j > i  send token ; color := black ÿtoken  j = i  L(i) := i {i becomes the leader} od {Non-initiators remain black, and act as routers} do token received  send od Message complexity = O(n 2 ). Why?

Bidirectional ring Franklin’s algorithm (round based) Send probes in both directions. Probes from higher numbered processes will knock the lower numbered processes out of competition. In each round, out of two neighbors, at least one must quit. So at least 1/2 of the current contenders will quit. Message complexity = O(n log n). Why?

Sample execution

Peterson’s algorithm Finds maxima on a unidirectional ring using O(n log n) messages. Uses an id and an alias for each process.

Peterson’s algorithm initially  i : color(i) = red, alias(i) = i {program for each round and for each red process} send alias ; receive alias (N); if alias = alias (N)  I am the leader  alias ≠ alias (N)  send alias(N); receive alias(NN); if alias(N) > max (alias, alias (NN))  alias:= alias (N)  alias(N) < max (alias, alias (NN))  color := black fi { N(i) and NN(i) denote neighbor and neighbor’s neighbor of i }

Synchronizers Synchronous algorithms (round-based, where processes execute actions in lock-step synchrony) are easer to deal with than asynchronous algorithms. In each round, a process (1) receives messages from neighbors, (2) performs local computation (3) sends messages to ≥ 0 neighbors A synchronizer is a protocol that enables synchronous algorithms to run on asynchronous platforms synchronizer Asynchronous system Synchronous algorithm

Synchronizers “Every message sent in clock tick k must be received by the receivers in the clock tick k.” This is not automatic - some extra effort is needed. Start tick 0 In an ABD synchronizer, each process will start the simulation of a new clock tick after 2  time units, where  is the maximum propagation delay of each channel Asynchronous Bounded Delay (ABD) Synchronizer

 -synchronizers What if the propagation delay is arbitrarily large but finite? The  -synchronizer can handle this. 1.Send and receive messages for the current tick. 2.Send ack for each incoming message, and receive ack for each outgoing message 3.Send a safe message to each neighbor after sending and receiving all ack messages Simulation of each clock tick

Complexity of  -synchronizer Message complexity M(  ) Defined as the number of messages passed around the entire network for the simulation of each clock tick. M(  ) = O(|E|) Time complexity T(  ) Defined as the number of asynchronous rounds needed for the simulation of each clock tick. T(  ) = 3 (since each process exchanges m, ack, safe)

Complexity of  -synchronizer M A = M S + T S. M(  ) T A = T S. T(  ) MESSAGE complexity of the algorithm implemented on top of the asynchronous platform Message complexity of the original synchronous algorithm Time complexity of the original synchronous algorithm TIME complexity of the algorithm implemented on top of the asynchronous platform

The  -synchronizer Form a spanning tree with any node as the root. The root initiates the simulation of each tick by sending message m(j) for each clock tick j down the tree. Each process responds with ack(j) and then with a safe(j) message (that represents the fact that the entire subtree under it is safe). When the root receives safe(j) from every child, it initiates the simulation of clock tick (j+1) Message complexity M(  ) = 3 (N-1) since three messages (m, ack, safe) flow along each edge of the tree. Time complexity T(  ) = depth of the tree. For a balanced tree, this is O(log N)