What does an NTP server's stratum number tell you, and why is a lower stratum not the same as better time?
answer
- distance, not accuracy
- borrowed from telephone timing hierarchies
- each hop adds one
- 1 primary, 2-15 secondary, 16 unsynchronized
- error bound lives in root delay and dispersion
basics
~20 sStratum counts how many NTP hops a server sits from a reference clock: 1 is a primary server, 2-15 are secondary servers, 16 means unsynchronized. It measures distance in the tree, not the size of the clock's error.
solid answer
~50 sIn NTP (RFC 5905), stratum is the level of a server in the synchronisation tree. A primary server wired to a reference clock such as a GPS receiver is stratum 1; every server that synchronises over NTP advertises its source's stratum plus one, up to 15; 16 means unsynchronized and clients will not use it. On the wire, 0 means "unspecified or invalid" and marks a kiss-o'-death packet; calling the GPS receiver itself "stratum 0" is common usage, not a packet value. Stratum is a hop count, so it only loosely tracks accuracy: a stratum 3 client on a quiet LAN can be far closer to UTC than a stratum 2 client fed across a 90 ms WAN path. The error bound a client inherits is carried in the `Root Delay` and `Root Dispersion` fields, not in `Stratum`.
go deeper
Recall that stratum counts hops from a reference clock: 1 primary, 2-15 secondary, 16 unsynchronized. Say clearly that it is a distance, not an accuracy grade.
Explain how a server derives its stratum from its source plus one, what 0 means on the wire versus the 'stratum 0 device' habit, and why clients refuse a stratum 16 source.
Show with a real path why a deeper stratum on a LAN can beat a shallower one across a WAN, and point to root delay and root dispersion as the actual error bound you would check.
Frame stratum as a topology metric when designing a time hierarchy: keep paths short and symmetric, provide independent primaries, and monitor root distance rather than stratum when judging whether the service meets its accuracy target.
## What stratum measures The **Network Time Protocol** (NTPv4, RFC 5905, which obsoletes RFC 1305 and absorbs SNTP from RFC 4330) organises time servers into a hierarchy. Loosely following conventions from telephone-network timing, the level of each server is its **stratum**: - A **primary server** is directly attached to a reference clock - a GPS receiver, a radio time signal, a pulse-per-second source - and is assigned **stratum 1**. - A **secondary server** synchronises over NTP and takes the stratum of the server it follows, plus one. RFC 5905's system-variable update writes this literally: `s.stratum <- p.stratum + 1`. - The RFC describes the resulting topology as a variant of the Bellman-Ford routing algorithm building a shortest-path spanning tree rooted at the primary servers, so stratum behaves like a hop-count metric. Stratum therefore answers one question: *how many NTP hops separate this clock from a reference clock?* ## The values on the wire The `Stratum` field is an 8-bit integer in the NTP header. RFC 5905 assigns it these meanings: | Value | Meaning in RFC 5905 | |---|---| | 0 | unspecified or invalid; with an ASCII kiss code in the Reference ID it is a kiss-o'-death packet | | 1 | primary server (e.g. equipped with a GPS receiver) | | 2-15 | secondary server (via NTP) | | 16 | unsynchronized | | 17-255 | reserved | Two details trip people up: 1. **"Stratum 0" for the reference clock is industry usage.** Engineers often call the GPS receiver or atomic clock itself "stratum 0". RFC 5905 mentions that reference clocks normally appear at stratum 0 *inside* an implementation, but in a packet a 0 means unspecified or invalid, and it is customary for a receiver to map a received 0 to 16 internally. 2. **16 is the ceiling.** A client of a stratum 15 server would compute 16, which the table reserves for unsynchronized, so 15 is the deepest synchronised level. The RFC's reference skeleton also starts every host at 16 until it first synchronises. ## Walking a data centre hierarchy Take a data centre with two GPS-fed time appliances, four internal NTP servers and 2,000 clients: 1. Each appliance reads its GPS receiver and advertises **stratum 1**, with the Reference ID `GPS`. 2. The four internal servers synchronise to the appliances and advertise **stratum 2**. 3. The 2,000 clients synchronise to the internal servers and settle at **stratum 3**. If one internal server lost both appliances and followed a sibling internal server instead, it would advertise stratum 3 - one more hop, nothing else implied. ## Why stratum is not a quality score RFC 5905 says accuracy degrades as stratum increases "depending on the particular network path and system clock stability", and that mean errors grow approximately in proportion to stratum *and* round-trip delay. That is a loose correlation, not a measurement. Concretely: - **Path matters more than depth.** A stratum 3 client one LAN hop from a stratum 2 server can sit within a millisecond or two of UTC; a client that follows a public stratum 1 server across a 90 ms intercontinental path is stratum 2, yet its offset can be wrong by up to half that round trip if the path is asymmetric. - **A broken stratum 1 is still stratum 1.** An appliance with a failing antenna or a mis-set receiver keeps advertising stratum 1. Stratum says nothing about whether its time is right; spotting a source that disagrees with the others is the job of NTP's source-selection algorithms, a separate topic. - **The error bound has its own fields.** `Root Delay` (total round-trip delay to the reference clock) and `Root Dispersion` (total accumulated dispersion) let a client compute the **root synchronization distance**, `EPSILON + DELTA / 2`, the RFC's bound on error from all causes. ## What a client does with stratum 16 A server advertising stratum 16, or a Leap Indicator of 3 ("unknown, clock unsynchronized"), is not used for synchronisation: RFC 5905's packet and fitness checks discard a source whose leap indicator is unsynchronized or whose stratum is 16 or more. A freshly booted server with no source yet is in exactly this state: it reports Leap Indicator 3 and an unsynchronized stratum (16, which RFC 5905 notes is customarily sent as 0 on the wire), so clients pointed only at it stay unsynchronised. Note that NTPv4 does not mark a silent association by flipping it to 16; instead its synchronization distance grows with time until it crosses the distance threshold. ## Interview takeaway Say "stratum is distance, not accuracy", give the 0 / 1 / 2-15 / 16 meanings, label "stratum 0 device" as usage, and point to root delay and root dispersion as the fields that bound the error.
- Why does a received stratum 0 get treated like 16 by many NTP implementations?In a packet, stratum 0 means "unspecified or invalid" and is how a kiss-o'-death packet is marked. RFC 5905 notes it is customary to map a received 0 to 16 internally, so the same rule that rejects unsynchronized servers also refuses to synchronise to a kiss-o'-death reply, and to map 16 or more back to 0 on transmit.
- Can a stratum 2 NTP server be a worse source than a stratum 3 one?Yes. Stratum only counts hops. A stratum 2 server reached over a long, asymmetric or congested path inherits a large root delay and dispersion, so its root synchronization distance can be far larger than that of a stratum 3 server one LAN hop away whose upstream is also close. The distance, not the stratum, bounds the error.
- What is the deepest stratum a synchronised NTP server can advertise?15. Secondary servers occupy 2-15, and each hop adds one, so a client of a stratum 15 server would land on 16, which RFC 5905 reserves for unsynchronized. Values 17-255 are reserved and unused.
saying these in an interview costs you the question
- Stratum 1 always means the most accurate time available
- Stratum 0 in an NTP packet means the sender is an atomic clock
- A lower stratum source should always be preferred regardless of path
- Stratum 16 is just a very distant but usable server
- Stratum is configured by the administrator to rank server quality