# Multicasting in FreeBSDv8



## znarF (Oct 14, 2009)

I'm having some trouble getting a multicast setup going in FreeBSD8.

My setup is as follows:
[HostA] ---- [RouterA] ---- [RouterB] ---- [HostB]

I use "mcastsend" on HostA to send multicast packets over the network.  HostB uses "mcastread" to subscribe to the multicast group.

The information gets sent between the two routers and the multicast routing tables seem to be correctly updated (tried mrouted and igmp_proxy).  We're using IGMPv2.

The UDP Payload packets enters RouterB, but they aren't forwarded to HostB.

Any advice, or ideas on how I can further debug this would be greatly appreciated.

Thanks.


----------



## znarF (Oct 14, 2009)

*more info*

I am using FreeBSDv8 release candidate 1, with mrouted-3.9beta3+ISO12...is this mrouted version possibly broken?

I've modified the setup so that we only have a single router connected to two hosts in separate networks.  This worked with igmp_proxy - which basically set up a static route in one direction (up & down stream).

Ultimately I'll need to use a routing daemon that can handle more complex setups - like mrouted, without taking up as much memory as Xorp.


----------



## znarF (Oct 14, 2009)

*more insights*

After single stepping through the mrouted code, it seems that not all the igmp packets that I pick up with tcpdump end up being processed.

If the listener host starts up, it sends an unsolicited IGMP_V2_MEMBERSHIP_REPORT packet.  This report is seen on tcpdump on the router, but mrouted doesn't enter the "accept_igmp" routine...which means that the required kernel routes won't be added.

Does this make sense?  Maybe I'm missing something.


----------



## SirDice (Oct 14, 2009)

Not sure if this is also needed on 8.x but did you add 

```
option MROUTING
```
to your kernel config?


----------



## znarF (Oct 15, 2009)

*Options*

Yes, MROUTING is enabled in the kernel.  Typically mrouted would moan if this is not the case.

I'm tracking the problem in the kernel multicasting code.  It looks like there's been a major overhaul to include IGMPv3.  Will post my results.


----------



## znarF (Oct 15, 2009)

I've found the problem in the kernel code.  Membership Report messages are filtered out in "in_mcast.c" (imo_multi_filter)  It is filtered out, because the destination address (the new group to be joined), is not yet subscribed to by the router.  

But according to rfc2236, the destination address should be the group being reported:
   General Query                 ALL-SYSTEMS (224.0.0.1)
   Group-Specific Query          The group being queried
   Membership Report             The group being reported
   Leave Message                 ALL-ROUTERS (224.0.0.2)

I've just commented out the imo_multi_filter call in the kernel.  If anyone can think of any reason why I shouldn't be doing this, please let me know!


----------

