NTP Time

Meinberg NTP Zeitserver

The public domain software package NTP

The public domain software package called NTP (Network Time Protocol) is an implementation of the same named TCP/IP network protocol. NTP has been initiated in the 1980's by Dave L. Mills who was trying to achieve a high accuracy time synchronization for computers across the network. The protocol and related algorithms have been specified in several RFCs. Since then NTP has continuously been optimitzed and is at present time widely used around the world. The protocol supports an accuracy of time down to nanoseconds. However, the maximun achievable accuracy also depends on the operating system and the network performance.

Currently there are two versions of NTP which can be used intermixed: NTP v3 is the latest released version which runs very stable on many operating systems. NTP v4 has some improvements over NTP v3 and has better support for some operating systems. Additionally, there's also a simplified version of the protocol called SNTP (Simple Network Time Protocol). SNTP uses the same TCP/IP packet structure like NTP but due to the simpler algorithms, it provides only very reduced precision.

The NTP package contains a background program (daemon or service) which synchronizes the computer's system time to one or more external reference time sources which can be either other devices on the network, or a radio clock which is connected to the computer. Additionally, the NTP distribution contains programs which can be used to control or monitor the time synchronization status, and a complete set of documentation in HTML format.

Supported Platforms

NTP's native operating system is UNIX. Today, however, NTP runs with many UNIX-like systems. NTP v4 has also been ported to Windows and can be used with Windows NT, Windows 2000 and newer Windows versions up to Windows Vista and Windows 7.

The standard NTP distribution can not be run with Windows 9x/ME because there are some kernel features missing which are required for precision time keeping. For Windows 9x/ME and other platforms which are not supported directly by the NTP package there are some NTP or SNTP programs available on the internet. An overview of available programs can be found on the NTP support home page.

Nowadays many workstations are shipped with a pre-installed NTP client, so Meinberg also offers various plug-and-play NTP time servers called LANTIME NTP time server with different reference clock options, e.g. built-in GPS or DCF77 PZF receivers. The devices also have a network interface and power supply included and are assembled in a standalone case and ready to operate.

Naming Conventions: ntp or xntp

Each NTP source distribution contains the NTP daemon itself, plus some utility programs. Earlier versions of the NTP distribution and some of the programs included in the package had names starting with xntp (e.g. xntpd) while other utilities in the same package had names starting with ntp (e.g. ntpq).

Beginning with NTP version 4, the naming conventions were changed to be more straightforward, so now the name of the NTP distribution itself and the names of all the programs included start with ntp (e.g. ntpd, ntpq).

Some Unix-like operating systems use a script to start the NTP daemon at system start-up. Sometimes the script still has a name starting with xntp even though the real name of the daemon is ntpd. This is the case, for example, for SuSE Linux.

The Time Synchronization Hierarchy

The NTP daemon can not only adjust its own computer's system time. Additionally, each daemon can be a client, server, or peer for other NTP daemons:

  • As client it queries the reference time from one or more servers.
  • As server it makes its own time available as reference time for other clients.
  • As peer it compares its system time to other peers until all the peers finally agree about the "true" time to synchchronize to.

These features can be used to set up a hierarchical time synchronization structure. The hierarchical levels of the time synchronization structure are called stratum levels. A smaller stratum number means a higher level in the hierarchy structure. On top of the hierarchy there is the daemon which has the most accurate time and therefore the smallest stratum number.

Stratum Level

By default, a daemon's stratum level is always one level below the level of its reference time source. The top level daemon often uses a radio clock as reference time source. By default, radio clocks have a stratum number of 0, so a daemon who uses that radio clock as reference time will be a stratum 1 time server, which has the highest priority level in the NTP hierarchy. In large networks it is a good practice to install one ore more stratum 1 time servers which make a reference time available to several server computers in each department. Thus the servers in the departments become stratum 2 time servers which can be used as reference time source for workstations and other network devices of the department.

Unlike in telecom applications where the word stratum is used e.g. to classify oscillators according to their absolute accuracy, the term stratum in the NTP context does not indicate a certain class of accuracy, it's just an indicator of the hierarchy level.

Built-In Redundancy

Each NTP daemon can be configured to use several independent reference time sources. Each reference time source is queried (polled) periodically in certain intervals, and the time sources are then classified into groups of time sources which agree about the same time. This allows a group of "good" time sources (truechimers in NTP terminology) to overvote a smaller group of "bad" time sources (so called falsetickers). The so called system peer is then selected from the group of truechimers.

If the time source currently selected as system peer becomes unavailable then a new system peer is determined based on this selection algorithm. The stratum level under which a daemon is visible on the network corresponds to the current system peer's stratum level plus 1.

For details on the selection algorithm see:
http://www.eecis.udel.edu/~mills/ntp/html/prefer.html

For details on the number of time sources to be used see:
http://support.ntp.org/bin/view/Support/SelectingOffsiteNTPServers#Section_5.3.3.