Understanding Linux Network Device Drivers (Part 1)

1.1 What is a Network Device

1. A network device is primarily responsible for sending and receiving network data packets. It transmits data packets received from upper-layer protocols using a specific media access control method and passes the received data packets to upper-layer protocols. The network interface is the third category of standard devices in Linux.

2. Network devices are similar to block devices in that they register themselves in specific data structures within the kernel.

3. When network data exchange occurs, the method registered by the network device driver will be called by the kernel.

4. Network devices do not have a device entry under /dev; they use reserved internal device names. In Linux, everything is a file, which is an abstraction of a standardized interface. Due to historical reasons, the socket interface standard for network programming predates the emergence of the Linux kernel, forcing the Linux kernel to adopt the socket concept. As a result, among the three types of interface drivers, only network devices do not have device files.

1.2 Characteristics of Network Devices

1. Network devices asynchronously receive incoming data packets, which is different from other devices.

2. Network devices actively “request” to push the data packets obtained from hardware into the kernel, while other devices, such as block devices, are “requested” to send buffers to the kernel.

3. Network devices must perform a large number of management tasks simultaneously.

Setting addresses

Modifying transmission parameters

Maintaining traffic and flow control Error statistics and reporting

4. The network subsystem is completely protocol-independent, and every interaction between the network driver and the rest of the kernel processes a network data packet.

Understanding Linux Network Device Drivers (Part 1)

Leave a Comment