【正文】
lberto Ornaghi 2022 28 IGMP v3 The protocol (for group members) Interface Filter State INCLUDE if *all* such records have a filter mode of INCLUDE, then the filter mode of the interface record is INCLUDE, and the source list of the interface record is the union of the source lists of all the socket records. For example, if the socket records for multicast address m on interface i are: from socket s1: ( i, m, INCLUDE, {a, b, c} ) from socket s2: ( i, m, INCLUDE, {b, c, d} ) from socket s3: ( i, m, INCLUDE, {e, f} ) then the corresponding interface record on interface i is: ( m, INCLUDE, {a, b, c, d, e, f} ) Alberto Ornaghi 2022 29 IGMP v3 The protocol (for group members) Action on Reception of a Query When a system receives a Query, it does not respond immediately. Instead, it delays its response by a random amount of time, bounded by the Max Resp Time value derived from the Max Resp Code in the received Query message. A system may receive a variety of Queries on different interfaces and of different kinds (., General Queries, GroupSpecific Queries, and Groupand SourceSpecific Queries), each of which may require its own delayed response. Before scheduling a response to a Query, the system must first consider previously scheduled pending responses and in many cases schedule a bined response. Alberto Ornaghi 2022 30 IGMP v3 The protocol (for group members) Action on Reception of a Query Therefore, the system must be able to maintain the following state: ? A timer per interface for scheduling responses to General Queries. ? A pergroup and interface timer for scheduling responses to Group Specific and GroupandSource Specific Queries. ? A pergroup and interface list of sources to be reported in the response to a GroupandSource Specific Query. router IGMP query IGMP report Wait for random interval Alberto Ornaghi 2022 31 IGMP v3 The protocol (for multicast routers) The purpose of IGMP is to enable each multicast router to learn, for each of its directly attached works, which multicast addresses are of interest to the systems attached to those works. IGMP version 3 adds the capability for a multicast router to also learn which *sources* are of interest to neighboring systems, for packets sent to any particular multicast address. The information gathered by IGMP is provided to whichever multicast routing protocol is being used by the router, in order to ensure that multicast packets are delivered to all works where there are interested receivers. NOTE: Multicast routers may also themselves bee members of multicast groups, and therefore also perform the group member part of IGMPv3 Alberto Ornaghi 2022 32 IGMP v3 The protocol (for multicast routers) If a multicast router has more than one interface to the same work, it only needs to operate this protocol over one of those interfaces. On each interface over which this protocol is being run, the router MUST enable reception of multicast address , from all sources. Multicast routers need to know only that *at least one* system on an attached work is interested in packets to a particular multicast address from a particular source。s IP API must support the following operation IPMulticastListen ( socket, interface, multicastaddress, filtermode, sourcelist ) Alberto Ornaghi 2022 12 IGMP v3 API parameters socket is an implementationspecific parameter used to distinguish among different requesting entities. interface is a local identifier of the work interface on which reception of the specified multicast address is to be enabled or disabled. (., an Ether interface) multicastaddress is the IP multicast address to which the request pertains. If reception of more than one multicast address on a given interface is desired, IPMulticastListen is invoked separately for each desired multicast address. filtermode may be either INCLUDE or EXCLUDE. sourcelist is an unordered list of zero or more IP unicast addresses from which multicast reception is desired or not desired, depending on the filter mode. Alberto Ornaghi 2022 13 IGMP v3 API patibility Previous versions of IGMP did not support source filters and had a simpler API consisting of Join and Leave operations to enable and disable reception of a given multicast address (from *all* sources) on a given interface. The Join operation is equivalent to IPMulticastListen ( socket, interface, multicastaddress, EXCLUDE, {} ) and the Leave operation is equivalent to: IPMulticastListen ( socket, interface, multicastaddress, INCLUDE, {} ) where {} is an empty source list. Alberto Ornaghi 2022 14 IGMP v3 API example For example, suppose one application or process invokes the following operation on socket s1: IPMulticastListen ( s1, i, m, INCLUDE, {a, b, c} ) requesting reception on interface i of packets sent to multicast address m, *only* if they e from source a, b, or c. Suppose another application or process invokes the following operation on socket s2: IPMulticastListen ( s2, i, m, INCLUDE, {b, c, d} ) Thus, in this example, the reception state of interface i for multicast address m has filter mode INCLUDE and source list {a, b, c, d}. Alberto Ornaghi 2022 15 IGMP v3 Message format IGMP messages are encapsulated in IPv4 datagrams, with an IP protocol number of 2. Every IGMP message is sent with an IP TimetoLive of 1, and carries an IP Router Alert option [RF