IGMPv2 works similarly to IGMPv1. The most significant difference between the two versions lies in the leave mechanism. When an IGMPv2 host leaves a group, it sends a Leave message to the IGMP querier. When the IGMP querier receives the Leave message, it sends a Group-Specific Query message to check whether the group has other members. If the IGMP querier does not receive any Report messages for the group within a specified period, it no longer maintains membership of the group. IGMPv2 enables an IGMP querier to know the groups that have no members on a local network segment and update group membership quickly. This leave mechanism reduces redundant multicast traffic on the network.
Figure 1 shows the IGMPv2 message format, and Table 1 describes the message fields.
Field | Description |
---|---|
Type | The four message type options are:
|
Max Response Time | After receiving a General Query message, hosts must respond with a Report message within the maximum response time. This field is valid only in IGMP Query messages. |
Checksum | The checksum is 16 bits long. It is the one's complement of the one's complement sum of the whole IGMP message (the entire IP payload). When computing the checksum, a device initially sets the checksum field to 0. The sender computes the checksum and inserts it into this field. The receiver verifies the checksum before processing the message. |
Group Address | The group address is set differently in different types of
messages:
|
IGMPv2 introduces the querier election and leave mechanisms.
The following describes the querier election and leave processes on the network in Figure 2.
Querier election mechanism
IGMPv2 defines an independent querier election mechanism. When multiple multicast routers are present on a local network segment, the router with the smallest IP address is elected as the querier.
Figure 3 shows how an IGMPv2 querier is elected:
All IGMPv2 routers (RouterA and RouterB in this example) consider themselves queriers and send General Query messages to all hosts and routers on the shared network segment.
When the routers receive a General Query message, they compare the source IP address of the message with their own interface IP addresses. The router with the smallest IP address becomes the querier, and the other routers are considered non-queriers. In this example, RouterA has a smaller interface IP address than RouterB. Therefore, RouterA becomes a querier, and RouterB becomes a non-querier.
The IGMP querier (RouterA) sends General Query messages to all hosts and other multicast routers on the local network segment. The non-querier (RouterB) no longer sends General Query messages.
RouterB starts the other querier present timer. If RouterB receive a Query message from the querier before the timer expires, it resets the timer. Otherwise, it triggers a querier election.
Leave mechanism
Figure 4 shows message exchanges when HostA leaves group G1:
There is another member of G1 on the network segment, HostB, which sends a Report message for G1 immediately after receiving a Group-Specific Query message. The querier therefore continues maintaining the membership of G1.
If G1 has no members on the network segment, the querier will not receive a Report message for G1. When the group membership timer times out, the querier deletes the (*, G1) entry. Thereafter, if the querier receives multicast data sent to G1, it does not forward the data downstream.