Message parsing method based on network card and related device

By parsing the packets on the network card and sending the parsed information to the virtual machine manager, the problem of insufficient processing capacity of the intelligent network card is solved, the CPU load on the virtual machine manager side is reduced, and the packet processing efficiency is improved.

CN114363256BActive Publication Date: 2024-10-18HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011043083.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-10-18
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

When processing network packets, the smart network card has limited processing capabilities, resulting in the inability to process some packets, increasing the CPU load on the virtual machine manager side, and reducing the overall processing capability.

Method used

By parsing the received message on the network card, the parsing information is obtained, and based on the parsing information, it is judged whether the preset conditions are met. If not, the parsing information and the message are sent to the virtual machine manager, so that the parsing information and the message are sent to the virtual machine manager. The message processing module directly uses the parsing information for processing, reducing repeated parsing.

Benefits of technology

This reduces the number of times the virtual machine manager parses packets, reduces CPU processing overhead, and improves overall processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114363256B_ABST
    Figure CN114363256B_ABST
Patent Text Reader

Abstract

The present application provides a message parsing method based on a network card, which involves a network card and a virtual machine manager and is applied in a cloud computing scenario. In the method, the network card can parse the received message to obtain the parsing information of the message, and under certain conditions, send the aforementioned message and the parsing information to the virtual machine manager, so that multiple message processing modules in the virtual machine manager can directly process the message according to the aforementioned parsing information, without the need for each of the aforementioned message processing modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced to reduce the processing overhead of the CPU on the virtual machine manager side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and in particular to a message parsing method based on a network card and related devices. Background Art

[0002] Smart NIC (smart network interface controller) is a network interface controller with advanced forwarding features, which can process network packets. For example, packet forwarding, packet modification, packet checksum calculation, packet aggregation and slicing. This smart NIC is often used in conjunction with a virtual machine manager to reduce the CPU load on the virtual machine manager side, thereby improving the overall processing power of the virtual machine manager.

[0003] In traditional technology, the smart network card has a part of computing instances reserved, which can perform simple message processing such as message forwarding on the message. However, the processing capacity of the smart network card is limited, and there is a situation where some messages cannot be processed. Therefore, it is necessary to forward the aforementioned messages to the virtual machine manager for processing, resulting in the smart network card having a poor effect on reducing the CPU load on the virtual machine manager side. Therefore, there is an urgent need for a solution that can more effectively utilize the smart network card to optimize the message processing process. Summary of the invention

[0004] The embodiment of the present application provides a message parsing method based on a network card and a related device, which are used to reduce the number of times a virtual machine manager side parses a message during message processing, so as to reduce the processing overhead of the CPU on the virtual machine manager side.

[0005] In a first aspect, the present application provides a message parsing method based on a network card, the method involves a network card and a virtual machine manager, and is applied in a cloud computing scenario. In the method, the network card parses a received message to obtain parsing information of the message. Then, the network card determines whether the message meets a preset condition based on the aforementioned parsing information. When it is determined that the parsing information of the message does not meet the preset condition, the network card sends the parsing information and the message to the virtual machine manager. Then, the virtual machine manager provides the parsing information to multiple message processing modules in the virtual machine manager, so that each of the aforementioned multiple message processing modules performs corresponding message processing on the message based on the parsing information.

[0006] In this embodiment, since the network card can parse the message to obtain the parsing information of the message, and when it is determined that the parsing information of the message does not meet the preset condition, the message and the parsing information are sent to the virtual machine manager, so that multiple message processing modules in the virtual machine manager can directly process the message according to the parsing information, without the need for each of the modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced, so as to reduce the processing overhead of the CPU on the virtual machine manager side.

[0007] In an optional implementation, the message comes from a virtual machine directly connected to the network card; or, the message comes from a switch connected to the network card.

[0008] In an optional implementation, the aforementioned preset condition is that the network card queries a message processing rule related to the parsing information.

[0009] The message processing rule related to the parsing information can be understood as part or all of the parsing information being related to a message processing rule in the network card. It should be understood that the message processing rule can be stored in the aforementioned network card in the form of a table or other forms. In a specific implementation, the aforementioned message processing rule is stored in a flow table, the flow table includes at least one flow, and the flow in the flow table is the aforementioned message processing rule.

[0010] In an optional implementation, the method further includes: when the parsed information of the message meets the preset condition, the network card processes the message according to the message processing rule.

[0011] In this embodiment, the aforementioned network card can not only parse the message, but also query the processing rules of the message based on the parsing information, so that after querying the processing rules related to the parsing information, the network card can process the message. In other words, this embodiment can hand over part of the processing tasks of the message to the network card, instead of handing over all the processing tasks of the message to the message processing module in the virtual machine manager. Therefore, the processing overhead of the CPU on the virtual machine manager side can be reduced.

[0012] Exemplarily, the aforementioned message processing rules include performing a layer 2 security check on the message, querying the source address and destination address of the message, and forwarding the message to the destination address, etc., which are not specifically limited here.

[0013] In an optional implementation, the parsing information includes key information; the network card includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule. In addition, the method further includes: the network card queries the flow table according to the key information; when the flow corresponding to the key information is not found according to the key information, the network card determines that the parsing information of the message does not meet the preset condition.

[0014] In this embodiment, the network card can use the key information in the parsed information as an index to search for the flow corresponding to the key information in the aforementioned flow table. If the flow corresponding to the key information cannot be found, the network card sends both the aforementioned parsed information and the message to the virtual machine manager, so that the virtual machine manager processes the message according to the parsed information.

[0015] In an optional implementation, before the virtual machine manager provides the parsing information to a plurality of message processing modules in the virtual machine manager, the method further includes: the virtual machine manager storing the parsing information.

[0016] In this embodiment, the virtual machine manager can store the aforementioned parsing information, so each message processing module in the virtual machine manager can obtain the aforementioned parsing information according to the needs of each module. At this time, each message processing module in the virtual machine manager does not need to parse the message, but can directly use the parsing information from the aforementioned network card.

[0017] In an optional embodiment, before the virtual machine manager provides the parsed information to multiple message processing modules in the virtual machine manager, the method also includes: the virtual machine manager classifies and stores the parsed information into multiple data structures, each of the data structures contains a portion of the parsed information, each of the data structures contains different types of information, and the message processing module is used to process the message according to at least one of the data structures.

[0018] In this embodiment, in order to facilitate each message processing module in the virtual machine manager to obtain the parsing information required by each message processing module, the virtual machine manager can classify and store the parsing information into multiple data structures. It can also be understood that converting the parsing information into a format that can be recognized by the message processing module is conducive to improving the efficiency of each message processing module in obtaining the parsing information to process the message.

[0019] In an optional implementation, the data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

[0020] In this embodiment, it is proposed that the aforementioned data structure also includes indication information, and the indication information is used to indicate the type of parsing information carried by the data structure. Therefore, each message processing module in the virtual machine manager can obtain the content stored in the data structure according to the aforementioned indication information. It can also be understood that the aforementioned message processing module can use the aforementioned indication information to query the parsing information required by the message processing module. Therefore, it is beneficial to improve the efficiency of the message processing module in obtaining parsing information, and further to improve the efficiency of the virtual machine manager in processing messages.

[0021] In an optional implementation, the key information includes one or more of a source IP address, source port information, a destination IP address, destination port information or a transport layer protocol.

[0022] In an optional implementation, the message processing module is any one of a layer 2 security module, an access control list (ACL) module, a forwarding module or an unloading module.

[0023] In a second aspect, the present application provides a message parsing method based on a network card, the method involves a network card and a virtual machine manager, and is applied in a cloud computing scenario. In the method, the network card sends a received message to the virtual machine manager; the virtual machine manager parses the message to obtain parsing information of the message, and provides the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

[0024] It should be understood that the network card in this embodiment may be a common network card without a resolution function, or may be a smart network card with a resolution function but without enabling the resolution function, which is not specifically limited here.

[0025] In this embodiment, the network card does not parse the message, but forwards the message to the virtual machine manager, which uniformly parses the message to obtain the parsing information of the message, and directly provides the parsing information to each message processing module in the virtual machine manager for message processing. In this process, the virtual machine manager only parses the message once, and each message processing module in the virtual machine manager directly uses the aforementioned parsing information without parsing the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced to reduce the processing overhead of the CPU on the virtual machine manager side.

[0026] In an optional implementation, the message comes from a virtual machine directly connected to the network card; or, the message comes from a switch connected to the network card.

[0027] In an optional embodiment, before the virtual machine manager provides the parsed information to multiple message processing modules in the virtual machine manager, the method also includes: the virtual machine manager classifies and stores the parsed information into multiple data structures, each of the data structures contains a portion of the parsed information, each of the data structures contains different types of information, and the message processing module is used to process the message according to at least one of the data structures.

[0028] In this embodiment, in order to facilitate each message processing module in the virtual machine manager to obtain the parsing information required by each message processing module, the virtual machine manager can classify and store the parsing information into multiple data structures. It can also be understood that converting the parsing information into a format that can be recognized by the message processing module is conducive to improving the efficiency of each message processing module in obtaining the parsing information to process the message.

[0029] In an optional implementation, the data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

[0030] In this embodiment, it is proposed that the aforementioned data structure also includes indication information, and the indication information is used to indicate the type of parsing information carried by the data structure. Therefore, each message processing module in the virtual machine manager can obtain the content stored in the data structure according to the aforementioned indication information. It can also be understood that the aforementioned message processing module can use the aforementioned indication information to query the parsing information required by the message processing module. Therefore, it is beneficial to improve the efficiency of the message processing module in obtaining parsing information, and further to improve the efficiency of the virtual machine manager in processing messages.

[0031] In an optional implementation, the message processing module is any one of a layer 2 security module, an access control list (ACL) module, a forwarding module or an unloading module.

[0032] In a third aspect, the present application provides a server, which includes a network card and a virtual machine manager. The network card is used to receive a message, parse the message to obtain parsing information of the message, and when it is determined that the message does not meet a preset condition according to the parsing information, the parsing information and the message are sent to the virtual machine manager. In addition, the virtual machine manager is used to provide the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

[0033] In an optional implementation, the message comes from a virtual machine directly connected to the network card; or, the message comes from a switch connected to the network card.

[0034] In an optional implementation, the preset condition is that the network card queries a message processing rule related to the parsed information.

[0035] In an optional implementation, the network card is further configured to process the message according to the message processing rule when the parsed information of the message meets the preset condition.

[0036] In an optional embodiment, the parsing information includes key information; the network card includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule; the network card is also used to query the flow table according to the key information, and when the flow corresponding to the key information is not found according to the key information, it is determined that the parsing information of the message does not meet the preset condition.

[0037] In an optional implementation, the virtual machine manager is further used to store the parsing information.

[0038] In an optional embodiment, the virtual machine manager is specifically used to classify and store the parsed information into multiple data structures, each of the data structures contains a portion of the parsed information, each of the data structures contains different types of information, and the message processing module is used to process the message according to at least one of the data structures.

[0039] In an optional implementation, the data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

[0040] In an optional implementation, the key information includes one or more of a source IP address, source port information, a destination IP address, destination port information or a transport layer protocol.

[0041] In an optional implementation, the message processing module is any one of a layer 2 security module, an access control list (ACL) module, a forwarding module or an unloading module.

[0042] In a fourth aspect, the present application provides a server, which includes a network card and a virtual machine manager. The network card is used to receive a message and send the message to the virtual machine manager. In addition, the virtual machine manager is used to parse the message to obtain parsing information of the message, and provide the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

[0043] In an optional implementation, the message comes from a virtual machine directly connected to the network card; or, the message comes from a switch connected to the network card.

[0044] In an optional embodiment, the virtual machine manager is specifically used to classify and store the parsed information into multiple data structures, each of the data structures contains a portion of the parsed information, each of the data structures contains different types of information, and the message processing module is used to process the message according to at least one of the data structures.

[0045] In an optional implementation, the data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

[0046] In an optional implementation, the message processing module is any one of a layer 2 security module, an access control list (ACL) module, a forwarding module or an unloading module.

[0047] In a fifth aspect, the present application provides a network card, which includes a parser and an embedded switch. The parser is used to obtain a message and parse the message to obtain parsing information of the message, wherein the message comes from a virtual machine directly connected to the network card; and the embedded switch is used to send the parsing information and the message to the virtual machine manager.

[0048] In an optional embodiment, the parsing information includes key information; the embedded switch includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule; the embedded switch is also used to query the flow table according to the key information, and when the flow corresponding to the key information is not found according to the key information, it is determined that the parsing information of the message does not meet the preset condition.

[0049] In an optional implementation, the key information includes one or more of a source IP address, source port information, a destination IP address, destination port information or a transport layer protocol.

[0050] In a sixth aspect, the present application provides a message processing device, which includes a processing module, a storage module and a network interface. The network interface is connected to a network card, the storage module stores a program, and the processing module calls the aforementioned program to implement the functions involved in the network card and the virtual machine manager in the aforementioned first aspect or second aspect.

[0051] In the seventh aspect, an embodiment of the present application provides a bare metal server, which is a computing server with both virtual machine elasticity and physical machine performance, and is used to provide excellent computing performance and data security for core databases, key application systems, high-performance computing, big data and other businesses. The bare metal server includes a processing module and a transceiver module. Among them, the processing module can be a processor, and the transceiver module can be an input and output device or a network interface. The bare metal server can also include a storage module, which can be a memory; the storage module is used to store instructions, and the processing module executes the instructions stored in the storage module, so that the bare metal server performs the functions involved in the network card and the virtual machine manager in the first aspect or the second aspect mentioned above.

[0052] In an eighth aspect, an embodiment of the present application provides a physical machine, which is used to run the aforementioned network card and virtual machine manager, and process the message based on the network card and virtual machine manager in the aforementioned first aspect or second aspect. The physical machine includes a processing module and a transceiver module. Among them, the processing module can be a processor, and the transceiver module can be an input and output device or a network interface. The physical machine can also include a storage module, which can be a memory; the storage module is used to store instructions, and the processing module executes the instructions stored in the storage module, so that the physical machine performs the functions involved in the network card and virtual machine manager in the aforementioned first aspect or second aspect.

[0053] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0054] In the embodiment of the present application, since the network card can parse the message to obtain the parsing information of the message, and when the parsing information of the message does not meet the preset conditions, the aforementioned message and the parsing information are sent to the virtual machine manager, so that multiple message processing modules in the virtual machine manager can directly process the message according to the aforementioned parsing information, without the need for the aforementioned modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced, so as to reduce the processing overhead of the CPU on the virtual machine manager side. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application.

[0056] Figure 1 This is an application scenario diagram of the message parsing method based on the network card in the embodiment of the present application;

[0057] Figure 2 A flow chart of a message parsing method based on a network card in an embodiment of the present application;

[0058] Figure 3 Another flow chart of the message parsing method based on the network card in the embodiment of the present application;

[0059] Figure 4 This is another application scenario diagram of the message parsing method based on the network card in the embodiment of the present application;

[0060] Figure 5 A schematic diagram of an embodiment of a message processing device proposed in an embodiment of the present application;

[0061] Figure 6 A schematic diagram of another embodiment of the message processing device proposed in the embodiment of the present application. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0063] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0064] The embodiment of the present application provides a message parsing method based on a network card and a related device, which are used to reduce the number of times a virtual machine manager side parses a message during message processing, so as to reduce the processing overhead of the CPU on the virtual machine manager side.

[0065] For ease of understanding, some technical terms involved in the embodiments of the present application are explained below:

[0066] Virtual machine: refers to a computer system that runs in a completely isolated environment and has hardware system functions through software simulation. The virtual machine runs in a physical computer, and the work that can be completed in the physical computer can be realized in the virtual machine. Common virtual machines include: Java virtual machine, Linux virtual machine and Windows virtual machine. The virtual machine in this embodiment can be any of the above virtual machines.

[0067] Hypervisor: Also known as virtual machine monitor (VMM), is software, firmware or hardware used to create and execute virtual machines. An intermediate software layer that runs between the underlying physical server and the operating system, allowing multiple operating systems and applications to share hardware.

[0068] Embedded switch (eSwitch): Located in the Smart NIC, it is the core component of the Smart NIC to process message forwarding logic and is used to accelerate network processing logic in specific scenarios. Generally, it is implemented by application specific integrated circuit (ASIC) chips customized by hardware manufacturers based on business.

[0069] Virtual switch (vSwitch): is a virtual device that enables the virtual machine manager to process messages. Each message processing module in the virtual machine manager can be located in the virtual switch. Generally, different message processing modules have different processing operations on messages, and the aforementioned multiple message processing modules can process a certain message in series.

[0070] Fast data path: An academic definition of a fast forwarding path, usually a forwarding path with faster performance. In the Smart NIC scenario, it refers to the data path where packets are forwarded through hardware such as the NIC.

[0071] Slow data path: An academic definition of a slow forwarding path, which is usually a data forwarding path that processes complex logic and has slower performance. In the Smart NIC scenario, it refers to the data path where packets are forwarded through a virtual switch.

[0072] Miss upcall: describes the behavior of sending a miss to the slow forwarding path when the fast path fails to look up the table in a design scenario where the fast and slow forwarding paths are separated.

[0073] The following is an introduction to the application scenarios and system architecture to which the network card-based message parsing method proposed in the embodiment of the present application is adapted:

[0074] The network card-based message parsing method proposed in the embodiment of the present application can be applied to cloud computing scenarios. For example, a scenario where a network card is used to accelerate message forwarding processing between two virtual machines to unload the host CPU processing load. Figure 1 As shown, in this scenario, the virtual machine manager run by the host manages at least one virtual machine (for example, virtual machine 1 and virtual machine 2), and there is a communication demand between the aforementioned virtual machines. In order to improve the efficiency of communication between the aforementioned virtual machines, the host running the virtual machine manager is also configured with a network card, which is used to unload the processing load of the CPU of the host. When one of the virtual machines (for example, virtual machine 1) transmits a message to another virtual machine (for example, virtual machine 2), the virtual machine 1 will send the message to the aforementioned network card in a direct-pass manner. If the network card has the ability to process the message, the embedded switch in the network card processes the message and transmits the processed message to virtual machine 2 in a direct-pass manner; if the network card does not have the ability to process the message, the network card transmits the aforementioned message to the virtual machine manager, which is processed by the virtual switch in the virtual machine manager, and then forwards the processed message to the network card, and then the network card transmits the message to virtual machine 2 in a direct-pass manner. However, if the aforementioned message is forwarded to the virtual machine manager for processing, the CPU resource on the virtual machine manager side will be occupied again, resulting in that the network card has a poor effect on reducing the CPU load on the virtual machine manager side.

[0075] It should be understood that, in addition to the aforementioned application scenarios, the network card-based message parsing method can also be used to process messages from external switches. That is, the message introduced in this application can come from a virtual machine directly connected to the network card, or from a switch connected to the network card. In the subsequent embodiments, the message can come from a virtual machine directly connected to the network card as an example for introduction.

[0076] In this regard, the present application provides a message parsing method based on a network card, which can more effectively utilize the network card to reduce the CPU load on the virtual machine manager side and optimize the message processing flow.

[0077] like Figure 2 As shown, it is an embodiment of the message parsing method based on the network card proposed in the present application. In this method, the network card and the virtual machine manager in the server will perform the following steps:

[0078] Step 201: The network card receives a message sent by the virtual machine.

[0079] In this embodiment, if a virtual machine needs to transmit a message to another virtual machine, and the two virtual machines can also accelerate the message forwarding processing through the network card, then the network card can receive the message sent by the aforementioned virtual machine. The message carries information (or data) that needs to be transmitted to the other virtual machine. Exemplarily, the message can be a source Internet protocol (IP) message.

[0080] In addition, the network card is directly connected to the virtual machine, that is, the virtual machine transmits the above message to the network card through the direct technology. The above direct technology refers to direct memory access (DMA) technology, and the process of the virtual machine sending the above message to the network card can be free from CPU intervention.

[0081] Step 202: The network card parses the message to obtain parsing information of the message.

[0082] In this embodiment, the network card has parsing capability, that is, the network card can perform parsing operations on the message. The parsing operation can be understood as analyzing the message header of the message to obtain information such as tunnel information, layer 2 information, source IP address, source port information, destination IP address, destination port information or transport layer protocol. It should be understood that when the format of the aforementioned message is different, the parsing operation of the network card on the message will also be different, which is not specifically limited here.

[0083] In an optional implementation, the network card is a smart network interface controller (Smart NIC). The smart network card includes an embedded switch (embedded switch, eSwitch). The embedded switch is a core component of the smart network card processing message forwarding logic, which is used to accelerate the network processing logic in a specific scenario.

[0084] In this embodiment, the information (or data) obtained by the network card parsing the message is called parsing information. The parsing information is also called metadata, intermediate data or relay data. It is data about data, mainly information describing data properties, and is used to support functions such as indicating storage location, historical data, resource search, and file records.

[0085] Optionally, the aforementioned parsing information includes key information (key), which is relatively important information in the parsing information, and the key information can be used as an index basis for querying the flow table. Exemplarily, the key information includes one or more of the source IP address, source port information, destination IP address, destination port information or transport layer protocol. Optionally, the key information may also include tunnel information and layer 2 information, etc., which are not specifically limited here.

[0086] Optionally, the network card further includes a flow table, in which one or more flow tables are stored. The flow table includes at least one flow, and the flows in the flow table are used to indicate message processing rules, and different flows indicate different message processing rules. In addition, the key information corresponds to some flows in the flow table, so the key information can be used as an index basis for querying the flows in the flow table. Optionally, the flow table is located in the embedded switch.

[0087] Step 203: The network card determines whether the parsed information of the message meets a preset condition.

[0088] The preset condition is that the network card finds a message processing rule related to the parsing information of the message. Since the parsing information of the message comes from the aforementioned message, it can also be understood that the preset condition is that the network card finds a message processing rule related to the message.

[0089] In this embodiment, when the network card determines that the parsed information of the message meets the preset condition, the network card executes step 204 ; when the network card determines that the parsed information of the message does not meet the preset condition, the network card executes step 205 .

[0090] Specifically, the network card uses the parsing information to query the message processing rules stored in the network card. If there is a message processing rule related to the parsing information of the message, the network card determines that the parsing information of the message meets the preset condition.

[0091] In a specific embodiment, the aforementioned network card includes a flow table, the flow in the flow table is used to indicate the message processing rules, and the parsing information includes key information (key). At this time, the network card can query the aforementioned flow table according to the key information. When the flow corresponding to the key information is not found according to the key information, the network card determines that the parsing information of the message does not meet the preset condition. Optionally, if the network card includes an embedded switch, the embedded switch queries the aforementioned flow table according to the key information, and when the flow corresponding to the key information is not found according to the key information, it is determined that the parsing information of the message does not meet the preset condition.

[0092] Step 204: The network card processes the message according to the message processing rule.

[0093] In this embodiment, when the network card determines that the parsed information of the message meets the preset conditions, the network card processes the message according to the message processing rules. It can be understood that the network card just has the ability to process the message, so the network card can directly process the message without the intervention of the virtual machine manager. At this time, the network card will no longer execute the subsequent steps 205 and 206. In practical applications, the path (or method) in which the network card directly processes the message is called a fast data path.

[0094] Optionally, if the network card includes an embedded switch, the embedded switch processes the message according to the aforementioned message processing rule.

[0095] Step 205: The network card sends the parsed information and the message to the virtual machine manager.

[0096] In this embodiment, when the aforementioned network card determines that the parsing information of the message does not meet the preset conditions, it means that the network card does not contain a message processing rule for processing the message, so the virtual machine manager needs to intervene to process the aforementioned message. At this time, since the network card has parsed the message and obtained the parsing information of the message, the network card can send both the parsing information and the message to the virtual machine manager. At this time, after receiving the aforementioned message, the virtual machine manager does not need to parse the message, but directly uses the parsing information of the message sent by the network card to process the message. For the specific processing method, please refer to step 206. In actual applications, the path (or method) by which the network card forwards the message to the virtual machine in the virtual machine manager for processing is called a slow data path.

[0097] In a specific implementation, the network card transmits the parsed information and the message to the virtual machine manager via direct memory access (DMA). Optionally, the virtual machine manager includes a virtual switch (vSwitch), which receives the data from the network card using a packet receiving interface.

[0098] It should also be understood that the situation where the network card fails to find the corresponding flow in the flow table based on the key information is also called a miss. At this time, the process of the network card sending the aforementioned message to the virtual machine manager is also called a miss upcall, that is, the fast path table lookup misses and then sends it to the slow forwarding path.

[0099] Step 206: The virtual machine manager provides the parsed information to multiple message processing modules in the virtual machine manager.

[0100] Among them, the aforementioned message processing module refers to a functional module that can perform corresponding message processing on the message according to the parsed information. Exemplarily, the message processing module can be a layer two security (layer two security, L2-security) module, an access control list (access control list, ACL) module, a forwarding module or an offload module, etc., which are not specifically limited here. It should also be understood that, generally, the aforementioned message processing modules will process the message in series. For example, the aforementioned layer two security module, access control list ACL module and forwarding module process the message respectively in turn.

[0101] In an optional implementation, after receiving the aforementioned parsing information, the virtual machine manager will store the parsing information so that the aforementioned message processing module can obtain the aforementioned parsing information at any time. In this implementation, the virtual machine manager can store the aforementioned parsing information, so each message processing module in the virtual machine manager can obtain the aforementioned parsing information according to the needs of each module. At this time, each message processing module in the virtual machine manager does not need to parse the message, but can directly use the parsing information from the aforementioned network card.

[0102] Specifically, in the process of processing the aforementioned message, the message processing module will obtain the parsing information (including key information) required by the message processing module to process the message. Then, the message processing module uses the aforementioned key information to query the flow table in the message processing module. Exemplarily, the flow table can be a forwarding table or a state processing table. When the message processing module queries the processing rules for processing the message, the message processing module uses the aforementioned parsing information and message processing rules to process the message.

[0103] Exemplarily, the control list ACL module is used as an example for introduction. When the control list ACL module processes the aforementioned message, the control list ACL module obtains the key information required by the control list ACL module in the aforementioned parsing information. Then, the flow table in the control list ACL module is queried according to the aforementioned key information, and the flow table contains processing rules for access control of multiple messages. Then, the control list ACL module processes the aforementioned message according to the aforementioned processing rules for access control.

[0104] In another optional embodiment, the virtual machine manager stores the parsed information in a plurality of data structures by classification, and provides the parsed information in the form of data structures to each message processing module in the virtual machine manager. Each data structure contains a portion of the parsed information, and each of the data structures contains different types of information. The message processing module obtains the information in the one or more data structures according to the need for processing the message to process the message. In this embodiment, in order to facilitate each message processing module in the virtual machine manager to obtain the parsed information required by each message processing module, the virtual machine manager may store the parsed information in a plurality of data structures by classification. It can also be understood that converting the parsed information into a format that can be recognized by the message processing module is conducive to improving the efficiency of each message processing module in obtaining the parsed information to process the message.

[0105] Optionally, the data structure includes indication information, and the indication information is used to indicate the type of parsing information carried by the data structure. Therefore, each message processing module in the virtual machine manager can obtain the content stored in the data structure according to the aforementioned indication information. It can also be understood that the aforementioned message processing module can use the aforementioned indication information to query the parsing information required by the message processing module. Therefore, it is beneficial to improve the efficiency of the message processing module in obtaining parsing information, and further to improve the efficiency of the virtual machine manager in processing messages.

[0106] Optionally, the virtual machine manager includes a virtual parser, which is located in the aforementioned virtual switch. The virtual parser can classify and organize the parsing information from the packet receiving interface. It can be understood that the aforementioned parsing information is converted into information (or data) that is easy for the message processing module to recognize, which is conducive to improving the efficiency of each message processing module in obtaining parsing information to process messages.

[0107] In this embodiment, since the network card can parse the message to obtain the parsing information of the message, and sends the message and the parsing information to the virtual machine manager when a hit is missed, multiple message processing modules in the virtual machine manager can directly process the message according to the parsing information, without the need for each of the modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced, thereby reducing the processing overhead of the CPU on the virtual machine manager side.

[0108] like Figure 3 As shown, it is another embodiment of the message parsing method based on the network card proposed in the present application. The network card and the virtual machine manager in the server will perform the following steps:

[0109] Step 301: The network card receives a message sent by the virtual machine.

[0110] In this embodiment, step 301 is similar to the aforementioned step 201, and please refer to the aforementioned step 201 for details.

[0111] Step 302: The network card sends the message to the virtual machine manager.

[0112] In this embodiment, the network card does not have the parsing capability, or the network card has the parsing capability but the parsing function is not enabled. Therefore, the network card forwards the message to the virtual machine manager for processing.

[0113] Step 303: The virtual machine manager parses the message to obtain parsing information of the message.

[0114] Specifically, the virtual machine manager will perform unified parsing on the message to obtain parsing information of the message.

[0115] Optionally, the virtual machine manager includes a virtual parser, and the virtual parser has a parsing function. The virtual parser parses the message to obtain the aforementioned parsing information.

[0116] Optionally, the aforementioned resolution information includes key information (key), and the key information includes one or more of the source IP address, source port information, destination IP address, destination port information or transport layer protocol.

[0117] Optionally, the aforementioned virtual parser will also query the flow table based on the aforementioned key information to obtain the message processing rules corresponding to the key information.

[0118] Step 304: The virtual machine manager provides the parsed information to multiple message processing modules in the virtual machine manager.

[0119] The message processing module is a functional module that can perform corresponding message processing on the message according to the parsing information. For details, please refer to the relevant introduction in the aforementioned step 206.

[0120] In an optional implementation, after receiving the aforementioned parsing information, the virtual machine manager will store the parsing information so that the aforementioned message processing module can obtain the aforementioned parsing information at any time.

[0121] In another optional implementation, the virtual machine manager stores the parsed information in a plurality of data structures according to classification. Each data structure contains a portion of the parsed information, and each data structure contains different types of information. The message processing module obtains information in the aforementioned one or more data structures according to the need for processing the message to process the message.

[0122] Optionally, the data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

[0123] Optionally, the virtual machine manager includes a virtual parser, which is located in the aforementioned virtual switch. The virtual parser can classify and organize the parsing information from the packet receiving interface, which can be understood as converting the aforementioned parsing information into information (or data) that is easy for the message processing module to identify. Therefore, each message processing module in the virtual machine manager can obtain the parsing information separated and organized by the aforementioned virtual parser according to the needs of each module, without the need to parse and process the message, which is conducive to improving the efficiency of each message processing module in obtaining the parsing information to process the message.

[0124] In this embodiment, the virtual machine manager can uniformly parse the message to obtain the parsing information of the message, and directly provide the parsing information to multiple message processing modules in the virtual machine manager, so that the aforementioned message processing modules can directly process the message according to the aforementioned parsing information, without the need for the aforementioned modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced, thereby reducing the processing overhead of the CPU on the virtual machine manager side.

[0125] The following is an introduction to the above-mentioned network card-based message parsing method in combination with specific scenarios. Figure 4 As shown, it is a networking model for accelerating communication between guest virtual machines through smart network cards in a cloud computing scenario. In this networking model, guest virtual machine 0 (Guest VM0) runs a server application (Server APP) to receive a request message from a client application (Client APP) running in guest virtual machine 1 (Guest VM1). After guest virtual machine 0 processes the request message, the server application will reply a response message to the client application running in guest virtual machine 1.

[0126] Specifically, the Client APP request message of Guest VM1 reaches the embedded switch in the network card through a direct link. The embedded switch parses the request message to obtain the metadata of the request message, and searches the flow table of the embedded switch according to the key in the metadata. Because, in the case of a new flow between the aforementioned client virtual machine 1 and the client virtual machine 0, the flow table in the embedded switch (eSwitch) is not sufficient to support the processing of the aforementioned request message. Therefore, if the flow table is searched based on the key in the metadata of the request message, there will be a high probability that it will not hit. If it misses, the embedded switch will trigger a miss upcall, that is, the virtual function VF module (for example, virtual function VF1 and virtual function VF1') is used to send metadata and packet data (that is, the message) to the virtual switch in the aforementioned virtual machine manager through the uplink channel. The virtual parser in the virtual switch will classify and organize the aforementioned metadata to obtain multiple data structures. Among them, each of the aforementioned multiple data structures stores different metadata. The message processing module in the virtual switch will use the metadata in the aforementioned data structure to process the aforementioned request messages in sequence. Then, the processed messages are sent from the corresponding port to the embedded switch in the network card, and the embedded switch uses the virtual function VF module (for example, virtual function VF0 and virtual function VF0') to transmit the aforementioned processed request messages to the Server APP of Guest VM0 through a direct link. Similarly, after the Server APP of Guest VM0 receives the request message, it sends the request data in the form of a message to the Client APP of GuestVM1 through a similar process. In this way, the accelerated transmission of messages between the two virtual machines is achieved.

[0127] The aforementioned virtual function VF may be a virtual interface or channel for transmitting the aforementioned message. The aforementioned virtual function VF may be implemented by single-root I / O virtualization (SR-IOV) technology or other virtualization technologies, which are not specifically limited here. When the aforementioned virtual function VF is a virtual interface, the virtual interface can implement the same function as the aforementioned physical interface.

[0128] In this embodiment, since the embedded switch in the network card can parse the message to obtain the parsing information (i.e., metadata) of the message, and when a hit is not found, the aforementioned message and parsing information (i.e., metadata) are sent to the virtual switch maintained by the virtual machine manager, and the virtual parser organizes and classifies the aforementioned metadata into multiple data structures, so that multiple message processing modules in the virtual switch can directly use the metadata in the aforementioned data structure to process the message, without the need for the aforementioned modules to parse the message again. Therefore, the number of times the virtual machine manager side parses the message during the message processing process can be reduced, so as to reduce the processing overhead of the CPU on the virtual machine manager side.

[0129] The following is an introduction to the devices involved in the network card-based message parsing method in this application:

[0130] like Figure 5 As shown, a schematic diagram of the structure of a message processing device 50 is provided in an embodiment of the present application. The message processing device 50 may be a physical machine. Figure 2 and Figure 3 In the corresponding method embodiment, the virtual machine manager runs in the aforementioned message processing device 50 .

[0131] The message processing device 50 includes at least one processor 501 and at least one memory 502. It should be understood that: Figure 5 Only one processor 501 and one memory 502 are shown.

[0132] Among them, the processor 501 can be a general-purpose central processing unit (CPU), a microprocessor, a network processor (NP) or an application-specific integrated circuit (application-specific integrated circuit), or one or more integrated circuits for controlling the execution of the program of the present application. The aforementioned processor 501 can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor 501 can refer to one or more devices, circuits and / or processing cores for processing data (such as computer program instructions). In addition, the processor 501 can be a separate semiconductor chip, or it can be integrated into a semiconductor chip together with other circuits. For example, it can form a system-on-a-chip (SoC) with other circuits (such as encoding and decoding circuits, hardware acceleration circuits or various buses and interface circuits), or it can also be integrated into the ASIC as a built-in processor of a special application integrated circuit (ASIC). The ASIC with an integrated processor can be packaged separately or packaged together with other circuits.

[0133] In addition, the aforementioned memory 502 may be a read-only memory (ROM), or other types of static storage devices that can store static information and instructions, or a random access memory (RAM), or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), which is not specifically limited here. The memory 502 may exist independently, but be connected to the aforementioned processor 501. Optionally, the memory 502 may also be integrated with the aforementioned processor 501. For example, integrated into one or more chips.

[0134] In addition, the memory 502 is also used to store program codes for executing the technical solutions of the embodiments of the present application. The aforementioned program codes can be controlled and executed by the processor 501, and the various types of computer program codes executed can also be regarded as drivers of the processor 501. Therefore, the aforementioned processor 501 can run the aforementioned virtual machine manager to provide the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

[0135] In addition, the message processing device 50 also includes a network card (not shown), which can be integrated into the aforementioned processor 501, or can exist independently but be connected to the aforementioned processor 501. The network card is used to receive a message sent by the virtual machine and parse the message to obtain parsing information of the message. Optionally, the network card is also used to send the parsing information and the message to the virtual machine manager when it is determined that the message does not meet the preset condition according to the parsing information.

[0136] Optionally, the message processing device 50 further includes a communication interface 503, and the communication interface 503 is used to communicate with other message processing devices or network devices. Optionally, the aforementioned network card may be an external network card, and the network card is connected to the aforementioned processor 501 via the communication interface 503.

[0137] like Figure 6 As shown, a schematic diagram of the structure of a message processing device 60 is provided in an embodiment of the present application. The message processing device 60 may be a server, a large computing device or a large management device, which is not specifically limited here. Figure 2 and Figure 3 The corresponding method embodiments can be based on Figure 6 The structure of the message processing device 60 is shown.

[0138] The message processing device 60 includes a plurality of functional modules, each of which may be integrated into a processing unit, each of which may exist physically separately, or two or more modules may be integrated into a unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0139] Specifically, the message processing device 60 includes a transceiver module 601 and a processing module 602 .

[0140] The transceiver module 601 is used to receive a message sent by a virtual machine and parse the message to obtain parsing information of the message.

[0141] The processing module 602 is configured to send the parsing information and the message to the virtual machine manager when it is determined that the message does not meet a preset condition according to the parsing information.

[0142] The processing module 602 is further used to provide the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

[0143] In an optional implementation, the processing module 602 is further configured to process the message according to the message processing rule when the parsed information of the message meets the preset condition.

[0144] In another optional implementation, the processing module 602 is further configured to query the flow table according to the key information.

[0145] In another optional implementation, the processing module 602 is further configured to determine that the parsed information of the message does not satisfy the preset condition when a flow corresponding to the key information is not found according to the key information.

[0146] In another optional implementation, the processing module 602 is further used to classify and store the parsed information into a plurality of data structures, each of which contains a portion of the parsed information, and each of which contains different types of information, and the message processing module is used to process the message according to at least one of the data structures. The data structure includes indication information, and the indication information is used to indicate the type of parsed information carried by the data structure.

[0147] In the above embodiment, each functional module in the message processing device 60 can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, each functional module in the message processing device 60 can be implemented in whole or in part in the form of a computer program product. At this time, if each functional module in the message processing device 60 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. For example, as the computer software product is stored in a storage medium, the computer software product includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0149] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A message parsing method based on a network card, characterized in that: include: The network card receives a message and parses the message to obtain parsing information of the message, wherein the message comes from a virtual machine directly connected to the network card; Alternatively, the message comes from a switch connected to the network card; the parsed information includes one or more of a source IP address, source port information, a destination IP address, a destination port information, a transport layer protocol, tunnel information, and layer 2 information; When it is determined that the parsed information of the message does not meet a preset condition, the network card sends the parsed information and the message to the virtual machine manager, and the preset condition is that the network card queries a message processing rule related to the parsed information; The virtual machine manager provides the parsing information to a plurality of message processing modules in the virtual machine manager, wherein the plurality of message processing modules are used to perform corresponding message processing on the message according to the parsing information.

2. The method according to claim 1, characterized in that The method further comprises: When the parsed information of the message meets the preset condition, the network card processes the message according to the message processing rule.

3. The method according to claim 1 or 2, characterized in that: The parsing information includes key information; the network card includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule; The method further comprises: The network card queries the flow table according to the key information; When a flow corresponding to the key information is not found according to the key information, the network card determines that the parsed information of the message does not meet the preset condition.

4. The method according to claim 1 or 2, characterized in that: Before the virtual machine manager provides the parsing information to a plurality of message processing modules in the virtual machine manager, the method further includes: The virtual machine manager stores the parsed information.

5. The method according to claim 1 or 2, characterized in that: Before the virtual machine manager provides the parsing information to a plurality of message processing modules in the virtual machine manager, the method further includes: The virtual machine manager classifies and stores the parsed information into multiple data structures, each of which contains a portion of the parsed information, and each of which contains different types of information. The message processing module is used to process the message according to at least one of the data structures.

6. The method according to claim 5, characterized in that The data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

7. The method according to claim 3, characterized in that The key information includes one or more of a source Internet Protocol IP address, source port information, a destination IP address, destination port information or a transport layer protocol.

8. The method according to claim 1 or 2, characterized in that: The message processing module is any one of a layer 2 security module, an access control list (ACL) module, a forwarding module or an unloading module.

9. A server, characterized in that: include: A network card, used for receiving a message from a virtual machine directly connected to the network card; Alternatively, the message comes from a switch connected to the network card; The network card is further used to parse the message to obtain parsing information of the message, and when it is determined that the parsing information of the message does not meet a preset condition, send the parsing information and the message to the virtual machine manager, wherein the preset condition is that the network card queries a message processing rule related to the parsing information, and the parsing information includes one or more of a source IP address, source port information, a destination IP address, a destination port information, a transport layer protocol, a tunnel information, and a layer 2 information; The virtual machine manager is used to provide the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

10. The server according to claim 9, characterized in that The parsing information includes key information; the network card includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule; The network card is further configured to query the flow table according to the key information, and when a flow corresponding to the key information is not found according to the key information, determine that the parsed information of the message does not meet the preset condition.

11. The server according to claim 9 or 10, characterized in that: The virtual machine manager is also used to classify and store the parsed information into multiple data structures, each of which contains a portion of the parsed information, and each of which contains different types of information. The message processing module is used to process the message according to at least one of the data structures.

12. The server according to claim 11, characterized in that: The data structure includes indication information, where the indication information is used to indicate the type of parsing information carried by the data structure.

13. A message processing device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the method according to any one of claims 1 to 8.

14. A network card, characterized in that: include: A parser, used to obtain a message and parse the message to obtain parsing information of the message, wherein the message comes from a virtual machine directly connected to the network card or a switch connected to the network card, and the parsing information includes one or more of a source IP address, source port information, a destination IP address, a destination port information, a transport layer protocol, a tunnel information, and a layer 2 information; An embedded switch, used for sending the parsing information and the message to a virtual machine manager when it is determined that the parsing information of the message does not meet a preset condition, wherein the preset condition is that the network card queries a message processing rule related to the parsing information, so that the virtual machine manager provides the parsing information to multiple message processing modules in the virtual machine manager, wherein the multiple message processing modules are used to perform corresponding message processing on the message according to the parsing information.

15. The network card according to claim 14, characterized in that: The parsing information includes key information; the embedded switch includes a flow table, the flow table includes at least one flow, and the flow is used to indicate a message processing rule; The embedded switch is further configured to query the flow table according to the key information, and when a flow corresponding to the key information is not found according to the key information, determine that the parsed information of the message does not meet the preset condition.

Citation Information

Patent Citations

  • Method of achieving function of network adapter unloading, network adapter, host system and network device

    CN103139253A

  • Method, apparatus, and system for controlling data transmission

    WO2014023003A1