IPv6 Multicast Operation

We conclude this topic with some concrete examples of IPv6 multicast operation and descriptions of several utility programs related to multicasting and multicast routing.

ifmcstat Command

The ifmcstat command allows a system administrator to check whether a node is listening to a particular multicast group. The ifmcstat command needs access to the kernel memory and requires the super user privilege to run the command.

The following is a sample output from this command executed on an IPv6 router that also serves as a DHCPv6 server. The -f inet6 option instructs the ifmcstat utility to print IPv6-related information only; without this option, ifmcstat would output both IPv4 and IPv6 group addresses.

tmp22-53

ifmcstat displays the group membership information on a per interface basis beginning with the interface name. The command first lists the unicast and anycast addresses assigned to the interface. You may notice that there are two subnet-router anycast addresses: 2001 :db8:0:4819:: and 2 001 :db8 : 0 : 8002 ::.


Multicast group address information follows the list of unicast addresses. Each line beginning with the keyword group shows an IPv6 multicast group address to which the node is listening on the interface, and corresponds to an in6_multi{} data structure. Since the sample router is a DHCPv6 server, it joins the All_DHCP_Servers address, ff05::1:3, and the All_DHCP_Relay_Agents_and_Servers address, ff02::1:2 (Section 4.2.3). Similarly, since the node is a router, it joins the All-Routers address ff02::2, and joins the all-rip-routers address ff02::9 for running the RIPng routing protocol (Section 1.4.2).

refcnt shows the value of the in6m_refcount member of the corresponding in6_multi{} structure, which is meaningless for FreeBSD. FreeBSD manages multicast groups through an address family independent structure, ifmultiaddr{}, which has its own reference counter and is shown as multicnt in the preceding output.

Lines beginning with the keyword mcast-macaddr show the corresponding Layer-2 multicast address for a Layer-3 group address. The interface used in this example is an Ethernet interface, and it can be easily checked that the corresponding Layer-2 addresses conform to the mapping described in Section 2.2.

Enable IPv6 Multicast Routing

No special kernel configuration is necessary to enable IPv6 multicast routing, while the kernel should be rebuilt with the MROUTING option to enable IPv4 multicast routing in the traditional BSD kernel. The difference comes from the view that multicasting is not special anymore.

An IPv6 multicast router should also function as a unicast router (recall that a multicast router must join the All-Routers multicast address and process the Router Alert Hop-by-Hop option). Enabling unicast routing can be done either by rebuilding the kernel with the GATEWAY6 option, or by executing the following sysctl command:

tmp22-54_thumb

pim6dd and pim6sd Routing Daemons

The pim6dd and pim6sd routing daemons are almost configuration free. These daemons can be started by simply invoking the command. For example,

tmp22-55_thumb

The pim6sd daemon requires that a configuration file exist in the system due to an implementation constraint, which is /etc/pim6sd.conf by default.2 An empty configuration file is accepted. A major exception is a PIM-SM RP because a PIM router needs to be configured explicitly to function as an RP. The following line should be added to the configuration file to enable a PIM-SM router as an RP.

tmp22-56_thumb

Additionally, there should normally be one special router called the bootstrap router in order to distribute the RP address (the mechanism is beyond the scope of this topic and is not explained in this topic). The easiest way is to let the RP act as the bootstrap router as well, which should be done by adding the following line to the configuration file:

tmp22-57_thumb

In the rest of this topic, we will concentrate on the pim6sd operation, although most of the information can easily apply to pim6dd. Our discussion will focus on the network topology given in Figure 2-31. Routers A and C are FreeBSD-based PCs that run pim6sd, which are the main concern in the following discussion. In Figure 2-31, ne0, ne1, etc., refer to interface names in a router.

pim6stat Output

The pim6stat command displays the internal status of a running pim6sd process. pim6stat requires the super user privilege to execute the command. Assuming there are two hosts (i.e., H1 and H2 in Figure 2-31) joining a multicast group ff05::1:3 but there is no multicast traffic yet, the output from pim6stat at Router C would be like this:

FIGURE 2-24

FIGURE 2-24

 

tmp22-59

 

 

 

 

tmp22-60

The first section of the pim6stat output lists the multicast interfaces with the local address assigned on each interface. The Flags field gives additional information on each interface: QRY means the router is acting as an MLD querier on the corresponding link. NO-NBR means there are no other PIM routers on the link. It is common to have both the NO-NBR flag and the QRY flag set at the same time. DR means the router is the PIM designated router on the link (the concept of designated router is not discussed in this topic).

The second section of the output shows a list of PIM neighbor routers on each multicast interface attached to the router. Each PIM neighbor router is recognized by a link-local address, but each router also notifies each other of global addresses (if any) on the corresponding interface in order to improve the robustness of RPF (see Section 2.4.4). The list of global addresses is shown, following the link-local addresses.

The third section of the output is a list of the current MLD queriers.

The fourth section of the output is a list of recognized multicast groups that have listeners reported via MLD.

Then the internal routing table (cache) of pim6sd follows. In this example, there is only one entry for the group ff05::1:3. In this entry, the first line beginning with IN6ADDR_ANY means this entry is for a shared tree for the group ff05::1:3 with 2001 :db:cc::1 as the RP address. The next section of the entry shows per interface information. Each line describes the status of each interface in terms of a particular PIM event, such as a joining or pruning event. In this example, the first line means this router (C) receives a join message on interface 3 (from router D). The third line means there is a listener (H1) for the group on the link attached to interface 2. The fifth line means incoming packets should be sent on interfaces 3 and 4. And finally, the sixth line means packets for this group should come from interface 0 (toward the RP), which should be determined by the RPF algorithm.

The last section of the output provides information on the RP and the bootstrap router. In this example, the address of RP is 2001:db8:cc::1, and the upstream router’s link-local address toward the RP is fe80::1 on the link attached to ne0. The multicast prefix ff00::/8 means this RP is responsible for all valid multicast addresses.

The pim6stat command also works for pim6dd by specifying the -d command line option.

netstat Command

Now assume sender S starts sending multicast packets to group ff05::1:3. Each PIM router creates an appropriate multicast forwarding cache (or an equivalent state depending on the implementation) and forwards the packets. Executing the netstat command with the -g option allows a user to view the multicast forwarding cache.

tmp22-61_thumb

For example, an output of netstat -g at router A would be as follows:

tmp22-62_thumb

This means one forwarding cache entry exists for the source address 2001:db8:a0::1 and the group address ff05::1:3 pair. Router A has forwarded 10 packets for this multicast flow, and there are no packets waiting for a cache entry to be established. The incoming multicast interface is interface ne0. The only outgoing interface is the Register interface, which is identified by the multicast interface index of 3.

Similarly, netstat -g would contain the following part at router C:

tmp22-63_thumb

Since router C has two outgoing interfaces, ne2 and ne3, the list of the outgoing interfaces is shown as "2 3".

Next post:

Previous post: