Message processing method, device and terminal equipment

By using the mapping table and flow table in the network card to query the processing operation sequence of fragmented messages and the virtual host to determine the fragmenting order, the problems of resource waste and low message processing capability in the existing technology are solved, and efficient data forwarding is achieved. and processing.

CN112311692BActive Publication Date: 2024-09-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910704773.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-31
Publication Date
2024-09-27
Estimated Expiration
2039-07-31

AI Technical Summary

Technical Problem

When existing end devices process fragmented packets, resources are wasted seriously, resulting in reduced packet processing capabilities. The network card needs to send a large number of fragmented packets to OVS for processing, and the client needs to reorganize the fragmented packets, resulting in a waste of resources. .

Method used

By using the mapping table and flow table in the network card, query and execute the processing operation sequence corresponding to the packet identifier carried in the fragmented packet, reducing dependence on OVS, improving data forwarding efficiency, and determining the order of fragmented packets through the virtual host , the client does not need to be reorganized.

Benefits of technology

It reduces resource waste, improves message processing capabilities and data forwarding efficiency, and reduces the client's processing load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112311692B
    Figure CN112311692B
Patent Text Reader

Abstract

The present application discloses a message processing method, device and terminal equipment, belonging to the field of computer. The method includes: receiving multiple first fragment messages, wherein the multiple first fragment messages all carry first-class message identifiers, the first-class message identifiers include message IDs, and the message IDs carried by at least two of the multiple first fragment messages are the same; querying the first-class message identifiers carried by multiple first fragment messages in the message identifier set; wherein the first-class message identifiers carried by any fragment message in at least one fragment message all have corresponding processing operation sequences, and the corresponding processing operation sequence of the first-class message identifier carried by any fragment message includes: some or all processing operations performed by OVS on any fragment message; when the first-class message identifier is queried, the processing operations in the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message are sequentially executed on the first fragment message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the computer field, and in particular to a message processing method and device, and a terminal device. Background Art

[0002] When an end device sends a message to another end device through a transmission link, if the payload length of the message exceeds the maximum transmission unit (MTU) of the transmission link, the end device sending the message needs to fragment the message into multiple fragmented messages with a length less than the MTU and transmit these fragmented messages on the transmission link.

[0003] The current end device includes: a client, an open virtual switch (open vswitch, OVS) and a network card. The network card stores the message identifier carried by the fragmented message and the processing operation sequence corresponding to the message identifier. Among them, the message identifier carried by the fragmented message includes transport layer information. When the end device forwards data, after the network card receives the fragmented message, it queries the message identifier carried by the fragmented message. If the message identifier is queried, the network card performs the processing operation in the processing operation sequence corresponding to its message identifier on the fragmented message; if the message identifier is not queried, the network card sends the fragmented message to OVS so that the OVS processes the fragmented message. When the end device receives the fragmented message, the network card sends the received fragmented message directly to the client, and the client reassembles the received fragmented message to obtain a complete message.

[0004] However, this will cause a waste of resources on the end device and reduce the message processing capability of the end device. For example, since only the first fragment message in the message carries the message identifier, the network card needs to send a large number of fragment messages to OVS for processing, resulting in a waste of OVS resources. For another example, since the client needs to reassemble the received fragment messages, it causes a waste of client resources. Summary of the invention

[0005] The present application provides a message processing method, which can solve the problem of waste of terminal equipment resources in the related technology to a certain extent. The technical solution is as follows:

[0006] In a first aspect, a message processing method is provided, which is applied to a network card in a terminal device, and the method includes:

[0007] Receive multiple first fragment messages, wherein the multiple first fragment messages all carry the first-category message identifier, the first-category message identifier includes a message ID, and at least two of the multiple first fragment messages carry the same message ID; query the first-category message identifier carried by the first fragment message in a message identifier set; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first-category message identifier carried by at least one fragment message processed by the OVS in the terminal device, and the first-category message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first-category message identifier carried by any fragment message includes: part or all of the processing operations performed by the OVS on the any fragment message; when the first-category message identifier carried by the first fragment message is queried, the processing operations in the processing operation sequence corresponding to the first-category message identifier carried by the first fragment message are sequentially performed on the first fragment message.

[0008] In the embodiment of the present application, taking into account that the actual processing operations of multiple fragment messages of the same message on the forwarding plane are the same, the first-class message identifier carried by any fragment message in at least one fragment message in the message identifier set has a corresponding processing operation sequence. As a result, when the network card finds the first-class message identifier corresponding to the first message fragment in the message identifier set summary, it can sequentially perform the processing operations in the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message on the first message fragment. And because each fragment message in any message carries the first-class message identifier, the network card can perform the processing operations in the processing operation sequence corresponding to the first-class message identifier carried by the fragment message on each fragment message in any message summary, without uploading a large number of fragment messages to OVS for processing, thereby improving data forwarding efficiency.

[0009] Optionally, the first type of message identifier also includes: destination Internet Protocol address IP and source IP.

[0010] In an embodiment of the present application, the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier are reflected by the mapping table and the flow table stored in the network card. Then, the querying of the first-class message identifier carried by the first fragment message in the message identifier set includes: querying the first-class message identifier carried by the first fragment message in the mapping table, the mapping table is used to record: the correspondence between the first-class message identifier in the message identifier set and the flow table entry of the flow table, and the flow table is used to record: the correspondence between the flow table entry of the flow table and the processing operation sequence corresponding to the first-class message identifier carried by any fragment message.

[0011] It should be noted that the above flow table can also be used to record the flow table entries, processing operation sequences and the corresponding relationship between the second-class message identifiers. In the embodiment of the present application, the first fragment message in any message carries the second-class message identifier, and the non-first fragment message in any message does not carry the second-class message identifier. Among them, the second-class message identifier may include: the subnet identifier and five-tuple information (source IP address, destination IP address, protocol type, source port and destination port) of the message

[0012] Since in the related technology, the message identifier and its processing operation sequence recorded in the normalized flow table are the same as the second type of message identifier and processing operation sequence of the flow table in the embodiment of the present application, the first type of message identifier carried by the first fragment message in the related technology and the processing operation sequence corresponding to the first type of message identifier can be reused in the embodiment of the present application, thereby more effectively improving the utilization rate of the corresponding relationship.

[0013] By way of example, when a first-class message identifier carried by a first fragmented message is reflected through a mapping table and a flow table stored in a network card, before sequentially executing processing operations in a processing operation sequence corresponding to the first-class message identifier carried by the first fragmented message on the first fragmented message, the method further includes: determining a first flow table entry corresponding to the first-class message identifier carried by the first fragmented message according to the mapping table; querying the first flow table entry in the flow table; when the first flow table entry is queried in the flow table, determining a processing operation sequence corresponding to the first flow table entry according to the flow table; and using the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first-class message identifier carried by the first fragmented message.

[0014] Optionally, the method also includes: when the first type of message identifier carried by the first fragment message is not queried, sending the first fragment message to the OVS in the end device, so that the OVS performs one or more processing operations on the first fragment message, and when the first fragment message is the first fragment message in the message to which the first fragment message belongs, sending the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier to the network card, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; receiving the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier sent by the OVS; and adding the first type of message identifier carried by the first fragment message to the message identifier set.

[0015] There may be multiple situations where the first type of message identifier carried by the first fragment message is not found. For example, when the message identifier set is an empty set, the network card cannot find the first type of message identifier carried by the first fragment message. Alternatively, when the message identifier set is a non-empty set, the message identifier set does not include the first type of message identifier.

[0016] When receiving the first fragment message, the OVS can determine whether the first fragment message is the first fragment message. For example, it can be determined whether the first fragment message is the first fragment message based on the information contained in the header of the first fragment message. When it is determined that the first fragment message is the first fragment message in the message to which it belongs, when the OVS performs one or more processing operations on the first fragment message, the OVS can track and record the one or more processing operations, and then generate the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier according to the first fragment message corresponding to the one or more processing operations.

[0017] In this way, when a mapping table and a flow table are used to reflect the first-class message identifier carried by the first fragmented message, and the processing operation sequence corresponding to the first-class message identifier, and the flow table records the correspondence between the flow table items, the processing operation sequence, and the second-class message identifier, since the flow table is the same as the normalized flow table in the related technology in the related technology, the network card can make full use of the flow table to directly process more fragmented messages quickly, thereby improving the utilization efficiency of the flow table.

[0018] Furthermore, in the embodiment of the present application, since the network card only needs to perform one jump from the mapping table to the flow table to obtain the processing operations required to be performed on multiple fragment messages to which the first fragment message belongs, compared with the related art, which may require multiple item table jumps, the query process of the processing operation is simplified. And since the processing operation sequence in the flow table can include part of the processing operations in one or more processing operations determined in the related art, the processing operation on the first fragment message is also simplified.

[0019] In a second aspect, a message processing method is provided, which is applied to a machine OVS in a terminal device, and the method includes:

[0020] Receive the first fragment message sent by the network card in the terminal device; perform one or more processing operations on the first fragment message; when the first fragment message is the first fragment message in the message to which the first fragment message belongs, generate a first-class message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-class message identifier, each fragment message in any message carries the first-class message identifier, and the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message includes: part or all of the one or more processing operations; among the multiple first fragment messages carrying the first-class message identifier, at least two first fragment messages carry the same message ID, the first-class message identifier includes a message ID, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; send the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier to the network card.

[0021] When receiving the first fragment message, the OVS can determine whether the first fragment message is the first fragment message. For example, it can be determined whether the first fragment message is the first fragment message based on the information contained in the header of the first fragment message. When it is determined that the first fragment message is the first fragment message in the message to which it belongs, when the OVS performs one or more processing operations on the first fragment message, the OVS can track and record the one or more processing operations, and then generate the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier according to the first fragment message corresponding to the one or more processing operations.

[0022] In a third aspect, a message processing method is provided, which is used for a terminal device, wherein the terminal device includes a virtual host and a client, and the method includes:

[0023] The virtual host determines the order of multiple fragmented messages received by the network card in the terminal device; the virtual host generates indication information, and the indication information is used to indicate: the order of the multiple fragmented messages; the client obtains the indication information; the client aggregates the multiple fragmented messages according to the indication information to obtain an initial message.

[0024] Since the received fragmented messages are stored through the network card, and the storage addresses of the stored fragmented messages in the memory are arranged by using the virtual host, the client can obtain the fragmented messages stored therein through the arranged storage addresses to obtain the complete message, so the client does not need to reassemble the fragmented messages. Compared with the related art, the client needs to parse the received fragmented messages and reassemble them into a complete message, which saves the processing resources of the client and enables the client to provide resource processing services to the greatest extent.

[0025] Optionally, the terminal device further includes: a memory, the multiple fragment messages are stored in the memory of the terminal device, and the virtual host determines the order of the multiple fragment messages received by the network card in the terminal device, including: determining the order of the multiple fragment messages according to the multiple fragment messages stored in the memory. The method also includes: after generating the indication information, the virtual host stores the indication information in the memory, the indication information includes: descriptors of the storage addresses of the multiple fragment messages, and the descriptors of the storage addresses of the multiple fragment messages are arranged in the order of the multiple fragment messages.

[0026] The virtual host stores the indication information in a third storage area of ​​the memory, and both the client virtual host and the client storage can access the third storage area, which may be the storage area pointed to by the descriptor table.

[0027] The step of determining the order of the plurality of fragment messages according to the plurality of fragment messages stored in the virtual host memory comprises:

[0028] The virtual host determines the order of the multiple fragment messages according to the header set stored in the memory, wherein the header set includes: headers of all non-first fragment messages belonging to the initial message, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs.

[0029] Among them, the virtual host can determine the order of multiple fragmented messages according to the multiple fragmented messages stored in the memory. For example, the virtual host can determine the order of multiple fragmented messages according to the header set stored in the memory, and the header set includes: the headers of all non-first fragmented messages belonging to the initial message. For example, the header of the fragmented message has fragment offset information, and the fragment offset information includes the position of the fragmented message offset from the beginning of the initial message to which it belongs. The virtual host can determine the position of the second fragmented message in the message to which it belongs according to the fragment offset information of the second fragmented message. The second fragmented message is any fragmented message among the multiple fragmented messages received by the network card. It should be noted that the message ID carried by the fragmented message is the ID of the message to which the fragmented message belongs.

[0030] It should be noted that the header and payload of the first fragment message belonging to the initial message are stored in the first storage area of ​​the memory, the header of the non-first fragment message belonging to the initial message is stored in the second storage area, and the payload of the non-first fragment message is stored in the first storage area of ​​the memory.

[0031] The above-mentioned virtual host generates indication information, including: the virtual host hashes the header set to obtain a first hash value; the virtual host queries the first address queue chain corresponding to the first hash value in the hash table, wherein the hash table is used to record: the correspondence between the hash value and the address queue chain, the address queue chain includes address queues corresponding to multiple third-class message identifiers, and the address queues corresponding to different third-class message identifiers are different, and each fragmented message in any message carries the third-class message identifier; the virtual host determines the first address queue corresponding to the third-class message identifier carried by each header in the first address queue chain based on the third-class message identifier carried by each header in the header set; The virtual host determines the target position of each fragment message in the multiple fragment messages according to the order of the multiple fragment messages; the virtual host writes the storage address of each fragment message in the memory into the first address position in the first address queue, wherein the first address queue has multiple address positions arranged in sequence, and the first address position is the address position of the target position in the multiple address positions; the virtual host obtains the storage address of the first fragment message belonging to the initial message; the virtual host writes the storage address of the first fragment message into the first address position in the multiple address positions; the virtual host generates the indication information according to the storage addresses in the multiple address positions.

[0032] Before the virtual host generates the indication information, a reassembly condition needs to be satisfied. The reassembly condition includes a storage address of a fragment message belonging to the initial message stored in a plurality of address locations. For example, the virtual host can determine whether the storage address of the fragment message belonging to the initial message is stored in the plurality of address locations according to the header of the initial message.

[0033] Since the virtual host can describe the storage address of the fragment message through the descriptor of the storage address, the multiple fragment messages and the indication information are stored in the memory of the terminal device, and the client obtains the indication information, including: the client obtains the indication information from the memory, and the indication information includes: the descriptors of the storage addresses of the multiple fragment messages, and the descriptors of the storage addresses of the multiple fragment messages are arranged in the order of the multiple fragment messages.

[0034] The client aggregates the multiple fragment messages according to the indication information, including: the client sequentially obtains the fragment messages stored in each storage address indicated by the indication information; the client arranges the obtained fragment messages in sequence according to the order in which the fragment messages are obtained.

[0035] Among them, after the virtual host stores the indication information in the memory, the client can first send packet receiving information, which may include an aggregation identifier, so that after receiving the packet receiving information, the client determines to perform aggregation operations on multiple fragmented messages obtained subsequently to obtain a complete initial message.

[0036] In a fourth aspect, a message processing method is provided, which is applied to an end device, wherein the end device includes a network card and an OVS, and the method includes:

[0037] The network card receives multiple first fragment messages, wherein the multiple first fragment messages all carry the first-category message identifier, the first-category message identifier includes a message ID, and the message IDs carried by at least two of the multiple first fragment messages are the same; the network card queries the first-category message identifier carried by the first fragment message in a message identifier set; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first-category message identifier carried by at least one fragment message processed by OVS, and the first-category message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first-category message identifier carried by any fragment message includes: part or all of the processing operations performed by the OVS on the any fragment message; when the first-category message identifier carried by the first fragment message is queried, the network card sequentially performs the processing operations in the processing operation sequence corresponding to the first-category message identifier carried by the first fragment message on the first fragment message.

[0038] Optionally, the first type of message identifier also includes: destination Internet Protocol address IP and source IP.

[0039] In an embodiment of the present application, the above-mentioned network card queries the first type of message identifier carried by the first fragment message in the message identifier set, including: the network card queries the first type of message identifier carried by the first fragment message in the mapping table; the mapping table is used to record: the correspondence between the first type of message identifier in the message identifier set and the flow table entry of the flow table, and the flow table is used to record: the correspondence between the flow table entry of the flow table and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message.

[0040] Optionally, before the network card sequentially performs processing operations in a processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message, the method further includes:

[0041] The network card determines a first flow table entry corresponding to a first type of message identifier carried by the first fragmented message according to the mapping table; the network card queries the first flow table entry in the flow table; when the first flow table entry is found in the flow table, the network card determines a processing operation sequence corresponding to the first flow table entry according to the flow table; the network card uses the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first type of message identifier carried by the first fragmented message.

[0042] Further optionally, the method further includes:

[0043] When the first-class message identifier carried by the first fragment message is not found, the network card sends the first fragment message to the OVS in the end device; the OVS receives the first fragment message sent by the network card in the end device; the OVS performs one or more processing operations on the first fragment message; when the first fragment message is the first fragment message in the message to which the first fragment message belongs, the OVS generates the first-class message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-class message identifier, each fragment message in any message carries the first-class message identifier, and the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message includes: some or all of the one or more processing operations; the OVS sends the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier to the network card. The network card receives the first type of message identifier carried by the first fragment message sent by the OVS, and a processing operation sequence corresponding to the first type of message identifier; the network card adds the first type of message identifier carried by the first fragment message to the message identifier set; wherein the message ID carried by the fragment message is the ID of the message to which the fragment message belongs.

[0044] In a fifth aspect, a message processing device is provided, which is applied to a network card in a terminal device, and the device includes:

[0045] A first receiving module, used to receive a plurality of first fragment messages, wherein the plurality of first fragment messages all carry the first type message identifier, the first type message identifier includes a message ID, and at least two of the plurality of first fragment messages carry the same message ID;

[0046] A first query module is used to query the first type of message identifier carried by the first fragment message in the message identifier set; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first type of message identifier carried by at least one fragment message processed by the open virtual switch OVS in the end device, and the first type of message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message includes: part or all of the processing operations performed by the OVS on the any fragment message;

[0047] An execution module is used to, when the first type of message identifier carried by the first fragment message is queried, sequentially execute the processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message.

[0048] Optionally, the first type of message identifier also includes: destination Internet Protocol address IP and source IP.

[0049] Optionally, the first query module is used to: query the first type of message identifier carried by the first fragment message in a mapping table; the mapping table is used to record: the correspondence between the first type of message identifier in the message identifier set and the flow table item of the flow table, and the flow table is used to record: the correspondence between the flow table item of the flow table and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message;

[0050] Optionally, the device further comprises:

[0051] A first determination module is used to determine, according to the mapping table, a first flow table entry corresponding to the first type of message identifier carried by the first fragment message before sequentially performing processing operations in a processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message;

[0052] A second query module, configured to query the first flow table entry in the flow table;

[0053] A second determining module is used to determine, when the first flow table entry is queried in the flow table, a processing operation sequence corresponding to the first flow table entry according to the flow table;

[0054] The third determination module is used to use the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

[0055] Optionally, the device further comprises:

[0056] a sending module, configured to send the first fragment message to the OVS in the terminal device when the first category message identifier carried by the first fragment message is not found, so that the OVS performs one or more processing operations on the first fragment message, and when the first fragment message is the first fragment message in the message to which the first fragment message belongs, send the first category message identifier carried by the first fragment message to the network card, and a processing operation sequence corresponding to the first category message identifier, wherein the message ID carried by the fragment message is the ID of the message to which the fragment message belongs;

[0057] A second receiving module, configured to receive a first-category message identifier carried by the first fragment message sent by the OVS, and a processing operation sequence corresponding to the first-category message identifier;

[0058] An updating module is used to add the first type of message identifier carried by the first fragment message to the message identifier set.

[0059] In a sixth aspect, a message processing device is provided, which is applied to an open virtual switch OVS in an end device, and the device includes:

[0060] A receiving module, used for receiving a first fragment message sent by a network card in the terminal device;

[0061] An execution module, configured to execute one or more processing operations on the first fragment message;

[0062] A generation module, used for generating a first-category message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-category message identifier when the first fragment message is the first fragment message in the message to which the first fragment message belongs, each fragment message in any message carries the first-category message identifier, and the processing operation sequence corresponding to the first-category message identifier carried by the first fragment message includes: part or all of the processing operations in the one or more processing operations, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs;

[0063] The sending module is used to send the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier to the network card.

[0064] In a seventh aspect, a message processing device is provided, the device comprising: a client and a virtual host;

[0065] The virtual host is used to determine the order of multiple fragment messages received by the network card in the terminal device;

[0066] The virtual host is used to generate indication information, and the indication information is used to indicate: the order of the multiple fragment messages;

[0067] The client is used to obtain the instruction information;

[0068] The client is used to aggregate the multiple fragment messages according to the indication information to obtain an initial message.

[0069] Optionally, the apparatus further comprises: a memory; the plurality of fragment messages are stored in the memory of the terminal device, and the virtual host is further used for:

[0070] Determining an order of the plurality of fragment messages according to the plurality of fragment messages stored in the memory;

[0071] After generating the indication information, the virtual host is used to store the indication information in the memory, wherein the indication information includes: descriptors of the storage addresses of the multiple fragmented messages, and the descriptors of the storage addresses of the multiple fragmented messages are arranged in the order of the multiple fragmented messages.

[0072] Optionally, the virtual host is also used to: determine the order of the multiple fragmented messages based on the header set stored in the memory, the header set including: headers of all non-first fragmented messages belonging to the initial message, and the message ID carried by the fragmented message is the ID of the message to which the fragmented message belongs.

[0073] Optionally, the header and payload of the first fragment message belonging to the initial message are stored in a first storage area in the memory, the header of the non-first fragment message belonging to the initial message is stored in a second storage area, and the payload of the non-first fragment message is stored in the first storage area of ​​the memory.

[0074] Optionally, the virtual host is also used to: hash the header set to obtain a first hash value; query the first address queue chain corresponding to the first hash value in the hash table, wherein the hash table is used to record: the correspondence between the hash value and the address queue chain, the address queue chain includes address queues corresponding to multiple third-class message identifiers, and the address queues corresponding to different third-class message identifiers are different, and each fragmented message in any message carries the third-class message identifier; based on the third-class message identifier carried by each header in the header set, determine the first address corresponding to the third-class message identifier carried by each header in the first address queue chain. queue; determine the target position of each fragment message in the multiple fragment messages according to the order of the multiple fragment messages; write the storage address of each fragment message in the memory into the first address position in the first address queue, wherein the first address queue has a plurality of address positions arranged in sequence, and the first address position is the address position of the target position in the plurality of address positions; obtain the storage address of the first fragment message belonging to the initial message; write the storage address of the first fragment message into the first address position in the plurality of address positions; generate the indication information according to the storage addresses in the plurality of address positions.

[0075] Optionally, the multiple fragmented messages and the indication information are stored in the memory of the terminal device, and the client is also used to: obtain the indication information from the memory, the indication information including: descriptors of the storage addresses of the multiple fragmented messages, and the descriptors of the storage addresses of the multiple fragmented messages are arranged in the order of the multiple fragmented messages; sequentially obtain the fragmented messages stored in each storage address indicated by the indication information; and sequentially arrange the obtained fragmented messages in the order in which the fragmented messages are obtained.

[0076] In an eighth aspect, a network card is provided, comprising a processing component, a storage medium and a communication interface, wherein the processing component and the storage medium are both connected to the communication interface, and the processing component executes a message processing method as described in any one of the first aspects above based on a program in the storage medium.

[0077] In the ninth aspect, an end device is provided, comprising: a processor, a memory and a network card provided in the eighth aspect; the processor is used to run an open virtual switch OVS based on the program in the memory, and execute the message processing method described in the second aspect through OVS.

[0078] A tenth aspect. A terminal device is provided, the terminal device comprising: a processor and a memory;

[0079] The processor is used to run a virtual host and a client based on the program in the memory, and to execute a method executed by the client in any message processing method described in the third aspect through the virtual host, and to execute a method executed by the client in any message processing method described in the third aspect through the client.

[0080] Optionally, the terminal device also includes: the network card provided in the eighth aspect above; the processor is also used to run an open virtual switch OVS based on the program in the memory, and execute the message processing method described in the second aspect above through OVS.

[0081] In the eleventh aspect, a chip is provided, wherein the chip is used to run OVS, and the OVS is used to execute the message processing method described in the second aspect.

[0082] In the twelfth aspect, a chip is provided, comprising: a virtual host and a client; the virtual host is used to execute the method executed by the client in any message processing method described in the third aspect; the client is used to execute the method executed by the client in any message processing method described in the third aspect.

[0083] Optionally, the chip further includes: OVS, and the OVS is used to execute the message processing method described in the second aspect.

[0084] Optionally, the chip is a processor.

[0085] In the thirteenth aspect, a readable storage medium is provided, wherein a program is stored in the storage medium; when the program is executed by a processing component, any method described in the first to fourth aspects is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Figure 1 is a schematic diagram of a data transmission system provided in an embodiment of the present application;

[0087] Figure 2 This is a schematic diagram of the principle of message fragmentation;

[0088] Figure 3 It is a schematic diagram of data forwarding using a fast path to offload to a network card in the related art;

[0089] Figure 4 It is a flow chart of a message processing method provided by an embodiment of the present application;

[0090] Figure 5 It is a schematic diagram of a message provided in an embodiment of the present application;

[0091] Figure 6 This is a schematic diagram of a process of OVS processing a message provided by an embodiment of the present application;

[0092] Figure 7 It is a partial structural diagram of a terminal device provided in an embodiment of the present application;

[0093] Figure 8 It is a structural diagram of a terminal device provided in an embodiment of the present application;

[0094] Fig. 9 It is a schematic diagram of the process of reassembling fragmented messages in the related art;

[0095] Fig.10 is a flowchart of another message processing method provided in an embodiment of the present application;

[0096] Fig.11 It is a flow chart of the message reassembly phase in the message processing method provided in the embodiment of the present application;

[0097] Fig.12 It is a flowchart of a method for generating indication information provided by an embodiment of the present application;

[0098] Fig.13 This is a schematic diagram of a process for generating indication information provided by an embodiment of the present application;

[0099] Fig.14 It is a partial structural diagram of a terminal device provided in an embodiment of the present application;

[0100] Fig.15 is a block diagram of a message processing device provided in an embodiment of the present application;

[0101] Fig.16 is a block diagram of another message processing device provided in an embodiment of the present application;

[0102] Fig.17 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0103] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0104] Please refer to Figure 1 , which shows a data transmission system provided by an embodiment of the present application. The data transmission system includes: multiple terminal devices 1, and optionally, the data transmission system may also include a network device 0. The above multiple terminal devices 1 can be connected through the network device 0. By way of example, the terminal device 1 can be a terminal, a server, and a service area cluster composed of multiple servers. The network device 0 can be a gateway, a switch, and a server agent. The terminal device can correspond to a connected end node, and the network device can correspond to a connected intermediate node.

[0105] The terminal device 1 may include: an open virtual switch (open vswitch, OVS) 202, a network card 203 and a memory 204. The memory 204 may be a storage space shared by the OVS 202 and the network card 203, so that when the network card 203 stores data in the memory 204. For example, the memory 204 may be a cache.

[0106] For example, the end device includes a processor 206, and the client 201 and OVS 202 may both belong to the processor. For example, OVS 202 may be a virtual machine, and OVS 202 may include: OVS software mounted on the processor, and hardware mounted by the OVS software in the processor. The network card 203 may be a smart network interface card (smartNIC).

[0107] Each end device can forward data to other end devices through the network card therein. For example, end device 1 can send data to network device 0 through the network card, and network device 0 sends the received data to another end device 1. In the process of forwarding data, the end device that sends data to network device 0 can be called a source end device, and the end device that receives the data sent by network device 0 can be called a destination end device.

[0108] Messages can be transmitted between the source device and the destination device through multiple transmission links in sequence. However, the length of messages that can be transmitted on different transmission links is limited by the link layer protocol used by the transmission link, and different link layer protocols specify different payload lengths of messages. Among them, the message includes: a header and a payload part, and the payload length of the message refers to the length of the payload part of the message. Based on this, when it is necessary to transmit a message on a certain transmission link, if the length of the message exceeds the MTU specified by the link layer protocol corresponding to the transmission link, the message needs to be fragmented to obtain multiple fragmented messages with a length less than the MTU, and then these fragmented messages are transmitted on the transmission link.

[0109] Each fragmented message may include: a header and a payload part. The message fragmentation process includes: first, dividing the payload part of the message into one or more payload sub-parts. Then, a header is added to each payload sub-part, and the fragment header is obtained or modified according to the header of the message. When the payload sub-part is the first payload sub-part obtained after the payload part is divided, the header added to the first payload sub-part is compared with the header of the message to which the first payload sub-part belongs, except for the two field information of the flag and the slice offset in the header, the rest of the information is the same. When the payload sub-part is not the first payload sub-part, the header added to the non-first payload sub-part is compared with the header added to the first payload sub-part, not only the information of the two fields of the flag and the slice offset in the header is different, but also the header of the non-first payload sub-part does not contain the transport layer information. The first payload sub-part after adding the header can be called the first fragmented message, and the non-first payload sub-part after adding the header can be called the non-first fragmented message. Therefore, the multiple fragmented messages can be considered to include: the first fragmented message and the non-first fragmented message. And the header of the first fragmented message includes transport layer information, while the header of the non-first fragmented message does not include transport layer information. For example, the fragmented message usually refers to a message that uses the user datagram protocol (UDP) at the transport layer. Among them, the message ID carried by the fragmented message is the ID of the message to which the fragmented message belongs, that is, the fragmented message is obtained by fragmenting the message to which it belongs.

[0110] like Figure 2 As shown, it shows a schematic diagram of the principle of message fragmentation. Assume that the message of the source device 101 is sent to the destination device 104 through the first router 102 and the second router 103. Among them, the MTU of the transmission link between the source device 101 and the first router 102 is 65535 bytes (Byte, B), the MTU of the transmission link between the first router 102 and the second router 103 is 400B, and the MTU of the transmission link between the second router 103 and the destination device 104 is 2500B.

[0111] Assume that the source device 101 needs to send a Figure 2The first message A0 in the packet includes an Internet Protocol (IP) header H_0 and a load PL_0 with a load length of 1000B. When the first router 102 receives the first message A0, since the load length (1000B) of the first message A0 is greater than the MTU (400B) of the transmission link between the first router 102 and the second router 103, the first router 102 needs to fragment the first message A0 and then send each fragment message obtained after the fragmentation to the second router 103. The first router 102 can fragment the first message A0 to obtain: the first fragment message A01, and two non-first fragment messages, namely, the fragment message A02 and the fragment message A03. The first fragment message A01 includes a header H_01 and a load PL_01 with a load length of 3976. The fragment message A02 includes a header H_02 and a payload PL_02 whose length is 3976. The fragment message A03 includes a header H_03 and a payload PL_03 whose length is 2048.

[0112] Similarly, after receiving each fragment message (such as the three fragment messages obtained after the first router fragments the first message), the second router 103 also needs to re-fragment the received fragment message when the load length of the received fragment message is greater than the MTU of the transmission link between the second router 103 and the destination device 104, and then send the fragment message obtained after re-fragmentation to the target virtual host. For example, since the load length (3976B) of the fragment message A01 and the load length (3976B) of the fragment message A02 received by the second router 103 are both greater than the MTU (2500B) of the transmission link between the second router 103 and the destination device 104, the second router 103 fragments the fragment message A01 and then sends each fragment message obtained after fragmentation to the destination device. Among them, the second router can fragment the fragment message A01 to obtain: the first fragment message A011, and a non-first fragment message A012. Fragment the fragment message A02, and then send each fragment message obtained after fragmentation to the destination device. Among them, the second router can fragment the fragment message A02 to obtain: two non-first fragment messages, fragment message A021 and fragment message A022. The fragment message A011 includes a header H_011 and a load PL_011 with a load length of 2480B. The fragment message A012 includes a header H_012 and a load PL_012 with a load length of 1496B. The fragment message A021 includes a header H_021 and a load PL_021 with a load length of 2480B. The fragment message A022 includes a header H_022 and a payload PL_022 with a payload length of 1496 B. Since the payload length (2048 B) of the fragment message A03 is smaller than the MTU (2500 B) of the transmission link between the second router 103 and the destination device 104, the second router 103 directly sends the fragment message A03 to the destination device 104.

[0113] The current OVS can process the received fragmented message through a slow path or a fast path. The slow path means that the OVS parses the received fragmented message, and then queries multiple flow item tables stored in the OVS according to the results of the analysis, and then determines the processing operation of the fragmented message according to the multiple flow item tables. The processing operation may include: forwarding the fragmented message to a certain port, modifying a certain field of the fragmented message and / or discarding the fragmented message. When the OVS uses a slow path to process the fragmented message, a corresponding relationship between the fragmented message and the processing operation of the fragmented message is usually established. The fast processing path means that the OVS queries the received fragmented message in the corresponding relationship between the fragmented message and the processing operation established above, and executes the processing operation corresponding to the fragmented message according to the query result. Among them, when the received fragmented message is the first fragmented message, the OVS processes the first fragmented message through the slow path. When the received fragment message is not the first fragment message, the OVS processes the non-first fragment message through the fast path. In this way, since usually only the first fragment message is processed through the slow path, and a large number of fragment messages are processed through the fast path, the forwarding performance of the fast path affects the forwarding performance of the OVS for messages (or data).

[0114] When the end device forwards data, in order to improve forwarding performance, the fast path can be offloaded to the network card. Figure 3 , which shows a schematic diagram of data forwarding using a fast path to offload to a network card in the related art. Figure 3 As shown, the network card 203 can store the message identifier carried by the fragment message and the processing operation sequence corresponding to the message identifier. Among them, the normalization table 2041 can be used. The message identifier carried by the fragment message and the processing operation sequence corresponding to the message identifier are recorded, and the message identifier can be a matching item of the normalization table, and the processing operation sequence can be a behavior item of the normalization table. For example, the message identifier can be a subnet identifier extracted from the fragment message and the source IP, destination IP, protocol type, source port and destination port information extracted from the header of the fragment message. And the source port and destination port belong to the transport layer information. The processing operation sequence can include the processing operations that need to be performed in sequence when the fragment message is forwarded.

[0115] When the network card 203 receives the fragment message, the network card first queries the message identifier carried by the fragment message. If the message identifier carried by the fragment message is queried, the network card determines the processing operation sequence corresponding to the message identifier carried by the fragment message, and does not need to be transmitted to OVS202 for processing. If the message identifier carried by the fragment message is not queried, the network card transmits the fragment message to OVS202. After receiving the fragment message, the OVS202 uses a slow path to process the fragment message. Among them, OVS202 includes an intelligent unloading engine unit 2021, which tracks and records the processing operation of the fragment message, and then generates the message identifier carried by the fragment message according to the recorded processing operation, and the processing operation sequence corresponding to the message identifier, and the message identifier carried by the generated fragment message, and the processing operation sequence corresponding to the message identifier are unloaded to the normalized flow table in the network card 203.

[0116] However, since the message identifier carried by the fragmented message is stored in the network card, and the processing operation sequence corresponding to the message identifier, the message identifier includes the source IP, destination IP, protocol type, source port and destination port information, which contains the information of the transport layer. In the fragmented message, except for the first fragmented message, all the fragmented messages do not contain the information of the transport layer. Therefore, when the network card processes the received fragmented message, it is impossible to query the message identifier carried by the received fragmented message, and thus it is impossible to determine the processing operation sequence corresponding to the message identifier carried by the fragmented message, which makes the network card need to upload a large number of fragmented messages to OVS for processing. However, the performance of the OVS in processing data is poor, which directly affects the data forwarding performance.

[0117] This application embodiment provides a message processing method that can solve the above problems. Figure 4 , which shows a message processing method provided by an embodiment of the present application, which can be applied to the above Figure 1 The end device shown. Figure 4 As shown, the message processing method may include the following steps:

[0118] Step 101: The network card receives a plurality of first fragment messages.

[0119] The multiple first fragment messages all carry a first-class message identifier, the first-class message identifier includes a message ID, and at least two of the multiple first fragment messages carry the same message ID, that is, at least two first fragment messages are fragment messages obtained by fragmenting the same message.

[0120] The first fragmented message may be a fragmented message generated in the terminal device and transmitted to the network card, or it may be a fragmented message received by the network card from an external network. The first fragmented message may be obtained by directly fragmenting a message (the first fragmented message belongs to the message), wherein the fragmented message may be a message that has never been fragmented, or a fragmented message obtained after fragmentation. And the first fragmented message may be the first fragmented message in the message to which it belongs, or it may be a non-first fragmented message. It should be noted that the message ID carried by the fragmented message is the ID of the message to which the fragmented message belongs.

[0121] In the present application embodiment, Figure 5 As shown, the first fragment message among multiple fragment messages includes: a header and a payload. The header includes: transport layer information (for example, source port and destination port) and other information (such as version, header length, differentiated service, total length, message identification number (identification, ID), flag, fragment offset, lifetime, protocol type, header checksum, source IP address, destination IP address, etc.). The non-first fragment message includes: a header and a payload. Compared with the header of the first fragment message, the header does not include: transport layer information.

[0122] Step 102: The network card searches the message identifier set for the first type of message identifiers carried by the multiple first fragment messages.

[0123] The message identification set can be an empty set or a non-empty set. When the message identification set is a non-empty set, the message identification set includes: the first-class message identification carried by at least one fragment message processed by OVS in the end device, and the first-class message identification carried by any fragment message in at least one fragment message has a corresponding processing operation sequence. The at least one fragment message refers to one or more fragment messages.

[0124] In an embodiment of the present application, the processing operation sequence corresponding to the first-class message identifier carried by any fragmented message includes: some or all of the processing operations performed by OVS on the any fragmented message. By way of example, the network card can query the first-class message identifier carried by the first fragmented message in the correspondence between the first-class message identifier and the processing operation sequence. The above-mentioned message identifier set can be all the first-class message identifiers in the corresponding relationship. The processing operations performed by OVS on any fragmented message may include: forwarding the fragmented message to a certain port, modifying a certain field of the fragmented message and / or discarding the fragmented message. The first-class message identifier can be a message identifier carried by the header of each fragmented message. For example, the first-class message identifier can include: Figure 5The source IP address, destination IP address and message ID information shown are information carried by the header of each fragment message. Alternatively, the first-class message identifier may include a message ID. According to actual conditions, the first-class message identifier may also include a message ID and other information, which is not limited in the embodiments of the present application.

[0125] Optionally, the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier can be reflected by the mapping table and flow table stored in the network card. For example, the mapping table is used to record: the corresponding relationship between the first-class message identifier in the message identifier set and the flow table item of the flow table. The flow table is used to record the corresponding relationship between the flow table item of the flow table and the processing operation sequence corresponding to the first-class message identifier carried by any fragment message. At this time, the message identifier set refers to the set of all first-class message identifiers in the mapping table. Then in step 102, the network card can directly query the first-class message identifier carried by the first fragment message in the mapping table. It can be understood that in the mapping table and the flow table, the flow ID (flow_id) can be used to identify the flow table item of the flow table. The mapping table can have matching items and flow table items. The matching item in the mapping table can be the first-class message identifier. At this time, the matching item can be called a fragment matching key (fragment_match_key).

[0126] For example, the above mapping table may be as shown in Table 1 below, and the mapping table may be as shown in Table 2 below.

[0127] Table 1

[0128] Flow entry Processing operation sequence 1 {Processing Operation 1, Processing Operation 2, and Processing Operation 3} 2 {Processing Operation 4 and Processing Operation 5}

[0129] As shown in Table 1, in the flow entry with a flow ID of 1, the processing operation sequence includes processing operation 1, processing operation 2, and processing operation 3. In the flow entry with a flow ID of 2, the processing operation sequence includes processing operation 4 and processing operation 5.

[0130] Table 2

[0131] First-class message identification Flow entry 1 1 2 2

[0132] As shown in Table 2, the flow table entry corresponding to the first-class message identifier 1 is 1. Accordingly, the processing operation sequence corresponding to the first-class message identifier 1 includes processing operation 1, processing operation 2, and processing operation 3. The flow table entry corresponding to the first-class message identifier 2 is 2. Accordingly, the processing operation sequence corresponding to the first-class message identifier 2 includes processing operation 3 and processing operation 4.

[0133] Step 103: When the first type of message identifier carried by the first fragment message is found, the network card determines a processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

[0134] Among them, continue to use the mapping table and the flow table to record the correspondence between the first type of message identifier and the processing operation sequence as an example for explanation. When the first type of message identifier carried by the first fragment message is queried, the process of the network card determining the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message may include: the network card first determines the first flow table item corresponding to the first type of message identifier carried by the first fragment message according to the mapping table. Then, the network card queries the first flow table item in the flow table. When the first flow table item is queried in the flow table, the network card determines the processing operation sequence corresponding to the first flow table item according to the flow table. Afterwards, the network card uses the processing operation sequence corresponding to the first flow table item as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

[0135] For example, it is assumed that the first-class message identifier carried by the first fragment message is 1, and the network card stores the flow table shown in Table 3 and the mapping table shown in Table 2. The network card first determines the flow table entry with flow ID 1 corresponding to the first-class message identifier 1 according to the mapping table. Then, the network card searches the flow table for the flow ID 1 and determines the processing operation sequence {processing operation 1, processing operation 2, and processing operation 3} corresponding to the flow table entry.

[0136] Step 104: The network card sequentially performs, on the first fragment message, processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

[0137] After determining the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message, the network card can perform the processing operations in the processing operation sequence on the first fragment message. For example, continue to take the example shown in the above step 103 as an example. When it is determined that the first type of message identifier carried by the first fragment message corresponds to the processing operation sequence {processing operation 1, processing operation 2 and processing operation 3}, the network card can perform processing operation 1, processing operation 2 and processing operation 3 on the first fragment message in sequence.

[0138] Step 105: When the first type of message identifier carried by the first fragment message is not found, the network card sends the first fragment message to the OVS.

[0139] There may be multiple situations where the first type of message identifier carried by the first fragment message is not found. For example, when the message identifier set is an empty set, the network card cannot find the first type of message identifier carried by the first fragment message. Alternatively, when the message identifier set is a non-empty set, the message identifier set does not include the first type of message identifier.

[0140] Step 106: OVS performs one or more processing operations on the first fragment message.

[0141] The OVS receives the first fragment message sent by the network card of the terminal device and processes the first fragment message. The OVS processes the first fragment message in a manner substantially the same as the OVS processes the fragment message using a slow path.

[0142] Step 107: When the first fragment message is the first fragment message in the message to which the first fragment message belongs, the OVS generates a first-class message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-class message identifier. Each fragment message in any message carries a first-class message identifier, and the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message includes: some or all of the one or more processing operations.

[0143] When receiving the first fragment message, the OVS can determine whether the first fragment message is the first fragment message. For example, it can be determined whether the first fragment message is the first fragment message based on the information contained in the header of the first fragment message. When it is determined that the first fragment message is the first fragment message in the message to which it belongs, when the OVS performs one or more processing operations on the first fragment message, the OVS can track and record the one or more processing operations, and then generate the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier according to the first fragment message corresponding to the one or more processing operations.

[0144] For example, one or more flow items may be stored in OVS, each of which may be used to record the identifier of a fragmented message and a processing operation performed by OVS on the fragmented message. Furthermore, for every two processing operations performed in sequence, the flow item used to record the previous processing operation also records the identifier of the flow item used to record the next processing operation. Figure 6 As shown, the multiple flow items stored in OVS include: flow entry 1 to flow entry 5 and CT entry 1, a total of 6 items. OVS determines the connection tracking action (CT action), state update (CT stateupdate), insert virtual LAN header (VLAN push), remove virtual LAN header (VLAN pop), insert tunnel header (tunnel push) and insert virtual LAN header to be performed on the first fragment message in sequence according to flow entry 1, CT entry 1, flow entry 2 to flow entry 5 corresponding to the first fragment message. A total of 6 processing operations.

[0145] OVS can determine one or more processing operations performed by OVS on the first fragment message by tracking the multiple flow items that the first fragment message passes through, thereby generating the above-mentioned flow table. Then, the OVS can extract the second-class message identifier carried by the first fragment message and generate the above-mentioned mapping table according to the above-mentioned flow table. Finally, the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier are reflected through the flow table and the mapping table.

[0146] Optionally, due to the partial processing operations performed by OVS on the fragmented message, it may not be necessary when the network card performs the same processing on the same fragmented message. Therefore, the OVS can uniformly arrange the one or more processing operations corresponding to the first fragmented message according to the network card, so that the processing operation sequence in the flow table can include some of the one or more processing operations. For example, the unified arrangement can refer to screening the one or more processing operations according to the processing operations that the network card needs to perform, so as to retain the necessary processing operations that the network card needs to perform. For example, in the above example, since the network card may not need to insert the virtual LAN header and remove the virtual LAN header when processing the first fragmented message. Therefore, after the OVS uniformly arranges the processing operations, it is determined that the processing operation sequence corresponding to the first fragmented message can include connection tracking actions, inserting tunnel headers, and inserting virtual LAN headers.

[0147] Optionally, the OVS may include an intelligent engine processing module, and the above-mentioned tracking and recording of the one or more processing operations, unified orchestration of the one or more processing operations, and generation of the first-class message identifier carried by the above-mentioned first fragment message, as well as the processing operation sequence corresponding to the first-class message identifier can all be executed by the intelligent engine processing module.

[0148] It should be noted that when the first fragment message judged above is not the first fragment message in the message to which it belongs, OVS processes the non-first fragment message and does not generate the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier.

[0149] Step 108: OVS sends the first-category message identifier carried in the first fragment message and a processing operation sequence corresponding to the first-category message identifier to the network card.

[0150] For example, OVS offloads the generated flow table and mapping table to the network card. Wherein, step 203 can be executed by the intelligent engine processing module in OVS.

[0151] Step 109: The network card adds the first type of message identifier carried by the first fragment message to the message identifier set.

[0152] After receiving the first-class message identifier carried by the first fragment message sent by OVS and the processing operation sequence corresponding to the first-class message identifier, the network card can add the first-class message identifier carried by the first fragment message received from OVS to the message identifier set stored by the network card. For example, the network card can record the correspondence between the first-class message identifier carried by the first fragment message and a table entry in the flow table in the mapping table, and the network card can also record the correspondence between the table entry and the processing operation sequence corresponding to the first-class message identifier in the flow table.

[0153] Alternatively, after receiving the first-class message identifier carried by the first fragment message sent by the OVS, and the processing operation sequence corresponding to the first-class message identifier, the network card may update the message identifier set included in the identifier set with the first-class message identifier carried by the first fragment message received from the OVS. For example, the network card may update the corresponding relationship recorded in the mapping table to: the corresponding relationship between the first-class message identifier carried by the first fragment message and a table entry in the flow table, and the network card may also update the corresponding relationship recorded in the flow table to: the corresponding relationship between the table entry and the processing operation sequence corresponding to the first-class message identifier.

[0154] It should be noted that the flow table provided in the embodiment of the present application can also be used to record the flow table items, processing operation sequences and the corresponding relationship between the second type of message identifiers of the flow table. In the embodiment of the present application, the first fragment message in any message carries the second type of message identifier, and the non-first fragment message in any message does not carry the second type of message identifier. Among them, the flow table includes matching items and behavior items. The second type of message identifier can be a matching item in the flow table, and the matching item can be called a matching key (match_key). For example, the second type of message identifier can include: a subnet identifier and five-tuple information (source IP address, destination IP address, protocol type, source port and destination port) of the message. The processing operation sequence can be a behavior item of the flow table. Since in the related art, the message identifier and its processing operation sequence recorded in the normalized flow table are the same as the second type of message identifier and processing operation sequence of the flow table in the embodiment of the present application, therefore, the first type of message identifier carried by the first fragment message in the related art and the processing operation sequence corresponding to the first type of message identifier can be reused in the embodiment of the present application, which more effectively improves the utilization rate of the corresponding relationship.

[0155] For example, a flow table for recording the correspondence between its flow table entries, processing operation sequences, and second-category message identifiers may be as shown in the following Table 3. The flow table may be the same as the normalized flow table in the related art.

[0156] Table 3

[0157] Flow entry Second type message identification Processing operation sequence 1 1_1 {Processing Operation 1, Processing Operation 2, and Processing Operation 3} 2 2_1 {Processing Operation 4 and Processing Operation 5}

[0158] As shown in Table 3, the flow entry corresponding to the second type message identifier 1_1 is 2, and the corresponding processing operation sequence includes processing operation 1, processing operation 2, and processing operation 3. The flow entry corresponding to the second type message identifier 2_1 is 2, and the corresponding processing operation sequence includes processing operation 4 and processing operation 5.

[0159] It should also be noted that when the end device is a Linux operating system, data can be forwarded at Layer 2 (data link layer). At this time, the OVS can include a client (VMware) in bridged mode and multiple bridges. The client in bridged mode refers to connecting the network card with the virtual network card of the client using a virtual bridge to achieve communication between OVS and the network card. Figure 7 As shown, the OVS may include a client 301, a first bridge 302, a second bridge 303, a third bridge 304, and a fourth bridge 305, and the fourth bridge 305 is connected to the network card 203 (such as a smart network card). Among them, the first bridge 303 can be a ply bridge; the second bridge 303 can be a Linux bridge; the third bridge 304 can be an integrated bridge (br-int); and the fourth bridge 305 can be a channel bridge (br-tun). When the first fragment message is the first fragment message, the process of processing the first fragment message on the end device, forwarding it, and creating the above-mentioned flow table and mapping table may include:

[0160] First, the first fragment message enters the first bridge 302 from the client 301. Then, the first bridge 302 sends the received first fragment message to the second bridge 303, and the second bridge 303 performs one or more processing operations on the first fragment message, tracks and records the one or more processing operations for tracking (that is, connection tracking), and performs a security check on the first fragment message. After that, the first fragment message enters the first bridge 302 again after passing through the second bridge 303. At this time, the first bridge 302 generates a first-class message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-class message identifier according to part or all of the one or more processing operations performed by the first fragment message recorded by the second bridge 303. Then, the first fragment message is sent to the third bridge 304, and the third bridge 304 writes an internal virtual local area network tag (VLAN tag) to the first fragment message. Afterwards, the first fragment message is sent to the fourth bridge 305, which strips off the virtual LAN tag on the first fragment message, writes the virtual extensible LAN network identifier (VNI) and encapsulates the first fragment message into a virtual extensible LAN (VXLAN) tunnel message. Then the fourth bridge 305 writes an external VLAN tag in the VXLAN tunnel message.

[0161] After OVS completes the above processing operation on the first fragment message, OVS can send the processed first fragment message to the network card, and the network card sends the first fragment message to other end devices. For example, the fourth bridge 305 can transmit the first fragment message written with the external VLAN tag to the network card, and the network card sends it to other end devices.

[0162] To summarize, the message processing method provided in the embodiment of the present application, considering that the actual processing operations of multiple fragment messages of the same message on the forwarding plane are the same, by making the first-class message identifier carried by any fragment message in at least one fragment message in the message identifier set have a corresponding processing operation sequence, so that when the network card queries the first-class message identifier corresponding to the first message fragment in the message identifier set summary, it can perform the processing operations in the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message on the first message fragment in sequence, and since each fragment message in any message carries the first-class message identifier, the network card can perform the processing operations in the processing operation sequence corresponding to the first-class message identifier carried by the fragment message on each fragment message in any message summary, without uploading a large number of fragment messages to OVS for processing, thereby improving data forwarding efficiency.

[0163] Furthermore, when a mapping table and a flow table are used to reflect the first-class message identifier carried by the first fragmented message and the processing operation sequence corresponding to the first-class message identifier, and the flow table records the correspondence between the flow table items, the processing operation sequence and the second-class message identifier of the flow table, since the flow table is the same as the normalized flow table in the related technology in the related technology, the network card can execute the processing operation in the processing operation sequence corresponding to the first-class message identifier carried by the fragmented message for each fragmented message aggregated by any message, thereby improving data forwarding efficiency.

[0164] Furthermore, when a mapping table and a flow table are used to reflect the first type of message identifier carried by the first fragmented message, and the processing operation sequence corresponding to the first type of message identifier, and the flow table records the correspondence between the flow table items, the processing operation sequence, and the second type of message identifier, since the flow table is the same as the normalized flow table in the related technology in the related technology, the network card can make full use of the flow table to directly process more fragmented messages quickly, thereby improving the utilization efficiency of the flow table.

[0165] Furthermore, in the embodiment of the present application, since the network card only needs to perform one jump from the mapping table to the flow table to obtain the processing operations required to be performed on multiple fragmented messages of the message to which the first fragmented message belongs, compared with the related art, which may require multiple item table jumps, the query process of the processing operation is simplified. And since the processing operation sequence in the flow table can include part of the processing operations in one or more processing operations determined in the related art, the processing operation of the first fragmented message is also simplified.

[0166] Please refer to Figure 8 , which shows a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 1 On the basis of the end device shown, the end device may further include: a client 201 and a virtual host (vHost) 205. Correspondingly, the processor in the end device may also include the client 201 and the virtual host 205. For example, the client 201 and the virtual host 205 may both be virtual machines. For example, the virtual host 205 includes: virtual host software mounted on the processor, and hardware mounted by the virtual host software in the processor; the client 201 includes: client software mounted on the processor, and hardware mounted by the client software in the processor.

[0167] When the end device is the destination end device, after multiple fragment messages belonging to the same message arrive at the end device, the network card 203 directly stores the multiple fragment messages in the memory 204. The client 201 receives the multiple fragment messages from the memory 204, and then the kernel of the client 201 parses the multiple fragment messages and reassembles the multiple fragment messages into a complete message. After reassembling into a complete message, the kernel of the client 201 performs subsequent processing on the complete message.

[0168] Among them, a hash table (ip4_frags.hash[]) is stored in the client 201, and the hash table is used to record: the corresponding relationship between the hash value and the storage space of multiple message queues. The hash value can be obtained by the client 201 performing hash processing on the source IP address, the destination IP address, the protocol type and the message identifier in the message. The storage space of the multiple message queues includes the corresponding relationship between the messages (inet_frag_queue) corresponding to the multiple reassembled message identifiers. The reassembled message identifier may include information such as the source IP address, the destination IP address, the protocol type, the message identifier and the user of the reassembled message. The message may include a pointer (fargments) pointing to the first fragment message in the fragment chain list and a pointer (fargments_tail) pointing to the last fragment message in the fragment chain list. The fragment chain list can be used to store multiple fragment messages arranged in sequence, and the fragment chain list is composed of a buffer structure (sk_buff), and the fragment chain list can be represented by sk_buff.

[0169] Please refer to Fig. 9 , which shows a schematic diagram of the process of reassembling fragmented messages in the related art. Fig. 9As shown, frag_fri represents a pointer to the first fragment message in the fragment list. Frag_tai represents a pointer to the last fragment message in the fragment list. D represents multiple fragment messages stored in the fragment list. The process of the client 201 parsing and reassembling the multiple fragment messages may include: the client 201 first parses the fragment message, then extracts the source IP address, destination IP address, protocol type and message identifier information included in the header of the fragment message, and performs hash processing on the information to obtain a hash value. Then, the client 201 queries the hash value in the hash table. If the hash value is found in the hash table, the client 201 determines the storage space of the multiple message queues corresponding to the hash value according to the hash table. Afterwards, the client 201 queries the reassembled message identifier in the storage space of the multiple message queues to determine the message corresponding to the reassembled message identifier. And according to the information of the fragment offset in the header of the fragment message, the target position of the fragment message in the message to which it belongs is determined, and then the fragment message is inserted into the first position of the fragment chain list, and the first position is the position of the target position in the position of the multiple fragment messages in the fragment chain list. When all the fragment messages are stored in the fragment chain list, the multiple fragment messages form a complete message.

[0170] However, since the client needs to parse the received fragmented messages to reassemble the fragmented messages into a complete message, the processing resources of the client are highly consumed, reducing the utilization rate of the client's resources. In addition, since the client has relatively poor data processing performance, the client has low processing efficiency for the fragmented messages.

[0171] Please refer to Fig.10 , which shows another message processing method provided by the embodiment of the present application. It can solve the problem of low client data utilization rate in the related art. The message processing method can be applied to Figure 8 In the end device shown, Fig.10 As shown, the message processing method includes:

[0172] Step 201: The network card receives multiple fragment messages.

[0173] The network card can receive many fragmented messages. The multiple fragmented messages mentioned in step 201 all carry a first-class message identifier, and the first-class message identifier includes a message ID, and the message IDs carried by the multiple fragmented messages are the same.

[0174] Step 202: The network card stores the multiple fragmented messages in a memory.

[0175] Wherein, the client, the virtual host and the network card can all access the memory. The process of the network card storing multiple fragment messages in the memory may include: the network card determines whether the multiple fragment messages received by it are the first fragment message belonging to the initial message or the non-first message, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs. When the fragment message received by it is the first fragment message, the network card stores the header and load of the first fragment message in the first storage area in the memory. When the fragment message received by it is not the first fragment message, the network card stores the header of the non-first fragment message in the second storage area, and stores the load of the non-first fragment message in the first storage area of ​​the memory. Wherein, the second storage area can be called a metadata storage area. The second storage area corresponds to the first storage area one by one. For example, the network card can use direct memory access (DMA) to store the header and load of the fragment message in the memory. The DMA refers to an interface technology that allows a network card to directly exchange data with a memory without going through a central processing unit (CPU).

[0176] For example, Fig.11 As shown, it shows a flow chart of the message reassembly stage in the message processing method provided in an embodiment of the present application. Assume that the fragmented messages received by the network card include fragmented messages including fragmented messages B01, fragmented messages B02... and fragmented messages B0n, a total of n fragmented messages, n is a positive integer, and n>1. Among them, fragmented message B01 includes a header B011 and a load B012; fragmented message B02 includes a header B021 and a load B022... fragmented message B0n includes a header B0n1 and a load B0n2. The network card can store the fragmented message B01, the fragmented message B02... and the fragmented message B0n in the first storage area of ​​the memory 204, respectively, the address is the area of ​​mbuf_1, mbuf_2... and mbuf_n.

[0177] Step 203: The virtual host reads the multiple fragment messages stored in the storage.

[0178] Step 204: The virtual host determines the order of the multiple fragment messages read from the memory.

[0179] Among them, the virtual host can determine the order of multiple fragment messages according to the multiple fragment messages stored in the memory. For example, the virtual host can determine the order of multiple fragment messages according to the header set stored in the memory, and the header set includes: the headers of all non-first fragment messages belonging to the initial message, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs. For example, the header of the fragment message has fragment offset information, and the fragment offset information includes the position of the fragment message offset from the beginning of the initial message to which it belongs. It should be noted that the message ID carried by the fragment message is the ID of the message to which the fragment message belongs. The virtual host can determine the position of the second fragment message in the message to which it belongs according to the fragment offset information of the second fragment message. The second fragment message is any fragment message among the multiple fragment messages received by the network card.

[0180] Step 205: The virtual host generates indication information, which includes: descriptors of storage addresses of multiple fragment messages, and the descriptors of storage addresses of multiple fragment messages are arranged in the order of the multiple fragment messages.

[0181] That is, the indication information can be used to indicate: the order of multiple fragment messages. Fig.12 and Fig.13 As shown, the process of generating instruction information by the virtual host may include:

[0182] Step 2051: The virtual host hashes the header set to obtain a first hash value.

[0183] The virtual host performs hash processing on the header of the second fragment message in the header set to obtain a first hash value, which may be a unique ID (which may be identified by ufid) of the message to which the second fragment message belongs.

[0184] Step 2052: The virtual host queries the first address queue chain corresponding to the first hash value in the hash table, wherein the hash table is used to record: the correspondence between the hash value and the address queue chain, the address queue chain includes address queues corresponding to multiple third-category message identifiers, and the third-category message identifiers corresponding to different address queues are different.

[0185] The virtual host uses the first hash value as a key value, inserts it into the hash table, and determines the first address queue chain corresponding to the first hash value. For example, the virtual host determines the first address queue chain H[X] in the hash table according to the first hash value. The first address queue chain H[X] includes multiple IP address queues (ip queue) corresponding to message identifiers. Among them, the third-category message identifier includes list information, ufid identifier, message ID (ip.id) of the fragment to which the address belongs, fragment offset (ip.offset) of the fragment message to which the address belongs, and flag (ip.more_flag) of the fragment message to which the address belongs. The address queue (mbuf) corresponding to the third-category message identifier.

[0186] Step 2053: The virtual host determines the first address queue corresponding to the third category message identifier carried by each header in the first address queue chain based on the third category message identifier carried by each header in the header set.

[0187] For example, the virtual host searches the first address queue (iq_1) corresponding to the third type message identifier in the first address queue chain H[X].

[0188] Step 2054: The virtual host determines the target position of the fragmented message to which each header belongs based on each header, and writes the storage address of the fragmented message to which each header belongs in the memory into the first address position in the first address queue, wherein the first address queue has multiple address positions arranged in sequence, and the first address position is the address position of the target position among the multiple address positions.

[0189] For example, the virtual host first determines the second position of the load of the fragment message to which the header belongs in the load of the initial message according to the offset information included in the header of the fragment message B02. Then the virtual host writes the storage address mbuf_2 of the fragment message B02 in the memory to the second address position in the first address queue.

[0190] Step 2055: The virtual host obtains the storage address of the first fragment message belonging to the initial message.

[0191] For example, it is assumed that the first fragment message of the initial message aggregation is fragment message B01. The virtual host obtains the storage address mbuf_1 of the fragment message B01 in the memory.

[0192] Step 2056: The virtual host writes the storage address of the first fragment message into the first address position among the multiple address positions. For example, the virtual host writes the storage address mbuf_1 of the fragment message B01 into the first address position.

[0193] Step 2057: The virtual host generates indication information according to the storage addresses in the multiple address locations.

[0194] Wherein, before the virtual host generates the indication information, the reorganization condition needs to be met. The reorganization condition includes a plurality of address locations storing storage addresses of fragmented messages belonging to the initial message. For example, the virtual host can determine whether the storage addresses of the fragmented messages belonging to the initial message are stored in the plurality of address locations according to the header in the initial message. For example, the virtual host first determines whether the fragmented message belongs to the last fragmented message of the message to which it belongs based on the MF field in the flag of the fragmented message included in the header of the initial message. When the MF field is 0, the fragmented message is the last fragmented message; when the MF field is 1, the fragmented message is not the last fragmented message. When the last fragmented message is stored in the memory, the total length (the sum of the fragment offset and the total length) of the message to which the last fragmented message belongs can be determined based on the fragment offset and total length information included in its header. After determining the total length of the message to which the last fragment message belongs, when the sum of the lengths of all fragment messages belonging to the message stored in the memory is equal to the total length, it is determined that the reassembly condition is met.

[0195] Optionally, the virtual host may describe the storage address of the fragmented message by a descriptor of the storage address. Then, the virtual host generates the indication information including: the descriptors of the storage addresses of the multiple fragmented messages according to the storage addresses in the multiple address positions, and the descriptors of the storage addresses of the multiple fragmented messages are arranged in the order of the multiple fragmented messages. It can also be understood that the virtual host reorders the descriptors corresponding to the storage addresses, and the arrangement order of the reordered descriptors is the same as the arrangement order of the multiple fragmented messages.

[0196] For example, please continue to refer to Fig.11 , the arrangement order of the above-mentioned fragment message B01, fragment message B02... and fragment message B0n in the message to which they belong is fragment message B0n, fragment message B01... and fragment message B02. The descriptors corresponding to fragment message B0n, fragment message B01... and fragment message B02 in sequence include descriptor 2 (desc_2), descriptor n (desc_n)... and descriptor 1 (desc_1). Then the descriptors of the storage addresses of the fragment message B01, fragment message B02... and fragment message B0n are arranged in the order of the fragment messages as: desc_1, desc_2... and desc_n.

[0197] Step 206: The virtual host stores the instruction information in the memory.

[0198] The virtual host stores the indication information in a third storage area of ​​the memory, and both the client virtual host and the client storage can access the third storage area, and the third storage area can be a storage area pointed to by a descriptor table. The descriptor table has a virtual input / output header identifier (virtio_hdr).

[0199] Step 207: The client obtains the indication information from the memory, and aggregates the multiple fragmented messages according to the indication information to obtain an initial message.

[0200] Among them, after the virtual host stores the indication information in the memory, the client can first send packet receiving information, which may include an aggregation identifier, so that after receiving the packet receiving information, the client determines to perform aggregation operations on multiple fragmented messages obtained subsequently to obtain a complete initial message.

[0201] Optionally, the client sequentially obtains the fragmented messages stored in each storage address indicated by the indication information, and arranges the obtained fragmented messages in sequence according to the order in which the fragmented messages are obtained.

[0202] It should be noted that the above message reassembly stage can be applied in the following cases: Fig.14 The network card driver 2041 of the client 204 shown is in the scenario of virtio. The network card driver 2041 includes a descriptor table 2041a, an available ring (availablering) 2041b and a used ring (used ring) 2041c. Among them, the available descriptors are stored in the available ring 2041b. The used descriptors are stored in the used ring 2041c. After the virtual host generates the indication information in the above step 205, the descriptors of the storage addresses of the multiple fragmented messages included in the indication information can be loaded into the available ring. At this time, the third storage area in the memory refers to the area where the available ring is stored in the memory. The network card driver of the client can obtain the indication information in the available ring, and read the load stored in the storage address pointed to by the descriptor in the memory according to the indication information.

[0203] In summary, the message processing method provided by the embodiment of the present application stores the received fragmented messages through the network card, and arranges the storage addresses of the stored fragmented messages in the memory by using the virtual host. The client can obtain the complete message by obtaining the fragmented messages stored therein through the arranged storage addresses, so there is no need for the client to reassemble the fragmented messages. Compared with the related art, the client needs to parse the received fragmented messages and reassemble them into a complete message, which saves the processing resources of the client and enables the client to provide resource processing services to the greatest extent.

[0204] The two message processing methods provided in the embodiments of the present application (such as Figure 4 and Fig.10 The message processing method shown in the figure) can be applied to one end device, that is, one end device can execute the above two message processing methods.

[0205] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0206] The present application embodiment provides a message processing device, which is applied to a network card in a terminal device, such as Fig.15 As shown, the message processing device 400 includes: a first receiving module 401, a first query module 402 and an execution module 403.

[0207] The first receiving module 401 is used to receive multiple first fragment messages, wherein the multiple first fragment messages all carry a first type of message identifier, the first type of message identifier includes a message ID, and at least two of the multiple first fragment messages carry the same message ID;

[0208] The first query module 402 is used to query the first type of message identifiers carried by the multiple first fragment messages in the message identifier set; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first type of message identifier carried by at least one fragment message processed by OVS in the end device, and the first type of message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message includes: part or all of the processing operations performed by OVS on any fragment message;

[0209] The execution module 403 is used to, when the first type of message identifier carried by the first fragment message is queried, sequentially execute the processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message.

[0210] Optionally, the first type of message identifier also includes: destination Internet Protocol address IP and source IP.

[0211] Optionally, the above-mentioned first query module 402 is used to: query the first type of message identifier carried by the first fragment message in a mapping table, the mapping table is used to record: the correspondence between the first type of message identifier in the message identifier set and the flow table item of the flow table, and the flow table is used to record: the correspondence between the flow table item of the flow table and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message.

[0212] Optionally, the message processing device 400 further includes: a first determination module 404 , a second query module 405 , a second determination module 406 and a third determination module 407 .

[0213] The first determination module 404 is used to determine the first flow table entry corresponding to the first type of message identifier carried by the first fragment message according to the mapping table before sequentially executing the processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message.

[0214] A second query module 405, configured to query the first flow table entry in the flow table;

[0215] A second determining module 406 is configured to determine, when the first flow table entry is found in the flow table, a processing operation sequence corresponding to the first flow table entry according to the flow table;

[0216] The third determining module 407 is configured to use the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

[0217] Optionally, the message processing device 400 further includes: a sending module 408 , a second receiving module 409 and an updating module 410 .

[0218] A sending module 408 is used to send the first fragment message to the OVS in the end device when the first category message identifier carried by the first fragment message is not queried, so that the OVS performs one or more processing operations on the first fragment message, and when the first fragment message is the first fragment message in the message to which the first fragment message belongs, send the first category message identifier carried by the first fragment message to the network card, and the processing operation sequence corresponding to the first category message identifier, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs;

[0219] The second receiving module 409 is used to receive the first type of message identifier carried by the first fragment message sent by the OVS, and the processing operation sequence corresponding to the first type of message identifier;

[0220] The updating module 410 is used to add the first type of message identifier carried by the first fragment message to the message identifier set.

[0221] The present application embodiment provides a message processing device, which is applied to an OVS in a terminal device, such as Fig.16 As shown, the message processing device 500 includes: a receiving module 501, an execution module 502, a generation module 503 and a sending module 504.

[0222] Receiving module 501, used for receiving the first fragment message sent by the network card in the terminal device;

[0223] An execution module 502 is used to perform one or more processing operations on the first fragment message;

[0224] A generation module 503 is used to generate a first-class message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-class message identifier when the first fragment message is the first fragment message in the message to which the first fragment message belongs, wherein among the multiple first fragment messages carrying the first-class message identifier, at least two first fragment messages carry the same message ID, the first-class message identifier includes a message ID, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; the processing operation sequence corresponding to the first-class message identifier carried by the first fragment message includes: part or all of the processing operations in one or more processing operations;

[0225] The sending module 504 is used to send the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier to the network card.

[0226] The embodiment of the present application provides a message processing device, the message processing device comprising: a client and a virtual host;

[0227] The virtual host is used to determine the order of multiple fragmented messages received by the network card in the end device;

[0228] The virtual host is used to generate indication information, and the indication information is used to indicate: the order of multiple fragment messages;

[0229] The client is used to obtain instruction information;

[0230] The client is used to aggregate multiple fragmented messages according to the indication information to obtain an initial message.

[0231] Optionally, the message processing device further includes: a memory; the plurality of fragment messages are stored in the memory of the terminal device, and the virtual host is further used to: determine the order of the plurality of fragment messages according to the plurality of fragment messages stored in the memory;

[0232] After generating the indication information, the virtual host is used to store the indication information in a memory, wherein the indication information includes: descriptors of storage addresses of multiple fragment messages, and the descriptors of storage addresses of multiple fragment messages are arranged in the order of the multiple fragment messages.

[0233] Optionally, the virtual host is also used to determine the order of multiple fragmented messages based on a header set stored in the memory, the header set including: headers of all non-first fragmented messages belonging to the initial message, and the message ID carried by the fragmented message is the ID of the message to which the fragmented message belongs.

[0234] Optionally, the header and payload of the first fragment message belonging to the initial message are stored in a first storage area in the memory, the header of the non-first fragment message belonging to the initial message is stored in a second storage area, and the payload of the non-first fragment message is stored in the first storage area of ​​the memory.

[0235] Optionally, virtual hosts are also used to:

[0236] Hash the header set to obtain a first hash value;

[0237] Querying a first address queue chain corresponding to a first hash value in a hash table, wherein the hash table is used to record: a correspondence between a hash value and an address queue chain, the address queue chain includes address queues corresponding to a plurality of third-class message identifiers, and different third-class message identifiers correspond to different address queues, and each fragment message in any message carries a third-class message identifier;

[0238] Based on the third-category message identifier carried by each header in the header set, determine the first address queue corresponding to the third-category message identifier carried by each header in the first address queue chain;

[0239] Determine a target position of each fragment message in the multiple fragment messages according to the sequence of the multiple fragment messages;

[0240] Writing the storage address of each fragment message in the memory into the first address position in the first address queue, wherein the first address queue has a plurality of address positions arranged in sequence, and the first address position is an address position of a target position among the plurality of address positions;

[0241] Obtain the storage address of the first fragment message belonging to the initial message;

[0242] Writing the storage address of the first fragment message into the first address position among the multiple address positions;

[0243] Indicative information is generated based on storage addresses in a plurality of address locations.

[0244] Optionally, the multiple fragment messages and the indication information are stored in a memory of the terminal device, and the client is further used for:

[0245] Obtain indication information from a memory, the indication information comprising: descriptors of storage addresses of a plurality of fragment messages, wherein the descriptors of the storage addresses of the plurality of fragment messages are arranged in the order of the plurality of fragment messages;

[0246] Sequentially obtain the fragmented message stored in each storage address indicated by the indication information;

[0247] Arrange the obtained fragmented messages in sequence according to the order in which they were obtained.

[0248] It should be noted that: the message processing device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal device is divided into different functional modules to complete all or part of the functions described above. In addition, the message processing device provided in the above embodiment and the message processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0249] The embodiment of the present application provides a network card, which includes a processing component, a storage medium and a communication interface, wherein the processing component and the storage medium are both connected to the communication interface, and the processing component executes the steps executed by the network card in the above method embodiment based on the program in the storage medium. For example, Figure 4 In the embodiment shown, steps 101 to 105, step 109 and Fig.10 In the illustrated embodiment, step 201 is shown. By way of example, the processing component may be a component having a processing function, such as a processing circuit.

[0250] The embodiment of the present application provides an end device, which includes: a processor, a memory, and a network card provided in the above embodiment; the processor is used to run OVS based on the program in the memory, and execute the steps performed by OVS in the above method embodiment through OVS. For example, Figure 4 In the illustrated embodiment, steps 106 to 108 are shown.

[0251] An embodiment of the present application provides a terminal device, the terminal device comprising: a processor and a memory;

[0252] The processor is used to run the virtual host and the client based on the program in the memory, and execute the steps performed by the virtual host in the above method embodiment through the virtual host. For example, Fig.10 Steps 203 to 206 in the embodiment shown are performed by the client through the client. For example, Fig.10 Step 207 in the embodiment shown.

[0253] For example, Fig.17 A schematic diagram of a terminal device structure provided in an embodiment of the present application, the terminal device can be Figure 1 or Figure 8 Path determination device, recording device, or management device in. See Fig.17 , Fig.17The device shown may include a processor 401, a memory 402, a communication interface 403, and a bus 404. The processor 401, the memory 402, and the communication interface 403 are communicatively connected via the bus 404. There are multiple communication interfaces 403, which are used to communicate with other devices under the control of the processor 401, and the memory 402 is used to store instructions; the processor 401 can call the instructions stored in the memory 402 via the bus 404.

[0254] The present application provides a readable storage medium, in which a program is stored; when the program is executed by a processing component, Figure 4 or Fig.10 By way of example, the processing component may be a component having a processing function such as a processing circuit or a processor.

[0255] The embodiment of the present invention further provides a program product. When the program product is run on a network card, the network card executes the steps executed by the network card in the message processing method provided in the embodiment of the present invention. For example, Figure 4 In the embodiment shown, steps 101 to 105, step 109 and Fig.10 Step 201 in the embodiment shown. Alternatively, when the program product is run on a processor, the processor is caused to execute the steps of the client, OVS or virtual host in the message processing method provided in the embodiment of the present invention. For example, Figure 4 Steps 106 to 108 in the embodiment shown, or Fig.10 Steps 203 to 207 in the illustrated embodiment.

[0256] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0257] In the present application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "plurality" refers to two or more than two, unless otherwise clearly defined.

[0258] In this application, the term "and / or" is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0259] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A message processing method, It is characterized in that A network card applied to a terminal device, the method comprising: Receive multiple first fragment messages, wherein the multiple first fragment messages all carry a first-class message identifier, the first-class message identifier includes a message ID, and at least two first fragment messages among the multiple first fragment messages carry the same message ID, the at least two first fragment messages are fragment messages obtained from the same message, and the at least two first fragment messages are processed the same on the forwarding plane; The method further comprises: querying the first type of message identifier carried by the first fragment message in the mapping table stored in the network card; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first type of message identifier carried by at least one fragment message processed by the open virtual switch OVS in the end device, and the first type of message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message includes: OVS performs a processing operation on any fragment message; The message identifier set is a set of all first-class message identifiers in the mapping table, the mapping table is used to record: the correspondence between the first-class message identifiers in the message identifier set and the flow table items of the flow table, the flow table is used to record: the flow table items of the flow table, the processing operation sequence corresponding to the first-class message identifier carried by any fragment message, and the correspondence between the second-class message identifier, the second-class message identifier is located in the first fragment message of any message, and is not located in the non-first fragment message of any message; When the first type of message identifier carried by the first fragment message is queried, determining a first flow table entry corresponding to the first type of message identifier carried by the first fragment message according to the mapping table; Query the first flow table entry in the flow table; When the first flow table entry is queried in the flow table, determining a processing operation sequence corresponding to the first flow table entry according to the flow table; Using the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message; The processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message are sequentially performed on the first fragment message.

2. The method according to claim 1, It is characterized in that The first type of message identifier includes: destination Internet Protocol address IP and source IP.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: When the first-class message identifier carried by the first fragment message is not found, the first fragment message is sent to the OVS in the end device, so that the OVS performs one or more processing operations on the first fragment message, and when the first fragment message is the first fragment message in the message to which the first fragment message belongs, the first-class message identifier carried by the first fragment message and the processing operation sequence corresponding to the first-class message identifier are sent to the network card, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; Receive the first type of message identifier carried by the first fragment message sent by the OVS, and a processing operation sequence corresponding to the first type of message identifier; The first type of message identifier carried by the first fragment message is added to the message identifier set.

4. A message processing method, It is characterized in that An open virtual switch OVS applied to an end device, the method comprising: Receive a first fragment message sent by the network card in the terminal device, the network card in the terminal device is used to query the first category message identifier carried by the first fragment message in the mapping table stored in the network card, and when the first category message identifier carried by the first fragment message is not queried, send the first fragment message to the OVS in the terminal device, the mapping table is used to record: the correspondence between the first category message identifier in the message identifier set and the flow table item of the flow table, the flow table is used to record: the flow table item of the flow table, the processing operation sequence corresponding to the first category message identifier carried by any fragment message, and the correspondence between the second category message identifier, the second category message identifier is located in the first fragment message of any message, and is not located in the first fragment message of the message. in any non-first fragmented message of any message; the network card in the terminal device is also used to determine, according to the mapping table, a first flow table item corresponding to the first type of message identifier carried by the first fragmented message when the first type of message identifier carried by the first fragmented message is queried; query the first flow table item in the flow table; when the first flow table item is queried in the flow table, determine, according to the flow table, a processing operation sequence corresponding to the first flow table item; use the processing operation sequence corresponding to the first flow table item as the processing operation sequence corresponding to the first type of message identifier carried by the first fragmented message; and sequentially perform the processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragmented message on the first fragmented message; Performing one or more processing operations on the first fragment message; When the first fragment message is the first fragment message in the message to which the first fragment message belongs, a first-category message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-category message identifier are generated, wherein among the multiple first fragment messages carrying the first-category message identifier, at least two first fragment messages carry the same message ID, the at least two first fragment messages are fragment messages obtained from the same message, the at least two first fragment messages have the same processing operation on the forwarding plane, the first-category message identifier includes a message ID, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; the processing operation sequence corresponding to the first-category message identifier carried by the first fragment message includes: some or all of the one or more processing operations; Sending the first type of message identifier carried by the first fragment message and a processing operation sequence corresponding to the first type of message identifier to the network card.

5. A message processing device, It is characterized in that A network card used in a terminal device, the device comprising: A first receiving module, configured to receive a plurality of first fragment messages, wherein the plurality of first fragment messages all carry a first-class message identifier, the first-class message identifier includes a message ID, and at least two of the plurality of first fragment messages carry the same message ID, the at least two first fragment messages are fragment messages obtained from the same message, and the at least two first fragment messages have the same processing operation on the forwarding plane; The first query module is used to query the first type of message identifier carried by the first fragment message in the mapping table stored in the network card; wherein, when the message identifier set is a non-empty set, the message identifier set includes: the first type of message identifier carried by at least one fragment message processed by the open virtual switch OVS in the end device, and the first type of message identifier carried by any fragment message in the at least one fragment message has a corresponding processing operation sequence, and the processing operation sequence corresponding to the first type of message identifier carried by any fragment message includes: OVS processes any fragment message The fragment message has been partially or completely processed, the message identifier set is a set of all first-class message identifiers in the mapping table, the mapping table is used to record: the correspondence between the first-class message identifiers in the message identifier set and the flow table entries of the flow table, the flow table is used to record: the flow table entries of the flow table, the processing operation sequence corresponding to the first-class message identifier carried by any fragment message, and the correspondence between the second-class message identifier, the second-class message identifier is located in the first fragment message of any message, and is not located in the non-first fragment message of any message; an execution module, configured to, when the first type of message identifier carried by the first fragment message is queried, sequentially execute, on the first fragment message, processing operations in a processing operation sequence corresponding to the first type of message identifier carried by the first fragment message; The device also includes: A first determination module is used to determine, according to the mapping table, a first flow table entry corresponding to the first type of message identifier carried by the first fragment message before sequentially performing processing operations in a processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message; A second query module, configured to query the first flow table entry in the flow table; A second determining module is used to determine, when the first flow table entry is queried in the flow table, a processing operation sequence corresponding to the first flow table entry according to the flow table; The third determination module is used to use the processing operation sequence corresponding to the first flow table entry as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message.

6. The device according to claim 5, It is characterized in that The first type of message identifier includes: destination Internet Protocol address IP and source IP.

7. The device according to claim 5 or 6, It is characterized in that The device also includes: a sending module, configured to send the first fragment message to the OVS in the terminal device when the first category message identifier carried by the first fragment message is not found, so that the OVS performs one or more processing operations on the first fragment message, and when the first fragment message is the first fragment message in the message to which the first fragment message belongs, send the first category message identifier carried by the first fragment message to the network card, and a processing operation sequence corresponding to the first category message identifier, wherein the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; A second receiving module, configured to receive a first-category message identifier carried by the first fragment message sent by the OVS, and a processing operation sequence corresponding to the first-category message identifier; An updating module is used to add the first type of message identifier carried by the first fragment message to the message identifier set.

8. A message processing device, It is characterized in that An open virtual switch OVS applied to an end device, the device comprising: A receiving module, used for receiving a first fragment message sent by a network card in the terminal device, the network card in the terminal device is used for querying a first-class message identifier carried by the first fragment message in a mapping table stored in the network card, and when the first-class message identifier carried by the first fragment message is not found, sending the first fragment message to the OVS in the terminal device, the mapping table is used to record: a correspondence between a first-class message identifier in a message identifier set and a flow table entry of a flow table, the flow table is used to record: a flow table entry of the flow table, a processing operation sequence corresponding to the first-class message identifier carried by any fragment message, and a correspondence between a second-class message identifier, the second-class message identifier being located in the first fragment message of any message, and The network card in the terminal device is also used for determining the first flow table item corresponding to the first type of message identifier carried by the first fragment message according to the mapping table when the first type of message identifier carried by the first fragment message is queried; querying the first flow table item in the flow table; when the first flow table item is queried in the flow table, determining the processing operation sequence corresponding to the first flow table item according to the flow table; using the processing operation sequence corresponding to the first flow table item as the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message; and sequentially executing the processing operations in the processing operation sequence corresponding to the first type of message identifier carried by the first fragment message on the first fragment message; An execution module, configured to execute one or more processing operations on the first fragment message; A generation module, used for generating a first-category message identifier carried by the first fragment message and a processing operation sequence corresponding to the first-category message identifier when the first fragment message is the first fragment message in the message to which the first fragment message belongs, wherein among multiple first fragment messages carrying the first-category message identifier, at least two first fragment messages carry the same message ID, the at least two first fragment messages are fragment messages obtained from the same message, the at least two first fragment messages have the same processing operation on the forwarding plane, each fragment message in any message carries the first-category message identifier, and the processing operation sequence corresponding to the first-category message identifier carried by the first fragment message includes: some or all of the processing operations in the one or more processing operations, and the message ID carried by the fragment message is the ID of the message to which the fragment message belongs; The sending module is used to send the first type of message identifier carried by the first fragment message and the processing operation sequence corresponding to the first type of message identifier to the network card.

9. A network card, It is characterized in that The network card includes a processing component, a storage medium and a communication interface, the processing component and the storage medium are both connected to the communication interface, and the processing component executes the message processing method as described in any one of claims 1 to 3 based on the program in the storage medium.

10. A terminal device, It is characterized in that The terminal device comprises: a processor, a memory and the network card according to claim 9; The processor is used to run an open virtual switch OVS based on the program in the memory, and execute the message processing method according to claim 4 through OVS.

11. A readable storage medium, It is characterized in that The storage medium stores a program; when the program is executed by the processing component, the method described in any one of claims 1 to 4 is implemented.