[Xorp-users] Linux 2.6 multicast issue using PIM

Pavlin Radoslavov pavlin@icir.org
Mon, 23 Aug 2004 11:45:48 -0700


> Bruce M Simpson wrote:
> > On Mon, Aug 23, 2004 at 02:04:14PM +0200, Arnaud Le Taillanter wrote:
> > 
> >>Just out of curiosity, why is PIM kernel support necessary for the Xorp 
> >>PIM daemon to operate?
> >>I've successfully run XORP PIM on a FreeBSD box, I followed the 
> >>documentation and enabled the kernel options MROUTING (fair :) and also
> >>PIM, but I don't see why Xorp PIM would need PIM support from the 
> >>kernel. Xorp BGP doesn't need BGP support from the kernel for example.
> > 
> > 
> > BGP lives entirely in userland; it only requires specific kernel support
> > in special circumstances (TCP-MD5).
> > 
> > PIM does not live entirely in userland. Multicast forwarding functions are
> > located within the kernel.
> 
> 
> Aren't the multicast forwarding functions being dealt with by the 
> MROUTING (for FreeBSD) or CONFIG_IP_MROUTE (for Linux) kernel options?
> 
> In my thinking, the PIM XORP daemon then would only need to push out to 
> the kernel the multicast routes it derived from its protocol activity, 
> like BGP does with the unicast routes (via the forwarding engine 
> abstraction). Perhaps PIM needs some information from the kernel about
> multicast traffic coming through an interface (which may change the PIM
> state)?

Ideally, yes, PIM should not need any additional support from the
kernel (beyond the generic multicast routing support). In reality,
you need a bit of extra support.

For example, each PIM router has the special PIM Register virtual
interface. That interface is used for sending and receiving of the
encapsulated PIM Register packets (from the DR to the RP).

At the DR, if the PIM Register vif is in the outgoing interface set
of a multicast forwarding entry, then this means that all data
packets that match on that entry have to be encapsulated as PIM
Register packets and unicast to the RP. Traditionally, this has been
done by sending the whole packet to userland (by a special
IGMPMSG_WHOLEPKT upcall to the application level daemon), where it
is encapsulated and sent to the RP. Such upcall was not needed for
the "vanilla" multicast forwarding support in the kernel (e.g., the
one that was done for DVMRP), but it was added later just for
PIM-SM.

At the RP, if an encapsulated data packet arrives on the PIM
Register vif, then if you want to decapsulate it within the kernel
(as both Linux and FreeBSD do) and forward it on the matching
multicast forwarding entry, the decapsulation itself requires a bit
of PIM knowlegde.

In addition, if a multicast data packet arrives on the wrong
incoming interface, the "vanilla" multicast forwarding will trigger
the IGMPMSG_VRONGVIF in some specific conditions (e.g., the
interface is in the outgoing interface set, the interface is not a
broadcast media, etc). In case of PIM, those conditions are
different. Hence, here again you need a special PIM support from the
kernel.

Regards,
Pavlin