Physical time cannot order events across separated machines, because a distributed system lacks a shared clock and cannot observe global time directly. In his 1978 Communications of the ACM paper, Leslie Lamport replaced wall-clock assumptions with the “happened before” relation (->), showing that causal precedence across networked processes forms a partial order rather than a single timeline.
That distinction still governs distributed databases, replicated logs, and causal tracing. Before reaching for synchronized hardware or central locks, engineers must separate three questions: whether one operation could have influenced another, how to build a deterministic tie-broken total order for replication, and when external user actions still demand bounded physical clock skew.
- Partial order from three rules:
a -> bholds within one process, from message send to receipt, and by transitivity; unrelated events are concurrent. - Logical clocks work in one direction only:
IR1andIR2guaranteea -> bimpliesC(a) < C(b), whileC(a) < C(b)never provesacausedb. - Total order enables replication, with a catch: breaking timestamp ties by process ID builds a deterministic state-machine order
=>, though a single crashed node halts the 1978 design. - Out-of-band channels motivate physical bounds: a phone call between users exposes anomalies invisible to counters, solved by bounding clock drift (
kappa <= 10^-6) and skewepsilon / (1 - kappa) <= mu.
Why physical time and naive coordinators fail
In an airline reservation system, “grant a seat if requested before the flight fills” sounds unambiguous until terminals sit on separate machines. Lamport defines a system as distributed whenever message delay is non-negligible relative to time between local events, covering both an ARPAnet cluster and CPU, memory, and I/O buses inside one computer.
Without global physical clocks, real-time ordering is unobservable, and real clocks drift anyway. Lamport therefore defines “happened before” (->) strictly over events that actually occurred (unlike special relativity’s light cones over possible messages): a -> b if a precedes b in one process, a sends a message received at b, or a transitive chain links them.
Events with no connecting path are concurrent, regardless of wall-clock position. In Figure 1, p1 -> r4 along the message chain p1 -> q2 -> q4 -> r3 -> r4, whereas p3 and q3 are concurrent: even if q3 appears earlier in physical time, P learns nothing about q3 until Q’s message arrives at p4.
That asymmetry breaks a central FIFO scheduler P0. If P1 requests a lock from P0 and then messages P2, which immediately requests the same lock from P0, differing network delays let P2’s request arrive first, violating causal order (P1 -> P2).
Logical clocks and replicated state machines
Each process Pi keeps a counter Ci obeying the Clock Condition: a -> b implies C(a) < C(b). The converse cannot hold: in Figure 1, p2 and p3 are both concurrent with q3, so requiring C(a) < C(b) iff a -> b would force C(p2) = C(q3) = C(p3), contradicting p2 -> p3.
Two implementation rules enforce the Clock Condition:
- Rule IR1 (local advance):
PiincrementsCibetween any two successive local events. - Rule IR2 (message carry): Every message
mcarriesTm = Ci(a). On receipt,PjsetsCjstrictly pastTmand not below its current value (max(Cj, Tm) + 1).
Drawing dashed “tick lines” through equal clock values across processes flattens space-time into horizontal time slices (Figures 2 and 3), though any valid slice choice is equally valid without physical time.
Breaking ties via any fixed process order < produces a deterministic total order =>: a => b when Ci(a) < Cj(b), or Ci(a) = Cj(b) and Pi < Pj (Footnote 3 notes rotating via C(a) mod N improves fairness). Lamport uses => in a five-rule distributed mutual exclusion protocol over FIFO reliable links: Pi broadcasts a timestamped request and acquires the resource once its request leads its local queue under => and it has heard a later timestamp than Tm from every peer.
Generalizing, every process simulates a deterministic state machine e: C x S -> S by applying command T once it has seen all commands <= T from every peer. That insight launched state-machine replication (Chandy-Lamport, Paxos), yet the 1978 design stalls completely if one node crashes because peers wait forever for its timestamps, and without physical time a crashed node is indistinguishable from a slow one.
Anomalous behavior and physical clock bounds
Logical clocks still fail when causality leaves the network. In Lamport’s “anomalous behavior” example, a user submits request A on computer A and phones a friend to submit B on computer B. Externally A preceded B, yet B can get a smaller logical timestamp and run first.
Lamport offers two fixes: return TA to the caller so the friend requests a timestamp > TA (anticipating causal tokens and hybrid logical clocks), or synchronize physical clocks Ci(t) to satisfy the Strong Clock Condition (a ->_ext b implies C(a) < C(b)). With drift bounded by |dCi(t)/dt - 1| < kappa (PC1, typically kappa <= 10^-6), skew bounded by |Ci(t) - Cj(t)| < epsilon (PC2), and minimum causal propagation delay mu, anomalies disappear when epsilon / (1 - kappa) <= mu.
Clocks must never step backward, which risks breaking C1. Instead, IR1' keeps clocks ticking forward at rate > 0, while IR2' stamps each message Tm = Ci(t) with known minimum transit delay mu_m and advances receivers to max(Cj(t' - 0), Tm + mu_m). Over a strongly connected network of diameter d where links carry messages with unpredictable delay < xi at least every tau seconds, Lamport’s appendix theorem bounds skew after t0 + tau * d by epsilon = d * (2 * kappa * tau + xi) (roughly 5 ms for kappa = 10^-6, tau = 1s, xi = 1 ms, d = 5).
Trace four ordering edge cases
Scalar clocks feel trivial until you trace what changes when a message jumps ahead, ties collide, or causality travels out of band. Step through the four cases below to see exactly how IR1, IR2, =>, and PC1/PC2 respond.
Select a case (or use Left and Right arrow keys) to inspect the event trace, what breaks naively, the paper's rule, and modern parallels.
Sequential events in one process
Rule IR1Events p1, p2, p3 execute inside process P with no incoming messages from other nodes.
- Why naive fix breaks
- Reading a coarse or backward-stepped wall clock can assign two successive local instructions the same or inverted timestamps.
- Paper's mechanism
- IR1 increments Ci between every pair of successive events in Pi, guaranteeing condition C1: Ci(a) < Ci(b).
- Paper example
- Process P assigns distinct strictly increasing numbers (for example 1, 2, 3) along its vertical timeline in Figure 2.
- Modern engineering link
- Monotonic sequence counters inside Raft terms or HLC logical-counter bits prevent duplicate version stamps within one millisecond.
Fast sender meets lagging receiver
Rule IR2Process Q sends message m at Cq = 3 to process P whose local counter sits at 1 (or vice versa, P at 10 receives Tm = 4).
- Why naive fix breaks
- Using only local counters lets a busy sender emit at t=8 while a quiet receiver logs receipt at t=2, reversing cause and effect.
- Paper's mechanism
- IR2 attaches Tm = Cq(send) and forces the receiver to set Cp = max(Cp, Tm) + 1 before recording the receive event.
- Paper example
- In Figure 2, q1 at time 1 sends to p2, advancing P past 1; if P is already at 10 and receives Tm = 4, P advances to 11.
- Modern engineering link
- RPC metadata carries HLC or Lamport headers in CockroachDB and YugabyteDB so causal reads never observe stale snapshot timestamps.
Concurrent events with identical clock values
Total order =>Events p2 in P1 and q3 in P2 both land at logical timestamp 4 with no message path between them.
- Why naive fix breaks
- Leaving equal timestamps unordered causes replicas simulating state machine S to apply commands in different orders and diverge.
- Paper's mechanism
- Define total order => using fixed process priority Pi < Pj (or rotating C(a) mod N) whenever Ci(a) = Cj(b).
- Paper example
- In Section 4, P1 and P2 both enter requests at T = 4; all queues agree that P1 precedes P2 if P1 < P2.
- Modern engineering link
- Last-write-wins registers in Dynamo-style stores break timestamp ties using node IDs, though without consensus they drop concurrent writes.
Out-of-band causality beats internal counters
Strong Clock ConditionA user issues request A on node A, phones a friend to submit B on node B, and B receives a smaller logical clock than A.
- Why naive fix breaks
- Because the telephone call is not a message inside the distributed system, IR1 and IR2 have zero visibility into A ->_ext B.
- Paper's mechanism
- Either return TA to the caller to pass explicitly, or sync physical clocks via IR1'/IR2' so epsilon / (1 - kappa) <= mu.
- Paper theorem bound
- With diameter d, drift kappa, period tau, and jitter xi, skew stays within d * (2 * kappa * tau + xi) after t0 + tau * d.
- Modern engineering link
- Google Spanner's TrueTime enforces external consistency via commit wait rather than relying solely on logical clocks.
Source: Lamport (1978), Sections 2 through 6.
If you skip clicking through the tabs, here is the core logic across all four cases:
- Local advance (
IR1): every process bumps its own counter between local events so intra-process order is never tied or inverted. - Message jump (
IR2): piggybackingTmforces lagging receivers forward, preservinga -> b => C(a) < C(b)regardless of clock skew. - Tie breaking (
=>): comparing(C(a), process_id)produces one deterministic sequence across all replicas, though the choice among concurrent events is arbitrary. - Out-of-band causality (
Strong Clock Condition): when real users coordinate outside the protocol, you must either propagate causal tokens explicitly or bound physical clock uncertainty below minimum inter-event latencymu.
Caveats and what changed after 1978
Three boundaries separate Lamport’s 1978 paper from production consensus and storage systems built today.
First, scalar clocks cannot detect concurrency. Because C(a) < C(b) holds both when a -> b and when a and b are independent, a single integer cannot tell you whether two writes conflicted. Fidge and Mattern solved this a decade later with vector clocks of size O(N), trading per-message metadata proportional to cluster size for an exact biconditional (a -> b iff V(a) < V(b)).
Second, all-node participation halts on a single crash. Lamport’s mutual exclusion and state-machine protocols assume every process eventually acknowledges every timestamped event over reliable FIFO links. That makes the 1978 state machine non-fault-tolerant; Lamport spent the next decade removing that assumption, culminating in The Part-Time Parliament where only a majority quorum is needed.
Third, physical clock synchronization requires trusted latency bounds. The appendix theorem assumes a strongly connected topology with predictable minimum delay mu_m and bounded jitter xi. On modern public clouds, asymmetric routes, VM pauses, and NTP slewing can violate those bounds, which is why systems like Google Spanner pair GPS and atomic clocks with an explicit uncertainty wait (commit wait), while clusters without specialized hardware use hybrid logical clocks to stay near wall time without breaking causality.
For engineers designing distributed systems today, Lamport’s 1978 lesson remains exact: decide first whether your invariant needs only causal order (tokens or HLCs), deterministic total order across replicas (consensus rather than all-to-all timestamps), or external real-time order (bounded uncertainty). Mixing those three requirements up is how silent ordering bugs survive integration tests and surface in production.


