[Xorp-users] Very simple multicast setup, yet can't find any text on how to do it!

Erik Slagter erik at slagter.name
Mon Jan 26 05:09:25 PST 2009


[Background information: I want to multicast a stream using IPv6 that is 
originating (locally) from a linux server that has a number of 
interfaces connected, each interface should only send out the packets 
when it has one or more clients that have joined the group, no PIM is in 
use, only MLD. The kernel native multicast forwarding functionality 
should be used, no packet forwarding in user space.]

Finally I came to the conclusion that both xorp and mrd6 are not 
designed for what I need, xorp only functions with multicasting when pim 
is enabled (and set up properly) and the source should be outside the 
host xorp is running on. Mrd6 also needs an external multicast source 
(and maybe (configured) pim as well, I am not shure).

So hacked myself a little (well..) program that does exactly this and 
not more. Due to the documentation about ipv6 multicast routing (api) 
being very sparse (not to say next to non-existent) I had to try and 
error the thing together. If anyone is interested (either for 
experimenting or for giving feedback for improvement (please!)) please yell.

This is what is does: it listens on all system network interfaces for 
MLD messages (currently MLDv2 REPORT only, only INCLUDE and EXCLUDE, 
like current linux kernels send them, the RFC is incomprehensable). When 
a join request arrives, the requested multicast group is added to the 
list of groups of the interface the request came from and the multicast 
route for this group is again added with the changed interface list. 
Likewise for a leave request. Sounds simple, not? Well it's not :-/

Thanks to Todd Hayton BTW, I used his example program as a starting 
point (although my goal is different).

Although I have it working now, I still do have some questions for the 
experts.

- Every now and then I have a line with multicast route with an 
interface of "65536" and silly data in /proc/net/ip6_mr_cache. This look 
like a side-effect of packets being queued when no applicable mc route 
is found?

- As far as I know, it should be ok for a multicast group to be 
forwarded regardless of the source address. If I set mc.mf6cc_origin to 
all (binary) zeroes (bzero) and then call MRT6_ADD_MFC, it simply 
doesn't work, it only works if I request the address from the  incoming 
interface from the routing table, and fill the entry with that address 
and the corresponding interface index, which I think is a dirty hack :-/ 
Isn't there a way to specify a wildcard origin address and interface?

- When I start the program that feeds the multicast stream, before my 
own program is started, the packets are routed to a (for me) random 
interface. This is not always the same interface. It would be logical to 
me if the packets are routed to the lo interface or are discarded 
instead, when no "MRT6_INIT" program is running...

- After I start my program, and I have installed a multicast route with 
one or more interfaces, the packets are STILL (also) forwarded to this 
interface (see above) regardless whether the interface is mentioned in 
the mc route.

- To resolve the above issue, I add a dummy ethernet interface (dummy0), 
which I try to set as multicast source for locally generated mc traffic 
using IPV6_MULTICAST_IF, sometimes this works, sometimes it doesn't. If 
it doesn't, I need to stop both programs (no MRT6_INIT apps, so no more 
mcast route cache...) and type "ip -6 route del ff05::4242" until ip 
returns an error. This route doesn't show up in "ip -6 route show", 
btw... If I now start both programs, the mc traffic seems to originate 
from dummy0 and is not physically sent out to unsubscribed interfaces 
anymore, although tshark reveals the packets are actually still "sent" 
on dummy0. I am not shure whether is this a result of IPV6_MULTICAST_IF 
or that I am just "lucky".

- What is the intended use of IPV6_MULTICAST_IF actually?

- Although I only request MLDv2 packets (143) I still get all sorts of 
messages on the raw socket (icmp type 0, expected, probably "upcall" 
packets) but also all sorts of other types?!

- The semantics of MRT6_ADD_MFC and MRT6_DEL_MFC are still more or less 
a mystery to me. Adding and deleting one specific multicast route seems 
straightforward, but how is one supposed to add an interface to an 
existing route or delete one interface? Currently I call MRT6_ADD_MFC 
simply with the updated set of interfaces and this seems to work, but 
imho this is not "adding" a route like the name suggests... Likewise is 
it possible to call MRT6_DEL_MFC with a minimal set of information 
(like, delete all routes to mc group xx, regardless interface, origin 
address, etc.)? This to clean up the cache every now and then...

Thank you for your time and efford!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3328 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-users/attachments/20090126/e2487760/attachment.bin 


More information about the Xorp-users mailing list