Internet Group Management Protocol (IGMPv3)
RFC 3678 Summary - IGMPv3 API
RFC 3678 describes the API functions for handling IGMPv3 from userspace.
It defines two API variants – the basic API already exists for IGMPv2
and was extended for IGMPv3 – the advanced API was newly created:
- Basic API (delta based)
- Any-Source Multicast API = exclude mode
- Source-Specific Multicast API = include mode
- Advanced API (full-state)
Further more, there are two implementations – once only for IPv4 and a second for both, IPv4 and IPv6:
- IPv4 API
- Protocol independent API (supports IPv4 and IPv6)
IPv4 specific
Basic API (delta based) – Any-Source Multicast API (exclude mode)
- IP_ADD_MEMBERSHIP (struct ip_mreq)
- IP_BLOCK_SOURCE (struct ip_mreq_source)
- IP_UNBLOCK_SOURCE (struct ip_mreq_source)
- IP_DROP_MEMBERSHIP (struct ip_mreq)
Basic API (delta based) – Source-Specific Multicast API (include mode)
- IP_ADD_SOURCE_MEMBERSHIP (struct ip_mreq_source)
- IP_DROP_SOURCE_MEMBERSHIP (struct ip_mreq_source)
- IP_DROP_MEMBERSHIP (struct ip_mreq)
Advanced API (full-state)
- setipv4sourcefilter(...)
- getipv4sourcefilter(...)
Protocol Independent
Any-Source Multicast API (exclude mode)
- MCAST_JOIN_GROUP (struct group_req)
- MCAST_BLOCK_SOURCE (struct group_source_req)
- MCAST_UNBLOCK_SOURCE (struct group_source_req)
- MCAST_LEAVE_GROUP(struct group_req)
struct group_req
{
/* Interface index. */
uint32_t gr_interface;
/* Group address. */
struct sockaddr_storage gr_group;
};
struct group_source_req
{
/* Interface index. */
uint32_t gsr_interface;
/* Group address. */
struct sockaddr_storage gsr_group;
/* Source address. */
struct sockaddr_storage gsr_source;
};
Source-Specific Multicast API (include mode)
- MCAST_JOIN_SOURCE_GROUP(struct group_source_req)
- MCAST_LEAVE_SOURCE_GROUP(struct group_source_req)
- MCAST_LEAVE_GROUP (struct group_req)
Advanced API (full-state)
- setsourcefilter
- getsourcefilter
Source: RFC 3678 (Socket Interface Extensions for Multicast Source Filters)
RFC 3376 Summary – IGMPv3
Message Formats
Type Number (hex) |
Message Name |
0x11 |
Membership Query |
0x22 |
Version 3 Membership Report |
for interoperation with previous versions of IGMP |
0x12 |
Version 1 Membership Report [RFC-1112] |
0x16 |
Version 2 Membership Report [RFC-2236] |
0x17 |
Version 2 Leave Group [RFC-2236] |
Unrecognized message types MUST be silently ignored.
Membership Queries
There are three variants of the Query message:
- A "General Query" is sent by a multicast router to learn the complete multicast reception state of the
neighboring interfaces (that is, the interfaces attached to the network on which the Query is transmitted). In a General Query, both the Group Address field and the Number of Sources (N) field are zero.
- A "Group-Specific Query" is sent by a multicast router to learn the reception state, with respect to a
*single* multicast address, of the neighboring interfaces. In a Group-Specific Query, the Group Address field contains the multicast address of interest, and the Number of Sources (N) field contains
zero.
- A "Group-and-Source-Specific Query" is sent by a multicast router to learn if any neighboring interface
desires reception of packets sent to a specified multicast address, from any of a specified list of
sources. In a Group-and-Source-Specific Query, the Group Address field contains the multicast address
of interest, and the Source Address [i] fields contain the source address(es) of interest.
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 | QQIC | Number of Sources (N) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address [1] |
+- -+
| Source Address [2] |
+- . -+
. . .
. . .
+- -+
| Source Address [N] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Group Address field is set to zero when sending a General Query, and set to the IP multicast address be-
ing queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
Membership Reports
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 = 0x22 | Reserved | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | Number of Group Records (M) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Group Record [1] .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Group Record [2] .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| . |
. . .
| . |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Group Record [M] .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record Type | Aux Data Len | Number of Sources (N) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Multicast Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address [1] |
+- -+
| Source Address [2] |
+- -+
. . .
. . .
. . .
+- -+
| Source Address [N] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Auxiliary Data .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Group Record Types:
- The “Current-State Record” is sent in response to a Query.
1 = MODE_IS_INCLUDE
2 = MODE_IS_EXCLUDE
- The “Filter-Mode-Change Record” is sent when a local invocation of IPMulticastListen causes a
change of the filter mode (e.g. from INCLUDE to EXCLUDE)
3 = CHANGE_TO_INCLUDE_MODE
4 = CHANGE_TO_EXCLUDE_MODE
- The “Source-List-Change Record” is sent when a local invocation of IPMulticastListen causes a
change of the source list (and the filter mode is not changed).
5 = ALLOW_NEW_SOURCES
6 = BLOCK_OLD_SOURCES
Version 3 Reports are sent with an IP destination address of 224.0.0.22, to which all IGMPv3-capable multi-
cast routers listen. A system that is operating in version 1 or version 2 compatibility modes sends version 1 or
version 2 Reports to the multicast group specified in the Group Address field of the Report.
Source: RFC 3376 (Internet Group Management Protocol, Version 3)