Clock Synchronization Demo
Visualize clock offset, drift, network delay, NTP/PTP exchange timing, and correction quality
Clock Synchronization Workbench
See why IoT devices need shared time, how drift accumulates between sync events, and why network delay, jitter, and asymmetric paths limit NTP, PTP, SNTP, and gateway beacons.
What
Clock sync estimates how far a device clock is from a reference clock, then corrects it or slows/speeds it back into line.
Why
Bad time breaks event ordering, TDMA slots, security token checks, log correlation, and coordinated actuation.
Try First
Use NTP campus, press Step Exchange, then increase asymmetry. The offset estimate becomes biased by half the path imbalance.
Notice
Frequent sync reduces drift, but it cannot remove delay asymmetry. PTP improves precision by timestamping close to the wire.
Message timing and clock error
A device compares its local clock with a reference by exchanging timestamped messages.
Exchange timeline
Offset between syncs
Current explanation
Clock drift builds until the next synchronization event. The device clock gains or loses time according to its oscillator drift. Resync interval controls how much error can accumulate before the next correction.1. Drift builds
Oscillator drift accumulates offset between synchronization events.2. Timestamp exchange
Client and reference exchange timestamps over a delayed network path.3. Estimate offset
NTP/PTP estimate offset and delay, but asymmetry creates bias.4. Correct clock
Step or slew the clock, then choose the next resync interval.Learning Support
Minimum Background
Offset is the current time difference. Drift is the rate that this difference grows. Jitter is short-term variation.
Mental Model
A sync protocol asks: how late did the message arrive, and how far should I move my local clock?
Key Limitation
Round-trip protocols can estimate delay, but unequal forward and return paths bias the offset estimate.
Quick Reference
NTP Offset
theta = ((T2 - T1) + (T3 - T4)) / 2. This estimates the correction from client time to server time.
NTP Delay
delta = (T4 - T1) - (T3 - T2). It estimates round-trip delay, not one-way delay.
Drift
drift_ms = ppm * interval_s / 1000 for one clock relative to a reference.
Asymmetry
If forward and return paths differ by 10 ms, round-trip offset can be biased by about 5 ms.
PTP
PTP can reach sub-microsecond accuracy when switches and endpoints support hardware timestamping.
Step vs Slew
Stepping jumps the clock. Slewing adjusts the rate so applications see monotonic time.