[zeromq-dev] czmq/zbeacon - broadcast address doesn't match selected interface
Patrick Noffke
patrick at noffke.me
Wed Oct 9 17:53:31 CEST 2013
On 10/09/2013 09:48 AM, Jason Ziglar wrote:
> I'm using zbeacon for service discovery, and have been noticing that the beacon doesn't always behave as expected. I'm using the zsys_set_interface() call to specify which interface to broadcast over, but according to netstat, the beacon is broadcasting over 0.0.0.0. This seems to cause the beacon to be routed differently on each machine.
>
> Is broadcasting over 0.0.0.0 expected behavior? I've got a patch that alters the behavior to what I expect. I'm not sure if I should submit it as a pull request or not though.
>
We are trying to use zbeacon as well. I am curious, why use UDP
broadcast instead of multicast? Please review this SO question for
background:
http://stackoverflow.com/questions/683624/udp-broadcast-on-all-interfaces
On Linux, IP addresses belong to a machine, not to an interface. I
could envision a case where you have two interfaces on the same subnet,
choose one to broadcast on, and a zbeacon listener then wishes to
connect back to the broadcaster, does an ARP request, gets a reply from
a different interface [1], and the subsequent connection is established
on an interface other than the one intended. To get around this, you
have to enable ARP filtering [2], but the average user might not be
aware of this.
[1] http://www.embedded-bits.co.uk/2008/multiple-network-gotcha/
[2] http://serverfault.com/a/247953
Would a rewrite to use multicast be an option? If so, I'd be willing to
help with that, though finding the time could be a challenge. I'm
mainly asking if it could be done without requiring a new API, but I
doubt it, since you could have old zbeacon instances on a network that
could no longer talk to a new multicast zbeacon.
Regards,
Patrick
More information about the zeromq-dev
mailing list