[Xorp-hackers] PIM-SM: Register Decapsulation

Pavlin Radoslavov pavlin at icir.org
Fri Sep 21 10:28:10 PDT 2007


> At the Vrije Universiteit Brussel, a university in Brussels, Belgium; we are
> experimenting with modifying the PIM-SM protocol. For this purpose we are
> also trying to implement a prototype of the Anycast-RP (RFC 4610), using
> XORP. Currently our prototype is currently not working as expecting. So for
> debugging reasons (and to gain a better understanding of the Xorp's
> workflow), we are also investigating the current XORP source code.
> 
>  
> 
> At some point in the file pim_proto_register.cpp we encountered the
> following comment:
> 
> .
> 
> // "decapsulate and forward the inner packet to
> 
> // inherited_olis(S, G, rpt)"

FYI, this is text from the PIM-SM spec.

> // XXX: This will happen inside the kernel.
> 
> // Here we only install the forwarding entry.

This is text from the implementor how the spec action is translated
into the XORP implementation.

> We were unable to locate the code where this decapsulation actually happens.
> So my question is quiete simple: Where do I have to look to understand the
> decapsulation's implementation?

In the UNIX kernel.
For *BSD systems this will be /usr/src/sys/netinet/ip_mroute.c
function pim_input():

    if (PIM_VT_T(pim->pim_vt) == PIM_REGISTER) {
        ...
    }

or /usr/src/sys/netinet6/ip6_mroute.c function pim6_input():

    if (pim->pim_type == PIM_REGISTER) {
        ...
    }

for IPv4 and IPv6 respectively. BTW, the above code is from
FreeBSD-4.10 so it might look slightly different for other versions
or *BSD flavors.

For Linux see /usr/src/linux/net/ipv4/ipmr.c function pim_rcv().

Hope that helps,
Pavlin



More information about the Xorp-hackers mailing list