Multicasting and the Multicast Listener Discovery (MLD) Protocol for IPv6 - Linux

In this section, we discuss the IPv6 multicast group management. Unfortunately, multicast routing is not supported by IPv6 at the time of this writing; only the host side is fully supported. IPv4 used the Internet Group Management Protocol (IGMP) for multicast routing. In IPv4, IGMP associates a multicast address with a series of unicast addresses called a group. If a host wants to receive packets sent to a particular multicast destination address, it joins the group by sending a special IGMP report message to the all routers destination address. Routers send out IGMP queries to the all hosts group address and listen to the IGMP reports from the hosts. Then, multicast routers would forward multicast packets that have a destination address which matches the group address to all members of the group.

In contrast, IPv6 is a little different. The multicast group management is now called Multicast Listener Discovery. The old IGMP protocol used with IPv4 [RFC 1112] is not defined for IPv6. Instead, the message types are defined as ICMP messages and there is no special packet handler for ICMP. However, the initialization function for MLD does register with the socket layer, so join and drop group requests from the application can be processed. The initialization function for MLD is called igmp6_init.

When we initialize, we create a specific socket type for IGMP, igmp6_socket. Notice that the protocol is set to IPPROTO_ICMPV6 because there is no IGMP protocol defined for IPv6. Add and drop group requests are sent to us through this socket.

Here is where we create nodes for multicasting in the /proc file system.

Instead, they are handled by ICMP as shown. When ICMP receives an MLD query, it will forward it to the function igmp6_event_query.

int igmp6_event_query(struct sk_buff *skb);

This function updates the timer for the particular group, which is in the mc_gq_timer field of the inet6_dev structure. When the timer expires, the group report is sent. When ICMP receives an MLD report, it will forward it to igmp6_event_report.

int igmp6_event_report(struct sk_buff *skb);

This function drops all reports that didn’t come from a link-local source address. Next, it deletes the timer for the group. However, as of this writing, it doesn’t update the routing table with the addresses in the report because IPv6 multicast routing is not supported yet.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Linux Topics