Previous section   Next section

Recipe 14.10 Using NTP to Send Periodic Multicast Time Updates

14.10.1 Problem

You want to set up your router to use the NTP multicast mode so that devices do not need to query periodically for the time.

14.10.2 Solution

Use the ntp multicast interface command to allow the router to send NTP multicast packets:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#clock timezone EST -5 
Router1(config)#clock summer-time EDT recurring
Router1(config)#ntp server 172.25.1.1
Router1(config)#ntp server 172.25.1.3
Router1(config)#interface FastEthernet 0/0
Router1(config-if)#ntp multicast 224.0.1.1 ttl 1
Router1(config-if)#end
Router1#

To enable NTP multicast client functionality on the router, use these commands:

Router2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#clock timezone EST -5
Router2(config)#clock summer-time EDT recurring
Router2(config)#interface Ethernet0
Router2(config-if)#ntp multicast client 224.0.1.1
Router2(config-if)#ntp multicast version 3
Router2(config-if)#end
Router2#

NTP multicast support is available starting in IOS Version 12.1.

14.10.3 Discussion

On the surface, the ability to forward NTP broadcast packets and NTP multicast packets on a LAN interface appear similar. However, there are some differences. First, NTP sends broadcast packets to the local broadcast address, 255.255.255.255. This means that every device on the network must examine the NTP packet. If there are devices on the network that are not NTP broadcast clients, then they will waste valuable system resources reading and discarding these NTP broadcast packets.

On the other hand, NTP multicast packets are sent to the well-known NTP multicast address (224.0.1.1 by default), so only participating NTP multicast clients will examine these packets. The decision of whether to look at a multicast packet is made by the client device's Network Interface Card (NIC), which makes multicast traffic more efficient.

Second, broadcast packets never leave the local LAN segment or broadcast domain. However, multicast packets can be forwarded beyond the local segment via multicast routing, as discussed in Chapter 23. In the previous example, we have configured the server so that it sends these multicast packets with a Time-To-Live (TTL) value of 1. This effectively limits the range of the NTP multicast packets to the local segment, so you do not have to enable multicast routing. But we could choose to route the packet further by increasing the TTL value and enabling multicast routing.

Third, upon initial startup, multicast clients will forward several unicast NTP queries in quick succession to accurately estimate delay and jitter to the server. This allows multicast NTP clients to synchronize their clocks more accurately than broadcast clients. Once the initial packet exchanges occur, the client becomes completely passive and listens for the regularly scheduled NTP multicast server packets.

The following example shows the output of a network analyzer configured to capture all NTP packets on the wire:

07:36:15 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:37:19 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:38:23 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:39:27 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:40:31 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:41:35 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:42:39 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:43:43 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:44:47 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1] 
07:45:51 172.25.1.5.ntp > 224.0.1.1.ntp:v3 mcast strat 3  [ttl 1]

The NTP server periodically forwards NTP multicast messages, while the clients on the local wire do not forward a single packet while in broadcast or multicast mode (after the initial setup). This effectively means the router can just send one packet every 64 seconds and synchronize a large number of clients.

The packet trace also displays some useful information about the server. First, the server's IP address is 172.25.1.5 and it is configured to send multicast NTP packets with the well-known NTP multicast address 224.0.1.1. It also shows that the server is running NTP Version 3 and is advertising itself as a Stratum 3 NTP server. Finally, it shows that the NTP packets have a TTL value of 1, which will contain these NTP packets to the local LAN segment.

Since multicast traffic is more efficient than broadcast traffic, it is the preferred method of providing NTP service via the local LAN. However, since not all NTP clients currently support NTP multicasting, you may have to also use NTP broadcast mode until all clients support multicasting. NTP broadcast services can safely coexist on the same wire as NTP multicast traffic, which should assist network administrators who are converting client software.

For redundancy purposes, you can configure multiple NTP broadcast/multicast servers on a single subnet.

14.10.4 See Also

Recipe 14.9; Recipe 14.12; Chapter 23


  Previous section   Next section
Top