NTP message format
NTP uses two types of messages: clock synchronization and NTP control messages. All NTP messages mentioned in this document refer to NTP clock synchronization messages. NTP control messages are used in environments where network management is needed. Because NTP control messages are not essential for clock synchronization, they are not described in this document.
A clock synchronization message is encapsulated in a UDP message in the format shown in Figure 6.
Figure 6: Clock synchronization message format
The main fields are described as follows:
LI (Leap Indicator)—A 2-bit leap indicator. If set to 11, it warns of an alarm condition (clock unsynchronized). If set to any other value, it is not to be processed by NTP.
VN (Version Number)—A 3-bit version number that indicates the version of NTP. The latest version is version 4.
Mode—A 3-bit code that indicates the operation mode of NTP. This field can be set to these values:
0—Reserved.
1—Symmetric active.
2—Symmetric passive.
3—Client.
4—Server.
5—Broadcast or multicast.
6—NTP control message.
7—Reserved for private use.
Stratum—An 8-bit integer that indicates the stratum level of the local clock, with the value ranging from 1 to 16. Clock precision decreases from stratum 1 through stratum 16. A stratum 1 clock has the highest precision, and a stratum 16 clock is not synchronized.
Poll—An 8-bit signed integer that indicates the maximum interval between successive messages, which is called the poll interval.
Precision—An 8-bit signed integer that indicates the precision of the local clock.
Root Delay—Roundtrip delay to the primary reference source.
Root Dispersion—The maximum error of the local clock relative to the primary reference source.
Reference Identifier—Identifier of the particular reference source.
Reference Timestamp—The local time at which the local clock was last set or corrected.
Originate Timestamp—The local time at which the request departed from the client for the service host.
Receive Timestamp—The local time at which the request arrived at the service host.
Transmit Timestamp—The local time at which the reply departed from the service host for the client.
Authenticator—Authentication information.