[zeromq-dev] Zyre: interface selection and implementation separation

Victor Perron victor at iso3103.net
Sun Dec 2 17:06:18 CET 2012

On Sun, Dec 2, 2012 at 4:44 PM, Yu Dongmin <miniway at gmail.com> wrote:

> Hello,
> Zyre is trying to use the wireless NIC as possible. SIOCGWINAME is used as
> the last non-loopback interface is not always wireless nic.
> please refer, https://github.com/zeromq/zyre/issues/25
> As far as I know, when a system that doesn't have proper ioctl option
> (that's why we have #ifdef blocks) the last non-loopback should be used.
> Otherwise it might be a bug.

That's also what I thought, but I received "Invalid argument" errno on
ioctl(sock, SIOCGIWNAME, ...) with a properly-initialized iwreq structure
(zeroed before copying the name, which wasn't done originally for some
reason) on the Galaxy Nexus S running Android 4.2.1.
Without the check it works fine on that interface though. I'm asking
because event having that bug is weird, it works on all my other Android
phones (Samsungs) and if SIOCGIWNAME was not supported, it would have
yielded ENOTSUP instead...

> In case when wireless nic is down and wired nic is up, the wired nic might
> not be used. This must be handled to support such a wire-connected desktop.

I agree with that part, I'll look into it. So in the end, the last
interface that is up should sum up those requirements, right ? And select
the last WLAN one if we have the choice ?
On other hand, I have devices here that have a mesh0 interface to connect
themselves to each other, and an ap0 interface to act as Access Points.

Wouldn't it be acceptable, finally, to give also the possibility to the
user to select its own brodcast interface(s) ?

> For the repository separation, I don't have any strong preference.
> Thanks
> Min
> On Dec 3, 2012, at 12:02 AM, Victor Perron <victor at iso3103.net> wrote:
> > Hello everybody,
> >
> > I have been interested into Zyre lately.
> >
> > I have tested that in a few situations (WLAN/Ethernet - mixed LANs,
> various architectures, Android phones...) and there is something that I
> feel a little limiting:
> > the current interface selection algorithm looks for the first WLAN
> interface available and uses that one to send its beacons.
> >
> > Still, I do want zyre to be working from my wired devices too - so this
> is already a little blocking un this case - and also, at a deeper level,
> the functions (in C) used to identify those interfaces are not always well
> supported on each target.
> > We already know that quite a lot of OSes do not have the
> getifaddrs/freeifaddrs functions, that can be easily circumvented.
> >
> > But also some Android versions/phones, for instance, do implement
> SIOCGIWNAME ioctl() call, some don't.
> > In the end, doing this kind of detection limits the portability of Zyre
> on those devices, and totally prevent wire-base LANs to be compatible (I
> think it's good if they can !)
> >
> > Why not more simply use the latest non-loopback interface that bears an
> IP address for instance ?
> >
> > Also, on a whole different level, I am asking myself why the C and Java
> implementations of Zyre are in the same repository ?
> > It's hard to make all the contributions match at the same time, and I
> think-maybe I'm wrong- that this will sooner or later lead to two quite
> different implementations in the same repo, same commit; which is
> misleading.
> > What do you think about a separation ?
> >
> >
> > Regards,
> > --
> > Victor
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121202/10fe8c34/attachment.htm>

More information about the zeromq-dev mailing list