[Twisted-Python] Source specific multicasting (SSM) example?

Phil Mayers p.mayers at imperial.ac.uk
Fri Apr 4 12:41:12 EDT 2008

Rodney Lott wrote:
> Hi, there.
> I was wondering if there is any information or examples on how to use 
> Twisted to perform a SSM operation.  I am new to Twisted and to Python.
> In C, I believe one would use the setsocketopt() to specify the joining 
> to a multicast group (G) to a specific source (S):
>         setsockopt(sock,…, IP_ADD_SOURCE_MEMBERSHIP, (S, G, iface), …)

...provided your OS has IGMPv3 support (and the underlying network has 
IGMPv3 and PIM-SSM setup).

> I believe that Python itself has analogous socket calls and could do 
> this using a UDP socket. 

At least on my version of Python (2.5.1, Fedora 8) there's no constant 
in the "socket" module for that:

 >>> [x for x in dir(socket) if 'member' in x.lower()]

Google for "python igmpv3" does not look promising... It seems as if 
this support isn't there yet.

> I read the Multicast UDP example on Twisted here: 
> http://stderr.org/doc/twisted-doc/howto/udp.html#auto3
> This shows how to do a normal multicast UDP situation with Twisted (i.e. 
> a process will receive UDP traffic from ALL sources registered to the 
> IGMP group). 
> So, if there were UDP three sources (e.g. A, B, and C) registered to the 
> IGMP group, I would like to find a way for my client to only receive 
> data from source B.
> I believe that I can get information using a SDP/SAP using a simple UDP 
> server listening on the appropriate port.  So, the only thing that I am 
> missing is how to register to a group for a specific source.  I am not 
> sure if the joinGroup() method will allow for this. 
> Thanks.
> -Rodney Lott
> ------------------------------------------------------------------------
> _______________________________________________
> 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