Distributed Gossip Protocols Krzysztof R. Apt CWI and University of - - PowerPoint PPT Presentation
Distributed Gossip Protocols Krzysztof R. Apt CWI and University of - - PowerPoint PPT Presentation
Distributed Gossip Protocols Krzysztof R. Apt CWI and University of Amsterdam Based on joint work with Wiebe van der Hoek and Davide Grossi Anyone who has obeyed nature by transmitting a piece of gossip experiences the explosive relief that
Anyone who has obeyed nature by transmitting a piece of gossip experiences the explosive relief that accompanies the satisfying of a primary need. Primo Levi
Krzysztof R. Apt Distributed Gossip Protocols
Gossip Protocols
Example n people, each knows a secret. How many phone calls are necessary before everybody knows every secret? In each call all secrets are exchanged. Theorem (many authors, early seventies) At least 2n − 4 calls are needed.
Krzysztof R. Apt Distributed Gossip Protocols
A solution with 4 calls for n = 4
A call: (a, b). A = {a, b, c, d}. Take the sequence (a, b), (c, d), (a, d), (b, c). After it a, b, c, d know all the secrets.
Krzysztof R. Apt Distributed Gossip Protocols
A solution with 4 calls for n = 4
A call: (a, b). A = {a, b, c, d}. Take the sequence (a, b), (c, d), (a, d), (b, c). After it a, b, c, d know all the secrets. Note that the sequence (a, b), (b, c), (c, d), (d, a) does not do the job.
Krzysztof R. Apt Distributed Gossip Protocols
A solution with 2n − 4 calls for n ≥ 4
Let A = {a, b, c, d, i1, . . ., in−4}. Take the sequence (a, i1), (a, i2), . . ., (a, in−4). After it a knows all the secrets of i1, . . ., in−4. Follow it by the sequence (a, b), (c, d), (a, d), (b, c). After it a, b, c, d know all the secrets. Follow it by the sequence (a, i1), (a, i2), . . ., (a, in−4). After it all the agents know all the secrets. Note This is a centralized algorithm.
Krzysztof R. Apt Distributed Gossip Protocols
Gossip Algorithms
A vast area.
Krzysztof R. Apt Distributed Gossip Protocols
Gossip Algorithms
A vast area. (Hedetniemi, Hedetniemi and Liestman, ’88) A survey of gossiping and broadcasting in communication networks. It has 135 references.
Krzysztof R. Apt Distributed Gossip Protocols
Gossip Algorithms
A vast area. (Hedetniemi, Hedetniemi and Liestman, ’88) A survey of gossiping and broadcasting in communication networks. It has 135 references. Distributed gossip protocols: each agent acts autonomously, by passing on the gossips it knows and/or by soliciting gossips it does not know.
Krzysztof R. Apt Distributed Gossip Protocols
Distributed Gossip Protocols based on Epistemic Logic
Assumptions (Attamah, Van Ditmarsch, Grossi and Van der Hoek, ’14). Agents and secrets.
◮ A finite set A of at least two agents. ◮ Each agent holds a secret.
Agent’s a secret denoted by A.
◮ Each secret is viewed a distinct propositional variable. ◮ P: the set of all secrets.
Types of calls.
◮ ab−: every agent c = a, b noted that a called b, ◮ ab0: every agent c = a, b noted that some call took place,
though not between whom,
◮ ab+: no agent c = a, b noted that the call between a and b took place
(considered here).
In all three cases no agent c = a, b learns the contents of the call.
- Intuition. The superscript indicates the degree of privacy of the call:
− < 0 < +.
Krzysztof R. Apt Distributed Gossip Protocols
Syntax
Epistemic formulas φ ::= Fap | ¬φ | φ ∧ φ | Kaφ, where a ∈ A and p ∈ P. Intuition. Fap is a primitive formula: agent a is familiar with (knows) secret p.
Krzysztof R. Apt Distributed Gossip Protocols
Syntax, ctd (modelled after CSP [Hoare ’78])
Component program for an agent a: ∗[[]m
j=1 φj → Sj],
where each φj is an epistemic formula, each Sj is a call in which agent a is the caller. Abbreviations: φ1 → S, . . ., φk → S to k
i=1 φi → S,
φ1 → S1, . . ., φk → Sk to []k
j=1 φj → Sj.
Example ∗[k
i=1 φi → S
[]m
j=1 ψj → Tj
].
Krzysztof R. Apt Distributed Gossip Protocols
Modes of Communication
push, ⊲, pull, ⊳, push-pull, ab or (a, b). In [ADGH14] only push-pull was considered.
Krzysztof R. Apt Distributed Gossip Protocols
Symmetric Protocols
Component program: a protocol executed by an individual agent. Distributed protocol: a parallel composition of component programs. Symmetric protocol: a composition of the component programs that are identical modulo the names of the agents. Formally. Consider π(x), where x ranges over A, such that for each a ∈ A, π(a) is a component program for agent a. Then the parallel composition of π(a), where a ∈ A, is a symmetric gossip protocol.
Krzysztof R. Apt Distributed Gossip Protocols
Example Protocol
Consider the agents 1, 2, . . ., n arranged in a ring, where n ≥ 3. Program for agent i: ∗[¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. Agent i calls his successor, i ⊕ 1, if i does not know whether his successor knows the secret of i’s predecessor, i ⊖ 1.
Krzysztof R. Apt Distributed Gossip Protocols
Example Protocol, ctd
Program for agent i: ∗[¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)].
Krzysztof R. Apt Distributed Gossip Protocols
Example Protocol, ctd
Program for agent i: ∗[¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. This protocol is not correct.
Krzysztof R. Apt Distributed Gossip Protocols
Example Protocol, ctd
Program for agent i: ∗[¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. This protocol is not correct. The sequence of calls ab, bc, cd, de, ea, ab results in a termination.
Krzysztof R. Apt Distributed Gossip Protocols
Example Protocol, ctd
Program for agent i: ∗[¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. This protocol is not correct. The sequence of calls ab, bc, cd, de, ea, ab results in a termination. However, at this point agent c does not know the secret of agent e.
Krzysztof R. Apt Distributed Gossip Protocols
Semantics (` a la [ADGH14])
Gossip situation: ((Qa)a∈A), where ∀a Qa ⊆ P.
- Intuition. Qa is the set of secrets a knows.
Initial gossip situation: Each Qa equals {A}.
- Intuition. Initially each agent knows only his own secret.
Krzysztof R. Apt Distributed Gossip Protocols
Transformation of the Gossip Situations
Each call transforms the current gossip situation by adjusting the relevant Qi relations.
Krzysztof R. Apt Distributed Gossip Protocols
Transformation of the Gossip Situations
Each call transforms the current gossip situation by adjusting the relevant Qi relations. ab(G) = G ′, where Q′
a = Q′ b = Qa ∪ Qb,
Q′
c = Qc for c = a, b,
Krzysztof R. Apt Distributed Gossip Protocols
Transformation of the Gossip Situations
Each call transforms the current gossip situation by adjusting the relevant Qi relations. ab(G) = G ′, where Q′
a = Q′ b = Qa ∪ Qb,
Q′
c = Qc for c = a, b,
(a ⊲ b)(G) = G ′, where Q′
b = Qa ∪ Qb,
Q′
a = Qa,
Q′
c = Qc for c = a, b,
Krzysztof R. Apt Distributed Gossip Protocols
Transformation of the Gossip Situations
Each call transforms the current gossip situation by adjusting the relevant Qi relations. ab(G) = G ′, where Q′
a = Q′ b = Qa ∪ Qb,
Q′
c = Qc for c = a, b,
(a ⊲ b)(G) = G ′, where Q′
b = Qa ∪ Qb,
Q′
a = Qa,
Q′
c = Qc for c = a, b,
(a ⊳ b)(G) = G ′, where Q′
a = Qa ∪ Qb,
Q′
b = Qb,
Q′
c = Qc for c = a, b.
Krzysztof R. Apt Distributed Gossip Protocols
Example
Consider three agents, a, b, c and the sequence of three calls bc, ac, bc. In the initial gossip situation Qa = {A}, Qb = {B}, Qc = {C}.
Krzysztof R. Apt Distributed Gossip Protocols
Example
Consider three agents, a, b, c and the sequence of three calls bc, ac, bc. In the initial gossip situation Qa = {A}, Qb = {B}, Qc = {C}. The first call transforms it into one in which Qa = {A}, Qb = {B, C}, Qc = {B, C}.
Krzysztof R. Apt Distributed Gossip Protocols
Example
Consider three agents, a, b, c and the sequence of three calls bc, ac, bc. In the initial gossip situation Qa = {A}, Qb = {B}, Qc = {C}. The first call transforms it into one in which Qa = {A}, Qb = {B, C}, Qc = {B, C}. The second call transforms it into one in which Qa = {A, B, C}, Qb = {B, C}, Qc = {A, B, C}.
Krzysztof R. Apt Distributed Gossip Protocols
Example
Consider three agents, a, b, c and the sequence of three calls bc, ac, bc. In the initial gossip situation Qa = {A}, Qb = {B}, Qc = {C}. The first call transforms it into one in which Qa = {A}, Qb = {B, C}, Qc = {B, C}. The second call transforms it into one in which Qa = {A, B, C}, Qb = {B, C}, Qc = {A, B, C}. The third call transforms it into one in which Qa = {A, B, C}, Qb = {A, B, C}, Qc = {A, B, C}.
Krzysztof R. Apt Distributed Gossip Protocols
Gossip models
Each gossip situation captures a possible ‘intermediate situation’: each agent knows specific secrets. Gossip model captures the idea that agents are uncertain which gossip situation is the actual one. A gossip model: (S, (∼a)a∈A), where
◮ S is a set of gossip situations, ◮ for each a ∈ A
G ∼a G ′ iff Qa = Q′
a.
Initial gossip model: S = {G}, where G is the initial gossip situation. Pointed gossip model: (M, G), where G is a gossip situation from M.
- Intuition. G is the current gossip situation. M captures the
uncertainty of the agents about the actual gossip situation.
Krzysztof R. Apt Distributed Gossip Protocols
Semantics
Fix a pointed gossip model (M, G), where G = ((Qa)a∈A). (M, G) | = Fap iff p ∈ Qa, (M, G) | = Kaφ iff (M, G ′) | = φ for every G ′ ∼a G.
Krzysztof R. Apt Distributed Gossip Protocols
Computations (1)
Semantics of a gossip protocol: a computation tree. The root is the initial pointed gossip model. The nodes are pointed gossip models. Each call transforms the current pointed gossip model into the new
- ne.
Fix a pointed gossip model (M, G), where M := (S, (∼a)a∈A).
◮ Given a call ab
ab(M, G) := (M′, G ′), where M′ = ({cd(G ′′) | G ′′ ∈ S, c, d ∈ A, c = d} ∪ {G}, (∼a)a∈A), G ′ = ab(G).
◮ Analogously for a ⊲ b and a ⊳ b. Krzysztof R. Apt Distributed Gossip Protocols
Computations (2)
Assume a gossip protocol that is a parallel composition of ∗[[]ma
j=1 φa j → Sa j ], where a ∈ A.
Then (M′, G ′) → (M′′, G ′′), if for some a and j ∈ {1, . . ., ma} (M′, G ′) | = φa
j and Sa j (M′, G ′) = (M′′, G ′′).
Krzysztof R. Apt Distributed Gossip Protocols
Computations (2)
Assume a gossip protocol that is a parallel composition of ∗[[]ma
j=1 φa j → Sa j ], where a ∈ A.
Then (M′, G ′) → (M′′, G ′′), if for some a and j ∈ {1, . . ., ma} (M′, G ′) | = φa
j and Sa j (M′, G ′) = (M′′, G ′′).
So if (M, G) is a leaf of the computation tree, then (M, G) | =
- a∈A
ma
- j=1
¬φa
j .
Krzysztof R. Apt Distributed Gossip Protocols
Computations (3)
Assume ∗[[]ma
j=1 φa j → Sa j ], where a ∈ A.
A computation of a gossip protocol: a path in its computation tree. An agent a is enabled in (M, G) from ξ if (M, G) | = ma
j=1 φa j .
- Intuition. An agent is enabled if it can perform a call.
An agent a is selected in (M, G) from ξ if it is the caller in the call that caused the transition (M, G) → (M′, G ′) in ξ. A computation ξ is fair if it is finite or each agent enabled in infinitely many pointed gossip models in ξ is selected in infinitely many pointed gossip models in ξ.
Krzysztof R. Apt Distributed Gossip Protocols
Correctness
Assume a gossip protocol P that is a parallel composition of ∗[[]ma
j=1 φa j → Sa j ], where a ∈ A.
P is partially correct if
a∈A ma
- j=1
¬φa
j
- →
- a,b∈A
FaB is true in all leaves of the computation tree of P. The exit condition of P:
- a∈A
ma
- j=1
¬φa
j
P terminates if all its computations are finite. P fairly terminates if all its fair computations are finite.
Krzysztof R. Apt Distributed Gossip Protocols
Some Implications
T: termination. FT: fair termination. Note T = ⇒ FT. T for ⊲ = ⇒ FT for ⊲. T for ⊳ = ⇒ FT for ⊳. No other implications hold.
Krzysztof R. Apt Distributed Gossip Protocols
Example: T for ⊲ does not imply T
Consider three agents, a, b, c. FaAll stands for
i∈{a,b,c} FaI.
Krzysztof R. Apt Distributed Gossip Protocols
Example: T for ⊲ does not imply T
Consider three agents, a, b, c. FaAll stands for
i∈{a,b,c} FaI.
Let A ⊂ C stand for
- i∈{a,b,c}
(FaI → FcI) ∧
- i∈{a,b,c}
(FcI ∧ ¬FaI)
- Intuition. c knows strictly more secrets than a.
Consider the following component programs:
◮ for agent a: ∗[¬(A ⊂ C) ∧ ¬FaAll → a ⊲ c], ◮ for agent b: ∗[¬(B ⊂ C) ∧ ¬FbAll → b ⊲ c], ◮ for agent c: ∗[[]i∈{a,b}FcAll ∧ ¬KcFiC → c ⊲ i]. Krzysztof R. Apt Distributed Gossip Protocols
Example: T for ⊲ does not imply T
Consider three agents, a, b, c. FaAll stands for
i∈{a,b,c} FaI.
Let A ⊂ C stand for
- i∈{a,b,c}
(FaI → FcI) ∧
- i∈{a,b,c}
(FcI ∧ ¬FaI)
- Intuition. c knows strictly more secrets than a.
Consider the following component programs:
◮ for agent a: ∗[¬(A ⊂ C) ∧ ¬FaAll → a ⊲ c], ◮ for agent b: ∗[¬(B ⊂ C) ∧ ¬FbAll → b ⊲ c], ◮ for agent c: ∗[[]i∈{a,b}FcAll ∧ ¬KcFiC → c ⊲ i].
This protocol is correct, terminates for ⊲ and does not always terminate for the push-pull mode. The only computations: [a ⊲ c||b ⊲ c], [c ⊲ a||c ⊲ b]. For the push-pull mode ac, ac, ac, . . . is a possible computation.
Krzysztof R. Apt Distributed Gossip Protocols
Another Ring Protocol
Program for agent i: ∗[(¬
n
- j=1
FiJ) ∨ ¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. Agent i calls his successor, i ⊕ 1, if it does not know all the secrets or it does not know whether his successor knows the secret of i’s predecessor, i ⊖ 1. Properties of this protocol: T FT T for ⊲ FT for ⊲ T for ⊳ FT for ⊳ no yes no yes no yes
Krzysztof R. Apt Distributed Gossip Protocols
Another Ring Protocol
Program for agent i: ∗[(¬
n
- j=1
FiJ) ∨ ¬KiFi⊕1I ⊖ 1 → (i, i ⊕ 1)]. Agent i calls his successor, i ⊕ 1, if it does not know all the secrets or it does not know whether his successor knows the secret of i’s predecessor, i ⊖ 1. Properties of this protocol: T FT T for ⊲ FT for ⊲ T for ⊳ FT for ⊳ no yes no yes no yes Non-termination: (i, i ⊕ 1), (i, i ⊕ 1), . . .
Krzysztof R. Apt Distributed Gossip Protocols
A Terminating Ring Protocol
Program for agent i: ∗[
n
- j=1
(FiJ ∧ ¬KiFi⊕1J) → (i, i ⊕ 1)]. Agent i calls his successor, i ⊕ 1, if i knows some secret and it does not know whether its successor knows it. Properties of this protocol: T FT T for ⊲ FT for ⊲ T for ⊳ FT for ⊳ yes yes yes yes no yes Non-termination for ⊳: i ⊳ i ⊕ 1, i ⊳ i ⊕ 1, . . .
Krzysztof R. Apt Distributed Gossip Protocols
A Terminating Ring Protocol, ctd
Program for agent i: ∗[
n
- j=1
(FiJ ∧ ¬KiFi⊕1J) → (i, i ⊕ 1)]. Partial correctness Consider its exit condition
n
- i=1
n
- j=1
(¬FiJ ∨ KiFi⊕1J). It implies n
i=1
n
j=1 FiJ.
Proof by induction on the pairs (i, j), ordered as follows: (1, 1), (2, 1), . . ., (n, 1), (2, 2), (3, 2), . . ., (1, 2), . . . (n, n), (1, n), . . ., (n − 1, n).
Krzysztof R. Apt Distributed Gossip Protocols
A Terminating Ring Protocol, ctd
Program for agent i: ∗[
n
- j=1
(FiJ ∧ ¬KiFi⊕1J) → (i, i ⊕ 1)]. Termination for push-pull. After each call (i, i ⊕ 1) the set Inf := {(i, j) | ¬KiFi⊕1J}. decreases.
Krzysztof R. Apt Distributed Gossip Protocols
Protocols for Complete Graphs
Learn New Secrets Protocol ([ADGH14]) Program for agent i: ∗[[]j∈A¬FiJ → (i, j)]. Agent i calls agent j if agent i does not know his secret. Properties of this protocol: T FT T for ⊲ FT for ⊲ T for ⊳ FT for ⊳ yes yes no no yes yes
Krzysztof R. Apt Distributed Gossip Protocols
Learn New Secrets Protocol for push-pull
Program for agent i: ∗[[]j∈A¬FiJ → (i, j)]. It can generate the shortest sequences of 2n − 4 calls. Indeed, let A = {a, b, c, d, i1, . . ., in−4}. Then (a, i1), (a, i2), . . ., (a, in−4), (a, b), (c, d), (a, d), (b, c), (i1, b), (i2, b), . . ., (in−4, b) corresponds to a terminating computation. It can also generate the longest sequences of n(n−1)
2
calls. Indeed, take [2], [3], [4], . . ., [n], where [k] stands for (1, k), (2, k), . . ., (k − 1, k).
Krzysztof R. Apt Distributed Gossip Protocols
Hear My Secret Protocol
Program for agent i: ∗[[]j∈A¬KiFjI → (i, j)]. Agent i calls agent j if agent i does not know whether j knows his secret. Properties of this protocol: T FT T for ⊲ FT for ⊲ T for ⊳ FT for ⊳ yes yes yes yes no no It can generate the shortest and the longest sequences of calls. Argument the same as for the LNS protocol.
Krzysztof R. Apt Distributed Gossip Protocols
Future Work
Analyze the protocols for other types of calls, so
◮ ab−: every agent c = a, b noted that a called b, ◮ ab0: every agent c = a, b noted that some call took place,
though not between whom.
Prove (im)possibility results for various protocols concerning generation of (not only) the shortest sequences and for various modes
- f communication.
Consider initial situations in which the agents have some partial knowledge of the secrets.
Krzysztof R. Apt Distributed Gossip Protocols
Thank you
Krzysztof R. Apt Distributed Gossip Protocols