8. Managing Group Membership
8.1. Extensions to the IP Service Interface
To allow upper-layer protocol modules to request that their host create, join, or leave a host group, the IP service interface must be extended to offer the following three new operations:
CreateGroup ( private, loopback )
--> outcome, group-address, access-key
The CreateGroup operation requests the creation of a new, transient host group, with this host as its only member. The "private" argument specifies if the group is to be private or public. The "loopback" argument specifies whether or not datagrams sent from this host to the group should be delivered locally as well as to other member hosts. The "outcome" result indicates whether the request is granted or denied. If it is granted, a new 32-bit IP host group address is returned, along with a 64-bit access key which is zero for public groups and non-zero for private groups. The request may be denied due to lack of response from a multicast agent, or lack of resources.
JoinGroup ( group-address, access-key, loopback ) --> outcome
The JoinGroup operation requests that this host become a member of the host group identified by "group-address", with the specified access key. The "loopback" argument specifies whether or not datagrams sent from this host to the group should be delivered locally as well as to other member hosts. The "outcome" result indicates whether the request is granted or denied. The request may be denied due to lack of response from a multicast agent, lack of resources, an invalid group address, an incorrect access key, or already being a member.
LeaveGroup ( group-address, access-key ) --> outcome
The LeaveGroup operation requests that this host give up its membership in the host group identified by "group-address", with the specified access key. The "outcome" result indicates whether the request is granted or denied. The request may be denied due to an invalid group address, an incorrect access key, or not currently being a member.
Each of these operations may take up to a minute or more to complete, depending on the number of IGMP retransmissions performed within the IP module, and time required for a multicast agent to generate a reply. However, typical delays should be on the order of a few seconds.
Besides the LeaveGroup operation, a host loses its membership in a group whenever the host or its IP module crashes, or, in rare circumstances, when a multicast agent revokes its membership. The IP service interface should provide some means of informing an upper-layer module when its membership has been revoked. Membership may be revoked due to lack of resources, deallocation of the group address, or the discovery of another host group using the same group address with a different access key. (See Appendix II for discussion of address recycling issues.)
It is important to observe that IP group membership is per-host, rather than per-process. An IP service interface should not allow multiple processes to invoke JoinGroup operations for the same group as a way of achieving delivery to more than process. The IP module delivers each incoming datagram, whether multicast or unicast, to the single upper-layer protocol module identified by the protocol field in the datagram's IP header; it is an upper-layer issue whether or not to deliver incoming datagrams to more than one process, perhaps using the concept of "process groups" or "shared ports".
8.2. Extensions to the IP Module
Within the IP module, the membership management operations are supported by the Internet Group Management Protocol (IGMP), specified in Appendix I. As well as having messages corresponding to each of the operations specified above, IGMP also specifies a "deadman timer" procedure whereby hosts periodically confirm their memberships with the multicast agents.
The IP module must maintain a data structure listing the IP addresses of all host groups to which the host currently belongs, along with each group's loopback policy, access key, and timer variables. This data structure is used by the IP multicast transmission service to know which outgoing datagrams to loop back, and by the reception service to know which incoming datagrams to accept. The purpose of IGMP and the management interface operations is to maintain this data structure.
On hosts attached to more than one network, each membership is associated with a particular network interface. On such a host the management interface operations above may each require an additional parameter specifying to which interface the create, join, or leave request applies. The group membership data structure must also be extended to associate an interface with each membership. If a host joins the same host group on more than one network interface, it can expect to receive multiple copies of each datagram sent to that group.
8.3. Extensions to the Local Network Service Interface
To allow an IP module to control what packets should be accepted by the local network module, it is necessary to extend the local network service interface with the following two new operations:
AcceptAddress ( group-address )
RejectAddress ( group-address )
where "group-address" is an IP host group address. The AcceptAddress operation requests the local network module to accept and deliver up subsequently arriving packets destined to the local network address corresponding to "group-address". The RejectAddress operation requests the local network module to stop delivering up packets destined to the local network address corresponding to "group-address".
Any local network module is free to ignore RejectAddress requests, and may deliver up packets destined to more addresses than just those specified in AcceptAddress requests, if it is unable to filter incoming packets adequately.
8.4. Extensions to an Ethernet Local Network Module
An Ethernet module responds to AcceptAddress operations by adding the corresponding Ethernet multicast address to its acceptance filter for incoming packets. A RejectAddress operation causes the corresponding Ethernet address to be dropped from the filter. For Ethernet interfaces with a limit on the number of addresses that can be added to the filter, the Ethernet software module must detect when that threshold is exceeded and open up the filter to accept all multicast packets. It should also detect when the number of addresses drops below the threshold and revert to individual address filtering.
8.5. Extensions to Local Network Modules other than Ethernet
Other multicast networks, such as IEEE 802.2 networks, can be handled the same way as Ethernet for the purpose of controlling address filtering. For a pure broadcast network or a point-to-point network, the AcceptAddress and RejectAddress operations may have no effect; all incoming packets could be passed to the IP module for IP-level filtering.