Method and device for processing message

By adding additional information fields instead of headers to the message data part, the problem of increased message length and processing overhead caused by on-path processing is solved, the efficiency of fragmentation and reorganization is improved, and the processing overhead of on-path processing nodes is reduced.

CN114615354BActive Publication Date: 2024-09-13ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210383327.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2024-09-13
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

The length of the message caused by the associated processing increases. When it exceeds the specified limit, it needs to be fragmented or reassembled, which increases the processing overhead of the associated processing node.

Method used

In the first path-associated processing node, the processed message is added with additional information fields in the data part instead of in the header for fragmentation processing, thereby avoiding data copying and improving fragmentation and reorganization efficiency.

Benefits of technology

By adding fields to the data part, data copies during the fragmentation process are reduced, the processing overhead of the associated processing nodes is reduced, and the efficiency of fragmentation reorganization is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615354B
    Figure CN114615354B
Patent Text Reader

Abstract

The present disclosure provides a method and device for processing a message, the method is executed by a first associated processing node, the first associated processing node is communicatively connected with a second associated processing node, the method comprises: receiving a first message; performing a first associated processing on the first message; adding a first field to a data portion of the first message after the first associated processing to obtain a second message, the first field comprising additional information obtained through the first associated processing; fragmenting the second message to obtain a plurality of fragmented messages, the plurality of fragmented messages comprising a first fragmented message, the first fragmented message comprising the first field; and sending the first fragmented message to the second associated processing node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer network technology, and in particular to a method and device for processing messages. Background Art

[0002] Before the message leaves the source device and arrives at the destination device, the on-path processing node can perform on-path processing on the message. On-path processing may include encryption and / or decryption processing, for example. On-path processing may cause the message length to increase. If the length of the message after on-path processing exceeds the specified limit, the on-path processing node needs to fragment or reassemble the message. Fragmentation or reassembly will increase the processing overhead of the on-path processing node. Summary of the invention

[0003] In view of this, the present disclosure provides a method and apparatus for processing messages to reduce the overhead of fragmentation processing performed by an accompanying processing node.

[0004] In a first aspect, a method for processing a message is provided, the method being executed by a first on-path processing node, the first on-path processing node being communicatively connected to a second on-path processing node, the method comprising: receiving a first message; performing a first on-path processing on the first message; adding a first field to a data portion of the first message after the first on-path processing to obtain a second message, the first field comprising additional information obtained after the first on-path processing; fragmenting the second message to obtain a plurality of fragmented messages, the plurality of fragmented messages comprising a first fragmented message, the first fragmented message comprising the first field; and sending the first fragmented message to the second on-path processing node.

[0005] Optionally, the first field is located at the end of the second message.

[0006] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message. The method also includes: modifying the second protocol number field in the header of the first message to the first protocol number, and the first protocol number is used to indicate that the first field is added to the data part of the first message.

[0007] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated processing so that the second associated processing node can determine whether the received fragment message is complete.

[0008] Optionally, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number field are used to record the sequence number and the fragment number of the second message respectively, so that the second associated processing node determines the first fragment message of the second message.

[0009] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0010] Optionally, the first associated processing node is a network card, the first associated processing is encryption processing, and the second associated processing is decryption processing.

[0011] In a second aspect, a method for processing a message is provided, the method being executed by a second associated processing node, the second associated processing node being communicatively connected to the first associated processing node, the method comprising: receiving a first fragmented message sent by the first associated processing node, the first fragmented message belonging to a plurality of fragmented messages, the first fragmented message comprising a first field; parsing the first fragmented message to obtain the first field; reorganizing the plurality of fragmented messages to obtain a second message; deleting the first field in a data portion of the second message; performing a second associated processing on the second message from which the first field is deleted according to the first field to obtain a first message, the first field comprising additional information obtained by the first associated processing node performing the first associated processing on the first message, the second associated processing being determined by the additional information.

[0012] Optionally, the method further includes: adding the first fragment message to a bidirectional linked list; wherein the bidirectional linked list includes at least one fragment message with an equal source address and an equal sequence number.

[0013] Optionally, the first field is located at the end of the second message.

[0014] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message. The method also includes: modifying the second protocol number field in the header of the first message to the original protocol number.

[0015] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first in-path processing. The method also includes: judging whether the received fragment message is complete based on the length field.

[0016] Optionally, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number field are used to record the sequence number and fragment number of the second message respectively. The method also includes: determining the first fragment message of the second message based on the sequence number field and the fragment number field.

[0017] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0018] Optionally, the second associated processing node is a network card, the first associated processing is encryption processing, and the second associated processing is decryption processing.

[0019] In a third aspect, a device for processing messages is provided, wherein the device runs a first associated processing node, the first associated processing node is communicatively connected with a second associated processing node, and the device comprises: a network processing chip for receiving a first message; an associated processing chip for performing a first associated processing on the first message, and adding a first field to a data portion of the first message after the first associated processing to obtain a second message, wherein the first field includes additional information obtained through the first associated processing; the network processing chip is also used to fragment the second message to obtain a plurality of fragmented messages, wherein the plurality of fragmented messages include a first fragmented message, wherein the first fragmented message includes the first field, and sending the first fragmented message to the second associated processing node.

[0020] Optionally, the first field is located at the end of the second message.

[0021] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message. The network processing chip is also used to: modify the second protocol number field in the header of the first message to the first protocol number, and the first protocol number is used to indicate that the first field is added to the data part of the first message.

[0022] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated processing so that the second associated processing node can determine whether the received fragment message is complete.

[0023] Optionally, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number field are used to record the sequence number and the fragment number of the second message respectively, so that the second associated processing node determines the first fragment message of the second message.

[0024] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0025] Optionally, the device is a network card, the associated processing chip is an encryption and decryption chip, the first associated processing is encryption processing, and the second associated processing is decryption processing.

[0026] In a fourth aspect, a device for processing messages is provided, wherein the device runs a second associated processing node, the second associated processing node is communicatively connected to the first associated processing node, and the device comprises: a network processing chip, for receiving a first fragmented message, the first fragmented message belongs to a plurality of fragmented messages, the first fragmented message comprises a first field, and the first fragmented message is parsed to obtain the first field, and the plurality of fragmented messages are reassembled to obtain a second message; an associated processing chip, for deleting the first field in the data portion of the second message, and performing a second associated processing on the second message with the first field deleted according to the first field to obtain a first message, the first field comprising additional information obtained by the first associated processing node performing the first associated processing on the first message, and the second associated processing is determined by the additional information.

[0027] Optionally, the network processing chip is further used to: add the first fragment message to a bidirectional linked list; wherein the bidirectional linked list includes at least one fragment message with an equal source address and an equal sequence number.

[0028] Optionally, the first field is located at the end of the second message.

[0029] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message, and the network processing chip is further used to: modify the second protocol number field in the header of the first message to the original protocol number.

[0030] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first in-path processing. The network processing chip is also used to: determine whether the received fragmented message is complete based on the length field.

[0031] Optionally, the first field includes a serial number field and a fragment number field, and the serial number field and the fragment number field are used to record the serial number and fragment number of the second message respectively. The network processing chip is also used to: determine the first fragment message of the second message based on the serial number field and the fragment number field.

[0032] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0033] Optionally, the device is a network card, the associated processing chip is an encryption and decryption chip, the first associated processing is encryption processing, and the second associated processing is decryption processing.

[0034] According to a fifth aspect, a computer program product is provided, comprising an executable code, which, when executed, can implement the method described in the first aspect or the second aspect.

[0035] It is understandable that if the first field containing the additional information obtained by the first on-path processing is added to the header of the message, it will result in multiple copies of the first field during the fragmentation process. The present disclosure can avoid the process of data copying of the first field during the fragmentation process by adding the first field to the data portion of the first message, thereby improving the efficiency of fragment reorganization of on-path processing and further reducing the processing overhead of the on-path processing node. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 The figure is an example of a message fragmentation method.

[0037] Figure 2 A schematic flowchart of a method for processing a message provided in an embodiment of the present disclosure.

[0038] Figure 3 An example diagram of fragmenting a second message provided in an embodiment of the present disclosure.

[0039] Figure 4 A schematic diagram of another method for processing messages provided in an embodiment of the present disclosure.

[0040] Figure 5 A schematic flowchart of a method for reassembling a message provided in an embodiment of the present disclosure.

[0041] Figure 6 A schematic structural diagram of a device for processing messages provided in an embodiment of the present disclosure.

[0042] Figure 7 A schematic structural diagram of another device for processing messages provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0044] On-the-road processing

[0045] In network-based data transmission, data can be transmitted between network devices. Network devices may include, for example, source devices, destination devices, intermediate devices, etc. Data may be carried in messages. The source device processes the data to form messages (such as IP messages) that can be transmitted in the network, and transmits the messages to the network. After the message leaves the source device, it may pass through the intermediate device to reach the destination device. The source device may include devices such as a source host or a source host system. The destination device may include devices such as a destination host or a destination host system. The intermediate device may include devices such as a network card.

[0046] The intermediate device can perform additional processing on the message. For example, the intermediate device can encrypt, decrypt, compress or decompress the message. These additional processing performed by the intermediate device can be called on-line processing. It can be understood that on-line processing is processing performed outside the source device or the destination device. Therefore, the user of the source device or the destination device will not perceive the on-line processing, thereby improving the user experience.

[0047] Taking the intermediate device as a secure network card as an example, the on-the-road processing that can be implemented by the secure network card includes: encryption processing and / or decryption processing. The secure network card may include an encryption and decryption chip and a network processing chip. The encryption and decryption chip can be used to implement encryption processing and / or decryption processing. The network processing chip can be used to implement processing related to message transmission. The message sent by the source device can pass through the first secure network card. The first secure network card can encrypt the message and send the encrypted message through the network. Before the encrypted message reaches the destination device, it can pass through the second secure network card. The second secure network card can decrypt the encrypted message and transmit the decrypted message to the destination device. It can be understood that the secure transmission of data can be achieved through the encryption and decryption of the secure network card. The message sent by the user through the source device is unencrypted, and the message received by the destination device is also unencrypted. In other words, when the user transmits data securely through the secure network card, he will not feel the encryption and decryption process. Therefore, on-the-road processing through the secure network card can improve the user experience.

[0048] In some embodiments, the intermediate device may be referred to as an associated processing device. A network node that performs associated processing may be referred to as an associated processing node. The associated processing node may run on the intermediate device.

[0049] Fragmentation and reassembly

[0050] During data transmission, if the length of a message is greater than the specified value, the sending end (including the source device and the intermediate device) can fragment (or cut) the message to form multiple smaller fragmented messages for transmission. The receiving end (including the intermediate device and the destination device) can reassemble the fragmented messages to restore the original message.

[0051] It is understandable that, during the on-link processing, some fields or information may be added to the message, which may increase the length of the message. When the length of the message after on-link processing exceeds the specified value, the intermediate device may fragment or reassemble the message. For example, the network card used for encryption may fragment the message, and the network card used for user decryption may reassemble the message.

[0052] It is understandable that the message received by the intermediate device may be a fragmented message, and the intermediate device may perform secondary fragmentation on the fragmented message. For example, the intermediate device may perform on-path processing on the fragmented message, and after on-path processing, if the length of the fragmented message is greater than a specified value, the intermediate device may perform secondary fragmentation on the fragmented message.

[0053] A message may include a header and a data part. The header of a message may be used to indicate the information required for message transmission. For example, the header of a message may include one or more of the following information: protocol number, sequence number, fragment number, message length, destination address, and source address.

[0054] The protocol number can be used to indicate the type or version of the transmission protocol. The sequence number can be used to indicate the original data message to which the fragment message belongs. During the reassembly process, fragment messages with the same sequence number can be merged into one message. The fragment number can also be called an offset, which is used to indicate the offset of the data part of the fragment message in the original message, that is, the position of the data part of the fragment message relative to the original message. During the reassembly process, the fragment message can be restored to the appropriate position according to the fragment number. Fragmentation and reassembly can be implemented, for example, according to the method specified in the standard IP protocol.

[0055] Figure 1 This is an example diagram of a message fragmentation method. Figure 1 This section describes the method of message fragmentation.

[0056] like Figure 1 As shown, the first message 100 can be cut into fragment messages 110 to 140. As can be seen from the figure, the longer data part 1 is divided into four shorter parts, namely data part 2, data part 3, data part 4 and data part 5. Data part 2, data part 3, data part 4 and data part 5 constitute the data parts of fragment messages 110 to 140 respectively. It can be understood that the total length of data part 2 to data part 5 is equal to the length of data part 1.

[0057] Most of the information in the header of the fragment message can be copied from the header 1 of the first message 100. For example, the information such as the protocol number, sequence number, destination address and source address in the header of the fragment message can be copied from the header 1 of the first message 100, that is, these fields can be consistent with the corresponding fields in the header 1. A few fields of the fragment message may be different, for example, the fragment numbers of different fragment messages may be different.

[0058] The fragment numbers of different fragment messages can be determined according to the position of the data part of the fragment message in the first fragment message. Figure 1 For example, if the fragment message 110 is the first fragment message of the first message 100, the offset between the fragment message 110 and the first message 100 is 0, and the fragment number of the fragment message 110 is consistent with that of the first message 100. For example, if the fragment number of the first message 100 is 0, the fragment number of the fragment message 110 is also 0. Alternatively, the first message 100 may be a fragment message of a certain message, that is, the fragment number of the first message 100 may not be 0. For example, if the fragment number of the first message 100 is 175, the fragment number of the fragment message 110 may also be 175. The fragment message 140 is the last fragment message of the first message 100. If the offset of the data part of the fragment message 140 relative to the first message 100 is 525, the fragment number of the fragment message 140 may be the fragment number of the first message 110 plus 525.

[0059] The receiving end can reassemble the received fragmented messages. At the receiving end, multiple fragmented messages from the same message fragment can form a linked list. For example, fragmented messages with equal source addresses and sequence numbers can form a one-way list with fragment numbers from low to high. The fragmented messages received by the receiving end are complete, and reassembly can be achieved. In other words, the message can only be reassembled when the receiving end has received all the fragmented messages. The relevant technology can perform a trial reassembly every time a fragmented message is received. If the trial reassembly is successful, it means that the receiving end has received all the fragmented messages, and the receiving end can merge all the fragmented messages to restore the original message. For example, the merging can be achieved starting from the first fragmented message according to the one-way linked list.

[0060] As can be seen from the above, the on-link processing may cause the message length to increase. If the message length after on-link processing exceeds the specified limit, the on-link processing node needs to fragment the message. It is understandable that fragmentation processing will increase the processing overhead of the on-link processing node.

[0061] In view of the above problems, the present disclosure proposes a method for processing messages. Figure 2 A schematic flowchart of a method for processing a message provided in an embodiment of the present application. Figure 2The method shown may be performed by a first associated processing node and a second associated processing node. The first associated processing node may be communicatively connected to the second associated processing node. Figure 2 The method shown may include steps S210 to S290. Steps S210 to S250 may be performed by a first associated processing node, and steps S250 to S290 may be performed by a second associated processing node. The first associated processing node or the second associated processing node may be an intermediate device, such as a network card.

[0062] Step S210, receiving a first message.

[0063] The present disclosure does not limit the sender of the first message. Taking the first associated processing node as a network card as an example, the sender of the first message can be a source device.

[0064] The first message may include a header and a data portion. For example, S may be used to indicate the first message, IP may be used to indicate the header of the first message, and DATA may be used to indicate the data portion of the first message. In other words, S may be expressed as IP+DATA.

[0065] The first message may be a message that has been encapsulated by the source device and can be transmitted in the network. For example, the first message may be an IP message.

[0066] Step S220: performing first path associated processing on the first message.

[0067] The first associated processing may be an associated processing performed by the first associated processing node on the first message. For example, the first associated processing may be encryption processing. The second associated processing node may perform a second associated processing corresponding to the first associated processing. For example, the second associated processing may be decryption processing.

[0068] The first message after the first on-link processing can be represented as Sp. It can be understood that after the first on-link processing, the data part of the first message can change. For example, after the first on-link processing, DATA can be changed to DATAp, that is, Sp can be represented as IP+DATAp.

[0069] Step S230, adding a first field to the data portion of the first message after the first associated path processing to obtain a second message.

[0070] The first field may include additional information obtained through the first on-link processing. The additional information may be represented as PI, for example. Taking the first on-link processing as encryption processing as an example, the additional information may include information on how to perform decryption.

[0071] The first field can be added at any position of DATAp. For example, the first field can be added at the very beginning, the last part, or any position in the middle of DATAp. In other words, the first field can be located at the beginning, the end, or the middle of the data part of the second message. Figure 3 As shown, the first field may be located at the end of the second message 300 .

[0072] It is understandable that, in the case where the first field is located at the end of the second message, when adding the first field, the first field can be directly added at the end of DATAp. In other words, there is no need to insert the first field at a certain insertion point in the middle of Sp, nor is there a need to move the bits after the insertion point backward, so that the underlying hardware does not need to support the scatter / gather read / write function, thereby simplifying the hardware structure of the first associated processing node.

[0073] It is understandable that in the process of forming the second message from the first message, the length of the data part of the message changes. Therefore, the message length in the header of the second message can also be adaptively modified. For example, the message length in the header of the second message can be modified to the total length of the data part of the second message obtained after the first message is processed by the first on-link and the first field is added.

[0074] In some embodiments, the first field may also be referred to as a network transmission header (NTH) field.

[0075] Step S240, fragment the second message to obtain multiple fragment messages.

[0076] It is understandable that if the length of the second message is greater than the specified value, step S240 may be performed to fragment the second message. If the length of the second message is not greater than the specified value, the second message may be directly sent out. The specified value may be, for example, a maximum transmission unit (MTU).

[0077] The plurality of fragment messages may include a first fragment message, and the first fragment message may include a first field. It is understandable that the first field may be divided into at least one fragment message, that is, the first fragment message may include all or part of the first field.

[0078] The present disclosure does not limit the fragmentation method used to fragment the second message. For example, the fragmentation can be performed using a standard IP protocol fragmentation method.

[0079] Figure 3 FIG. 1 is an example diagram of fragmenting a second message provided by an embodiment of the present disclosure. Figure 3As shown, the first field is located at the end of the second message 300. The second message 300 can be cut into a plurality of fragment messages 310-350. The fragment message 350 can be the last fragment message of the second message 300. The first field can be divided into the fragment message 350, that is, the first fragment message can be the fragment message 350.

[0080] It can be understood that the source address, destination address and sequence number of the headers of the multiple fragmented messages generated by the second message fragmentation are all the same.

[0081] Step S250: The first associated processing node sends the first fragment message to the second associated processing node.

[0082] The first fragment message may be directly sent from the first associated processing node to the second associated processing node. The first fragment message may also be sent to the second associated processing node after passing through one or more network devices.

[0083] Step S260: parse the first fragment message to obtain a first field.

[0084] Optionally, the second associated processing node may determine whether the entire content of the first field is in the first fragment message. If the entire content of the first field is in the first fragment message, the first field may be directly retrieved. If the first fragment message includes a portion of the content of the first field, the first field may be obtained in combination with other fragment messages.

[0085] Step S270: reassemble the multiple fragmented messages to obtain a second message.

[0086] The present disclosure does not limit the method for reassembling multiple fragmented messages. For example, a reassembly method of a standard IP protocol may be used to reassemble multiple fragmented messages.

[0087] Step S280, deleting the first field in the data portion of the second message.

[0088] It is understandable that the content included in the first field is not the user data actually transmitted. After deleting the first field, the data part of the second message may contain the data content actually transmitted.

[0089] Step S290: performing a second process on the second message from which the first field is deleted according to the first field to obtain a first message.

[0090] The second processing corresponds to the first on-link processing, that is, after the first on-link processing and the second processing, the first message is still in the original form of the first message. As described above, the first field includes additional information obtained through the first on-link processing, so the second on-link processing node can perform the second processing on the second message with the first field deleted according to the additional information of the first on-link processing in the first field, thereby obtaining the first message originally received by the first on-link processing node.

[0091] The second on-path processing node can implement corresponding on-path processing according to the first field. The first field may include additional information obtained through the first on-path processing. The second on-path processing node can perform a second processing on the message after the reassembly is completed according to the additional information of the first on-path processing, thereby restoring the message to the first message received by the first on-path processing node. For example, the first on-path processing may be an encryption processing, and the second processing may be a decryption processing. The additional information may be encrypted and decrypted additional information. The second on-path processing node can perform a second processing according to the additional information of the encryption and decryption, thereby decrypting and restoring the message.

[0092] It is understandable that if the first field containing the additional information of the on-path processing is added to the header of the first message, the first field will be copied multiple times during the fragmentation process. The present disclosure can avoid the process of data copying of the first field during the fragmentation process by adding the first field to the data part of the first message (i.e., the original message), thereby improving the efficiency of the on-path processing fragment reorganization and further reducing the processing overhead of the on-path processing node.

[0093] As an implementation method, the second associated processing node can also realize the reassembly of the fragmented message according to the first field. For example, the second associated processing node can merge the fragmented messages after receiving the fragmented message including the first field (i.e., the first fragmented message). That is to say, before receiving the first fragmented message, the second associated processing node may not try to reassemble the fragmented message. For example, the first field can be located at the end of the second message, and the first fragmented message including the first field can be the last fragmented message of the second message. In some cases, the last fragmented message can arrive at the second associated processing node last. Therefore, when the second associated processing node receives the last fragmented message, it has already received most of the fragmented messages, or has received all the fragmented messages. In this case, the probability of successful reassembly is higher. Therefore, Figure 3 The method shown can also realize fast message reassembly, avoiding multiple reassembly attempts, thereby realizing efficient message reassembly.

[0094] Optionally, the first field may include one or more of the following fields: a first protocol number field, a length field, a sequence number field, a fragment number field, and an identification field.

[0095] The first protocol number field can be used to record the original protocol number of the first message. The first protocol number can record the protocol number recorded in the second protocol number field in the header of the first message. Figure 3 The method shown may also include modifying the second protocol number field in the header of the first message to the first protocol number. The first protocol number is used to indicate that the first field is added in the data part. The first protocol number can be represented by nth, for example. After the first message is fragmented, the protocol numbers indicated in the headers of the multiple fragmented messages generated can all be nth. After the second accompanying processing node receives the fragmented message, if it detects that the protocol number contained in the header is the first protocol number, it can be determined that the first field is added in the data part of the first message, so that the received fragmented message can be processed accordingly.

[0096] The length field can be used to indicate the length of the data portion of the first message after the first on-path processing. The length field can directly record the length of the data portion of the first message after the first on-path processing. Alternatively, the length field can record the length of the first message in other processing stages. Alternatively, the length field can record the length of other parts of the first message. The second on-path processing node can calculate the length of the data portion of the first message after the first on-path processing through the length field.

[0097] The second associated processing node can determine whether the received message is complete (i.e., whether all fragmented messages have been received) based on the indication of the length field. For example, the second associated processing node can calculate the total length of the data portion of the fragmented messages with the same source address and sequence number in the header. If the total length is equal to the length recorded in the length field, it can be determined that all fragmented messages have been received, and then all fragmented messages are merged. It can be understood that according to the indication of the length field and the total length of the data portion of the message received by the second associated processing node, the fragmented messages are merged and reassembled, and the reassembly can be done quickly without repeated attempts to reassemble, thereby making the reassembly efficiency higher.

[0098] The sequence number field and the fragment number field can be used to record the sequence number and fragment number of the second message, respectively. It can be understood that the second message is generated by the first message, the sequence number of the second message is the same as the sequence number of the first message, and the fragment number of the second message is the same as the fragment number of the first message. Therefore, the sequence number field and the fragment number field can also be used to record the sequence number and fragment number of the first message, respectively.

[0099] As can be seen from the above, after the message is fragmented, the sequence number of the first fragment message is equal to the sequence number of the original message, and the fragment number of the first fragment message is also equal to the fragment number of the original message. Therefore, the second accompanying processing node can determine which fragment message among the multiple fragment messages received is the first fragment message based on the sequence number field and the fragment number field. For example, if the sequence number and the fragment number in the header of the second fragment message are the same as the contents stored in the sequence number field and the fragment number field, it can be determined that the second packet message is the first fragment message. Alternatively, starting from the last fragment message, the length of the length field can be searched forward along the linked list composed of the fragment messages, so as to preliminarily determine the first fragment message. If the sequence number and the fragment number in the header of the preliminarily determined first fragment message are consistent with the contents of the sequence number field and the fragment number field in the first field, it can be determined that the preliminarily determined first fragment message is the first fragment message.

[0100] The identification field can be used to mark the first fragment message where the first field is located. For example, the identification field can be marked by a magic number. In some embodiments, the identification field can also be called a magic field.

[0101] The second associated processing node may receive multiple fragment messages, and the first field exists in some of the fragment messages (including the first fragment message) among the multiple fragment messages. The second associated processing node can determine which one of the multiple fragment messages is the first fragment message through the identification field, and further obtain all fragment messages including the first field according to the first fragment message, and then obtain the first field.

[0102] The identification field may be located at the end of the first field. The first fragment message marked by the identification field is the last fragment message containing the first field. If the first field in the first fragment is not complete, the remaining first field may be retrieved from the previous fragment message or the previous fragment messages to obtain the complete first field.

[0103] The second associated processing unit can construct a bidirectional linked list. The bidirectional linked list includes at least one fragment message with equal source address and equal sequence number. After receiving the fragment message, the second associated processing unit can add the fragment message to the corresponding bidirectional linked list. The bidirectional linked list can be constructed according to the order of the fragment number. For example, the bidirectional linked list can be constructed from low to high based on the fragment number. Based on the order of fragment numbers from low to high, the bidirectional linked list can be expressed as Next List. Or, based on the order of fragment numbers from high to low, the bidirectional linked list can be expressed as Prev List. The bidirectional linked list can enable the fragment message to retrieve other fragment messages forward and / or backward. For example, starting from the first fragment message, you can search in two directions to determine the length of the bidirectional linked list, so as to obtain the total length of the fragment messages that have been received. Or, starting from the first fragment message, you can search forward and preliminarily determine the first fragment message based on parameters such as the message length.

[0104] Figure 4 A schematic diagram of another method for processing messages provided in an embodiment of the present disclosure. Figure 4 The method shown can be performed by a source device, a first associated processing node, a second associated processing node, and a destination device. The first associated processing node or the second associated processing node can run on a network card. The first associated processing node may include a first associated processing unit and a first associated processing network unit. The second associated processing node may include a second associated processing unit and a second associated processing network unit. Figure 4 The method shown may include steps S410 to S490.

[0105] Step S410: The source device sends a first message S. S may include a header IP and a data portion DATA. The first associated processing node receives the first message S. The first associated processing network unit of the first associated processing node may receive the first message S.

[0106] Step S420: The first associated processing node sends the first message S to the first associated processing unit for processing.

[0107] The first associated path processing unit can perform the first associated path processing on the first message S. The data portion of the first message after the first associated path processing can be represented by DATAp. That is, the first message after the first associated path processing is IP+DATAp.

[0108] After completing the first associated processing, the first associated processing unit can add the first field NTH to the last part of S and modify the message length information of IP. Then the first message S becomes the second message Sp, which includes IP+DATAp+NTH.

[0109] The NTH field may include: additional information PI generated by the first associated processing unit performing the first associated processing, a sequence number field, a fragment number field, a first protocol number field, a length field, and an identification field. Among them, the sequence number field, the fragment number field, and the first protocol number field can be obtained from the partial information IP.INFO of the IP in the message S. The length field can be the length of DTATp, that is, DATAp.len. The identification field can be a magic field. For example, the NTH field can be expressed as PI+IP.INFO+DATAp.len+magic.

[0110] Step S430: delivering the second message Sp to the first associated processing network unit.

[0111] Step S440, the first associated processing network unit may modify the protocol information in the header IP in the second message Sp to nth. The modified IP may be represented by IPn. The modified second message may be represented by Spn. Spn may be represented by IPn+DATAp+NTH.

[0112] The first associated network unit can determine whether the size of the Spn exceeds the specified limit. If the size of the Spn does not exceed the specified limit, the first associated network unit can directly send the Spn out. If the size of the Spn exceeds the specified limit, the first associated network unit can fragment the Spn.

[0113] The first on-path processing network unit can fragment Spn according to the standard IP protocol to obtain multiple fragment messages. Multiple fragment messages can be expressed as Spn-1:IPn1+DATA1, Spn-2:IPn2+DATA2,..., Spn-(e-1):IPn(e-1)+DATA(e-1) and Spn-e:IPne+DATAe. Among them, Spn-1 is the first fragment message, and Spn-e is the last fragment message. It can be understood that Spn-e can be the first fragment message, NTH exists at least in Spn-e, and the magic field belongs to Spn-e.

[0114] Step S450: The second associated processing node receives a plurality of fragment messages.

[0115] After receiving the message, the second associated processing node can determine whether the received message is a fragmented message. If it is a fragmented message, step S460 can be performed. If the received message is not a fragmented message, the second processing can be performed without entering the reassembly process. As an implementation method, if the message received by the second associated processing node is not a fragmented message, the protocol number in the header of the message can be modified to the protocol number recorded in the protocol field in the first field.

[0116] Step S460: For the received fragmented message, the second associated processing network unit may use the fragmented message with the same source address and sequence number in the header to construct a bidirectional linked list Next / Prev List based on the fragment number from low to high.

[0117] The second associated path processing network unit may reassemble the received multiple fragmented messages to obtain a second message Sp.

[0118] The message reassembly method can be found in Figure 5 .about Figure 5 For a detailed introduction, please refer to the following text and will not be repeated here.

[0119] Step S470: The second associated path processing network unit delivers the second message Sp to the second associated path processing unit.

[0120] The second associated processing unit obtains the additional information PI from the NTH of the second message Sp. The second associated processing unit performs the second processing on DATAp according to the additional information PI. After the second processing is completed, NTH is removed and the message length of the IP in Sp is modified. The second message Sp can be converted into the first message S.

[0121] Step S480: The second associated path processing unit delivers the first message S to the second associated path processing network unit.

[0122] Step S490: The second associated processing node sends the first message S to the target device.

[0123] Figure 5 A schematic flow chart of a method for reassembling a message provided by an embodiment of the present disclosure. When the second associated processing node receives a fragment message Spn-X, it can execute Figure 5 The method shown in the figure realizes the reorganization of the original message (ie, the second message) to which Spn-X belongs. Figure 5 The method shown includes steps S510 to S590.

[0124] Step S510, determine whether the tail end of Spn-X is a magic field.

[0125] If the tail end of Spn-X is a magic field, since the magic field is located at the end of the second message, it can be determined that Spn-X is the last fragment message Spn-e.

[0126] If the tail end of Spn-X is a magic field, step S520 may be executed.

[0127] If the tail end of Spn-X is not a magic field, step S590 may be executed, that is, waiting for receiving subsequent fragment messages.

[0128] Step S520, determine whether Spn-X includes the entire content of the NTH field.

[0129] If Spn-X does not include the entire content of the NTH field, the NTH field still exists in other fragment messages, and step S530 can be performed. If Spn-S includes the entire content of the NTH field, step S540 can be performed.

[0130] Step S530, starting from Spn-X, along the order of Prev List of the bidirectional linked list, it is determined whether a plurality of continuous fragment messages can construct a complete NTH.

[0131] In step S530, if a complete NTH field can be constructed, step S540 can be executed.

[0132] In step S530, if the complete NTH field cannot be constructed, step S590 may be executed, that is, waiting for subsequent fragment messages.

[0133] Step S540: extract the content in the NTH field. For example, one or more of the length field, the sequence number field, and the fragment number field in the NTH field may be extracted.

[0134] Step S550, calculating the total length of all fragment messages in the bidirectional linked list.

[0135] Step S560, determining whether the total length of all fragment messages in the bidirectional linked list is equal to the content indicated by the length field in NTH.

[0136] It is understandable that if the total length of all fragment messages in the bidirectional linked list is equal to the content indicated by the length field in NTH, it can be preliminarily determined that the second associated processing node has received all fragment messages of the second message. If the total length of all fragment messages in the bidirectional linked list is not equal to the content indicated by the length field in NTH, the second associated processing node has not received all fragment messages of the second message and needs to continue receiving fragment messages, that is, execute step S590.

[0137] Step S570, determine whether the sequence number and fragment number of the first fragment message header in the bidirectional linked list are equal to the indications of the sequence number field and the fragment number field in the NTH.

[0138] If the sequence number and the fragment number of the first fragment message in the doubly linked list are equal to the indication of the sequence number field and the fragment number field in NTH, it can be further determined that the fragment message in the doubly linked list is complete (that is, the fragment message in the doubly linked list is all the fragment messages in the second message), and step S580 is executed. If the sequence number and the fragment number of the first fragment message in the doubly linked list are not equal to the indication of the sequence number field and the fragment number field in NTH, the fragment message in the doubly linked list is not all the fragment messages in the second message, and step S590 can be executed, that is, waiting for receiving subsequent fragment messages.

[0139] Step S580: merge the fragmented messages in the bidirectional linked list. For example, the fragmented messages Spn-1 to Spn-e may be merged into the second message Sp according to the reorganization method of the standard IP protocol.

[0140] Combination of the above Figure 2 to Figure 5 The method embodiment of the present disclosure is described in detail. Figure 6-7 The device embodiment of the present disclosure is introduced. It can be understood that the device embodiment corresponds to the method, and the parts not described in detail can refer to the method embodiment.

[0141] Figure 6 A schematic structural diagram of a message processing device 600 provided in an embodiment of the present disclosure. The message processing device 600 may run a first associated processing node, and the first associated processing node is communicatively connected with a second associated processing node. The device 600 may include: a network processing chip 610 and an associated processing chip 620.

[0142] The network processing chip 610 may be configured to receive a first message.

[0143] The on-link processing chip 620 can be used to perform first on-link processing on the first message, and add a first field to the data part of the first message after the first on-link processing to obtain a second message, wherein the first field includes additional information obtained through the first on-link processing.

[0144] The network processing chip 610 is also used to fragment the second message to obtain multiple fragment messages, where the multiple fragment messages include a first fragment message, where the first fragment message includes the first field, and send the first fragment message to the second associated processing node.

[0145] Optionally, the first field is located at the end of the second message.

[0146] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message. The network processing chip 610 is also used to: modify the second protocol number field in the header of the first message to the first protocol number, and the first protocol number is used to indicate that the first field is added to the data part of the first message.

[0147] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated processing so that the second associated processing node can determine whether the received fragment message is complete.

[0148] Optionally, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number are used to record the sequence number and the fragment number of the second message respectively, so that the second associated processing node determines the first fragment message of the second message.

[0149] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0150] Optionally, the device 600 is a network card, the associated processing chip 620 is an encryption and decryption chip, the first associated processing is encryption processing, and the second processing is decryption processing.

[0151] Figure 7 A schematic structural diagram of another apparatus 700 for processing a message provided in an embodiment of the present disclosure. The apparatus 700 for processing a message may run a second associated processing node, and the first associated processing node is communicatively connected with the second associated processing node. The apparatus 700 may include: a network processing chip 710 and an associated processing chip 720.

[0152] The network processing chip 710 may be configured to receive a first fragment message, the first fragment message belonging to a plurality of fragment messages, the first fragment message including a first field, and parse the first fragment message to obtain the first field, and reassemble the plurality of fragment messages to obtain a second message;

[0153] The in-path processing chip 720 can be used to delete the first field in the data part of the second message, and perform second processing on the second message with the first field deleted based on the first field to obtain a first message, wherein the first field includes additional information obtained by the first in-path processing node performing the first in-path processing on the first message, and the second processing is determined by the additional information.

[0154] Optionally, the network processing chip 710 is further used to: add the first fragment message to a bidirectional linked list; wherein the bidirectional linked list includes at least one fragment message with an equal source address and an equal sequence number.

[0155] Optionally, the first field is located at the end of the second message.

[0156] Optionally, the first field includes a first protocol number field, which is used to record the original protocol number of the first message. The network processing chip 710 is also used to modify the second protocol number field in the header of the first message to the original protocol number.

[0157] Optionally, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first in-path processing. The network processing chip 710 is also used to: determine whether the received fragmented message is complete based on the length field.

[0158] Optionally, the first field includes a sequence number field and a fragment number field, the sequence number field and the fragment number are used to record the sequence number and fragment number of the second message respectively, and the network processing chip 710 is also used to: determine the first fragment message of the second message according to the sequence number field and the fragment number field.

[0159] Optionally, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

[0160] Optionally, the device is a network card, the associated processing chip is an encryption and decryption chip, the first associated processing is encryption processing, and the second processing is decryption processing.

[0161] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments of the present disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.

[0162] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0164] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0165] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

[0166] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A method for processing a message, the method being executed by a first associated processing node, the first associated processing node being communicatively connected with a second associated processing node, the method comprising: receiving a first message; Performing first path-associated processing on the first message; adding a first field to a data portion of the first message after the first on-link processing to obtain a second message, wherein the first field includes additional information obtained through the first on-link processing; Fragment the second message to obtain multiple fragment messages, where the multiple fragment messages include a first fragment message, and the first fragment message includes the first field; Send the first fragment message to the second associated processing node.

2. The method according to claim 1, wherein the first field is located at the end of the second message.

3. The method according to claim 1, wherein the first field comprises a first protocol number field, and the first protocol number field is used to record an original protocol number of the first message, and the method further comprises: The second protocol number field in the header of the first message is modified to the first protocol number, where the first protocol number is used to indicate that the first field is added to the data part of the first message.

4. According to the method of claim 1, the first field includes a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated processing so that the second associated processing node can determine whether the received fragment message is complete.

5. According to the method according to claim 1, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number field are respectively used to record the sequence number and fragment number of the second message, so that the second accompanying processing node can determine the first fragment message of the second message.

6. According to the method according to claim 1, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

7. A method for processing a message, the method being executed by a second associated processing node, the second associated processing node being communicatively connected to a first associated processing node, the method comprising: receiving a first fragment message sent by the first associated processing node, where the first fragment message belongs to a plurality of fragment messages, and the first fragment message includes a first field; Parsing the first fragment message to obtain the first field; Reassembling the multiple fragmented messages to obtain a second message; Deleting the first field in the data portion of the second message; According to the first field, a second on-link processing is performed on the second message from which the first field is deleted to obtain a first message, wherein the first field includes additional information obtained by the first on-link processing node performing the first on-link processing on the first message, and the second on-link processing is determined by the additional information.

8. The method according to claim 7, wherein the first field is located at the end of the second message.

9. The method according to claim 7, wherein the first field comprises a first protocol number field, and the first protocol number field is used to record an original protocol number of the first message, and the method further comprises: The second protocol number field in the header of the first message is modified to the original protocol number.

10. The method according to claim 7, wherein the first field comprises a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated path processing, and the method further comprises: According to the length field, it is determined whether the received fragment message is complete.

11. The method according to claim 7, wherein the first field comprises a sequence number field and a fragment number field, wherein the sequence number field and the fragment number field are used to record a sequence number and a fragment number of the second message, respectively, and the method further comprises: Determine the first fragment message of the second message according to the sequence number field and the fragment number field.

12. According to the method of claim 7, the first field includes an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

13. A device for processing a message, wherein the device runs a first associated processing node, the first associated processing node is communicatively connected with a second associated processing node, and the device comprises: A network processing chip, configured to receive a first message; an associated path processing chip, configured to perform a first associated path processing on the first message, and to add a first field to a data portion of the first message after the first associated path processing to obtain a second message, wherein the first field includes additional information obtained through the first associated path processing; The network processing chip is also used to fragment the second message to obtain multiple fragment messages, where the multiple fragment messages include a first fragment message, the first fragment message includes the first field, and send the first fragment message to the second associated processing node. The device according to claim 13 , wherein the first field is located at the end of the second message.

15. The device according to claim 13, wherein the first field comprises a first protocol number field, the first protocol number field is used to record an original protocol number of the first message, and the network processing chip is further used to: The second protocol number field in the header of the first message is modified to the first protocol number, where the first protocol number is used to indicate that the first field is added to the data part of the first message.

16. The device according to claim 13, wherein the first field comprises a length field, and the length field is used to indicate the length of the data portion of the first message after the first associated processing so that the second associated processing node can determine whether the received fragment message is complete.

17. According to the device of claim 13, the first field includes a sequence number field and a fragment number field, and the sequence number field and the fragment number field are respectively used to record the sequence number and fragment number of the second message, so that the second accompanying processing node determines the first fragment message of the second message.

18. The device according to claim 13, wherein the first field comprises an identification field, and the identification field is used to mark that the first field is located in the first fragment message.

19. A device for processing a message, the device running a second associated processing node, the second associated processing node being communicatively connected to a first associated processing node, the device comprising: A network processing chip, configured to receive a first fragment message, the first fragment message belonging to a plurality of fragment messages, the first fragment message including a first field, and parse the first fragment message to obtain the first field, and reassemble the plurality of fragment messages to obtain a second message; An on-link processing chip is used to delete the first field in the data part of the second message, and perform second on-link processing on the second message with the first field deleted according to the first field to obtain a first message, wherein the first field includes additional information obtained by the first on-link processing node performing the first on-link processing on the first message, and the second on-link processing is determined by the additional information.

20. The apparatus according to claim 19, wherein the first field is located at the end of the second message.

21. The device according to claim 19, wherein the first field comprises a first protocol number field, the first protocol number field is used to record an original protocol number of the first message, and the network processing chip is further used to: The second protocol number field in the header of the first message is modified to the original protocol number.

22. The device according to claim 19, wherein the first field comprises a length field, the length field being used to indicate the length of a data portion of the first message after the first associated path processing, and the network processing chip is further used to: According to the length field, it is determined whether the received fragment message is complete.

23. The device according to claim 19, wherein the first field comprises a sequence number field and a fragment number field, the sequence number field and the fragment number field are used to record the sequence number and the fragment number of the second message respectively, and the network processing chip is further used to: Determine the first fragment message of the second message according to the sequence number field and the fragment number field.

24. The apparatus according to claim 19, wherein the first field comprises an identification field, and the identification field is used to mark that the first field is located in the first fragment message.