How IGMP snooping works
The ports in this section are dynamic ports. For information about how to configure and remove static ports, see "Configuring static ports."
IGMP messages types include general query, IGMP report, and leave message. An IGMP snooping-enabled switch performs differently depending on the message.
General query
To check for the existence of multicast group members, the IGMP querier periodically sends IGMP general queries to all hosts and routers on the local subnet. All these hosts and routers are identified by the address 224.0.0.1.
After receiving an IGMP general query, the switch forwards the query to all ports in the VLAN except the port that received the query. The switch also performs one of the following operations:
If the receiving port is a dynamic router port in the router port list, the switch restarts the aging timer for the port.
If the receiving port does not exist in the router port list, the switch adds the port to the router port list. It also starts an aging timer for the port.
IGMP report
A host sends an IGMP report to the IGMP querier for the following purposes:
Responds to queries if the host is a multicast group member.
Applies for a multicast group membership.
After receiving an IGMP report from the host, the switch forwards it through all the router ports in the VLAN. The switch also resolves the address of the reported multicast group, and looks up the forwarding table for a matching entry.
If no match is found, the switch creates a forwarding entry for the group with the receiving port as an outgoing interface. It also marks the receiving port as a dynamic member port and starts an aging timer for the port.
If a match is found but the matching forwarding entry does not contain the receiving port, the switch adds the receiving port to the outgoing interface list. It also marks the receiving port as a dynamic member port and starts an aging timer for the port.
If a match is found and the matching forwarding entry contains the receiving port, the switch restarts the aging timer for the port.
In an application with a group policy configured on an IGMP snooping-enabled switch, when a user requests a multicast program, the user's host initiates an IGMP report. After receiving this report, the switch resolves the multicast group address in the report and performs ACL filtering on the report. If the report passes ACL filtering, the switch creates an IGMP snooping forwarding entry for the multicast group with the receiving port as an outgoing interface. Otherwise, the switch drops this report, in which case the multicast data for the multicast group is not sent to this port, and the user cannot retrieve the program.
A switch does not forward an IGMP report through a non-router port because of the IGMP report suppression mechanism. For more information about the IGMP report suppression mechanism, see "Configuring IGMP."
Leave message
An IGMPv1 host silently leaves a multicast group. The switch is not notified of the leaving and cannot immediately update the status of the port that connects to the receiver host. The switch does not remove the port from the outgoing interface list in the associated forwarding entry until the aging time for the group expires. For a static member port, this mechanism does not take effect.
An IGMPv2 or IGMPv3 host sends an IGMP leave message to the multicast router when it leaves a multicast group.
When the switch receives an IGMP leave message on a dynamic member port, the switch first examines whether a forwarding entry matches the group address in the message.
If no match is found, the switch discards the IGMP leave message.
If a match is found but the receiving port is not an outgoing interface in the forwarding entry, the switch discards the IGMP leave message.
If a match is found and the receiving port is not the only outgoing interface in the forwarding entry, the switch performs the following operations:
Discards the IGMP leave message.
Sends an IGMP group-specific query to identify whether the group has active receivers attached to the receiving port.
Sets the aging timer for the receiving port to twice the IGMP last member query interval.
If a match is found and the receiving port is the only outgoing interface in the forwarding entry, the switch performs the following operations:
Forwards the IGMP leave message to all router ports in the VLAN.
Sends an IGMP group-specific query to identify whether the group has active receivers attached to the receiving port.
Sets the aging timer for the receiving port to twice the IGMP last member query interval.
After receiving the IGMP leave message on a port, the IGMP querier resolves the multicast group address in the message. Then the IGMP querier sends an IGMP group-specific query to the multicast group through the receiving port.
After receiving the IGMP group-specific query, the switch forwards it through all its router ports in the VLAN and all member ports of the multicast group. Then, it waits for the responding IGMP reports from the directly connected hosts. For the dynamic member port that received the leave message, the switch performs one of the following operations:
If the port receives an IGMP report before the aging timer expires, the switch resets the aging timer for the port.
If the port does not receive any IGMP reports when the aging timer expires, the switch removes the port from the forwarding entry for the multicast group.