Re: Call for opinions: default naming policy for USB network interfaces: MAC/path/kernel?

2016-04-14 Thread Martin Pitt
Martin Pitt [2016-04-06 12:56 +0200]:
>  * MAC based (status quo): Emphasize the identity of the device that
>you connect
>+ Works well on PCs/laptops where you want to connect your phone or
>  USB 3G stick on an arbitrary USB slot.
> 
>- With boards like the RasPi you usually think in terms of
>  location: The left port is for the external USB ethernet card,
>  the right port for something else.
> 
>- You can't just take a pre-configured image and install it on a
>  bunch of RasPis, as the configuration depends on the particular
>  USB ethernet dongle that you plug in, so the names will be
>  different on every deployed device, you can't keep a r/o
>  image, and you need to adjust the configuration everywhere.

For the record, forgot some minuses here:

 - Long and ugly names

 - This also causes an "interesting" bug (LP: #1567744): It's not
   possible to make the name much longer by e. g. appending a ":1" to
   define an aliased device, in this case you have to set your own
   name.  So:

> None of those are optimal of course (this is an absurdly difficult and
> bikeshed-prone topic, thanks to Linux's "unique" way of treating
> network interfaces completely differently than all other devices), so
> I'm not sure how to do the decision in a qualified way. But let's
> please collect some opinions and see if there's some clear favorite.

So we got one vote from Aaron in favor of moving to location-based,
and some further analysis from Steve (who didn't seem to like
location-based much), so not a clear direction here. Which probably
means to keep the status quo for 16.04 final? 16.04.1 is our next
change to address that (we can't chagne the schema for upgrades
anyway).

Thanks,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


signature.asc
Description: PGP signature
-- 
ubuntu-desktop mailing list
ubuntu-desktop@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop


Re: Call for opinions: default naming policy for USB network interfaces: MAC/path/kernel?

2016-04-06 Thread Aron Xu
On Wed, Apr 6, 2016 at 6:56 PM, Martin Pitt  wrote:
> Hello all,
>
> last summer we discussed changing the way network interface names are
> named [1]. For the most part I think this worked out well, but I've
> heard some complaints here and there about USB devices, we had some
> ad-hoc discussions, but they weren't concluded. So let's review this
> before we release this in an LTS. I'm particularly interested in
> getting some opinions from the desktop and snappy folks, hence the
> cross-posting (this doesn't practically affect the server and cloud
> worlds). But please let's keep the discussion on ubuntu-devel@.
>
> Internal (PCI etc.) ethernet and wifi devices now have either
> BIOS-assigned names based on indexes (eno1) or slots (ens2) or PCI
> path based names like "enp0s1" or "wlp0s1", i. e. they are named by
> location, and roughly match the intution of "first/second" or
> "left/right" card (which works for both physical and virtual
> interfaces, which wasn't the case for the previous MAC-based system
> and thus we didn't do any persistent naming for virtual environments).
>
> However, as there were some complaints [2][3] about location-based
> names not being appropriate for USB devices, we currently use the MAC
> address for those. I. e. they are named like "enx123456AABBCC".
>
> After having seen this in practice for a while, I wonder whether that
> was actually the right decision. There's the stylistic issue of these
> names being very long, but if you configure ifupdown or your firewall
> etc. with those, you only need to copy&paste it exactly once. The more
> important question is whether treating them as "device identity" as
> oppposed to "where do I connect it" is actually the right default.
>
> These are the options with pros (+) and cons (-):
>
>  * MAC based (status quo): Emphasize the identity of the device that
>you connect
>+ Works well on PCs/laptops where you want to connect your phone or
>  USB 3G stick on an arbitrary USB slot.
>
>- With boards like the RasPi you usually think in terms of
>  location: The left port is for the external USB ethernet card,
>  the right port for something else.
>
>- You can't just take a pre-configured image and install it on a
>  bunch of RasPis, as the configuration depends on the particular
>  USB ethernet dongle that you plug in, so the names will be
>  different on every deployed device, you can't keep a r/o
>  image, and you need to adjust the configuration everywhere.
>
>  * Location based (upstream default): Emphasize the location of the
>device that you connect; this has opposite pros and cons:
>+ Works well on embedded boards where you more likely think in
>  terms of location and USB port numbers than "did I use this or
>  that USB ethernet adapter"
>
>+ Is much more suitable for pre-configuring an image and deploying
>  it to lots of devices.
>
>- Breaks on laptops/desktops with lots of USB ports when you tend
>  to plug in your phone/USB dongle in different ports every time.
>  Although there it probably doesn't matter as NetworkManager
>  does not care about device names and connections are set up
>  dynamically -- it's relatively unlikely that you use ifupdown or
>  custom name-based firewall rules for hotpluggable USB network
>  interfaces.
>

Would like to vote for this option since NM does identify the device
based on MAC (considering mostly for desktop use cases, which covers
most day-to-day usages/troubles). For human beings remembering a MAC
address is much harder than plugging in the device into certain USB
port(s) she/he is familiar with.

>  * Keep the kernel name (like eth0) for USB devices
>- Does not provide any stable names if you have multiple USB
>  devices at the same time (however, this doesn't appear to be a
>  common case)
>
>* I. e. this requires you to manually configure names IF you need
>  to refer to the names in config files (ifupdown, firewall) AND
>  you need multiple USB network devices simultaneously.
>
>+ If you only ever use at most one USB device (the common case),
>  the name "eth0" is reasonably predictable, and pre-configured
>  systems (like Raspis) with hardcoded "eth0" have a reasonably
>  high chance of working out of the box.
>
>- There are no firm guarantees about the kernel actually naming the
>  device "eth0" in all cases.
>
> None of those are optimal of course (this is an absurdly difficult and
> bikeshed-prone topic, thanks to Linux's "unique" way of treating
> network interfaces completely differently than all other devices), so
> I'm not sure how to do the decision in a qualified way. But let's
> please collect some opinions and see if there's some clear favorite.
>
> My gut feeling is to switch to location-based or kernel names by
> default. It shouldn't matter much on desktops as one usually uses
> dynamic configuration there (NetworkManager), and