Message processing method, intelligent network card, control component, storage medium and product
By offloading fragmented packet processing methods using smart network interface cards, the problem of computational resource consumption in fragmented packet processing by forwarding devices is solved, thereby improving forwarding efficiency and performance.
Patent Information
- Application Number
- CN202411068174.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-08-05
AI Technical Summary
When the length of an IP packet exceeds the maximum transmission unit configured in the data link, the virtual machine fragments the IP packet, causing the forwarding device to consume control plane computing resources and affecting packet forwarding efficiency.
By offloading fragmented packet processing methods through smart network interface cards (NICs), the source port number in the outer encapsulation header of fragmented packets is modified and updated, and the judgment and calculation of the encapsulation header are completed on the smart NIC side, reducing the control plane burden of forwarding devices.
It improves the forwarding efficiency of forwarding devices, reduces the probability of packet reassembly failure, and enhances forwarding performance.
Smart Images

Figure CN119052254B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of communications, and particularly to a message processing method, a smart network interface card, a control component, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Currently, when the length of an Internet Protocol (IP) packet exceeds the Maximum Transmission Unit (MTU) configured in the data link, the Virtual Machine (VM) will fragment the IP packet. For example... Figure 1 As shown, IP packet 1 includes UDP data of length 4324, a UDP header of length 8, and an IP header of length 1. The length of this IP packet, 4252, is greater than the MTU length, 1500. Therefore, the VM divides IP packet 1 into three fragments. The first fragment includes UDP data of length 1472, a UDP header of length 8, and an IP header of length 20. One subsequent fragment includes UDP data of length 1480 and an IP header of length 20. Another subsequent fragment includes UDP data of length 1372 and an IP header of length 20. Clearly, except for the first fragment, subsequent fragments do not contain transport layer encapsulation. Furthermore, the forwarding device does not reassemble the fragmented IP packets; they are ultimately reassembled at the destination device.
[0003] It should be noted that, in order to ensure that all fragments of the same message are sent from the same physical port, the control plane of the forwarding device needs to determine and calculate the source port number of the encapsulation header of the fragmented message before forwarding the message, so that the source port number of all fragmented messages must be consistent. This will consume the computing resources of the control plane and affect the forwarding efficiency of the message. Summary of the Invention
[0004] This application provides a message processing method, a smart network interface card (NIC), a control component, a computer-readable storage medium, and a computer program product, and provides a scheme for offloading fragmented messages through a smart NIC.
[0005] In a first aspect, embodiments of this application provide a message processing method applied to a smart network interface card (NIC), the method comprising:
[0006] Obtain the first message; wherein the first message is a message obtained by encapsulating the second message;
[0007] If the first message meets a modification condition, a first parameter matching a type of the first message is determined;
[0008] Based on the first parameter, a source port number in an outer encapsulation header of the first message is modified, and an outer source port number representing encapsulation in an action parameter of a flow table in the intelligent network card corresponding to the first message is updated.
[0009] In a second aspect, an embodiment of the present application provides a message processing method applied to a control component, and the method comprises the following steps:
[0010] Receiving a second message sent by an intelligent network card;
[0011] Encapsulating the second message to obtain the first message, and configuring a source port number in an outer encapsulation header as a second parameter in the process of encapsulating the second message;
[0012] Generating a first flow table matched with the second message; wherein the first flow table indicates that the second parameter is used as the source port number in the outer encapsulation header;
[0013] Sending the first flow table and the first message to the intelligent network card.
[0014] In a third aspect, an embodiment of the present application provides an intelligent network card, and the intelligent network card comprises:
[0015] A first obtaining module is configured to obtain a first message; wherein the first message is a message obtained by encapsulating a second message;
[0016] A first processing module is configured to, if the first message meets a modification condition, determine a first parameter matching a type of the first message;
[0017] The first processing module is further configured to, based on the first parameter, modify a source port number in an outer encapsulation header of the first message, and update an outer source port number representing encapsulation in an action parameter of a flow table in the intelligent network card corresponding to the first message.
[0018] In a fourth aspect, an embodiment of the present application provides a control component, and the control component comprises:
[0019] A second receiving module is configured to receive a second message sent by an intelligent network card;
[0020] A second processing module is configured to encapsulate the second message to obtain the first message, and configure a source port number in an outer encapsulation header as a second parameter in the process of encapsulating the second message;
[0021] The second processing module is further configured to generate a first flow table matched with the second packet; and the first flow table indicates that a second parameter is used as a source port number for encapsulation.
[0022] The second sending module is configured to send the first flow table and the first packet to the intelligent network card.
[0023] In a fifth aspect, an embodiment of the present application provides an intelligent network card, which comprises:
[0024] A first memory is configured to store executable instructions.
[0025] A first processor is configured to execute the executable instructions stored in the first memory, and implement the packet processing method.
[0026] In a sixth aspect, an embodiment of the present application provides a control component, which comprises:
[0027] A second memory is configured to store executable instructions.
[0028] A second processor is configured to execute the executable instructions stored in the second memory, and implement the packet processing method.
[0029] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, configured to store a computer program, and the computer program causes a computer to execute the packet processing method.
[0030] In an eighth aspect, an embodiment of the present application provides a computer program product, comprising computer program instructions, and the computer program instructions cause a computer to execute the packet processing method.
[0031] The present application offloads the judgment, calculation and modification of the source port number of all fragmented packets to the intelligent network card, effectively improves the forwarding efficiency of the forwarding device, and improves the forwarding performance. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 An illustrative diagram of packet fragmentation provided in the related art;
[0033] Figure 2 An illustrative diagram of an encapsulated packet provided in the related art;
[0034] Figure 3 An illustrative diagram of a framework for implementing a fragmented packet processing method provided in the related art Figure 1 ;
[0035] Figure 4 An illustrative diagram of a flow for implementing a fragmented packet processing method provided in the related art Figure 2 ;
[0036] Figure 5 A flowchart of a packet processing method provided by an embodiment of the present application Figure 1 ;
[0037] Figure 6 A flowchart of a packet processing method provided by an embodiment of the present application Figure 2 ;
[0038] Figure 7 A schematic block diagram of an intelligent network card provided by an embodiment of the present application
[0039] Figure 8 A schematic block diagram of a control component provided by an embodiment of the present application
[0040] Figure 9 A schematic structural diagram of a communication device provided by an embodiment of the present application
[0041] Figure 10 A schematic block diagram of a chip provided by an embodiment of the present application DETAILED DESCRIPTION
[0042] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work fall within the scope of protection of the present application.
[0043] The terms “first”, “second”, and the like in the specification and claims of the present application and the above-described drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device.
[0044] In this document, the term “embodiment” means that a specific feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0045] Before explaining the present application in detail, the related art packet processing method is described here:
[0046] When the virtual switch (vSwitch) component encapsulates a cross-node forwarding packet with a virtual extensible local area network (vxlan) tunnel, the outer layer UDP source port number of the vxlan packet encapsulation is calculated by the vSwitch component according to the five-tuple (source / desination IP address, source / desination port number, protocol number) of the inner layer packet by hash. Since the subsequent packet of the fragmented packet does not contain the transport layer encapsulation, whether the first packet or the subsequent packet, the outer layer UDP source port number of the vxlan packet encapsulation is calculated by the vSwitch component according to the three-tuple (source / desination IP address, protocol number) of the inner layer packet by hash.
[0047] Since two physical network ports form a Bond port, when a packet is sent across nodes, the network card will select a physical network port according to the outermost five-tuple of the packet by hash. In order to ensure that all fragments of the same packet are sent from the same physical network port, the vxlan encapsulation UDP source port number of all fragmented packets needs to be consistent.
[0048] Figure 2 is a schematic diagram of an encapsulated packet in the related art; as shown in Figure 2 The original L2 frame (Original L2 Frame) is first encapsulated with a vxlan header (Header) to obtain a vxlan header; then, UDP encapsulation is performed to encapsulate an outer layer (Outer) UDP header on the outer layer of the vxlan header and the Original L2 Frame; then, IP encapsulation is performed to encapsulate an Outer IP Header on the outer layer of the Outer UDP Header; finally, Medium Access Control (MAC) encapsulation is performed to encapsulate an Outer MAC Header on the outer layer of the Outer IP Header; at the same time, a frame check sequence (FCS) is included at the end of the frame.
[0049] The vxlan Header occupies 8 bytes (byte), including an 8-bit vxlan flag field, a 24-bit Reserved field, a 24-bit vxlan Network Identifier (VNL), and an 8-bit Reserved field.
[0050] The Outer UDP Header occupies 8 bytes, and includes a 16-bit source port (Src Port) field, a 16-bit vxlan Port field, a 16-bit UDP length (Length) field, and a 16-bit checksum (Chksum) field.
[0051] The Outer IP Header occupies 20 bytes, and includes a 72-bit IP high data rate miscellaneous data (Hdr Misc Data) field, a 3-bit protocol (Protocol) field, a 16-bit other checksum (Hdr Chksum) field, a 32-bit source IP (Src IP) field, and a 32-bit destination IP (Dst IP) field.
[0052] The Outer MAC Header occupies 14 bytes, and includes a 48-bit destination address (Dct Add) field, a 48-bit source address (Src Add) field, a 16-bit vxlan type (Type) field, a 16-bit virtual local area network identifier (VLAN ID) field, and a 16-bit Ethernet type (Eth Type) field.
[0053] Figure 3 is a framework schematic diagram provided by the related art for implementing a fragmented packet processing method. As shown in Figure 3 After the vSwitch intelligent network card is introduced, for a data packet transmission path (Datapath), since a first packet cannot be queried in a flow table in the intelligent network card fast path, the vSwitch intelligent network card will upcall the first packet to a control plane of a virtual layer, for example, vswitchd. The vswitchd calculates a vxlan source UDP port number, performs vxlan encapsulation, and reinjects the encapsulated data packet to the vSwitch intelligent network card. At the same time, the vswitchd downloads the calculated source udp port number to the vSwitch intelligent network card with a flow table. Subsequent packets are encapsulated by the intelligent network card according to the flow table, and are directly forwarded, and the path does not pass through the vswitchd. The vswitchd can interact with a database of the ovs, that is, ovsdb, to obtain related calculation or encapsulation data. The Megaflow cache or the Microflow cache can be matched through the Flow table.
[0054] Figure 4 is a flow schematic diagram provided by the related art for implementing a fragmented packet processing method. As shown in Figure 4
[0055] In step 401, the intelligent network card receives a packet.
[0056] Step 402, if the packet is the first packet of a fragmented packet and no existing flow table is matched on the network card side, the packet is upcalled to the control plane of the vSwitch, i.e., vSwitch-C, and step 403 is performed. If the packet is a subsequent packet of a fragmented packet, the flow table stored in the intelligent network card side is queried, the packet corresponding flow table is matched, and step 408 is performed.
[0057] Step 403, the vSwitch-C matches the control plane flow table, performs vxlan encapsulation on the packet, and generates the flow table of the forwarding plane to be sent to the intelligent network card.
[0058] Here, the source udp port number of the hash calculation is carried in the flow table of the forwarding plane.
[0059] Step 404, the vSwitch-C judges whether the inner layer is fragmented, if yes, step 405 is performed, otherwise, step 406 is performed.
[0060] Step 405, the outer layer source udp port number is replaced according to the inner layer packet three tuple hash value, the packet with the replaced outer layer source udp port number is re-injected to the intelligent network card, and step 407 is performed.
[0061] In some embodiments, the inner layer packet three tuple hash value is a value calculated by the hash of the three address groups (source / desination IP, protocol number) of the inner layer packet.
[0062] Step 406, the outer layer source udp port number is replaced according to the inner layer packet five tuple hash value, the packet with the replaced outer layer source udp port number is re-injected to the intelligent network card, and step 407 is performed.
[0063] In some embodiments, the inner layer packet five tuple hash value is a value calculated by the hash of the five address groups (source / desination IP, source / desination port number, protocol number) of the inner layer packet.
[0064] Step 407, the intelligent network card sends the packet according to the outermost five tuple hash value of the packet.
[0065] Step 408, the intelligent network card encapsulates the packet according to the flow table action, and performs step 407.
[0066] Figure 5 A flowchart of a packet processing method provided by an embodiment of the present application is shown in FIG. 1, the method is applied to an intelligent network card, and the method comprises the following steps. Figure 5
[0067] Step 501, a first packet is acquired.
[0068] The first packet is a packet obtained by encapsulating the second packet.
[0069] In the embodiments of the present application, the first packet is also referred to as a first data packet, and the second packet is also referred to as a second data packet; if the second packet is a fragmented packet, the source port number in the outer header of the first packet is configured as a default value, for example, 0, that is, the source port number in the outer header of the packet is configured as a fixed value, and then, in the case of forwarding the packet by the forwarding device, if the fixed value is detected, it can be determined that it is a forwarding packet, and then the forwarding device controls the source port number of all fragmented packets to be consistent, so that all fragments of the same packet are sent from the same physical network port; and further, the probability of failure of the destination device to reassemble the packet is reduced.
[0070] In step 502, if the first packet meets the modification condition, a first parameter matching the type of the first packet is determined.
[0071] In the embodiments of the present application, the first packet meets the modification condition means that the parameter of the packet header of the first packet needs to be modified, for example, if the source port number of the outer encapsulation header of the first packet is the second parameter, for example, 0, and the type of the first packet is the first type, here, the first type means that the egress port of the first packet is a preset port, for example, a Bond port, and also means that the first packet is a fragmented packet, it is determined that the first packet meets the modification condition. It should be noted that the determination method of determining whether the first packet meets the modification condition can be determined according to actual conditions, and the present application does not make specific limitations.
[0072] In the embodiments of the present application, the first packet does not meet the modification condition means that the parameter of the packet header of the first packet does not need to be modified. Then, if the first packet does not meet the modification condition, the forwarding device directly forwards the first packet. For example, if the source port number of the outer encapsulation header of the first packet is the first parameter, it is determined that the first packet does not meet the modification condition, and the first packet is directly forwarded.
[0073] In the embodiments of the present application, if the type of the first packet is the first type corresponding to the fragmented packet, the first parameter is determined based on the source IP address, the destination IP address and the protocol number of the first packet.
[0074] For example, the source IP address, the destination IP address and the protocol number of the first packet are subjected to hash calculation, and the result of the hash calculation is taken as the first parameter.
[0075] For example, the source IP address, the destination IP address and the protocol number of the encrypted first packet are subjected to hash processing, and then the result of the hash calculation is taken as the first parameter.
[0076] In the embodiments of the present application, if the first message type is a second type corresponding to a non-fragment message, the first parameter is determined based on the source IP address, destination IP address, source port number, destination port number and protocol number of the first message.
[0077] For example, the source IP address, destination IP address, source port number, destination port number and protocol number of the first message are subjected to hash calculation, and the result of the hash calculation is taken as the first parameter.
[0078] For example, the source IP address, destination IP address, source port number, destination port number and protocol number of the encrypted first message are subjected to hash processing, and then the result of the hash calculation is taken as the first parameter.
[0079] In step 503, the source port number in the outer encapsulation header of the first message is modified based on the first parameter, and the outer source port number representing encapsulation in the action parameter of the flow table in the intelligent network card corresponding to the first message is updated.
[0080] In the method provided in the embodiments of the present application, an intelligent network card acquires a first message; wherein the first message is a message obtained by encapsulating a second message; if the first message satisfies a modification condition, a first parameter matching the type of the first message is determined; and the source port number in the outer encapsulation header of the first message is modified based on the first parameter, and the outer source port number representing encapsulation in the action parameter of the flow table in the intelligent network card corresponding to the first message is updated. That is, the present application offloads the judgment, calculation and modification of the source port number of all encapsulated fragment messages to the intelligent network card side, effectively improving the forwarding efficiency and performance of the forwarding device.
[0081] In some embodiments, the method provided in the embodiments of the present application includes the following contents:
[0082] In step A1, an intelligent network card encapsulates a second message.
[0083] In step A2, if the intelligent network card stores a first flow table matching the second message, the intelligent network card acquires a second parameter from the first flow table.
[0084] Here, the second parameter can be used as a basis for judging whether the second message is a fragment message, that is, based on the second parameter, whether the source port number in the outer encapsulation header of the first message is configured as the first parameter.
[0085] In step A3, the second message is encapsulated based on the action in the flow table to obtain a first message.
[0086] In step A4, if the first message satisfies a modification condition, the intelligent network card determines a first parameter matching the type of the first message.
[0087] Step A5, the intelligent network card modifies the source port number in the outer encapsulation header of the first message based on the first parameter, and updates the action parameter of the flow table in the intelligent network card corresponding to the first message to represent the outer source port number of encapsulation.
[0088] Here, if the second message is a fragmented message, the source port number in the outer header is configured as the second parameter in the encapsulation process. At this time, the source port number of the outer encapsulation header of the first message is the second parameter. Further, the intelligent network card further judges and modifies, that is, if the source port number of the outer encapsulation header of the first message is the second parameter, and the type of the first message is the first type, here, the first type refers to that the egress port of the first message is a Bond port, and also refers to that the first message is a fragmented message, it is determined that the first message satisfies the modification condition, then the first parameter matching the type of the first message is determined; based on the first parameter, the source port number in the outer encapsulation header of the first message is modified, and the action parameter of the flow table in the intelligent network card corresponding to the first message is updated to represent the outer source port number of encapsulation.
[0089] Here, if the second message is a fragmented message, the source port number in the outer header is directly configured as the first parameter in the encapsulation process. At this time, the source port number of the outer encapsulation header of the first message is the first parameter. Subsequently, the intelligent network card does not need to modify the source port number in the outer encapsulation header of the first message, and update the action parameter of the flow table in the intelligent network card corresponding to the first message to represent the outer source port number of encapsulation, and can directly forward the first message.
[0090] Here, if the second message is a non-fragmented message, the source port number in the outer header is configured as the first parameter in the encapsulation process. At this time, the source port number of the outer encapsulation header of the first message is the first parameter. Subsequently, the intelligent network card does not need to modify the source port number in the outer encapsulation header of the first message, and update the action parameter of the flow table in the intelligent network card corresponding to the first message to represent the outer source port number of encapsulation, and can directly forward the first message.
[0091] In some embodiments, the method provided by the embodiments of the present application includes the following contents:
[0092] Step B1, the intelligent network card receives a second message.
[0093] Step B2, if the intelligent network card does not include a first flow table matching the second message, the intelligent network card sends the second message to a control component.
[0094] In the embodiments of the present application, the intelligent network card does not include a first flow table matching the second message, including the following scenarios: the first message is in the first packet of a data flow, or the first message is in the first several packets for generating a flow table of a control plane, or the existing flow table of the forwarding device does not match the flow table corresponding to the first message.
[0095] Step B3, the control component receives the second packet sent by the intelligent network card.
[0096] Step B4, the control component encapsulates the second packet to obtain the first packet, and configures the source port number in the outer encapsulation header as the second parameter in the process of encapsulating the second packet.
[0097] Step B5, the control component generates the first flow table matched with the second packet.
[0098] In the first flow table, the second parameter is indicated as the source port number in the outer encapsulation header.
[0099] Step B6, the control component sends the first flow table and the first packet to the intelligent network card.
[0100] Step B7, the intelligent network card receives the first packet and the first flow table sent by the control component.
[0101] Step B8, if the first packet meets the modification condition, the intelligent network card determines the first parameter matched with the type of the first packet.
[0102] Step B9, the intelligent network card modifies the source port number in the outer encapsulation header of the first packet based on the first parameter, and updates the action parameter of the flow table in the intelligent network card corresponding to the first packet to represent the outer source port number of encapsulation.
[0103] In the following, the technical scheme of the application embodiment for offloading the fragmented packet by the intelligent network card in an actual application scenario will be described.
[0104] Figure 6 is a flow diagram of a packet processing method provided by the application embodiment. As shown in Figure 6 ,
[0105] Step 601, the intelligent network card receives the packet, if the packet is the first packet of the fragmented packet and no existing flow table is matched on the network card side, the packet is upcalled to the control plane of the vSwitch, i.e. vSwitch-C, and step 603 is executed. If the packet is the subsequent packet of the fragmented packet, i.e. there is a flow table that can be matched in the intelligent network card, the forwarding plane flow table stored in the intelligent network card is queried, the flow table corresponding to the packet is matched, and step 607 is executed.
[0106] Here, the first packet refers to the packet received by the intelligent network card, which is the first packet of the data stream or the first several packets used for generating the flow table of the control plane.
[0107] Step 602, the vSwitch control plane parses the message type, queries the control plane flow table, and encapsulates the data packet with vxlan, wherein the source UDP port number in the outer vxlan header is configured as a default value 0; a forwarding plane flow table is generated and delivered to the intelligent network card, wherein the source UDP port number of the vxlan encapsulation is the default value 0, further, the vSwitch-C sends a reinject message to the intelligent network card, and the intelligent network card receives the vSwitch-C reinject message and executes step 603.
[0108] Step 603, by identifying that the source UDP port number of the vxlan encapsulation is 0 and the out port is the Bond port, it is judged whether to modify the source UDP port number of the message header and whether to update the source UDP port number of the vxlan encapsulation in the corresponding flow table action, if yes, step 604 is executed; otherwise, step 606 is executed.
[0109] Step 604, the intelligent network card judges whether the inner layer of the message is a fragmentation message, if yes, the inner layer message "source IP address, destination IP address, protocol number" is used as a parameter for hash calculation to obtain the outer layer source UDP port number; if not, the five-tuple of the inner layer message is used as a parameter for hash calculation to obtain the outer layer source UDP port number.
[0110] Step 605, the intelligent network card modifies the outer layer source UDP port number of the message and modifies the outer layer source UDP port number of the vxlan encapsulation in the flow table action.
[0111] Step 606, the physical port forwards the message.
[0112] Exemplarily, the physical network port can be selected according to the outer layer five-tuple hash to send the message.
[0113] Step 607, the intelligent network card encapsulates the message according to the flow table action, and further, step 603 is executed.
[0114] It should be noted that if step 605 is not completed when step 606 is executed, step 603 judges yes, and steps 604, 605 and 606 are repeated; if step 605 is completed, step 603 judges no, and the message is forwarded according to step 606.
[0115] Embodiments of the present application provide an intelligent network card which can be used to implement Figure 4 The processing method of the message provided by the corresponding embodiments is described with reference to Figure 7 As shown in the figure, the intelligent network card 700 includes:
[0116] The first obtaining module 701 is configured to obtain a first packet; wherein the first packet is a packet obtained by encapsulating a second packet;
[0117] The first processing module 702 is configured to determine a first parameter matching a type of the first packet if the first packet meets a modification condition.
[0118] The first processing module 702 is configured to modify a source port number in an outer encapsulation header of the first packet and update an action parameter of a flow table in an intelligent network card corresponding to the first packet, which represents an encapsulated outer source port number, based on the first parameter.
[0119] In other embodiments of the present application, the first processing module 702 is configured to directly forward the first packet if the source port number in the outer encapsulation header of the first packet is the first parameter.
[0120] The first processing module 702 is configured to determine that the first packet meets the modification condition if the source port number in the outer encapsulation header of the first packet is the second parameter and the type of the first packet is the first type.
[0121] In other embodiments of the present application, the first receiving module 703 is configured to receive the second packet.
[0122] The first processing module 702 is configured to obtain the second parameter from a first flow table matching the second packet in the intelligent network card if the first flow table is stored in the intelligent network card.
[0123] The first processing module 702 is configured to encapsulate the second packet based on an action in the flow table to obtain the first packet.
[0124] In other embodiments of the present application, the first sending module 704 is configured to send the second packet to a control component if the first flow table matching the second packet is not included in the intelligent network card.
[0125] The first receiving module 703 is configured to receive the first packet and the first flow table sent by the control component; wherein the first flow table indicates that the second parameter is used as the encapsulated source port number.
[0126] In other embodiments of the present application, the first processing module 702 is configured to determine that the type of the first packet is a first type corresponding to a fragmented packet, and determine the first parameter based on a source Internet Protocol address, a destination Internet Protocol address and a protocol number of the first packet.
[0127] In other embodiments of the present application, the first processing module 702 is configured to determine that the type of the first packet is a second type corresponding to a non-fragmented packet, and determine the first parameter based on a source Internet Protocol address, a destination Internet Protocol address, a source port number, a destination port number and a protocol number of the first packet.
[0128] In other embodiments of the present application, the first processing module 702 is configured to determine whether to configure the source port number in the outer encapsulation header of the first message as the first parameter based on the second parameter.
[0129] The above device embodiments are similar to the above method embodiments in description, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0130] It should be noted that, in the embodiments of the present application, if the message processing method described above is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an end device to execute all or part of the method embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, magnetic disk or optical disk, and various storage media that can store program codes. Thus, the embodiments of the present application are not limited to any specific hardware and software combination.
[0131] The embodiments of the present application provide a control component which can be used to implement Figure 5 The processing method of the message provided by the corresponding embodiments is described with reference to Figure 8 The control component 800 includes:
[0132] The second receiving module 801 is configured to receive the second message sent by the intelligent network card.
[0133] The second processing module 802 is configured to encapsulate the second message to obtain the first message, and configure the source port number in the outer encapsulation header as the second parameter in the process of encapsulating the second message.
[0134] The second processing module 802 is configured to generate a first flow table matched with the second message; and the first flow table indicates that the second parameter is used as the source port number in the outer encapsulation header.
[0135] The second sending module 803 is configured to send the first flow table and the first message to the intelligent network card.
[0136] The above device embodiments are similar to the above method embodiments in description, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0137] It should be noted that, in the embodiments of the present application, if the message processing method described above is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a network device to execute all or part of the methods of the embodiments of the present application. The storage medium described above includes: a U disk, a mobile hard disk, a ROM, a magnetic disk or an optical disk, and various media that can store program codes. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0138] Figure 9 is a schematic structural diagram of a communication device 900 provided by an embodiment of the present application. The communication device can be a smart network card or a control component. Figure 9 The communication device 900 shown includes a first processor 910, which can call and run a computer program from a memory to implement the method in the embodiments of the present application.
[0139] Optionally, as shown in Figure 9 The communication device 900 can also include a first memory 920. The first processor 910 can call and run a computer program from the first memory 920 to implement the method in the embodiments of the present application.
[0140] The first memory 920 can be a separate device independent of the first processor 910, or can be integrated in the first processor 910.
[0141] Optionally, as shown in Figure 9 The communication device 900 can also include a transceiver 930, and the first processor 910 can control the transceiver 930 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices.
[0142] The transceiver 930 can include a transmitter and a receiver. The transceiver 930 can further include an antenna, and the number of antennas can be one or more.
[0143] Optionally, the communication device 900 can be a smart network card of the embodiments of the present application, and the communication device 900 can implement the corresponding processes of the smart network card in the various methods of the embodiments of the present application. For the sake of brevity, it will not be repeated here.
[0144] Optionally, the communication device 900 can be specifically a control component of the embodiments of the present application, and the communication device 900 can implement corresponding procedures in the various methods of the embodiments of the present application that are implemented by the control component. For brevity, details are not described herein.
[0145] Figure 10 is a schematic structural diagram of a chip of the embodiments of the present application. Figure 10 The chip 1000 shown includes a second processor 1010, which can call and run a computer program from a memory to implement the method in the embodiments of the present application.
[0146] Optionally, as shown in Figure 10 The chip 1000 can also include a second memory 1020. The second processor 1010 can call and run a computer program from the second memory 1020 to implement the method in the embodiments of the present application.
[0147] The second memory 1020 can be a separate device independent of the second processor 1010, or can be integrated in the second processor 1010.
[0148] Optionally, the chip 1000 can also include an input interface 1030. The second processor 1010 can control the input interface 1030 to communicate with other devices or chips, and specifically, can obtain information or data sent by other devices or chips.
[0149] Optionally, the chip 1000 can also include an output interface 1040. The second processor 1010 can control the output interface 1040 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
[0150] Optionally, the chip can be applied to the smart network card in the embodiments of the present application, and the chip can implement corresponding procedures in the various methods of the embodiments of the present application that are implemented by the smart network card. For brevity, details are not described herein.
[0151] Optionally, the chip can be applied to the control component in the embodiments of the present application, and the chip can implement corresponding procedures in the various methods of the embodiments of the present application that are implemented by the control component. For brevity, details are not described herein.
[0152] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.
[0153] It should be understood that the processor of the embodiments of the present application can be an integrated circuit chip having a signal processing capability. In the implementation process, each step of the method embodiments described above can be completed by the integrated logic circuit or the instruction in the form of software in the processor. The processor described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.
[0154] As an embodiment, the processor can include one or more general central processing units (CPUs). Each of the processors can be a single-CPU processor or a multi-CPU processor. The processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer execution instructions).
[0155] It is to be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM) and direct Rambus RAM (DR RAM). It should be noted that the memory of the system and method described herein is intended to include, but not limited to, these and any other suitable types of memory.
[0156] It should be understood that the above-mentioned memory is exemplary but not limiting, for example, the memory in the embodiments of the present application can also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM) and direct Rambus RAM (DR RAM) and the like. That is, the memory in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0157] The embodiments of the present application also provide a computer readable storage medium for storing a computer program.
[0158] The computer readable storage medium can be applied to the intelligent network card in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes realized by the intelligent network card in the various methods of the embodiments of the present application. For the sake of brevity, details are not repeated here.
[0159] The computer readable storage medium can be applied to the control component in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes realized by the control component in the various methods of the embodiments of the present application. For the sake of brevity, details are not repeated here.
[0160] The embodiments of the present application also provide a computer program product, which includes a computer program executable by the processor of the communication device 900 or the chip 1000 to complete the steps of any of the preceding methods.
[0161] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program product.
[0162] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that the computer can store or the data storage device such as server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD) or semiconductor media (such as solid state disk (SSD)) and the like.
[0163] The processing method of the packet, the intelligent network card, the control component, the computer readable storage medium and the computer program product provided by the embodiments of the present application are described in detail, and the principles and implementation manners of the present application are described by using specific examples. The above embodiment description is only used to help understand the method and core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed; and the content of the specification should not be understood as a limitation of the present application.
[0164] It should be understood that the "one embodiment" or "an embodiment" or "the present embodiment" or "the foregoing embodiment" or "some embodiments" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "the present embodiment" or "the foregoing embodiment" or "some embodiments" or "some embodiments" appearing throughout the specification does not necessarily mean the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the execution order, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The sequence number of the above embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.
[0165] Unless otherwise specified, the intelligent network card / control component executes any step in the embodiments of the present application, which can be the processor of the intelligent network card / control component executing the step. Unless otherwise specified, the embodiments of the present application do not limit the order of the steps executed by the intelligent network card / control component. In addition, the way of processing data in different embodiments can be the same method or different method.
[0166] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or in other forms.
[0167] The units described as separate components above can or can not be physically separate, and the components shown as units can or can not be physical units; they can be located in one place or distributed on multiple network units; and part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0168] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be realized in the form of hardware, or in the form of hardware plus software functional units.
[0169] The methods disclosed in the several method embodiments of the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0170] The features disclosed in the several product embodiments of the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0171] The features disclosed in the several method or device embodiments of the present application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
[0172] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by a program instructing related hardware, the aforementioned program can be stored in a computer storage medium, and the program executes the steps including the above-mentioned method embodiments when executed; and the aforementioned storage medium includes mobile storage devices, ROM, magnetic discs or optical discs, and various storage medium that can store program codes.
[0173] Alternatively, the integrated units of the present application, if implemented in the form of software functional modules and sold or used as independent products, can also be stored in a computer storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. The aforementioned storage medium includes mobile storage devices, ROM, magnetic discs or optical discs, and various storage medium that can store program codes.
[0174] The singular forms "a", "an" and "the" used in the embodiments of the present application and the appended claims are intended to include the plural forms, unless the context clearly indicates otherwise.
[0175] It should be noted that in each of the embodiments involved in the present application, all steps can be performed or part of the steps can be performed, as long as a complete technical solution can be formed.
[0176] The above is only an embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A message processing method, characterized in that, Applied to smart network interface cards, the method includes: Receive the second message; If the smart network interface card stores a first flow table that matches the second packet, the second parameter is obtained from the first flow table; the second packet is encapsulated based on the action in the flow table to obtain a first packet; wherein, the first packet is a packet obtained by encapsulating the second packet; If the smart network interface card does not contain a first flow table that matches the second message, the second message is sent to the control component; the first message and the first flow table sent by the control component are received; wherein, the first flow table indicates the source port number encapsulated using the second parameter; If the first message meets the modification conditions, determine the first parameter that matches the type of the first message; Based on the first parameter, modify the source port number in the outer encapsulation header of the first packet, and update the outer source port number in the action parameters of the flow table in the smart network interface card corresponding to the first packet, which represents the encapsulation.
2. The method according to claim 1, characterized in that, The method further includes: If the source port number of the outer encapsulation header of the first message is the first parameter, the first message is forwarded directly; If the source port number of the outer encapsulation header of the first message is the second parameter, and the type of the first message is the first type, then the first message is determined to meet the modification conditions.
3. The method according to claim 1, characterized in that, The first parameter for determining the type matching the first message includes: If the first message is of the first type corresponding to a fragmented message, the first parameter is determined based on the source Internet Protocol address, destination Internet Protocol address, and protocol number of the first message.
4. The method according to claim 1, characterized in that, The method further includes: If the first message type is the second type corresponding to a non-fragmented message, the first parameter is determined based on the source Internet Protocol address, destination Internet Protocol address, source port number, destination port number, and protocol number of the first message.
5. The method according to claim 1, characterized in that, The method further includes: Based on the second parameter, determine whether to configure the source port number in the outer encapsulation header of the first message as the first parameter.
6. A method for processing messages, characterized in that, Applied to a control component, the method includes: Receive the second message sent by the smart network card; The second message is encapsulated to obtain the first message, and during the encapsulation of the second message, the source port number in the outer encapsulation header is configured as the second parameter; Generate a first flow table matching the second message; wherein the first flow table indicates that the second parameter is used as the source port number in the outer encapsulation header; The first flow table and the first packet are sent to the smart network interface card (NIC). If the first packet meets the modification conditions, the smart NIC determines a first parameter that matches the type of the first packet, and based on the first parameter, modifies the source port number in the outer encapsulation header of the first packet, and updates the outer source port number in the action parameters of the flow table in the smart NIC corresponding to the first packet, which represents the encapsulation.
7. A smart network interface card, characterized in that, The smart network interface card includes: The first receiving module is used to receive the second message; The first processing module is further configured to, if the smart network card stores a first flow table that matches the second packet, obtain a second parameter from the first flow table; encapsulate the second packet based on the action in the flow table to obtain a first packet; wherein the first packet is a packet obtained by encapsulating the second packet; The first sending module is further configured to send the second message to the control component if the smart network card does not contain a first flow table that matches the second message; The first receiving module is further configured to receive the first message and the first flow table sent by the control component; wherein, the first flow table indicates the source port number encapsulated using the second parameter; The first processing module is further configured to determine a first parameter that matches the type of the first message if the first message meets the modification conditions; The first processing module is further configured to modify the source port number in the outer encapsulation header of the first packet based on the first parameter, and update the outer source port number in the action parameters of the flow table in the smart network interface card corresponding to the first packet, which represents the encapsulation.
8. A control component, characterized in that, The control component includes: The second receiving module is used to receive the second message sent by the smart network card; The second processing module is used to encapsulate the second message to obtain the first message, and during the encapsulation process of the second message, the source port number in the outer encapsulation header is configured as the second parameter; The second processing module is further configured to generate a first flow table matching the second message; wherein the first flow table indicates the source port number encapsulated using the second parameter; The second sending module is used to send the first flow table and the first packet to the smart network interface card (NIC). If the first packet meets the modification conditions, the smart NIC determines a first parameter that matches the type of the first packet, and based on the first parameter, modifies the source port number in the outer encapsulation header of the first packet, and updates the outer source port number representing the encapsulation in the action parameters of the flow table in the smart NIC corresponding to the first packet.
9. A smart network interface card, characterized in that, The smart network interface card includes: The first memory is used to store executable instructions; The first processor, when executing executable instructions stored in the first memory, implements the message processing method according to any one of claims 1 to 5.
10. A control component, characterized in that, The control component includes: The second memory is used to store executable instructions; The second processor, when executing executable instructions stored in the second memory, implements the message processing method of claim 6.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the message processing method of any one of claims 1 to 5, or the message processing method of claim 6.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the message processing method of any one of claims 1 to 5, or the message processing method of claim 6.
Citation Information
Patent Citations
Packet message processing method and device
CN101018206A
Message processing method and equipment
CN104348716A