Search⌘ K
AI Features

Lamport Clocks

Explore how Lamport clocks help track the order of events across distributed nodes by using logical counters. Understand their rules, clock consistency condition, and limitations in inferring causality. Learn practical applications of Lamport clocks for total event ordering despite lacking strong consistency, aiding synchronization tasks in distributed systems.

Leslie Lamport invented one of the first and simplest types of logical clocks, called the Lamport clockL. Lamport, “Time, Clocks, and the Ordering of Events in a Distributed System,” Communications of the ACM 21, 7 July 1978, 1978..

In this type of logical clock, every node in the system maintains a logical clock in the form of a numeric counter that starts from zero when a node starts operating.

Rules of the protocol

  • (R1) Before executing an event (send, receive, or local), a node increments the counter of its logical clock by one: Ci=Ci+1C_i = C_i + 1.
  • (R2) Every sent message piggybacks the clock value of its sender at sending time. When a node nin_i receives a message with timestamp CmsgC_{msg}
...