Ntp message format – H3C Technologies H3C WX6000 Series Access Controllers User Manual

Page 71

Advertising
background image

6-3

z

When Device A receives the NTP message, the local time of Device A is 10:00:03 am (T4).

Up to now, Device A has sufficient information to calculate the following two important parameters:

z

The roundtrip delay of NTP message: Delay = (T4–T1) – (T3-T2) = 2 seconds.

z

Time difference between Device A and Device B: Offset = ((T2-T1) + (T3-T4))/2 = 1 hour.

Based on these parameters, Device A can synchronize its own clock to the clock of Device B.

This is only a rough description of the work mechanism of NTP. For details, see RFC 1305.

NTP Message Format

NTP uses two types of messages, clock synchronization message and NTP control message. An NTP

control message is used in environments where network management is needed. As it is not a must for

clock synchronization, it will not be discussed in this document.

All NTP messages mentioned in this document refer to NTP clock synchronization messages.

A clock synchronization message is encapsulated in a UDP message, in the format shown in

Figure 6-2

.

Figure 6-2 Clock synchronization message format

Main fields are described as follows:

z

LI: 2-bit leap indicator. When set to 11, it warns of an alarm condition (clock unsynchronized); when

set to any other value, it is not to be processed by NTP.

z

VN: 3-bit version number, indicating the version of NTP. The latest version is version 3.

Advertising