Hacker Newsnew | past | comments | ask | show | jobs | submit | yardstick's commentslogin

It’s been a decade or more since I last used NTP pool on my servers, have they fixed their quality issues with unreliable and misconfigured time sources? With 10k+ servers polling them, I saw enough issues to abandon it in favour of the likes of Google, Apple, Microsoft etc.

Issues included unresponsive servers, and servers handing out time that was days/weeks/months out of realtime.


I've been using the ntp pools successfully for at least 20 years across many 100s of systems. I think you need to pick at least five sources. Although the docs suggest four: https://www.ntppool.org/en/use.html for an individual system.

Years ago, I wrote a document on support.ntp.org that laid out the math for how NTP servers are chosen, and how many upstream time servers you need to protect yourself from a given number of falsetickers. That article seems to have gone by the wayside, otherwise I would refer you to it.

However, during my time working on the EC2-Chronos team that managed all NTP time servers for all of AWS and Amazon worldwide, in every single region, availability zone, and datacenter, I learned the old rules aren’t quite right.

Ultimately, the NTP algorithm works something like this:

1. Get a statistically significant set of time samples for each upstream time server. That will give you a range of time that it looks like the upstream time server is sending to you, and what you can’t really control is the latency, jitter, wander, etc… that is induced by the network between you. You can measure and account for some of what the network does to you, but not all of it. That’s why you get error bars back.

2. Take the median for each upstream time server, plus the error bars, and plot that on a line. Fastest at one end, slowest at the other.

3. Do some calculations to figure out what the median value is for all of these time servers.

4. If you have more than a selected number of servers on that line, it selects the one that is furthest from the median and throws it out.

5. Then recalculate the new median. If you are now down to three timeservers on that list (or whatever you have configured), then take the one closest to that median and it becomes your SYSPEER. That’s the server you will sync yourself to, since it seems to have the best idea of what the “real” time should be.

6. If you still have servers that can be “voted off the island”, then go back to step #4.

7. Periodically re-evaluate the servers you have configured and which one should be your new SYSPEER.

Now, this assumes you don’t have a local refclock attached (e.g., GPS). If you do, then you probably “PREFER” it over everyone else.

The idea here is that each server that gets voted off the island is potentially a false ticker that is trying to get you to choose the wrong SYSPEER. So, make sure you have enough extra servers defined in your configuration file to survive having a number of falstickers and still get to the right answer. Or, at least one that is close enough.

Historically, the limit was ten upstream timeservers. Any more than that, and `ntpd` would still monitor them, but wouldn’t use them for selecting a SYSPEER. You could monitor up to about 600 upstream timeservers this way, and IIRC, this is actually how the early versions of the NTP Pool operated. You can now adjust how many time servers you want to use for that consideration, but if everyone did this, then it would be chaos. So, you do need to restrict yourself to a reasonable number of upstreams.

More recent NTP servers (e.g., Chrony) will actively use a more upstreams if you configure them, but again you should be courteous to your neighbors and not abuse this feature.

Another trick you can use is to select numbered time servers inside of each NTP Pool zone. So, not just “us.pool.ntp.org”, but also “0.us.pool.ntp.org” and “1.us.pool.ntp.org” and “2.us.pool.ntp.org” and “3.us.pool.ntp.org”. If you were to choose all five of these names, each one will come back with multiple IP addresses, and you should have way more upstream time servers defined than you will ever need.

You should also choose upstream servers and zones that are relatively close to your topological location, where possible. So, don’t choose any upstream servers in Europe or Asia, if you are located in the US. And so on.

Some vendors have signed up to have their own subdomains under the NTP Pool. So, you could add them as time servers for your machine, if you’re on one of those platforms. And they usually have numbered subdomains as well.

If you are an Amazon or AWS customer, then you can also use time.aws.com as one of your upstream time servers. That service was designed to serve all Amazon and AWS customers, worldwide. Every Kindle. Every Alexa device. Every Ring camera. And there are numbered subdomains under time.aws.com, too. I made sure those were created, based on my own experience in helping to set up the NTP Pool and in talking to Ask Bjørn Hansen.

Of course, Apple and Google run their own time server infrastructures. So, you can use them, as well as the NTP Pool. And plenty of other vendors also run their own time server infrastructures.

I’ve been doing this off and on for over twenty years. I can keep going, if you want. Feel free to ask me anything related to NTP.


Could you please shed some light on why EC2 instances are recommended to sync to the single link-local address (say, I care only about EC2 instances without PTP for now)? I presume that traffic never leaves the hardware node, and since underlying HW needs precise enough time, it just serves that time downstream to the instance.

So, on EC2 nodes, the internal Stratum-2 servers provide time to the NTP client on the hypervisor card. From there, it is provided via the link-local address to the EC2 instances. That’s the best quality of time sync that you could possibly get to those instances. The Stratum-1 servers inside the AWS network in each availability zone are providing the signal to the Stratum-2 distribution servers, and those Stratum-2 distribution servers are what feed the hypervisors across all regions, all availability zones, and all datacenters.

On the newer instances, your local NTP client could also be configured to receive a 1PPS signal from the hypervisor card, and in that case you can get an SLA of 20 microseconds or better from “true time”. For these systems, there are Stratum-1 servers within the same datacenter as the hardware where your instance is running. That’s what allows AWS to run a custom fabric for 1PPS signals that is very high fidelity, low jitter and wander, etc….

Older instances aren’t running on hardware that has access to that proprietary fabric where 1PPS is transmitted with very high fidelity, and so there is no 1PPS signal that can be fed to your instance. In that case, you get an SLA of one millisecond (or better).

Either way, this is at least an order of magnitude better than you can get from any other source, since that source would have to be from outside of the AWS network. You might be able to get yourself down to single-digit millisecond accuracy, but still not down as low as you can get from AWS if you just use the link-local service.


Yes was using DNS - two hostnames, one for europe and one for americas iirc. So it was receiving randomly allocated servers every DNS resolve. Didn’t try 4+ hostnames.

With 1, it may be right or wrong, and we can't know one way or the other.

With 2, we still never know if one is correct. This is about the same as 1 but with more steps.

With 3, we gain some good certainty[1].

With 4, there can be further-improved consensus and also redundancy (stuff can and will break). 4 is what the pool suggests[2] using.

With 5 or 6 or more, we're getting into rapidly-diminishing returns while linearly increasing load on the pool. If the time is critical enough to whatever you've got going on to go that far, it may be best to start rolling one's own infrastructure if for no other reason than to reduce impact and be a good neighbor.

(Setting up a networked timeserver (I'm most familiar with ISC ntpd) to distribute network time locally is easy, and is a light-weight process for non-gargantuan networks. Learning about and adding locally-received GPS is still optional, but it's in the realm of spending afternoon with a Raspberry Pi or something along with an inexpensive GPS module.)

[1]: https://en.wikipedia.org/wiki/Triple_modular_redundancy

[2]: https://www.ntppool.org/en/use.html


So, the cool thing about `ntpd` and Chrony is that they do exponential backoff, once they have gathered enough statistical information about the upstream servers they are using. They will typically keep a tighter loop on their selected SYSPEER, but the others will be allowed to relax.

This will reduce the load on any additional upstream time servers that you configure, but obviously it won’t go all the way down to zero.

You still want to be considerate of your neighbors, and not abuse their servers. But it is generally considered fine to be connected to as many as ten upstream time servers.

Now, if you use the “pool” directive, when you get back multiple IP addresses for the same name, you will connect to each of those servers in that pool. If you do the numbered server trick that I explain elsewhere, and each name comes back with just three IP addresses, that means that you will actually be connecting to four or five names, times three IP addresses per name. That’s twelve to fifteen servers, probably.

But that’s okay, because you’re just connecting to the servers you were told about when you did the DNS query, and given the DNS load balancing built into the pool, when the next person asks the same question about those same machines, they will probably get different answers.

Whether it’s `ntpd` or Chrony, when your client goes through the periodic re-evaluation process of those configured upstream time servers, that’s when it should pick up any IP addresses per name changes. And if the IP address is different, then it doesn’t matter that the name is the same. The design of the NTP protocol is such that you must have one and only one unique clock behind each IP address. That’s why load balancing switches don’t work with NTP.


Hey, thanks for the considered response.

I knew about most of that, but I did know about the numbered server addresses being used as multiple peers. You also filled in some other important details that I had glossed over.

I still think it's best to do some local stuff, though, if a large-ish network is resoundingly reliant on tightly-accurate time: Both for the health of volunteer-effort pool, and for the health of the local stuff that needs that timing even as the greater network ebbs and flows.

I have a question, though: What happens when a peer from a pool DNS name drops off and never comes back? Does the local assortment of peers stay relatively-degraded until restart of the daemon, or is there a mechanism that will eventually select a replacement?


Newer versions of ntpd have the `pool` directive which will re-resolve a new IP to clear out bad servers. I suspect that would have resolved your issue.

FWIW I've been serving time in the pool for years now, it's a fun little hobby.


In cases I’ve seen, normally Internet-origin traffic is silently dropped, but blocked traffic from the local network will get a tcp reset or ICMP unreachable.

A local client trying to DoS the local firewall has a lot better options than trying to overload it sending rejects.


And as a side benefit we get to worry less about dodgy builders taking shortcuts!

Can a key be a URL?


I had to skip lots of it. Funnily enough I didn’t think it was LLM made, just someone who wanted to practice their storytelling skills a bit eagerly. A bit of a /r/LinkedInLunatics feel to it.

Bottom bit was confusing. Did he actually get hit or was it just a story? I assume the later but you never know these days…


> Bottom bit was confusing. Did he actually get hit or was it just a story?

What do you mean? This is clearly fiction. The person in the story is dying, the author hasn't died.

Or do you mean whether the person in the story actually died? Yes, he did. He's not typing, these are meant to be his thoughts. He's "stretching" the minute of his death; the story makes an analogy with the no-man's minute of the bug he was trying to debug:

> Tanya used to say I was always somewhere other than here. Now it's true. Only I still don't know where. Sometimes I think it's in that very minute. The server thinks I've been sent. The warehouse thinks I haven't been received yet. And both are right, each by its own clock.

He's been "sent" (to the afterlife) by this plane of existence (the server), but the warehouse (the afterlife) still hasn't received the message, hence "the minute". He's living in that eternal minute, Owl Creek style.


It's clearly a work of fiction. Perhaps you should skip less and you'll retain more.


A better analogy would be to say Anthropic must register their domain with every TLD available, to prevent someone cybersquatting it. I see Claude.org.nz is available.


Maybe, but if I was maintaining PHP or another critical software, I’d think twice about letting Chainguard have inside information.

I would let Chainguard deal with the patches post official release like all other unreliable parties.


Both are to blame.

Calif more than Chainguard, but still Chainguard too.

Calif was obviously twitching to claim credit for their findings, and what I find troubling is this eagerness was more important to them than giving users a chance to update their systems.

Even if they ended up waiting only a day post release I would still say it seems a bit too soon. Maybe a week after. Not everyone’s system have aggressive patching schedules and PHP is soo heavily used.


This is probably the future, tho. Being first to disclose a vuln is a Big Deal in some quarters. And now, the velocity of AI driven pentest swarms mean every researcher who finds something worthwhile has to think "how close is the next droog's swarm to finding what I found" and the temptation to jump the gun only gets stronger.


Yeah I completely understand the motivation. I just wish they were more pragmatic to the security risk vs building their reputation.


I can't blame Chainguard for breaching an embargo which was already nonexistent at the time. If the embargo is broken already, they have a duty to their customers to upload as soon as possible.

All parties have that duty, but it's better if they do that at the same time.

... That's why you have an embargo.


Just wait until someone installs a listening device somewhere in the cab. Doesn’t need to be Waymo doing the listening. Target Waymos that operate around financially important areas like tech and finance companies and profit.


That can be done in any cab. Heck a driver would have a much easier time covertly recording you.


True. But less likely to be able to deploy at scale. Waymo cleaners I’m guessing will be far less likely than drivers to care about keeping their cab super clean and noticing these things.

Plus as per this article, the rider is way less likely to talk important business in front of the driver - hence Waymo being ideal.


The driver might object to a passenger bugging their car, though.


They do record video though, so you'd have to figure out a way to install it such that you aren't suspected of installing it. Plus how do you get it back? You could put in something with a cell modem, but then how do you power it more. There are USB ports tho, so you could ride in the front seat and make it look like a charging cable or battery that you just forgot, but really it's a listening device with a cell modem. For all that effort, you'd want some serious ROI and youd want to do some math on the chances you get something actionable that isn't going to get you investigated by the SEC anyway, and then further, you can't do it a bunch of times because that's really how you get caught. Nah, better to actually get employed by a company, and the higher up you go, the bigger the crimes you can commit!

Sounds like something out of Billions.


We should just tell the French they can send their fishing boats outside the plant. Two birds one stone :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: