6. Protocol for Multicast Routers
The purpose of IGMP is to enable each multicast router to learn, for each of its directly attached networks, which multicast addresses have listeners on that network. IGMPv3 also allows a multicast router to learn which sources are of interest to the listeners.
6.1. Conditions for Querier Election
IGMPv3 agrees with IGMPv2 that there should be only one Querier per network. However, IGMPv3 Queriers and IGMPv2 Queriers can coexist on the same network. The election protocol is the same as in IGMPv2:
- Initially, every multicast router starts up as a Querier on each of its attached networks.
- If a multicast router hears a Query message from a router with a lower IP address, it must become a Non-Querier on that network.
- If a multicast router has not heard a Query message from a router with a lower IP address for [Other Querier Present Interval], it resumes the role of Querier.
6.2. Querier Action on Reception of a Query
When a Querier receives a Query message, it checks the source IP address of the Query.
- If the source IP address is lower than its own IP address, the router becomes a Non-Querier.
- If the source IP address is greater than its own IP address, the router continues to be the Querier.
- If the source IP address is equal to its own IP address, the Query is ignored (it's a reflection or loopback).
6.3. Sending of Queries
The Querier periodically sends General Queries to solicit membership information. It also sends Group-Specific or Group-and-Source-Specific Queries when it receives certain types of State Change Reports.
6.3.1. General Queries
The Querier sends General Queries periodically to the all-systems multicast address (224.0.0.1). The default [Query Interval] is 125 seconds.
General Queries are used to refresh the membership information for all groups and sources.
6.3.2. Group-Specific Queries
When the Querier receives a State Change Report indicating that a system has left a group (e.g., a filter mode change from EXCLUDE to INCLUDE, or a source list change blocking a source), it sends a Group-Specific Query to the group address.
This Query is used to determine if there are any remaining systems interested in the group.
6.3.3. Group-and-Source-Specific Queries
When the Querier receives a State Change Report indicating that a system is no longer interested in specific sources for a group (e.g., blocking specific sources), it sends a Group-and-Source-Specific Query.
This Query is used to determine if there are any remaining systems interested in those specific sources.
6.4. Reception of Reports
Multicast routers record the reception state for each group and source based on the Reports they receive. The state is maintained per interface.
6.4.1. Reception of Current State Records
When a router receives a Current State Record, it updates its group/source timers.
- If the record is MODE_IS_INCLUDE, the router refreshes the timers for the listed sources.
- If the record is MODE_IS_EXCLUDE, the router refreshes the group timer and the timers for the excluded sources (if any).
6.4.2. Reception of Filter-Mode-Change Records
When a router receives a Filter-Mode-Change Record, it updates the filter mode and timers.
- CHANGE_TO_INCLUDE_MODE: The router switches to INCLUDE mode if it wasn't already, and updates source timers.
- CHANGE_TO_EXCLUDE_MODE: The router switches to EXCLUDE mode and updates the group timer.
6.4.3. Reception of Source-List-Change Records
When a router receives a Source-List-Change Record, it updates the source timers.
- ALLOW_NEW_SOURCES: The router adds the new sources to its list and starts their timers.
- BLOCK_OLD_SOURCES: The router may query to see if other systems still need these sources before removing them.
6.5. Switching Router Filter-Modes
The router's filter mode for a group transitions between INCLUDE and EXCLUDE based on the state of the group timer and source timers.
- If the group timer is running, the filter mode is EXCLUDE.
- If the group timer expires, the filter mode switches to INCLUDE.
6.6. Action on Reception of a Group Leave Message (IGMPv2)
If a router receives an IGMPv2 Leave Group message, it acts as if it received a State Change Report indicating a change to INCLUDE mode (effectively leaving the group) for the group specified in the Leave message. This allows IGMPv3 routers to interoperate with IGMPv2 hosts.