| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| playground:arinc9:network.interfaces [2021/09/22 07:24] – Explaining network, network interfaces & types of network interfaces arinc9 | playground:arinc9:network.interfaces [2021/09/22 08:31] – [Certain Types of Network Interfaces] arinc9 |
|---|
| ====== Network & Network Interfaces ====== | ====== Network & Network Interfaces ====== |
| ===== Definition of a Network ===== | ===== Definition of a Network ===== |
| A network represents a group of computers communicating with each other. A computer can be any device with the ability of processing information. | A network represents a group of computers communicating with each other. A computer can be any device with the ability of processing information.\\ |
| | There doesn't necessarily have to be more than one physical computer to form a network. There could be a set of virtualised computers communicating with each other under a single physical computer. |
| |
| On the software, computers communicate with each other using network interfaces. | On software, computers communicate with each other using network interfaces. |
| |
| |
| A network interface is the point of interconnection, implemented on the software, between computers. The term "interface", when used in computer networking, is short for the term "network interface". | A network interface is the point of interconnection, implemented on the software, between computers. The term "interface", when used in computer networking, is short for the term "network interface". |
| |
| There doesn't necessarily have to be more than one physical computer to form a network. There could be a set of virtualised computers communicating with each other under a single physical computer. | Data transmission between interfaces can be made over Ethernet [[wp>IEEE 802.3]] or WLAN [[wp>IEEE 802.11]] which are the most common communication protocols. |
| |
| Data transmission between interfaces can be made over Ethernet [[wp>IEEE 802.3]] or WLAN [[wp>IEEE 802.11]] which are the common communication protocols. | Each entry on the output of ''ip link'' represents a network interface. Network interfaces can be created by making use of physical devices (a switch, a [[wp>Network interface controller|NIC]], a [[wp>Wireless network interface controller|wireless NIC]]) and/or features of the software (vlan, bridging, tunnelling). |
| | <code> |
| Each entry on the output of ''ip link'' represents a network interface. Network interfaces can be created by making use of physical devices (a NIC, a wireless NIC) and/or features of the software (vlan, bridging, tunnelling). | # ip link |
| | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 |
| Network interfaces can be distinguished, by software, by what the interface uses (physical devices & software features) to transmit data. E.g.: Network interface (uses a [[wp>Network interface controller|NIC]]), wireless interface (uses a [[wp>Wireless network interface controller|WNIC]]), loopback interface, bridge interface (uses bridging feature of software), 802.1q vlan interface (uses vlan feature of software), veth interface (uses virtual ethernet feature of software), tunnel interface (uses tunnelling feature of software), dummy interface, etc. | link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
| | 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP mode DEFAULT group default qlen 1024 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 6: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 7: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 11: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 17: br0.5@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 18: br0.8@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 74155: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 74156: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff permaddr 60:38:e0:c9:0c:11 |
| | 74157: wlan1-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 24015: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 3 |
| | link/ppp |
| | 24016: wg: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 |
| | link/none |
| | </code> |
| |
| |
| ==== Certain Types of Network Interfaces ==== | ==== Certain Types of Network Interfaces ==== |
| * <color maroon>**//Ethernet Interfaces//**</color>: ''eth0'', ''eth1'', etc.\\ these interfaces are created using ethernet devices (switches, NICs, virtual NICs, etc.). As soon as the [[https://www.kernel.org/doc/html/latest/networking/device_drivers/ethernet/index.html| Ethernet Device driver]] is loaded on the kernel, the driver creates the corresponding network interface. | Network interfaces can be distinguished, by software, by what the interface uses (physical devices & software features) to transmit data.\\ |
| | For example: Ethernet interface (uses a NIC), wireless interface (uses a wireless NIC), loopback interface, bridge interface (uses bridging feature of software), 802.1q vlan interface (uses vlan feature of software), veth interface (uses virtual ethernet feature of software), tunnel interface (uses tunnelling feature of software), dummy interface, etc. |
| |
| * <color maroon>**//Wireless Interfaces//**</color>: ''wlan0'', ''wlan0_1'', ''wlan1'', ''ath3'', ''ath_monitor'', etc. | * <color maroon>**//Ethernet Interfaces//**</color>: ''eth0'', ''eth1'', etc.\\ are created using ethernet devices (switches, NICs, virtual NICs, etc.). As soon as the [[https://www.kernel.org/doc/html/latest/networking/device_drivers/ethernet/index.html| Ethernet Device driver]] is loaded on the kernel, the driver creates the corresponding network interface. |
| |
| * <color maroon>**//VLAN Interfaces//**</color>: ''eth4.0'', ''eth4.1'', ''eth4.3'', ''vlan0'', etc.\\ are created to virtually create multiple network segments to separate [[wp>Broadcast domain]]s. The drivers all participating network cards must support [[wp>IEEE 802.1Q]] and be configured accordingly. This standard allows for up to 4096 VLANs (12Bits). | * <color maroon>**//Wireless Interfaces//**</color>: ''wlan0'', ''wlan0-1'', ''wlan1'', ''ath3'', ''ath_monitor'', etc. |
| | |
| | * <color maroon>**//VLAN Interfaces//**</color>: ''eth0.1'', ''eth0.2'', ''br0.1'', ''vlan0'', etc.\\ are created to virtually create multiple network segments to separate [[wp>Broadcast domain]]s. The drivers all participating network cards must support [[wp>IEEE 802.1Q]] and be configured accordingly. This standard allows for up to 4096 VLANs (12Bits). |
| |
| * <color maroon>**//Stacked VLAN Interfaces//**</color>: [[wp>IEEE 802.1ad]]-support was mainlined in [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8ad227ff89a7e6f05d07cd0acfd95ed3a24450ca|2013-04-19: net: vlan: add 802.1ad support]] Configuration is done using ''ip link'':<code bash> | * <color maroon>**//Stacked VLAN Interfaces//**</color>: [[wp>IEEE 802.1ad]]-support was mainlined in [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8ad227ff89a7e6f05d07cd0acfd95ed3a24450ca|2013-04-19: net: vlan: add 802.1ad support]] Configuration is done using ''ip link'':<code bash> |
| Two network interfaces can also be bonded together (please see [[wp>Link aggregation]] and [[wp>Channel bonding]] and [[http://wiki.ubuntuusers.de/Netzwerkkarten_b%C3%BCndeln|Ubuntu Wiki]]), [[http://lxr.free-electrons.com/source/Documentation/networking/bonding.txt|Documentation/networking/bonding.txt]] | Two network interfaces can also be bonded together (please see [[wp>Link aggregation]] and [[wp>Channel bonding]] and [[http://wiki.ubuntuusers.de/Netzwerkkarten_b%C3%BCndeln|Ubuntu Wiki]]), [[http://lxr.free-electrons.com/source/Documentation/networking/bonding.txt|Documentation/networking/bonding.txt]] |
| |
| Interfaces can be named anything. It's just more convenient........... VLAN example: | ==== Subinterfaces & Naming the Network Interfaces ==== |
| | The term "subinterface" means that an interface is based off of another interface. This term is mostly used for VLAN interfaces.\\ |
| | For example, if the ''br0.5'' VLAN interface is based off of ''br0'', it's a subinterface of ''br0''. |
| | |
| | <code> |
| | 17: br0.5@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | 18: br0.8@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 |
| | link/ether a1:b2:c3:d4:e5:f6 brd ff:ff:ff:ff:ff:ff |
| | </code> |
| |
| | Interfaces can be named anything. However, it's more convenient to name for example:\\ |
| | * A bridge interface with ''br'' to figure out it's a bridge interface\\ |
| | * A VLAN interface with ''br0'' and ''.5'' to figure out which interface it's based off of and what VLAN ID it uses\\ |
| | by just looking at the name of the interface. |
| ===== OpenWrt Configuration ===== | ===== OpenWrt Configuration ===== |
| | {{:meta:icons:tango:dialog-information.png?nolink}} |[[docs:techref:uci]] is a small C utility designed to centralize configuration in OpenWrt.\\ ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'' is the network configuration file.\\ ''[[docs:guide-user:network:wifi:basic|/etc/config/wireless]]'' is the wireless configuration file.\\ <color maroon>**UCI creates an abstraction layer for configuring network interfaces**</color>:\\ In ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'' you allocate a name like //lan// or //internet_wire// or //whatever// to each ''ifname''-variable for every device and then this name is consistently used through the entire UCI configuration. But this can only be used in conjunction with UCI!| | | {{:meta:icons:tango:dialog-information.png?nolink}} |[[docs:techref:uci]] is a small C utility designed to centralize configuration in OpenWrt.\\ ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'' is the network configuration file.\\ ''[[docs:guide-user:network:wifi:basic|/etc/config/wireless]]'' is the wireless configuration file.\\ <color maroon>**UCI creates an abstraction layer for configuring network interfaces**</color>:\\ In ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'' you allocate a name like //lan// or //internet_wire// or //whatever// to each ''ifname''-variable for every device and then this name is consistently used through the entire UCI configuration. But this can only be used in conjunction with UCI!| |