[zeromq-dev] czmq/zbeacon - broadcast address doesn't match selected interface

Pieter Hintjens ph at imatix.com
Wed Oct 9 18:11:14 CEST 2013


On Wed, Oct 9, 2013 at 5:53 PM, Patrick Noffke <patrick at noffke.me> wrote:

> We are trying to use zbeacon as well.  I am curious, why use UDP
> broadcast instead of multicast?

On IPv4, the two work more or less the same. When we developed this,
we of course used UDP multicast. This works, of course. But we found
that the Android WiFi stack (our target at the time) does not handle
multicast properly. Specifically, it discards multicast packets when
acting as an access point. Whereas, broadcast works as expected.

That's the only reason, and IMO there were other plausible workarounds
(primarily, if a node received a broadcast it would connect back over
TCP, and if a node received a TCP connection and no broadcast, it
would also connect out over TCP), and Zyre does implement that, but
I've not retested that case.

It's quite likely that switching to multicast will work perfectly and
if you want to make that patch, I'll merge it happily.

We would have to issue a new version of the ZRE protocol,
http://rfc.zeromq.org/spec:20, (which depends on zbeacon) and possibly
think about backwards compatibility, though I don't know of any real
zbeacon deployments yet. It would certainly be doable to configure a
zbeacon class to use either multicast or broadcast before starting to
publish, and to listen to both broadcast and multicast in any case.

-Pieter



More information about the zeromq-dev mailing list