Election Algorithms and Distributed Processing Section 6.5.

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.
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
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.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
1 Algorithms and protocols for distributed systems We have defined process groups as having peer or hierarchical structure and have seen that a coordinator.
Page 1 Mutual Exclusion* Distributed Systems *referred to slides by Prof. Paul Krzyzanowski at Rutgers University and Prof. Mary Ellen Weisskopf at University.
Leader Election Bismita Srichandan. Leader Election What is Leader Election Why Leader election is needed Different design topologies Algorithms used.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
1 Complexity of Network Synchronization Raeda Naamnieh.
Distributed Systems Spring 2009
LEADER ELECTION CS Election Algorithms Many distributed algorithms need one process to act as coordinator – Doesn’t matter which process does the.
CS 582 / CMPE 481 Distributed Systems
Chapter 4 - Self-Stabilizing Algorithms for Model Conservation4-1 Chapter 4: roadmap 4.1 Token Passing: Converting a Central Daemon to read/write 4.2 Data-Link.
1. Explain why synchronization is so important in distributed systems by giving an appropriate example When each machine has its own clock, an event that.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
Synchronization in Distributed Systems. Mutual Exclusion To read or update shared data, a process should enter a critical region to ensure mutual exclusion.
Distributed Systems 2006 Group Membership * *With material adapted from Ken Birman.
Coordination in Distributed Systems Lecture # 8. Coordination Anecdotes  Decentralized, no coordination  Aloha ~ 18%  Some coordinating Master  Slotted.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Clock Synchronization and algorithm
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Election Algorithms. Topics r Issues r Detecting Failures r Bully algorithm r Ring algorithm.
L EADER E LECTION Advanced Operating Systems (CSC 8320) Fall 2011 Shagun Kariwala.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 6 Synchronization.
Mutual exclusion Concurrent access of processes to a shared resource or data is executed in mutually exclusive manner Distributed mutual exclusion can.
Leader Election Algorithms for Mobile Ad Hoc Networks Presented by: Joseph Gunawan.
Centralized mutual exclusion Problem : What if the coordinator fails? Solution : Elect a new one.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Coordination and Agreement. Topics Distributed Mutual Exclusion Leader Election.
Page 1 Distributed Systems Election Algorithms* *referred to slides by Prof. Hugh C. Lauer at Worcester Polytechnic Institute.
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 8 Leader Election Section 12.3 Klara Nahrstedt.
Synchronization CSCI 4780/6780. Mutual Exclusion Concurrency and collaboration are fundamental to distributed systems Simultaneous access to resources.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
ADITH KRISHNA SRINIVASAN
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
6.5 Election Algorithms -Avinash Madineni.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
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.
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.
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.
Coordination and Agreement
CSE 486/586 Distributed Systems Leader Election
Advanced Topics in Concurrency and Reactive Programming: Time and State Majeed Kassis.
Election algorithm Who wins? God knows.
Distributed Processing Election Algorithm
Lecture 17: Leader Election
Lecture 9: Asynchronous Network Algorithms
Leader Election (if we ignore the failure detection part)
Outline Distributed Mutual Exclusion Introduction Performance measures
CSE 486/586 Distributed Systems Leader Election
Lecture 10: Coordination and Agreement
Prof. Leonardo Mostarda University of Camerino
Lecture 11: Coordination and Agreement
Leader Election Bernard Chen.
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Election Algorithms and Distributed Processing Section 6.5

Outline Election algorithms – introduction Traditional election algorithms –Bully algorithm –Ring algorithm Wireless election algorithms

Need for a Coordinator Many algorithms used in distributed systems require a coordinator –For example, see the centralized mutual exclusion algorithm. In general, all processes in the distributed system are equally suitable for the role Election algorithms are designed to choose a coordinator.

Election Algorithms Any process can serve as coordinator Any process can “call an election” (initiate the algorithm to choose a new coordinator). –There is no harm (other than extra message traffic) in having multiple concurrent elections. Elections may be needed when the system is initialized, or if the coordinator crashes or retires.

Assumptions Every process/site has a unique ID; e.g. – the network address –a process number Every process in the system should know the values in the set of ID numbers, although not which processors are up or down. The process with the highest ID number will be the new coordinator. Process groups (as with ISIS toolkit or MPI) satisfy these requirements.

Requirements When the election algorithm terminates a single process has been selected and every process knows its identity. Formalize: every process p i has a variable e i to hold the coordinator’s process number. –∀i, e i = undefined or e i = P, where P is the non-crashed process with highest id –All processes (that have not crashed) eventually set e i = P.

The Bully Algorithm - Overview Process p calls an election when it notices that the coordinator is no longer responding. High-numbered processes “bully” low- numbered processes out of the election, until only one process remains. When a crashed process reboots, it holds an election. If it is now the highest- numbered live process, it will win.

OK election Figure 6-20 Process p sends an election message to all higher-numbered processes in the system. If no process responds, then p becomes the coordinator. If a higher-level process (q) responds, it sends p a message that terminates p’s role in the algorithm

OK coordinator election Figure 6-20 The process q now calls an election (if it has not already done so). Repeat until no higher-level process responds. The last process to call an election “wins” the election. The winner sends a message to other processes announcing itself as the new coordinator. If 7 comes back on line, it will call an election

OK coordinator election OK election Figure 6-20

Analysis Works best if communication in the system has bounded latency so processes can determine that a process has failed by knowing the upper bound (UB) on message transmission time (T) and message processing time (M). –UB = 2 * T + M However, if a process calls an election when the coordinator is still active, the coordinator will win the election.

A Ring Algorithm - Overview The ring algorithm assumes that the processes are arranged in a logical ring and each process is knows the order of the ring of processes. Processes are able to “skip” faulty systems: instead of sending to process j, send to j + 1. Faulty systems are those that don’t respond in a fixed amount of time.

A Ring Algorithm P thinks the coordinator has crashed; builds an ELECTION message which contains its own ID number. Sends to first live successor Each process adds its own number and forwards to next. OK to have two elections at once.

Ring Algorithm - Details When the message returns to p, it sees its own process ID in the list and knows that the circuit is complete. P circulates a COORDINATOR message with the new high number. Here, both 2 and 5 elect 6: [5,6,0,1,2,3,4] [2,3,4,5,6,0,1]

Elections in Wireless Environments Traditional algorithms aren’t appropriate. –Can’t assume reliable message passing or stable network configuration This discussion focuses on ad hoc wireless networks but ignores node mobility. –Nodes connect directly, no common access point, connection is short term –Often used in multiplayer gaming, on-the-fly file transfers, etc.

Assumptions Wireless algorithms try to find the best node to be coordinator; traditional algorithms are satisfied with any node. Any node (the source) can initiate an election by sending an ELECTION message to its neighbors – nodes within range. When a node receives its first ELECTION message the sender becomes its parent node.

Node a is the source. Messages have a unique ID to manage possible concurrent elections Figure 6-22.

Figure 6.22 Figure Election algorithm in a wireless network, with node a as the source. (a) Initial network. (b)–(e) The build-tree phase When a node R receives its first election message, it designates the source Q as its parent, and forwards the message to all neighbors except Q. When R receives an election message from a non- parent, it just acknowledges the message

Figure (e) The build-tree phase. (f) Reporting of best node to source. If R’s neighbors have parents, R is a leaf; otherwise it waits for its children to forward the message to their neighbors. When R has collected acks from all its neighbors, it acknowledges the message from Q. Acknowledgements flow back up the tree to the original source.

Wireless Elections At each stage the “most eligible” or “best” node will be passed along from child to parent. Once the source node has received all the replies, it is in a position to choose the new coordinator. When the selection is made, it is broadcast to all nodes in the network.

Wireless Elections If more than one election is called (multiple source nodes), a node should participate in only one. Election messages are tagged with a process id. If a node has chosen a parent but gets an election message from a higher numbered node, it drops out of the current election and adopts the high numbered node as its parent. This ensures only one election makes a choice.

Chapter 6 - Summary “Synchronization is … doing the right thing at the right time.” Synchronization in distributed systems is related to communication. Complicated by lack of global clock, shared memory. Logical clocks support global event order. Distributed mutex: important class of synchronization algorithms. Leader election algorithms are sometimes needed.