Understanding the NTP Stratum Hierarchy

A handful of sites around the globe maintain highly accurate and precise atomic clocks that are the official time source for the entire world. Ultimately, a typical computer whose time is set via NTP traces its clock's settings back to one of these official time sources. NTP is designed to permit computers to set their clocks to a time signal maintained by an outside source. An NTP server does this, and in turn allows other computers to set their clocks to its own signal. This arrangement creates an expanding pyramid of clocks that trace their setting back to some accurate source, as shown in Figure 27.4. The peak of this pyramid is known as a stratum 0 time server. Such a server is not a computer in the traditional sense; instead, it's an atomic clock, a radio that receives time signals broadcast from an atomic clock, or some similar device. A stratum 1 time server sets its clock based on this veridical time source. A stratum 2 time server sets it clock to a stratum 1 server's signal, and so on.

Figure 27.4: NTP enables an expanding pyramid of computers to set their clocks to a highly accurate original source signal.

Figure 27.4 demonstrates another important feature of NTP: Individual NTP clients and servers can synchronize themselves to multiple time sources. Some of the computers in Figure 27.4 tie into two higher-stratum servers. In a configuration like this, the server that synchronizes to multiple sources uses various means to determine which source is more accurate.

If for some reason you need a highly accurate local time, you can obtain your own stratum 0 time source. The least expensive of these are radio devices that read time signals broadcast from Global Positioning System (GPS) satellites or via AM radio. The Linux Clock Mini-HOWTO document

(http://www.tldp.org/HOWTQ/mini/Clock-4.html) includes pointers to a few hardware manufacturers of such devices, which cost about $100. Using such a clock requires installing special drivers and pointing your NTP server to the device by using a special server configuration. You might need your own stratum 0 source if you're doing scientific experiments that require not just very precise but very accurate time measurements, for instance. Fortunately, few people need this sort of accuracy; configuring one of your systems as fairly low-stratum devices will work just fine for most purposes.

Typically, you'll set up one of your systems (or perhaps more, if your network is very large or split across many subnets) as your network's main time server. This server will synchronize itself with an outside time server, and all your other computers will use your main time server as a time source. This configuration minimizes the load placed on an external time server and the amount of NTP-related traffic between your site and other sites on the Internet. You can dedicate a computer to the task of being the NTP server, but this task imposes very little CPU or network load, so you may want to run the NTP server on some other convenient system, such as a print server or DHCP server. Keep in mind that the NTP server is a server, and it poses at least some security risk, so you shouldn't run it on a particularly sensitive system. Heavy network loads for other services could also degrade the accuracy of the NTP server's clock.

Because the number of publicly accessible stratum 1 time sources is limited, chances are you'll point your primary server at between one and three stratum 2 or lower NTP servers. Therefore, most of the computers on your subnet will be at stratum 3 or lower. Even with several intervening layers, these computers' clocks should be accurate to within less than a second.

0 0

Post a comment