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.
We'll cover the following...
Leslie Lamport invented one of the first and simplest types of logical clocks, called the
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: .
- (R2) Every sent message piggybacks the clock value of its sender at sending time. When a node receives a message with timestamp