Network Time Protocol (NTP) is a networking protocol that synchronizes the clocks of computers and devices to Coordinated Universal Time (UTC). It works by exchanging timestamped messages over UDP port 123, measuring the network delay, and gradually adjusting the local clock. The current version is NTPv4, defined in RFC 5905.
Key takeaways
- NTP synchronizes clocks to UTC over UDP port 123, using four timestamps to calculate clock offset and network delay.
- Time sources are organized in strata: stratum 0 is the reference clock, stratum 1 servers connect to it, and each level below syncs from above.
- Wrong time breaks security — certificates, Kerberos logins, tokens and log timelines all depend on accurate clocks.
Every log entry, every certificate check, every login and every file timestamp on your network depends on one quiet assumption: that all your computers agree on what time it is. Network Time Protocol is the system that makes that true — and when it breaks, security breaks with it.
What is Network Time Protocol?
Network Time Protocol (NTP) is a networking protocol that synchronizes the clocks of computers and devices in a network to Coordinated Universal Time (UTC). It is one of the oldest protocols still in everyday use: it was first defined in the IETF in RFC 958 in 1985, and the current version, NTPv4, was published as RFC 5905 in June 2010.
NTP runs over UDP port 123. It uses UDP deliberately: the protocol's design depends on measuring how long messages take to travel, and TCP retries would add delay and make the measurement less accurate. That choice also shapes its security story, as you will see below.
Every computer clock drifts. The quartz oscillator inside a machine runs slightly fast or slow, and temperature changes make it worse. Left alone, a clock can drift seconds per day. NTP fixes this by regularly polling time servers and nudging the local clock toward the consensus — usually by slewing it gradually, speeding it up or slowing it down, rather than jumping it in one step.
How does NTP work?
NTP works by exchanging timestamped messages between a client and a server, then using four timestamps to calculate two things: how far the client's clock is from the server's, and how long the messages spent travelling over the network.
The exchange runs like this:
- Request (T1). The client sends a UDP packet to the server on port 123, recording the time it left.
- Receipt (T2). The server records when the request arrived.
- Reply (T3). The server sends its reply, recording when it left, and includes all three timestamps so far.
- Arrival (T4). The client records when the reply arrived.
- Calculation. From the four timestamps the client works out the round-trip delay and its clock offset, then adjusts its clock.
The key insight is that the client cannot just copy the server's time, because the reply took time to arrive. By measuring the round trip, NTP estimates how much of the gap is network delay and how much is a real clock difference. It then repeats the exchange many times, filters out bad samples, and picks the best servers when several are configured.
Accuracy is impressive for such a simple exchange. RFC 5905 notes that primary servers using modern machines are precise within a few tens of microseconds, and clients on fast LANs within a few hundred microseconds. Over the public internet, a few tens of milliseconds is typical — far more precise than anything a login, a certificate or a log file needs.
What are NTP strata?
NTP organizes time sources into a hierarchy of levels called strata. Each stratum is one step further from the reference clock, and the hierarchy keeps the load off the most accurate servers while giving every client a clear chain of trust for its time.
| Stratum | What it is | Example |
|---|---|---|
| 0 | Reference clock, not a network device | Atomic clock, GPS receiver, radio clock |
| 1 | Server directly connected to stratum 0 | National lab time server, GPS-disciplined server |
| 2 | Server syncing from stratum 1 | ISP or company time server |
| 3–15 | Each level syncs from the one above | Office servers, network devices, PCs |
| 16 | Unsynchronized | A device with no working time source |
Time flows down the hierarchy: stratum 1 servers serve stratum 2, stratum 2 serves stratum 3, and so on. As the stratum number rises, accuracy generally falls slightly and delay grows, so clients should sync from the lowest stratum available to them. Public servers such as the NTP Pool Project provide stratum 1 and 2 servers for anyone to use.
Best practice is to configure at least four independent sources. With four or more, the selection algorithm can compare them, discard an outlier, and keep accurate time even if one source goes wrong. With only one source, a bad server means a bad clock and no way to know.
What are the NTP modes of operation?
NTP clients and servers can relate to each other in several modes, and the mode decides who asks and who answers. Most devices you manage will use client/server mode, but the others matter when you read a configuration or a log.
- Client/server (modes 3 and 4): the normal case — a client asks a server for the time and the server answers.
- Symmetric (modes 1 and 2): two servers act as peers and synchronize with each other, giving mutual backup if one loses its upstream source.
- Broadcast (mode 5): a server broadcasts the time and clients listen, useful on a local network where many devices need the same time.
- Control and private (modes 6 and 7): management queries — and the source of the most famous NTP attack, as the security section below explains.
NTPv4 also added support for IPv6, a dynamic server discovery feature that lets clients find nearby time servers without manual configuration, and an extension mechanism for new features. It is fully backward compatible with NTPv3 and earlier versions.
Why does accurate time matter for security?
Accurate time is a security dependency that most organizations never think about — until it breaks. Almost every security control assumes the clock is right, and a clock that is wrong by minutes can quietly disable them.
- Certificates: TLS certificates have a validity window. A clock set too far forward makes valid certificates look expired; a clock set backward makes expired certificates look valid again. Check a site's certificate with our free SSL checker and you are trusting the clock on both ends.
- Logins: Kerberos, the authentication protocol behind Active Directory, rejects tickets if the client and server clocks differ by more than five minutes. A time failure looks like an identity outage.
- Tokens and codes: time-based one-time passwords (TOTP) and many API tokens expire within seconds or minutes. A drifting clock means codes that never work.
- Logs and forensics: if your servers disagree on the time, you cannot reconstruct an attack timeline. Evidence with conflicting timestamps is weak evidence.
- DNSSEC: signed DNS records have validity periods, and a wrong clock can make valid signatures look expired or invalid ones look current.
That is why time synchronization belongs in a security baseline, not just in network plumbing. If you are working through your controls, our small business cybersecurity checklist includes the monitoring and logging habits that depend on accurate time.
Is NTP secure? Attacks and NTS
Classic NTP has a serious weakness: in its default form it carries no authentication. Because it runs over connectionless UDP, an attacker who can reach a client can forge replies, and an attacker on the path can modify them. The consequences are a shifted clock, broken logins and certificates, and a corrupted timeline — exactly the things an attacker wants before or during an intrusion.
The best-known abuse is the "monlist" amplification attack. Older versions of the reference ntpd daemon answered a diagnostic command, monlist, with a list of the last 600 clients — turning a small spoofed query into a response hundreds of times larger, aimed at a victim. It has its own identifier, CVE-2013-5211, and was widely used in reflection DDoS attacks in 2014.
The modern fix is Network Time Security (NTS), defined in RFC 8915 in September 2020. NTS uses a TLS handshake on TCP port 4460 to establish keys — building on the TLS described in our guide to what TLS is — and then authenticates every NTP packet on UDP port 123. It prevents forged replies, though it cannot stop a delay attack by an on-path attacker.
Older authentication options are not the answer: NTP's symmetric-key authentication needs a pre-shared key per server pair and was based on MD5, which is insecure, and Autokey, its public-key successor, is broken and deprecated. If you run your own time servers, use NTS where clients support it, configure at least four diverse sources, and block mode 6 and 7 queries from outside.
NTP vs SNTP vs PTP: which one do you need?
Three protocols cover time synchronization, at different levels of precision. NTP is the general-purpose choice for computers and servers. SNTP is its simplified subset for devices that only need to ask a server for the time and set their clock, without the full filtering and selection algorithms — common in IoT devices and simple appliances.
| NTP | SNTP | PTP | |
|---|---|---|---|
| Full name | Network Time Protocol | Simple Network Time Protocol | Precision Time Protocol |
| Defined in | RFC 5905 | RFC 4330 (subset of NTP) | IEEE 1588 |
| Typical accuracy | Milliseconds over the internet | Similar, less filtering | Sub-microsecond on a LAN |
| Transport | UDP port 123 | UDP port 123 | UDP, often multicast |
| Best for | Servers, PCs, network gear | IoT, simple devices | Trading, telecoms, industrial control |
PTP (Precision Time Protocol, IEEE 1588) is the specialist: it uses hardware timestamping to reach sub-microsecond accuracy on a local network, which financial trading, telecoms and industrial control need. For everything else, NTP is the right tool — and the IETF is already working on its successor, NTPv5, with a draft in progress as of October 2026.
How to check your time synchronization
On Windows, run w32tm /query /status in a terminal to see your time source, stratum and offset. On Linux with chrony, chronyc tracking and chronyc sources show the same. On both, the offset tells you how far your clock is from the server — anything under a few tens of milliseconds is healthy.
Signs of trouble: login failures that mention Kerberos and time skew, TOTP codes that never work, certificates that appear expired on one machine but not another, and log timestamps that disagree between servers by more than a second. Check UDP port 123 first — a firewall that blocks it is the most common cause of a clock that slowly drifts and never corrects.
If you run servers of your own, point them at four reliable sources, prefer NTS-capable ones, and alert on large offsets. A clock that suddenly jumps is worth investigating the same day: it can be a failing time source, a network problem — or someone interfering with your time.
The bottom line
NTP is one of the oldest protocols on the internet and one of the most taken for granted. It keeps every clock in your network aligned to UTC with a simple exchange of timestamps over UDP port 123, organized in strata from atomic clocks down to your laptop.
Treat it as a security control, not plumbing: use at least four diverse sources, adopt NTS where you can, block the old diagnostic queries, and monitor your offsets. The day your clocks disagree is the day your logins, certificates and logs start failing — and the fix is a protocol your systems probably already run.
Frequently asked questions
What does NTP stand for?
NTP stands for Network Time Protocol. It is the protocol computers use to synchronize their clocks with each other over a network, keeping them aligned to Coordinated Universal Time (UTC).
What port does NTP use?
NTP uses UDP port 123. It deliberately uses UDP rather than TCP, because TCP retries would add delay and make the time measurement less accurate. Firewalls that block UDP port 123 will stop time synchronization.
What is a stratum in NTP?
A stratum is a level in the NTP hierarchy showing how far a server is from the reference clock. Stratum 0 is the reference clock itself, such as an atomic clock or GPS receiver. Stratum 1 servers connect directly to it, stratum 2 servers sync from stratum 1, and so on down to stratum 15. Stratum 16 means unsynchronized.
How accurate is NTP?
On a fast local network, NTP can keep clocks within a few hundred microseconds of each other, and primary servers are precise within a few tens of microseconds, according to RFC 5905. Over the internet, typical accuracy is within a few tens of milliseconds, which is more than enough for logins, certificates and logging.
What is the difference between NTP and SNTP?
SNTP, the Simple Network Time Protocol, is a simplified subset of NTP defined for devices that only need to set their clock from a server, without running the full NTP algorithms. Most modern systems run full NTP, while simple IoT devices often use SNTP.
Is NTP secure?
Classic NTP is not authenticated by default, so an attacker on the path can forge replies and shift a clock. Network Time Security (NTS), defined in RFC 8915, adds authentication using a TLS handshake on TCP port 4460, and is the modern answer for clients that need trusted time.
Why does my computer clock keep drifting?
Every computer clock drifts because its hardware oscillator is not perfect — it runs slightly fast or slow, and temperature changes make it worse. NTP corrects this drift continuously by polling time servers and gradually adjusting the clock, a process called slewing.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against IETF RFC 5905, Cisco's NTP documentation and the IETF Network Time Protocols working group charter.
How we write and fact-check →