Controlling Multicast Scope with TTL

Problem

You want to ensure that your multicast traffic remains confined to a small part of the network.

Solution

You can define a TTL threshold value for each interface on a router. The ttl-threshold command instructs the router to drop any multicast packets that have a TTL value less than or equal to the specified value. The router will receive packets on this interface normally. This command only affects transmission of multicast packets:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip multicast-routing
Router1(config)#interface FastEthernet0/0
Router1(config-if)#ip multicast ttl-threshold 16
Router1(config-if)#end
Router1#

This technique works for all multicast routing protocols.

Discussion

The first popular method for controlling the scope of multicast transmissions made use of the standard IP TTL header variable. This is an 8-bit variable that each router decrements by one as it forwards the packet. If a router receives a packet with a TTL value of 1, it won’t forward it any further. The main use of TTL in unicast IP networking is to help to kill loops. In a loop situation, a packet may go around a few times, but the TTL value keeps decrementing and will eventually reach 1, when the network will drop it.

In multicast networking, TTL has a more subtle use. Most multicast applications include the ability to define an initial TTL value other than the default 255. This leads to a common method ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.