Why clocks drift
Each machine has its own oscillator that runs slightly fast or slow, so clocks drift apart over time. Distributed systems that compare timestamps across machines need them roughly aligned.
How NTP works
The Network Time Protocol syncs a machine to time servers arranged in tiers called strata.
- The client measures round trip delay to a server and estimates one way latency as half of it.
- It uses that estimate to correct its offset from the server.
- It slews the clock gradually rather than jumping, to avoid time going backward.
Why you still cannot trust it
Even synced, clocks have an uncertainty window of several milliseconds. Comparing two timestamps across machines can give the wrong order if they fall within that window. This is why systems avoid relying on wall clocks for ordering and prefer logical clocks or bounded uncertainty like TrueTime.
Key idea
NTP narrows clock drift using round trip estimates and gradual slewing, but a residual uncertainty window means physical timestamps cannot be trusted for precise cross machine ordering.