In a few hundred years, when the history of our time is written from a long-term perspective, it is likely that the most important event those historians will see is not technology, not the Internet, not e-commerce. It is an unprecedented change in human condition. For the first time, they will have to manage themselves. Peter DruckerTheoretical Foundation
|
happened before →
|
e11 → e12 , e12 → e22
e21 → e13 , e14 || e24 |
To realize the relation → we need a clock Ci at each process Pi in the system
Ci(a) -- timestamp of event a at Pi
if a → b, then C(a) < C(b)
→ is irreflixive, defines partial order among events
Totally ordering relation ( => ) can be defined by ( on top of the above )
Pj
( e.g. Pi
Pj if i ≤ j, to break ties )

n = number of processes in a distributed system
Each event in process Pi ~ vector clock Ci ( integer vector of length n )
| Ci = | ![]() |
Ci[1]
Ci[2] .. Ci[n] |
![]() |
Implementation Rules:
Assertion.
At any instant

Comparing two vector timestamps of events a and b
| Equal | ta = tb | iff | all i, | ta[i] = tb[i] |
| Not Equal | ta ≠ tb | iff | some i, | ta[i] ≠ tb[i] |
| Less Than or Equal | ta ≤ tb | iff | all i, | ta[i] ≤ tb[i] |
| Not Less Than or Equal To | ta |
iff | some i, | ta[i] > tb[i] |
| Less Than | ta < tb | iff | all i, some j, | ta[i] ≤ tb[i], ta[j] < tb[j] |
| Not Less Than | ta |
iff | !(ta < tb) | |
| Concurrent | ta || tb | iff | ta[i] |
Now, a → b iff ta < tb
otherwise concurrent

if Send( M1 ) → Send( M2 )
then the receipient should receive M1 before
M2
i.e. Send( M1 ) → Send( M2 ) requires Receive( M1 ) → Receive( M2 )
Birman-Schiper-Stephenson Protocol: Enforcing Causal Ordering of Messages
Assumes broadcast communication channels that do not loose or corrupt messages. ( i.e. everyone talks to everyone ). Use vector clocks to "count" number of messages ( i.e. set d = 1 ). n processes.



Schiper-Eggli-Sandoz were able to solve the problem without broadcasting channels


each process has two states S1, S0
![]() |
→ |
![]() |
| |
|
|
![]() |
← |
![]() |
four global states : in-P1, in-C1, in-P2, in-C2
Suppose
inconsistency arises because P1 recorded its state before P sent a message along C and C recorded after P sent the message
let n = # of messages sent along C1 before P1 recorded its state
and
let n' = # of messages sent along C1 before C1 recorded its state
e.g. n = 0, n' = 1 in the above example
we see that recorded global state may be inconsistent if n < n'
Suppose
Thus consistent global state requires n = n'
Similarly, if
Also a consistent global state must satisfy
or from above we have
Chandy-Lamport Global State Recording Protocol
The goal of this distributed algorithm is to capture a consistent global state. It assumes all communication channels are FIFO. It uses a distinguished message called a marker to start the algorithm.
Example
In this example, all processes are connected by communications channels Cij. Messages being sent over the channels are represented by arrows between the processes.
Snapshot s1:
Snapshot s2: now a message is in transit on C12 and C21.
The recorded process states and channel states must be collected and assembled to form the global state. ( e.g. send G.S. to all processes in finite time )
Termination
each process must ensure that
A remark ( state without proof here )





C = { c1, c2, ... ,cn }
ci -- cut event, local state of
site ( or process ) Si at that instant
all Si, all Sj, no ei, no ej such that
ci )


Time of a cut
C = { c1, c2, ... ,cn }
Ci -- vector clock of ci
TC = sup ( C1, C2, ... , Cn )
TC[k] = max ( C1[k], C2[k], ... , Cn[k] )
| TC = | |
C1[1] C2[2] . . Cn[n] |
|
-------------- (1) |
| TC = sup ( C1, C2, ... , Cn ) = | |
C1[1] C2[2] . . Cn[n] |
|
On the other hand if (1) is true
we have Ci[i] ≥ Cj[i] for all i, j.
This implies that the the events ci are concurrent
and the cut is consistent.
Huang's Termination Detection Protocol
Notation:

Total number of messages passed: 8 (one to start each computation, one to return the weight).