Content

| 7.2 |  | Examining Multicast in a Multilayer Switched Network |
| 7.2.9 |  | IGMP snooping |

Layer 2 switches need some degree of multicast awareness to avoid flooding multicasts to all switch ports. IGMP Snooping requires the LAN switch to examine, or "snoop" some Layer 3 information in the IGMP packets sent between the hosts and the router. When the switch hears the IGMP Host Report from a host for a particular multicast group, the switch adds the host's port number to the associated multicast table entry. When the switch hears the IGMP Leave Group message from a host, it removes the host's port from the table entry.

When IGMP snooping is enabled, the switch responds to periodic multicast router queries to all VLANs with only one join request per MAC multicast group, and the switch creates one entry per VLAN in the Layer 2 forwarding table for each MAC multicast group for which it receives an IGMP join request. All hosts interested in this multicast traffic send join requests and are added to the forwarding table entry.

Since IGMP control messages are transmitted as multicast packets they are indistinguishable from multicast data at Layer 2. A switch running IGMP Snooping must examine every multicast data packet to check if it contains any pertinent IGMP control information. Enabling IGMP Snooping on a low end switch could severely affect performance when data is transmitted at high rates . CGMP is an ideal alternative for low-end legacy switches.

Configuring IGMP snooping on a Catalyst IOS-based switch
By default, IGMP snooping is globally enabled. When it is globally enabled or disabled, it is also enabled or disabled in all existing VLAN interfaces. By default, IGMP snooping is enabled on all VLANs, but it can be enabled and disabled on a per-VLAN basis.

If IGMP global snooping is disabled, VLAN snooping may not be enabled. If global IGMP snooping is enabled, snooping may be enabled or disabled on a VLAN basis.

To globally enable IGMP snooping, enter the global configuration command ip igmp snooping. The global command no ip igmp snooping vlan vlan-id disables IGMP snooping on a particular VLAN.

> Switch(config)#ip igmp snooping vlan 1

When IGMP immediate-leave processing is enabled, the switch immediately removes a port from the IP multicast group when it detects an IGMPv2 leave message on that port. Immediate-leave processing allows the switch to remove an interface from the forwarding table after receiving a leave message without first sending out group-specific queries from the interface. The immediate-leave feature should be implemented only when a single receiver is present on every port in the VLAN. Immediate-leave is disabled by default. Use the ip igmp snooping vlan vlan-id immediate-leave global configuration command to enable IGMP immediate-leave processing on a VLAN interface.

> Switch(config)#ip igmp snooping vlan 1 immediate-leave

The switch may be configured to either snoop on Protocol-Independent Multicast/Distance Vector Multicast Routing Protocol (PIM/DVMRP) packets or to listen to CGMP self-join packets. By default, the switch snoops on PIM/DVMRP packets on all VLANs.

To learn of multicast router ports through only CGMP self-join packets, use the ip igmp snooping vlan vlan-id mrouter learn cgmp global configuration command. When this command is used, the router listens only to CGMP self-join packets and no other CGMP packets.

To learn of multicast router ports through only PIM/DVMRP packets, use the ip igmp snooping vlan vlan-id mrouter learn pim-dvmrp global configuration command.

> Switch(config)#ip igmp snooping vlan 1 mrouter interface fastethernet0/6

> Switch(config)#ip igmp snooping vlan 2 mrouter learn cgmp

To view the Layer 2 multicast entries for the switch or for a VLAN, use the command show mac-address-table multicast [vlan vlan-id] [user | igmp-snooping] [count]. The user option displays only the user-configured multicast entries.