[nanomsg] Re: binding to interface names

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Tue, 10 Nov 2015 09:45:45 -0800

And it’s gone. I’ve updated the docs too. So if you use tip, you won’t be
able to use URLs of the form tcp://eth0:5555 or whatever. You can only
specify an IP address in the form “127.0.0.1”, or “[::1]” (or
“[192.168.0.1]” — square brackets can be used with either v4 or v6
addresses and I *do* encourage the use of them to avoid ambiguity — they
are required with v6 addresses) for the local interface to bind to.

This will be integrated into v0.8 whenever that releases.

- Garrett

On Tue, Nov 10, 2015 at 8:57 AM, Garrett D'Amore <garrett@xxxxxxxxxx> wrote:

So I’m going to assume the lack of any response otherwise indicates
general agreement with me. Expect to remove this feature later today.

On Mon, Nov 9, 2015 at 11:57 AM, Garrett D'Amore <garrett@xxxxxxxxxx>
wrote:

Hi all,

libnanomsg “supports” binding to named interfaces, such as

“tcp://eth0:7777”

There are problems with this, such as bug #371, #506, etc. Furthermore,
this type of named interface cannot *ever* work portably.

- Windows doesn’t *have* interface names like this
- Some platforms allow multiple IPs to be bound to a single named
interface

And applications designed this way are *fragile*. If an IP needs to be
moved to a new interface for operational reasons (such as replacing an
interface), then the application will break.

Its *far* better, and standards conforming, to use an IP address (we
allow you to use a DNS name too) instead. For example, to use loopback use:

tcp://127.0.0.1:7777

That solves a lot of fragility problems, and its even RFC-compliant,
since the standards require 127.0.0.1 to be a loopback address (or ::1 for
IPv6).

Given all this, I’d like to get a sense whether folks are using interface
names. Obviously, I have a strong opinion that they *shouldn’t*, and I am
hoping I can just remove this half-baked idea from libnanomsg altogether,
thereby closing the bugs and ultimately simplifying the library a little
bit. (I believe *strongly* in KISS.)

If you’re going to be broken by a removal of this functionality, and
cannot accommodate a change to use numeric IPs instead, please let me know
ASAP. I’d like details.

Absent any compelling argument in favor of keeping this functionality,
binding to interface names will be removed from the next release of
libnanomsg.

- Garrett



Other related posts: