What Is NTP? How Network Time Protocol Works

NTP, the Network Time Protocol, is the system computers use to set their clocks over the internet. A device asks a time server for the time, measures how long the answer took to arrive, and corrects its own clock for that delay. The current version, NTPv4, is defined in RFC 5905, which opens: “The Network Time Protocol (NTP) is widely used to synchronize computer clocks in the Internet.” This guide explains the four timestamps behind every NTP exchange with a worked example, what “stratum” means, how accurate NTP really is, the 2036 rollover of NTP’s own clock, and which public servers you can use. Facts are as of November 2026.

Key facts

  • Current standard: NTP version 4, RFC 5905 (June 2010).
  • NTP counts seconds from 0 h on 1 January 1900 UTC, which is 2,208,988,800 seconds before the Unix epoch (our arithmetic).
  • NTP’s 32-bit seconds field wraps on Thursday, February 7, 2036 at 06:28:16 UTC (our arithmetic). RFC 5905 handles this with “eras”.
  • Stratum 1 = a server fed directly by a reference clock such as GPS; 16 = “unsynchronized” (RFC 5905).
  • Accuracy: “a few tens of microseconds” for good primary servers, “a few hundred microseconds” on fast local networks, and “a few tens of milliseconds” across the wider internet (RFC 5905, section 1).

What NTP does, in one paragraph

Every computer has a quartz clock that drifts. NTP fixes the drift by comparing the local clock with a better one somewhere on the network. The hard part is not asking for the time; it is knowing how stale the answer is by the time it arrives. NTP solves that by recording four timestamps per exchange, which lets the client estimate both the network delay and the offset between its clock and the server’s. Your laptop, phone and smart TV almost certainly run NTP or its simpler cousin SNTP in the background. Android, for example, says “Android uses the Simple Network Time Protocol (SNTP)” and by default queries time.android.com (Android Open Source Project). Phones add a second source, the mobile network, on top of NTP.

The four timestamps, with a worked example

RFC 5905 says “The on-wire protocol uses four timestamps numbered t1 through t4”. In plain terms:

Timestamp Taken by Meaning
T1 Client clock Request leaves the client
T2 Server clock Request arrives at the server
T3 Server clock Reply leaves the server
T4 Client clock Reply arrives back at the client

The RFC gives the clock offset as “theta = T(B) – T(A) = 1/2 * [(T2-T1) + (T3-T4)]” and the round-trip delay as “delta = T(ABA) = (T4-T1) – (T3-T2).” Here is a worked example we made up to show the arithmetic. Suppose your computer’s clock is 0.500 s slow, the trip to the server takes 30 ms, the trip back takes 30 ms, and the server spends 2 ms preparing the answer:

Step Value (seconds past the minute)
T1, client sends (client clock) 10.000
T2, server receives (server clock) 10.530 (true time 10.530, client thinks 10.030)
T3, server replies (server clock) 10.532
T4, client receives (client clock) 10.062
Offset θ = ½[(10.530 − 10.000) + (10.532 − 10.062)] ½[0.530 + 0.470] = +0.500 s (clock is half a second slow)
Delay δ = (10.062 − 10.000) − (10.532 − 10.530) 0.062 − 0.002 = 0.060 s round trip

We checked the example a second way: true send time 10.500 + 0.030 = 10.530 at the server, and the reply leaves at 10.532, arrives at true time 10.562, which the slow client clock reads as 10.062. The formula recovers the 0.500 s error exactly because the two legs are equal. If the outbound leg took 50 ms and the return 10 ms, the same formula would be off by half the difference, 20 ms. That asymmetry is the main limit on NTP accuracy, and it is why Android notes that “Network latency effects are a significant contributor to time inaccuracy” in its single-query SNTP setup, with a stated worst case of “approximately 2.5 seconds” under its default 5-second timeout (AOSP).

Stratum: how far a server is from the source

RFC 5905 arranges servers in layers: “Primary servers are assigned stratum one; secondary servers at each lower level are assigned stratum numbers one greater”. A stratum 1 server is a “primary server (e.g., equipped with a GPS receiver)”, and the value 16 means “unsynchronized”. So a typical home computer synchronizing to a public pool server that itself follows a stratum 1 server would be at stratum 3. Lower is not automatically better: a nearby stratum 2 server with a short, symmetric network path can beat a distant stratum 1 server on a congested route.

The reference clocks at the top are ultimately traced to atomic time. GPS satellites carry their own atomic clocks (see how GPS keeps time), and national labs such as NIST run their own stratum 1 servers. For the physics behind them, see how atomic clocks work.

How accurate is NTP?

RFC 5905 gives three tiers, quoted from section 1:

  • “Typical primary servers using modern machines are precise within a few tens of microseconds.”
  • “Typical secondary servers and clients on fast LANs are within a few hundred microseconds”.
  • Over the wider internet, the RFC says “servers and clients are precise within a few tens of milliseconds”.

For everyday use, tens of milliseconds is far better than you need: a human cannot see a 30 ms difference on a clock face. It matters for log files, financial timestamps, security certificates and distributed databases, where events from many machines must be put in order. NTP’s timestamp itself is much finer than its accuracy: the 32-bit fraction field counts units of 2−32 s, about 233 picoseconds (our arithmetic).

NTP’s own “Y2K”: February 7, 2036

RFC 5905 says “the prime epoch, or base date of era 0, is 0 h 1 January 1900 UTC, when all bits are zero.” The 64-bit packet timestamp has a 32-bit seconds field, so it can count 232 = 4,294,967,296 seconds before it wraps. We computed the moment with Python’s datetime and checked it by adding 2,208,988,800 (the 1900-to-1970 gap) to the Unix value 2,085,978,496:

Place Local time when NTP era 0 ends
UTC Thursday, February 7, 2036, 06:28:16
Vancouver (UTC-7) Wednesday, February 6, 2036, 11:28:16 PM
New York (EST) Thursday, February 7, 2036, 1:28:16 AM
London (GMT) Thursday, February 7, 2036, 6:28:16 AM
Tokyo Thursday, February 7, 2036, 3:28:16 PM
Sydney (AEDT) Thursday, February 7, 2036, 5:28:16 PM

This is not a repeat of the Year 2038 problem, which hits 32-bit Unix time two years later. NTP was designed to cope: the RFC says era 0 runs “to some time in 2036, when the timestamp field wraps”, and that “Eras cannot be produced by NTP directly, nor is there need to do so.” In practice a client that already knows the time to within about 68 years (half of the 136-year era) can tell which era a timestamp belongs to. Devices most at risk are ones that boot with no idea of the date, such as a gadget whose clock battery has died.

Leap seconds and NTP

NTP follows UTC, so it had to handle leap seconds, which some large operators “smeared” over many hours instead. That chapter is closing: the 28th General Conference on Weights and Measures decided on October 15, 2026 that “continuous UTC will become effective on 20 May 2027” (CGPM Resolution 5, 2026), and the IANA time zone release 2026f now says “No more leap seconds” (IANA; background in our guide to leap seconds).

Public NTP servers you can use

Service Hostname What the operator says
NTP Pool Project pool.ntp.org “a big virtual cluster of timeservers”; it listed 6,361 servers in the pool when we checked on November 9, 2026 (ntppool.org)
NIST Internet Time Service time.nist.gov “resolved to all of the server addresses below in a round-robin sequence”; users must “NEVER” query “more frequently than once every 4 seconds” (NIST)
Android default time.android.com “By default, AOSP uses time servers at time.android.com”; normal polling interval 18 hours (AOSP)

The NTP Pool says it is “being used by hundreds of millions of systems around the world.” Its volunteer servers are why your router or Linux box can set its clock without any account or payment.

Tips

  • Check your offset. Most operating systems show the last sync in their date and time settings. On Linux, timedatectl shows whether NTP is active; on Windows, w32tm /query /status shows the source.
  • Do not hammer servers. NIST’s once-every-4-seconds limit is a ceiling, not a target; normal clients poll every few minutes to hours.
  • Time zones are separate. NTP only carries UTC. Your device applies its time zone rules locally, which is why a stale time zone database can show the wrong local time even when NTP is perfect. Convert between zones with our time zone converter.

How we checked

We read RFC 5905 at rfc-editor.org and quoted it directly. The 2036 date, the 2,208,988,800-second offset, the 233-picosecond resolution and the city times were computed in Python (datetime with IANA tzdata 2026f) and the rollover was checked a second way by adding the 1900-1970 offset to the Unix count. The four-timestamp example was built forward from assumed true times and then solved with the RFC formulas. Server details come from each operator’s own page, read on November 9, 2026.

Sources

Frequently asked questions

What does NTP stand for?

Network Time Protocol. Version 4 is the current standard (RFC 5905).

What port does NTP use?

Port 123. RFC 5905 notes that “UDP/TCP Port 123 was previously assigned by IANA for this protocol”, and says “The NTP packet is a UDP datagram” (section 7.3), so NTP traffic runs over UDP.

What is the difference between NTP and SNTP?

SNTP (Simple NTP) uses the same packets but skips most of the filtering and server selection. It is fine for devices that only need to be roughly right, which is why Android uses it with one query about once a day.

Is NTP accurate enough for stock trading?

Over the public internet, NTP is typically good to tens of milliseconds. Trading systems and telecom networks that need microseconds usually use local GPS receivers or the Precision Time Protocol (PTP) instead.

Will NTP break in 2036?

The 32-bit seconds counter wraps on February 7, 2036 at 06:28:16 UTC. Up-to-date NTP software handles the wrap; old or embedded devices that boot without knowing the date are the main risk.

Similar Posts