CCiDS

Capturing Causality in Distributed
Systems
Michel Raynal, Mukesh Singhal
IEEE Computer, pp. 49-56, February 1996
Abstract
This article presents a general framework of a system of logical clocks in
distributed systems and discuss three methods—scalar, vector, and matrix—for
implementing logical time in these systems. And it also presents three efficient
implementations.
Introduction
A MODEL OF DISTRUBUTED EXECUTIONS
CONSISTENT:
 clock consistency:
e1  e2  C(e1) < C(e2)
 strongly consistent:
e1  e2  C(e1) < C(e2)
Implementing logical clocks

SCALAR TIME
Rules R1 and R2 update the clocks as follows.
R1. Before executing an event (send, receive, or internal), pi executes the
following:
Ci := Ci + d (d > 0)
R2. Each message piggybacks the clock value of its sender at sending time. When
pi receives a message with the timestamp Cmsg, it executes the following actions:
1. Ci := max(Ci , Cmsg)
2. Execute R1.
3. Deliver the message.
However, the system of scalar clocks is not strongly consistent.

VECTOR TIME
The process pi use the following R1 and R2 to update its clock.
R1. Before executing an event, pi updates its local logical time as follows:
vti[i] := vti[i] + d (d > 0)
R2. Each sender process piggybacks a message m with its vector clock value at
sending time. Upon receiving such a message (m, vt), pi executes the following
sequence of actions:
1. Update its logical global time as follows:
1  k  n: vti[k] := max(vti[k], vt[k])
2. Execute R1.
3. Deliver the message m.
The system of vector clocks is strongly consistent.

MATRIX TIME
Process pi use the following R1 and R2 to update its clock.
R1. Before executing an event, pi updates its local logical time as follows:
mti[i, i] := mti[i, i] + d (d > 0)
R2. Each message m is piggybacked with the matrix time mt. When pi receives
such a message (m, mt) from pi, pi executes the following sequence of actions:
1. Update its logical global time as follows:
1  k  n: mti[i, k] := max(mti[i,k], mt[j, k])
1  k, l  n: mti[k, l] := max(mti[k, l], mt[k, l])
2. Execute R1.
4. Deliver message m.
EFFICIENT IMPLEMENTATIONS

Singhal-Kshemkalyani’s differential technique

Fowler-Zwaenepoel’s direct-dependency technique

Jard-Jourdan’s adaptive technique
Conclusion
We have presented a general framework of logical clocks in distribution systems
and have discussed three systems of logical clocks: scalar, vector, and matrix. We also
discussed three efficient implementations of vector clocks; similar techniques can be
used to efficiently implement matrix clocks.