A Principled Way of Designing Efficient Protocols Yoram Moses - - PowerPoint PPT Presentation

a principled way of designing efficient protocols
SMART_READER_LITE
LIVE PREVIEW

A Principled Way of Designing Efficient Protocols Yoram Moses - - PowerPoint PPT Presentation

A Principled Way of Designing Efficient Protocols Yoram Moses Technion Partly joint with Armando Castaeda and Yannai Gonczarowski SIROCCO 2016, Helsinki ( :- ) A Useful Design Principle July 19th, 2016 1 / 43 Motivation THEME SIROCCO is


slide-1
SLIDE 1

A Principled Way of Designing Efficient Protocols

Yoram Moses

Technion

Partly joint with Armando Castañeda and Yannai Gonczarowski

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 1 / 43

slide-2
SLIDE 2

Motivation

THEME

SIROCCO is devoted to the study of the interplay between communication and knowledge in multi-processor systems from both

the qualitative and quantitative viewpoints. Special emphasis is given to innovative approaches and fundamental understanding…

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 2 / 43

slide-3
SLIDE 3

Many Models of Distributed Computing

Communication: Message passing, shared memory, visual signalling Topology: Fixed, Dynamic Timing: Clocks, timing guarantees on actions and events (synchrony asynchrony, partial synchrony) Computing power: From mainframes, servers, mobile devices, low-powered sensors Failure modes, Uniqueness of ID’s, etc... No unifying “Turing-machine” model for distributed systems Lack of general results that apply to “all systems"

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 3 / 43

slide-4
SLIDE 4

Computing the Max

Example: Computing the Maximum (CtM)

75 100 80 90 1 2 3 4

Each node i has an initial value vi Agent 1 must print the maximal value After receiving “v2 = 100” Agent 1 has the maximum. Can she act?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 4 / 43

slide-5
SLIDE 5

Computing the Max

Example: Computing the Maximum (CtM)

75 100 80 90 1 2 3 4

v2=100

Each node i has an initial value vi Agent 1 must print the maximal value After receiving “v2 = 100” Agent 1 has the maximum. Can she act?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 4 / 43

slide-6
SLIDE 6

Computing the Max

Example: Computing the Maximum (CtM)

75 100 80 90 1 2 3 4

v2=100 75 100 90

1 2 3 4

v2=100

200

Each node i has an initial value vi Agent 1 must print the maximal value After receiving “v2 = 100” Agent 1 has the maximum. Can she act?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 4 / 43

slide-7
SLIDE 7

Computing the Max

Collecting Values

75 100 80 90 1 2 3 4

90

Collecting all values is not necessary Collecting all values is not sufficient: Alice might not know that she has all values

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 5 / 43

slide-8
SLIDE 8

Computing the Max

Collecting Values

75 100 80 90 1 2 3 4

90

Collecting all values is not necessary Collecting all values is not sufficient: Alice might not know that she has all values

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 5 / 43

slide-9
SLIDE 9

Computing the Max

Collecting Values

75 100 80 90 1 2 3 4

v2=100

100

Collecting all values is not necessary Collecting all values is not sufficient: Alice might not know that she has all values

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 5 / 43

slide-10
SLIDE 10

Computing the Max

Collecting Values

75 100 80 90 1 2 3 4

100,80,90

Collecting all values is not necessary Collecting all values is not sufficient: Alice might not know that she has all values

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 5 / 43

slide-11
SLIDE 11

Computing the Max

Collecting Values

75 100 90

1 2 3 4

100,80,90

80

200

5

75 100 80 90 1 2 3 4

100,80,90

Collecting all values is not necessary Collecting all values is not sufficient: Alice might not know that she has all values

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 5 / 43

slide-12
SLIDE 12

Computing the Max

What is CtM about if not collecting values?

Knowledge

Knowing that Max = c is necessary and sufficient for printing c.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 6 / 43

slide-13
SLIDE 13

Knowledge of Preconditions

Knowing that Max = c can depend on: Messages received The agents’ protocol The domain of possible initial values The network topology Timing guarantees re: communication, synchrony, activation Possibility of failures, . . . Needing to know the maximum is an instance of a general principle

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 7 / 43

slide-14
SLIDE 14

Knowledge of Preconditions

The Knowledge of Preconditions Principle (KoP)

If ϕ must be true when i performs α Then Kiϕ must be true when i performs α Then is a prerequisite for

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 8 / 43

slide-15
SLIDE 15

Knowledge of Preconditions

The Knowledge of Preconditions Principle (KoP)

If ϕ must be true when i performs α Then Kiϕ must be true when i performs α If good credit is a prerequisite for ATM payment Then Katm(credit) is a prerequisite for ATM payment

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 8 / 43

slide-16
SLIDE 16

Knowledge of Preconditions

The Knowledge of Preconditions Principle (KoP)

If ϕ must be true when i performs α Then Kiϕ must be true when i performs α If Empty Critical Section is a prerequisite for i entering the CS Then Ki(empty CS) is a prerequisite for i entering the CS

This is useful for analyzing Mutual Exclusion [M.&Patkin 2015]

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 8 / 43

slide-17
SLIDE 17

Knowledge of Preconditions

The Knowledge of Preconditions Principle (KoP)

If ϕ must be true when i performs α Then Kiϕ must be true when i performs α If Alice has moved is a prerequisite for Bob’s move Then KBob(Alice has moved) is a prerequisite for Bob’s move

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 8 / 43

slide-18
SLIDE 18

Knowledge of Preconditions

The Knowledge of Preconditions Principle (KoP)

If ϕ must be true when i performs α Then Kiϕ must be true when i performs α

All standard specifications are epistemic: Knowledge is a prerequisite for action This is a fundamental theorem of multi-agent systems

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 9 / 43

slide-19
SLIDE 19

Modeling Knowledge in Distributed Systems

A Theory of Knowledge in Distributed Systems

A three decades old theory of knowledge is based on Kripke 1950’s, Hintikka [1962], Aumann [1976] Halpern and M. [1984] Parikh and Ramanujam [1985] Chandy and Misra [1986] Fagin et al. [1995], Reasoning about Knowledge

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 10 / 43

slide-20
SLIDE 20

Modeling Knowledge in Distributed Systems

Basic notion: Indistinguishability r r0

i

i has the same state at both points

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 11 / 43

slide-21
SLIDE 21

Modeling Knowledge in Distributed Systems

Basic notion: Indistinguishability r r0

1

Max = 100

true at an indistinguishable point ⇔ possible

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 11 / 43

slide-22
SLIDE 22

Modeling Knowledge in Distributed Systems

Basic notion: Indistinguishability

print1(100)

r r0

1

X

Max = 100

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 11 / 43

slide-23
SLIDE 23

Modeling Knowledge in Distributed Systems

Defining Knowledge in Pictures r r0

i i i

r00 r000

  • SIROCCO 2016,

Helsinki (:-) A Useful Design Principle July 19th, 2016 12 / 43

slide-24
SLIDE 24

Modeling Knowledge in Distributed Systems

Defining Knowledge in Pictures r r0

i i i

r00 r000

  • SIROCCO 2016,

Helsinki (:-) A Useful Design Principle July 19th, 2016 12 / 43

slide-25
SLIDE 25

Modeling Knowledge in Distributed Systems

Defining Knowledge in Pictures r r0

i i i

r00 r000

  • Ki

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 12 / 43

slide-26
SLIDE 26

Modeling Knowledge in Distributed Systems

Defining Knowledge in Pictures ¬ r r0

i i i

r00 r000

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 12 / 43

slide-27
SLIDE 27

Modeling Knowledge in Distributed Systems

Defining Knowledge in Pictures ¬Ki ¬ r r0

i i i

r00 r000

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 12 / 43

slide-28
SLIDE 28

Modeling Knowledge in Distributed Systems

Defining Knowledge more formally

[Fagin et al. 1995]

A run is a sequence r ∶ N → G

  • f global states.

A system is a set R of runs. Assumption Each global state r(t) determines a local state ri(t) for every agent i. Definition (R,r,t) ⊧ Kiϕ iff (R,r ′,t′) ⊧ ϕ for all points (r ′,t′) of R such that ri(t) = r ′

i (t′).

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 13 / 43

slide-29
SLIDE 29

Runs and points

(r,0) (r,1) (r,2) (r,3) (r,4) (r,t)      

A point (r,t) refers to time t in run r. Facts are "true" or "false" at a point. R × N = Pts(R) is the set of points in system R.

slide-30
SLIDE 30

Modeling Knowledge in Distributed Systems

A Propositional Logic of Knowledge

Starting from a set Φ of primitive propositions, define LK

n = LK n (Φ) by

ϕ ∶= p ∈Φ ∣ ¬ϕ ∣ ϕ ∧ ϕ ∣ K1ϕ ∣ ⋯ ∣ Knϕ Given an interpretation π ∶ Φ × Pts(R) → {True,False} (R,r,t) ⊧ p, for p ∈ Φ, iff π(p,r,t) = True. (R,r,t) ⊧ ¬ϕ iff (R,r,t) / ⊧ ϕ (R,r,t) ⊧ ϕ ∧ ψ iff both (R,r,t) ⊧ ϕ and (R,r,t) ⊧ ψ.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 15 / 43

slide-31
SLIDE 31

Modeling Knowledge in Distributed Systems

Knowledge = Truth in All Possible Worlds

(R,r,t) ⊧ Kiϕ iff (R,r ′,t′) ⊧ ϕ for all points (r ′,t′) of R such that ri(t)=r ′

i (t′).

Comments: The definition ignores the complexity of computing knowledge Local information = current local state. Kiϕ holds if ϕ is guaranteed to hold in R given i’s local state. The knowledge operator Ki is an S5 modal operator.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 16 / 43

slide-32
SLIDE 32

Modeling Knowledge in Distributed Systems

Knowledge = Truth in All Possible Worlds

(R,r,t) ⊧ Kiϕ iff (R,r ′,t′) ⊧ ϕ for all points (r ′,t′) of R such that ri(t)=r ′

i (t′).

Comments: The definition ignores the complexity of computing knowledge Local information = current local state. Kiϕ holds if ϕ is guaranteed to hold in R given i’s local state. The knowledge operator Ki is an S5 modal operator.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 16 / 43

slide-33
SLIDE 33

Necessary Conditions for Actions

(aka “preconditions”)

Max = c is a necessary condition for print1(c) in CtM. Definition ψ is a necessary condition for doesi(α) in R if (R,r,t) ⊧ doesi(α) ⇒ ψ for all (r,t) ∈ Pts(R). Specifications impose necessary conditions: “Good credit” is necessary for ATM dispensing cash “CS is empty” is necessary for entering the CS in Mutual Exclusion

slide-34
SLIDE 34

Knowledge and Coordination

Knowledge of Preconditions

Definition α is a conscious action for i in R if (R,r,t) ⊧ doesi(α) & r ′

i (t′) = ri(t)

implies (R,r ′,t′) ⊧ doesi(α) Theorem (KoP, [M. 2015]) Suppose that α is a conscious action for i in the system R. If ϕ is a necessary condition for doesi(α) in R, then Kiϕ is a necessary condition for doesi(α) in R.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 18 / 43

slide-35
SLIDE 35

Knowledge and Coordination

Proof of KoP

r r0

doesi(α)

, doesi(α) , doesi(α) , doesi(α) Kiϕ

r00 r000

α is a conscious action for i ϕ is a necessary condition for doesi(α)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 19 / 43

slide-36
SLIDE 36

Knowledge and Coordination

Proof of KoP

r r0

i i i

doesi(α)

, doesi(α) , doesi(α) , doesi(α) Kiϕ

r00 r000

α is a conscious action for i ϕ is a necessary condition for doesi(α)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 19 / 43

slide-37
SLIDE 37

Knowledge and Coordination

Proof of KoP

r r0

i i i

doesi(α)

, doesi(α) , doesi(α) , doesi(α) Kiϕ

r00 r000

α is a conscious action for i ϕ is a necessary condition for doesi(α)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 19 / 43

slide-38
SLIDE 38

Knowledge and Coordination

Proof of KoP

r r0

i i i

doesi(α)

, doesi(α) , doesi(α) , doesi(α) Kiϕ

r00 r000

,

α is a conscious action for i ϕ is a necessary condition for doesi(α)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 19 / 43

slide-39
SLIDE 39

Knowledge and Coordination

Proof of KoP

r r0

i i i

doesi(α)

, doesi(α) , doesi(α) , doesi(α) Kiϕ

r00 r000

α is a conscious action for i ϕ is a necessary condition for doesi(α)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 19 / 43

slide-40
SLIDE 40

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

. . . . . .

a complete communication graph with n nodes

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-41
SLIDE 41

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

. . . . . .

each process i starts with an initial “vote” vi ∈ {0,1}

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-42
SLIDE 42

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

. . . . . .

a discrete global clock, messages take 1 round

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-43
SLIDE 43

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

full-information protocol (fip): Processes broadcast their complete history

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-44
SLIDE 44

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1

full-information protocol (fip): Processes broadcast their complete history

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-45
SLIDE 45

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1 1

full-information protocol (fip): Processes broadcast their complete history

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-46
SLIDE 46

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1 1 1

crash failures

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-47
SLIDE 47

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1 1 1

x x

crash failures

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-48
SLIDE 48

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1 1 1

x x

crash failures: at most t < n processes fail per run

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-49
SLIDE 49

Deriving Efficient Protocols

An Application: Distributed Consensus

Model:

1 2 3 4 5 . . . . . .

1 1 1 1 1 1 1 1 1 1

i

1 2 3

n

.

1 1 1

a process is correct in r if it doesn’t crash

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 20 / 43

slide-50
SLIDE 50

Deriving Efficient Protocols

Consensus

Protocol Specification: In every run with no more than t processes crashes: Decision: Every correct process must decide on some value Validity: decidei(v) is allowed only if someone voted v (“∃v”) Agreement: All correct processes decide on the same value correct = does not crash

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 21 / 43

slide-51
SLIDE 51

Deriving Efficient Protocols

t + 1 round Lower Bound

Theorem (Dolev-Strong ’82, Fischer-Lynch ’82) Every consensus protocol must have a (worst-case) run in which the last correct process requires at least t + 1 rounds to decide.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 22 / 43

slide-52
SLIDE 52

Deriving Efficient Protocols

A Knowledge-based Analysis: Deciding on 0

Validity: A necessary condition for decidei(v) is ∃v, for v = 0,1 By Validity, ∃0 is a necessary condition for decidei(0). By KoP, Ki∃0 is a necessary condition for decidei(0).

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 23 / 43

slide-53
SLIDE 53

Deriving Efficient Protocols

Knowing ∃0

1 2 3 4 6 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

Kj∃0 Kj∃0

5

Kh∃0

Kj∃0 holds if vj = 0 or j received a message from a process that knows ∃0.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-54
SLIDE 54

Deriving Efficient Protocols

Knowing ∃0

¬Ki∃0 Kj∃0

How can one proc know ∃0 when another does not?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-55
SLIDE 55

Deriving Efficient Protocols

Knowing ∃0

¬Ki∃0 Kj∃0

How can one proc know ∃0 when another does not?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-56
SLIDE 56

Deriving Efficient Protocols

Knowing ∃0

¬Ki∃0 Kj∃0 ¬Kj∃0

How can one proc know ∃0 when another does not?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-57
SLIDE 57

Deriving Efficient Protocols

Knowing ∃0

¬Ki∃0 Kj∃0 ¬Kj∃0 Kj∃0

How can one proc know ∃0 when another does not?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-58
SLIDE 58

Deriving Efficient Protocols

Knowing ∃0

¬Ki∃0 Kj∃0 ¬Kj∃0

x x

Kj∃0

How can one proc know ∃0 when another does not?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-59
SLIDE 59

Deriving Efficient Protocols

Knowing ∃0

1 2 3 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0 ¬Kj∃0

x

Kj∃0

m SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-60
SLIDE 60

Deriving Efficient Protocols

Knowing ∃0

1 2 3 . . . . . .

x

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0

m SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-61
SLIDE 61

Deriving Efficient Protocols

Knowing ∃0

1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0

x x x x x x x x x x x x x x x

m 3

Claim: If Kj∃0 & ¬Ki∃0 at time m, then ≥ m crashes have occurred

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-62
SLIDE 62

Deriving Efficient Protocols

Knowing ∃0

1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0

x x x x x x x x x x x x x x x

m 3

Corollary: At time t + 1, either everyone knows ∃0 or nobody does

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 24 / 43

slide-63
SLIDE 63

Deriving Efficient Protocols

A Simple Consensus Protocol

Protocol P0 (for undecided process i): if time = t + 1 & ¬Ki∃0 then decidei(0) elseif time = t + 1 & ¬Ki∃0 then decidei(1) Communication is according to the fip. Optimal: All decisions at time t + 1

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 25 / 43

slide-64
SLIDE 64

Deriving Efficient Protocols

A Better Protocol

Protocol Q0 (for undecided process i): if Ki∃0 then decidei(0) elseif time = t + 1 & ¬Ki∃0 then decidei(1) Optimal: All decisions by time t + 1

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 26 / 43

slide-65
SLIDE 65

Deriving Efficient Protocols

Q0 Dominates P0

An adversary is a pair β = (V ,F) V = (v1,...,vn) determines the initial values F is the failure pattern — who crashes, when, and how Definition Protocol P′ dominates protocol P if, for all adv. β, process i and time k, if i decides at time k in P[β] then it decides by time k in P′[β]. Claim Q0 strictly dominates P0. Can Q0 be dominated?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 27 / 43

slide-66
SLIDE 66

Deriving Efficient Protocols

Adversaries

Time of last decision 1 2 t+1

P0 Q0

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 28 / 43

slide-67
SLIDE 67

Deriving Efficient Protocols

Adversaries

Time of last decision 1 2 t+1

P0 Q0

1

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 28 / 43

slide-68
SLIDE 68

Deriving Efficient Protocols

Q0 Dominates P0

An adversary is a pair β = (V ,F) V = (v1,...,vn) determines the initial values F is the failure pattern — who crashes, when, and how Definition Protocol P′ dominates protocol P if, for all adv. β, process i and time k, if i decides at time k in P[β] then it decides by time k in P′[β]. Claim Q0 strictly dominates P0. Can Q0 be dominated?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 29 / 43

slide-69
SLIDE 69

Deriving Efficient Protocols

A Knowledge-based Analysis: Deciding on 1

Suppose the rule for deciding 0 is Kj∃0⇔decidej(0). When can decidei(1) be performed? Recall: Agreement: All correct processes decide on the same value By Agreement, “no currently active process decides 0” is a necessary condition for decidei(1); so ψ = “no active process knows ∃0” is a nec. cond. for decidei(1); By the KoP, Ki(nobody_knows∃0) is a necessary condition for decidei(1).

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 30 / 43

slide-70
SLIDE 70

Deriving Efficient Protocols

An Unbeatable Consensus Protocol

[Castañeda, Gonczarowski & M. ’14]

Protocol OPT0 (for undecided process i): if Ki∃0 then decidei(0) elseif Ki(nobody_knows∃0) then decidei(1) By the KoP: decidei(0) is performed as soon as possible decidei(1) is performed asap, given the rule for decide(0)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 31 / 43

slide-71
SLIDE 71

Deriving Efficient Protocols

An Unbeatable Consensus Protocol

[Castañeda, Gonczarowski & M. ’14]

Protocol OPT0 (for undecided process i): if Ki∃0 then decidei(0) elseif Ki(nobody_knows∃0) then decidei(1) By the KoP: decidei(0) is performed as soon as possible decidei(1) is performed asap, given the rule for decide(0)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 31 / 43

slide-72
SLIDE 72

Deriving Efficient Protocols

Implemented OPT0

[Castañeda, Gonczarowski & M. ’14]

Protocol OPT0 (for undecided process i): if Ki∃0 then decidei(0) elseif Ki(nobody_knows∃0) then decidei(1) My name is Sherlock Holmes. It is my business to know what other people don’t know.

The Adventure of the Blue Carbuncle, 1892

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 32 / 43

slide-73
SLIDE 73

Deriving Efficient Protocols

Implementing OPT0

Protocol OPT0 (for undecided process i): if Ki∃0 then decidei(0) elseif Ki(nobody_knows∃0) then decidei(1) To test for Ki(nobody_knows∃0), recall the analysis of Kj∃0&¬Ki∃0

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 33 / 43

slide-74
SLIDE 74

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0

x x x x x x x x x x x x x x x

m 3 SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-75
SLIDE 75

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0 Kj∃0

x x x x x x x x x x x x x x x

m 3

Ki(nobody_knows∃0) does not hold

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-76
SLIDE 76

Deriving Efficient Protocols

Kj∃0?

1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

¬Ki∃0

x x x x x x x x x x x x x x x

m 3

? ? ? ? ?

?

The world according to i

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-77
SLIDE 77

Deriving Efficient Protocols

Kj∃0?

1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m 3

? ? ? ? ?

?

¬Ki∃0

Process i’s view contains a hidden path

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-78
SLIDE 78

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m 3

? ? ? ? ?

?

?

x

?

x x x x

¬Ki∃0 Kj∃0?

Each node ⟨h,k⟩ is seen, crashed or hidden w.r.t. ⟨i,m⟩

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-79
SLIDE 79

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m

? ?

?

x x x x

k

x x x x x x

? ?

x

¬Ki∃0 Kj∃0?

Time k is revealed at ⟨i,m⟩ if all nodes ⟨h,k⟩ are not hidden

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-80
SLIDE 80

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m

? ?

?

x x x x

k

x x x x x x

? ?

x

¬Ki∃0 Kj∃0?

If time k is revealed and ¬Ki∃0 then ¬Kj∃0

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-81
SLIDE 81

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m

? ?

?

x x x x

k

x x x x x x

? ?

x Ki(nobody knows∃0)

Kj∃0?

If time k is revealed and ¬Ki∃0 then Ki(nobody_knows∃0)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-82
SLIDE 82

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m

? ?

?

x x x x

k

x x x x x x

? ?

x Ki(nobody knows∃0)

Kj∃0?

Ki(nobody_knows∃0) iff some time k is revealed and ¬Ki∃0

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-83
SLIDE 83

Deriving Efficient Protocols 1 2 . . . . . .

1 1 1 1 1 1 1 1 1 1

j i

1 2 3

n

.

x x x x x x x x x x x x x x x

m

? ?

?

x x x x

k

x x x x x x

? ?

x Ki(nobody knows∃0)

Kj∃0?

Ki(nobody_knows∃0) iff some time k is revealed and ¬Ki∃0

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 34 / 43

slide-84
SLIDE 84

Deriving Efficient Protocols

A Standard Protocol for OPT0

[Castañeda, Gonczarowski & M. ’14]

Standard OPT0 (for undecided process i): if seen 0 then decidei(0) elseif some time k is revealed to i then decidei(1) Theorem (CGM) OPT0 dominates Q0 No consensus protocol dominates OPT0 (it is unbeatable) OPT0 implementable using O(logn) bit messages on average

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 35 / 43

slide-85
SLIDE 85

Deriving Efficient Protocols

Another Example

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 36 / 43

slide-86
SLIDE 86

Deriving Efficient Protocols

Another Example: Majority Consensus

In addition to Decision, Validity and Agreement, we require: Majority Rule: A correct process will decide 0 if it discovers ≥ n/2 of the votes are 0 decide 1 if it discovers > n/2 of the votes are 1

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 37 / 43

slide-87
SLIDE 87

Deriving Efficient Protocols

All-case Optimal Majority Consensus

Standard OPTmc (for undecided process i): if seen ≥n/2 votes of 0 then decidei(0) elseif seen >n/2 votes of 1 then decidei(1) elseif some time k is revealed to i & seen more votes for v than 1 − v then decidei(v)

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 38 / 43

slide-88
SLIDE 88

Deriving Efficient Protocols

Majority Consensus

Kj(Maj = 0)? 1 2 . . . . . .

1 1 1 1 1 ? 1 1 1

j

i

1 2 3

n

.

x x x x x x x x x x x x x x x

m 3

? ? ? ? ?

?

? ? ? ?

i

A hidden path can report all of the unknown votes Kj(Maj = 1)?

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 39 / 43

slide-89
SLIDE 89

Deriving Efficient Protocols

All-case Optimality

Theorem (CGM) The protocol OPTmc: solves Majority Consensus dominates all protocols for Majority Consensus decides in ≤ f + 1 rounds (aka “early stopping”) is implementable using O(logn) bit messages on average Treats “0” and “1” fairly

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 40 / 43

slide-90
SLIDE 90

Deriving Efficient Protocols

Adversaries

Time of last decision 1 2 t+1

OPTmc

1

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 41 / 43

slide-91
SLIDE 91

Deriving Efficient Protocols

KoP Revisited

The KoP is a universal theorem for distributed systems KoP applies more generally:

Suppose that a legal system satisfies that Judge punishes X only if X committed the crime. By KoP, when deciding to punish the judge must know that X committed the crime. A jellyfish does not sting its own body. By KoP the jellyfish cell must know not my body when it launches a sting. Consider a (Turing) machine that will perform accept on a word x ∈ {0,1}∗ only if x ∈ L for a given language L. Then the TM head must know, based on the current state and the letter seen on the tape, that x ∈ L.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 42 / 43

slide-92
SLIDE 92

Deriving Efficient Protocols

KoP Revisited

The KoP is a universal theorem for distributed systems KoP applies more generally:

Suppose that a legal system satisfies that Judge punishes X only if X committed the crime. By KoP, when deciding to punish the judge must know that X committed the crime. A jellyfish does not sting its own body. By KoP the jellyfish cell must know not my body when it launches a sting. Consider a (Turing) machine that will perform accept on a word x ∈ {0,1}∗ only if x ∈ L for a given language L. Then the TM head must know, based on the current state and the letter seen on the tape, that x ∈ L.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 42 / 43

slide-93
SLIDE 93

Deriving Efficient Protocols

KoP Revisited

The KoP is a universal theorem for distributed systems KoP applies more generally:

Suppose that a legal system satisfies that Judge punishes X only if X committed the crime. By KoP, when deciding to punish the judge must know that X committed the crime. A jellyfish does not sting its own body. By KoP the jellyfish cell must know not my body when it launches a sting. Consider a (Turing) machine that will perform accept on a word x ∈ {0,1}∗ only if x ∈ L for a given language L. Then the TM head must know, based on the current state and the letter seen on the tape, that x ∈ L.

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 42 / 43

slide-94
SLIDE 94

Deriving Efficient Protocols

Conclusions

KoP formally relates knowledge and action Protocol specifications induce epistemic conditions Knowledge is an essential aspect of distributed protocols Knowledge-based analysis facilitates design of efficient protocols Diverse applications including VLSI, Biology, real-time coordination and more

Thank You!

SIROCCO 2016, Helsinki (:-) A Useful Design Principle July 19th, 2016 43 / 43