NTP, or Network Time Protocol according to abbreviationfinder, is a protocol designed to synchronize workstation clocks across the network. Version 3 of this protocol is an Internet Draft Standard, formalized in RFC 1305. The NTP version 4 protocol is a major revision of the aforementioned standard, 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
NTP uses UDP as its Transport Layer, using Port 123. It is designed to resist the effects of variable latency, in addition to achieving millisecond accuracy relative to Coordinated Universal Time (UTC).
The UTC time is disseminated through special receivers, such as Radios, Satellites or Modems, managed by the governments of various nations of the world. A limited number of computers are equipped with these receivers and act as time servers.
NTP is one of the oldest Internet Protocols still in use (since before 1985). NTP was originally designed by and continues to be maintained by Dave Mills of the University of Delaware, in conjunction with a team of volunteers, it uses the Marzullo Algorithm with the UTC time scale, including support for features such as Leap Seconds. NTPv4 can stay in sync to within 10 milliseconds (1/100th of a second) over the Internet, and can get as close as 200 microseconds (1/5000th of a second) or more on local area networks under ideal conditions.
In NTP a Hierarchy System of clock strata is used, where stratum 1 systems are synchronized with an external Clock such as a GPS Clock or some Atomic Clock. NTP stratum 2 systems derive their time from one or more of the stratum 1 systems, and so on (it should be noted that this is different from clock strata used in telecommunications systems).
There is a less complex form of NTP that does not require storing information regarding previous communications known as Simple Network Time Protocol’ or SNTP. It has gained popularity in embedded devices and in applications where high precision is not needed.
Package Description
Description of the NTP/SNTP version 4 packet format, which follows the IP and UDP headers.
0 | one | two | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | eleven | 12 | 13 | 14 | fifteen | 16 | 17 | 18 | 19 | twenty | twenty-one | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
LI | BV | Mode | Stratum | chicken | precision | ||||||||||||||||||||||||||
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) |
Leap Indicator (LI)
2-bit code used to indicate that a second will be added/removed from the last minute of the current day.
LI | Worth | Meaning |
00 | 0 | without modification |
01 | one | the last minute has 61 seconds |
10 | two | the last minute has 59 seconds |
eleven | 3 | alarm condition (clock not synchronized) |
Version Number (VN)
3-bit integer indicating the version number. Version 3 indicates version 3 (IPv4 only) and 4 indicates version 4 (IPv4, IPv6 and OSI). If it is necessary to distinguish between IPv4, IPv6 and OSI, the encapsulated context must be examined.
Mode
three-bit integer used to indicate the mode, defined as follows:
Mode | Meaning |
0 | reserved |
one | active symmetric |
two | passive symmetric |
3 | customer |
4 | server |
5 | broadcast |
6 | reserved for NTP control messages |
7 | reserved for private use |
Stratum
It is an 8-bit unsigned integer that indicates the level (stratum) of the local server, the values defined are the following:
Stratum | Meaning |
0 | not specified or not available |
one | primary reference (eg, radio clock) |
2-15 | secondary reference (via NTP or SNTP) |
16-255 | reserved |
Poll Interval
is an 8-bit signed integer indicating the maximum time interval between two successive messages, expressed in seconds and as the nearest power of 2. Most applications use the range from 6 bits (64″) to 10 (1024″)
Precision
is a signed integer indicating the precision of the local clock expressed in seconds to the nearest power of 2.