8

Cut to the chase: So which is it? Is an IP assigned to an interface, link, or device? What distinguishes these three things? Caveat: This is a critical review of the iproute2 utilities or documentation thereof, to gain a better understanding of them (mainly, ip).

It is often the case the networking books refer to these terms

  • link
  • device
  • interface

The route2 utility ip documentation defines link as follows:

link --- physical or logical network device.

Elsewhere...

A link refers a network device.

dev NAME --- name of the device to which we add the address

Commands like this assign ip addresses to "devices":

ip addr add 10.0.0.1/24 brd + dev eth0

Commands like this start "interfaces"

ip link set eth0 up

Compare the aforementioned with the following excerpts from reputable sources:

The boundary between the host and the physical link is called an interface.

Computer Networking: A Top-Down Approach by Kurose & Ross 7th Edition, p. 363.

Also

The boundary between the router and any one of its links is also called an interface.

Computer Networking: A Top-Down Approach by Kurose & Ross 7th Edition, p. 363.

Later,

[...] an IP address is technically associated with an interface, rather than with the host or router containing that interface.

My thinking

This is ambiguous. Is it fair to say that a device and interface are the same? Or does a device implement an interface? If so, then it would mean that a word like physical interface might refer directly to the device, and truly mean the same thing.

I would understand a link as the physical wire or simulated wire (wireless protocol like 802.11). By the way, I didn't even mention the term "link layer".

3 Answers 3

7

IP addresses are assigned to interfaces (physical or virtual). Unnumbered, point-to-point interfaces may work without an IP address of their own though (e.g. a simple, serial interface). Also, only layer-3 interfaces can use IP addresses.

A layer-3 device like a host or a router may have multiple interfaces, mandating multiple IP addresses. Lower-layer devices like switches or repeaters don't use IP addresses for their basic function. Note that "device" can also be used for just about any technical component. It may also very well refer to a device in the sense of Linux's hardware management.

A link is an active connection between two physical-layer interfaces. On bus networks like obsolete 10BASE5, more than two interfaces can be "linked".

In special contexts the terms may be used with other meanings but above is the essence.

3
  • Following your answer while playing devil's advocate (I appreciate your time, "danke"), eth0 in my question is referred to in iproute2 docs as both an "interface" and a "device", and to confuse matters even more, it defines "link" as a network "device". eth0 is then both a layer-3 device and an interface with an IP address (and, if we follow iproute2 definitions--a link too!). I am not sure I can accept your answer, but I'll upvote it. It does not fully disambiguate the terms or address the confusion. e.g. "dev NAME - name of the device to which we add the address" conflicts with this. Commented Feb 20, 2022 at 14:13
  • 1
    You'd have to have that argument with the authors of those tools. Using "device" for an interface isn't entirely wrong but it's ambiguous and a cause of confusion. It may stem from the Linux concept of device which an Ethernet interface is a type of. Using "link" for an interface is almost always wrong. However, giving an interface an administrative "link up" = activating its linking capability would be correct.
    – Zac67
    Commented Feb 20, 2022 at 14:31
  • 1
    That's fair. I realize that my question could be interpreted as a critique of iproute2 and cause a heated debate, so I added that to the question content. Given that iproute2 is arguably the de facto standard in Linux, I figured the authors could take the heat. We're on the same wavelength with regards to "link up". Commented Feb 20, 2022 at 15:22
7

Unlike other mature engineering disciplines, networking doesn't have well-defined terms. Many are borrowed from electrical engineering or computer science, but used slightly differently. A large number are coined by manufacturer's marketing departments. Those terms mean whatever the marketers want it to mean. So you'll never be able to have definitions that everyone agrees on.

To add to @Zac67 's answer, the term link can have many definitions, depending on the context. A link can be a physical connection -- a cable between two devices, or it can be a logical or abstract idea: as in a link between the database and the telemetry module.

The meaning of device also depends on the context. From the perspective of the computer operating system, the peripherals (network interfaces, storage, input/output) are devices. From a larger perspective, devices are systems that are connected to the network.

A software engineer might use device differently than a network engineer. You just have to be aware of the context.

4
  • 1
    Playing devil's advocate again in response to "you'll never be able to have definitions that everyone agrees on" -> Concepts and things are things in the real world that software (like in the "iproute2 Utility Suite") implements--computers are unambiguous in their operation, so somewhere there must be an unambiguous core. A common solution to making language unambiguous is to extend the nouns with qualifiers (affixes): network device, link medium, physical device, virtual device. I suppose I am seeking that unambiguous core with iproute2 (Unless you disagree with my assumptions, of course).+1 Commented Feb 20, 2022 at 15:29
  • 1
    The cynic in me says, "Yeah, good luck with that." Unlike other mature disciplines, there are no widespread degree programs, professional societies, etc., that create a common language. Terms are invented by manufacturers as they wish. Networking is not yet a recognized discipline in its own right.
    – Ron Trunk
    Commented Feb 20, 2022 at 16:00
  • :) I await the possible grief/response you're going to get by a networking professor somewhere. Thanks for your respectable contribution to this! Maybe this question will serve to expose some of the deficiencies of a "manufacturer-take-the-reins" approach (or of the iproute2 docs). I thought the IEEE might have already formalized / standardized names. Commented Feb 20, 2022 at 16:17
  • If I find that networking professor, I'm going to grab him by the lapels, get in his face and yell, "For the love of all that's holy, please stop teaching !@%$@! classful addressing and the OSI model!" You're just confusing your students!
    – Ron Trunk
    Commented Feb 20, 2022 at 17:21
6

Don't get too deep in the trap of iproute2's documentation. Link, interface, and device all mean different things to different people in different contexts. In the case of ip link, it's referring to the kernel defined network device ("netdev") -- which may be physical like eth0, or logical like dummy0 or eth0.10 / vlan10@eth0. In that context, link, interface, and device are all the same thing; they simply chose the word link for the command. (it had to be something, and using dev creates a keyword usage conflict... ip dev bond0 set dev eth0 master ;-) )

For the ip addr command, they stuck with dev for historical reasons. (that's what it's been called for eons. Go look at docs for SunOS from the 80's.) And you can have multiple addresses on a single "netdev" further muddying the link/interface/device waters -- linux did away with the eth0:1 eth0:2 alias construct long ago.

As a network engineer, those three words do mean different things to me.

  • Link: the actual circuit, path, and/or cable between ports.
  • Device: either the entire system, or the blob within it that creates the electrical (optical) signal.
  • Interface: the logical middleground between the two, often in the context of the OS (eth0, f0/0, etc.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .