- 2071 Shrawan · 3+5 marks
Clock sync problems; Chandy-Lamport
Short answer
Common problems: clock drift, variable network delays, single point of failure, faulty clocks, and inability to move clocks backward. Chandy-Lamport algorithm: a process records its state, sends markers on all channels; on first marker, record state and set that channel empty; on later markers, record intervening messages as channel state. This yields a consistent global snapshot.
What are the common problems of physical clock synchronization algorithms? Write Chandy-Lamport's algorithm for recording global states in Distributed System.
Common problems of physical clock synchronization algorithms
- Clock drift and skew: oscillators run at different speeds, so clocks diverge between synchronisations.
- Unpredictable message delay: the accuracy is limited by the variable network delay and its asymmetry (Cristian, NTP).
- Single point of failure: a single time server (Cristian) fails or gives wrong time; a faulty master affects all (Berkeley).
- Faulty or malicious clocks: wrong values corrupt the average (need outlier rejection).
- Clock cannot move backwards: adjusting must be gradual, which takes time.
- Scalability and traffic: frequent polling loads the network.
- Accuracy limited to milliseconds; needs UTC reference for external sync.
Chandy-Lamport global snapshot algorithm
Purpose: record a consistent global state (state of every process and of every channel) of a distributed system without stopping it. Assumptions: channels are FIFO and reliable; the processes are connected; any process can start the snapshot.
Marker rule for sending: After a process Pi records its state, it sends a marker on each outgoing channel before sending any further messages.
Marker receiving rule: On receipt of a marker on incoming channel c:
- If Pi has not yet recorded its state: it records its own state, records the state of channel c as empty, and starts recording messages arriving on its other incoming channels (and sends markers on all outgoing channels).
- Else (already recorded): the state of channel c is the sequence of messages received on c after Pi recorded its state and before the marker arrived.
Initiation: Any process records its state and sends markers on all outgoing channels.
Termination: The snapshot is done when every process has received a marker on each of its incoming channels. The recorded process states and channel states are then collected at one place.
P1 --m--> P2 P1 records state S1, sends marker
P1 --marker--> P2 P2 gets marker first time:
records S2, channel(P1->P2) = {}
sends markers on its outputs
Messages arriving at P2 on other channels before their
markers are saved as that channel's state.
The recorded global state is consistent (a consistent cut): no message is recorded as received without being recorded as sent. It is used for deadlock detection, termination detection and checkpointing.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Physical clock synchronization algorithm · Distributed System, chapter 5
- Clock synchronization need; Lamport · Distributed System, chapter 5
- Problems of Lamport's clock; vector clock · Distributed System, chapter 5 · asked 2×
- Lamport's logical clock algorithm · Distributed System, chapter 5 · asked 5×
- Physical vs logical clock; sync method · Distributed System, chapter 5 · asked 2×
- Vector clock synchronization algorithm · Distributed System, chapter 5 · asked 2×
- Clock synchronization in DFS · Big Data Technologies, chapter 1
- Common problems of existing foundations · Building Technology, chapter 2 · asked 2×
- Global structure of multimedia system · Multimedia System, chapter 1 · asked 3×