- Asked 2/15
- 2072 Chaitra · 2+2+6 marks
Physical vs logical clock; sync method
Short answer
Physical clocks differ from logical clocks because they track real time and drift. Synchronization is difficult due to clock drift, variable and asymmetric network delays, single points of failure, and the need not to run clocks backward. Cristian's algorithm sets the clock to server time plus half the round-trip delay, assuming symmetric delay.
Differentiate between physical clock and logical clock. Why is it difficult to synchronize physical clock? Describe a method for physical clock synchronization.
Physical vs logical clock
| Point | Physical clock | Logical clock |
|---|---|---|
| What it keeps | Actual time of day | Counter giving event order |
| Based on | Hardware oscillator | Happened-before relation |
| Unit | Seconds | Dimensionless numbers |
| Needs sync | Yes, to UTC or among themselves | No external sync |
| Drift | Yes | None |
| Examples | Cristian, Berkeley, NTP | Lamport, vector clock |
| Use | Real-time stamping, billing | Causal ordering, consistency |
Why synchronising physical clocks is difficult
- No global clock: every node has its own crystal; they run at different rates (clock drift, ~1 s in 10⁵–10⁶ s) and differ in skew.
- Variable network delay: the time to carry a message is unpredictable (congestion, queueing, routing), so the time received is already out of date.
- Asymmetric delays for request and reply make delay estimates inexact.
- Failures: time server or links may fail, clocks may be faulty.
- Clocks must not run backward (breaks ordering such as file timestamps), so correction must be gradual.
- Cost and scale: many nodes and wide area networks make frequent synchronisation expensive.
- Even after synchronisation, drift makes clocks diverge again, so it must be repeated.
Method: Cristian's algorithm
A client sends a request to a time server (which has a UTC source) at T0 and receives the server's time T_S at T1. It sets its clock to
T_new = T_S + (T1 − T0) / 2
assuming equal delay in both directions. Accuracy is within ± ((T1 − T0)/2 − Tmin). To improve: repeat several times and use the reading with the minimum round trip time; if T_new is behind the current time, slow the clock down gradually instead of jumping back.
Example: T0 = 5.000 s, T1 = 5.040 s (local), T_S = 9.000 s. T_new = 9.000 + 0.020 = 9.020 s.
Limit: the single server is a point of failure; Berkeley and NTP overcome this.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Synchronising physical clock using logical clock · Distributed System, chapter 5 · asked 2×
- Physical clock synchronization algorithm · Distributed System, chapter 5
- Need of logical clock synchronization · Distributed System, chapter 5
- Physical/logical clocks; NTP and Berkeley · Distributed System, chapter 5
- Physical vs logical clocks; Lamport · Distributed System, chapter 5
- Lamport's logical clock algorithm · Distributed System, chapter 5 · asked 5×
- Clock sync problems; Chandy-Lamport · Distributed System, chapter 5
- Clock synchronization in DFS · Big Data Technologies, chapter 1
- Logical and physical address bits · Operating System, chapter 4