Network Time Protocol (NTP) works by exchanging timestamped UDP packets between a client and a server, then using four timestamps to compute the network delay and clock offset that separate them. The client corrects its clock by that offset, keeps the best of several servers, and repeats the exchange at intervals measured in seconds to minutes. Accuracy on a local network reaches sub-millisecond levels; across the public internet it typically lands within a few milliseconds.
The mechanism rewards a closer look, because every step exists to defeat a specific source of error. A clock that is wrong by one second can invalidate a security certificate, corrupt a database transaction order, or desynchronize a distributed system. NTP turns a noisy, one-way network path into a disciplined estimate of true time, and it does so with a small, bounded exchange.
The Four-Timestamp Exchange
The core of NTP is a single round trip that produces four timestamps. The client stamps a packet with its transmit time (t1) and sends it to the server. The server records its receive time (t2) and its transmit time (t3). The client records when the reply arrives (t4). Those four numbers are enough to solve for two unknowns: the round-trip delay and the offset between the two clocks.
The math is simple arithmetic applied to the four values. Round-trip delay is (t4 − t1) minus the server's processing time (t3 − t2). Clock offset is the average of the two one-way differences: [(t2 − t1) + (t3 − t4)] divided by two. The client adds that offset to its own clock, subtracting the estimated delay it incurred on the path.
Why four timestamps instead of two? A single timestamp pair cannot separate clock error from network delay. If the client sends at 10:00:00.000 and the server receives at 10:00:00.050, the 50-millisecond gap could be almost entirely travel time or almost entirely a slow client clock. The four-timestamp exchange assumes the outbound and return paths are roughly symmetric, so delay cancels out and offset remains. This symmetry assumption is the protocol's central bet, and its failure modes all trace back to it.
Why Symmetry Matters and Where It Breaks
The symmetry assumption says the request and reply experience nearly equal delay. When true, the offset calculation is exact. When false, the error equals half the asymmetry between the two directions. A path that takes 20 milliseconds outbound and 60 milliseconds back introduces a 20-millisecond offset error, even though the round-trip delay itself looks perfectly plausible.
Real networks violate symmetry constantly. Asymmetric routing sends packets through different paths each way. Queue buildup on one direction adds delay the other direction never sees. A congested uplink can add tens of milliseconds to outbound traffic while the return path stays clear. NTP cannot detect these asymmetries from the four timestamps alone; it can only mitigate them.
The protocol mitigates through selection and averaging rather than through a single measurement. It contacts multiple servers, discards outliers, and combines the survivors. Each server contributes a root distance estimate that accounts for its own synchronization quality and the path to it. A server closer to a reference clock, reached over a symmetric path, earns more weight. This is why a stratum-1 server on the local network outperforms a stratum-2 server across the country, and why NTP configurations list several servers instead of one.
Stratum Levels and the Clock Hierarchy
NTP organizes time sources into a hierarchy called strata, but the term misleads. Stratum does not measure accuracy directly; it measures distance in hops from a reference clock. A stratum-0 device is the reference itself, typically an atomic clock or a GPS receiver. A stratum-1 server syncs directly to stratum-0 hardware. Each additional stratum adds one step of synchronization and, in principle, one increment of error.
The hierarchy exists to scale. A single reference clock cannot serve millions of clients. Stratum-1 servers fan out to stratum-2 servers, which fan out to stratum-3, and so on, so load spreads across the tree. Most public NTP pools cap usable servers at stratum 2 through 4, and clients beyond stratum 15 are considered unsynchronized. The hierarchy therefore trades directness for reach.
Here the counterintuitive detail appears: a lower stratum number does not guarantee better time. A well-run stratum-3 server on a symmetric local network can beat a distant stratum-1 server reached over a congested, asymmetric transit path. The hierarchy tracks distance from a reference, not the quality of the path to your machine. Experienced operators select servers by observed jitter and delay, not by stratum alone.
Quantified Accuracy: What to Expect
Accuracy depends on where the client sits relative to its servers. On a local area network, round-trip delays of well under a millisecond and symmetric paths yield offset estimates in the tens of microseconds and timekeeping in the low hundreds of microseconds. Over the public internet, round-trip times of 10 to 100 milliseconds and occasional asymmetry push typical offset to a few milliseconds, with worst cases reaching tens of milliseconds during congestion.
The clock's own behavior sets a floor on how well it holds time between updates. A typical quartz oscillator drifts by roughly 10 to 50 parts per million, which works out to a few seconds per day if left uncorrected. NTP's polling interval adapts to measured drift: well-behaved clocks poll servers every 64 to 1,024 seconds, while unstable ones poll faster. The daemon also slews the clock gradually for small corrections rather than stepping it, avoiding jumps that break applications.
These figures describe stable mechanical regimes, not current products or prices. The ranges are the durable part; specific hardware and vendor numbers change and are omitted here. The practical takeaway is that NTP delivers sub-millisecond accuracy on controlled networks and single-digit milliseconds on the open internet, and that a free-running clock would lose seconds per day without it.
The Timeline of a Synchronization Round
Each exchange follows a fixed sequence, and the time course matters for understanding what the daemon does between updates.
| Stage | What happens | Typical timing |
|---|---|---|
| Client transmits request (t1) | Outbound UDP packet leaves with client timestamp | Start of round |
| Server receives (t2) | Server notes arrival against its own clock | Network one-way delay |
| Server responds (t3) | Reply leaves with server timestamps | Server processing, microseconds |
| Client receives reply (t4) | Client stamps arrival, computes delay and offset | Network one-way delay |
| Clock adjustment | Daemon applies slew or step based on offset size | Milliseconds after computation |
| Poll interval | Next exchange scheduled based on drift and stability | 64 to 1,024 seconds |
| Clock discipline | Daemon filters, selects, and combines multiple servers | Continuous |
The whole exchange occupies milliseconds, but the discipline loop runs for minutes. This split matters: measurement is fast, correction is deliberate. The daemon would rather make a small error for a few minutes than thrash the clock with aggressive corrections.
What NTP Cannot Fix
NTP corrects offset and keeps drift in check, but it cannot repair symmetric-path violations, and it cannot detect a server that is itself wrong. If a server's clock has drifted or been misconfigured, the client will faithfully copy the error, and no amount of averaging across servers fixes a majority that share the same fault. The protocol defends against this with plausibility checks and by preferring servers that agree with one another, but disagreement among honest servers is a real limit.
The protocol also assumes the reference hierarchy is trustworthy. An attacker who can spoof or intercept NTP traffic can shift a client's clock, and the basic protocol offers no cryptographic authentication by default. Deployments that need integrity use NTP's authentication extensions or a symmetric key scheme, but ordinary public-pool time is unauthenticated. The practical consequence is that NTP is a coordination tool, not a security boundary.
Red flag: a client whose only configured server is on a congested, asymmetric link can be wrong by half the asymmetry and never know it. Red flag: an unauthenticated public time source can be manipulated, so security-sensitive deployments need authenticated time. Red flag: a server that loses its upstream sync will keep serving time that slowly drifts, and clients inherit the drift. Red flag: clocks stepped rather than slewed can break applications that assume monotonic time. Red flag: firewall rules that block UDP port 123 will leave a machine silently unsynchronized.
Common Misconceptions
The most persistent misconception is that NTP sets the clock once and is done. In practice, synchronization is continuous. The daemon never stops polling, because quartz drift never stops, and the discipline loop exists to track that drift. A machine that stops syncing for a day can be seconds off.
A second misconception treats stratum as a quality score. As the hierarchy section explains, stratum measures hops from a reference, not accuracy. A stratum-3 server with a short, symmetric path can outperform a distant stratum-1 server, and operators who rank servers by stratum alone often underperform.
A third misconception assumes the four-timestamp exchange yields exact time. It yields an estimate, bounded by the symmetry assumption, and the estimate carries error the protocol cannot measure. The honest description is that NTP computes the best offset consistent with the timestamps it received, then hedges with multiple servers.
A fourth misconception conflates NTP with its simpler cousins. The table below separates the main alternatives, because the differences matter for choosing a tool.
| Protocol or method | Synchronization | Typical accuracy | Authentication | Best use |
|---|---|---|---|---|
| NTP (full daemon) | Continuous, adaptive polling | Microseconds to milliseconds | Optional extensions | General servers and networks |
| SNTP (simple client) | Periodic, single exchange | Milliseconds to tens of milliseconds | None built in | Appliances and low-precision devices |
| GPS/GNSS receiver | Direct from satellites | Nanoseconds to microseconds | Physical signal | Reference clocks and stratum-1 servers |
| PTP (IEEE 1588) | Hardware-timestamped exchange | Sub-microsecond | Optional | Industrial and financial systems |
| Manual clock setting | One-time human input | Seconds to minutes | None | Machines with no network |
The comparison shows the tradeoff frontier: NTP balances reach and accuracy, PTP buys precision with hardware support, and SNTP trades accuracy for simplicity. Choosing among them is a matter of the required accuracy and the appetite for configuration.
Practical Actions
The first concrete step is to configure multiple servers from a reputable pool and let the daemon select among them. Four sources are the usual minimum, because selection needs enough candidates to reject outliers. Configure them explicitly rather than relying on whatever default the operating system shipped.
The second step is to allow UDP port 123 outbound and inbound for the response. A firewall that blocks it leaves the machine unsynchronized with no visible error, so verify that the daemon reports a valid sync state after configuration. Check that the daemon shows reachable peers and a sane offset.
The third step is to keep the polling interval adaptive rather than forcing a short one. The daemon speeds up polling when drift is high and slows it when the clock is stable, which reduces load on public servers without sacrificing accuracy. Forcing aggressive polling helps no one and can trigger server-side rate limits.
The fourth step is to distinguish slewing from stepping. Small corrections should be slewed so applications see monotonic time; stepping should be reserved for large errors when startup or a long outage demands it. Configure the threshold to match the applications you run.
The fifth step is to monitor drift over time. A clock whose offset keeps growing between updates signals a hardware problem or a persistently asymmetric path. Watching the trend, rather than any single reading, is how operators catch failing timekeeping before it breaks something downstream.
Limits and the Boundary of What Can Be Concluded
NTP's guarantees are bounded by measurement quality, and measurement quality is bounded by path symmetry and server trustworthiness. Within those bounds, the protocol is remarkably effective: it turns a careless clock into a coordinated one and does so with a small, well-understood exchange. Beyond them, it cannot distinguish a slow network from a fast wrong clock, and it cannot verify that a server is honest.
The stable part of what can be concluded is the mechanism itself: four timestamps, a symmetry assumption, selection across servers, and a discipline loop that tracks drift. The changing part, which servers to use, which hardware to buy, and what any vendor claims about accuracy, depends on evidence that was not supplied and should be verified locally. The mechanism is durable; the numbers around it are not.