[Xorp-hackers] Multicast routing

Pavlin Radoslavov pavlin at icir.org
Thu Feb 15 10:49:15 PST 2007


Sachin K <sachinutd at gmail.com> wrote:

> How does the XORP multicast router sniff IGMP/MLD messages from the network?
> 
> I checked the some routers' code. Most of them just open a RAW socket with
> protocol set to IPPROTO_IGMP. But using this the router gets the
> packets addressed to 224.0.0.1 only.
> 
> How does it receive IGMPv2 and IGMPv3 membership reports sent by other hosts?

The kernel gets all multicast packets because the interface is set
in ALLMULTI mode (i.e., snoop all multicast packets). This happens
after the multicast routing socket has been opened with
setsockopt(..., MRT_INIT, ...) and then each interface is added with
setsockopt(..., MRT_ADD_VIF, ...).

Then the userland program can receive the IGMP packets with opening
a raw IPPROTO_IGMP socket.

BTW, note that there could be only one multicast routing socket open
at a time (across all processes).

Regards,
Pavlin




More information about the Xorp-hackers mailing list