Fragmented message processing method and device, computer readable storage medium and computer program product

By dynamically monitoring the use of shard reorganization resources in network intermediate devices and adjusting message processing strategies, the congestion and security risks of traditional systems when processing shard messages in high concurrency scenarios are solved, and efficient and stable operation of the network is achieved. .

CN119449734APending Publication Date: 2025-02-14BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411608718.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When traditional security detection systems deal with the surge in sharded packets in high concurrency scenarios, they are prone to the risk of message loss, detection response delays and security vulnerabilities, resulting in network congestion and instability.

Method used

Adjust the packet processing strategy by dynamically monitoring the use of sharded reorganization resources in the network intermediate devices. When the device is in a high load state, the first-reach shard message is directly forwarded to reduce processing time and resource usage; when the device is in a low load state, the first-reach shard message is stored and waits for the other shard messages to be reorganized and restored. to ensure the integrity and security of the packet.

Benefits of technology

It realizes a dynamic balance between message processing capabilities and communication security during traffic bursts, ensures efficient and stable operation of the network, and avoids the risks of message loss and security vulnerabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449734A_ABST
    Figure CN119449734A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a fragmented message processing method and device, a computer readable storage medium and a computer program product, when the device is in a first running state in which recombination resources are relatively tense, a first-arrival fragmented message is directly forwarded to a receiver, so that intermediate storage and recombination steps are reduced, the message processing speed is accelerated, and the message processing efficiency is improved. And the condition of recombination resource shortage is relieved. And when the equipment is in the second running state in which the recombination resources are relatively abundant, the first-arrival fragmented message is stored in the recombination queue, and recombination restoration is performed after the rest fragmented messages arrive, so that the integrity and security of the message under the condition that the recombination resources are relatively abundant are ensured. By dynamically monitoring the use condition of the recombined resources and dynamically adjusting the message processing strategy according to the condition, the balance between the message processing capability and the communication security is realized, and the efficient and stable operation of the network in different resource states is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a fragmented message processing method, device, computer-readable storage medium and computer program product. Background Art

[0002] With the widespread application of industrial control systems, the Internet of Things, and big data platforms, the amount of data packets transmitted in the network has increased dramatically. Especially in high-concurrency scenarios, the traffic of fragmented messages has shown a significant sudden growth trend. Faced with this situation, traditional security detection systems face challenges in processing the surge in fragmented messages, and are prone to the risk of message loss, detection response delays, and even security vulnerabilities during peak traffic periods. Therefore, how to ensure the safe and effective transmission of fragmented messages in the context of network congestion caused by the surge in fragmented messages, thereby ensuring the efficient and stable operation of the network has become an urgent problem to be solved. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a fragmented message processing method, device, computer-readable storage medium and computer program product, so as to achieve a dynamic balance between message processing capability and communication security during traffic bursts, thereby ensuring the technical effect of efficient and stable operation of the network.

[0004] In a first aspect, an embodiment of the present application provides a fragment message processing method, wherein the fragment message is obtained by fragmenting a complete message; a plurality of fragment messages of the complete message are sent by a sender to a receiver via a network intermediate device; the method is applied to the network intermediate device; the method comprises:

[0005] When receiving the first-arrived fragment message, obtaining the fragment reassembly resource usage of the network intermediate device; the first-arrived fragment message is the first fragment message to arrive at the network intermediate device among the multiple fragment messages;

[0006] If the fragment reassembly resource usage indicates that the network intermediate device is in the first operating state, forwarding the first-reaching fragment message to the receiver;

[0007] If the usage of the fragment reassembly resources indicates that the network intermediate device is in the second operating state, the first-arrived fragment message is stored in the reassembly queue, and after waiting for the arrival of the remaining fragment messages in the complete message and reassembling and restoring them into the complete message, the complete message is forwarded to the receiver; wherein the fragment reassembly resource usage rate in the first operating state exceeds the fragment reassembly resource usage rate in the second operating state.

[0008] In the above implementation process, when the device is in the first operating state where the reassembly resources are relatively tight, the first-reaching fragmented message is directly forwarded to the recipient, reducing the intermediate storage and reassembly steps, thereby speeding up the message processing speed and alleviating the tight reassembly resources. When the device is in the second operating state where the reassembly resources are relatively abundant, the first-reaching fragmented message is stored in the reassembly queue, waiting for the arrival of the remaining fragmented messages for reassembly and restoration, thereby ensuring the integrity and security of the message when the reassembly resources are relatively abundant. By dynamically monitoring the use of reassembly resources and dynamically adjusting the message processing strategy according to the situation, a balance is achieved between message processing capabilities and communication security, ensuring the efficient and stable operation of the network under different resource states.

[0009] Furthermore, the first-reaching fragment message is the starting fragment message of the complete message; before forwarding the first-reaching fragment message to the receiving party, it also includes:

[0010] Determine that the first-reaching fragment message passes the security detection.

[0011] In the above implementation process, the basic communication security of the network is guaranteed by ensuring that the first fragment message passes the security check before being forwarded to the receiver.

[0012] Furthermore, the method further comprises:

[0013] If the first-reaching fragment message fails the security detection, the first-reaching fragment message and the remaining fragment messages in the complete message are discarded.

[0014] In the above implementation process, on the one hand, if the first-reaching fragment message fails the security detection, there is no need to continue processing the first-reaching fragment message and the remaining fragment messages, which can avoid wasting unnecessary resources such as memory, CPU, etc. during the reassembly process, thereby improving the processing efficiency of the network intermediate equipment. On the other hand, by discarding the entire complete message when the first-reaching fragment message fails the detection, the security protection capability of network communication is effectively enhanced.

[0015] Further, the first-reaching fragment message is a starting fragment message of the complete message; and forwarding the first-reaching fragment message to the receiving party includes:

[0016] Establishing a connection between the network intermediate device and the receiver based on the initial fragment message;

[0017] The initial fragment message is forwarded to the receiver via the connection.

[0018] In the above implementation process, a connection is established between the network intermediate device and the receiver based on the starting fragment message (i.e., the first arriving fragment message), and the starting fragment message is forwarded through the connection, which improves the efficiency of network communication and enhances the security of communication.

[0019] Further, the first-reaching fragment message is a non-initial fragment message of the complete message; and forwarding the first-reaching fragment message to the receiving party includes:

[0020] The first-reaching fragment message is stored in a forwarding queue, and after the starting fragment message reaches the network intermediate device and a connection between the network intermediate device and the receiver is established based on the starting fragment message, the non-starting fragment message is forwarded to the receiver through the connection.

[0021] In the above implementation process, when the starting fragment message arrives, the device can immediately establish a connection with the receiver based on its information, and then forward the non-starting fragment messages stored in the queue, which not only improves the message processing speed but also reduces resource occupation and waste.

[0022] Furthermore, the method further comprises:

[0023] In the case of receiving a non-first-arrived fragmented message, if the first-arrived fragmented message is located in the reassembly queue, the non-first-arrived fragmented message is stored in the reassembly queue to wait for reassembly; the non-first-arrived fragmented message is a fragmented message that arrives at the network intermediate device after the first-arrived fragmented message;

[0024] If the first-arrived fragment message is not in the reassembly queue, the non-first-arrived fragment message is forwarded to the receiver.

[0025] In the above implementation process, if the first-reaching fragment message is already in the reassembly queue, it means that the device is waiting for the arrival of the remaining fragment messages for reassembly. At this time, the non-first-reaching fragment message is also stored in the reassembly queue, waiting to be reassembled with the remaining fragment messages. If the first-reaching fragment message is not in the reassembly queue, this may mean that the first-reaching fragment message has been forwarded to the receiver. In this case, the non-first-reaching fragment message is directly forwarded to the receiver to avoid unnecessary waiting and resource occupation.

[0026] Furthermore, the method further comprises:

[0027] If the usage of the fragment reassembly resource indicates that the network intermediate device is in the third operation state, obtaining the historical operation state;

[0028] If the historical running state is the first running state, forwarding the first arriving fragment message to the receiving party;

[0029] If the historical operating state is the second operating state, the first-arrived fragmented message is stored in the reassembly queue, and after waiting for the remaining fragmented messages in the complete message to arrive and be reassembled and restored into the complete message, the complete message is forwarded to the receiver; wherein the fragment reassembly resource utilization rate in the third operating state is less than the fragment reassembly resource utilization rate in the first operating state, and exceeds the fragment reassembly resource utilization rate in the second operating state.

[0030] In the above implementation process, if the historical operating status indicates that the system reassembly resources are relatively tight, the reassembly resources at this time are very likely to still be insufficient, and the fragmented messages are still directly forwarded according to the processing method of fragmented messages in the first operating state; if the historical operating status indicates that the system reassembly resources are relatively abundant, the reassembly resources at this time are very likely to still be relatively abundant, and the fragmented messages are still reassembled and forwarded according to the processing method of fragmented messages in the second operating state.

[0031] A second aspect of an embodiment of the present application provides a device, the device comprising:

[0032] processor;

[0033] a memory for storing processor-executable instructions;

[0034] Wherein, when the processor calls the executable instruction, any method described in the first aspect is implemented.

[0035] A third aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement any of the methods described in the first aspect.

[0036] A fourth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, any method described in the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A flowchart of a fragment message processing method provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of another method for processing fragmented messages provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of a burst fragmentation traffic processing process provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of a processing flow for restoring normal shard traffic provided in an embodiment of the present application;

[0042] Figure 5 A structural block diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0044] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0045] In the related technologies, the burst fragmented traffic is mainly dealt with by closing fragment reassembly or expanding fragment reassembly resources. However, after closing the fragment reassembly message, the system cannot perform security detection, which poses a security risk. In addition, the allocation of extended resources is relatively fixed and cannot be optimized according to the burst traffic, which may cause resource waste or shortage. Therefore, the related technologies cannot effectively handle fragmented messages during the burst traffic period, which usually leads to problems such as message loss, detection delay, and security vulnerabilities.

[0046] In response to any of the above-mentioned problems, the present application provides a fragment message processing method, referring to Figure 1 , Figure 1 A flowchart of a fragmented message processing method provided in an embodiment of the present application.

[0047] In this embodiment, the fragmented message is obtained by fragmenting the complete message; the multiple fragmented messages of the complete message are sent by the sender to the receiver via the network intermediate device; the method is applied to the network intermediate device; the method includes:

[0048] Step S10: upon receiving the first-arrived fragment message, obtaining the fragment reassembly resource usage of the network intermediate device; the first-arrived fragment message is the first fragment message to arrive at the network intermediate device among the multiple fragment messages;

[0049] It should be noted that fragmented messages are a data format in the transport layer or network layer of a computer network. Large data packets are divided into smaller fragments to form fragmented messages. This fragmentation method helps improve network transmission efficiency and can be reassembled at various nodes in the network to restore it to its complete form. Each fragmented message contains a portion of the original data, as well as some additional information, such as the source address, destination address, port number, fragment offset, identifier, flag bit, etc. This information can help network devices correctly reassemble the fragmented message and pass it to the receiver.

[0050] A complete message refers to a message that has not been fragmented and contains complete data. In a computer network, a complete message is usually generated by the sender and sent to the receiver. The complete message contains all the data that needs to be transmitted, as well as the necessary header information (such as source address, destination address, protocol type, etc.). After receiving the complete message, the receiver can directly process it without fragmenting and reassembling it. However, in actual network transmission, due to limitations of factors such as network bandwidth, delay, MTU (i.e., the maximum transmission unit of the network), sometimes larger data packets need to be fragmented to adapt to the transmission capacity of the network. In this case, the fragmented message transfer party (i.e., the network intermediate device) or the receiver between the sender and the receiver needs to reassemble the received fragmented messages to restore the complete message.

[0051] The sender is a device that generates and sends fragmented messages. These devices can be computers, network devices (such as routers, switches, etc., which are responsible for forwarding data in the network, but sometimes they may also act as senders to send data to other network devices or terminals), and IoT devices (such as smart sensors, smart cameras, etc., which collect data and send it to the central processing system or cloud server through the network).

[0052] Network intermediate devices are devices responsible for receiving, processing and forwarding fragmented messages. They can be routers, switches, gateways, firewalls, and proxy servers.

[0053] The receiver is the device that receives the fragmented message. The specific behavior of the receiver depends on the processing strategy of the network intermediate device. In some cases, it is responsible for receiving the complete message after the network intermediate device reassembles and restores it, while in other cases, it is responsible for receiving the fragmented message directly forwarded by the network intermediate device and reassembling the fragmented message to restore it to a complete message.

[0054] It should be understood that the usage of the fragment reassembly resources can reflect the current usage of the fragment reassembly resources of the network intermediate device, wherein the fragment reassembly resources include memory, CPU, etc.

[0055] Step S20: if the first fragment reassembly resource usage indicates that the network intermediate device is running at a high load and in a first running state, forwarding the first-reaching fragment message to the receiver;

[0056] It should be noted that the first operating state is high-load operation. The total amount of fragment reassembly resources can be set according to the system hardware conditions, and then a high load threshold (such as 80% of the total resources) can be set according to the total amount of fragment reassembly resources. When the fragment reassembly resource utilization rate of the network intermediate device exceeds the high load threshold, it is determined that the current network intermediate device is in the first operating state, and the current reassembly resource utilization rate is high. In order to avoid further increasing the burden on the device, the network intermediate device directly forwards the first-reaching fragment message to the receiver, and the receiver reassembles the message, reducing the processing time and resource occupation of the network intermediate device. In this embodiment, the device can be divided into two operating states according to the high load threshold (such as 80% of the total resources), namely, the first operating state exceeding the high load threshold (at this time, the device is running at high load) and the second operating state below the high load threshold (at this time, the device is running at low load or normally).

[0057] Step S30: If the usage of the fragment reassembly resources indicates that the network intermediate device is in the second operating state, the first-arrived fragment message is stored in the reassembly queue, and after waiting for the arrival of the remaining fragment messages in the complete message and reassembling and restoring them into the complete message, the complete message is forwarded to the receiver; wherein the fragment reassembly resource usage rate in the first operating state exceeds the fragment reassembly resource usage rate in the second operating state.

[0058] It should be noted that the second operating state is low-load operation. The total amount of fragment reassembly resources can be set according to the system hardware conditions, and then a low load threshold (such as 10% of the total resources) is set according to the total amount of fragment reassembly resources. When the fragment reassembly resource utilization rate of the network intermediate device is lower than the low load threshold, the current network intermediate device is determined to be in the second operating state, and the current reassembly resource utilization rate is low. The network intermediate device has sufficient resources to process the first arriving fragment message and the subsequent arriving fragment messages. Therefore, the network intermediate device stores the first arriving fragment message in the reassembly queue and waits for the remaining fragment messages to arrive. When all the fragment messages arrive, the device reassembles them into a complete message and forwards them to the recipient, ensuring the integrity and accuracy of the message.

[0059] In this embodiment, the fragment message processing method is dynamically adjusted according to the real-time resource usage of the network intermediate device, thereby optimizing resource utilization and communication fluency, and ensuring efficient and stable operation of the network under different resource states.

[0060] On the basis of any of the above embodiments, the first-reaching fragment message is the starting fragment message of the complete message; before forwarding the first-reaching fragment message to the receiving party, it also includes:

[0061] Determine that the first-reaching fragment message passes the security detection.

[0062] It should be noted that the starting fragment message is the first fragment in the complete message. Due to the uncertainty of network transmission, the first fragment in the complete message may not be the fragment message that first reaches the network intermediate device. In this embodiment, the first fragment message that arrives at the network intermediate device is the first fragment in the complete message. The security and integrity of the first fragment message are crucial for subsequent fragment reassembly and data processing. If the first fragment message is tampered with or damaged during transmission, the entire complete message will not be able to be correctly reassembled, resulting in data loss or errors. Therefore, security detection can ensure the integrity and security of the first fragment message, thereby ensuring the accuracy of the entire complete message.

[0063] Specifically, the remaining fragmented messages that belong to the same complete message as the initial fragmented message can be directly forwarded by the network intermediate device only when the initial fragmented message passes the security detection.

[0064] In this embodiment, the first fragment message in the complete message can be forwarded to the receiver only when it is determined that the first fragment message in the complete message passes the security detection, thereby ensuring the security of network communication.

[0065] Based on any of the above embodiments, the method further includes:

[0066] If the first-reaching fragment message fails the security detection, the first-reaching fragment message and the remaining fragment messages in the complete message are discarded.

[0067] It should be noted that in network communications, data packets are divided into multiple fragmented messages for transmission to improve transmission efficiency and adapt to bandwidth limitations in different network environments. However, this fragmented transmission method also brings potential security risks. In order to ensure the security and integrity of data transmission, security checks are usually performed on the received fragmented messages on the network intermediate devices.

[0068] Security testing ensures the legitimacy, integrity, and authenticity of the message content by performing a series of checks and verifications on the fragmented messages. These checks include but are not limited to verifying the source, destination, checksum, and encryption signature of the message.

[0069] If the first-reaching fragment message (in this embodiment, the first-reaching fragment message is the first fragment message in the complete message) fails to pass the security detection of the network intermediate device, it indicates that it may contain malicious code, viruses or other potential threats, which will have a serious impact on the entire network communication. At this time, discarding the first-reaching fragment message that fails to pass the security detection and the remaining fragment messages can prevent potential security threats from spreading to the entire network. In addition, if the first-reaching fragment message has been damaged or tampered with, even if the remaining fragment messages can be successfully transmitted, they cannot be correctly reassembled into a complete message at the receiving end. Therefore, discarding all related fragment messages is a necessary measure to maintain data integrity.

[0070] In this embodiment, the first-reaching fragment message that fails the security check and the remaining fragment messages that belong to the same complete message as the first-reaching fragment message are discarded at the same time, which not only ensures the security of network communication but also accelerates the release of fragment reassembly resources.

[0071] Based on any of the above embodiments, the first-reaching fragment message is the starting fragment message of the complete message; forwarding the first-reaching fragment message to the receiving party includes: Figure 2 Steps S21-S22 shown:

[0072] Step S21: establishing a connection between the network intermediate device and the receiver based on the initial fragment message;

[0073] Step S22: forwarding the initial fragment message to the receiver via the connection.

[0074] In a specific implementation, when the fragment traffic increases in a short period of time, the utilization rate of fragment reassembly resources rises sharply. The system first detects the utilization of fragment reassembly resources in real time when receiving the fragment message. When it detects that the utilization rate of the reassembly resources is too high and the system is running at high load, it enters the selective processing mode. In this mode, only the first fragment message (i.e., the first IP fragment) is connected and security detection is performed, and the remaining fragment messages do not need to perform connection establishment and security detection and are directly forwarded. Among them, the first fragment message can be a TCP (Transmission Control Protocol) connection or a UDP (User Datagram Protocol) connection. This embodiment takes the establishment of a UDP connection as an example. The above strategy can reduce the number of messages that need to be processed, effectively reduce the load of the system, and reduce the delays that occur during the reassembly and detection process.

[0075] like Figure 3 As shown, Figure 3A schematic diagram of a burst fragmentation traffic processing process provided for an embodiment of the present application. A high load threshold a (such as 80% of the total resources) and a low load threshold b (such as 10% of the total resources) are set according to the total amount of system fragmentation reassembly resources, and the setting of the high load threshold and the low load threshold can be completed in advance. When the fragmentation traffic increases in a short period of time and the utilization rate of the fragmentation reassembly resources rises sharply, the utilization of the fragmentation reassembly resources is detected in real time. If the current utilization rate of the network intermediate device exceeds the high load threshold, the fragmentation selective processing mode is turned on. In this mode, the received fragmentation message is processed differently. Specifically, if the received fragmentation message is the first small piece in the complete message, it is forwarded to the recipient after the UDP connection is established and the security detection is completed. If the received fragmented message is not the first small fragment in the complete message, then no connection is established or security check is performed for this non-first fragment message, and this non-first fragment message is directly forwarded. In one case, the forwarding of this non-first fragment message is completed based on the connection established with the first fragment message. If the current utilization rate of the intermediate network device does not exceed the high load threshold, the message is processed according to the normal fragmented message processing process, that is, all fragmented messages need to be reassembled and forwarded to the recipient only after passing the security check of the security module.

[0076] Specifically, regarding establishing a UDP connection:

[0077] In UDP, although there is no actual connection establishment process, the communication preparation between the network intermediate device and the receiver can be understood logically. Specifically, first, the network intermediate device determines the location of the receiver based on the destination address (IP address and port number) in the initial fragment message; then, the network intermediate device may create a temporary cache or state table for the receiver to store the fragment message information related to the receiver (such as sequence number, fragment offset, number of received fragments, etc.). This cache or state table is logically equivalent to a "connection" identifier, which is used to ensure that subsequent fragment messages can be correctly forwarded to the receiver; finally, the network intermediate device forwards the initial fragment message and subsequent fragment messages to the receiver based on the receiver's address and the information in the cache / state table.

[0078] In this embodiment, the initial fragment message plays an important role in network communication. By establishing a connection with the receiver based on the information carried in the initial fragment message and forwarding the message, the network intermediate device can ensure the integrity and order of the data, improve transmission efficiency, and enhance network security.

[0079] On the basis of any of the above embodiments, the first-reaching fragment message is a non-initial fragment message of the complete message; and forwarding the first-reaching fragment message to the receiving party includes:

[0080] The first-reaching fragment message is stored in a forwarding queue, and after the starting fragment message reaches the network intermediate device and a connection between the network intermediate device and the receiver is established based on the starting fragment message, the non-starting fragment message is forwarded to the receiver through the connection.

[0081] Specifically, when a network intermediate device receives a non-initial fragment message, and the fragment message arrives at the network intermediate device before the initial fragment message, at this time, the network intermediate device checks whether the message belongs to a connection that has not yet been established. If the message belongs to a new connection and the initial fragment message that plays an important role in establishing the connection has not yet arrived, the non-initial fragment message is stored in a forwarding queue, which is used to temporarily store messages waiting to be forwarded. Then, the network intermediate device continues to monitor the fragment messages on the network until the initial fragment message arrives. Once the initial fragment message arrives, the network intermediate device will establish a connection with the recipient based on the information of the message (such as source address, destination address, port number, sequence number, etc.). After the connection is established, the fragment messages in the forwarding queue are forwarded to the recipient through the established connection.

[0082] In this embodiment, for non-initial fragmented messages that reach the network intermediate device first, by storing these messages and establishing a connection after the initial fragmented message arrives, it is ensured that all fragments of the complete message can be forwarded to the recipient based on the correct transmission link. This processing method improves the reliability of network communication.

[0083] Based on any of the above embodiments, the method further includes:

[0084] In the case of receiving a non-first-arrived fragmented message, if the first-arrived fragmented message is located in the reassembly queue, the non-first-arrived fragmented message is stored in the reassembly queue to wait for reassembly; the non-first-arrived fragmented message is a fragmented message that arrives at the network intermediate device after the first-arrived fragmented message;

[0085] If the first-arrived fragment message is not in the reassembly queue, the non-first-arrived fragment message is forwarded to the receiver.

[0086] It should be noted that if the first-arrived fragment is already in the reassembly queue, this means that the device is waiting for the remaining fragments of the complete message to arrive for reassembly. At this time, even if the current fragment reassembly resource usage indicates that the network intermediate device is in the first operating state (i.e., high load state), the non-first-arrived fragment message will not be directly forwarded to the recipient, but the non-first-arrived fragment message will be reassembled before forwarding. It should be noted that another key factor that determines whether the non-first-arrived fragment message is reassembled before forwarding is whether the reassembly timeout is exceeded. If the reassembly cannot be completed within the timeout, it means that there is a problem with the transmission of the fragment message, and the message needs to be discarded to release resources.

[0087] It should be understood that if the first arriving fragmented packet is not in the reassembly queue, this may mean one of the following situations:

[0088] ①The first fragment message has not yet reached the device;

[0089] ②The first fragment message has been forwarded to the receiver;

[0090] ③An error or abnormality occurred during the processing of the device.

[0091] If the first-arrived fragmented message is not in the reassembly queue, it means that the device is not waiting for the remaining fragments of the complete message to arrive for reassembly. In this case, the non-first-arrived fragmented message is directly forwarded to the receiver.

[0092] In this embodiment, considering the surge in fragmented traffic, the running state of the network intermediate device may change rapidly. If all the fragmented messages are directly forwarded when the network intermediate device is in the first running state, without considering special circumstances, it may result in one or more fragmented messages in the complete message being received in the previous historical running state, and the device puts it into the reassembly queue to wait for the remaining fragmented messages to be received for reassembly. During the reassembly timeout, the running state changes rapidly from other running states to the first running state. The remaining fragmented messages that need to be reassembled are received in the first running state and are mistakenly directly forwarded to the recipient. Although the reassembly timeout has not been exceeded, the fragmented messages in the reassembly queue cannot be reassembled. In order to prevent the above situation from occurring, before directly forwarding the fragmented message according to the first running state, it is first determined whether it belongs to the fragmented message waiting for reassembly. If it is indeed a fragmented message that can be reassembled within the reassembly timeout, it is reassembled and restored to a complete message, and then the complete message is forwarded to the recipient, which is conducive to ensuring the integrity of the data.

[0093] Based on any of the above embodiments, the method further includes:

[0094] If the usage of the fragment reassembly resource indicates that the network intermediate device is in the third operation state, obtaining the historical operation state;

[0095] If the historical running state is the first running state, forwarding the first arriving fragment message to the receiving party;

[0096] If the historical operating state is the second operating state, the first-arrived fragmented message is stored in the reassembly queue, and after waiting for the remaining fragmented messages in the complete message to arrive and be reassembled and restored into the complete message, the complete message is forwarded to the receiver; wherein the fragment reassembly resource utilization rate in the third operating state is less than the fragment reassembly resource utilization rate in the first operating state, and exceeds the fragment reassembly resource utilization rate in the second operating state.

[0097] It should be noted that the third operating state is normal operation. Exemplarily, the normal operating state means that the utilization rate of the fragment reassembly resource is between the low load threshold (such as 10% of the total resources) and the high load threshold (such as 80% of the total resources), such as being in the range of 10% to 80% of the total resources. In this embodiment, the device can be divided into three operating states according to the high load threshold and the low load threshold, namely, the first operating state exceeding the high load threshold (at this time, the device is running at a high load), the third operating state between the low load threshold and the high load threshold (at this time, the device is running normally), and the second operating state below the low load threshold (at this time, the device is running at a low load).

[0098] When the device detects that it is in the third operating state, that is, the fragment reassembly resource utilization rate is less than the utilization rate in the first operating state but exceeds the utilization rate in the second operating state, the device will enter the next operation.

[0099] Specifically, after determining that the device is in the third operating state, the device will obtain its previous historical operating state information. This helps the device understand the previous resource usage and processing strategy, so as to make more reasonable decisions. If the historical operating state is the first operating state, it means that the device was in a relatively tight resource state before. Therefore, even if the resource utilization rate has decreased now (although it has decreased, it is still in the third operating state where the utilization rate is higher than the second operating state), the device will still adopt a conservative strategy and forward the first-reaching fragment message directly to the receiver without using reassembly resources for reassembly. If the historical operating state is the second operating state, this means that the device was in a relatively sufficient resource state before. Therefore, even if the resource utilization rate has increased now (but has not exceeded the resource utilization rate of the first operating state), the device still has sufficient reassembly resources to reassemble the fragment messages. In this case, the device will wait for the arrival of all fragment messages and then complete the reassembly before forwarding them to the receiver.

[0100] like Figure 4As shown, Figure 4 A schematic diagram of a processing flow for restoring normal fragmentation traffic provided by an embodiment of the present application. In the figure, if the historical operating state of the device is the first operating state (i.e., high-load operation), the device will automatically enter the fragmentation selective processing mode under the high-load operating state. Under the fragmentation selective processing mode, the fragmentation reorganization resource usage of the current device is judged in real time. Once the system detects that the fragmentation resource utilization rate has fallen back to a low-load level, that is, the current resource utilization rate is lower than the low-load threshold b (such as 10% of the total resources) set according to the system hardware situation, it will automatically exit the selective fragmentation processing mode and restore the complete fragmentation reorganization logic. At this time, the system re-enables the reorganization algorithm for all received fragmentation messages and performs a complete security check on the reorganized messages. This mechanism ensures that when resources are sufficient, the system can maximize data integrity and security and avoid security risks that may occur in emergency mode. In another case, once the system detects that the fragmentation resource utilization rate has decreased but is still higher than the low-load threshold, the device is in a normal operating state and maintains the selective fragmentation processing mode.

[0101] In this embodiment, the efficiency and reliability of network communication are improved by dynamically monitoring the current operating status and the historical operating status and dynamically adjusting the fragment message processing strategy.

[0102] Based on the method described in any of the above embodiments, the present application also provides Figure 5 A schematic diagram of the structure of a device is shown in FIG. Figure 5 At the hardware level, the device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method described in any of the above embodiments.

[0103] Based on the method described in any of the above embodiments, the present application also provides a computer storage medium, which stores a computer program. When the computer program is executed by a processor, it can be used to execute the method described in any of the above embodiments.

[0104] Based on the method described in any of the above embodiments, the present application also provides a computer program product, which includes one or more computer programs or instructions. The computer program or instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. When the computer program is executed by a processor, the method described in any of the above embodiments is implemented.

[0105] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0107] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0108] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0110] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A fragment message processing method, characterized in that: The fragmented message is obtained by fragmenting the complete message; The plurality of fragment messages of the complete message are sent by the sender to the receiver via the network intermediate device; the method is applied to the network intermediate device; the method comprises: When receiving the first-arrived fragment message, obtaining the fragment reassembly resource usage of the network intermediate device; the first-arrived fragment message is the first fragment message to arrive at the network intermediate device among the multiple fragment messages; If the fragment reassembly resource usage indicates that the network intermediate device is in the first operating state, forwarding the first-reaching fragment message to the receiver; If the usage of the fragment reassembly resources indicates that the network intermediate device is in the second operating state, the first-arrived fragment message is stored in the reassembly queue, and after waiting for the arrival of the remaining fragment messages in the complete message and reassembling and restoring them into the complete message, the complete message is forwarded to the receiver; wherein the fragment reassembly resource usage rate in the first operating state exceeds the fragment reassembly resource usage rate in the second operating state.

2. The method according to claim 1, characterized in that The first-reaching fragment message is the starting fragment message of the complete message; before forwarding the first-reaching fragment message to the receiving party, it also includes: Determine that the first-reaching fragment message passes the security detection.

3. The method according to claim 2, characterized in that The method further comprises: If the first-reaching fragment message fails the security detection, the first-reaching fragment message and the remaining fragment messages in the complete message are discarded.

4. The method according to any one of claims 1 to 3, characterized in that: The first-reaching fragment message is the starting fragment message of the complete message; The forwarding of the first-reaching fragment message to the receiving party includes: Establishing a connection between the network intermediate device and the receiver based on the initial fragment message; The initial fragment message is forwarded to the receiver via the connection.

5. The method according to claim 1, characterized in that The first-reaching fragment message is a non-initial fragment message of the complete message; and forwarding the first-reaching fragment message to the receiving party includes: The first-reaching fragment message is stored in a forwarding queue, and after the starting fragment message reaches the network intermediate device and a connection between the network intermediate device and the receiver is established based on the starting fragment message, the non-starting fragment message is forwarded to the receiver through the connection.

6. The method according to claim 1, characterized in that The method further comprises: In the case of receiving a non-first-arrived fragmented message, if the first-arrived fragmented message is located in the reassembly queue, the non-first-arrived fragmented message is stored in the reassembly queue to wait for reassembly; the non-first-arrived fragmented message is a fragmented message that arrives at the network intermediate device after the first-arrived fragmented message; If the first-arrived fragment message is not in the reassembly queue, the non-first-arrived fragment message is forwarded to the receiver.

7. The method according to claim 1, characterized in that The method further comprises: If the usage of the fragment reassembly resource indicates that the network intermediate device is in the third operation state, obtaining the historical operation state; If the historical running state is the first running state, forwarding the first arriving fragment message to the receiving party; If the historical operating state is the second operating state, the first-arrived fragmented message is stored in the reassembly queue, and after waiting for the remaining fragmented messages in the complete message to arrive and be reassembled and restored into the complete message, the complete message is forwarded to the receiver; wherein, the fragment reassembly resource utilization rate in the third operating state is less than the fragment reassembly resource utilization rate in the first operating state, and exceeds the fragment reassembly resource utilization rate in the second operating state.

8. A device, characterized in that The device comprises: processor; a memory for storing processor-executable instructions; Wherein, when the processor calls the executable instruction, the method described in any one of claims 1-7 is implemented.

9. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed by a processor, the steps of any method described in claims 1-7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Message shunting method and device

    CN103888364A

  • Data recombination method and device

    CN112866308A

  • Data packet sending method and equipment

    CN115150280A

  • Packet processor

    JP2010011344A

  • Apparatus and method for network congestion control

    KR1020060027245A