← All 171 books ntp, one sync per page
One sync per page

ntp, one sync per page

Twenty-eight lessons on what NTP is: a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks, in operation since before 1985 and designed by David L. Mills; the law of one sync per page; the four timestamps t0 to t3, the offset theta and the round-trip delay delta, mitigation, discipline and the symmetry assumption; the stratum ladder from reference clocks to stratum 16, primary servers, refids and the spanning tree; the packet on UDP port 123, its header fields, the 64-bit fixed-point stamps and the 2036 rollover; the volunteer pool, the daemons ntpd, chrony, OpenNTPD and NTPsec, SNTP and timesyncd, leap seconds and smearing; trust and attacks, Network Time Security, the PTP neighbor, the RFC line from 958 to 5905, and the four-move handoff.


Steve Hodgkiss 7 lessons

One exchange, four timestamps, one correction. That's the honest clock.

ntp, one sync per page

Twenty-eight lessons on what NTP is: a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks, in operation since before 1985 and designed by David L. Mills; the law of one sync per page; the four timestamps t0 to t3, the offset theta and the round-trip delay delta, mitigation, discipline and the symmetry assumption; the stratum ladder from reference clocks to stratum 16, primary servers, refids and the spanning tree; the packet on UDP port 123, its header fields, the 64-bit fixed-point stamps and the 2036 rollover; the volunteer pool, the daemons ntpd, chrony, OpenNTPD and NTPsec, SNTP and timesyncd, leap seconds and smearing; trust and attacks, Network Time Security, the PTP neighbor, the RFC line from 958 to 5905, and the four-move handoff.


Set in Space Grotesk, Inter and JetBrains Mono (SIL Open Font License).

An honest book about its demos: no NTP daemon or query binary (ntpd, ntpq, chronyd, ntpdate, sntp) is installed on the machine that built it (verified at dispatch), so no NTP query was run and no packet was captured. The only real clock tool that ran is timedatectl; its captured output appears in one lesson labelled as a real local run. Every other fact is as the primary source states it, fetched and read during this build: the Wikipedia articles Network Time Protocol, NTP pool, Marzullo's algorithm and Precision Time Protocol, cached verbatim beside this book. No facts come from Reddit, Stack Overflow, vendor blogs or commercial sites. Every lesson that describes a practice exercise carries the label 'this book's plan', never posing as a captured fact. Independent, not affiliated with any vendor or the Wikimedia Foundation.

Your purchase is for personal use only. You do not have redistribution rights: please do not share, resell, or republish this book or its pages.

© 2026 Steve Hodgkiss. All rights reserved. Personal use only; no redistribution rights.

Edition 1.0 · stevehodgkiss.net

Contents

Contents


Part 1 · The sync itself
The law first4
Part 2 · Four timestamps
The offset theta5
Part 3 · After the exchange
Marzullo's rule6
Part 4 · The strata
Stratum sixteen7
Part 5 · The packet
The 2036 rollover8
Part 6 · The fleet
The daemons9
Part 7 · The long view
The last sync10

Per this book's plan, the law of this book is: no fact unless a cached source line holds it, no invented NTP output anywhere, because no NTP daemon or query binary is installed on this machine, one real local run of timedatectl quoted as captured, and every practice exercise labelled as this book's plan.

NTP companion · No. 01
the law

The law first

honest sources, one real demo

the law before the first exchange: honest sources, one real runno NTP daemon or querybinary on this machinethe book's law: every facttraced to a source lineone real tool ran here:timedatectl, capturedduring the build: theclock reports synced,the NTP service active;the rest is quoted fromthe cached articles onlyan honest book: one captured status line, everything else cited

Before the first exchange, the law. There is no NTP daemon or query binary on the machine that built this book: no ntpd, no ntpq, no query ran, and nothing in these pages pretends otherwise.

One real tool did run: timedatectl, and its captured lines appear in one lesson labelled as a real local run. Everything else is traced to a line of the cached Wikipedia sources, and each exercise carries the label this book's plan.

A protocol whose whole job is honesty about time deserves a book that is honest about what it measured.

ONE HONEST SYNC

Before trusting any technical page, ask the book's own question: which source line holds this, and did the demo really run?

Per the Wikipedia Network Time Protocol article, time offset theta is the positive or negative (client time greater than server time) difference in absolute time between the two clocks, it is defined by theta = ((t1 - t0) + (t2 - t3)) / 2, and solving the two packet equations for theta yields the definition of the time offset.

NTP companion · No. 02
the offset

The offset theta

how far apart the clocks are

the offset: how far apart the two clocks standtheta = ((t1 - t0) + (t2 - t3)) / 2the positive or negativedifference in absolute timebetween the two clocks,client time above or belowserver time; sign matters,and both one-way readsboth routes matterequally: the divide by twoone number answers: how wrong is my clock, and which way

The first number a sync produces. Per the article, the offset is the positive or negative (client time > server time) difference in absolute time between the two clocks.

And the definition is one line: theta = ((t1 - t0) + (t2 - t3)) / 2. The two one-way differences are averaged, which is why both routes matter equally.

The algebra hides one assumption, that the road out and the road home cost the same; the symmetry lesson returns to it.

ONE HONEST SYNC

Recompute theta by hand once with small numbers; if the client is ahead, what sign do you expect?

Per the Wikipedia Marzullo's algorithm article, the algorithm was invented by Keith Marzullo for his Ph.D. dissertation in 1984, it is an agreement algorithm used to select sources for estimating accurate time from a number of noisy time sources, a refined version renamed the intersection algorithm forms part of the modern Network Time Protocol, and the best estimate is taken to be the smallest interval consistent with the largest number of sources.

NTP companion · No. 03
the vote

Marzullo's rule

smallest interval, most sources

Marzullo's vote: smallest interval, most sources10 ± 212 ± 111 ± 1[11,12]: all three agreeinvented by Keith Marzullofor his 1984 dissertation;refined into the intersectionalgorithm inside modernNTP, per the articlethe smallest interval backed by thelargest number of sources winsthe interval where the most clocks agree wins the vote

Per the article, Marzullo's algorithm was invented by Keith Marzullo for his Ph.D. dissertation in 1984 as an agreement algorithm for estimating accurate time from a number of noisy time sources.

The rule: the best estimate is taken to be the smallest interval consistent with the largest number of sources. With estimates 10, 12 and 11 the intervals intersect to form [11,12].

The lineage is direct: a refined version of it, renamed the "intersection algorithm", forms part of the modern Network Time Protocol.

ONE HONEST SYNC

Three clocks vote 10, 12 and 11; which interval wins, and what happens to the outlier?

Per the Wikipedia Network Time Protocol article, the upper limit for stratum is 15, stratum 16 is used to indicate that a device is unsynchronized, stratum is not always an indication of quality or reliability and it is common to find stratum 3 time sources that are higher quality than some stratum 2 time sources, and the NTP algorithms on each computer interact to construct a Bellman-Ford shortest-path spanning tree to minimize the accumulated round-trip delay to the stratum 1 servers for all the clients.

NTP companion · No. 04
the edge

Stratum sixteen

fifteen steps, then unsynced

the edge of the ladder: fifteen steps, then sixteenstratum 15the upper limitof the ladderstratum 16meansunsynchronizedthe spanning treeBellman-Ford shortestpath to stratum 1stratum 3 can beat stratum 2on quality, per the articlekiss-o'-death codes INIT,STEP and RATE say: rest a whilesixteen is not the bottom rung; it is the exit sign

The ladder ends twice. Per the article, the upper limit for stratum is 15, and stratum 16 is used to indicate that a device is unsynchronized.

The number is not a grade: stratum is not always an indication of quality or reliability, and it is common to find stratum 3 time sources that are higher quality than some stratum 2 time sources.

The whole fleet self-organizes: the algorithms construct a Bellman-Ford shortest-path spanning tree, to minimize accumulated delay on the way to the stratum 1 servers.

ONE HONEST SYNC

A stratum 2 and a stratum 3 server disagree; which wins, and what should you check first?

Per the Wikipedia Network Time Protocol article, the 64-bit timestamp scale rolls over every 2 to the power 32 seconds (136 years), the first rollover occurs on 7 February 2036, NTPv4 introduces a 128-bit date format that is never transmitted, and the most-significant 32 bits of that format is the Era Number which would resolve rollover ambiguity in most cases.

NTP companion · No. 05
the era

The 2036 rollover

136 years, then a new era

the era: 136 years, then 7 February 20361900the era2036the epoch begins1 January, per articlethe counter rolls overevery 136 yearsfirst rollover lands7 February 2036a 128-bit date formatexists in NTPv4, nevertransmitted; its era numberthe counter is mortal; the era number is the afterlife

The scale has a birthday. The 64-bit stamps give a time scale that rolls over every 2 to the 32nd seconds, 136 years, and from the 1900 epoch the first rollover occurs on 7 February 2036.

The fix already exists on paper: NTPv4 introduces a 128-bit date format, yet the 128-bit format is never transmitted.

Its top bits do the quiet work: the most-significant 32 bits of this format is the Era Number, which would resolve rollover ambiguity in most cases.

ONE HONEST SYNC

Ask which of your systems still hold a 1900 epoch; 2036 is closer than it feels.

Per the Wikipedia Network Time Protocol article, the reference implementation runs as a daemon called ntpd under Unix and has been continuously developed for over 20 years, chrony is an independent implementation mainly sponsored by Red Hat that was created by Richard Curnow in 1997 and is currently maintained by Miroslav Lichvar, OpenNTPD was presented by Henning Brauer of OpenBSD in 2004 with a privilege-separated design, and NTPsec is a fork that has pared away 75% of the original codebase.

NTP companion · No. 06
the fleet

The daemons

one protocol, many programs

the daemons: one protocol, four programsntpdthe reference daemon, developed for over 20 yearschronyCurnow 1997, kept by Lichvar, sponsored by Red HatOpenNTPDBrauer, OpenBSD 2004, privilege separatedNTPseca fork that pared away 75% of the codebasesame wire protocol, four sets of trade-offs to choosepick one daemon and know which trade it makes

One protocol, four programs. The reference implementation runs as a daemon called ntpd under Unix; chrony, created by Richard Curnow in 1997 and currently maintained by Miroslav Lichvar, is mainly sponsored by Red Hat.

OpenNTPD, from Henning Brauer of OpenBSD in 2004, chose a privilege-separated design and accepts less accuracy.

NTPsec forked after the 2014 compromises and has been able to pare away 75% of the original codebase, making the remainder easier to audit.

ONE HONEST SYNC

Same protocol, four codebases; which qualities would you weigh before picking one to run?

Per the Wikipedia Network Time Protocol article, a typical NTP client regularly polls one or more NTP servers, stratum represents the distance from the reference clock and is not always an indication of quality, and the NTP pool provides time to hundreds of millions of systems around the world. Per this book's plan, the handoff is one sitting and four moves.

NTP companion · No. 07
the handoff

The last sync

four moves, one sitting

the handoff: four moves, one sitting, one honest habit1234check thesync statusname yourserversknow yourstratumread oneexchangethe status tool answered yes andactive on this machine; ask yoursstratum is distance, not quality;the pool is volunteers, treat them wellteach four moves and the invisible protocol turns visible

The handoff, per this book's plan, is one sitting and four moves: check the sync status, name your servers, know your stratum, read one exchange as theta and delta.

The first move is free on any Linux box: one status command reports whether the clock is synchronized and whether the NTP service is active; on this book's machine it answered yes and active.

The rest of the habit: point at the pool or your own servers on purpose, remember stratum is distance not quality, and never trust a single exchange.

ONE HONEST SYNC

Teach the four moves today; a friend who can read one sync has left the crowd that just hopes.

Index

Index


Marzullo's rule6
Stratum sixteen7
The 2036 rollover8
The daemons9
The last sync10
The law first4
The offset theta5