5. Description of the Protocol for Group Members
IGMP is an asymmetric protocol, specifying different behaviors for group members (hosts or routers that wish to receive multicast packets) and multicast routers (which listen for IGMP messages and coordinate multicast forwarding). This section describes the part of IGMPv3 that applies to group members. (Note that a router may also be a group member.)
A system performs the protocol described in this section over each interface on which multicast reception is supported. The protocol on each interface involves the immediate processing of two types of events:
-
A change of the multicast reception state on the interface, caused by a local invocation of the IPMulticastListen definition.
-
Reception of a Membership Query message.
5.1. Action on Change of Interface State
An invocation of IPMulticastListen may cause the multicast reception state of an interface to change, according to the rules in Section 3.2. Each such change affects the per-interface state for a single multicast group address.
A change of interface state causes the system to immediately transmit a State Change Report from that interface. The type and contents of the State Change Report are determined as follows:
-
If the change of state is non-significant, such as the filter mode for a group moving from INCLUDE to INCLUDE or from EXCLUDE to EXCLUDE, with the set of source addresses remaining unchanged, no report is generated.
-
If the change of state is significant, a State Change Report is generated. The Report contains a single Group Record for the group whose state has changed. The type and contents of the Group Record are determined by comparing the Old State (the state before the change) with the New State (the state after the change), as indicated in the following table:
Old State New State State Change Record Sent INCLUDE (A) INCLUDE (B) ALLOW (B-A), BLOCK (A-B) EXCLUDE (A) EXCLUDE (B) ALLOW (A-B), BLOCK (B-A) INCLUDE (A) EXCLUDE (B) TO_EX (B) EXCLUDE (A) INCLUDE (B) TO_IN (B) The notation "ALLOW (B-A)" means that the State Change Record carries a source list containing all source addresses that are in set B but not in set A. The notation "BLOCK (A-B)" means that the State Change Record carries a source list containing all source addresses that are in set A but not in set B.
If the computed source list for an ALLOW or BLOCK record is empty, that record is omitted from the State Change Report.
To ensure that the State Change Report is received by all multicast routers on the network, the system retransmits the Report [Robustness Variable] - 1 times, at random intervals chosen from the range (0, [Unsolicited Report Interval]). The [Robustness Variable] is a tunable parameter, defaulting to 2. The [Unsolicited Report Interval] is also a tunable parameter, defaulting to 10 seconds.
If a State Change Report is scheduled for transmission, and a Query is received that would cause a Current State Report to be generated (see Section 5.2), the pending State Change Report is discarded and the Current State Report is sent instead. The Current State Report must contain all the information that would have been in the State Change Report.
5.2. Action on Reception of a Query
When a system receives a Query, it first checks if the Query is valid. To be valid, the Query must:
- be at least 12 octets long,
- have a correct IP checksum,
- have a destination IP address equal to the all-systems multicast address (224.0.0.1) or the specific group address being queried.
If the Query is invalid, it is ignored. If the Query is valid, the system performs the following actions:
- It updates its timer for the Querier, if necessary (see Section 6).
- It determines whether it needs to respond to the Query.
The following subsections describe the rules for responding to different types of Queries.
5.2.1. Action on Reception of a General Query
Upon reception of a General Query, the system checks each interface to see if there is any multicast reception state for any group. For each group for which there is state, the system schedules a Current State Report to be sent.
The Report contains a Group Record for the group. The type of the Group Record is MODE_IS_INCLUDE if the filter mode for the group is INCLUDE, and MODE_IS_EXCLUDE if the filter mode is EXCLUDE. The source list in the Group Record contains the set of source addresses for the group.
The Report is scheduled to be sent at a random time chosen from the range (0, [Max Resp Time]), where [Max Resp Time] is the value specified in the Max Resp Code field of the Query.
5.2.2. Action on Reception of a Group-Specific Query
Upon reception of a Group-Specific Query, the system checks if it has any multicast reception state for the group address specified in the Query. If not, it ignores the Query.
If there is state for the group, the system schedules a Current State Report to be sent. The Report contains a Group Record for the group, constructed as described in Section 5.2.1.
The Report is scheduled to be sent at a random time chosen from the range (0, [Max Resp Time]).
5.2.3. Action on Reception of a Group-and-Source-Specific Query
Upon reception of a Group-and-Source-Specific Query, the system checks if it has any multicast reception state for the group address specified in the Query. If not, it ignores the Query.
If there is state for the group, the system determines whether it is interested in any of the source addresses specified in the Query. The system is interested in a source address if:
- The filter mode for the group is EXCLUDE, OR
- The filter mode for the group is INCLUDE and the source address is in the source list.
If the system is interested in at least one of the source addresses, it schedules a Current State Report to be sent. The Report contains a Group Record for the group, constructed as described in Section 5.2.1.
The Report is scheduled to be sent at a random time chosen from the range (0, [Max Resp Time]).
5.2.4. Action on Reception of a Query with the "S" Flag Set
If the "S" (Suppress Router-Side Processing) flag is set in a received Query, the system does not update its timer for the Querier. However, it still responds to the Query as described in Sections 5.2.1 through 5.2.3.