1 Leader Election in Rings. 2 A Ring Network 3 1 1 1 1 11 1 1 2 2 2 2 2 2 2 2 Sense of direction left right.

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.
Leader Election.
Leader Election Breaking the symmetry in a system.
Distributed Leader Election Algorithms in Synchronous Ring Networks
Two absolute bounds for distributed bit complexity Yefim Dinitz, Noam Solomon, 2007 Presented by: Or Peri & Maya Shuster.
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.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
Lecture 8: Asynchronous Network Algorithms
Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks ©
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 ©
1 Maximal Independent Set. 2 Independent Set (IS): In a graph G=(V,E), |V|=n, |E|=m, any set of nodes that are not adjacent.
Lecture 7: Synchronous Network Algorithms
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Minimum Spanning Trees
Minimum Spanning Trees
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph, any set of nodes that are not adjacent.
CPSC 668Set 5: Synchronous LE in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Complexity of Network Synchronization Raeda Naamnieh.
CPSC 668Set 4: Asynchronous Lower Bound for LE in Rings1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 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.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
Leader Election in Rings
Distributed Algorithms (22903) Lecturer: Danny Hendler Leader election in rings This presentation is based on the book “Distributed Computing” by Hagit.
Maximal Independent Set Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Raeda Naamnieh 1. The Partition Algorithm Intuitively, the idea of the following algorithm is to choose each cluster as a maximal subset of nodes whose.
Distributed Computing 5. Synchronization Shmuel Zaks ©
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph G=(V,E), |V|=n, |E|=m, any set of nodes that are not adjacent.
Leader Election. Leader Election: the idea We study Leader Election in rings.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 5: Synchronous LE in Rings 1.
Leader Election (if we ignore the failure detection part)
Vertex Coloring Distributed Algorithms for Multi-Agent Networks
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 ::
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
1 Distributed Vertex Coloring. 2 Vertex Coloring: each vertex is assigned a color.
Distributed Algorithms (22903) Lecturer: Danny Hendler Leader election in rings This presentation is based on the book “Distributed Computing” by Hagit.
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.
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
1 Algorithms for COOPERATIVE DS: Leader Election in the MPS model.
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 ::
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Leader Election Chapter 3 Observations Election in the Ring
Distributed Algorithms (22903)
Maximal Independent Set
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Algorithms for COOPERATIVE DS: Leader Election in the MPS model
Lecture 9: Asynchronous Network Algorithms
Leader Election (if we ignore the failure detection part)
MST GALLAGER HUMBLET SPIRA ALGORITHM
Distributed Consensus
Maximal Independent Set
Parallel and Distributed Algorithms
TexPoint fonts used in EMF.
Leader Election CS60002: Distributed Systems
MST GALLAGER HUMBLET SPIRA ALGORITHM
Lecture 8: Synchronous Network Algorithms
Distributed Algorithms (22903)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Presentation transcript:

1 Leader Election in Rings

2 A Ring Network

Sense of direction left right

Links are bi-directional for messages At most one message in each direction

Anonymous Ring

6 Eponymous (non-anonymous) Ring

7 Leader Election Initial stateFinal state leader

8 Leader election algorithms are affected by: Anonymous Ring Eponymous Ring The size of the network is known The size of the network is not known Synchronous Algorithm Asynchronous Algorithm

9 Synchronous Anonymous Rings Every processor runs the same algorithm Every processor does exactly the same execution

10 Initial stateFinal state leader If one node is elected a leader, then every node is elected a leader

11 Final state leader Conclusion 1: Leader election cannot be solved in synchronous anonymous rings

12 Final state leader Conclusion 2: Leader election cannot be solved in asynchronous anonymous rings either Why? The asynchronous ring may behave Like the synchronous ring

13 Asynchronous Eponymous Rings The maximum id node is elected leader

Each node sends a message with its id to the left neighbor

If: message received id current node id Then: forward message

If: message received id current node id 8 7 Then: forward message

If: message received id current node id 8 7 Then: forward message

If: message received id current node id 8 Then: forward message

If: a node receives its own message 8 Then: it elects itself a leader

If: a node receives its own message Then: it elects itself a leader leader

leader The leader sends a message in the network declaring itself as the “leader of the ring”

leader Time complexity: nodes

23 1 n-1 n-3 2 n-2 n Message complexity:nodes worst case scenario:

24 1 n-1 n-3 2 n-2 n Message complexity:nodes messages

25 1 n-1 n-3 2 n-2 n Message complexity:nodes messages

26 1 n-1 n-3 2 n-2 n Message complexity:nodes messages

27 1 n-1 n-3 2 n-2 n Message complexity:nodes Total messages:

28 Notes: does not need to be known to the algorithm The algorithm can be converted to asynchronous

29 An O(n log n) Mess. Algorithm Again, the maximum id node is elected leader

nodes

Phase 1: send id to 1-neighborhood

32 If: received id current id Then: send a reply

33 If: a node receives both replies Then: it becomes a temporal leader

Phase 2: send id to 2-neighborhood

If: received id current id Then: forward the message

36 If: received id current id Then: send a reply At second step:

If: a node receives both replies Then: it becomes a temporal leader

Phase 3: send id to -neighborhood

If: received id current id Then: forward the message

If: received id current id Then: send a reply At the step:

If: a node receives both replies Then: it becomes the leader

leader

leader nodesphases In general:

leader Phase i: send id to -neighborhood

45 Time complexity The leader spends time in Phase 1: 2 Phase 2: 4 … Phase i: … Phase log n: Total time:

46 Phase 1: 4 Phase 2: 8 … Phase i: … Phase log n: Message complexity Messages per leader Max #leaders

47 Phase 1: 4 Phase 2: 8 … Phase i: … Phase log n: Total messages: Messages per leader Max #leaders

48 Notes: The algorithm does not need to know It can be converted to an asynchronous algorithm

49 An Mess. Synchronous Algorithm The node with smallest id is elected leader There are rounds: If in round there is a node with id this is the new leader the algorithm terminates is known

50 Round 1 ( time steps): no message sent nodes

nodes Round 2 ( time steps): no message sent

nodes Round 9 9 new leader

nodes Round 9 ( time steps): messages sent 9 new leader

nodes Round 9 ( time steps): messages sent 9 new leader Algorithm Terminates

nodes Round 9 ( time steps): messages sent 9 new leader Total number of messages:

56 Another Synchronous Algorithm The node with smallest id is elected leader is not known

57 The algorithm: Each node injects a message with its id Message with id is injected and transferred with rate Nodes which have seen smaller id absorb higher id messages

Time 1 0 Transfer rate

Time rate

Time 3 0 1

Time 4 0 1

Time 5 0

Time 6 0

Time 8 0

65 Time New leader

66 Message complexity Assume leader has (smallest) id Total time of algorithm: Note that if then algorithm is exponentially slow

67 Take the node with immediately higher id Total number of messages:

68 Take the node with immediately higher id Total number of messages:

69 id messages lower higher Total messages:

70 An Lower Bound Assume we have algorithms in which: the maximum identifier is elected leader all the nodes must know the leader We will prove: at least messages are needed the size of the network is not known to elect a leader the network is asynchronous

71 open edge no messages cross it There is a possible asynchronous execution with an open edge (i.e. a very slow edge) Messages may be pending to cross open edge

72 open edge If the edge remains open, then the execution will eventually reach a quiescent state where not more messages cross the ring Messages pending to cross open edge Quiescent State

73 open edge Messages pending to cross open edge Quiescent State In the quiescent state, a node can send a message only after it receives a message (thus no messages cross the ring)

74 This may cause a propagation of messages until the algorithm terminates Suppose that the edge closes Time t

75 This may cause a propagation of messages until the algorithm terminates Time t+1

76 This may cause a propagation of messages until the algorithm terminates Time t+2

77 Time t+k k k After k time steps the affected radius is k

78 Time t+x Eventually, the ring stabilizes with a leader

79 We will show, that there is an execution with nodes such that: there is an open edge at least messages are received where

80 x y basis case If then is the leader should know about this Therefore a message is sent: Proof by induction

81 x y open edge The message can be sent on one edge

82 The case From induction hypothesis, we have an execution: open edge Messages sent nodes

83 The case open edges Messages sent nodes From induction hypothesis, we have an execution:

84 Observation: If no message is sent along then ring cannot distinguish the two scenarios (similarly for ring )

85 Messages sent nodes Therefore, the same number of messages have to be sent in sub-rings True open edge True open edge

86 max id All nodes in should learn about (assume that max id is in ) open edge

87 max id All nodes in should learn about Thus, after the open edges close, at least messages are sent (At least one of these is sent)

88 max id Suppose edges close at time At least one message is sent

89 max id time At least one message is sent

90 max id time At least messages have been sent since

91 max id time radius At least messages have been sent since

92 max id time radius At least messages have been sent since Independent areas

93 max id time radius At least messages have been sent in one area Independent areas Messages

94 max id time radius open edge Since areas are independent, we could have closed only one edge Messages

95 max id time radius open edge Messages Induction Hypothesis Total Messages