chronyc tracking my current offset, drift, root dispersionchronyc sources -v who I'm listening to and whytimedatectl sync state at a glancentpq -pn peer table for classic ntpdethtool -T eth0 does my NIC do HW timestamping?pmc -u 'GET CURRENT_DATA_SET' PTP offset from masteradjtimex -p peek at kernel discipline stateWhy I Drift (I Cannot Help It)
My heartbeat is a quartz crystal, and quartz ages, warms, and lies. Left alone I wander — synchronization is a control loop that corrects me continuously, not a lookup I perform once.
ppmoffsetdrift (frequency error)jitterWall clock (CLOCK_REALTIME)
Tracks UTC and can jump backward when I'm stepped. Use for timestamps, never for measuring elapsed time.
Monotonic (CLOCK_MONOTONIC)
Never steps backward, immune to my corrections. Use for durations, timeouts, and benchmarks.
Time Scales I Answer To
| Scale | Definition | Relationship |
|---|---|---|
TAI | Atomic time, no leap seconds, monotonic | The physics baseline |
UTC | Civil time, kept near Earth rotation via leap seconds | TAI − 37 s (as of 2024) |
GPS time | Atomic, from the satellite constellation | TAI − 19 s (no leaps) |
Unix time | Seconds since 1970 epoch | Counts UTC, ignores leaps |
Leap seconds
Inserted UTC steps (a 23:59:60) that make me repeat or skip a second — a discontinuity that breaks naive elapsed-time math.
Leap smearing
Google/AWS spread the leap second over ~24 h by slewing, so I never see 23:59:60. Never mix a smearing server with a stepping one.
The NTP Stratum Hierarchy
NTP is a tree of authority. Distance from a reference clock is stratum; error accumulates with every hop, so higher stratum means less trustworthy.
stratum 0stratum 1stratum 2–15pool 2.pool.ntp.org| Mode | Config | Use |
|---|---|---|
| Client/server | server host iburst | Normal upstream sync |
| Symmetric peer | peer host | Mutual sync between equals |
| Broadcast/multicast | broadcastclient | LAN fan-out, lower accuracy |
The Four-Timestamp Dance
Every exchange yields four timestamps: T1 (client send), T2 (server recv), T3 (server send), T4 (client recv). From these I compute offset and round-trip delay.
offset θ = ((T2 − T1) + (T3 − T4)) / 2
delay δ = (T4 − T1) − (T3 − T2)
clock filterselectionfalsetickerclusteringroot delayroot dispersionKernel Discipline & Daemons
The daemon computes corrections; the kernel applies them via adjtimex(), either nudging my frequency (slew) or resetting me outright (step).
Slewing
Gradually speeds or slows me so time stays monotonic. Default for small offsets;