1 / 18

Coordination in Distributed Systems

Coordination in Distributed Systems. Coordination Anecdotes. Decentralized, no coordination Aloha ~ 18% Some coordinating Master Slotted Aloha ~ 36% Impossibility of Concensus If the ether dropped your packets, we will never have concensus (lynch). Why is coordination important.

elisa
Download Presentation

Coordination in Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Coordination in Distributed Systems

  2. Coordination Anecdotes • Decentralized, no coordination • Aloha ~ 18% • Some coordinating Master • Slotted Aloha ~ 36% • Impossibility of Concensus • If the ether dropped your packets, we will never have concensus (lynch)

  3. Why is coordination important • Resource Sharing • Database • Files • Agreement • Agree on an award for faculty • Agree on whether to take a quiz • Leader Election • Choose Time server • Choose Bus Master

  4. Challenges • Host Failures • Link Failures • Time and Causual Ordering

  5. Distributed Mutual Exclusion • Mutual Exclusion • Atmost one process in the critical section • What happens when processes are distributed • Let’s assume reliability first • Three messages • Enter(): I want to enter • ResourceAccess(): OK Go ahead access the critical section • Exit(): I am done

  6. Requirements for Mutex • At most one process in the critical section • Everyone gets to access the critical section: Eventual grant • Global ordering: Difficult

  7. Distributed Mutual Exclusion P1 P4 P3 P2

  8. Centralized Algorithm • Single Coordinating Server • P can enter Critical Section (CS) if it has a grant TOKEN • Server Grants TOKEN • Processes Request TOKEN • GRANT if CS is free • Else queue • Grant to the oldest in the queue • Problems • Performance Bottleneck • Server Crash • Ordering?

  9. Ring Based Coordination • Logical Ring • Typically based on network address • Pass token clockwise (other otherwise)

  10. Ring based Coordination • No Master, no Centralized Server • Wait for TOKEN • If you want to enter CS • Grab Token • Access CS • Release and Pass along the TOKEN • Else • Pass along the Token • Problems: • Continuous Overhead • Must wait for N (worst case) before enter is granted • Ordering?

  11. Ricarta&Agarwal Algo • Based on Reliable Multicast • Multicast to All Processes when you want to enter CS • If you hear an Ack from everyone • Enter CS • Else • Repeat • Ordering? • Timestamp multicast with Lamport Clocks • Use vector clocks for total ordering

  12. Leader Election • Elect Unique Master • Typically after failure • Simulataneous Requests Allowed • Permissible States • Either No Leader • Or Well-known leader • Everyone must know about leader • All processes must participate in election and can discover leader

  13. Chang&Roberts Algo

  14. Ring coordination • Find the Master with the maximum UID • Receive UID • Pass max(Own UID, Nieghbor UID) • If you hear your UID again • You are the leader • Annouce yourself as the leader • Problems: • Two Iterations • Unique IDs assumed • Failure?

  15. Itai&Rodeh Algo • Relaxes UID Requirement • Again Ring Based (unidirectional) • Election • Assign you’re an ID (from 1 … k) • Do the Chang algo • If no leader • Choose ID again • Termination? • Probablistic

  16. Termination • Larger the K, larger your probability of assigning yourself a unique ID • N = 4, K=16 • Time to terminate: 1.01 rounds • Welcome to the power of randomization • Used in everyday things to make problems tractable • Think Ethernet

  17. IEEE 1394: Firewire • High-speed synchronous Bus • Used on Sony Handycams • Bus Master Election Algorithm • Not a ring (actually a tree) • Hot Plug-n-Play: NO UIDs • Must elect master after a device is attached or removed

  18. Algo • Start with Leaves • Send “adopt me” • Leave has only one egress link • If you hear n-1 “adopt me” messages • Forward the message to the Nth link • Why is probability used again for root detection?

More Related