Stop Trusting Unsigned Time: Moving My Network to NTS (Network Time Security)
Every machine I run asks the internet what time it is, and until this week every one of them believed whatever answer came back. Plain NTP has no authentication. A 48-byte UDP packet arrives on port 123, and as long as it looks sane, chronyd starts steering the clock towards it. Nothing in that packet proves who sent it or that nobody changed it on the way.
That's a strange thing to tolerate in 2026, when almost everything else on the wire is encrypted and authenticated. Clocks matter more than they get credit for, too. So I moved all ten of my Linux hosts (four sites plus a six-node Kubernetes cluster) to NTS, Network Time Security (RFC 8915). It turned out to be a five-line config change. This post covers why you'd bother, what it actually costs (I measured it), and why I used three different providers rather than one.
Why should you care what time it is?
A huge amount of security quietly assumes the clock is right:
- TLS certificates are only valid between their
notBeforeandnotAfterdates. Wind a clock back and an expired, possibly revoked or compromised certificate becomes "valid" again. Wind it forward and every valid certificate looks expired, which is a very effective denial of service. - DNSSEC signatures have inception and expiration times. Same problem.
- Kerberos rejects tickets from clients whose clocks are more than five minutes off (the usual default).
- TOTP two-factor codes are just a hash of the current 30-second window.
- Logs from different machines are only useful in an incident if their timestamps line up.
Plain NTP gives an attacker on the path between you and your time server a lever on all of that. Here's the plain NTP exchange:
Plain NTP (UDP/123) - no authentication, no integrity
+--------+ 48 bytes: "what time is it?" +------------+
| client | -----------------------------------> | NTP server |
| | <----------------------------------- | |
+--------+ 48 bytes: "it is T" +------------+
^
|
+----------------------+
| anything on the path | rewrite T, replay an old
| (rogue Wi-Fi, ISP, | reply, or spoof one outright:
| hijacked route...) | the client cannot tell
+----------------------+
What NTS actually does
NTS splits the job in two:
- NTS Key Establishment (NTS-KE): a short TLS 1.3 connection to TCP port 4460. The client checks the server's certificate exactly like a browser checks a website's, and the two sides derive a pair of keys from the TLS session. The server also hands back a batch of opaque cookies (eight from every server I tested), and then the TLS connection closes.
- Ordinary NTP on UDP/123, carrying extra extension fields: a unique identifier (for replay protection), one cookie, and an authenticator (AEAD) that covers the whole packet. The server's reply is authenticated the same way and carries a fresh, encrypted cookie to replace the one just spent.
1) NTS-KE: once, then roughly every 4 weeks (chrony's default ntsrefresh)
+--------+ TLS 1.3 on TCP/4460, cert validated +------------+
| client | <======================================> | NTS-KE |
| | -> keys exported from the TLS session | server |
| | <- 8 cookies (+ which NTP host/port) | |
+--------+ +------------+
2) Every poll after that: plain old UDP/123, but signed
+--------+ NTP + [unique id][cookie][AEAD tag] +------------+
| client | ---------------------------------------> | NTP server |
| | <--------------------------------------- | |
+--------+ NTP + [AEAD tag][new encrypted cookie] +------------+
* tampered reply -> authenticator fails -> discarded
* replayed reply -> wrong unique id -> discarded
* server keeps no per-client state; the cookie carries the keys
The cookie trick is the clever part. The cookie is the client's keys, encrypted with a key only the server knows. When a request arrives, the server unwraps the cookie to recover the keys for that client. So a public time service with millions of clients doesn't need to hold a session table, which is why big operators can afford to run this. Because every cookie is used once and replaced with a fresh encrypted one, a passive observer also can't link your requests together as you move between networks. That privacy property was a deliberate design goal of the RFC.
Two things NTS does not do, because it's worth being honest about them:
- It can't protect you from the server itself lying. NTS proves the answer came from
time.cloudflare.comunmodified. It can't prove that Cloudflare's clock is right. - It can't stop an on-path attacker from delaying packets. Holding one direction back skews the offset calculation. That error is bounded by the round-trip time, so it's milliseconds rather than years, but it's not zero.
Both of those are why the next section matters as much as the encryption.
Who offers NTS publicly?
More operators than I expected. Before trusting any of them I checked each one myself: an openssl s_client -alpn ntske/1 handshake on port 4460 for all five, plus a full one-shot NTS sync with chronyd -Q for the three I ended up using. All have IPv6.
- Cloudflare:
time.cloudflare.com. Anycast, and one of the earliest big NTS deployments. - Meta:
nts.meta.com. This is not the oldtime1-5.facebook.comhosts, which are still plain NTP. Inchronycit shows up as stratum 1 servers namedtimeN.meta.com. - Netnod (Sweden):
nts.netnod.se, plus regional names likesth1.nts.netnod.se. They run Sweden's official time and back it with their own atomic clocks. - PTB (Germany's national metrology institute):
ptbtime1.ptb.dethroughptbtime4.ptb.de. - time.nl (Netherlands):
nts1.time.nl.
Community lists such as jauderho/nts-servers track plenty more.
Why more than one provider
chronyd doesn't simply average its sources. Each source gives it an offset and an error bound, so really an interval where the true time could be. chrony then looks for the region where most of those intervals overlap. A source whose interval falls outside the majority is marked a falseticker and ignored.
Each source = an estimate of "now" +/- its error bound
Two sources disagree - who is right?
A |-------*-------|
B |-------*-------|
no majority: chrony can't tell which one is lying
Three independent sources - majority rules
A |-------*-------|
B |-----*-----|
C |-------*-------| <- falseticker, dropped
[=====] <- A and B overlap here: the time comes from this region
That's the reason for using independent operators specifically. With one provider, a bad day at that provider (a broken upstream reference, a bad leap-second rollout, a compromised box, or a lying-but-correctly-signed answer) is a bad day for your clock. With two, chrony can see that something is wrong but can't tell which one. Three is the smallest number where one bad source gets outvoted. Using different companies also tends to mean different networks, different anycast sites and different upstream references, so their failures are far less likely to coincide. That also takes the edge off the delay attack above: an attacker would have to skew the paths to several unrelated networks in the same direction at once.
The config
Here's the entire time-source section of my /etc/chrony/chrony.conf, deployed to every host by Ansible:
# Time sources: Network Time Security (NTS, RFC 8915) only.
# NTS-KE is TLS on TCP 4460, then NTP on UDP 123 with authenticated cookies,
# so a spoofed/MITM'd reply is rejected rather than slewing the clock.
pool nts.meta.com nts iburst maxsources 2
server time.cloudflare.com nts iburst
server nts.netnod.se nts iburst
# Cache NTS-KE cookies across restarts so a chrony restart doesn't need a
# fresh TLS key exchange to every server.
ntsdumpdir /var/lib/chrony
# NTS-KE validates the server's TLS cert against the system clock. If the
# RTC is badly off (dead CMOS battery, fresh VM) every cert looks invalid and
# chrony can never sync. Skip the cert *time* check (chain/name still
# checked) until the clock has been synchronised once.
nocerttimecheck 1
Line by line:
ntson each source is all it takes to turn NTS on. Every Ubuntu chrony I run (4.x) is built with+NTS;chronyd -vwill tell you whether yours is.pool ... maxsources 2takes two of Meta's servers from behind the one name.time.cloudflare.comandnts.netnod.seare anycast, so oneserverline each is the right shape.ntsdumpdirsaves unused cookies to disk, so restarting chronyd goes straight back to NTP instead of redoing the TLS key exchange with every server.nocerttimecheck 1is the chicken-and-egg fix. TLS needs a roughly correct clock to validate a certificate, and you're using NTS to get a correct clock. If a host boots in 1970 (dead RTC battery, fresh VM), every certificate looks not-yet-valid and it never syncs. This skips only the date check, and only until the first clock update; the certificate chain and hostname are still verified. The chrony man page rightly calls this a security trade-off and a last resort. For a fleet of servers I'd take "boots into a working clock" over "stuck forever until someone notices", but drop it if your hosts have trustworthy RTCs.
If you filter outbound traffic, allow TCP/4460 as well as UDP/123. Firewalls that block 4460 are the most common reason NTS "just doesn't work".
Checking it's really NTS
Two chronyc commands. Here's one of my routers a few minutes after the change (-N shows the configured names instead of IPs):
$ chronyc -N sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^+ nts.meta.com 1 6 77 60 +454us[ +454us] +/- 8492us
^* nts.meta.com 1 6 77 60 -601us[ -412us] +/- 6169us
^- time.cloudflare.com 3 6 77 61 -537us[ -348us] +/- 22ms
^- nts.netnod.se 1 6 77 60 +18ms[ +18ms] +/- 74ms
$ chronyc -N authdata
Name/IP address Mode KeyID Type KLen Last Atmp NAK Cook CLen
=========================================================================
nts.meta.com NTS 1 30 128 196 0 0 8 68
nts.meta.com NTS 1 30 128 196 0 0 8 68
time.cloudflare.com NTS 1 30 128 196 0 0 8 64
nts.netnod.se NTS 1 15 256 196 0 0 8 100
In authdata, what you want to see is Mode NTS, a non-zero KeyID (a key exchange succeeded), NAK 0 (the server hasn't rejected our cookies) and Cook 8 (a full set of cookies in hand). Type is the AEAD algorithm each server picked: 30 is AES-128-GCM-SIV, 15 is AES-SIV-CMAC-256, which is why Netnod's key length shows as 256. All ten of my hosts look like this.
In sources, * marks the source chrony is synced to, + marks sources it's combining with it, and - marks good sources it's leaving out of the combination. Netnod sits at - because its NTP servers are in Sweden, 120 to 160 ms from my US hosts, so it never wins on precision. It's there to break a tie, not to be the clock.
The name you configure isn't the server you sync with
One surprise. Look closely at that output: the KE server can tell the client to use a different host for NTP, and Meta and Netnod both do. chronyc ntpdata (without -N) shows where the packets really go:
What I configured Who answers NTP
--------------------- ------------------------------------------
nts.meta.com (anycast) 2a03:2880:ff09::123, 2a03:2880:ff0a::123,
... and 129.134.27.123 <- IPv4! on a v6 host 🤮
nts.netnod.se (anycast) 2a01:3f7:3:51::4 / ::5 (Sweden)
time.cloudflare.com 2606:4700:f1::1 / ::123 (same anycast)
+--------+ 1) TLS to the nearest anycast front door +-------------+
| client | -------------------------------------------> | nts.meta.com|
| | <------------------------------------------- | (KE only) |
| | "cookies are for timeN.meta.com, go there" +-------------+
| |
| | 2) NTP to a fixed server, wherever it is +-------------+
| | <------------------------------------------> | timeN.meta |
+--------+ +-------------+
Pinging the name you configured therefore tells you about the KE front door, not the clock. From my Australian box nts.meta.com answers ping in about a millisecond, while the Meta NTP servers it's handed are around 100 ms away. Meta's KE also happily gave one of my hosts an IPv4 NTP server, so if you're on an IPv6-only network, check that you got a v6 one. I added the three NTS names to the NTP row of my SmokePing-style Grafana dashboards (replacing the old timeN.facebook.com targets), but for Meta and Netnod that graph shows the KE path. chronyc ntpdata is the source of truth.
Australia vs the US
I have one box in Australia (au) and nine in the US (two home routers, a VPS and the six Kubernetes nodes). Every one of them runs in UTC, as all infrastructure should, so this is purely about distance. Here's how the same config plays out (peer delay is the actual NTP round trip, from chronyc ntpdata):
au US hosts
Peer delay
time.cloudflare.com 1.1 ms 1.3 - 2.4 ms
Meta (timeN.meta.com) 97 - 125 ms 1.6 - 25 ms (one at 143 ms)
Netnod (Sweden) 265 ms 120 - 163 ms
Selected source Cloudflare Meta (all 9)
Stratum of this host 4 2
Error bound on source +/- 3.4 ms +/- 0.7 - 1.5 ms (k8s nodes)
+/- 6 - 12 ms (routers, VPS)
RMS offset 49 us 92 - 1600 us
A few things fall out of that:
- Anycast is what makes Australia work. Cloudflare serves NTP from the same anycast PoPs as everything else, so my Australian box gets a server a millisecond away. Meta's and Netnod's NTP servers are fixed, and Australia is a long way from both. Without Cloudflare,
auwould be relying on 100+ ms paths, where the delay-asymmetry error from earlier adds up fastest. - Australia effectively has one nearby source. Meta and Netnod are still useful there as voters (they agree with Cloudflare to within a millisecond), but their error bars are ±50 to ±130 ms, so they can only catch a Cloudflare failure if it's big. A local NTS operator in Australia or New Zealand would be a better third voter for that box, and I haven't found one yet. Let me know if you know of one.
- Stratum isn't quality.
auends up at stratum 4 because Cloudflare's servers are themselves stratum 3, while the US hosts sit at stratum 2 behind Meta's stratum 1 servers. Yetauhas the lowest RMS offset in the fleet. A short, consistent path beats a low stratum number every time. - The US Kubernetes nodes are the best synced machines I own, at about ±1 ms to Meta; their selected Meta server is under 2 ms away. The home routers and the VPS land at ±6 to 12 ms.
What does it cost?
This is usually the first objection, so I captured both modes on my WAN interface talking to Cloudflare:
Plain NTP NTS
NTP request (UDP) 48 bytes 188 bytes
NTP response (UDP) 48 bytes 188 bytes
NTS-KE (TCP/4460) - ~3.6 KB total, ~45 ms
(TCP + TLS 1.3 + cert chain + cookies)
once at start, then ~every 4 weeks
Extra round trips on 0 0
each time sample
Putting that into numbers:
- Bandwidth: each poll is about four times bigger, but polls are rare. Once chrony settles it polls every 1024 seconds by default, roughly 84 times a day per source. Four NTS sources come to about 125 KB/day of NTP payload, against about 32 KB for plain NTP. Add one ~3.6 KB key exchange per source every four weeks. That's noise on any link I own, including the metered LTE backup.
- Latency and accuracy: nothing measurable. After the key exchange, each sample is still one UDP round trip, and the timestamps are taken exactly as before. The authenticator adds a few microseconds of CPU on each end, which is well inside the error bars above. My Kubernetes nodes are synced to Meta at about ±0.7 to 1.5 ms over NTS, the same as before.
- Server cost: stateless thanks to the cookies, which is why Cloudflare, Meta and friends can offer it for free.
- Operational cost: this is the real one. You now depend on TCP/4460 being reachable, on DNS and the CA system at key-exchange time, and on a roughly correct clock (hence
nocerttimecheck). Each of those is a new way for time sync to fail at boot that plain NTP didn't have. They're all solvable, but know they're there before you deploy it to a box without a console.
How much more internet am I wasting? #cloggingTheTubes
Purely for fun, here's the whole fleet. Each NTP exchange is 140 bytes bigger in each direction, 280 bytes extra in total. With ten hosts, four sources each, and a poll every 1024 seconds once things settle:
280 B extra x 84.4 polls/day x 4 sources x 10 hosts = 945 KB/day
+ NTS-KE: ~4.3 KB on the wire x 40 sources / 28 days = ~7 KB/day
-----------
~952 KB/day
~348 MB/year
~348 MB/year = ~3 minutes of 4K Netflix (at ~15 Mbit/s)
= ~0.5 seconds of 4K Netflix per day
= ~241 x 1.44 MB floppy disks
And that's just the NTP payload. I'm also an unrepentant IPv6 zealot, so every one of those packets goes out with a 40-byte IPv6 header instead of IPv4's svelte 20 bytes. Every byte counts, so here's the full on-the-wire bill, headers and all, against what a sensible IPv4 person running plain NTP would pay:
One NTP exchange (request + response), IP + UDP headers included:
IPv4 + plain NTP 2 x (20 + 8 + 48) = 152 bytes <- a legacy person
IPv4 + NTS 2 x (20 + 8 + 188) = 432 bytes
IPv6 + NTS 2 x (40 + 8 + 188) = 472 bytes <- me
The IPv6 header tax alone (40 B/exchange + 20 B per NTS-KE TCP packet):
~136 KB/day = ~49.5 MB/year
= ~26 seconds of 4K Netflix/year
Grand total, v4 plain NTP -> v6 NTS: ~1.09 MB/day = ~397 MB/year
= ~3.5 minutes of 4K Netflix/year
So for the price of about half a second of Netflix a day, nobody on the path can rewrite what time all ten of my machines think it is, and I get to keep feeling smug about IPv6 while doing it. #evilPerson. I'll take that deal.
Wrapping up
If you run chrony, turning on NTS is a few nts keywords and a firewall rule. You get time that can't be silently rewritten in transit and requests that can't be tracked between networks, for a few extra KB a day. Pick at least three independent operators so chrony can outvote the one that has a bad day. Then check chronyc -N authdata for NTS, NAK 0 and a full set of cookies, and move on.
As always, the whole thing is a one-file change in my Ansible chrony role, deployed by the same shed that runs everything else. Ten hosts were swapped over, verified and graphed in 10 minutes with AI.