Introduction to Network Time Protocol (NTP)

By on

Network Time Protocol (NTP) is one of the Internet’s oldest protocols still utilised today. Developed by Dr David Mills from the University of Delaware, it has been in constant use and continually updated since 1985. NTP is a protocol designed to synchronize the clocks on computers and networks across the Internet or Local Area Networks (LANs).

NTP uses an algorithm (Marzullo’s algorithm) to synchronise time on a network using time scales like UTC (Coordinated Universal Time or Temps Universel Coordonné) and can support such features as leap seconds – added to compensate for the slowing of the Earth’s rotation.

NTP (version 4 being the latest) can maintain time over the public Internet to within 10 milliseconds (1/100th of a second) and can perform even better over LANs with accuracies of 200 microseconds (1/5000th of a second) under ideal conditions.

NTP time servers work within the TCP/IP suite and rely on UDP (User Datagram Protocol). A less complex form of NTP called Simple Network Time Protocol (SNTP) that does not require the storing of information about previous communications, needed by NTP, is used in some devices and applications where high accuracy timing is not as important and is also included as standard in Windows software (although more recent versions of Microsoft Windows have the full NTP installed and the source code is free and readily available on the Internet).

Time synchronisation with NTP is relatively simple, it synchronises time with reference to a reliable clock source. This source could be relative (a computer’s internal clock or the time on a wrist-watch) or absolute (A UTC clock source, like an atomic clock, that is accurate as is humanely possible).

Atomic clocks are the most absolute time-keeping devices. They work on the principle that the atom, caesium-133, has an exact number of cycles of radiation every second (9,192,631,770). This has proved so accurate the International System of Units (SI) has now defined the second as the duration of 9,192,631,770 cycles of radiation of the caesium-133 atom.

However, atomic clocks are extremely expensive and are generally only to be found in large-scale physics laboratories. However, NTP can synchronise networks to an atomic clock by using either the Global Positioning system (GPS) network or specialist radio transmission.

The most widely used is the GPS system which consists of a number of satellites providing accurate positioning and location information. Each GPS satellite can only do this by utilising an atomic clock which in turn can be can be used as a timing reference.

A typical GPS receiver can provide timing information to within a few nanoseconds of UTC as long as there is an antenna situated with a good view of the sky.

There are also a number of national time and frequency radio transmissions that can be used to synchronise a NTP server. In Britain the signal (called MSF) is broadcast by the National Physics Laboratory in Cumbria which serves as the United Kingdom’s national time reference, there are also similar systems in Colorado, US (WWVB) and in Frankfurt, Germany (DCF-77). These signals provides UTC time to an accuracy of 100 microseconds, however, the radio signal has a finite range and is vulnerable to interference.

The distance from the reference clock is known as the stratum levels and they exist to prevent cycles in the NTP and confirm accuracy. Stratum 0 are devices such as atomic clocks connected directly to a computer. Stratum 1 are computers attached to stratum 0 devices (like via a GPS receiver), while Stratum 2 are computers that send NTP requests to Stratum 1 servers. NTP can support up to 256 strata.

All Microsoft Windows versions since 2000 include the Windows Time Service (w32time.exe) which has the ability to synchronise the computer clock to an NTP server. It should be noted that Microsoft recommend that external time references are used rather than Internet based ones as these can’t be authenticated. Specialist NTP servers are available that can synchronise time on networks using either the MSF (or equivalent) or GPS signal.

hello

This post was written by:

Richard N Williams is a technical author and a specialist in the NTP Server and Time Synchronisation industry. Richard N Williams on Google+