Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Same multicast packet received by multiple NICs

by Illuminatus (Curate)
on Jun 01, 2012 at 22:51 UTC ( #973878=note: print w/replies, xml ) Need Help??

in reply to Same multicast packet received by multiple NICs

I also caveat that I've never used this module before. You could try specifying the interface device rather than the IP assigned to it, but since mcast_add just uses that to lookup the device IP, I can't see that it would make any difference.

If I want to see what's appearing on the NIC, I lean towards going to the source. You can use Net::Pcap with a compiled filter to get what you're looking for -- no pesky network stack mucking things up :)


  • Comment on Re: Same multicast packet received by multiple NICs

Replies are listed 'Best First'.
Re^2: Same multicast packet received by multiple NICs
by sophate (Beadle) on Jun 01, 2012 at 23:15 UTC

    Thanks but I don't think the interface device name or IP matters here. Actually I'm using the workaround to use Perl sockets to listen to the mcast from the NICs then create additional threads to monitor the traffic with tcpdump. It looks clumsy but it works. However, I still have no clue why recv() of a socket mapped to a particular NIC can receives data from ALL NICs listening to the same mcast address:port.

      It may depend on your OS. This module creates a socket of type SOCK_DGRAM. These route at the IP/UDP level. I know the module says it can limit you to what's on one NIC, but I'm pretty sure on Linux there's no way to enforce this. The point of multicast is to deliver to every endpoint using that destination address. Maybe the Windows stack has hooks to limit this. I am curious as to why you need to listen for the mcast traffic on a socket if you're using tcpdump to see them as well. You can pass a filter to tcpdump to only see what you're looking for.


        Hi, the socket is actually for joining the mcast group to draw the traffic into the NIC. Tcpdump is just for watching if there are any packets flowing through the NIC. Correct me if I'm wrong, I can't join a mcast group with just topdump :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973878]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2018-06-23 08:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.