What is NTP (Network Time Protocol)?

What is NTP?

Version 3 of this protocol is an Internet-Draft Standard formalized in RFC 1305. The NTP version 4 protocol is an important revision of the standard in question and is under development, but has not yet been formalized in an RFC. A simple version of NTP (SNTP) version 4 is described in RFC 2030.

NTP uses UDP as the Transport Layer using Port 123. It is designed to withstand the effects of variable delay, in addition to millisecond order accuracy, according to Coordinated Universal Time (UTC).

UTC time is propagated through special receivers such as Radios, Satellites or Modems, managed by governments of various nations of the world. A limited number of computers are equipped with these receivers and function as a time server.

NT Protocol is one of the oldest Internet protocols still in use. NTP was originally designed by Dave Mills from the University of Delaware and is now using the Marzullo Algorithm with a UTC time scale, including features like seconds, with a team of volunteers that continue to do so. NTPv4 can be synchronized over the Internet with a maximum difference of 10 milliseconds (1/100 second) and can reach 200 microseconds (1/5000 seconds) or more in local area networks under ideal conditions.

The NTP uses the Clock Stratum Hierarchy System, in which Stratum 1 systems are synchronized with an external clock, such as GPS Clock or some Atomic Clock. NTP layer 2 systems derive their time from one or more layer 1 systems and note that this is different from the clock layer used in telecommunications systems.

There is a less complicated NTP format that does not require the storage of information about previous communications known as the Simple Network Time Protocol or SNTP. It has gained popularity in embedded devices and applications where high precision is not required.

Package Description

Description of the NTP/SNTP Version 4 packet format following IP and UDP headers.

Root delay

Root Dispersion

Reference Identifier

Reference Timestamp (64)

Originate Timestamp (64)

Receive Timestamp (64)

Transmit Timestamp (64)

Key Identifier (optional) (32)

Message Digest (optional) (128)

LI (Leap Indicator)

A 2-bit code used to indicate that a second will be added/removed from the last minute of the current day.

without modification

the last minute is 61 seconds

the last minute is 59 seconds

alarm condition (clock not synchronized)

Version Number (VN)

It is a 3-bit integer that represents the version number. Version 3 specifies version 3 (IPv4 only) and version 4 for version 4 (IPv4, IPv6, and OSI). If a distinction needs to be made between IPv4, IPv6, and OSI, the encapsulated context should be examined.

Mode

A three-bit integer used to represent the mode defined as follows:

reserved

symmetric active

symmetric passive

client

server

broadcast

reserved for NTP control messages

reserved for private use

Stratum

It is an 8-bit unsigned integer representing the level (layer) of the local server, the defined values ​​are as follows:

not specified or not available

primary reference (eg radio clock)

secondary reference (via NTP or SNTP)

reserved

Poll Interval

An 8-bit signed integer that represents the maximum time interval between two consecutive messages, in seconds and shown as the closest power to 2. Most applications use a range of 6 bits to 10.

Precision

A signed integer that shows the precision of the local clock up to the nearest 2 power in seconds.