7
Configuring NTP
Synchronize your device with a trusted time source by using the Network Time Protocol (NTP) or
changing the system time before you run it on a live network. Various tasks, including network
management, charging, auditing, and distributed computing depend on an accurate system time
setting, because the timestamps of system messages and logs use the system time.
Overview
NTP is typically used in large networks to dynamically synchronize time among network devices. It
guarantees higher clock accuracy than manual system clock setting. In a small network that does not
require high clock accuracy, you can keep time synchronized among devices by changing their
system clocks one by one.
NTP runs over UDP and uses UDP port 123.
The term "interface" in this chapter collectively refers to Layer 3 interfaces, including VLAN
interfaces and Layer 3 Ethernet interfaces. You can set an Ethernet port as a Layer 3 interface by
using the port link-mode route command (see Layer 2—LAN Switching Configuration Guide).
How NTP works
Figure 5 shows how NTP synchronizes the system time between two devices, in this example,
Device A and Device B. Assume that:
• Prior to the time synchronization, the time is set to 10:00:00 am for Device A and 11:00:00 am
for Device B.
• Device B is used as the NTP server. Device A is to be synchronized to Device B.
• It takes 1 second for an NTP message to travel from Device A to Device B, and from Device B to
Device A.
• It takes 1 second for Device B to process the NTP message.
Figure 5 Basic work flow
IP network
Device BDevice A
10:00:00 am 11:00
:01 am
10:00:00 am
NTP message
NTP message
Device A receives the NTP message at 10:00:03 am
1.
3.
2.
4.
NTP message
10
:00:00 am 11:00
:01 am 11:00:02 am
NTP message
10:00:00 am 11:00
:01 am
11
:00:02 am