[nanomsg] Re: URL format for local binding

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Fri, 05 Jan 2018 19:01:33 +0000

I’m still fairly opposed to binding to an interface by its named
interface.  The reasons for this are that the meaning of what constitutes
an interface are not portable, even distribution to distribution.  For
example, does this apply to IPv6 or IPv4 or both?  Does an interface have
multiple logical IP addresses on it, and if so how are they enumerated?
(Some operating systems let you place multiple IP addresses on a physical
NIC, whereas others create “sub-inerfaces”, like “eth0:1”.)

What about virtual interfaces, and VLANs, and so forth?  Sometimes these
are expressed as interfaces, and sometimes they aren’t.

In fact, logically, these interfaces (eth0 for instance) are *link-layer*
entities, when what we care about is a network layer (IP address).   I
would prefer not to begin teaching nanomsg about link-layer entities (the
nng zerotier transport notwithstanding).

The code for implementing support for interface names is also rather
complex, and non-portable (even across different UNIX variants), so it
creates a substantial maintenance burden for me.

Finally, using IP addresses (or DNS names) is more precise, and more
correct, and gives access to the same functionality in an unambiguous and
correct manner.

 - Garrett

On Thu, Jan 4, 2018 at 7:58 PM Bent Cardan <bent@xxxxxxxxxxxxxxxxxxxx>
wrote:

won't miss it, i dont use it, but I do miss being able to bind to named
interfaces. That was pretty cool, are you still anti-named-interface as the
IP argument?

for those not familiar, let's say you had an eth0 or eth1 on your VM, you
could write code once for machines that you want to spin up later with
different IPs like:

tcp://eth0:port



On Thu, Jan 4, 2018 at 7:37 PM, Garrett D'Amore <garrett@xxxxxxxxxx>
wrote:

nanomsg uses a special syntax that lets one specify the “local address”
used for binding a TCP socket — in the form:

tcp://local;remote:port/

local in this case refers to a local IP address — letting one confine the
binding to a specific interface.  This is only used on an *outgoing*
connection, letting you specify which local interface should be used for an
outgoing connection.

I find this syntax awkward, and I would like to stop supporting it in
nng.  I think very few people are using it — in fact outside of “paranoia”
on multihomed hosts, I really can’t think of any valid use case for this.
 (Note that servers can still restrict which interface they *bind* to,
since that is part of their primary URL.)

Is anyone using this extended syntax to specify local IP addresses for
outgoing connections?  Will anyone miss it if it vanishes in nng?




Other related posts: