Black Box Explains…Network Time Protocol (NTP).
Network Time Protocol (NTP) dates to the early 1980s and is one of the oldest protocols used on the Internet today. NTP was developed to synchronize a network through the use of NTP servers and latency compensation to ensure that every device on a network shows the correct time.
NTP is based on a hierarchical system of clocks and NTP servers. At the top of the hierarchy are clock sources such as atomic or GPS clocks. These clocks are referred to as Stratum 0. NTP servers connected directly to a clock source are referred to as Stratum 1, servers connected to Stratum 1 servers are called Stratum 2, and so on.
Many Stratum 1 NTP servers—often called just time servers—are available for reference on the Internet. The National Institute of Standards and Technology (NIST) Internet Time Service provides many of these servers. Generally, servers closer to the clock—Stratum 1 and Stratum 2—are considered to be more accurate than servers further from the clock. NTP provides Coordinated Universal Time (UTC), which is based on International Atomic Time (TAI), and has support for leap seconds.
To set the correct time, a client device polls several NTP servers, throws out any times that appear to be anomalous, and averages the remaining times to come up with a best estimate of the correct time. An NTP transaction consists of four timestamps:
A client timestamp when a request is sent to the server.
A server timestamp when the request is received by the server.
A server timestamp when the reply is sent to the client.
A client timestamp when the reply is received by the client.
The client device uses these timestamps to compensate for latency and calculate the correct time. Accuracy can usually be maintained within a few milliseconds, even over the Internet.
A compatible standard, Simple Network Time Protocol (SNTP), polls only one NTP server to obtain the time.
Most of today’s computer operating systems include support for NTP or SNTP. Most managers of large networks set up a Stratum 2 NTP server and have computers on the network get their time from that server using SNTP. Having one NTP server for the network rather than having each device going to outside servers for the time ensures accurate and consistent time across the network.