Leader Election - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Leader Election

Description:

Results we already know: in trees with unique IDs (saturation) ... O(n) leader election in oriented complete networks. Reducing the number of chords ... – PowerPoint PPT presentation

Number of Views:111
Avg rating:3.0/5.0
Slides: 15
Provided by: Pao3
Category:
Tags: election | leader

less

Transcript and Presenter's Notes

Title: Leader Election


1
Leader Election
  • Transform the system from configuration where
    every node is in the same state, to a
    configuration where one node is in state leader
    and all others are in state defeated.
  • Motivation
  • central coordinator often needed
  • efficiency/simplicity (centralized protocols
    tend to be more efficient)
  • fault tolerance recover from a crashed
    coordinator
  • closely related to other problems spanning tree
    construction, minimum finding, cooperative
    merging of multiple computations

2
Leader Election II
  • Basic impossibility result
  • leader cannot be elected in general in anonymous
    setting
  • symmetry cannot be broken
  • Ways to avoid the problem
  • unique IDs (standard assumption)
  • asymmetric network, configuration of non-unique
    IDs
  • Results we already know
  • in trees with unique IDs (saturation)
  • multi-flooding (everybody broadcasts its ID,
    minimum wins)

3
Leader Election III
  • Leader election in rings
  • very simple, but symmetrical network
  • unidirectional, bidirectional (oriented,
    unoriented)
  • all the way
  • as far as it can, average cost analysis of it
  • limited travel (controlled distance)
  • Franklins algorithm, variants and improvements
  • unidirectional protocols
  • discussion

4
Leader Election IV
  • O(n) leader election in oriented hypercubes
  • O(n) leader election in oriented complete
    networks
  • Reducing the number of chords
  • log n chords hypercube-like chordal rings
  • O(1) chords O(n) leader election in torus
  • How about lack of orientation?
  • torus, hypercube, complete networks
  • General approach to leader election in specific
    networks
  • Leader election in arbitrary networks

5
All the way (LeLann 1977)
  • Basic idea
  • ID of each entity travels all the way around the
    ring
  • the leader is the node with minimal value
  • solves also the problem of input collection
  • Assumptions
  • local orientation, distinct IDs
  • can be unidirectional or bidirectional, also
    unoriented
  • no FIFO on links, no knowledge of n
  • Termination problem
  • when receives own ID back (assumes FIFO)
  • when received n distinct values (assumes n
    known)
  • Solution
  • compute n (have a counter in each message)

6
As far as it can (Chang and Roberts 79)
  • Main idea
  • no need to forward IDs which cannot be the
    smallest one
  • Overview
  • each node maintains variable smallest seen
  • only IDgtsmallest seen is forwarded
  • only the smallest ID will travel all the way
    around
  • notification phase is needed
  • FIFO? knowledge of n?
  • Complexity?
  • worst case, best case, average case

7
Limited travel (Hirschberg Sinclair 80)
  • Main idea
  • works in phases, the first phase is initiated by
    the spontaneously awaken processors (candidates)
  • in phase i a candidate sends two explorers in
    opposite directions
  • each explorer carriers the ID of its candidate
  • each explorer travels distance 2i and either
    dies (if it encounters a node with lower ID) or
    returns back to its candidate
  • when(if) a candidate receives back both its
    explorers, it is promoted to the next phase
  • when a candidate receives its explorers from the
    opposite directions, it becomes the leader

8
Limited travel (Hirschberg Sinclair 80)
  • Correctness
  • at least one candidate always survives phase i
    (the one with the smallest ID)
  • a candidate with will eventually become a leader
    (when 2i n)
  • at most one candidate will become leader (if a
    candidate receives both its explorers back from
    the opposite directions, they traveled the whole
    ring and there cannot be another active candidate
    left)
  • Complexity
  • at most n/2i candidates survive stage i (there
    is no candidate with lower ID within distance 2i
    )
  • a candidate in stage i spends 4x2i messages
  • therefore, the cost of one stage is 2n
  • there are log n stages
  • hence overall complexity is 8nlog n

9
Electorial stages (Franklin 80)
  • Main idea
  • works in phases, the first phase is initiated by
    the spontaneously awaken processors (candidates)
  • in phase i a candidate sends two explorers in
    opposite directions
  • each explorer carriers the ID of its candidate
    and the stage number
  • each explorer travels until it reaches another
    candidate of the same stage
  • when(if) a candidate receives explorers from
    both sides and it is the smallest, it is promoted
    to the next phase
  • when a candidate receives its explorers from the
    opposite directions, it becomes the leader
  • Assumptions
  • bidirectional, unoriented ring network, unique
    Ids
  • FIFO (will be relaxed)

10
Electorial stages (Franklin 80) II
  • Correctness
  • the candidate with the smallest ID will never be
    defeated
  • the number of candidates in each stage is halved
    by at least 2
  • show example when 2 stages are sufficient
  • show the worst case for n8
  • therefore the leader will eventually be elected
  • Complexity
  • at most log n1 phases
  • 2n messages are sent in each phase
  • total complexity 2n log n O(n)
  • Removing FIFO requirement
  • many ways, e.g. if a message of too high stage
    is received, queue it and wait for the message of
    the right stage
  • higher stage beats lower stage

11
Franklin with positive feedback
  • Main idea
  • when you receive messages from the two
    neighbouring candidates, send OK to the one with
    the smallest ID (if his ID is smaller then yours)
  • a candidate proceeds to the next stage only
    after receiving OK from both sides
  • Correctness/complexity
  • the candidate with the smallest ID is never
    defeated
  • in each stage the number of candidates is
    reduced by a factor of 3
  • the number of messages per stage is 3n
  • the overall complexity is 3nlog3n cca 1.89 n
    log n

12
Franklin in unidirectional rings
  • Main idea
  • Cannot send left? Lets the whole ring move
    right.
  • Implementation
  • each message travels to the second candidate
  • a candidate thus receives 2 messages from the
    left and plays the role of the candidate from
    which the first message arrived
  • Correctness/complexity
  • correctness follows from the bidirectional case
  • complexity 4n messages per stage, 4n log n
    overall

13
Alternate directions
  • Main idea
  • take Franklin and divide the sending to the
    right and to the left into two sub-stages
  • only the candidate which survive the first
    sub-stage are active in the second sub-stage
  • Correctness/complexity
  • correctness similarly as before
  • complexity there are at most F-1n (the first i
    such that the i-th Fibonacci number is at least
    n) sub-stages
  • there are n messages in each sub- stage
  • overall complexity is cca 1.44 n log n

14
Summary
Write a Comment
User Comments (0)
About PowerShow.com