Message processing methods, network devices and computer program products

By integrating message parsing, risk detection, and handling within a single process, the technology solves the problems of detection latency and handling lag in existing technologies, thereby improving security protection capabilities in high-throughput network environments.

CN123123024APending Publication Date: 2026-11-17TP-LINK INT SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611601927.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing high-speed forwarding frameworks cannot achieve deep adaptation and efficient collaboration between the detection engine and the high-speed forwarding plane in high-throughput network environments, resulting in problems such as detection delays, delayed processing, and missed traffic detections, making it difficult to meet the security protection requirements of real-time detection and immediate defense.

Method used

It adopts a kernel-independent message processing architecture, including message parsing nodes and message risk detection and handling nodes, which run in a single process to achieve integrated execution of message parsing, risk detection and handling, eliminating the overhead of data copying and process context switching caused by cross-process transmission.

Benefits of technology

It significantly improves the overall performance of packet security processing in high-throughput scenarios, reduces the processing latency of intrusion prevention, and ensures the immediate blocking of network attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123024A_ABST
    Figure CN123123024A_ABST
Patent Text Reader

Abstract

This disclosure relates to a packet processing method, network device, and computer program product. The method includes: loading a packet processing architecture into a network device, wherein the packet processing architecture is deployed independently of the network device's kernel and includes a packet parsing node and a packet risk detection and handling node, the packet processing architecture running within a single process; parsing a target packet at the packet parsing node; and performing risk detection on the parsed target packet at the packet risk detection and handling node, and handling the target packet based on the result of the risk detection. The method provided by this disclosure can integrate packet parsing, risk detection, and handling within a single process, effectively reducing intrusion prevention latency and ensuring that network attacks can be dealt with immediately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of network security technology, and more specifically, to a message processing method and corresponding network devices and computer program products. Background Technology

[0002] Intrusion Detection Systems (IDS) can monitor network transmission data in real time, identify anomalies, and alert on intrusion behaviors. Intrusion Prevention Systems (IPS) can perform proactive actions such as blocking and interception after detecting network intrusion behaviors. Both are core technologies for ensuring network transmission security. In complex network scenarios with high throughput and high traffic, achieving real-time detection by IDS and immediate response by IPS based on the data forwarding plane is a key research direction in current network security protection technologies.

[0003] Currently, there are various high-performance network forwarding frameworks in the industry. Among them, mainstream frameworks such as the Data Plane Development Kit (DPDK) and Vector Packet Processing (VPP) can effectively break through the performance bottleneck of traditional kernel-mode packet sending and receiving, provide reliable support for high-speed packet sending and receiving in user mode, and significantly improve the overall throughput of network data forwarding.

[0004] However, in actual engineering implementation, existing technologies still have significant shortcomings. Current high-speed forwarding frameworks can only achieve efficient data transmission and forwarding, but cannot achieve deep adaptation and efficient collaboration between the detection engine and the high-speed forwarding plane. Security processing logics such as detection and assessment, risk identification, and defense are disconnected from the high-speed forwarding process, easily leading to problems such as detection delays, delayed handling, and missed traffic detections. This makes it difficult to meet the security protection requirements of real-time detection and immediate defense in high-throughput network environments, becoming a key technical challenge restricting the high-performance application of IDS and IPS devices. Summary of the Invention

[0005] To address one or more problems in the prior art, this disclosure proposes a message processing method. This method enables the parsing, risk detection, and handling of target messages within a single process. This eliminates the data copying and process context switching overhead associated with cross-process message transmission, significantly improving the overall performance of message security processing in high-throughput scenarios. Furthermore, this method allows for the integrated execution of message parsing, risk detection, and handling within a single process, effectively reducing intrusion prevention latency and ensuring that network attacks are blocked immediately.

[0006] At least one embodiment of this disclosure provides a packet processing method, comprising: loading a packet processing architecture in a network device, wherein the packet processing architecture is deployed independently of the kernel of the network device and includes a packet parsing node and a packet risk detection and handling node, the packet processing architecture running in a single process; parsing a target packet at the packet parsing node; and performing risk detection on the parsed target packet at the packet risk detection and handling node, and handling the risk of the target packet based on the result of the risk detection.

[0007] At least another embodiment of this disclosure provides a network device, including: a kernel-independent packet processing architecture, the packet processing architecture running in a single process, and including at least a packet parsing node and a packet risk detection and handling node, wherein the packet parsing node is configured to parse target packets; and the packet risk detection and handling node is configured to perform risk detection on the parsed target packets and perform risk handling on the target packets based on the results of the risk detection.

[0008] At least one further embodiment of this disclosure provides a network device, including: a processor; a memory coupled to the processor; and computer program instructions stored in the memory, the computer program instructions performing the method provided in at least one embodiment of this disclosure when executed by the processor.

[0009] At least one further embodiment of this disclosure provides a computer-readable storage medium for storing instructions that, when executed by a processor, perform the method provided in at least one embodiment of this disclosure.

[0010] At least one further embodiment of this disclosure provides a computer program product including computer-readable instructions that, when executed by a processor of a network device, perform the method provided in at least one embodiment of this disclosure.

[0011] Another embodiment of this disclosure provides a network device, including: components for performing steps of the method provided in at least one embodiment of this disclosure. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some exemplary embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0013] Figure 1The diagram illustrates a network access scenario 100 of a network device provided in at least one embodiment of the present disclosure.

[0014] Figure 2 The illustration shows a schematic diagram of a DPDK-based "forwarding process + detection engine process" separation architecture deployed in a network device according to at least one embodiment of the present disclosure;

[0015] Figure 3 The illustration shows a schematic diagram of a VPP-based "VPP forwarding process + external detection process" separation architecture deployed in a network device according to at least one embodiment of the present disclosure;

[0016] Figure 4 The illustration schematically depicts a message processing method provided by at least one embodiment of the present disclosure;

[0017] Figure 5 The diagram illustrates a node connection and processing link provided in at least one embodiment of the present disclosure.

[0018] Figure 6 The diagram illustrates a specific message processing flow provided in at least one embodiment of this disclosure;

[0019] Figure 7 An example configuration of a network device 700 provided in at least one embodiment of the present disclosure is illustrated. Detailed Implementation

[0020] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0021] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel, unless otherwise expressly stated or conflicting. Furthermore, method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0022] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0023] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different models, devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these models, devices, modules or units.

[0024] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0025] The names of messages or information exchanged between multiple nodes, components, devices, modules or units in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0026] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0027] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, relevant users should be informed of the type, scope of use, and usage scenarios of the information involved in this disclosure and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means. Among them, relevant users may include any type of rights holder, such as individuals, enterprises, or groups.

[0028] For example, in the operational methods described later, when it is necessary to inform relevant users regarding the used packets, source IP address, source port, destination IP address, destination port, transport layer protocol, thresholds, etc., in accordance with relevant laws and regulations, a prompt message will be sent to the relevant users to clearly inform them. This allows the relevant users to independently choose whether to allow the use of the packet, source IP address, source port, destination IP address, destination port, transport layer protocol, threshold, etc., based on the prompt message. This prompt can be in the form of a pop-up window, which can present the prompt message in text format. In addition, the pop-up window can also include a selection control for the user to choose "agree" or "disagree".

[0029] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0030] Furthermore, the technical features described in the different embodiments of this disclosure can be combined with each other, provided that they do not conflict with each other. Additionally, the accompanying drawings are for illustrative purposes only and are simplified for brevity, and therefore may not be exactly the same as actual implementations. For example, device processing delays may be omitted in the figures.

[0031] Figure 1 The diagram illustrates a network access scenario 100 of a network device provided in at least one embodiment of the present disclosure.

[0032] like Figure 1 As shown, in network access scenario 100, when a terminal device 120 (such as a laptop, smartphone, tablet, desktop PC, personal digital assistant (PDA), access point, Wi-Fi phone in a WLAN environment, etc.) wants to access the Internet, it can interact with the Internet through a network device 110 that is already connected to the Internet. Network device 110 may include, for example, a router, gateway, firewall, or other devices with network connectivity capabilities. It may be configured with one or more WAN ports (also called network ports), for example, n WAN ports: WAN1, WAN2, ..., WANn, where n is an integer greater than or equal to 1. These WAN ports can be configured to connect to the Internet to establish a WAN link.

[0033] For some typical deployment architectures of network device 110 (as will be combined later) Figure 2 and Figure 3 As described, after network packets are received by the network interface card (NIC) and access the user-space forwarding plane, they need to be separately sent to a dedicated detection engine to perform security assessment operations such as rule matching, traffic feature detection, and abnormal behavior analysis. After the detection engine generates a risk assessment result, it is then sent back to the data forwarding plane, where the data plane performs security actions such as packet dropping, traffic blocking, blacklist configuration, Access Control List (ACL) issuance, log alerts, and behavior auditing. The complete "forwarding-detection-handling" business loop described above generally suffers from performance degradation issues in conventional implementations, including cross-process data communication, multiple copies of packets to memory, and frequent switching of the Central Processing Unit (CPU) schedule. These additional system overheads significantly reduce network data forwarding throughput, increase packet processing latency, and easily lead to delayed security actions, making it impossible to achieve immediate blocking of network risks. In high-throughput network scenarios with ultra-high traffic and high concurrency, the real-time performance and effectiveness of security protection will be significantly reduced.

[0034] Figure 2The illustration shows a schematic diagram of a DPDK-based "forwarding process + detection engine process" separation architecture deployed in a network device according to at least one embodiment of the present disclosure.

[0035] Reference Figure 2 In this deployment scheme, a process-decoupled independent architecture is generally adopted to implement data forwarding and security detection functions. Among them, the forwarding process based on the Data Plane Development Kit (DPDK) independently undertakes the high-speed packet sending and receiving of the network card and the basic network packet forwarding tasks, while the intrusion detection system (IDS) and intrusion prevention system (IPS) detection engines run as independent business processes.

[0036] The normal working mechanism of this architecture is as follows: the forwarding process performs memory copying or memory mapping of the network packets to be detected through a shared memory mechanism, and then transfers the packet data to an independent detection engine, which completes the subsequent security detection and analysis. At the same time, the forwarding process and the detection engine rely on a dedicated control channel to complete the real-time synchronization of detection status, judgment results and control commands, thereby realizing the linkage and cooperation between traffic forwarding and security detection.

[0037] Specifically, such as Figure 2As shown, the DPDK process 210 sends the data packets acquired from the Network Interface Card (NIC) 220 to the section shown at number 211 for user-space packet reception / RX (PMD Driver, polling mode driver), and then further sends the processed data packets to the section shown at number 212 for forwarding / classification / basic processing (L2 (Layer 2) / L3 (Layer 3) / ACL / NAT (Network Address Translation), etc.). During this processing, the packets to be detected are copied or delivered to the shared memory / hugepagering for packet copying / descriptor passing, so that they can be retrieved across processes and sent to the IPS / IDS process 230. Threat detection / rule matching / signature scanning are performed at the IPS / IDS process 230 (as shown at number 231). The handling decisions / policy outputs based on the detection results (such as dropping / blocking / issuing ACLs, etc.) are transmitted to section 212 of the DPDK process 210 via inter-process communication (IPC) for subsequent processing. Simultaneously, the IPS / IDS process 230 and the DPDK process 210 also need to use a control / state synchronization thread via IPC to communicate with the DPDK process (as shown in section 233). Next, at section 212, packets that have passed the detection (e.g., no risk detected) undergo subsequent user-space packet sending / TX processing (as shown in section 214). Finally, the detected packets are transmitted to the external network / next hop (as shown in section 240).

[0038] visible, Figure 2 The architecture shown has the following problems:

[0039] First, it is difficult to achieve stable end-to-end zero-copy transmission in an engineered manner. The network packets to be detected need to complete data copying in the shared memory space, or construct a cache description structure that can be identified across processes. This approach introduces additional memory copy operations and cross-process data synchronization overhead, significantly increasing the system's data processing burden.

[0040] Secondly, there is a serious problem of wasted CPU resources. The detection engine needs to resident in a separate thread to continuously maintain control interaction and state synchronization communication with the DPDK forwarding process, which monopolizes CPU computing resources for a long time, resulting in idle and ineffective consumption of core computing power.

[0041] Third, the security handling chain has inherent processing latency. After the detection engine generates risk assessment results, it needs to be transmitted back to the forwarding plane through a cross-process channel. This process involves data waiting and state synchronization delays, resulting in a lag in the identification and blocking of malicious traffic, making it impossible to achieve real-time and accurate defense.

[0042] Fourth, the overall deployment and implementation costs are high and the project implementation is difficult. The existing architecture requires configuring dedicated CPU cores for the forwarding process and the detection process, and completing complex planning and configuration such as core binding and traffic queue partitioning. The overall architecture deployment is cumbersome, the operation and maintenance costs are high, and the versatility and feasibility are poor.

[0043] Figure 3 The illustration shows a schematic diagram of a VPP-based "VPP forwarding process + external detection process" separation architecture deployed in a network device according to at least one embodiment of the present disclosure.

[0044] Reference Figure 3 In this deployment scheme, the forwarding architecture based on VPP also adopts a working mode that separates forwarding and detection. The VPP forwarding plane is responsible for high-performance network packet transmission and reception and service forwarding processing, and actively sends the packets to be detected to the external IDS / IPS detection engine process for security scanning and risk identification. After the detection engine completes the analysis and generates a handling decision, it sends the decision result back to the VPP forwarding plane to execute the corresponding protection operation.

[0045] Specifically, such as Figure 3 As shown, the VPP forwarding process 310 sends the data obtained from the network interface card (NIC) 320 to the input node (such as dpdk-input / af-packet, etc.) shown in number 311 for input and other processing operations; the data processed by this operation is sent to the VPP Graph processing link (such as L2 / L3 / ACL / NAT, etc. nodes) shown in number 312 for further processing; during this further processing, the packet to be detected is copied or uploaded to the upload / mirror traffic to be detected (punt / mirror / tap) shown in number 313 to send the packet across processes to the part shown in number 331 of the IPS / IDS engine 330 for threat detection / rule matching / signature scanning. The processing decision outputs based on the detection results (such as drop / block / blacklist / ACL recommendations, etc.) are sent back (e.g. via the control plane / Asymmetric Port Channel (APC)) to the part shown in number 312 for further processing; then, at number 312, the detected packets (if no risk is detected) are transmitted to the output node 314 for further transmission to the external network / next hop (as shown in number 340).

[0046] visible, Figure 3 The architecture shown has the following problems:

[0047] First, there is significant inter-process communication overhead. Message exchange and state information synchronization rely on inter-process communication (IPC) mechanisms, which introduces additional CPU processing overhead and can easily become a system performance bottleneck in high-throughput scenarios.

[0048] Second, there are issues with context switching and cache invalidation. Frequent context switching caused by cross-process scheduling can significantly reduce CPU cache hit rate, resulting in decreased packet processing efficiency, impairing overall system forwarding throughput and increasing service tail latency.

[0049] Third, there is a defect of delayed security handling. Because the security detection process and the traffic handling process belong to different thread processing links, their processing sequence cannot be completely synchronized, which will create a malicious traffic protection window. There will be problems such as packets being identified as malicious traffic, but the forwarding plane failing to complete the blocking and handling in time, which reduces the effectiveness and real-time performance of the overall network security protection.

[0050] In summary, traditional separate implementation schemes generally suffer from systemic performance bottlenecks in high-throughput network scenarios due to packet interaction and cross-process collaborative scheduling. The architecture design that separates forwarding and security detection functions inevitably introduces multiple performance overheads, such as process context switching, low CPU cache utilization, and inter-process communication, continuously limiting system forwarding throughput and packet processing efficiency. Furthermore, current technologies have not yet introduced session-based pre-filtering and traffic bypass mechanisms at the system architecture level, making it impossible to achieve a dynamic adaptive balance between security detection rate and system performance based on network traffic conditions, thus failing to meet the demands of both high security protection accuracy and ultra-high throughput network operation.

[0051] To address at least one of the aforementioned problems, at least one embodiment of this disclosure provides a real-time intrusion detection and prevention processing technology based on the data forwarding plane in high-throughput network environments. More specifically, to address at least one of the aforementioned problems, at least one embodiment of this disclosure provides a packet processing method, comprising: loading a packet processing architecture in a network device, wherein the packet processing architecture is deployed independently of the network device's kernel and includes a packet parsing node and a packet risk detection and handling node, the packet processing architecture running within a single process; parsing a target packet at the packet parsing node; and performing risk detection on the parsed target packet at the packet risk detection and handling node, and performing risk handling on the target packet based on the risk detection result. This method enables the parsing, risk detection, and handling of target packets within a single process. This allows the method provided by this disclosure to eliminate the data copying and process context switching overhead caused by cross-process packet transmission, significantly improving the overall performance of packet security processing in high-throughput scenarios. In addition, this also enables the method provided in this disclosure to perform integrated execution of message parsing, risk detection and handling based on a single process, effectively reducing the processing latency of intrusion prevention and ensuring that network attacks can be blocked in time.

[0052] Corresponding to the method described in at least one embodiment of this disclosure, at least one embodiment of this disclosure also provides a corresponding network device, computer-readable storage medium, and computer program product. These will be described below with reference to the accompanying drawings and examples.

[0053] Figure 4 The present disclosure schematically illustrates a message processing method provided by at least one embodiment.

[0054] like Figure 4 As shown, the method 400 of this embodiment may include steps S410 to S430. The subject executing this method may be a network device, which may include a gateway, router, switch (such as a Layer 3 switch), firewall, or other devices with network connectivity. The embodiments of this disclosure do not limit this.

[0055] Step S410: Load the packet processing architecture in the network device.

[0056] According to at least one embodiment of this disclosure, the message processing architecture can be deployed independently of the network device's kernel.

[0057] As an example, this message processing architecture may include message parsing nodes and message risk detection and handling nodes. This message processing architecture can run within a single process.

[0058] It should be noted that, in addition to the aforementioned message parsing nodes and message risk detection and handling nodes, this message processing architecture may also include other nodes, such as receiving nodes and output nodes. Furthermore, the functions implemented by each node in this message processing architecture can be predefined based on actual needs, and the functions implemented by each node can also be executed through the same node or different nodes, depending on actual requirements.

[0059] Additionally, it is understood that the term "node" in this document can refer to a programmable, modular, software-implemented logical unit for performing specific message processing tasks, and may also be referred to as a processing node or processing module. The embodiments of this disclosure do not limit this.

[0060] As an example, this message processing architecture can operate in user space, bypassing the kernel.

[0061] For example, the message processing architecture may include a Vector Packet Processing (VPP) architecture.

[0062] As can be seen, the method provided by one or more embodiments of this disclosure offers a kernel-independent packet processing architecture. It bypasses the kernel to perform subsequent packet parsing, risk detection, and risk mitigation operations, thus avoiding the forwarding overhead of the operating system kernel protocol stack, reducing performance losses caused by switching between kernel mode and user mode, and effectively improving packet processing throughput under high-traffic networks. Furthermore, the method provided by one or more embodiments of this disclosure can also complete complete security detection and mitigation logic independently of the kernel, reducing compatibility risks associated with kernel module development and shortening response latency to intrusion attacks.

[0063] Step S420: At the message parsing node, the target message is parsed.

[0064] As an example, the target message can be parsed to obtain the content carried in the target message, such as the payload.

[0065] Step S430: At the message risk detection and handling node, risk detection is performed on the parsed target message, and risk handling is carried out on the target message based on the risk detection results.

[0066] As an example, risk detection can be performed on the parsed payload, such as using the functions that IDS and / or IPS can achieve to perform risk detection on the payload, and then risk handling can be performed on the target message carrying the payload based on the results of the risk detection, such as blocking or forwarding to the next node.

[0067] As can be seen, the method provided by one or more embodiments of this disclosure can parse target packets through a packet parsing node in a packet processing architecture running within a single process, and perform risk detection on the parsed target packets through a packet risk detection and handling node, and handle the risk of the target packets based on the risk detection results. This allows the method provided by one or more embodiments of this disclosure to decouple the packet parsing process and the security handling process by dividing the architecture into independent packet parsing nodes and packet risk detection and handling nodes, facilitating independent iterative optimization of each module and improving the scalability of the entire packet processing chain. In addition, this also enables the method provided by one or more embodiments of this disclosure to rely on dedicated nodes to perform packet parsing, risk detection and handling operations, standardize pipeline processing logic, and reliably ensure the processing timeliness of security services in high-throughput scenarios. Furthermore, this enables the method provided by one or more embodiments of this disclosure to parse, detect risks, and handle target packets within a single process; this enables the method provided by this disclosure to eliminate the overhead of data copying and process context switching caused by cross-process transmission of packets, significantly improving the overall performance of packet security processing in high-throughput scenarios; this also enables the method provided by this disclosure to complete the integrated execution of packet parsing, risk detection, and handling based on a single process, effectively reducing the processing latency of intrusion prevention and ensuring that network attacks can be blocked in real time.

[0068] According to at least one embodiment of this disclosure, a target message may include multiple messages. Parsing the target message may include: generating a single vector corresponding to the multiple messages, and parsing the single vector. Performing risk detection on the parsed target message may include: performing risk detection on the parsed single vector.

[0069] As an example, the method provided in this disclosure can utilize a vectorization mechanism (such as VPP's frame / vector mechanism) to package multiple packets (e.g., 64 or 128) into a single vector (or frame). Then, the same parsing logic (such as parsing the IP header, obtaining the payload, etc.) is performed in parallel on the multiple packets within the packaged vector, instead of processing each packet individually. Furthermore, the packet risk detection and handling node does not receive a single packet, but rather a vector containing multiple packet buffers. The packet risk detection and handling node performs unified detection and handling operations on all packets within this vector, instead of processing them in a cyclical manner.

[0070] As can be seen, the method provided by one or more embodiments of this disclosure can process multiple data packets as a batch (Vector / Frame) through vectorization technology, instead of processing them packet by packet. This effectively reduces the function calls and branch prediction overhead of packet-by-packet parsing, thereby significantly reducing CPU context switching and branch prediction failures, improving CPU instruction efficiency, and increasing throughput.

[0071] According to at least one embodiment of the present disclosure, the message processing architecture is configured with at least one thread for processing messages within a single process, and when each message in the target message comes from the same session, parsing the target message, performing risk detection on the parsed target message, and performing risk disposal on the target message are performed by the same thread in the at least one thread.

[0072] As an example, a single process can be configured with four threads for processing packets. For instance, if the network device has four available CPU cores, this single process can be configured with one, two, three, or four threads for processing packets.

[0073] With four threads (Thread 1, Thread 2, Thread 3, and Thread 4), assuming the target message comprises five packets (Message 1, Message 2, Message 3, Message 4, and Message 5), since Message 1, Message 2, Message 3, Message 4, and Message 5 belong to the same session, Thread 2 can perform parsing, risk detection, and risk handling on Message 1, Message 2, Message 3, Message 4, and Message 5. It should also be noted that Thread 2 can handle multiple packets from another session.

[0074] As an example, it can be determined whether packets belong to the same session based on the 5-tuple obtained from the packets. This 5-tuple can include the Internet Protocol (IP) address, source port, destination IP address, destination port, and transport layer protocol (such as TCP, UDP, ICMP, etc.). If two packets have the same 5-tuple, then it can be determined that the two packets belong to the same session.

[0075] For example, the 5-tuple of message 1 is: 192.168.1.10:5000 -> 10.0.0.1:80 (TCP). The 5-tuple of message 2 is: 192.168.1.10:5000 -> 10.0.0.1:80 (TCP). Therefore, it can be determined that message 1 and message 2 belong to the same session.

[0076] For example, the 5-tuple of message 1 is: 192.168.1.10:5000 -> 10.0.0.1:80 (TCP). The 5-tuple of message 2 is: 192.168.1.10:5001 -> 10.0.0.1:80 (TCP). Therefore, it can be determined that message 1 and message 2 do not belong to the same session.

[0077] As can be seen, the method provided by one or more embodiments of this disclosure can bind a session to the same thread to complete the entire process, avoiding the lock contention overhead caused by the migration and synchronization of session state data between multiple threads, and improving the efficiency of message security processing. In addition, by using a five-tuple to complete session identification and coordinating with thread scheduling, the continuity of the message processing context for the same session is ensured, state maintenance costs are reduced, and the stability of detection logic under high concurrency traffic is improved.

[0078] According to at least one embodiment of this disclosure, the message processing architecture may further include a session determination node. The message processing method may further include: at the session determination node, determining a target message from a plurality of messages received by the network device from an external source before parsing the target message, wherein the target message includes at least one message from the same session.

[0079] As an example, a network device can access data from the outside (e.g., via its network interface card) through its network interface (such as a network card). Figure 1 The terminal device 120 shown receives multiple messages. The network device can then determine the target message from these multiple messages.

[0080] As an example, determining the target message may include the following steps:

[0081] Step 1: Extract the 5-tuple information from the header of each of the multiple received messages.

[0082] As an example, the 5-tuple information may include the source Internet Protocol IP address, source port, destination IP address, destination port, and transport layer protocol.

[0083] For example, the five-tuple information extracted from the header of message 1 is: 192.168.1.10:5000 -> 10.0.0.1:80 (TCP), where 192.168.1.10 is the source IP address, 5000 is the source port, 10.0.0.1 is the destination IP address, 80 is the destination port, and TCP is the transport layer protocol.

[0084] Step 2: Determine the target message based on the five-tuple information of each message.

[0085] As an example, if the five-tuples of message 1 and message 2 are the same (e.g., both are about session 1), then the target message can be determined to include message 1 and message 2. If the five-tuples of message 3, message 4, and message 5 are the same (e.g., all are about session 2), then the target message can be determined to include message 3, message 4, and message 5.

[0086] As an example, this message processing architecture can use a consistent hashing mechanism to map the five-tuple of a message to a specific thread for processing, thereby ensuring that all messages within the same session are processed by the same thread.

[0087] Suppose there are 4 threads: thread 1, thread 2, thread 3, and thread 4.

[0088] The 5-tuple for message A (belonging to session 1) is: 192.168.1.10:5000 -> 10.0.0.1:80.

[0089] Calculate the hash: Hash(A) = 12345.

[0090] Modulus: 12345 % 4 = 1

[0091] Result: Message A is placed in the queue of thread 1 for processing by thread 1.

[0092] The 5-tuple of message B (a follow-up packet to session 1) is: 192.168.1.10:5000 -> 10.0.0.1:80.

[0093] Calculate the hash: Hash(B) = 12345 (because the quintuples are the same, the hash value is the same).

[0094] Modulus: 12345 % 4 = 1

[0095] Result: Message B was also placed in the queue of thread 1 for processing by thread 1.

[0096] The 5-tuple of message C (Session 2) is: 192.168.1.10:5001 -> 10.0.0.1:80.

[0097] Calculate the hash: Hash(C) = 67890

[0098] Modulus: 67890 % 4 = 2

[0099] Result: Message C is placed in the queue of thread 2 for processing by thread 2.

[0100] As can be seen, as long as the quintuple remains unchanged, the hash value remains unchanged, the modulo result remains unchanged, and the message will always be assigned to the same thread for processing.

[0101] It should be noted that the above method of assigning messages belonging to the same session to the same thread for processing by calculating hashes and modulo is just an example. Other methods can also be used to achieve the same result.

[0102] For example, a network device's system can maintain a flow-to-worker mapping table. When the first packet (new session) arrives, the system does not calculate directly, but randomly or in a round-robin fashion selects an idle thread and stores the mapping relationship (5-tuple -> thread ID) in a hash table. When subsequent packets arrive, the system directly looks up the thread ID in the table, and then the subsequent packets are also handled by the thread indicated by that thread ID.

[0103] As can be seen, the method provided by one or more embodiments of this disclosure can identify session affiliation by extracting the packet's five-tuple, enabling session segmentation before packet parsing and providing accurate session identification basis for subsequent session-level security detection. Furthermore, by relying on the five-tuple as a session determination feature, it achieves accurate differentiation of network sessions, ensuring that packets within the same network session can be uniformly managed and securely processed.

[0104] According to at least one embodiment of this disclosure, performing risk detection on the parsed target message may include: performing risk detection on the parsed target message in response to the traffic type corresponding to the parsed target message being a first traffic type.

[0105] As an example, traffic type can reflect a business flow or behavioral pattern composed of a set of messages. It can indicate the purpose, source, or behavioral characteristics of the entire session, such as web browsing traffic, SSH management traffic, DNS query, DDoS attack traffic, file transfer traffic, etc.

[0106] As an example, the first traffic type can be a non-exempt type. When the traffic type is an exempt type, risk detection of the packet can be skipped; for example, certain management flows, specific ports / protocols, and traffic that cannot be decrypted in encrypted tunnels can be considered traffic types that do not require detection or cannot be detected, and such traffic types are exempt types.

[0107] For example, management traffic may contain thousands of TCP, UDP, or ICMP packets at the message level; at the traffic level, these packets collectively constitute "network management traffic" (such as SNMP, SSH, Ping). The method provided in this disclosure can identify that this is a "management traffic" (e.g., based on the source IP being a network management server, the destination port being 22 / 161, etc.), and thus the entire traffic type is marked as an exemption type, allowing all packets under this traffic to skip risk detection.

[0108] As can be seen, the method provided by one or more embodiments of this disclosure can distinguish between traffic exempt from inspection and traffic to be inspected by identifying traffic types. Traffic exempt from inspection can skip the risk detection process directly, reducing unnecessary detection computation overhead and improving overall packet processing throughput. Furthermore, the method provided by one or more embodiments of this disclosure can implement differentiated detection strategies based on business attributes to determine traffic types. This ensures the security audit capabilities of critical businesses while reducing the computing power consumption of the detection engine and shortening the forwarding latency of legitimate traffic exempt from inspection.

[0109] According to at least one embodiment of this disclosure, performing risk detection on the parsed target message may include the following steps:

[0110] Step 1: Determine the risk level of the session based on the session attributes of the session to which the target message belongs.

[0111] As an example, session attributes may include at least one of the following: source Internet Protocol IP address, source port, destination IP address, destination port, transport layer protocol, source IP address class, destination IP address class, traffic direction, application type, session duration, statistical characteristics of the data transmitted during the session, and historical threat records of the source IP address and / or destination IP address.

[0112] For the following attributes: source IP address, source port, destination IP address, destination port, and transport layer protocol.

[0113] Specific examples:

[0114] Source / Destination IP: 192.168.1.100 (internal network), 203.0.113.50 (external network).

[0115] Source / destination ports: 54321 (random high bits), 80 (HTTP), 22 (SSH).

[0116] Transport layer protocols: TCP, UDP, ICMP.

[0117] Risk assessment logic:

[0118] High risk level: The source port is a random high bit, the destination port is 22 (SSH) or 3389 (RDP), and the protocol is TCP. Judgment: This may be a brute-force attack or a remote intrusion attempt.

[0119] Low risk level: Source port 443, destination port 80, protocol TCP. Assessment: Regular web traffic, low risk.

[0120] Anomaly: The protocol is ICMP, but the data payload is abnormally large. Judgment: Possibly an ICMP tunneling attack.

[0121] For attributes: source IP address class, destination IP address class.

[0122] Specific examples:

[0123] Category tags: Private internal network address (RFC 1918), Trusted public IP (whitelist), Blacklisted public IP (threat intelligence), Tor exit node, Botnet IP range, High-risk country / region IP.

[0124] Example data: The source IP belongs to a known botnet IP range (203.0.113.0 / 24).

[0125] Risk assessment logic:

[0126] High risk level: The source IP or destination IP is on a blacklist or in a threat intelligence database (such as a known C2 server). Direct assessment: High risk, immediate intervention required.

[0127] Low risk level: The source IP is a trusted internal network management segment, and the destination IP is an internal core database. Assessment: Low risk.

[0128] Medium risk level: The source IP is a public network, and the destination IP is a high-risk country / region. Determination: In-depth detection is required.

[0129] For the attribute: traffic direction (Inbound / Outbound).

[0130] Specific examples:

[0131] Inbound: External IP address -> Internal server.

[0132] Outbound: Internal server -> external IP.

[0133] Risk assessment logic:

[0134] Abnormal outbound connection: The internal server actively initiates a large number of connections to unknown external IPs (e.g., 192.168.1.5 -> 203.0.113.99). Assessment: The internal network host may have been infected with a Trojan (C2 communication) or there may have been a data breach. This is classified as a high-risk situation.

[0135] Abnormal inbound connection: An external IP attempted to connect to an internal non-public port (e.g., 203.0.113.10 -> 192.168.1.5:8080, and port 8080 is not mapped). Judgment: This could be a port scan or intrusion attempt. This level is considered high risk.

[0136] For the attribute: Application type (services based on Deep Packet Inspection (DPI) or port identification).

[0137] Specific examples:

[0138] Business types: Web browsing (HTTP / HTTPS), database (MySQL / Oracle), file transfer (SFTP / FTP), instant messaging (WeChat / DingTalk), encrypted tunnel (IPSec / SSL), DNS, unknown applications.

[0139] Example: Traffic identified as a database protocol on a non-standard port (e.g., MySQL running on port 8080).

[0140] Risk assessment logic:

[0141] High risk level: Identification of unauthorized applications (such as employees using P2P to download during work hours) or sensitive protocols running on non-standard ports (such as SSH running on port 80). Determination: Violation or potential attack, requires blocking or speed limiting.

[0142] Medium risk level: Encrypted tunnel traffic identified (content cannot be decrypted). Judgment: Further analysis based on statistical characteristics (such as abnormal traffic patterns).

[0143] For the attribute: Session duration (the time span from session establishment to disconnection / timeout).

[0144] Specific examples:

[0145] Short connection: 0.5 seconds (milliseconds).

[0146] Interval: 5 minutes.

[0147] Long-term connection: 24 hours.

[0148] Risk assessment logic:

[0149] Extremely short: < 100ms. Judgment: It may be a port scan or SYN Flood attack, and is judged to be of high risk level.

[0150] Extremely long: > 1 hour and no application layer data interaction. Judgment: It may be a persistent backdoor or heartbeat packet, which is of high risk and is classified as a high-risk level.

[0151] Normal: 1-10 minutes of web browsing or file transfer. Assessment: Low risk level.

[0152] For attributes: statistical characteristics of data transmitted during the session (including cumulative byte count, packet rate, average packet size, etc.).

[0153] Specific examples:

[0154] Total bytes: 500MB (large traffic), 1KB (small packet).

[0155] Packet rate (PPS): 10000pps (high frequency), 10pps (low frequency).

[0156] Average packet size: 64 bytes (small packet), 1500 bytes (large packet).

[0157] Small package percentage: 95% (abnormally high).

[0158] Risk assessment logic:

[0159] DDoS characteristics: Packet rate > threshold (e.g., 5000 pps) and average packet size is extremely small. Assessment: DDoS attack, high risk level.

[0160] Characteristics of data breaches: The cumulative number of bytes is huge (e.g., 1GB) and it is a one-way outbound process. Assessment: Data leakage, high risk level.

[0161] Bypass trigger: Cumulative bytes > threshold (e.g., 100MB) and no abnormal statistical characteristics. Assessment: Low risk level, the Bypass mechanism can be triggered.

[0162] Scanning characteristics: Small packet ratio > 90%, high packet rate. Assessment: Port scanning, medium to high risk level.

[0163] Target attributes: historical threat records of source IP address and / or destination IP address.

[0164] Specific examples:

[0165] Historical record: SQL injection rules were hit in the past 24 hours, and the account was temporarily banned in the past 7 days. It has never been flagged. Reputation score: 80 (good).

[0166] Example data: The source IP 203.0.113.50 launched a DDoS attack yesterday.

[0167] Risk assessment logic:

[0168] Repeat offenders: The source IP has a history of attacks (such as being blocked in the past 24 hours). Judgment: Even if the current message is normal, the risk level will be directly upgraded (e.g., from "medium" to "high"), or the message will be automatically added to the blacklist.

[0169] Whitelist: Source IPs with a long history of good practices (such as internal servers). Assessment: Risk level downgraded to low risk level, which may allow for skipping some tests.

[0170] No record: New IP. Decision: Processed according to the default rules (usually considered "under observation").

[0171] A comprehensive example of the above attributes: Risk level calculation scenario

[0172] Scenario 1: User 192.168.1.100 (internal network) accesses 203.0.113.50 (external network).

[0173] Five-tuple: 192.168.1.100:5000 -> 203.0.113.50:443 (TCP). Base score: 0 (port is normal).

[0174] IP Classification: Destination IP 203.0.113.50 belongs to the blacklist. Risk +100.

[0175] Traffic direction: Outbound. Risk +10 (Intranet proactive connection to blacklist).

[0176] Application type: HTTPS. Risk +0 (encrypted, cannot be deeply tested, but the port is normal).

[0177] Session duration: New connection (0 seconds). Risk +0.

[0178] Statistical characteristics: Cumulative bytes: 0. Risk +0.

[0179] Historical threats: No historical threat records were found for source IP 192.168.1.100. Risk -10 (Trust bonus).

[0180] Final judgment:

[0181] Total score: 100 (high risk level).

[0182] At this point, the subsequent actions of the network devices could be: immediately block the session, issue a temporary ACL to ban the session, and issue an alert.

[0183] Scenario 2 (Low Risk):

[0184] If the destination IP is 8.8.8.8 (whitelisted DNS), and the statistics show a cumulative byte count of 50MB.

[0185] Decision: If the total score is less than the threshold, then bypass the depth detection.

[0186] It is evident that through this multi-dimensional combination of attributes, the system can accurately calculate the risk level, thereby achieving a balance between dynamic defense and high performance.

[0187] Step 2: Perform risk detection on the parsed target packet based on whether the risk level meets the first condition or whether the load of the network device's operating system or the data volume of the session to which the target packet belongs meets the second condition.

[0188] As an example, the first condition could be based on a comparison between the risk level and a predetermined risk level threshold. The second condition could be based on a comparison between the network device's operating system load and a predetermined load threshold, or a comparison between the cumulative data volume of the session to which the target packets belong and a threshold data volume.

[0189] For example, a predetermined risk level threshold could be 60 points. Scores below this threshold indicate a low risk level, while scores above or equal to this threshold indicate a medium or high risk level. To further differentiate between medium and high risk levels, a second predetermined risk level threshold (e.g., 80 points) can be set.

[0190] The predetermined load threshold may include a CPU utilization threshold, such as 85%. Exceeding this predetermined load threshold indicates that the system is under high load.

[0191] The threshold data size can be 4MB. Data exceeding this threshold can indicate a session to which many target packets have been transmitted cumulatively, further suggesting that the session is likely secure and low-risk.

[0192] In the above scenarios, the first condition can be that the risk level is not low-risk. The second condition can be that the network device's operating system load is not high, or the cumulative data volume of the session to which the target packets belong is less than the threshold data volume. In this case, risk detection needs to be performed on the parsed target packets. However, if the network device's operating system load is high, or the cumulative data volume of the session to which the target packets belong is equal to or greater than the threshold data volume, detection can be skipped for low-risk sessions.

[0193] As can be seen, the method provided by one or more embodiments of this disclosure can assess the session risk level based on multi-dimensional session attributes, achieve refined session risk determination, and improve the flexibility and accuracy of intrusion detection strategies. Furthermore, the method provided by one or more embodiments of this disclosure can also dynamically trigger packet detection based on device load and session data volume, selectively exempting low-risk sessions from detection overhead under high-load scenarios, thus balancing security protection capabilities and device performance.

[0194] According to at least one embodiment of the present disclosure, the message processing method may further include: during the operation of the message processing architecture within a single process, updating at least one of the predetermined load threshold, threshold data volume, and predetermined risk level threshold based on a version identifier or buffer identifier corresponding to a predetermined load threshold, threshold data volume, and predetermined risk level threshold.

[0195] As an example, predetermined load thresholds, threshold data volumes, predetermined risk level thresholds, and rules for intrusion detection and prevention can be updated based on actual needs, such as by users or administrators based on actual usage. In existing technologies, it is necessary to restart the relevant processes for the updated thresholds or rules to take effect; however, the method provided in this disclosure does not require restarting the processes, but rather dynamically loads or hot-updates thresholds or rules directly during process execution, for example, by updating based on version identifiers or buffer identifiers.

[0196] For version identification, thresholds or rules can include a version ID. When a thread in the message processing architecture begins processing a Vector, it records the current version ID. If the threshold or rule is updated during processing, the thread will detect the version ID change. In this case, the thread can choose to continue using the old version until the current Vector is finished processing, or immediately switch to the new version (this can depend on the specific implementation strategy; usually, ensuring consistency within the Vector is sufficient).

[0197] For buffer identifiers, updates can be implemented using a double buffering strategy. The specific process may include the following steps:

[0198] Step 1: Prepare new rules (backend / control panel)

[0199] Action: The administrator or control plane program issues a new rule set (e.g., adding a new SQL injection rule or adjusting the threshold).

[0200] Execution: The system does not directly modify the currently used rule base, but instead writes the new rule to the "alternate buffer" (e.g., Buffer B / Version 2).

[0201] Status: At this point, the data plane (thread) is still reading the "main buffer" (Buffer A / Version 1), and the business is completely unaffected.

[0202] Step 2: Atomic switching (switching pointers)

[0203] Action: Once the new rule in the backup buffer has been loaded and verified, the system executes an atomic operation.

[0204] Execution: Instantly switch the global "current rule pointer" from pointing to Buffer A to pointing to Buffer B. In a 64-bit system, for example, pointer assignment is an atomic instruction, requiring no locking and taking nanoseconds.

[0205] Effect: The pointer obtained by the next thread (or after the current thread finishes processing the current Vector) directly points to the new rule base.

[0206] Step 3: Clean up old resources (waste recycling)

[0207] Action: Confirm that all threads have switched to the new rule base and that the old rule base (Buffer A) is no longer being referenced.

[0208] Execution: The system safely releases the memory occupied by Buffer A to prevent memory leaks.

[0209] Timing: Reference counting is typically used to ensure that old resources are safely released.

[0210] As can be seen, the method provided by one or more embodiments of this disclosure can support hot updates of various thresholds and protection rules during process execution without restarting the packet processing process, thus avoiding network traffic processing interruptions caused by update operations. Furthermore, the method provided by one or more embodiments of this disclosure can also manage configuration updates using version identifiers or buffer identifiers, enabling real-time switching of protection policies without interrupting service forwarding, thereby improving the continuity of security protection configuration iterations and ease of operation and maintenance.

[0211] According to at least one embodiment of this disclosure, risk handling of a target packet based on the result of risk detection may include: performing a handling action on the parsed target packet in response to a result indicating that the parsed target packet or the session to which the parsed target packet belongs is threatened; and sending the parsed target packet to the next node of the network device after the packet risk detection and handling node in response to a result indicating that the parsed target packet or the session to which the parsed target packet belongs is not threatened.

[0212] As an example, if the risk level of the parsed target message or the session to which the parsed target message belongs is medium risk or high risk, it indicates that the target message or the session to which the target message belongs is a threat.

[0213] As an example, a threat can be determined by detecting known attack signatures (Signature-Based Detection).

[0214] This is the most direct way to determine a threat. The system performs deep analysis of the target message content and discovers that it contains known malicious code, attack payloads, or abnormal protocol headers.

[0215] Triggering condition: The message content (Payload) or protocol header field matches a preset attack rule base (such as Snort / Suricata rules).

[0216] Specific examples:

[0217] SQL injection: The message payload contains characteristic strings such as 'OR 1=1--' or 'UNION SELECT'.

[0218] XSS attack: The message contains <script>alert('xss')< / script> .

[0219] Buffer overflow: The TCP payload length is abnormal and contains specific shellcode signatures.

[0220] Malware signature: Detected binary signatures of known viruses, Trojans, or ransomware.

[0221] Protocol error: The TCP flag combination is abnormal (such as SYN+FIN), or the ICMP packet carries an excessively large data payload (ICMP Tunnel).

[0222] Assessment result: Threat exists (usually directly assessed as high risk).

[0223] As another example, a threat can be determined by identifying a target packet or the session to which it belongs based on session-level behavioral anomalies (Behavioral / Heuristic Detection). Even if a single packet appears "normal," a threat can be identified if the entire session to which the packet belongs exhibits abnormal behavioral patterns.

[0224] Triggering conditions: Session anomalies are determined based on statistical characteristics (traffic rate, packet size, duration, etc.) or historical status.

[0225] Specific examples:

[0226] (1) DDoS attack:

[0227] The session sent 10,000 packets in 1 second (the packet rate far exceeded the threshold).

[0228] Alternatively, the cumulative number of bytes in the session may surge in a short period of time (e.g., 1GB of data may be transferred in 1 second).

[0229] (2) Port scanning / brute force:

[0230] The same source IP connected to a large number of different destination ports in a short period of time (e.g., scanning 1,000 ports in 1 second).

[0231] Or, a large number of failed login attempts (such as SSH connection failures) are initiated from the same source IP within a short period of time.

[0232] (3) Low-and-Slow attack:

[0233] The connection lasts for an extremely long time (e.g., 24 hours), but the amount of data transmitted is very small, and the packet interval is fixed (suggested to be a C2 heartbeat).

[0234] (4) Abnormal session state:

[0235] The session had previously been marked as "blocked" or "blacklisted," but new packets were still coming in (indicating that the attacker was trying to bypass or reconnect).

[0236] The source IP of this session has been flagged as an attack source (repeat offender) in the historical threat log.

[0237] Assessment result: Threat exists (usually classified as medium or high risk depending on the severity).

[0238] If no threat is determined, the parsed target packet can be sent to the next node after the packet risk detection and handling node of the network device.

[0239] If a threat is identified, actions need to be taken to handle the target packets, such as blocking, dropping, rate limiting, redirecting, or mirroring.

[0240] Blocking can be a permanent interruption of an entire session, not only discarding the current packet but also preventing all subsequent packets from passing through. Specifically, a scenario that triggers this blocking could be: for a single packet, detecting SQL injection characteristics (such as 'OR 1=1'); and for a session, the session has been marked as "blocked" (e.g., a previous packet triggered a block). In this case, the system can update the session's status to BLOCKED. For the current packet, it is directly discarded without being sent. For subsequent packets: when the next packet from the same session enters the packet risk detection and handling node, the system can directly look up the table and find its status as BLOCKED, discarding it within seconds without performing any rule matching or other processing. Optionally, a temporary ACL rule can be issued in the packet processing architecture to directly discard all traffic from that source IP. In this case, the attack source can be completely cut off, preventing continuous attacks.

[0241] Dropping can be done on a single, specific packet without altering the overall session state (unless subsequent logic is upgraded). Specifically, scenarios triggering this drop could include: for a single packet, the current packet exhibits clear virus characteristics, while other packets in the session may be normal; or for a session, the system determines the session is in a "restricted state" (rate-limited), but the current packet exceeds the rate threshold. In this case, the system can directly release the buffer memory occupied by the packet. For the current packet: no forwarding, no alert (or only logging). For subsequent packets: they continue to the packet risk detection and handling node for normal detection. Under these circumstances, malicious packets can be accurately removed while maintaining connections for normal business operations.

[0242] Rate limiting allows packets to pass but restricts their transmission rate, discarding or queuing any excess packets. Specifically, scenarios triggering rate limiting include: for a single packet, detecting DDoS attack characteristics (such as SYNFlood) while wanting to maintain some service channels; and for a session, the cumulative packet rate exceeding a threshold (e.g., 1000pps) but not yet requiring complete blocking. In this case, the system updates the session state to RESTRICTED. For the current packet, if the current traffic is within the threshold (e.g., there are tokens in the token bucket), it is allowed; if the current traffic exceeds the threshold (token bucket is empty), the packet is discarded or placed in a queue for delayed transmission. Subsequent packets continue to be processed according to the rate limiting policy until the session recovers or times out. In this scenario, attack pressure can be alleviated, preventing complete service interruption while suppressing attack traffic.

[0243] Redirection can involve modifying the destination address or port of a packet, redirecting it to another device (such as a honeypot or sandbox). Specifically, scenarios triggering this redirection include: detecting suspicious C2 communication characteristics in a single packet; or suspecting a session has been hijacked or contains unknown malware. In these cases, the system can modify the packet's destination IP address (e.g., from 10.0.0.5 to 192.168.100.1) or destination port. The current packet is then sent to a honeypot or sandbox for analysis. Subsequent packets may be redirected further or blocked depending on the analysis results. This approach allows attackers to be lured or malware behavior to be analyzed in depth without affecting the real server.

[0244] Mirroring (or SPAN) can involve preserving the original packets for normal forwarding while simultaneously sending a copy to a monitoring device. Specifically, scenarios that trigger mirroring include: for single packets, detecting a potential threat but needing to preserve evidence for forensic analysis; and for sessions, the system being in "observation mode" and needing to record traffic characteristics. In this case, the system can leave the original packets unchanged (IP, MAC, and payload remain the same). The original packets are forwarded normally to the target device (e.g., for VPP, ip4-output -> network card). For the copy packets, an identical copy is sent to a designated monitoring port (e.g., a port connected to an IDS probe or SIEM system) via a mirror node, such as in VPP. This allows for "non-destructive testing," ensuring no disruption to business operations while enabling third-party systems to analyze threats in real time.

[0245] As can be seen, the methods provided by one or more embodiments of this disclosure can flexibly perform various types of actions such as blocking, dropping, rate limiting, redirection, or mirroring for threatening packets or sessions, enriching network security protection measures and adapting to differentiated security control needs. Furthermore, the methods provided by one or more embodiments of this disclosure can also directly forward non-threatening packets to downstream nodes, while timely performing corresponding protection operations on threatening packets, achieving coordinated detection and handling, and completing real-time security control while ensuring normal network forwarding capabilities.

[0246] According to at least one embodiment of the present disclosure, the message processing method may further include: updating the session state of the session to which the target message belongs in response to performing a disposal action on the parsed target message.

[0247] As an example, performing a processing action on the parsed target packet can indicate that the session to which the target packet belongs is under threat. In this case, the session state of the session to which the target packet belongs can be updated to a threat state.

[0248] At this point, for subsequent target packets belonging to the same session as the target packet, in response to the session state indicating that the session is under threat, the processing action is performed on the subsequent target packets at the packet risk detection and processing node, while the parsing of the subsequent target packets at the packet parsing node and the risk detection of the subsequent target packets at the packet risk detection and processing node are skipped.

[0249] As an example, a non-threat session state indicating that the target message belongs to a session can suggest that the session is not under threat. In this case, subsequent target messages belonging to the same session as the target message can be parsed.

[0250] As an example, a session state of "threat" for the session to which the target packet belongs indicates that the session to which the target packet belongs is threatened. In this case, for subsequent target packets belonging to the same session as the target packet, the aforementioned actions, such as blocking or dropping, can be performed directly on the subsequent target packets without parsing and risk detection.

[0251] As can be seen, the method provided by one or more embodiments of this disclosure enables the session state to be updated in real time after a security action is triggered. Subsequent packets from the same session can directly reuse the state determination result, eliminating the need for repeated packet parsing processes and saving computing resources. Furthermore, the method provided by one or more embodiments of this disclosure can also achieve selective packet parsing based on the session state. Session packets marked as threat states can directly undergo protection operations, shortening the processing latency of attack traffic and improving security interception efficiency in high-throughput scenarios.

[0252] According to at least one embodiment of this disclosure, a message risk detection and handling node can be deployed after the message parsing node and before the next node via an external extension interface of the message processing architecture.

[0253] As an example, the next node can be the node of the network device after the packet risk detection and handling node.

[0254] As an example, a message processing architecture can provide a programmable interface to allow users to implement their custom functionalities. This programmable interface can be referred to as an external extension interface. For example, for a VPP architecture, this external extension interface could refer to VPP's plugin registration mechanism and graph topology configuration.

[0255] As can be seen, the method provided by one or more embodiments of this disclosure can flexibly mount message risk detection and handling nodes into the message processing link through external extension interfaces, facilitating the on-demand deployment of security functions and improving the business expansion flexibility of the entire message architecture. Furthermore, the method provided by one or more embodiments of this disclosure can also support the development of custom security logic based on programmable external extension interfaces, enabling functional customization without modifying the core code of the forwarding framework, thus reducing the development and modification costs of security services.

[0256] According to at least one embodiment of this disclosure, the message processing architecture may further include a unicast message determination node located between the message parsing node and the message risk detection and handling node.

[0257] The message processing method may also include: at the unicast message determination node, determining whether the parsed target message from the message parsing node is a unicast message;

[0258] Performing risk detection on the parsed target message may include: performing risk detection on the parsed target message in response to determining that the parsed target message is a unicast message.

[0259] As an example, risk detection is typically performed on unicast traffic because unicast traffic is the primary carrier of user services and also the main target of attacks; while broadcast and multicast traffic are usually used for network discovery and protocol maintenance, with fewer attack characteristics or different processing logic. By identifying nodes through unicast packets, the method provided in this disclosure can ensure that packet risk detection and handling nodes only process unicast traffic, avoiding unnecessary deep detection of broadcast / multicast traffic, thereby saving CPU resources.

[0260] For a specific example, when a data packet arrives at a unicast packet identification node, the packet processing architecture (such as VPP) can check the IP header of the data packet to determine its traffic type. If it is unicast, for example, the destination IP address is a specific host address (e.g., 192.168.1.5), then the data packet is directed to the packet risk detection and handling node for risk detection and other operations. If it is not unicast (multicast / Broadcast / Local), for example, for multicast, the destination IP is a multicast address (e.g., 224.0.0.1); for broadcast, the destination IP is a broadcast address (e.g., 255.255.255.255); for local, the destination IP is the current gateway's own IP, then the data packet is directed to other processing paths (e.g., multicast routing, local protocol stack processing, etc.) and will not enter the packet risk detection and handling node for risk detection and other operations.

[0261] As can be seen, the method provided by one or more embodiments of this disclosure can identify the message type in advance by determining the node through unicast messages, and only send unicast traffic into the risk detection process, avoiding unnecessary deep security detection of broadcast and multicast messages, and reducing CPU computing power consumption. In addition, the method provided by one or more embodiments of this disclosure can also perform traffic splitting for different message types, so that security detection resources are concentrated on unicast service traffic that is vulnerable to network attacks, thereby improving the overall message forwarding throughput while ensuring the effectiveness of protection.

[0262] Based on the above combination Figure 4 As can be seen from the method described, the method provided by one or more embodiments of this disclosure can perform target packet parsing, risk detection, and handling within a single process. This enables the method provided by this disclosure to eliminate the overhead of data copying and process context switching caused by cross-process packet transmission, significantly improving the overall performance of packet security processing in high-throughput scenarios. Furthermore, this also allows the method provided by this disclosure to complete the integrated execution of packet parsing, risk detection, and handling within a single process, effectively reducing intrusion prevention latency and ensuring that network attacks can be blocked immediately.

[0263] To facilitate a better understanding of the above operations provided by at least one embodiment of this disclosure, further explanation will be provided below in the form of examples.

[0264] Based on the above combination Figure 4 As described above, the method and system using one or more embodiments of this disclosure can be an integrated high-performance IPS / IDS method and system based on a VPP architecture, the core of which is:

[0265] 1. The detection function is embedded in the same VPP process as a plug-in. The IPS / IDS detection logic is implemented as a detection node (such as IPS-NODE) ​​in the VPP graph and directly connected in the VPP data plane processing path.

[0266] 2. Detection is performed using the VPP vectorization (frame / vector) batch processing mechanism. Detection nodes perform unified parsing and detection on a batch of packets, reducing per-packet function calls and branch overhead.

[0267] 3. The "forwarding decision + detection decision + handling action" are completed serially within the same process and thread. This avoids cross-process communication, shared memory copying, context switching, and cache invalidation.

[0268] 4. Session management based on session / 5-tuple. This ensures that the same session is processed within the same VPP worker thread as much as possible, reducing cross-core migration and lock contention, and providing a state basis for subsequent bypass / blocking.

[0269] 5. Introduce session-level pre-filtering and bypass mechanisms. Skip detection for low-risk / no-detection traffic in advance; dynamically bypass low-risk sessions under high load, and concentrate resources to detect high-risk sessions.

[0270] 6. Closed-loop inline threat handling. After a detection node identifies a threat, it immediately discards / blocks it within the same thread and updates the session state or issues a temporary policy to achieve immediate blocking.

[0271] 7. Dynamic loading and hot updating of rules / policies. Supports updating the rule base and bypass thresholds even with continuous forwarding, and reduces the impact on the data surface through versioning, double buffering, and read-write separation.

[0272] The following example uses the VPP architecture for message processing.

[0273] At this point, the system runs within the same VPP process, and the system components (logical modules) may include:

[0274] VPP forwarding and protocol processing module: existing nodes such as packet reception, parsing, L2 / L3 forwarding, ACL / NAT, etc.

[0275] IPS / IDS detection plugin module: Register the detection node ips-node in the VPP graph (as described above). Figure 4 (The aforementioned message risk detection and handling node).

[0276] Session management module: 5-tuple / flow table, session status, session statistics;

[0277] Strategy and rule management module: rule base, feature base, bypass strategy, update mechanism;

[0278] Handling and Auditing Module: Drop / Block Actions, Alarm Logs, Audit Records (optional, interacts with the control plane).

[0279] Regarding node connection and link processing: In the VPP graph, ips-nodes can be arranged as follows... Figure 5 The connection is performed in series as shown.

[0280] Figure 5 The diagram illustrates a node connection and processing link provided in at least one embodiment of the present disclosure.

[0281] Reference Figure 5The ips-node 510 is located before the forwarding output (such as the next-node shown in number 520), ensuring that the detection results directly affect the final forwarding action. After the packet enters from the vpp's receiving node dpdk-input 530, it undergoes the preceding Layer 2 processing (such as the processing performed by the ethernet-input node shown in number 540) and routing processing (such as the processing performed by the ip4-input node shown in number 550) before being sent to the ips-node 510 node for detection (optionally, it may be processed via the ip4-unicast node shown in number 560). After the detection is completed, the decision is made based on the detection results whether the packet should follow the normal forwarding path or enter the dropping node.

[0282] Figure 5 The node numbered 530 is the dpdk-input node (DPDK input node), which is the entry point for data packets to enter the VPP. For example, the DPDK driver polls the network card, obtains the raw packet from the hardware Ring Buffer, allocates the VPPBuffer (using HugePages memory), then packs multiple Buffers into a Vector, and finally initializes the Buffer metadata.

[0283] Figure 5 The node numbered 540 is the ethernet-input node, which can perform Layer 2 protocol parsing, such as parsing the Ethernet frame header (source / destination MAC address), checking the Ethernet type field (to determine if it is IPv4 / IPv6, etc.), verifying frame integrity (CRC check), and extracting Layer 2 information for use by subsequent nodes.

[0284] Figure 5 The node numbered 550 is the ip4-input node (IPv4 input node), which can perform Layer 3 protocol parsing, such as parsing IP headers (source / destination IP, protocol type, TTL, etc.), verifying IP header integrity (checksum, length), and extracting 5-tuple information for use by the ips-node. It should be noted that IPv4 is just an example; it could also be IPv6, etc.

[0285] Figure 5 The ip4-unicast node shown as number 560 in the above is the combination of the aforementioned Figure 4 The unicast message determination node determines whether it is a unicast message and, if it is a unicast message, sends the message to the node shown in 510; if it is not a unicast message, it may enter other processing paths.

[0286] Figure 5The node numbered 570 is an ip4-lookup node, which can perform routing table lookups, such as querying the routing table based on the destination IP, then determining the next-hop IP and outgoing interface, and finally returning the routing results for subsequent nodes to use.

[0287] Figure 5 The node numbered 580 is the ip4-rewrite node, which can perform Layer 2 frame header rewriting, such as rewriting the MAC header (source / destination MAC) based on the routing results, then updating the TTL value, and finally recalculating the IP checksum.

[0288] Figure 5 The node numbered 590 is the ip4-output node, which is capable of preparing for output, such as sending packets into the output queue, preparing them for transmission via DPDK, and finally counting the number of transmissions.

[0289] Figure 5 The node numbered 520 in the diagram is the next-node, which can perform subsequent processing, such as receiving packets processed by the ips-node and then continuing the forwarding process.

[0290] The specific message processing methods and steps may include the following steps.

[0291] Step 1: VPP integrated deployment and node registration.

[0292] Loading IPS / IDS plugins within the same VPP process, as described above. Figure 4 The aforementioned external expansion interface;

[0293] The plugin registers the detection node ips-node with the VPP and configures its predecessor and successor node relationships in the graph;

[0294] It supports configuring the ips-node insertion position (e.g., after L3 table lookup, before output).

[0295] Step 2: Message access and vectorized batch processing.

[0296] VPP receives packets from the network interface card in frame / vector format and forms a batch of buffer vectors;

[0297] After the vectors enter the ips-node, the packets are processed in batches for field parsing, rule matching, and feature detection. During this process, VPP cache-friendly data structures can be reused as much as possible to reduce per-packet processing overhead.

[0298] Step 3: Process sequentially within the same thread to eliminate cross-process overhead.

[0299] The message is processed sequentially within the same VPP worker thread: parsing → session ownership → detection → handling → forwarding / dropping;

[0300] Messages are not transmitted via IPC, eliminating the need for additional communication threads and thus reducing context switching and cache invalidation.

[0301] Step 4: Session Management and Traffic Attribution.

[0302] Session entries (or flow entries) are created based on 5-tuples, and the following information can be saved: session identifier, status (normal / observation / blocking / bypass, etc.), and statistics (packet count / byte count / new creation time / last active time, etc.).

[0303] Previously, it was possible to bind the session to the VPP worker thread based on the session table or use consistent hashing to ensure that the same session would be stably processed by the same worker thread, thereby reducing cross-core contention.

[0304] Step 5: Pre-filtering mechanism and bypass mechanism.

[0305] Pre-filtering: Traffic types that do not require or cannot be detected (such as certain management flows, specific ports / protocols, and traffic that cannot be decrypted in encrypted tunnels) are marked as exempt from detection in advance, and the detection process is skipped directly;

[0306] Session-level risk identification: Calculate risk level based on session attributes (such as hit rules, statistical features, etc.);

[0307] Bypass strategy: When the system is under high load or the cumulative number of bytes in a session reaches a threshold, low-risk sessions are switched to bypass state, and subsequent packets are quickly skipped from detection, with only light checks or statistics retained.

[0308] Step 6: Closed-loop threat management and immediate blocking.

[0309] Once ips-node determines that the current packet or session is a threat, it immediately performs the following actions within the same thread:

[0310] o Directly discarding the current message or other processing actions;

[0311] o sets the session state to "blocked" (which indicates the presence of a threat), causing subsequent packets in the same session to be quickly hit and dropped;

[0312] Optional: Update action bits within VPP, issue temporary ACL / blacklist entries to expand the blocking scope;

[0313] Synchronous writing to the audit / alarm module ensures that "detection-handling-recording" is completed within the same link, reducing handling delays.

[0314] Step 7: Dynamic loading and hot updating of strategies and rules.

[0315] Supports incremental loading of the rule base, enabling / disabling detection items, adjusting detection levels and bypass thresholds;

[0316] By employing version number / double buffering or read-write separation structures, worker threads can read rules without locking or with low locking, thus avoiding impacting data plane throughput.

[0317] The specific content performed in the above steps can be obtained through... Figure 6 The content shown is used to illustrate this.

[0318] Figure 6 This illustration schematically depicts a specific message processing flow 600 provided in at least one embodiment of this disclosure. It should be noted that... Figure 6 The steps shown do not necessarily need to be strictly followed. Figure 6 The order of execution is shown, such as steps 2 and 7 described later, which can be executed simultaneously, or step 7 can be executed before step 2.

[0319] Reference Figure 6 The process begins at 610, when the network card receives packets and enters the VPP (frame / vector).

[0320] In step 1 (620): Integrated deployment and node registration. Load the IPS / IDS plugin and register the ips-node. Connect the ips-node to the VPP graph (before the output).

[0321] In step 2 of section 630, vectorized batch processing is initiated into the ips-node. A batch of packets is parsed / inspected uniformly by frame, thereby reducing per-packet function calls and branching overhead.

[0322] In step 3 of section 640: Process sequentially with the worker thread to perform "parse". Session ownership Detection Disposal "Forward / Drop" to avoid IPC / shared memory copying / context switching, etc.

[0323] In "Analysis" Session ownership Detection Disposal The process of "forwarding / discarding" may involve the content described below.

[0324] At 650, determine if the session table is hit (e.g., based on 5-tuples / flow, etc.).

[0325] If a match is missed (i.e., no match is found), it indicates that a new session has been created. Therefore, in step 4 (660), session management and traffic attribution, i.e., creating / updating session status and statistics, uses session-worker binding / consistent hashing to avoid cross-core migration.

[0326] If so, it means that the session already existed.

[0327] Then, the process proceeds to step 670.

[0328] At 670, determine if the pre-filter hit? (As mentioned earlier...) Figure 4 Whether or not traffic detection is unnecessary / impossible.

[0329] If a match is found, it indicates that the traffic is exempt from inspection, and the packet does not need to be inspected or cannot be inspected. At this point, the process proceeds to step 680, where a fast path is implemented, meaning the inspection is skipped and the packet is forwarded according to the existing forwarding strategy.

[0330] If the match is not found (i.e., no), the process proceeds to 690 to determine if the session is in a bypass state or if the bypass trigger conditions are met, such as low risk / byte threshold / high load.

[0331] If so (i.e., bypass processing), the process proceeds to 6100, where the bypass path is executed, i.e., lightweight processing; optionally, only statistical / lightweight rules can be implemented; then the process is forwarded.

[0332] If not (i.e., detection is required), the process proceeds to step 6110 to perform IPS / IDS detection, such as rule matching / feature detection / anomaly detection.

[0333] Next, the process proceeds to step 6120, where it is determined whether the issue constitutes a threat.

[0334] If not (i.e., normal), the process proceeds to 6130, forwards the output, or continues to graph subsequent nodes (output / egress).

[0335] If it is a threat, the process proceeds to step 6140, step 6: immediate closed-loop handling in the same thread, such as dropping the current packet, blocking the session, and optional updates to temporary ACL / blacklist / action bits; and synchronous alarms / auditing, etc.

[0336] Finally, the process reaches 6150, ends, or proceeds to the next batch of frames for further processing.

[0337] In addition, the following additional operations exist when rules, policies, etc. need to be updated.

[0338] In step 7 (6160), dynamic loading and hot updating of rules / policies (parallel control plane), such as based on version numbers, double buffering, and read-write separation, enables lock-free / low-lock reads on the worker side. Specifically, in step 6170, is it determined whether there are rule / policy updates?

[0339] If so, then at step 6180, perform an incremental update without stopping forwarding. After the update is complete (i.e., the new version takes effect), the process returns to the main step at step 6160.

[0340] If not, the process returns to main step 6160.

[0341] Based on the above combination Figure 6 As can be seen from the examples shown, the method provided in this disclosure can bring the following benefits:

[0342] 1. Increased throughput and reduced latency: Forwarding and detection are completed serially in the same process and thread, avoiding IPC / shared memory copying / context switching. Combined with VPP vectorized batch processing, cache hits and instruction efficiency are improved.

[0343] 2. Dynamic balance between detection rate and performance: Session-level pre-filtering and bypass allow resources to be focused on high-risk / new sessions, maintaining predictable detection capabilities under high load and preventing the detection engine from being overwhelmed.

[0344] 3. More timely response: The detection node is located within the forwarding path, and the session can be dropped and blocked immediately after the threat is determined, which significantly shortens the latency of the "detection-response" link.

[0345] 4. Reduced CPU resource consumption and simplified deployment: Reduce dedicated communication threads and cross-process channels, thereby reducing the rigid requirements for the number of cores and the complexity of core binding.

[0346] The core aspects of the method provided in this disclosure may include the following:

[0347] 1. The IPS / IDS detection logic is inlined within the graph processing chain of the same VPP process as a VPP plugin detection node. That is, the detection engine is changed from an independent process to a VPP graph node (ips-node), which directly participates in the data plane forwarding path, realizing a serial link in the same process of "packet reception → parsing / session → detection → processing → forwarding / dropping".

[0348] 2: Pre-filtering and bypass strategies based on session tables (including load / statistical triggers). That is, risk identification and state machines (normal / observation / bypass / blocking) are established at the session / five-tuple granularity, and the system dynamically decides whether to skip detection by combining session statistics and system load thresholds.

[0349] 3: Inline closed-loop processing within the same thread (directly discard after threat assessment / session blocking / optional temporary ACL). That is, the detection result is not transmitted back across processes; the action is executed directly in the same VPP worker thread and the session state is updated.

[0350] 4: Vectorized batch processing detection node implementation based on VPP frame / vector. That is, buffer vectors are processed in batches by frame in ips-node, reducing the overhead of per-packet calls.

[0351] In addition to the methods described above, this disclosure also provides corresponding network devices, computer-readable storage media, and computer program products in one or more embodiments. These will now be described in conjunction with the accompanying drawings.

[0352] Figure 7 An example configuration of a network device 700 provided in at least one embodiment of the present disclosure is illustrated.

[0353] See Figure 7 The network device 700 may include a processor 701 and a memory 702 coupled to the processor. Both the processor 701 and the memory 702 can be connected via a bus 703.

[0354] Processor 701 can perform various actions and processes according to the program stored in memory 702. Specifically, processor 701 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, which can implement or execute the methods, steps, and logic block diagrams provided in at least one embodiment of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor, and can be based on x86 architecture or ARM architecture.

[0355] Memory 702 stores computer instructions that, when executed by processor 701, implement any of the methods described above. Memory 702 may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory provided in at least one embodiment of this disclosure is intended to include, but is not limited to, these and any other suitable types of memory.

[0356] It should be understood that Figure 7 The network device configurations described herein are merely examples and not limitations. The network device configurations in this disclosure may include more than... Figure 7 The number of components in the component may be more or less.

[0357] In addition, this disclosure also provides a network device, including: a kernel-independent packet processing architecture, the packet processing architecture running in a single process, and including at least a packet parsing node and a packet risk detection and handling node, wherein the packet parsing node is configured to parse target packets; and the packet risk detection and handling node is configured to perform risk detection on the parsed target packets and perform risk handling on the target packets based on the results of the risk detection.

[0358] Furthermore, this disclosure also provides a network device comprising components for performing the above-described combination. Figure 1 The components of any of the steps in the described method. For example, the network device may include: a component for loading a packet processing architecture in the network device, wherein the packet processing architecture is deployed independently of the network device's kernel and includes a packet parsing node and a packet risk detection and handling node, the packet processing architecture running within a single process; a component for parsing a target packet at the packet parsing node; and a component for performing risk detection on the parsed target packet at the packet risk detection and handling node and handling the target packet based on the result of the risk detection.

[0359] Furthermore, this disclosure also provides a computer-readable storage medium for storing instructions that, when executed by a processor, perform the aforementioned combinations. Figure 4 Any of the methods described above. As an example, computer-executable instructions may be stored on a computer-readable storage medium. When executed by a processor, the computer-executable instructions can perform the methods described with reference to the above figures according to embodiments of the present disclosure. The computer-readable storage medium in embodiments of the present disclosure may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory provided in at least one embodiment of this disclosure is intended to include, but is not limited to, these and any other suitable types of memory.

[0360] Additionally, this disclosure provides a computer program product including computer program instructions that, when executed by a processor of a network device, perform the methods described in any of the preceding methods. As an example, the computer program product includes a non-transitory computer-readable storage medium having program instructions embodied therein, and the program instructions are executable by a processor. When executed, the program instructions cause the processor to perform one or more of the methods described above, and for the sake of brevity, details are omitted herein.

[0361] Although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0362] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

[0363] Unless otherwise expressly stated, expressions such as “according to,” “based on,” “depending on,” etc., as used in this disclosure do not mean “according to only,” “based on only,” or “depending on only.” In other words, in this disclosure, such expressions generally mean “at least according to,” “at least based on,” or “at least depending on.”

[0364] Any reference to the names “first,” “second,” etc., used in this disclosure is not intended to comprehensively limit the number or order of these elements. These expressions may be used in this disclosure as a convenient way to distinguish two or more elements. Therefore, reference to the first element and the second element does not imply that only two elements may be used, or that the first element must precede the second element in some form.

[0365] As used in this disclosure, the term "determine" can include a variety of operations. For example, "determine," calculation, operation, processing, derivation, investigation, search (e.g., searching in a table, database, or other data structure), and ascertainment are all considered "determine." Additionally, "determine" also refers to receiving (e.g., receiving information), sending (e.g., sending information), inputting, outputting, and accessing (e.g., accessing data in memory). Furthermore, "determine" can also refer to parsing, selecting, picking, building, and comparing. In other words, several actions can be considered "determine."

[0366] As used in this disclosure, terms such as “connected,” “coupled,” or any variation thereof refer to any direct or indirect connection or combination between two or more units, which may include situations where one or more intermediate units exist between two units that are “connected” or “coupled” to each other. The coupling or connection between units may be physical or logical, or a combination of both. As used in this disclosure, two units may be considered electrically connected by means of one or more wires, cables, and / or printing, and as multiple non-limiting and non-exhaustive examples, may be “connected” or “coupled” to each other by means of electromagnetic energy in the radio frequency region, microwave region, and / or light (visible and invisible) region, etc. Furthermore, in this disclosure, unless the context clearly indicates otherwise, the references to “at least one of…” or “one or more of…” in the list of items refer to any combination of these items, including a single member. By way of example and not limitation, “at least one of A, B or C”, “one or more of A, B or C”, “at least one of A, B and C”, “one or more of A, B and C” and “A, B, C or any combination thereof” cover: only A, only B, only C, A and B, A and C, B and C, and A, B and C; and any such combination may include one or more members of A, B or C (e.g., multiple A, multiple B or multiple C).

[0367] In this disclosure, unless otherwise expressly indicated, the term "or" should be understood in an inclusive sense (i.e., equivalent to "and / or") rather than an exclusive sense. For example, "A or B" could include only A, only B, or both A and B.

[0368] When the terms “comprising,” “including,” and variations thereof are used in this disclosure or claims, these terms are open-ended, just like the term “having.” Furthermore, the term “or” as used in this disclosure or claims is not an exclusive “or.”

[0369] It should be noted that the above description is merely some embodiments of this disclosure and an explanation of the technical principles employed. For example, the formulas involved in this disclosure are merely examples and not limitations. Those skilled in the art should understand that the scope of disclosure involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalent features without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this disclosure. That is to say, those skilled in the art will understand that many changes and / or modifications can be made to this disclosure shown in the specific embodiments without departing from the spirit or scope of this disclosure as broadly described. Therefore, this embodiment is considered illustrative rather than restrictive in all respects.

Claims

1. A message processing method, comprising: A packet processing architecture is loaded into a network device, wherein the packet processing architecture is deployed independently of the network device's kernel and includes packet parsing nodes and packet risk detection and handling nodes, and the packet processing architecture runs within a single process; At the message parsing node, the target message is parsed; and At the message risk detection and handling node, risk detection is performed on the parsed target message, and risk handling is carried out on the target message based on the result of the risk detection.

2. The packet processing method of claim 1, wherein, The target message includes multiple messages. The parsing of the target message includes: generating a single vector corresponding to the plurality of messages, and parsing the single vector; The risk detection performed on the parsed target message includes: performing risk detection on a single parsed vector.

3. The packet processing method of claim 1, wherein, The message processing architecture is configured with at least one thread for processing messages within the single process, and when each message in the target message comes from the same session, the parsing of the target message, the risk detection of the parsed target message, and the risk handling of the target message are all performed by the same thread in the at least one thread.

4. The packet processing method of claim 1, wherein, The message processing architecture also includes a session determination node, and the method further includes: Before parsing the target message, at the session determination node, the target message is determined from a plurality of messages received by the network device from the outside, wherein the target message includes at least one message from the same session.

5. The message processing method according to claim 4, wherein, Determining the target message includes: Extract the five-tuple information from the header of each of the multiple received messages, wherein the five-tuple information includes the source Internet Protocol IP address, source port, destination IP address, destination port, and transport layer protocol. The target message is determined based on the five-tuple information of each message.

6. The message processing method according to claim 1, wherein, The risk detection performed on the parsed target message includes: In response to the target message being identified as having the first traffic type, risk detection is performed on the target message.

7. The message processing method according to claim 1, wherein, The risk detection performed on the parsed target message includes: Based on the session attributes of the session to which the target message belongs, the risk level of the session is determined, wherein the session attributes include at least one of the following: source Internet Protocol IP address, source port, destination IP address, destination port, transport layer protocol, source IP address class, destination IP address class, traffic direction, application type, session duration, statistical characteristics of data transmitted during the session, and historical threat records of the source IP address and / or destination IP address; and Risk detection is performed on the parsed target packet based on whether the risk level meets the first condition, or whether the load of the network device's operating system or the cumulative data volume of the session to which the target packet belongs meets the second condition.

8. The message processing method according to claim 7, wherein, The first condition is based on a comparison between the risk level and a predetermined risk level threshold, and the second condition is based on a comparison between the operating system load of the network device and a predetermined load threshold, or a comparison between the cumulative data volume of the session to which the target packet belongs and a threshold data volume.

9. The message processing method according to claim 8, further comprising: During the operation of the message processing architecture within a single process, at least one of the predetermined load threshold, the threshold data volume, and the predetermined risk level threshold is updated based on a version identifier or buffer identifier corresponding to the predetermined load threshold, the threshold data volume, and the predetermined risk level threshold.

10. The message processing method according to claim 1, wherein, The risk handling of the target message based on the risk detection result includes: In response to the result indicating that the parsed target packet or the session to which the parsed target packet belongs is threatened, a disposition action is performed on the parsed target packet; and In response to the result indicating that the parsed target packet or the session to which the parsed target packet belongs is not a threat, the parsed target packet is sent to the next node of the network device after the packet risk detection and handling node.

11. The message processing method according to claim 10, wherein, The processing action performed on the parsed target message includes at least one of the following: Block the parsed target message; The parsed target message is discarded; Rate limiting is applied to the parsed target packets; Redirect the parsed target message; or Mirroring is performed on the parsed target message.

12. The message processing method according to claim 10, further comprising: In response to performing a processing action on the parsed target message, the session state of the session to which the target message belongs is updated; For subsequent target packets belonging to the same session as the target packet, in response to the session state indicating that the session is under threat, the handling action is performed on the subsequent target packet at the packet risk detection and handling node, while skipping the parsing of the subsequent target packet at the packet parsing node and the risk detection of the subsequent target packet at the packet risk detection and handling node.

13. The message processing method according to claim 1, wherein, The message risk detection and handling node is deployed after the message parsing node and before the next node via an external extension interface of the message processing architecture, wherein the next node is the node of the network device after the message risk detection and handling node.

14. The message processing method according to claim 1, wherein, The message processing architecture also includes a unicast message determination node located between the message parsing node and the message risk detection and handling node. The message processing method further includes: at the unicast message determination node, determining whether the parsed target message from the message parsing node is a unicast message; The step of performing risk detection on the parsed target message includes: performing risk detection on the parsed target message in response to determining that the parsed target message is a unicast message.

15. The message processing method according to claim 1, wherein, The message processing architecture includes a Vector Packet Processing (VPP) architecture.

16. A network device, comprising: A kernel-independent message processing architecture, which runs within a single process and includes at least a message parsing node and a message risk detection and handling node, wherein... The message parsing node is configured to parse the target message; and The message risk detection and handling node is configured to perform risk detection on the parsed target message and handle the risk of the target message based on the result of the risk detection.

17. A network device, comprising: processor; Memory coupled to the processor; as well as Computer program instructions stored in the memory, which, when executed by the processor, perform the message processing method as described in any one of claims 1-15.

18. A computer program product comprising computer program instructions that, when executed by a processor of a network device, perform the message processing method as described in any one of claims 1-15.