Distributed Algorithms - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Distributed Algorithms

Description:

Other building-block algorithms: Atomic Memory, Mutual Exclusion, Logical time / Synchronizers ... wait-free distributed implementation A' of algorithm A ... – PowerPoint PPT presentation

Number of Views:172
Avg rating:3.0/5.0
Slides: 37
Provided by: sgil4
Category:

less

Transcript and Presenter's Notes

Title: Distributed Algorithms


1
Distributed Algorithms
  • A Scattered Survey
  • Seth Gilbert

2
Overview
  • Introduction
  • Models
  • Algorithms
  • Formal Methods

3
Introduction
  • What is a distributed algorithm?
  • Why study distributed algorithms?
  • Is it practical?
  • Examples
  • TCP/IP, ethernet, Napster/Gnutella, NFS, Amazon

4
Model Basics
5
Model Basics - Anonymous
6
Model Basics Unique IDs
12
7
88
40
2
9
31
25
4
7
Model Basics - Network
12
7
88
40
2
9
9
31
25
4
8
Model Basics - Unidirectional
12
7
88
40
2
9
31
25
4
9
Model Basics - Ring
12
7
88
40
2
9
31
25
4
10
Model Basics Shared Memory
7
88
40
read/write
2
A
9
9
31
25
B
11
Synchronous Model
Network
i
j
time td
time t
Clock
12
Asynchronous Model
Network
i
j
time t???
time t
Clock
13
Partially Synchronous Models
  • Many different models
  • Good clocks / unbounded communication
  • Eventually synchronous
  • Some communication links good
  • Failure Detectors
  • Eventual notification of failures

14
Algorithms Overview
  • Leader Election
  • Shortest Path
  • Consensus
  • Other building-block algorithms
  • Atomic Memory, Mutual Exclusion, Logical time /
    Synchronizers
  • Note no randomization!!

15
1. Leader Election
  • Assumptions
  • Ring topology
  • Synchronous network
  • No failures
  • Goal
  • Exactly one process says, I am the leader

16
Leader Election Basics
  • Impossible without unique IDs
  • Symmetry
  • Randomization helps
  • Impossible with any failures
  • ring topology

17
Basic Algorithm
  • Send ID to the right
  • Remember largest ID and resend
  • Discard smaller IDs
  • Time O(n) rounds
  • Message complexity O(n2)

18
Better Algorithm
  • Goal O(n log n) messages
  • Add time-to-live to ID
  • Proceed by levels
  • TTL 2, TTL 4, TTL 8,
  • log(n) rounds
  • O(n) messages each round
  • Optimal for comparison-based algorithms

19
Algorithms
  • Basic
  • Time O(n) rounds
  • Message complexity O(n2)
  • More Complicated
  • Time O(n) rounds
  • Message complexity O(n log n)

20
Lower Bounds Messages
  • Comparison based algorithms
  • O(n log n) messages
  • In general
  • O(n) messages
  • Asynchronous Networks
  • O(n log n)

21
2. Shortest Path Routes
  • Input
  • Connected, undirected graph
  • Destination
  • Output
  • Shortest route to destination
  • Model Self-Stabilizing
  • Asynchronous
  • Arbitrary failures! (e.g. corrupt state)
  • Eventual stabilization

22
Bellman-Ford
  • Every so often
  • Ask all neighbors distance
  • Set distance to minimum
  • Destination always distance0
  • Stabilizes after n rounds

23
3. Consensus
  • Input
  • 1 or 0 to each node
  • Output
  • Agreement all nodes decide either 0 or 1
  • Termination all nodes eventually decide
  • Validity if all inputs 1, then decide 1

24
Motivation
  • Many problems equivalent to consensus
  • Read-Modify-Write Memory
  • Database commit
  • Transactional filesystem
  • Totally ordered broadcast
  • Distributed firing squad

25
Universality Result
  • Assume consensus service
  • Assume non-fault tolerant sequential algorithm
    (data object) A
  • Then
  • There exists a faul-tolerant, wait-free
    distributed implementation A of algorithm A

26
Asynchronous Consensus
  • Assume 1 stopping failure
  • Impossible! FLP 1985
  • If consensus algorithm C guarantees agreement and
    validity
  • Then
  • There exists an execution of C that does not
    terminate

27
More Consensus Models
  • Synchronous
  • f1 rounds if f failures
  • Asynchronous plus eventual sychrony
  • eventual synchronized clocks
  • eventual message delivery bound d
  • Consensus terminates
  • O((f4)d) after stabilization

28
Failure Detectors
  • Assume total asynchrony
  • Assume failure detector service
  • Notifies node i when node j fails
  • Eventually
  • Allow solving consensus
  • Weakest failure-detector?
  • Leader-election failure-detector

29
Types of Failure Detectors
  • All failed nodes suspected?
  • All correct nodes not suspected?
  • One correct node not suspected?
  • Eventually Perfect 1 2
  • Eventually Correct 1 3
  • Eventual Leader 3

30
Byzantine Consensus
  • What if some nodes lie?
  • Synchronous model
  • f stopping failures
  • n nodes
  • 2f1 n

31
Other Consensus Problems
  • Weak Consensus
  • not feasible
  • Weak Byzantine Consensus
  • not feasible
  • k-set Consensus
  • fltk gt feasible
  • Approximate Consensus

32
Current Research
  • Dynamic Networks
  • Joins / Leaves / Failures
  • Peer-to-Peer networks
  • Mobile networks
  • Unknown participants
  • Large scale networks
  • Data warehouses
  • Internet sized applications
  • Non-blocking, wait-free implementations

33
Formal Methods
  • IOA Language and compiler
  • Simulator
  • Proof tools
  • Larch Prover
  • Daikon invariant detection
  • Java code generator (in progress)

34
Summary of Results
35
Summary of Results
36
The End
37
Backup Slides
38
Models
  • Nodes
  • bounded / unbounded
  • unique ids
  • known / unknown participants
  • Communication
  • Network links
  • known / unknown topology
  • Shared memory

39
Atomic Memory
  • Definition
  • Motivation
  • Algorithms?

40
Mutual Exclusion
  • Dijkstra
  • Dining Philosophers
  • Resource Allocation
Write a Comment
User Comments (0)
About PowerShow.com