Virtual local area network (vlan) interface aggregation method, packet transceiving method, and related device
By aggregating multiple VLAN interfaces into a trunk interface in a Linux system and using a bitmap array to manage VLAN IDs, the problem of low network packet processing performance is solved, and interface utilization and management efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2021-12-30
- Publication Date
- 2026-05-19
AI Technical Summary
In Linux systems, because packets from different VLANs are processed through different sub-interfaces, network packet processing performance and network interface utilization are reduced, and management becomes more complex.
By modifying the physical network interface configuration information, multiple VLAN interfaces are aggregated into a single trunk interface. The first array carries the address information of the trunk interface, and a bitmap array is added to the trunk interface configuration information to manage the VLAN ID.
It improves the efficiency of message processing and interface management in Linux systems, reduces management and maintenance costs, and decreases hardware resource consumption.
Smart Images

Figure CN116437419B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a method for VLAN interface aggregation in virtual local area networks, a method for sending and receiving messages, and related equipment. Background Technology
[0002] With the rapid development of the Internet of Things, a massive number of devices are connected to the Internet, reaching tens of millions of devices (users) and generating huge network traffic.
[0003] In the traditional Linux packet processing mechanism, packets from different VLANs are processed using different sub-interfaces. When the number of packets and VLANs is huge, this can lead to reduced network packet processing performance and network interface utilization, as well as complex management.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] This disclosure provides a method for VLAN interface aggregation in virtual local area networks, a method for sending and receiving messages, and related equipment, which at least to some extent overcomes the technical problem of low network interface utilization in Linux systems in the prior art.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to one aspect of this disclosure, a method for VLAN interface aggregation in a virtual local area network is provided, comprising:
[0008] Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0009] In one embodiment of this disclosure, the method further includes:
[0010] Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs.
[0011] In one embodiment of this disclosure, the trunk interface configuration information includes public part information and private part information.
[0012] In one embodiment of this disclosure, adding a second array to the trunk interface configuration information specifically includes:
[0013] Add a second array to the private section of the trunk interface configuration information.
[0014] In one embodiment of this disclosure, the second array is a bitmap array.
[0015] According to another aspect of this disclosure, a message receiving method is provided, comprising:
[0016] Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0017] Obtain VLAN information from the received message;
[0018] The first element in the first array is found based on the VLAN information to obtain the trunk interface corresponding to the VLAN information, wherein the VLAN information includes the VLAN ID;
[0019] The message is transmitted to the destination host via the corresponding trunk interface.
[0020] According to another aspect of this disclosure, a message transmission method is provided, comprising:
[0021] Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0022] Obtain the message to be sent and submit the message to be sent to the trunk interface;
[0023] If the destination host of the message to be sent is known, the VLAN information of the destination host is encapsulated into the message to be sent through the trunk interface, and the encapsulated message to be sent is sent through the physical interface.
[0024] If the destination host of the message to be sent is unknown, all VLAN information is encapsulated into the message to be sent through the trunk interface, and the encapsulated message to be sent is sent through the physical interface.
[0025] The VLAN information includes the VLAN ID.
[0026] According to another aspect of this disclosure, a virtual local area network (VLAN) interface aggregation device is provided, comprising:
[0027] The configuration module is used to modify the first array in the physical network interface configuration information so that multiple VLAN interfaces are aggregated into a trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0028] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0029] Processor; and
[0030] A memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-described VLAN interface aggregation method by executing the executable instructions.
[0031] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described virtual local area network (VLAN) interface aggregation method.
[0032] The VLAN interface aggregation method, packet transmission and reception method, and related equipment provided in the embodiments of this disclosure, by modifying the array in the physical network interface configuration information, aggregate multiple VLAN interfaces into a single trunk interface, effectively improving the efficiency of packet processing and interface management in the Linux system, thereby reducing the operational costs of management and maintenance and minimizing the consumption of hardware resources.
[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0035] Figure 1 This diagram illustrates the VLAN interface packet processing mechanism in a Linux system.
[0036] Figure 2This diagram illustrates a system architecture of a VLAN interface aggregation method according to an embodiment of the present disclosure.
[0037] Figure 3 This diagram illustrates a VLAN interface aggregation method according to an embodiment of the present disclosure.
[0038] Figure 4 This diagram illustrates a message processing mechanism based on a trunk interface in an embodiment of the present disclosure.
[0039] Figure 5 This diagram illustrates the VLAN data frame format.
[0040] Figure 6 This diagram illustrates an interface of a message receiving method according to an embodiment of the present disclosure.
[0041] Figure 7 This diagram illustrates an interface of a message sending method according to an embodiment of the present disclosure.
[0042] Figure 8 This diagram illustrates a VLAN interface aggregation device according to an embodiment of the present disclosure; and
[0043] Figure 9 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0044] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0045] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0046] Figure 1 This illustrates the VLAN interface packet processing mechanism in existing Linux systems, such as... Figure 1 As shown, network packets pass through several virtual VLAN interfaces (refer to...). Figure 1The eth0.0, eth0.1, eth0.2...eth0.4094 links are connected to the physical interface (see...). Figure 1 The eth0 port in the network handles sending and receiving. In this scenario, although there are numerous virtual VLAN interfaces, each VLAN interface corresponds to only a single VLAN address, and each VLAN interface is only used when a packet is passing through. This results in most VLAN interfaces being idle at the same time, leading to low network interface utilization. Furthermore, the complex VLAN interface setup also presents the drawback of complex management.
[0047] To solve the above-mentioned technical problems, the solution provided in this disclosure modifies the first array in the physical network interface configuration information so that multiple VLAN interfaces are aggregated into a trunk interface. The first array includes a first element, which is used to carry the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network identifier VLANID.
[0048] To facilitate understanding, the following is an explanation of several terms used in this disclosure:
[0049] VLAN (Virtual Local Area Network) refers to a logical network built upon a switched local area network (LAN), grouping nodes in different physical locations based on the location, role, department, or applications and protocols used by network users. This creates an end-to-end logical network that can span different network segments and networks. A VLAN constitutes a logical subnet, or logical broadcast domain, which can cover multiple network devices and allow network users in different geographical locations to join a single logical subnet.
[0050] The main characteristics of VLANs are as follows:
[0051] (1) Control broadcast storms. A VLAN is a logical broadcast domain. By creating a VLAN, broadcasts are isolated and the broadcast range is narrowed, which can control the generation of broadcast storms.
[0052] (2) It can control user access permissions and logical network segment size, and divide different user groups into different VLANs, thereby improving the overall performance and security of the switched network;
[0053] (3) Increase flexibility. With the help of VLAN technology, different locations, different networks and different users can be combined to form a virtual network environment, which is as convenient, flexible and effective as using a local LAN. Network management is simple and intuitive, which can greatly reduce the burden of network management and maintenance work and reduce network maintenance costs.
[0054] Trunk, or port aggregation, is an encapsulation technology that creates a point-to-point link. Its main function is to connect multiple switches through a single link, thereby expanding the number of configured VLANs. Trunk technology can also be used to expand the number of ports by cascading with upstream switches, achieving near-stack functionality, significantly improving overall network capacity, saving network hardware costs, and thus expanding the entire network.
[0055] Trunk technology can connect multiple VLANs across different switches, extending VLANs throughout the network.
[0056] Figure 2 A schematic diagram of an exemplary system architecture that can be applied to the virtual local area network (VLAN) interface aggregation method or virtual local area network (VLAN) interface aggregation apparatus in embodiments of this disclosure is shown.
[0057] like Figure 2 As shown, the system architecture 200 may include terminal devices 201, 202, and 203, a network 204, and a server 205.
[0058] Network 204 is a medium used to provide a communication link between terminal devices 201, 202, 203 and server 205, and can be a wired network or a wireless network.
[0059] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0060] Terminal devices 201, 202, and 203 can be various electronic devices, including but not limited to smartphones, tablets, laptops, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.
[0061] Optionally, the client applications installed on different terminal devices 201, 202, and 203 may be the same, or clients of the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client may also differ; for example, the application client may be a mobile client, a PC client, etc.
[0062] Server 205 can be a server that provides various services, such as a backend management server that supports the devices operated by users using terminal devices 201, 202, and 203. The backend management server can analyze and process received requests and other data, and then feed the processing results back to the terminal devices.
[0063] Optionally, the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0064] Those skilled in the art will know that Figure 2 The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.
[0065] The following detailed description of this exemplary implementation method is provided in conjunction with the accompanying drawings and embodiments.
[0066] First, this disclosure provides a method for VLAN interface aggregation, which can be executed by any electronic device with computing capabilities.
[0067] Figure 3 This diagram illustrates a flowchart of a VLAN interface aggregation method in an embodiment of the present disclosure, as follows: Figure 3 As shown, the VLAN interface aggregation method provided in this embodiment includes the following steps:
[0068] S302, Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a trunk interface, wherein the first array includes a first element, the first element is used to carry the address information of the trunk interface, and the number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0069] In one embodiment of this disclosure, the address information of both the VLAN interface and the trunk interface is recorded in a first array, and the number of each element in the array corresponds one-to-one with the VLAN ID.
[0070] Specifically, the first array mentioned above can be a private array of physical network interfaces.
[0071] Optionally, different elements in the first array can record the address information of the same trunk interface, that is, the address information of the trunk interface and the elements in the first array become a one-to-many relationship, but the address information of different VLAN interfaces and the different elements in the first array still have a one-to-one correspondence.
[0072] Those skilled in the art will understand that, Figure 4 As shown, after VLAN interface aggregation is completed using the above method, when receiving packets, the 8021q module obtains VLAN information from the packet, finds a specific element in the array based on the VLAN information, and then locates the corresponding trunk interface. The packet can then be delivered to the application through the corresponding trunk interface. The VLAN information includes the VLAN ID.
[0073] It should be noted that the 8021q module is a Linux kernel module that implements single-layer and multi-layer VLAN sub-interfaces, supporting VLAN protocol standards including IEEE 802.1q and IEEE 802.1ad. This module is responsible for handling the addition and removal of VLAN information when sending and receiving packets.
[0074] In one embodiment of this disclosure, the trunk interface obtained through VLAN interface aggregation can perform flooding processing on packets from unknown hosts. This disclosure adds a VLAN ID to each neighbor entry in the network device, changing the mapping from port to Media Access Control (MAC) address to a mapping from port to MAC address / VLAN ID. Therefore, when sending a packet, if the trunk interface is the user-selected interface and the destination VLAN is empty, then a copy of the packet is sent to all VLANs managed by that trunk interface.
[0075] In one embodiment of this disclosure, multiple VLAN interfaces in a Linux system are aggregated into a trunk interface, i.e., a single trunk sub-interface. After aggregation, the trunk sub-interface can handle different VLAN packets that were not previously aggregated. Through a series of modifications to the 8021q module in the kernel, different VLAN IDs are stored internally within the trunk interface in a new way. By identifying the VLAN tag before searching for the trunk interface when sending and receiving network packets, the goal of handling multiple VLANs is achieved.
[0076] Those skilled in the art will understand that the VLAN information referred to in this disclosure specifically refers to the Virtual Local Area Network (VLAN) tag.
[0077] Specifically, the basic idea of VLAN interface aggregation is to use a dedicated protocol to encapsulate or add a VLAN tag so that the receiving device can distinguish the VLAN to which the data belongs. When a data frame enters the switch, the corresponding VLAN tag is removed. When a data frame with a VLAN tag is forwarded to another switch, the corresponding VLAN is found, and when the data frame leaves the switch, the VLAN tag is added.
[0078] It should be noted that, as Figure 5 As shown, the VLAN Tag consists of 4 bytes: a 2-byte Tag Protocol Identifier (TPID) indicating the data frame type, which can be set to 0x8100 to represent an IEEE 802.1Q VLAN data frame; and a 2-byte priority bit (PRI) indicating the data frame type, a 1-bit Canonical Format Indicator (CFI) indicating whether the MAC address is encapsulated in a standard format, and a 12-bit VLAN Identifier (VID) indicating the VLAN number to which the data frame belongs, corresponding to the element number of the first array in this disclosure.
[0079] Specifically, inserting a VLAN tag into a packet inevitably changes the entire packet format. Devices receiving this packet on the network must support VLAN tags to parse the entire packet; otherwise, it will be discarded. Existing methods for identifying packets carrying VLAN tags rely on network protocol stack support. However, these methods require configuring protocol stack parameters, which is complex and consumes significant CPU resources. Furthermore, packets sent by existing protocol stacks all carry the same VLAN tag across the IP address range corresponding to the port.
[0080] In one embodiment of this disclosure, a second array can be added to the trunk interface configuration information. The array includes a second element, and different second elements correspond to different VLAN IDs.
[0081] Optionally, the second array can be a bitmap array.
[0082] Those skilled in the art will understand that trunk interface configuration information is part of physical network interface configuration information, and a portion of the trunk interface configuration information is private to the trunk interface.
[0083] Specifically, in this embodiment of the disclosure, a bitmap array is added to the private part of the configuration information of the trunk interface to manage the configuration information of multiple VLAN IDs. This configuration information is specified by the user through software tools.
[0084] Specifically, an array of length 512 octets can be defined, containing 4096 bits, with each bit from index 0 to 4095 identifying a VLAN ID. If the user configures the trunk port to manage VLAN IDs in the range m to n, then the bits in the range m to n in the bitmap array will be 1. The bitmap array can significantly reduce storage space; a regular array uses one octet to identify each VLAN ID, occupying 8 times the space of a bitmap array.
[0085] Based on the same inventive concept, this disclosure also provides a message receiving method, as described in the following embodiments. Since the principle by which this method solves the problem is similar to that of the above-described method embodiments, the implementation of this method embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.
[0086] Figure 6 This diagram illustrates a message receiving method according to an embodiment of the present disclosure, such as... Figure 6 As shown, the method includes:
[0087] S602, Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0088] S604, retrieves VLAN information from received packets;
[0089] S606 finds the corresponding first element in the first array based on the VLAN information, thereby obtaining the trunk interface corresponding to the VLAN information, where the VLAN information includes the VLAN ID;
[0090] S608 transmits the message to the destination host via the corresponding trunk interface.
[0091] Optionally, the method in this disclosure embodiment further includes:
[0092] Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs.
[0093] Optionally, the trunk interface configuration information includes public and private information.
[0094] Optionally, a second array can be added to the trunk interface configuration information, specifically including:
[0095] Add a second array to the private section of the trunk interface configuration information.
[0096] Optionally, the second array is a bitmap array.
[0097] To facilitate understanding, the above message receiving method will be illustrated with examples through the following steps (1) to (6).
[0098] (1) The network interface card (NIC) receives a remote network packet and notifies the NIC driver.
[0099] (2) The network card driver performs preliminary processing on the packets, sets up the physical interface for receiving packets, and submits them to the kernel protocol stack.
[0100] (3) The kernel protocol stack discovers that the Layer 2 protocol is VLAN and calls the 8021q module to process the packet.
[0101] (4) The 8021q module strips the VLAN tag from the packet and matches and finds the corresponding trunk interface under the physical interface.
[0102] (5) The device that receives the redirected packets is the trunk interface.
[0103] (6) The message is delivered to the upper layer protocol and finally to the application.
[0104] Based on the same inventive concept, this disclosure also provides a message sending method, as described in the following embodiments. Since the principle by which this method solves the problem is similar to that of the above-described method embodiments, the implementation of this method embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.
[0105] Figure 7 This diagram illustrates a message transmission method according to an embodiment of the present disclosure, such as... Figure 7 As shown, the method includes:
[0106] S702, modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0107] S704: Obtain the message to be sent and submit the message to be sent to the trunk interface;
[0108] S706: If the destination host of the message to be sent is known, the VLAN information of the destination host is encapsulated into the message to be sent through the trunk interface, and the encapsulated message is sent through the physical interface; if the destination host of the message to be sent is unknown, all VLAN information is encapsulated into the message to be sent through the trunk interface, and the encapsulated message is sent through the physical interface; the VLAN information includes the VLAN ID.
[0109] It should be noted that the trunk interface obtained through VLAN interface aggregation can perform flooding of packets from unknown hosts. This disclosure adds a VLAN ID to each neighbor entry in the network device, changing the mapping from port to Media Access Control (MAC) address to port to MAC address / VLAN ID mapping. Therefore, when sending a packet, if the trunk interface is the user-selected interface and the destination VLAN is empty, then the packet is copied and sent to all VLANs managed by that trunk interface.
[0110] Optionally, the method in this disclosure embodiment further includes:
[0111] Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs.
[0112] Optionally, the trunk interface configuration information includes public and private information.
[0113] Optionally, a second array can be added to the trunk interface configuration information, specifically including:
[0114] Add a second array to the private section of the trunk interface configuration information.
[0115] Optionally, the second array is a bitmap array.
[0116] To facilitate understanding, the above message sending method will be illustrated with examples through the following steps (1) to (6).
[0117] (1) The application sends a message to the remote end.
[0118] (2) The kernel protocol stack encapsulates messages into message queues.
[0119] (3) After the network packet passes through the routing decision, the packet sending interface is set as the trunk interface, and packets are delivered to this interface one by one.
[0120] (4) If the destination host is known, the trunk interface encapsulates the packet with the VLAN tag of the destination host. Otherwise, a copy of the packet is made for all VLANs managed by the trunk interface and the corresponding tag is added.
[0121] (5) The sending device of the message is redirected to the physical interface and handed over to the interface for processing.
[0122] (6) The physical interface delivers the packet to the network interface card (NIC) driver for processing. The NIC completes the packet transmission.
[0123] Based on the same inventive concept, this disclosure also provides a Virtual Local Area Network (VLAN) interface aggregation device, as described in the following embodiments. Since the principle by which this device embodiment solves the problem is similar to that of the above-described method embodiments, the implementation of this device embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.
[0124] Figure 8 This diagram illustrates a VLAN interface aggregation device according to an embodiment of the present disclosure, such as... Figure 8 As shown, the device 800 includes:
[0125] Configuration module 801 is used to modify the first array in the physical network interface configuration information so that multiple VLAN interfaces are aggregated into a trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID.
[0126] Optionally, the configuration module 801 described above is also used for:
[0127] Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs.
[0128] Optionally, in the configuration module 801 described above, the trunk interface configuration information includes public part information and private part information.
[0129] Specifically, the configuration module 801 can add a second array to the private part of the trunk interface configuration information.
[0130] Optionally, in the above configuration module 801, the second array is a bitmap array.
[0131] It should be noted that the VLAN interface aggregation device provided in the above embodiments is only illustrated by the division of the above functional modules when performing VLAN interface aggregation. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the VLAN interface aggregation device and the VLAN interface aggregation method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0132] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”
[0133] The following reference Figure 9 To describe an electronic device 900 according to such an embodiment of the present disclosure. Figure 9 The electronic device 900 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0134] like Figure 9 As shown, the electronic device 900 is manifested in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0135] The storage unit stores program code that can be executed by the processing unit 910, causing the processing unit 910 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 910 can perform the following steps of the above method embodiment: modifying a first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface, wherein the first array includes a first element, the first element being used to carry the address information of the trunk interface, and the number of the first element corresponding to the Virtual Local Area Network (VLAN) ID.
[0136] Optionally, the above-mentioned processing unit 801 may also perform:
[0137] Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs.
[0138] Optionally, in the steps performed by the processing unit 801 above, the trunk interface configuration information includes public part information and private part information.
[0139] Specifically, the processing unit 801 can add a second array to the private part of the trunk interface configuration information.
[0140] Optionally, in the steps performed by the processing unit 801 described above, the second array is a bitmap array.
[0141] Storage unit 920 may include readable media in the form of volatile storage units, such as random access memory (RAM) 9201 and / or cache memory 9202, and may further include read-only memory (ROM) 9203.
[0142] Storage unit 920 may also include a program / utility 9204 having a set (at least one) program module 9205, such program module 9205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0143] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0144] Electronic device 900 can also communicate with one or more external devices 940 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 950. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 960. As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0145] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0146] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0147] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0148] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0149] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0150] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0151] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0152] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0153] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0154] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. A method for VLAN interface aggregation in a Virtual Local Area Network (VLAN), characterized in that, include: Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID. The multiple VLAN interfaces are multiple VLAN interfaces of the Linux system; The method further includes: Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs. The second array is a bitmap array.
2. The VLAN interface aggregation method according to claim 1, characterized in that, The trunk interface configuration information includes public and private information.
3. The VLAN interface aggregation method according to claim 2, characterized in that, The addition of a second array to the trunk interface configuration information specifically includes: Add a second array to the private section of the trunk interface configuration information.
4. A message receiving method, characterized in that, include: Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID. Obtain VLAN information from the received message; The first element in the first array is found based on the VLAN information, thereby obtaining the trunk interface corresponding to the VLAN information, wherein the VLAN information includes the VLAN ID; The message is transmitted to the destination host via the corresponding trunk interface; The multiple VLAN interfaces are multiple VLAN interfaces of the Linux system; The method further includes: Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs. The second array is a bitmap array.
5. A message sending method, characterized in that, include: Modify the first array in the physical network interface configuration information to aggregate multiple VLAN interfaces into a single trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID. Obtain the message to be sent and submit the message to be sent to the trunk interface; If the destination host of the message to be sent is known, the VLAN information of the destination host is encapsulated into the message to be sent through the trunk interface, and the encapsulated message to be sent is sent through the physical interface. If the destination host of the message to be sent is unknown, all VLAN information is encapsulated into the message to be sent through the trunk interface, and the encapsulated message to be sent is sent through the physical interface. The VLAN information includes the VLAN ID; The multiple VLAN interfaces are multiple VLAN interfaces of the Linux system; The method further includes: Add a second array to the trunk interface configuration information. The second array includes a second element, and different second elements correspond to different VLAN IDs. The second array is a bitmap array.
6. A VLAN interface aggregation device, characterized in that, include: The configuration module is used to modify the first array in the physical network interface configuration information so that multiple VLAN interfaces are aggregated into a trunk interface. The first array includes a first element, which carries the address information of the trunk interface. The number of the first element corresponds to the Virtual Local Area Network (VLAN) ID. The multiple VLAN interfaces are multiple VLAN interfaces of the Linux system; The configuration module is also used to: add a second array to the trunk interface configuration information, the second array including a second element, different second elements corresponding to different VLAN IDs; the second array is a bitmap array.
7. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the VLAN interface aggregation method according to any one of claims 1 to 3 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the VLAN interface aggregation method of any one of claims 1 to 3.