Skip to main content

Appendix I. Internet Group Management Protocol (IGMP)

The Internet Group Management Protocol (IGMP) is used between IP hosts and their immediate neighbor multicast agents to support the creation of transient groups, the addition and deletion of members of a group, and the periodic confirmation of group membership. IGMP is an asymmetric protocol and is specified here from the point of view of a host, rather than a multicast agent.

Like ICMP, IGMP is a integral part of IP. It is required to be implemented in full by all hosts conforming to level 2 of the IP multicasting specification. IGMP messages are encapsulated in IP datagrams, with an IP protocol number of 2. All IGMP messages have the following format:

 0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Group Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Access Key +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

There are eight types of IGMP message:

1 = Create Group Request
2 = Create Group Reply

3 = Join Group Request
4 = Join Group Reply

5 = Leave Group Request
6 = Leave Group Reply

7 = Confirm Group Request
8 = Confirm Group Reply

Code

In a Create Group Request message, the code field indicates if the new host group is to be public or private:

0 = public
1 = private

In all other Request messages, the code field contains zero.

In a Reply message, the Code field specifies the outcome of the request:

0       = request granted
1 = request denied, no resources
2 = request denied, invalid code
3 = request denied, invalid group address
4 = request denied, invalid access key
5 - 255 = request pending, retry in this many seconds

Checksum

The checksum is the 16-bit one's complement of the one's complement sum of the IGMP message starting with the IGMP Type. For computing the checksum, the checksum field should be zero.

Identifier

In a Confirm Group Request message, the identifier field contains zero.

In all other Request messages, the identifier field contains a value to distinguish the request from other requests by the same host.

In a Reply message, the identifier field contains the same value as in the corresponding Request message.

Group Address

In a Create Group Request message, the group address field contains zero.

In all other Request messages, the group address field contains a host group address.

In a Create Group Reply message, the group address field contains either a newly allocated host group address (if the request is granted) or zero (if denied).

In all other Reply messages, the group address field contains the same host group address as in the corresponding Request message.

Access Key

In a Create Group Request message, the access key field contains zero.

In all other Request messages, the access key field contains the access key assigned to the host group identified in the Group Address field (zero for public groups).

In a Create Group Reply message, the access key field contains either a non-zero 64-bit number (if the request for a private group is granted) or zero.

In all other Reply messages, the access key field contains the same access key as in the corresponding Request.

Protocol Rules

Request messages are sent only by hosts. Reply messages are sent only by multicast agents. If a host receives an IGMP message of a type other than the four Reply types specified above, the message is discarded.

A Request message is sent with its IP destination field containing the well-known address of the Multicast Agent Group. The IP time-to-live field is initialized by the sender to 1, in order to limit the scope of the request to immediate neighbor multicast agents only. The IP source address field contains the individual IP address of the sending host.

A Reply message is sent only in response to a Request message. Its IP destination address field contains the individual address of the host that sent the corresponding Request. (A Confirm Group Reply may also be sent to the host group address specified in its corresponding Confirm Group Request.) The IP source address field contains the individual IP address of the replying multicast agent.

When a host sends a new Create Group, Join Group, or Leave Group Request message, it supplies an arbitrary identifier that it has not used within the last T0 seconds. (It is usually sufficient just to increment the identifier for each new request.) The host initializes a timer to T1 seconds and a retransmission counter to zero. If a Reply message with a matching identifier is not received before the timer expires, it is reset to T1 seconds and the retransmission counter is incremented. If the counter is less than N1, the host retransmits the Request message with the same identifier. If the counter equals N1, the host gives up; if the request was to create or join a group, it is deemed to have failed; if the request was to leave a group, it is deemed to have succeeded.

If a "request pending" code is received in a matching reply to a Create Group, Join Group, or Leave Group Request, the timer is reset to the number of seconds specified by the code and the retransmission counter is reset to zero. The new timer value applies to one timeout interval only -- if the timer expires, it is reset to T1 seconds, the counter is incremented, and the request is retransmitted.

The first matching Reply to a Create Group, Join Group, or Leave Group Request containing a "request granted" or "request denied" code determines the outcome of the request. Any subsequent or non-matching Replies are discarded by the host. However, if a host receives an affirmative Create Group Reply or Join Group Reply that neither matches an outstanding Request nor contains the address of a group to which the host belongs, the host should immediately send a Leave Group Request for the unexpected group address.

A "request granted" reply to a Create Group Request implies that, as well as the group being created, the requesting host is granted membership in the group, i.e. there is no need to send a separate Join Group Request.

Confirm Group Request messages must be sent periodically by hosts to inform the neighboring multicast agent(s) of the hosts' continuing membership in the specified groups. If an agent does not receive a Confirm Group Request message for a particular group within an agent-defined interval, it stops delivering datagrams destined to that group.

For each group to which it belongs, a host maintains a confirmation timer and a variable t. The variable t is initialized to T2 seconds. Whenever the host's request to create or join a group is granted, and whenever the host either sends a Confirm Group Request or receives a Confirm Group Reply with a "request granted" code for the group, the host sets the group's timer to a random number uniformly distributed between t and t + T3 seconds. If the host receives a a Confirm Group Reply with a "request pending" code, t is changed to the value of the code and the timer is reset to a random number between the new t and t + T3. The variable t retains its value until another "request pending" code is received. Whenever the timer expires, the host sends a Confirm Group Request.

Even if a host fails to receive Confirm Group Replies to its Requests, it continues to consider itself a member of the group, because it may still be able to receive multicast datagrams from other hosts on the same local network. Only if a host receives a "request denied" code in a Confirm Group Reply does it stop sending Confirm Group Requests and consider its membership to be revoked.

Multicast agents respond to Confirm Group Request messages by sending Confirm Group Reply messages either to the individual sender of the Request or to the host group address specified in the Request. By sending back a Confirm Group Reply to all neighboring members of a group, a multicast agent is able to reset every member's timer with a single packet. The randomization of the timers is intended to cause only the one member whose timer expires first to send a Confirm Group Request, stimulating a Reply to reset all the timers. The use of the "request pending" codes allows the multicast agent to control the rate at which it receives Confirm Group Requests.

Protocol Timing Constants

The following timing constants are specified for IGMP. They are subject to change as a result of operational experience.

T0 = 300 seconds  minimum recycle time for identifiers

T1 = 2 seconds retrans. interval for Create/Join/Leave Requests

N1 = 5 tries retrans. limit for Create/Join/Leave Requests

T2 = 15 seconds initial value for Confirm Request variable t

T3 = 15 seconds random range for Confirm Request variable t