【正文】
ering – Only from a source – All but a source Alberto Ornaghi 2022 11 IGMP v3 API Within an IP system, there is (at least conceptually) an Application Programming Interface or API used by upperlayer protocols or application programs to ask the IP layer to enable and disable reception of packets sent to specific IP multicast addresses. In order to take full advantage of the capabilities of IGMPv3, a system39。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 [RFC2113] in its IP header. There are two IGMP message types of concern to the IGMPv3 protocol: Type Number (hex) Message Name 0x11 Membership Query 0x22 Version 3 Membership Report Alberto Ornaghi 2022 16 An implementation of IGMPv3 MUST also support the following three message types, for interoperation with previous versions of IGMP 0x12 Version 1 Membership Report [RFC1112] 0x16 Version 2 Membership Report [RFC2236] 0x17 Version 2 Leave Group [RFC2236] IGMP v3 Message format Alberto Ornaghi 2022 17 IGMP v3 Message 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 = 0x11 | Max Resp Code | Checksum | +++++++++++++++++++++++++++++++++ | Group Address | +++++++++++++++++++++++++++++++++ | Resv |S| QRV | IC | Number of Sources (N) | +++++++++++++++++++++++++++++++++ | Source Address [1] | + + | Source Address [2] | + . + . . . . . . + + | Source Address [N] | +++++++++++++++++++++++++++++++++ Membership Query Message Alberto Ornaghi 2022 18 IGMP v3 Message format The Max Resp Code field specifies the maximum time allowed before sending a responding report. Allow IGMPv3 routers to tune the leave latency“. The Group Address field is set to zero when sending a General Query, and set to the IP multicast address being queried when sending a GroupSpecific Query or GroupandSourceSpecific Query The Querier39。 a multicast router is not required to keep track of the interests of each individual neighboring system. IGMPv3 is backward patible with previous versions of the IGMP protocol. In order to remain backward patible with older IGMP systems, IGMPv3 multicast routers MUST also implement versions 1 and 2 of the protocol. Alberto Ornaghi 2022 33 IGMP v3 The protocol (for multicast routers) Conditions for IGMP Queries ? Periodic request for membership Multicast routers send General Queries periodically to request group membership information from an attached work.