QinQ message processing method and device, storage medium and electronic device
By determining the matching relationship between the two-layer VLAN tag and the QinQ interface in QinQ network message processing, and directly processing the packets through the QinQ interface, the low efficiency and high resource consumption problems caused by the QinQ interface relying on the VLAN interface in the prior art are solved, and more efficient message processing and lower resource consumption are achieved.
Patent Information
- Application Number
- CN202111183401.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-10-11
AI Technical Summary
During the processing of existing QinQ network packets, the QinQ interface relies on the VLAN interface for interface matching, resulting in interdependence between network interfaces, low utilization rate, low processing efficiency and high hardware resource consumption.
By determining the matching relationship between the two-layer VLAN tag information and the QinQ interface information and configuring the matching relationship into the network physical interface, QinQ packets can be processed directly through the QinQ interface, avoiding layer by layer identification and stripping of the two-layer VLAN tags.
Removing the dependency between the QinQ interface and the VLAN interface has improved the efficiency of QinQ packet processing, reduced hardware resource consumption, and simplified system management and maintenance.
Smart Images

Figure CN115967591B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a QinQ message processing method, a QinQ message processing device, a computer-readable medium, and an electronic device. Background Art
[0002] With the rapid development of the Internet of Things, a large number of devices are connected to the Internet, and the number of devices (i.e. users) has reached tens of millions, resulting in huge network traffic. The QinQ (802.1Q-in-802.1Q) protocol is a Layer 2 tunneling protocol based on the IEEE 802.1Q technology. QinQ is a technology that expands the VLAN (Virtual local Area Network) space. It achieves the function of expanding the VLAN space by adding another layer of 802.1Q tags on the basis of 802.1Q tagged messages, so that private network VLANs can be transparently transmitted to the public network. The QinQ termination is mainly used to realize the VLAN termination of messages carrying two or more layers of VLAN tags.
[0003] In the existing QinQ network message processing process, the network card driver determines the network physical interface for receiving the message, and the network physical interface for receiving the message matches the corresponding VLAN interface according to the outer VLAN tag information carried by the message, and then strips off the outer VLAN tag of the message; then the VLAN interface matches the corresponding QinQ interface according to the inner VLAN tag information carried by the message, and strips off the inner VLAN tag of the message; finally, the message is forwarded at Layer 3 or handed over to other services for processing.
[0004] In the existing QinQ message processing process, the QinQ interface relies on the VLAN interface for interface matching. The message needs to pass through the VLAN interface before it can find the QinQ interface, that is, it needs to pass through two layers of interfaces to achieve QinQ termination. In this process, there are problems such as mutual dependence between network interfaces, low network interface utilization, low message processing efficiency, and high consumption of hardware resources.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the embodiments of the present disclosure is to provide a QinQ message processing method, a QinQ message processing device, a computer-readable medium and an electronic device, thereby solving the problems of low network interface utilization, low message processing efficiency and high consumption of hardware resources in the prior art to a certain extent.
[0007] According to a first aspect of the present disclosure, a QinQ message processing method is provided, including:
[0008] Determine a matching relationship between the double-layer VLAN tag information and the QinQ interface information; the QinQ interface information includes a QinQ interface identifier;
[0009] Configuring the matching relationship in a network physical interface;
[0010] According to the matching relationship, the double-layer VLAN tag information carried by the QinQ message is matched with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message;
[0011] The QinQ message is processed through the QinQ interface corresponding to the QinQ interface identifier according to the service information.
[0012] In an exemplary embodiment of the present disclosure, based on the above solution, determining the matching relationship between the double-layer VLAN tag information and the QinQ interface information includes:
[0013] Add the double-layer VLAN tag information to the QinQ interface information to form the QinQ interface information containing the double-layer tag;
[0014] According to the QinQ interface information containing the double-layer VLAN tag, a matching relationship between the double-layer VLAN tag information and the QinQ interface information is established.
[0015] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, the step of establishing a matching relationship between the double-layer VLAN tag information and the QinQ interface information according to the QinQ interface information containing the double-layer tag includes:
[0016] According to the double-layer VLAN tag information and the QinQ interface identifier in the QinQ interface information containing the double-layer tag, a corresponding self-balancing binary search tree is established; one node in the self-balancing binary search tree corresponds to one QinQ interface identifier.
[0017] In an exemplary embodiment of the present disclosure, based on the above solution, adding the double-layer VLAN tag information to the QinQ interface information includes:
[0018] The 802.1Q module of the Linux kernel reconfigures the QinQ interface information so that the QinQ interface information contains double-layer VLAN tag information.
[0019] In an exemplary embodiment of the present disclosure, based on the above solution, configuring the matching relationship in the network physical interface includes:
[0020] The storage information of the QinQ interface information is configured in the 802.1Q module of the Linux kernel so that the matching relationship is stored in the network physical interface.
[0021] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, matching the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through the network physical interface according to the matching relationship includes:
[0022] Searching the self-balancing binary search tree stored in the network physical interface for node information identical to the double-layer VLAN tag information carried by the QinQ message;
[0023] According to the found node information, the corresponding QinQ interface identifier is determined.
[0024] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, processing the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information includes:
[0025] Determine service type information, where the service type information includes termination and forwarding;
[0026] Based on the service type information, the QinQ message is terminated or forwarded through a QinQ interface corresponding to the QinQ interface identifier.
[0027] In an exemplary embodiment of the present disclosure, based on the above solution, the method further includes:
[0028] Add single-layer VLAN tag information to VLAN interface data;
[0029] VLAN interface data containing single-layer VLAN tag information is configured in the network physical interface.
[0030] According to a second aspect of the present disclosure, a QinQ message processing device is provided, including:
[0031] A matching relationship building module is used to determine a matching relationship between the double-layer VLAN tag information and the QinQ interface information; the QinQ interface information includes a QinQ interface identifier;
[0032] A matching relationship configuration module, used to configure the matching relationship in the network physical interface;
[0033] An interface matching module, used to match the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through a network physical interface according to the matching relationship, and determine the QinQ interface identifier corresponding to the QinQ message;
[0034] The message processing module is used to process the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information.
[0035] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the QinQ message processing method described in any one of the above is implemented.
[0036] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned QinQ message processing methods by executing the executable instructions.
[0037] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:
[0038] In the QinQ message processing method provided in the disclosed example implementation method, the matching relationship between the double-layer VLAN tag information and the QinQ interface information can be first determined; the matching relationship can be configured in the network physical interface; according to the matching relationship, the double-layer VLAN tag information carried by the QinQ message is matched with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message; according to the service information, the QinQ message is processed through the QinQ interface corresponding to the QinQ interface identifier. On the one hand, the dependency between the QinQ interface and the VLAN interface in the QinQ message processing process is eliminated, so that the QinQ message can be directly processed through the QinQ interface, thereby improving the QinQ message processing efficiency; on the other hand, the layer-by-layer identification and stripping process of the double-layer VLAN tag information is avoided, thereby reducing the consumption of hardware resources. In addition, the creation, management status, MTU (maximum transmission unit), and packet receiving and sending operations of the QinQ interface are completely independent of the VLAN interface, and the MTU of the QinQ interface is independent of the network physical interface, which is convenient for the management and maintenance of the entire system.
[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0041] Figure 1A schematic diagram showing an exemplary scenario architecture of an existing QinQ message processing process;
[0042] Figure 2 A flowchart of a QinQ message processing method according to an embodiment of the present disclosure is schematically shown;
[0043] Figure 3 A flowchart of matching relationship determination according to an embodiment of the present disclosure is schematically shown;
[0044] Figure 4 A schematic diagram of a process of processing a message according to a service information interface according to an embodiment of the present disclosure is shown;
[0045] Figure 5 A schematic diagram schematically shows a QinQ message processing process and an exemplary scenario architecture according to an embodiment of the present disclosure;
[0046] Figure 6 The structure block diagram of a QinQ message processing device according to an embodiment of the present disclosure is schematically shown;
[0047] Figure 7 A block diagram of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0048] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0049] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0050] With the rapid development of the Internet of Things, the number of user terminal devices connected to the Ethernet has increased significantly, reaching tens of millions, and the network traffic is huge. How to efficiently transmit information between huge network architectures has become a technical difficulty.
[0051] A virtual local area network (VLAN) is a group of logical devices and users that are not restricted by physical location and can be organized based on functions, departments, applications, and other factors. A network is logically divided into several small virtual networks, namely VLANs (virtual local area network). VLANs work at the data link layer of the OSI reference model. A VLAN is a switching network. All users in the same VLAN are in the same broadcast domain. Each VLAN is connected through a routing device to achieve communication.
[0052] With QinQ technology, the operator network can provide a VLAN ID for different VLANs from the same user network, saving the operator's VLAN ID and solving the problem of increasingly tight VLAN ID resources in the operator network. Therefore, it has become the mainstream technology in this field. The existing message processing process is explained using QinQ messages as an example.
[0053] like Figure 1 The figure shows a schematic diagram of the existing QinQ message processing scenario. If the user state wants to send a message to the remote end, the following steps need to be performed:
[0054] Each device in user mode determines the message to be sent, and the kernel protocol stack encapsulates the message to be sent into a message data packet to form a message data packet queue.
[0055] After the network message is routed, the packet interface is set to QinQ interface eth0.0.0~eth0.0.4094, and the packets are delivered to a certain QinQ interface one by one. The QinQ interface encapsulates the inner VLAN tag for the packet and directs it to one of the VLAN interfaces eth0.0~eth0.4094.
[0056] The VLAN interface encapsulates the outer VLAN tag for the message data packet and directs it to the network physical interface.
[0057] The network physical interface delivers the sent data packet to the network card driver for processing; the network card driver sets the sending parameters.
[0058] The network interface controller (eg, network card NIC) controls the sending of message data packets according to the set sending parameters.
[0059] In the above existing message processing process, for example, QinQ messages, which have two or more VLAN tags, need to add or strip VLAN tags layer by layer during their sending and receiving process. There are interdependencies between network interfaces, which are mainly reflected in the associated dependencies in management status, MTU (maximum transmission unit), interface coupling, and packet sending and receiving processes.
[0060] Specifically, the dependencies include: Management status: The management status of the VLAN interface will be synchronized to the QinQ interface. MTU: The MTU value of the QinQ interface cannot be greater than the minimum value of the VLAN interface and the network physical interface. Interface coupling: When a VLAN interface is deleted, the QinQ interface it manages will also be deleted synchronously. Packet sending and receiving process: QinQ packets must pass through the VLAN interface on which they depend to complete sending and receiving.
[0061] The dependency between the above network interfaces (QinQ interface and VLAN interface) cannot meet the message immediacy requirement when the number of user devices increases sharply, and the management and maintenance cost is very high.
[0062] Based on the above problems, the present invention designs a QinQ message processing method.
[0063] The technical solution of the embodiment of the present disclosure is described in detail below:
[0064] refer to Figure 2 As shown, a QinQ message processing method according to an exemplary embodiment of the present disclosure may include the following steps:
[0065] Step S210, determining a matching relationship between the double-layer VLAN tag information and the QinQ interface information; the QinQ interface information includes a QinQ interface identifier;
[0066] Step S220, configuring the matching relationship in the network physical interface;
[0067] Step S230, according to the matching relationship, matching the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message;
[0068] Step S240: Process the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information.
[0069] In the QinQ message processing method provided in this example implementation, the matching relationship between the double-layer VLAN tag information and the QinQ interface information can be first determined; the matching relationship can be configured in the network physical interface; according to the matching relationship, the double-layer VLAN tag information carried by the QinQ message is matched with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message; according to the service information, the QinQ message is processed through the QinQ interface corresponding to the QinQ interface identifier. On the one hand, the dependency between the QinQ interface and the VLAN interface in the QinQ message processing process is eliminated, so that the QinQ message can be directly processed through the QinQ interface, thereby improving the QinQ message processing efficiency; on the other hand, the layer-by-layer identification and stripping process of the double-layer VLAN tag information is avoided, thereby reducing the consumption of hardware resources. In addition, the creation, management status, MTU (maximum transmission unit), and packet receiving and sending operations of the QinQ interface are completely independent of the VLAN interface, and the MTU of the QinQ interface is independent of the network physical interface, which is convenient for the management and maintenance of the entire system.
[0070] Next, in another embodiment, the above steps are described in more detail.
[0071] In step S210, the matching relationship between the double-layer VLAN tag information and the QinQ interface information is determined. In this example implementation, the QinQ interface information may include information such as the QinQ interface identifier, the QinQ interface transmission rate, the QinQ interface status (e.g., management status (up)), and the QinQ interface IP. The double-layer VLAN tag information may include inner VLAN tag information, i.e., inner VLAN tag information, and outer VLAN tag information, i.e., outer VLAN tag information. The inner VLAN tag information is a private network tag, and the outer VLAN tag information is a public network tag. The message containing the double-layer VLAN tag information can realize the private network VLAN transparent transmission to the public network.
[0072] In this example implementation, the inner VLAN tag information may also carry multiple layers of VLAN tag information, for example, two layers of VLAN tag information or three layers of VLAN tag information. In this embodiment, the VLAN tag information within the outermost layer may be collectively referred to as inner VLAN tag information. One inner VLAN tag information corresponds to one virtual local area network.
[0073] In this example implementation, the matching relationship between the double-layer VLAN tag information and the QinQ interface information may be determined through steps S310 - S320 .
[0074] In step S310, the double-layer VLAN tag information is added to the QinQ interface information to form the QinQ interface information containing the double-layer tag. In this example implementation, the double-layer VLAN tag information may include an outer VLAN tag and an inner VLAN tag. The outer VLAN tag may include a 2-byte ETYPE field and a 2-byte tag field, and the tag field may include a priority, a CFI (Canonical Format Indicator), and a VLAN ID field. The VLAN ID is 12 bits and can represent 4K VLANs. The format of the inner VLAN tag is the same as that of the outer VLAN tag. The above double-layer VLAN tag information is added to the QinQ interface information.
[0075] For example, for the Linux operating system, by reconfiguring the QinQ interface information in the 802.1Q module of the Linux kernel, the above double-layer VLAN tag information is configured in the QinQ interface information of the 802.1Q module, so that the QinQ interface information contains double-layer VLAN tag information. In this way, when sending and receiving messages, the QinQ interface can be directly searched, and the double-layer VLAN tag can be identified and stripped at one time, simplifying the message processing process.
[0076] In step S320, a matching relationship between the double-layer VLAN tag information and the QinQ interface identifier is established according to the QinQ interface information containing the double-layer tag. In this example implementation, a matching relationship can be established between the double-layer VLAN tag information in the QinQ interface information containing the double-layer tag and the corresponding QinQ interface identifier. The matching relationship is essentially a data structure, and the data structure can be presented in the form of a lookup table item or a self-balancing binary search tree. Preferably, this example establishes a corresponding self-balancing binary search tree according to the matching relationship between the double-layer VLAN tag information and the QinQ interface identifier, and one node in the self-balancing binary search tree corresponds to one QinQ interface identifier.
[0077] For example, in this example implementation, the nodes of the self-balancing binary search tree have two attributes. In addition to the general mandatory requirements of the binary search tree, the following requirements are added:
[0078] (1) A node has two attributes.
[0079] (2) The root node is the first attribute.
[0080] (3) Each leaf node (NIL node, empty node) has the first attribute.
[0081] (4) Both child nodes of each second attribute node are first attributes. (There cannot be two consecutive second attribute nodes on all paths from each leaf to the root)
[0082] (5) All paths from any node to each of its leaves contain the same number of first attribute nodes.
[0083] The above constraints enforce the key property of a self-balancing binary search tree: the longest possible path from the root to a leaf is no longer than twice the shortest possible path. As a result, the tree is roughly balanced. The worst-case time required for operations such as inserting, deleting, and looking up a value is proportional to the height of the tree. This theoretical upper limit on the height allows the self-balancing binary search tree to be efficient in the worst case, ensuring efficient lookup of double-layer VLAN tag information and QinQ interface identifiers.
[0084] In step S220, the matching relationship is configured in the network physical interface. In this example implementation, the network physical interface may be a network card interface in a software system. It may be used to implement data exchange between a user and an external device. This example mainly refers to the network physical interface (i.e., the main interface) in the data exchange process. In general, the matching relationship between the interface and the VLAN tag is recorded in the data structure of the corresponding interface at the upper level. In this example, the matching relationship between the double-layer VLAN tag information and the QinQ interface identifier is directly configured in the network physical interface, so that the network physical interface can directly search for the corresponding QinQ interface according to the double-layer VLAN tag information carried by the message without going through the VLAN interface, completely eliminating the dependency between the QinQ interface and the VLAN interface, and changing the network interface from the previous hierarchical relationship to the current parallel relationship. When the message carries a double-layer VLAN tag, the corresponding QinQ interface is directly searched in the network physical interface. When the message carries a single-layer VLAN tag, the corresponding VLAN interface is directly searched in the network physical interface. Whether it is a single-layer or double-layer VLAN tag, it only needs to go through the interface search and forwarding process once, which improves the message processing efficiency.
[0085] For example, the storage information of the QinQ interface information is configured in the 802.1Q module of the Linux kernel so that the matching relationship is stored in the network physical interface. When the matching relationship is a lookup table item, the corresponding lookup table item is stored in the network physical interface; when the matching relationship is a self-balancing binary search tree, the self-balancing binary search tree is stored in the network physical interface. In the process of sending and receiving messages, if the kernel protocol stack finds that the message carries a double-layer protocol as VLAN, the 802.1Q module is called to process the message; and the corresponding QinQ interface is found through the self-balancing binary search tree stored in the network physical interface; when the corresponding QinQ interface is not found, the message is directly discarded. If a matching QinQ interface is found, the message can be transmitted to the QinQ interface.
[0086] In step S230, according to the matching relationship, the double-layer VLAN tag information carried by the QinQ message is matched with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message.
[0087] In this example implementation, the node information identical to the double-layer VLAN tag information carried by the QinQ message is searched in the self-balancing binary search tree stored in the network physical interface; the corresponding QinQ interface identifier is determined according to the node information found. The specific implementation process is that after the Linux kernel protocol stack recognizes that the message carries VLAN tag information, it calls the 802.1Q module, and the 802.1Q module strips off the two layers of VLAN tags of the message, and searches for the corresponding node information in the matching relationship of the network physical interface, such as the self-balancing binary search tree, and determines the corresponding QinQ interface identifier according to the corresponding node information found. When no matching information is found in the matching relationship, the current message data packet is discarded.
[0088] In step S240, the QinQ message is processed through the QinQ interface corresponding to the QinQ interface identifier according to the service information.
[0089] In this example implementation, reference Figure 4 As shown, message processing is performed through steps S410-S420.
[0090] In step S410, the service type information is determined, and the service type information includes termination information and forwarding information. In this example implementation, the service type information can be determined by the service information identifier carried in the message, or can be obtained by the kernel through other interactive forms.
[0091] The service type information may be QinQ message termination information or QinQ message subsequent forwarding information. The QinQ message termination information may be information required to implement VLAN termination of messages carrying two or more VLAN tags. The QinQ message subsequent forwarding information may be information required for layer 2 forwarding, layer 3 forwarding, or other service processing.
[0092] In step S420, based on the service type information, the QinQ message is terminated or forwarded through the QinQ interface corresponding to the QinQ interface identifier. In this example implementation, since the double-layer VLAN tag information is added to the QinQ interface information in advance, when receiving and sending messages, the QinQ interface can be directly searched, and there is no need to go through the VLAN interface. The QinQ message can be directly terminated or forwarded through the QinQ interface, which simplifies the processing flow in the message receiving and sending process and improves the message processing efficiency.
[0093] In another embodiment of the present disclosure, for a message carrying a single layer of VLAN tag information, a VLAN interface can be directly used to process the message. This example retains a VLAN interface corresponding to a public network tag for processing a message carrying a single layer of VLAN tag information.
[0094] In this example implementation, VLAN message processing is implemented through the following steps: First, single-layer VLAN tag information is added to VLAN interface information, so that the VLAN interface information contains VLAN tag information; then, the VLAN interface information containing single-layer VLAN tag information is configured in the network physical interface, so that the message finds a matching VLAN interface in the network physical interface, and the VLAN interface is used to directly process the message.
[0095] For example, refer to Figure 5 , the message processing method disclosed in the present invention is used to implement the message receiving and sending process.
[0096] (1) Message sending process:
[0097] (1a) Each application in user mode sends a message to the remote end.
[0098] (1b) The kernel protocol stack encapsulates the message into a message queue to form a network data packet.
[0099] (1c) The network data packet is routed by the system, the packet sending interface is set as the QinQ interface, and the network data packets are delivered to the QinQ interface one by one.
[0100] (1d) The QinQ interface calls the 802.1Q module to encapsulate two layers of VLAN tags for network data packets.
[0101] (1e) Call the 802.1Q module to redirect the sending device of the network data packet to the network physical interface, and submit the network data packet to the network physical interface for processing.
[0102] (1f) The network physical interface submits the network data packet to the network card driver for processing.
[0103] (1g) The network card driver sets the sending parameters, and the network interface controller controls the sending of network data packets.
[0104] (2) Message receiving process:
[0105] (2a) The network interface controller controls the reception of network data packets from the remote end and notifies the network card driver.
[0106] (2b) The network card driver performs preliminary processing such as information verification on the network data packet, sets the network physical interface for receiving the packet, and submits the network data packet to the kernel protocol stack.
[0107] (2c) The kernel protocol stack parses the network data packet and, based on the parsing results, calls the 802.1Q module to process the message.
[0108] (2d) If the parsing result is a single-layer VLAN protocol, the 802.1Q module strips off the VLAN tag of the message and searches for the corresponding VLAN interface in the network physical interface accordingly; if the parsing result is a two-layer VLAN protocol, the 802.1Q module strips off the two-layer VLAN tags of the message and searches for the corresponding QinQ interface in the self-balancing binary search tree of the network physical interface accordingly.
[0109] (2e) If no corresponding QinQ interface or VLAN interface is found, the message is discarded directly.
[0110] (2f) If the QinQ interface is successfully matched, the packet receiving device is redirected to the QinQ interface.
[0111] If the VLAN interface is successfully matched, the packet receiving device is redirected to the VLAN interface.
[0112] (2g) The message is delivered to the upper layer protocol of the kernel protocol stack.
[0113] (2h) The message is delivered to each application in user mode.
[0114] The present disclosure can first determine the matching relationship between the double-layer VLAN tag information and the QinQ interface information; configure the matching relationship in the network physical interface; according to the matching relationship, match the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message; according to the business information, process the QinQ message through the QinQ interface corresponding to the QinQ interface identifier. On the one hand, the dependency between the QinQ interface and the VLAN interface in the QinQ message processing process is eliminated, so that the QinQ message can be directly processed through the QinQ interface, improving the efficiency of QinQ message processing; on the other hand, the layer-by-layer identification and stripping process of the double-layer VLAN tag information is avoided, reducing hardware resource consumption. In addition, the creation, management status, MTU (maximum transmission unit), and packet receiving and sending operations of the QinQ interface are completely independent of the VLAN interface, and the MTU of the QinQ interface is independent of the network physical interface, which is convenient for the management and maintenance of the entire system.
[0115] The present invention can simplify the message processing process by removing the dependency between network interfaces, especially in terms of QinQ message information, and search for QinQ interfaces in the self-balancing binary search tree of the network physical interface without going through the VLAN interface. The creation, management status, MTU, and packet receiving and sending operations of the QinQ interface disclosed in the present invention are completely independent of the VLAN interface; the MTU of the QinQ interface is independent of the network physical interface; the QinQ message does not need to be processed by the VLAN message when it is terminated; and the network interfaces are completely independent.
[0116] Furthermore, in this exemplary implementation, a QinQ message processing device 600 is also provided. The QinQ message processing device 600 can be applied to a communication device between a user and a remote end.
[0117] refer to Figure 6 As shown, the vehicle loading rate determination device 600 in the logistics station may include:
[0118] The matching relationship building module 610 is used to determine the matching relationship between the double-layer VLAN tag information and the QinQ interface information; the QinQ interface information includes the QinQ interface identifier.
[0119] The matching relationship configuration module 620 is used to configure the matching relationship in the network physical interface.
[0120] The interface matching module 630 is used to match the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through the network physical interface according to the matching relationship, and determine the QinQ interface identifier corresponding to the QinQ message.
[0121] The message processing module 640 is used to process the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information.
[0122] In an exemplary embodiment of the present disclosure, the matching relationship building module 610 includes:
[0123] The tag information adding module can be used to add double-layer VLAN tag information to QinQ interface information to form QinQ interface information containing double-layer tags.
[0124] The matching establishment module can be used to establish a matching relationship between the double-layer VLAN tag information and the QinQ interface identifier according to the QinQ interface information containing the double-layer tag.
[0125] In an exemplary embodiment of the present disclosure, the interface matching module 630 includes:
[0126] A receiving search module can be used to search the self-balancing binary search tree stored in the network physical interface for node information that is the same as the double-layer VLAN tag information carried by the QinQ message;
[0127] The interface identifier determination module can be used to determine the corresponding QinQ interface identifier according to the found node information.
[0128] In an exemplary embodiment of the present disclosure, the message processing module 640 includes:
[0129] The service type determination module can be used to determine service type information, where the service type information includes termination and forwarding.
[0130] The processing module may be configured to terminate or forward the QinQ message through a QinQ interface corresponding to the QinQ interface identifier based on the service type information.
[0131] The specific details of each module or unit in the above-mentioned vehicle loading rate determination device in the logistics station have been described in detail in the corresponding QinQ message processing method, so they will not be repeated here.
[0132] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following method. Figure 2 to Figure 5 The various steps shown, etc.
[0133] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0134] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0135] Refer to the following Figure 7 hereinafter describes an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0136] like Figure 7As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0137] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0138] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0139] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0140] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0141] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or may communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RA identification systems, tape drives, and data backup storage systems, etc.
[0142] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0143] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0144] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in the specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc., which shall all be considered as part of the present disclosure.
[0145] It should be understood that the disclosure disclosed and defined in this specification extends to all alternative combinations of two or more individual features mentioned or evident in the text and / or the accompanying drawings. All these different combinations constitute multiple alternative aspects of the disclosure. The embodiments of this specification illustrate the best mode known for implementing the disclosure and will enable those skilled in the art to utilize the disclosure.
Claims
1. A QinQ message processing method, characterized in that: include: Determine the matching relationship between the double-layer virtual LAN VLAN tag information and the QinQ interface information; The QinQ interface information includes a QinQ interface identifier; Configuring the matching relationship in a network physical interface; According to the matching relationship, the double-layer VLAN tag information carried by the QinQ message is matched with the QinQ interface identifier through the network physical interface to determine the QinQ interface identifier corresponding to the QinQ message; Processing the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information; The determining of the matching relationship between the double-layer VLAN tag information and the QinQ interface information includes: Add the double-layer VLAN tag information to the QinQ interface information to form the QinQ interface information containing the double-layer tag; According to the double-layer VLAN tag information and the QinQ interface identifier in the QinQ interface information containing the double-layer tag, a corresponding self-balancing binary search tree is established to establish a matching relationship between the double-layer VLAN tag information and the QinQ interface identifier; one node in the self-balancing binary search tree corresponds to one QinQ interface identifier; The processing of the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information includes: Determine service type information, where the service type information includes termination and forwarding; Based on the service type information, the QinQ message is terminated or forwarded through a QinQ interface corresponding to the QinQ interface identifier.
2. The QinQ message processing method according to claim 1, characterized in that: The adding of the double-layer VLAN tag information to the QinQ interface information includes: The 802.1Q module of the Linux kernel reconfigures the QinQ interface information so that the QinQ interface information contains double-layer VLAN tag information.
3. The QinQ message processing method according to claim 1, characterized in that: The configuring the matching relationship in the network physical interface includes: The storage information of the QinQ interface information is configured in the 802.1Q module of the Linux kernel so that the matching relationship is stored in the network physical interface.
4. The QinQ message processing method according to claim 1, characterized in that: According to the matching relationship, matching the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through the network physical interface includes: Searching the self-balancing binary search tree stored in the network physical interface for node information identical to the double-layer VLAN tag information carried by the QinQ message; According to the found node information, the corresponding QinQ interface identifier is determined.
5. The QinQ message processing method according to claim 1, characterized in that: The method further comprises: Add single-layer VLAN tag information to VLAN interface information; Configure VLAN interface information containing single-layer VLAN tag information to the network physical interface.
6. A QinQ message processing device, characterized in that: include: A matching relationship building module is used to determine the matching relationship between the double-layer virtual local area network VLAN tag information and the QinQ interface information; The QinQ interface information includes a QinQ interface identifier; A matching relationship configuration module, used to configure the matching relationship in the network physical interface; An interface matching module, used to match the double-layer VLAN tag information carried by the QinQ message with the QinQ interface identifier through a network physical interface according to the matching relationship, and determine the QinQ interface identifier corresponding to the QinQ message; A message processing module, used for processing the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information; The determining of the matching relationship between the double-layer VLAN tag information and the QinQ interface information includes: Add the double-layer VLAN tag information to the QinQ interface information to form the QinQ interface information containing the double-layer tag; According to the double-layer VLAN tag information and the QinQ interface identifier in the QinQ interface information containing the double-layer tag, a corresponding self-balancing binary search tree is established to establish a matching relationship between the double-layer VLAN tag information and the QinQ interface identifier; one node in the self-balancing binary search tree corresponds to one QinQ interface identifier; The processing of the QinQ message through the QinQ interface corresponding to the QinQ interface identifier according to the service information includes: Determine service type information, where the service type information includes termination and forwarding; Based on the service type information, the QinQ message is terminated or forwarded through a QinQ interface corresponding to the QinQ interface identifier.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: one or more processors; A storage device, used for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
A method for realizing multi-span tree protocol
CN101188564A
Method and device for user configuration information acquisition
CN101447945A