[Twisted-Python] sniffing multicast traffic

Ben Barker ben at bbarker.co.uk
Wed Mar 10 06:50:55 EST 2010


Thanks Lars - yes, I am not adamant about using twisted, although it
seemed initially to be the best place to stary. I have also been
looking at the pcapy module, which I think may do what I want, but
also seems very low level.

On Wed, Mar 10, 2010 at 10:48 AM, Lars Ivar Igesund <larsivi at gmail.com> wrote:
> Hi Ben,
>
> my experience (not with Twisted, but with multicast), is that
> multicast often fail to be properly routed (this may be a restriction
> on OS, switch, etc). That you see the multicasts on using tshark is no
> indication on the routing working properly, as it will catch all
> information in promiscous mode, whether routed there or not.
>
> Two possible solutions (that may or may not be easy to in conjunction
> with Twisted) are:
>  * Route the multicasts explicitly
>  * Make the listening socket bind explicitly to the network interface
> where you expect/see the multicast. This is the solution I have used
> myself, but may require using low level socket functionality. Binding
> to localhost (all interfaces at once) or similar did not work for me.
>
> Best regards,
> Lars Ivar
>
> On Wed, Mar 10, 2010 at 11:35 AM, Ben Barker <ben at bbarker.co.uk> wrote:
>> Hello - I wonder if someone can help:
>>
>> We have some status info being sent by various machines using
>> multicast addressed udp packets. I have been attempting to use twisted
>> to write a python script that will passively monitor on the relevant
>> port for any udp packets with the specified multicast address, which I
>> can then parse the payloads of as required.
>>
>> I have been looking at the examples here:
>>
>> http://code.activestate.com/recipes/425975-simple-udp-multicast-client-server-using-twisted/
>>
>> But I seem to have trouble getting them to receive anything at all.
>>
>> I have managed to use tshark to display the packets :
>>
>> tshark -i eth0  -x -l -f udp
>>
>> so I know the data is there (coming isn on address 224.0.0.4, port 901)
>>
>> Any suggestions?
>>
>> B
>>
>> _______________________________________________
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



More information about the Twisted-Python mailing list