An in-depth understanding of Linux Network Technology-Virtual Device initialization summary and a deep understanding of linux

Source: Internet
Author: User

An in-depth understanding of Linux Network Technology-Virtual Device initialization summary and a deep understanding of linux
Overview a virtual device is an abstraction built on one or more real devices. There are many to many mappings between virtual devices and real devices, but not all combinations can be defined or supported by the kernel.

The following lists some common Virtual Devices:

Bonding // binding: Virtual Devices are bound to physical devices, making them equivalent to a single device 802.1Q // IEEE Standard. The virtual representative Aliasing interfaces // alias interface is used to establish a VLANBridging // bridge, it is used to make an Ethernet real interface have multiple virtual interfaces: True equalizer (TEQL) // common balancer, which is a queue rule for traffic control Tunnel interfaces // Tunnel Interface

Initialization of interaction between virtual devices and kernel network protocol stacks: Like a real device, a net_device structure ( Note: You do not need to allocate net_device to an alias device ). Generally, the net_device function pointer of a virtual device directs to the package function, which contains the function pointer used by the relevant real device. Configuration: Virtual devices generally have special user space configuration tools for configuration and cannot use ifconfig.
External interface: the virtual device will create a file or directory in the/proc file system (the alias device is still a special case and it has not created a file or directory in/proc ), the specific content and complexity of the Creation depend on the design of the virtual device.
Transmission: when the relationship between a virtual device and a real device is not one-to-one, the function used for transmission needs to select the corresponding real device and other tasks. Because Qos is applied according to the needs of each device, traffic configuration is required.
Receiving: Virtual Devices are software objects and do not need to interact with system resources. The received traffic is indirectly obtained. Different Virtual Devices have different processing methods for the received traffic. For example, 802.1q may only allow packets with the correct id to pass, while the bridge will allow all packets to pass.
External notifications: similar to real devices, virtual devices also pay attention to special event notifications from other system components. A virtual device is based on the logic of a real device. A real device cannot send notifications to a virtual device. Therefore, a notification must be sent to the virtual device separately.
Notification that the virtual device cannot perceive hardware triggering

Other features of virtual devices the advantage of Virtual Devices will use register_netdevice and unregister_netdevice to register/remove, rather than their package function, to get more lock holding time.
Real devices can be removed (destroyed) only when they are downloaded. However, virtual devices can be removed through commands.
Most real devices use dev-> init, dev-> uninit and dev-> destructor. To register and remove devices. However, most virtual devices use relatively simple logic. They use dev-> init and dev-> uninit for additional work, so that dev-> destructor does not need to display the call. For real devices, net_device Initialization is divided into the driver's probe process and general setup routine. But the virtual device does not have probe routines.
Kernel notification table chain: Because Virtual Devices are built on real devices, changes in real devices will affect Virtual Devices.
















Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.