SlideShare a Scribd company logo
1 of 119
Theoretical Foundations
▸Clocks
▹Logical clocks (Lamport)
▹Partially ordered clocks (Fidge)
▸Causally ordered message delivery
▹Broadcast-based (Birman et al.)
▹Unicast-based (Raynal, Schiper & Toueg)
▸System states
▹Global snapshots (Chandy & Lamport)
▹Termination detection (Huang)
Theoretical Foundations
1
Basics of Message Delivery
▸sendp(m)
▹Transmission of message m by process p to a set of
destinations denoted destinations(m)
▸receiveq(m)
▹Reception of message m by process q
▹sendp(m)  receiveq(m)
▸deliverq(m)
▹Delivery of message m to process q
▹receiveq(m)  deliverq(m)
Theoretical Foundations > Causal Delivery
2
Causal Delivery
▸Causal Delivery:
▹If sendi(w)  sendj(m), and
q ∈ destinations(w) and q ∈ destinations(m),
then deliverq(w)  deliverq(m)
▸What’s an example of a causal delivery protocol?
▹Transmission Control Protocol (TCP)
Theoretical Foundations > Causal Delivery
3
Broadcast-based Causal Delivery
▸Broadcast:
▹when a process sends a message, it sends the
message to every process in the system
▹Called a multicast when sending to a defined group
Theoretical Foundations > Causal Delivery > Broadcast-based
4
BSS Protocol
▸Broadcast-based causal delivery protocol
▹Assumes an external service implements group
abstraction
▹sendp(m) broadcasts message m to the entire group in a
single action
▸Assumes a lossless network
▹Any message broadcast will eventually be received unless
the sender or destination fail
▸Assumes a failure detection mechanism exists
▹Will remove failed processes from the group
▹Will flush broadcasts at the time of a failure
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
5
BSS Protocol Rules
▸Rule 1
Before sending message m, process i increments
Ci[i] and timestamps m.
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
6
BSS Protocol Rules
▸Rule 2
On reception of message m sent by process i and
timestamped tm, process j (≠ i) delays delivery of
m until:
∀k:[1…n]
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
7
tm[k] = Cj[k] + 1; if k = i
tm[k] ≤ Cj[k]; if k ≠ i
BSS Protocol Rules
▸Rule 3
When a message m is delivered, Cj is updated to
max(Cj, tm).
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
8
BSS Safety and Liveness
▸Safety:
▹messages are always delivered in causal order
▹Causal delivery is never violated
▸Liveness:
▹a message will never be indefinitely delayed
▹Every message will be delivered eventually
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
9
BSS Protocol Exercise
▸Rule 1: i increments Ci[i] and timestamps m
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
10
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
BSS Protocol Exercise
▸Rule 1: i increments Ci[i] and timestamps m
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
11
P
Q
R
[1 0 0]
[0 0 0]
[0 0 0]
[1 0 0]
BSS Protocol Exercise
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
12
P
Q
R
[1 0 0]
[0 0 0]
[0 0 0]
[1 0 0]
BSS Protocol Exercise
▸Rule 1: i increments Ci[i] and timestamps m
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
13
P
Q
R
[1 0 0]
[0 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 2: Delivery the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
14
P
Q
R
[1 0 0]
[0 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
15
P
Q
R
[1 0 0]
[1 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 2: Delivery the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
16
P
Q
R
[1 0 0]
[1 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
17
P
Q
R
[1 0 1]
[1 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 2: Delivery the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
18
P
Q
R
[1 0 1]
[1 0 0]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
19
P
Q
R
[1 0 1]
[1 0 1]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
20
P
Q
R
[1 0 1]
[1 0 1]
[0 0 1]
[1 0 0]
[0 0 1]
BSS Protocol Exercise
▸Rule 1: i increments Ci[i] and timestamps m
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
21
P
Q
R
[1 0 1]
[1 1 1]
[0 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 2: Delivery the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
22
P
Q
R
[1 0 1]
[1 1 1]
[0 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
23
P
Q
R
[1 1 1]
[1 1 1]
[0 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 2: Delay delivering the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
24
P
Q
R
[1 1 1]
[1 1 1]
[0 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
25
P
Q
R
[1 1 1]
[1 1 1]
[0 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
26
P
Q
R
[1 1 1]
[1 1 1]
[1 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 2: Check the buffer for delayed messages
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
27
P
Q
R
[1 1 1]
[1 1 1]
[1 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
28
P
Q
R
[1 1 1]
[1 1 1]
[1 0 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
BSS Protocol Exercise
▸Rule 3: Cj is updated to max(Cj, tm)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
29
P
Q
R
[1 1 1]
[1 1 1]
[1 1 1]
[1 0 0]
[0 0 1]
[1 1 1]
[1 1 1]
Proof of BSS Safety
▸Safety:
▹messages are always delivered in causal order
▹Causal delivery is never violated
▸Must prove
▹If send(m1)  send(m2)
then deliveri(m1)  deliveri(m2)
▹Two cases:
1. Same process: sendp(m1)  sendp(m2)
2. Different processes: sendp(m1)  sendq(m2)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
30
Proof of BSS Safety: Case 1
▸If sendp(m1)  sendp(m2) then deliveri(m1)  deliveri(m2)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
31
P
Q
R
[2 1 0]
[2 1 0]
[2 1 0]
[1 0 0] [2 0 0]
[1 1 0]
[1 1 0]
Proof of BSS Safety: Case 2
▸If sendp(m1)  sendq(m2) then deliveri(m1)  deliveri(m2)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
32
X
Y
Z
create(R1)
create(R1)
update(R1)
R1
R1
R1
R1
R1
[1 1 0]
[1 1 0]
[1 1 0]
[0 1 0]
[0 1 0]
[1 1 0]
R1
Quiz Question
▸Assume sentQ(m)  sentQ(n),
process P ∈ dests(m), and P ∈ dests(n).
If deliverP(n)  deliverP(m), then safety is
violated.
▹True
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
33
Proof of BSS Liveness
▸Liveness:
▹a message will never be indefinitely delayed
▹Every message will be delivered eventually
▸Must prove
▹If sendi(m) and receivej(m) then deliverj(m)
▹Two counterexamples:
1. If k = i then tm[k] will never equal Cj[k] + 1
2. If k ≠ i then tm[k] will always be greater than Cj[k]
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
34
Proof of BSS Liveness: Counterexample 1
▸If k = i then tm[k] will never equal Cj[k] + 1
▸tm[k] is not less than Cj[k] + 1
▹Process i sent message m
▹Hence, Cj[i] < Ci[i] when m was timestamped
▸If tm[k] is more than Cj[k] + 1
▹Process i sent other messages prior to m
▸BSS assumes a lossless network
▹Process j will eventually receive the other messages from i
▹Hence, tm[k] will eventually equal Cj[k] + 1
▸Proves if sendi(m) and receivej(m) then deliverj(m)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
35
Proof of BSS Liveness: Counterexample 2
▸If k ≠ i then tm[k] will always be greater than Cj[k]
▸tm[k] is greater than Cj[k]
▹Before sending message m to process j,
process i received messages from process k that process j
has not received
▸BSS is broadcast-based
▹Process k also sent these messages to process j
▸BSS assumes a lossless network
▹Process j will eventually receive the messages from k
▹Hence, tm[k] will eventually be less than or equal to Cj[k]
▸Proves if sendi(m) and receivej(m) then deliverj(m)
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
36
Quiz Question
▸Assume sentQ(m)  sentQ(n),
process P ∈ dests(m), and P ∈ dests(n).
If deliverP(m) never occurs, then liveness is
violated.
▹True
Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol
37
Theoretical Foundations
▸Clocks
▹Logical clocks (Lamport)
▹Partially ordered clocks (Fidge)
▸Causally ordered message delivery
▹Broadcast-based (Birman et al.)
▹Unicast-based (Raynal, Schiper & Toueg)
▸System states
▹Global snapshots (Chandy & Lamport)
▹Termination detection (Huang)
Theoretical Foundations
38
Theoretical Foundations:
Unicast-based Causal Delivery
CS/CE/TE 6378
Advanced Operating Systems
Unicast-based Causal Delivery
▸Unicast:
▹when a process sends a message, it sends the
message to one process in the system
Theoretical Foundations > Causal Delivery > Unicast-based
40
RST Protocol
▸RST:
▹Raynal, Schiper & Toueg
▸A causal delivery protocol
▹Uses matrices to track messages sent
▸Assumes a lossless network
▹Any message unicast will eventually be received
unless the sender or destination fail
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
41
RST Protocol Variables
▸Every process manages two variables
▹DELIVj[i]
▸An array [1…n] that represents the number of messages
sent from process i and delivered to process j
▹SENTj[k, l]
▸A matrix [n x n] that represents the number of messages
sent from process k to process l (not necessarily delivered)
from process j’s perspective
▸Both are initialized with 0s
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
42
RST Protocol Rules
▸Rule 1
After sending message m to process j with a
copy of SENTi (called tm), process i increments
SENTi[i, j].
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
43
RST Protocol Example
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
44
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
RST Protocol Example
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
45
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
RST Protocol Example
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
46
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Example
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
47
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Rules
▸Rule 2
On reception of message m from process i and
piggybacked with tm, process j delays delivery
of m until:
∀k:[1…n] tm[k, j] ≤ DELIVj[k]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
48
RST Protocol Example
▸Rule 2: j = 0; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
49
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 0; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
50
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 0; k = 2; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
51
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
52
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Rules
▸Rule 3
On delivery of message m from process i and
piggybacked with tm, process j
1. Increments DELIVj[i],
2. Increments SENTj[i, j],
3. ∀k:[1…n] l:[1…n]
SENTj[k, l] = max(SENTj[k, l], tm[k, l])
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
53
RST Protocol Example
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
54
P
Q
R
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
55
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
56
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
1 0 0
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Example
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
57
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
RST Protocol Example
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
58
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
59
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
60
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 0
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
61
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
62
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
63
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
No, 1 ≤ 0
/
RST Protocol Example
▸Rule 2: Delay delivering the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
64
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
65
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
66
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
No, 1 ≤ 0
/
RST Protocol Example
▸Rule 2: Delay delivering the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
67
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
68
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
69
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
70
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
71
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
72
P
Q
R
[0 1 0]
[0 0 0]
[0 0 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
73
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
74
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
75
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
76
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
77
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 1 ≤ 1
RST Protocol Example
▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
78
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
79
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
80
P
Q
R
[0 1 0]
[0 0 0]
[0 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
81
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
82
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
0 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
83
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
84
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 1
RST Protocol Example
▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
85
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 1 ≤ 1
RST Protocol Example
▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
86
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Yes, 0 ≤ 0
RST Protocol Example
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
87
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
88
P
Q
R
[0 1 0]
[0 0 0]
[1 1 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
89
P
Q
R
[0 1 0]
[0 0 0]
[1 2 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
90
P
Q
R
[0 1 0]
[0 0 0]
[1 2 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
RST Protocol Example
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
91
P
Q
R
[0 1 0]
[0 0 0]
[1 2 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Quiz Questions
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
92
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Quiz Questions
▸What is the value of the SENT variable attached to m1?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
93
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Quiz Questions
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
94
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
0 0 0
Quiz Questions
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
95
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
96
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
97
[0 0 0]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
98
[0 0 1]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
99
[0 0 1]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
1 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
100
[0 0 1]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸What is the value of P’s SENT variable after p1?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
101
[0 0 1]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
Quiz Questions
▸Rule 1: Timestamp message with current SENT
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
102
[0 0 1]
[0 0 0]
[0 0 0]
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 1: Increment SENTi[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
103
[0 0 1]
[0 0 0]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸What is the value of the SENT variable attached to m3?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
104
[0 0 1]
[0 0 0]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 2: Delay delivering the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
105
[0 0 1]
[0 0 0]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸What is the value of Q’s DELIV variable after q1?
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
106
[0 0 1]
[0 0 0]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 2: Deliver the message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
107
[0 0 1]
[0 0 0]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 3: Increment DELIVj[i]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
108
[0 0 1]
[0 0 1]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 3: Increment SENTj[i, j]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
109
[0 0 1]
[0 0 1]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 3: max(SENTj, tm)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
110
[0 0 1]
[0 0 1]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Quiz Questions
▸Rule 2: Deliver the delayed message
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
111
[0 0 1]
[0 0 1]
[0 0 0]
0 1 0
0 0 0
1 1 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 0
0 0 0
1 1 0
Proof of RST Safety
▸Safety:
▹messages are always delivered in causal order
▹Causal delivery is never violated
▸Must prove
▹If send(m1)  send(m2)
then deliveri(m1)  deliveri(m2)
▹Two cases:
1. Same process: sendp(m1)  sendp(m2)
2. Different processes: sendp(m1)  sendq(m2)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
112
Proof of RST Safety: Case 1
▸If sendp(m1)  sendp(m2) then deliveri(m1)  deliveri(m2)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
113
P
Q
R
[0 1 0]
[0 0 0]
[1 2 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Proof of RST Safety: Case 2
▸If sendp(m1)  sendq(m2) then deliveri(m1)  deliveri(m2)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
114
P
Q
R
[0 1 0]
[0 0 0]
[1 2 0]
0 0 1
1 0 1
0 0 0
0 0 0
1 0 2
0 0 0
0 0 1
1 0 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0
0 0 0
1 0 1
0 0 0
0 0 0
1 0 1
0 0 0
Proof of RST Liveness
▸Liveness:
▹a message will never be indefinitely delayed
▹Every message will be delivered eventually
▸Must prove
▹If sendi(m) and receivej(m) then deliverj(m)
▹Counterexample:
▸∃k such that tm[k, j] will always be greater than DELIVj[k]
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
115
Proof of RST Liveness: Counterexample
▸∃k such that tm[k, j] will always be greater than
DELIVj [k]
▸tm[k, j] is greater than DELIVj [k]
▹Process k sent messages to process j prior to message m
being sent to process j
▹Process j has not received these messages yet
▸RST assumes a lossless network
▹Process j will eventually receive the messages from k
▹tm[k, j] will eventually be less than or equal to DELIVj [k]
▸Proves if sendi(m) and receivej(m) then deliverj(m)
Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol
116
BSS Protocol vs. RST Protocol
▸BSS Protocol
▹Pro: Requires smaller messages (vector)
▹Con: Requires more messages (broadcast)
▸RST Protocol
▹Pro: Requires fewer messages (unicast)
▹Con: Requires larger messages (matrix)
Theoretical Foundations > Causal Delivery
117
Quiz Question
▸Considering the BSS and RST algorithms, which
of the following is false?
▹The BSS algorithm is designed for multicast systems.
▹The RST algorithm is designed for unicast systems.
▹The BSS algorithm requires smaller messages.
▹The RST algorithm requires more messages.
Theoretical Foundations > Causal Delivery
118
Team Composition
▸ 5 teams with 4 (in one case 3) members
▸ All members are supposed to contributed equally in the project
▸ Good to schedule weekly meeting for discussion checking
progress
Team Introduction
119

More Related Content

What's hot

Chat bot making process using Python 3 & TensorFlow
Chat bot making process using Python 3 & TensorFlowChat bot making process using Python 3 & TensorFlow
Chat bot making process using Python 3 & TensorFlowJeongkyu Shin
 
The Application Layer
The Application LayerThe Application Layer
The Application Layeradil raja
 
Mutual exclusion in distributed systems
Mutual exclusion in distributed systemsMutual exclusion in distributed systems
Mutual exclusion in distributed systemsAJAY KHARAT
 
message communication protocols in IoT
message communication protocols in IoTmessage communication protocols in IoT
message communication protocols in IoTFabMinds
 
ENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGMohammad Adil
 
Localization & management of sensor networks
Localization & management of sensor networksLocalization & management of sensor networks
Localization & management of sensor networksRushin Shah
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Delay Tolerant Network - Presentation
Delay Tolerant Network - PresentationDelay Tolerant Network - Presentation
Delay Tolerant Network - PresentationLaili Aidi
 
similarity measure
similarity measure similarity measure
similarity measure ZHAO Sam
 
Deep Learning Based Voice Activity Detection and Speech Enhancement
Deep Learning Based Voice Activity Detection and Speech EnhancementDeep Learning Based Voice Activity Detection and Speech Enhancement
Deep Learning Based Voice Activity Detection and Speech EnhancementNAVER Engineering
 
bag-of-words models
bag-of-words models bag-of-words models
bag-of-words models Xiaotao Zou
 
Transport services
Transport servicesTransport services
Transport servicesNavin Kumar
 

What's hot (20)

Ip packet delivery
Ip packet deliveryIp packet delivery
Ip packet delivery
 
Chat bot making process using Python 3 & TensorFlow
Chat bot making process using Python 3 & TensorFlowChat bot making process using Python 3 & TensorFlow
Chat bot making process using Python 3 & TensorFlow
 
Congestion control
Congestion controlCongestion control
Congestion control
 
The Application Layer
The Application LayerThe Application Layer
The Application Layer
 
Mutual exclusion in distributed systems
Mutual exclusion in distributed systemsMutual exclusion in distributed systems
Mutual exclusion in distributed systems
 
K mean-clustering
K mean-clusteringK mean-clustering
K mean-clustering
 
message communication protocols in IoT
message communication protocols in IoTmessage communication protocols in IoT
message communication protocols in IoT
 
DSDV VS AODV
DSDV VS AODV DSDV VS AODV
DSDV VS AODV
 
ENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELINGENCAPSULATION AND TUNNELING
ENCAPSULATION AND TUNNELING
 
Overlay networks
Overlay networksOverlay networks
Overlay networks
 
Mycin
MycinMycin
Mycin
 
Localization & management of sensor networks
Localization & management of sensor networksLocalization & management of sensor networks
Localization & management of sensor networks
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
RIP Loop Prevention
RIP Loop PreventionRIP Loop Prevention
RIP Loop Prevention
 
Delay Tolerant Network - Presentation
Delay Tolerant Network - PresentationDelay Tolerant Network - Presentation
Delay Tolerant Network - Presentation
 
similarity measure
similarity measure similarity measure
similarity measure
 
Deep Learning Based Voice Activity Detection and Speech Enhancement
Deep Learning Based Voice Activity Detection and Speech EnhancementDeep Learning Based Voice Activity Detection and Speech Enhancement
Deep Learning Based Voice Activity Detection and Speech Enhancement
 
bag-of-words models
bag-of-words models bag-of-words models
bag-of-words models
 
Transport services
Transport servicesTransport services
Transport services
 
Framing Protocols
Framing ProtocolsFraming Protocols
Framing Protocols
 

More from logesswarisrinivasan

More from logesswarisrinivasan (6)

unit 4 for trees data structure notes it is
unit 4 for trees data structure notes it isunit 4 for trees data structure notes it is
unit 4 for trees data structure notes it is
 
8139350.ppt
8139350.ppt8139350.ppt
8139350.ppt
 
8486477.ppt
8486477.ppt8486477.ppt
8486477.ppt
 
CS3013 -MACHINE LEARNING.pptx
CS3013 -MACHINE LEARNING.pptxCS3013 -MACHINE LEARNING.pptx
CS3013 -MACHINE LEARNING.pptx
 
21GE301-UHV-Unit4.pdf
21GE301-UHV-Unit4.pdf21GE301-UHV-Unit4.pdf
21GE301-UHV-Unit4.pdf
 
Unit 2 [autosaved]
Unit 2 [autosaved]Unit 2 [autosaved]
Unit 2 [autosaved]
 

Recently uploaded

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 

Recently uploaded (20)

Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

05 (1).pptx

  • 1. Theoretical Foundations ▸Clocks ▹Logical clocks (Lamport) ▹Partially ordered clocks (Fidge) ▸Causally ordered message delivery ▹Broadcast-based (Birman et al.) ▹Unicast-based (Raynal, Schiper & Toueg) ▸System states ▹Global snapshots (Chandy & Lamport) ▹Termination detection (Huang) Theoretical Foundations 1
  • 2. Basics of Message Delivery ▸sendp(m) ▹Transmission of message m by process p to a set of destinations denoted destinations(m) ▸receiveq(m) ▹Reception of message m by process q ▹sendp(m)  receiveq(m) ▸deliverq(m) ▹Delivery of message m to process q ▹receiveq(m)  deliverq(m) Theoretical Foundations > Causal Delivery 2
  • 3. Causal Delivery ▸Causal Delivery: ▹If sendi(w)  sendj(m), and q ∈ destinations(w) and q ∈ destinations(m), then deliverq(w)  deliverq(m) ▸What’s an example of a causal delivery protocol? ▹Transmission Control Protocol (TCP) Theoretical Foundations > Causal Delivery 3
  • 4. Broadcast-based Causal Delivery ▸Broadcast: ▹when a process sends a message, it sends the message to every process in the system ▹Called a multicast when sending to a defined group Theoretical Foundations > Causal Delivery > Broadcast-based 4
  • 5. BSS Protocol ▸Broadcast-based causal delivery protocol ▹Assumes an external service implements group abstraction ▹sendp(m) broadcasts message m to the entire group in a single action ▸Assumes a lossless network ▹Any message broadcast will eventually be received unless the sender or destination fail ▸Assumes a failure detection mechanism exists ▹Will remove failed processes from the group ▹Will flush broadcasts at the time of a failure Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 5
  • 6. BSS Protocol Rules ▸Rule 1 Before sending message m, process i increments Ci[i] and timestamps m. Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 6
  • 7. BSS Protocol Rules ▸Rule 2 On reception of message m sent by process i and timestamped tm, process j (≠ i) delays delivery of m until: ∀k:[1…n] Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 7 tm[k] = Cj[k] + 1; if k = i tm[k] ≤ Cj[k]; if k ≠ i
  • 8. BSS Protocol Rules ▸Rule 3 When a message m is delivered, Cj is updated to max(Cj, tm). Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 8
  • 9. BSS Safety and Liveness ▸Safety: ▹messages are always delivered in causal order ▹Causal delivery is never violated ▸Liveness: ▹a message will never be indefinitely delayed ▹Every message will be delivered eventually Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 9
  • 10. BSS Protocol Exercise ▸Rule 1: i increments Ci[i] and timestamps m Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 10 P Q R [0 0 0] [0 0 0] [0 0 0]
  • 11. BSS Protocol Exercise ▸Rule 1: i increments Ci[i] and timestamps m Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 11 P Q R [1 0 0] [0 0 0] [0 0 0] [1 0 0]
  • 12. BSS Protocol Exercise Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 12 P Q R [1 0 0] [0 0 0] [0 0 0] [1 0 0]
  • 13. BSS Protocol Exercise ▸Rule 1: i increments Ci[i] and timestamps m Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 13 P Q R [1 0 0] [0 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 14. BSS Protocol Exercise ▸Rule 2: Delivery the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 14 P Q R [1 0 0] [0 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 15. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 15 P Q R [1 0 0] [1 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 16. BSS Protocol Exercise ▸Rule 2: Delivery the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 16 P Q R [1 0 0] [1 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 17. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 17 P Q R [1 0 1] [1 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 18. BSS Protocol Exercise ▸Rule 2: Delivery the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 18 P Q R [1 0 1] [1 0 0] [0 0 1] [1 0 0] [0 0 1]
  • 19. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 19 P Q R [1 0 1] [1 0 1] [0 0 1] [1 0 0] [0 0 1]
  • 20. BSS Protocol Exercise Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 20 P Q R [1 0 1] [1 0 1] [0 0 1] [1 0 0] [0 0 1]
  • 21. BSS Protocol Exercise ▸Rule 1: i increments Ci[i] and timestamps m Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 21 P Q R [1 0 1] [1 1 1] [0 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 22. BSS Protocol Exercise ▸Rule 2: Delivery the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 22 P Q R [1 0 1] [1 1 1] [0 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 23. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 23 P Q R [1 1 1] [1 1 1] [0 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 24. BSS Protocol Exercise ▸Rule 2: Delay delivering the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 24 P Q R [1 1 1] [1 1 1] [0 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 25. BSS Protocol Exercise ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 25 P Q R [1 1 1] [1 1 1] [0 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 26. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 26 P Q R [1 1 1] [1 1 1] [1 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 27. BSS Protocol Exercise ▸Rule 2: Check the buffer for delayed messages Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 27 P Q R [1 1 1] [1 1 1] [1 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 28. BSS Protocol Exercise ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 28 P Q R [1 1 1] [1 1 1] [1 0 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 29. BSS Protocol Exercise ▸Rule 3: Cj is updated to max(Cj, tm) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 29 P Q R [1 1 1] [1 1 1] [1 1 1] [1 0 0] [0 0 1] [1 1 1] [1 1 1]
  • 30. Proof of BSS Safety ▸Safety: ▹messages are always delivered in causal order ▹Causal delivery is never violated ▸Must prove ▹If send(m1)  send(m2) then deliveri(m1)  deliveri(m2) ▹Two cases: 1. Same process: sendp(m1)  sendp(m2) 2. Different processes: sendp(m1)  sendq(m2) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 30
  • 31. Proof of BSS Safety: Case 1 ▸If sendp(m1)  sendp(m2) then deliveri(m1)  deliveri(m2) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 31 P Q R [2 1 0] [2 1 0] [2 1 0] [1 0 0] [2 0 0] [1 1 0] [1 1 0]
  • 32. Proof of BSS Safety: Case 2 ▸If sendp(m1)  sendq(m2) then deliveri(m1)  deliveri(m2) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 32 X Y Z create(R1) create(R1) update(R1) R1 R1 R1 R1 R1 [1 1 0] [1 1 0] [1 1 0] [0 1 0] [0 1 0] [1 1 0] R1
  • 33. Quiz Question ▸Assume sentQ(m)  sentQ(n), process P ∈ dests(m), and P ∈ dests(n). If deliverP(n)  deliverP(m), then safety is violated. ▹True Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 33
  • 34. Proof of BSS Liveness ▸Liveness: ▹a message will never be indefinitely delayed ▹Every message will be delivered eventually ▸Must prove ▹If sendi(m) and receivej(m) then deliverj(m) ▹Two counterexamples: 1. If k = i then tm[k] will never equal Cj[k] + 1 2. If k ≠ i then tm[k] will always be greater than Cj[k] Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 34
  • 35. Proof of BSS Liveness: Counterexample 1 ▸If k = i then tm[k] will never equal Cj[k] + 1 ▸tm[k] is not less than Cj[k] + 1 ▹Process i sent message m ▹Hence, Cj[i] < Ci[i] when m was timestamped ▸If tm[k] is more than Cj[k] + 1 ▹Process i sent other messages prior to m ▸BSS assumes a lossless network ▹Process j will eventually receive the other messages from i ▹Hence, tm[k] will eventually equal Cj[k] + 1 ▸Proves if sendi(m) and receivej(m) then deliverj(m) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 35
  • 36. Proof of BSS Liveness: Counterexample 2 ▸If k ≠ i then tm[k] will always be greater than Cj[k] ▸tm[k] is greater than Cj[k] ▹Before sending message m to process j, process i received messages from process k that process j has not received ▸BSS is broadcast-based ▹Process k also sent these messages to process j ▸BSS assumes a lossless network ▹Process j will eventually receive the messages from k ▹Hence, tm[k] will eventually be less than or equal to Cj[k] ▸Proves if sendi(m) and receivej(m) then deliverj(m) Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 36
  • 37. Quiz Question ▸Assume sentQ(m)  sentQ(n), process P ∈ dests(m), and P ∈ dests(n). If deliverP(m) never occurs, then liveness is violated. ▹True Theoretical Foundations > Causal Delivery > Broadcast-based > BSS Protocol 37
  • 38. Theoretical Foundations ▸Clocks ▹Logical clocks (Lamport) ▹Partially ordered clocks (Fidge) ▸Causally ordered message delivery ▹Broadcast-based (Birman et al.) ▹Unicast-based (Raynal, Schiper & Toueg) ▸System states ▹Global snapshots (Chandy & Lamport) ▹Termination detection (Huang) Theoretical Foundations 38
  • 39. Theoretical Foundations: Unicast-based Causal Delivery CS/CE/TE 6378 Advanced Operating Systems
  • 40. Unicast-based Causal Delivery ▸Unicast: ▹when a process sends a message, it sends the message to one process in the system Theoretical Foundations > Causal Delivery > Unicast-based 40
  • 41. RST Protocol ▸RST: ▹Raynal, Schiper & Toueg ▸A causal delivery protocol ▹Uses matrices to track messages sent ▸Assumes a lossless network ▹Any message unicast will eventually be received unless the sender or destination fail Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 41
  • 42. RST Protocol Variables ▸Every process manages two variables ▹DELIVj[i] ▸An array [1…n] that represents the number of messages sent from process i and delivered to process j ▹SENTj[k, l] ▸A matrix [n x n] that represents the number of messages sent from process k to process l (not necessarily delivered) from process j’s perspective ▸Both are initialized with 0s Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 42
  • 43. RST Protocol Rules ▸Rule 1 After sending message m to process j with a copy of SENTi (called tm), process i increments SENTi[i, j]. Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 43
  • 44. RST Protocol Example ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 44 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 45. RST Protocol Example ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 45 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 46. RST Protocol Example ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 46 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 47. RST Protocol Example ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 47 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 48. RST Protocol Rules ▸Rule 2 On reception of message m from process i and piggybacked with tm, process j delays delivery of m until: ∀k:[1…n] tm[k, j] ≤ DELIVj[k] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 48
  • 49. RST Protocol Example ▸Rule 2: j = 0; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 49 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 Yes, 0 ≤ 0
  • 50. RST Protocol Example ▸Rule 2: j = 0; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 50 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 Yes, 0 ≤ 0
  • 51. RST Protocol Example ▸Rule 2: j = 0; k = 2; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 51 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 Yes, 0 ≤ 0
  • 52. RST Protocol Example ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 52 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 53. RST Protocol Rules ▸Rule 3 On delivery of message m from process i and piggybacked with tm, process j 1. Increments DELIVj[i], 2. Increments SENTj[i, j], 3. ∀k:[1…n] l:[1…n] SENTj[k, l] = max(SENTj[k, l], tm[k, l]) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 53
  • 54. RST Protocol Example Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 54 P Q R [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 55. RST Protocol Example ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 55 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 56. RST Protocol Example ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 56 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 57. RST Protocol Example ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 57 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
  • 58. RST Protocol Example ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 58 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 59. RST Protocol Example ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 59 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 60. RST Protocol Example ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 60 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 0 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 61. RST Protocol Example ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 61 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 62. RST Protocol Example ▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 62 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 63. RST Protocol Example ▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 63 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 No, 1 ≤ 0 /
  • 64. RST Protocol Example ▸Rule 2: Delay delivering the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 64 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 65. RST Protocol Example ▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 65 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 66. RST Protocol Example ▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 66 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 No, 1 ≤ 0 /
  • 67. RST Protocol Example ▸Rule 2: Delay delivering the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 67 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 68. RST Protocol Example ▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 68 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 69. RST Protocol Example ▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 69 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 70. RST Protocol Example ▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 70 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 71. RST Protocol Example ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 71 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 72. RST Protocol Example Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 72 P Q R [0 1 0] [0 0 0] [0 0 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 73. RST Protocol Example ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 73 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 74. RST Protocol Example ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 74 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 75. RST Protocol Example ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 75 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 76. RST Protocol Example ▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 76 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 77. RST Protocol Example ▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 77 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 1 ≤ 1
  • 78. RST Protocol Example ▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 78 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 79. RST Protocol Example ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 79 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 80. RST Protocol Example Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 80 P Q R [0 1 0] [0 0 0] [0 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 81. RST Protocol Example ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 81 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 82. RST Protocol Example ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 82 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 83. RST Protocol Example ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 83 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 84. RST Protocol Example ▸Rule 2: j = 2; k = 0; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 84 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 1
  • 85. RST Protocol Example ▸Rule 2: j = 2; k = 1; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 85 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 1 ≤ 1
  • 86. RST Protocol Example ▸Rule 2: j = 2; k = 2; tm[k, j] ≤ DELIVj[k]? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 86 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 Yes, 0 ≤ 0
  • 87. RST Protocol Example ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 87 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 88. RST Protocol Example Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 88 P Q R [0 1 0] [0 0 0] [1 1 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 89. RST Protocol Example ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 89 P Q R [0 1 0] [0 0 0] [1 2 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 90. RST Protocol Example ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 90 P Q R [0 1 0] [0 0 0] [1 2 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 91. RST Protocol Example ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 91 P Q R [0 1 0] [0 0 0] [1 2 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 92. Quiz Questions ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 92 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 93. Quiz Questions ▸What is the value of the SENT variable attached to m1? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 93 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 94. Quiz Questions ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 94 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
  • 95. Quiz Questions ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 95 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 96. Quiz Questions ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 96 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 97. Quiz Questions ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 97 [0 0 0] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 98. Quiz Questions ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 98 [0 0 1] [0 0 0] [0 0 0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 99. Quiz Questions ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 99 [0 0 1] [0 0 0] [0 0 0] 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 100. Quiz Questions ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 100 [0 0 1] [0 0 0] [0 0 0] 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 101. Quiz Questions ▸What is the value of P’s SENT variable after p1? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 101 [0 0 1] [0 0 0] [0 0 0] 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
  • 102. Quiz Questions ▸Rule 1: Timestamp message with current SENT Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 102 [0 0 1] [0 0 0] [0 0 0] 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 103. Quiz Questions ▸Rule 1: Increment SENTi[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 103 [0 0 1] [0 0 0] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 104. Quiz Questions ▸What is the value of the SENT variable attached to m3? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 104 [0 0 1] [0 0 0] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 105. Quiz Questions ▸Rule 2: Delay delivering the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 105 [0 0 1] [0 0 0] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 106. Quiz Questions ▸What is the value of Q’s DELIV variable after q1? Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 106 [0 0 1] [0 0 0] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 107. Quiz Questions ▸Rule 2: Deliver the message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 107 [0 0 1] [0 0 0] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 108. Quiz Questions ▸Rule 3: Increment DELIVj[i] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 108 [0 0 1] [0 0 1] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 109. Quiz Questions ▸Rule 3: Increment SENTj[i, j] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 109 [0 0 1] [0 0 1] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 110. Quiz Questions ▸Rule 3: max(SENTj, tm) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 110 [0 0 1] [0 0 1] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 111. Quiz Questions ▸Rule 2: Deliver the delayed message Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 111 [0 0 1] [0 0 1] [0 0 0] 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0
  • 112. Proof of RST Safety ▸Safety: ▹messages are always delivered in causal order ▹Causal delivery is never violated ▸Must prove ▹If send(m1)  send(m2) then deliveri(m1)  deliveri(m2) ▹Two cases: 1. Same process: sendp(m1)  sendp(m2) 2. Different processes: sendp(m1)  sendq(m2) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 112
  • 113. Proof of RST Safety: Case 1 ▸If sendp(m1)  sendp(m2) then deliveri(m1)  deliveri(m2) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 113 P Q R [0 1 0] [0 0 0] [1 2 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 114. Proof of RST Safety: Case 2 ▸If sendp(m1)  sendq(m2) then deliveri(m1)  deliveri(m2) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 114 P Q R [0 1 0] [0 0 0] [1 2 0] 0 0 1 1 0 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0
  • 115. Proof of RST Liveness ▸Liveness: ▹a message will never be indefinitely delayed ▹Every message will be delivered eventually ▸Must prove ▹If sendi(m) and receivej(m) then deliverj(m) ▹Counterexample: ▸∃k such that tm[k, j] will always be greater than DELIVj[k] Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 115
  • 116. Proof of RST Liveness: Counterexample ▸∃k such that tm[k, j] will always be greater than DELIVj [k] ▸tm[k, j] is greater than DELIVj [k] ▹Process k sent messages to process j prior to message m being sent to process j ▹Process j has not received these messages yet ▸RST assumes a lossless network ▹Process j will eventually receive the messages from k ▹tm[k, j] will eventually be less than or equal to DELIVj [k] ▸Proves if sendi(m) and receivej(m) then deliverj(m) Theoretical Foundations > Causal Delivery > Unicast-based > RST Protocol 116
  • 117. BSS Protocol vs. RST Protocol ▸BSS Protocol ▹Pro: Requires smaller messages (vector) ▹Con: Requires more messages (broadcast) ▸RST Protocol ▹Pro: Requires fewer messages (unicast) ▹Con: Requires larger messages (matrix) Theoretical Foundations > Causal Delivery 117
  • 118. Quiz Question ▸Considering the BSS and RST algorithms, which of the following is false? ▹The BSS algorithm is designed for multicast systems. ▹The RST algorithm is designed for unicast systems. ▹The BSS algorithm requires smaller messages. ▹The RST algorithm requires more messages. Theoretical Foundations > Causal Delivery 118
  • 119. Team Composition ▸ 5 teams with 4 (in one case 3) members ▸ All members are supposed to contributed equally in the project ▸ Good to schedule weekly meeting for discussion checking progress Team Introduction 119

Editor's Notes

  1. Dotted line shows how Rule 2 delays the delivery to ensure safety property
  2. What is the value of the SENT variable attached to m1?