Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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 :)

fnord


Comment on Re: Same multicast packet received by multiple NICs
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.

      fnord

        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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2014-10-23 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls