[PLUG] LAN broadcast?

Tim tim-pdxlug at sentinelchicken.org
Thu Jun 2 06:51:01 PDT 2011


> Not surprised. I couldn't see a way to broadcast using SOCK_STREAM. 
> Googled all over trying to find an example. Does it follow that since I 
> would like to use SOCK_STREAM for the rest of the communications during 
> the optimization job, the multicast side would need to be on a second 
> network interface?

Honestly, I've never implemented anything with multicast.  It is just
a neat way to efficiently distribute traffic.  

I've done a little digging, since this is something I want to learn as
well, and I believe you just need to set some socket options which
instruct the kernel which multicast groups you want to subscribe to.
Then in the background the kernel will notify the appropriate routers
what group traffic you should receive, etc.  I'm a little fuzzy on
what group you would want to pick for simple local experiments...

In any case, it shouldn't require using a different interface.  You
just subscribe to and then bind to a multicast group address and then
receive datagrams on that socket.  Separate unicast sockets can be
used on the same interface.

Here's a few links I found helpful:


More information about the PLUG mailing list