Network Time Protocol (NTP)
NTP is an industry protocol developed to facilitate time
synchronization of network devices. NTP Version 3 uses UDP transport and is
documented in RFC 1305.
A specified device in a NTP network usually gets its time from an
authoritative time source, such as a radio clock or an
atomic clock attached to a time server. NTP then periodically distributes this
time across the network. NTP is an extremely efficient protocol, requiring no
more than one packet per minute to synchronize two machines to the accuracy of
within a millisecond of one another.
NTP uses the concept of a stratum to describe how many NTP “hops”
a device is away from an authoritative time source. A stratum 1 time server
typically has an authoritative time source directly attached, a stratum 2 time
server receives its time via NTP from a stratum 1 time server, and so on.
Devices in a Cisco network can be configured to be a NTP server,
master, or peer. The Cisco implementation of NTP doesn’t support stratum 1
service, recommending instead that time service be synchronized with a public
NTP server available in the IP Internet. Note, it’s important to recognize that
not all Cisco devices support NTP fully. PIX firewalls just added NTP support
with v6.2 of the PIX OS, while IOS devices added support with IOS 10.0.
NTP devices avoid synchronizing to a device with inaccurate time
in two ways. First, NTP will never synchronize to a device that isn’t
synchronized itself. Second, NTP will compare the time reported by several
devices and won’t synchronize to a device with a time significantly different
than the others, even if its stratum is lower. This strategy effectively builds
a self-organizing tree of NTP servers.
NTP devices are usually statically configured to create
associations; each device is given the IP address of any devices with which it
should form associations. In a LAN environment, configuring NTP to use IP
broadcasts is often advantageous. This implementation reduces configuration
complexity because each device is configured to send or receive broadcast
messages.
Use the global configuration ntp peer command to
configure the software clock to synchronize a peer or to be synchronized by a
peer. To disable the feature, use the no form of this command. The syntax is as
follows:
Rtr1(config)#ntp peer ip-address [version ver-num] [key keyid] [source interface] [prefer]
Rtr1(config)#no ntp peer ip-address
The following example allows a router to synchronize its software
clock with the peer at IP address 192.168.1.45 using the default settings over
the FastEthernet 0 interface.
Rtr1(config)#ntp peer 192.168.1.45 source fastethernet 0
Use the interface configuration ntp broadcast
client command to receive NTP broadcast packets on a specified interface. To
disable this capability, use the no form of this command.
Rtr1(config-if)#ntp broadcast client
Rtr1(config-if)no ntp broadcast client