Synchronous counting and computational algorithm design Danny Dolev - - PowerPoint PPT Presentation

synchronous counting and computational algorithm design
SMART_READER_LITE
LIVE PREVIEW

Synchronous counting and computational algorithm design Danny Dolev - - PowerPoint PPT Presentation

*010 *020 *011 *002 *221 *110 *121 Synchronous counting and computational algorithm design Danny Dolev Christoph Lenzen Hebrew University of Jerusalem MIT Janne H. Korhonen Joel Rybicki Jukka Suomela University of Helsinki &


slide-1
SLIDE 1

Synchronous counting and computational algorithm design

Janne H. Korhonen Joel Rybicki Jukka Suomela

University of Helsinki & HIIT

November 16, 2013 SSS 2013, Osaka, Japan

*002 *010 *011 *020 *110 *121 *221 *022 *100 *101 *201 *202 *210 *222

Danny Dolev

Hebrew University of Jerusalem

Christoph Lenzen

MIT

slide-2
SLIDE 2

What is this talk about?

Developing compact fault-tolerant algorithms for a consensus-like problem using computational techniques.

slide-3
SLIDE 3

Algorithm design

Ask the computer scientist: “Is there an algorithm A for problem P?”

slide-4
SLIDE 4

Algorithm design

Ask the computer scientist: “Is there an algorithm A for problem P?”

slide-5
SLIDE 5

Computational algorithm design

Ask the computer: “Is there an algorithm A for problem P?”

slide-6
SLIDE 6

Verification vs synthesis

Verification: “Check that given A satisfies the specification S.” Synthesis: “Construct an A that satisfies a specification S.”

slide-7
SLIDE 7

Searching for algorithms

How to do a computer search? Intuitively, the task seems very difficult.

slide-8
SLIDE 8

An inductive approach

“Computers are good at boring calculations. People are good at generalizing.”

  • 1. Solve a difficult base case using computers
  • 2. Construct a general solution using the base case
slide-9
SLIDE 9

Synchronous counting

slide-10
SLIDE 10

The model

  • n processors
  • s states
  • arbitrary initial state

1 2 3

4

slide-11
SLIDE 11

The model

  • n processors
  • s states
  • arbitrary initial state

Synchronous step:

  • 1. send state to all neighbors
  • 2. update state

1 2 3

4

slide-12
SLIDE 12

The model

  • n processors
  • s states
  • arbitrary initial state

Synchronous step:

  • 1. send state to all neighbors
  • 2. update state

algorithm = transition function 1 2 3

4

slide-13
SLIDE 13

Self-stabilizing counting

Stabilization Counting

4 3 2 1

slide-14
SLIDE 14

Self-stabilizing counting

A simple algorithm solves the problem

slide-15
SLIDE 15

Self-stabilizing counting

Solution: Follow the leader.

4 3 2 1

slide-16
SLIDE 16

Self-stabilizing counting

Solution: Follow the leader.

4 3 2 1

slide-17
SLIDE 17

Self-stabilizing counting

Solution: Follow the leader.

4 3 2 1

slide-18
SLIDE 18

Self-stabilizing counting

Solution: Follow the leader.

4 3 2 1

slide-19
SLIDE 19

Tolerating Byzantine failures

Assume that at most f nodes may be Byzantine.

1

2 3 4

slide-20
SLIDE 20

Tolerating Byzantine failures

Assume that at most f nodes may be Byzantine. 1

2

3 4

slide-21
SLIDE 21

Tolerating Byzantine failures

Assume that at most f nodes may be Byzantine. 1 2

3

4

slide-22
SLIDE 22

Tolerating Byzantine failures

Assume that at most f nodes may be Byzantine. 1 2 3

4

slide-23
SLIDE 23

Tolerating Byzantine failures

can send different messages to non-faulty nodes! 1 2 3

4

slide-24
SLIDE 24

Tolerating Byzantine failures

can send different messages to non-faulty nodes! Note: Easy if self-stabilization is not required! 1 2 3

4

slide-25
SLIDE 25

Fault-tolerant counting

Stabilization Counting

4 3 2 1

slide-26
SLIDE 26

The model with failures

  • n processors
  • s states
  • arbitrary initial state
  • at most f Byzantine nodes

1 2 3

4

slide-27
SLIDE 27

Some basic facts

  • How many states do we need?
  • s ≥ 2
  • How many faults can we tolerate?
  • f < n/3
  • How fast can we stabilize?
  • t > f

Pease et al., 1980 Fischer & Lynch, 1982

slide-28
SLIDE 28

Solving synchronous counting

Deterministic solutions with large s known for similar problems (e.g. D. Dolev & Hoch, 2007) Are there deterministic algorithms with small s and t? Focus on the first non-trivial case f = 1 Randomized solutions for counting with small s and large t in expectation (e.g. Shlomi Dolev’s book) Our work:

slide-29
SLIDE 29

Generalizing from a base case

For any fixed s, f and t:

There is an algorithm A for n nodes There is an algorithm B for n+1 nodes with same s, f and t

slide-30
SLIDE 30

Finding an algorithm

The size of the search space is sb where b = nsn. n = 4 s = 2 264 ≈ 1019 parameters search space

slide-31
SLIDE 31

Finding an algorithm

The size of the search space is sb where b = nsn. n = 4 s = 2 n = 4 s = 3 264 ≈ 1019 3324 ≈ 10154 parameters search space We need a clever way to do the search!

slide-32
SLIDE 32

The high-level idea

  • Express the existence of an algorithm as a finite

combinatorial problem

  • Solve a base case that implies a general solution
  • SAT solvers solve the decision problem
slide-33
SLIDE 33

SAT solving

Given a propositional formula Ψ, does there exist a satisfying variable assignment? Problem: Example 1: (x1 ∨ ¬x2 ∨ x3) ∧ (¬x1 ∨ ¬x3)

slide-34
SLIDE 34

SAT solving

Given a propositional formula Ψ, does there exist a satisfying variable assignment? Problem: Example 1:

Satisfiable! x1 = 0 x2 = 0 x3 = 1 (x1 ∨ ¬x2 ∨ x3) ∧ (¬x1 ∨ ¬x3)

slide-35
SLIDE 35

SAT solving

  • NP-hard
  • Surprisingly fast in practice
  • Complete: proves YES and NO instances
  • Several solvers available
slide-36
SLIDE 36

Verification is easy

  • Let F be a set of faulty nodes, |F| ≤ f
  • Construct a state graph GF from A:

Nodes = actual states Edges = possible state transitions

1

2 3 4

*000 *021 *110 *002 *111

slide-37
SLIDE 37

*000

*001 *002 *010 *011 *012 *020 *021 *022 *100 *101 *102 *110

*111

*112 *120 *121 *122 *200 *201 *202 *210 *211 *212 *220 *221 *222

slide-38
SLIDE 38

*002 *010 *012 *020 *021 *022 *101 *102 *110 *121 *122 *202 *210 *211 *212 *220 *221 *222

*000

*001 *011 *100

*111

*112 *120 *200 *201

execution = walk

slide-39
SLIDE 39

*000

*001 *002 *010 *011 *012 *020 *021 *022 *100 *101 *102 *110

*111

*112 *120 *121 *122 *200 *201 *202 *210 *211 *212 *220 *221 *222

slide-40
SLIDE 40

*000 *111

Even

slide-41
SLIDE 41

*000 *111

Odd

slide-42
SLIDE 42

*000

*001 *002 *010 *011 *012 *020 *021 *022 *100 *101 *102 *110

*111

*112 *120 *121 *122 *200 *201 *202 *210 *211 *212 *220 *221 *222

Easy to reason about graphs!

slide-43
SLIDE 43

*000

*001 *002 *010 *011 *012 *020 *022 *100 *101 *102 *110

*111

*112 *120 *121 *122 *200 *201 *202 *210 *211 *212 *220 *221 *222 *021

deadlock = loop

slide-44
SLIDE 44

*000

*001 *002 *010 *012 *020 *022 *100 *102 *110

*111

*112 *120 *121 *122 *200 *201 *202 *210 *211 *212 *220 *221 *222 *011 *101 *021

livelock = cycle

slide-45
SLIDE 45

Verification is easy

Every GF is good no deadlocks GF is loopless

stabilization All nodes have a path to 0

counting {0,1} is the only cycle

A is correct

slide-46
SLIDE 46

From verification to synthesis

xi,u,s Ai(u) = s

The encoding uses the following variables:

eq,r

exists

(q, r) pq,r q r xi,u,s eq,r pq,r ⇔ ⇔

edge

path exists

slide-47
SLIDE 47

Main results, f = 1

  • lower bound: no 2-state algorithm
  • upper bound: 3 states suffice

If 4 ≤ n ≤ 5: If n ≥ 6:

  • 2 states always suffice
slide-48
SLIDE 48

Summary

  • We have algorithms that use the optimal number
  • f states for any n and f = 1
  • Computational techniques useful in design of

fault-tolerant algorithms

  • Solve a base case using computers; let people

generalize

slide-49
SLIDE 49

Summary

*002 *010 *011 *020 *110 *121 *221 *022 *100 *101 *201 *202 *210 *222

Thanks!

  • We have algorithms that use the optimal number
  • f states for any n and f = 1
  • Computational techniques useful in design of

fault-tolerant algorithms

  • Solve a base case using computers; let people

generalize