The Internet of Unprofitable Things
In short, if you are ever going to make an embedded device, or an operating system distribution, or anything with NTP default on, please make sure,<p>1. NEVER, ever hardcode an individual NTP server (in form of a IP or domain). DO NOT just go to a list of NTP servers, then copy a few into your code. DON&#x27;T ping pool.ntp.org and get its IP address written down. DON&#x27;T DO ANY OF THESE! PLEASE!<p>2. DO NOT use Stratum 0 and Stratum 1 servers. Please use Tier-2 and lower. Practically, if you follow Rule No.1, then you are always following this rule.<p>3. If the scale of your system is small, in hundreds, or in a few thousands, PLEASE USE pool.ntp.org, this is the NTP community cluster backed by DNS load balancer. Always request the DNS, and make sure the IP is not cached locally for too long. If you need more than one servers, use 0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org, etc (3 is often enough).<p>4. If the scale of your system is large, such as tens of thousand, or you are making a new system, you SHOULD request a customized prefix from pool.ntp.org, such as debian.pool.ntp.org, it helps the community to manage the traffic. If your system is a large commercial one, you ARE REQUIRED to donate some servers to the NTP Pool to compensate the community. Another option is running your own private NTP cluster. The policy is here: <a href="https:&#x2F;&#x2F;www.ntppool.org&#x2F;en&#x2F;vendors.html" rel="nofollow">https:&#x2F;&#x2F;www.ntppool.org&#x2F;en&#x2F;vendors.html</a><p>5. If possible run a standard NTP implementation, like NTPd, chrony, or something else as long as it&#x27;s written professionally. Nowadays even lightbulbs run Linux, then why don&#x27;t you run a standard NTPd?<p>But If you can&#x27;t, then make sure...<p>(a) implement NTPv4, DO NOT use NTPv1.<p>(b) Read the new SNTP RFC if you are implementing an SNTP client. <a href="http:&#x2F;&#x2F;www.faqs.org&#x2F;rfc&#x2F;rfc4330.txt" rel="nofollow">http:&#x2F;&#x2F;www.faqs.org&#x2F;rfc&#x2F;rfc4330.txt</a><p>(c) DO NOT synchronize time on the beginning of an hour, or 00:00 UTC! Select a minute in a hour randomly for synchronization.<p>(d) Use an exponentially-increase retrial interval, DO NOT keep retrying when the server is unreachable, you are launching a DDoS attack!<p>(e) Support Kiss of Death packet, your client should immediately stop requesting a server, cease and desist, once a KoD packet is received.<p>(f) Make sure the client will stop requesting the builtin list of servers, once an alternative server is set by the user.<p>These should have been written in all textbooks related to practical networking lectures, but apparently, there aren&#x27;t. People don&#x27;t even realize that their actions are harmful, and we have all the problems...<p>--------------------------------<p>The NTP community is a complete tragedy of the commons. Even many government institutions cannot keep up with the abusive traffic, and stopped providing public NTP servers.<p>Today, if we don&#x27;t count Microsoft and Apple&#x27;s NTP, almost all public NTP servers are provided by the volunteers from <a href="https:&#x2F;&#x2F;www.pool.ntp.org" rel="nofollow">https:&#x2F;&#x2F;www.pool.ntp.org</a>. By using DNS, it forms a NTP cluster to distribute the load. These people provide time for the entire Internet, and they are the people who withstand all the abuses day by day.<p>People just assume they are some random super servers that always work, without being responsible for their actions, such as hardcoding IP addresses, writing abusive retry code (without exponential increment of timeout), and making a cronjob that initialize a synchronization exactly at midnight (without randomization), effectively a DDoS.<p>Usually, if a device comes with hardcoded NTP addresses, it, in fact, usually indicates their program is poorly-written, and the manufacturers are irresponsible. Those devices have the worst homebrew NTP implementation on the planet,<p>1. They send ancient NTPv1 packets, while the latest version is NTPv4.<p>2. They synchronize their time on the beginning of an hour, effectively making a flooding attack. Another larger flooding attack starts at 00:00 UTC.<p>3. They retry interval is around 3 minutes, if fails to reach the server, make even more traffic to the server, rather than an exponentially-increase interval.<p>4. They still try to talk to the default hardcoded servers, even if an alternative server list is set.<p>5. They don&#x27;t support the Kiss of Death packet, nothing can stop them if they became wild.<p>Stratum 0&#x2F;1 servers are the most vulnerable: they have highest accuracy, with reference clock. Despite the acceptable usage of ST-1 is only passing time to downstream, or for scientific purposes, since there&#x27;s only a handful of them and often listed publicly, they are often spotted by those manufacturers, and put in their devices by default.<p>Stratum 0&#x2F;1 are usually provided by universities, or unpaid volunteers for the public good of the Internet. If a single server got hardcoded in those mass-manufactured devices, serious consequences can happen, the volunteer may literally bankrupt: your whole institute&#x2F;school will be kicked out from the Internet [0]; when you came to the manufacture asking to pay the damage they are responsible for, you are threatened by a lawyer from California. [1] The whole Internet community should honor the spirit of self-sacrifice of these NTP volunteers.<p>The NTP community pool is Stratum 2+, suitable for general use. It has similar issues of abuses - once you&#x27;re in and became well-known on the net, there&#x27;s no way out and you keep receiving bad-traffic, because some clueless people have hardcoded your IP address, or has put it in a cache that never expires. Fortunately given a reasonable bandwidth, it is often a negligible issue and safe to ignore. But there are exceptions. [2] One of my NTP server became DDoSed one day, because an ISP cached the IP address for pool.ntp.org with a large TTL, and the IP address happened to be mine! The traffic was 40 Mbps...<p>In contrast, NTPd has proper rate-limit mechanism built-in, such as KoD and good pooling interval, blocking NTP does NOT causes more user traffic. What increased is the abuser traffic. The damage caused by a standard NTPd and silly sysadmin is much less significant and is negligible compared to the Internet of Scary Things.<p>By the way, not only hardware devices can contains dangerous NTP code, but also software.<p>As long as manufactures still write broken code and unaware of the proper way to use NTP, nothing can be done to solve this issue. Many involved in these misuses and abuses are totally unaware what they are doing. The proper way to use NTP should have been written in all textbooks related to practical networking lectures.<p>[0]: Flawed Routers Flood University of Wisconsin Internet Time Server
<a href="http:&#x2F;&#x2F;pages.cs.wisc.edu&#x2F;~plonka&#x2F;netgear-sntp&#x2F;" rel="nofollow">http:&#x2F;&#x2F;pages.cs.wisc.edu&#x2F;~plonka&#x2F;netgear-sntp&#x2F;</a><p>[1]: Open Letter to D-Link about their NTP vandalism
<a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20060423012837&#x2F;http:&#x2F;&#x2F;people.freebsd.org&#x2F;~phk&#x2F;dlink&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20060423012837&#x2F;http:&#x2F;&#x2F;people.fre...</a><p>[2]: Recent NTP pool traffic increase
<a href="https:&#x2F;&#x2F;mailman.nanog.org&#x2F;pipermail&#x2F;nanog&#x2F;2016-December&#x2F;089588.html" rel="nofollow">https:&#x2F;&#x2F;mailman.nanog.org&#x2F;pipermail&#x2F;nanog&#x2F;2016-December&#x2F;0895...</a>