Sample Header Ad - 728x90

Is it possible that multiple network interface (net_device) tied to a single physical adapter

2 votes
1 answer
62 views
I am new to the Linux kernel. Recently, I read some articles about Linux "network interface", understanding that it is a logical abstraction layer of the underlying physical adapter (NIC), which defines a set of functions (to be implemented by the driver, e.g. hard_start_xmit) to be used by the Linux kernel to talk to the NIC. In Linux, it is represented by the structure net_device. For each "network interface", there are also some other fields, such as the MAC address of the tied physical adapter, IP address/default gateway/DNS, etc. **Q1:** Is it possible that multiple "network interface" (net_device) are tied to a single physical adapter and all are in the UP state? E.g. different IP addresses and connected to different subnets? **Q2:** If Q1's answer is yes, when the network stack sends an outgoing packet to the physical adapter, how does it decide which "network interface" to use (e.g. call hard_start_xmit)? Is it based on the route table with the target IP address? **Q3:** When an incoming frame arrives at the physical adapter driver, as multiple network interfaces are tied to it, does the driver need to identify which "network interface" should handle the frame (i.e. put data into its queue/buffer)? If yes, how? I am trying to understand more details of the data send/receive process in the Linux kernel for the multiple NIC or multiple "network interface" cases.
Asked by JIE JEVONS DU (21 rep)
Apr 24, 2025, 06:04 AM
Last activity: Apr 24, 2025, 01:03 PM