Concepts
The core ideas behind ClockBound: the clock error bound, the window of uncertainty, and clock status.
The Clock Error Bound
The Clock Error Bound (CEB) is a measure of clock accuracy. It is defined against reference time (UTC) and represents the maximum difference between the local clock on your computer and that reference time.
Crucially, the clock error bound is not the offset against the sources ClockBound tracks. Instead it reports the worst case: every source of error accumulated along the path from the reference clock to your computer. That makes it a general metric for comparing timestamps across nodes, independent of their location or synchronization protocol.
The window of uncertainty
For every event of interest, a ClockBound client reports a window of uncertainty defined by two timestamps, earliest and latest, that bound reference time. The window is simply the time reported by the daemon, plus or minus the clock error bound.
The bound grows between clock updates as the local oscillator drifts, and shrinks again when a fresh reference measurement arrives. When two nodes' windows do not overlap, their order is certain; when they do, an application knows it must not assume an order.
Drag right to advance time: the bound grows as the clock drifts, then snaps back at each clock update. Schematic illustration.
Clock status
Alongside the time window, the daemon reports a clock status so that clients can know whether the time window can be trusted.
0 — Unknown: the status of the clock is unknown. Error-bounded timestamps should not be trusted.1 — Synchronized: the clock is kept accurate by the synchronization daemon. Error-bounded timestamps can be trusted.2 — FreeRunning: the clock is free running and not being updated by the synchronization daemon. Error-bounded timestamps can be trusted.3 — Disrupted: the clock has been disrupted and its accuracy cannot be bounded. Error-bounded timestamps should not be trusted.
Clock disruption & the VMClock
On virtual machines, maintenance events can disrupt the clock — and the underlying clock hardware may even change — violating assumptions made by time-synchronization software. ClockBound reads the VMClock (a vDSO-style clock exposed to guests at /dev/vmclock0) to detect these disruptions and reflect them in the clock status, so applications avoid acting on untrustworthy time.
Glossary
- Clock Error Bound (CEB)
- The maximum difference between the local clock and true (reference) time. ClockBound reports it as half the width of the [earliest, latest] window.
- NTP
- Network Time Protocol — synchronizes a computer clock to remote time servers over the network.
- PHC
- PTP Hardware Clock — a hardware clock (on EC2, exposed via the ENA driver) that provides a highly accurate local time reference.
- VMClock
- A vDSO-style clock exposed to VM guests (at /dev/vmclock0) that lets software detect clock disruptions caused by VM maintenance events.
- TSC
- Time Stamp Counter — a high-resolution CPU counter (rdtsc on x86, cntvct_el0 on aarch64) used to extrapolate time between daemon updates.
- Clock status
- The daemon state for the clock: Unknown (0), Synchronized (1), FreeRunning (2), or Disrupted (3).