Message processing method, device, equipment, storage medium and computer program product

By mounting the gateway forwarding rule learning module to the IP layer and utilizing the Ethernet Bridge Netfilter framework, TCP/IP packet mirroring and filtering of gateway devices in bridged state are achieved, solving the problem that gateway devices cannot perform network service transmission quality monitoring in bridged state.

CN118802806BActive Publication Date: 2026-04-07CHINA MOBILE COMM LTD RES INST +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, gateway devices cannot process the TCP/IP layer information of data packets in bridged mode, which prevents the smart gateway forwarding rule learning module from configuring mirroring rules and filtering and mirroring IP data.

Method used

The gateway's forwarding rule learning module is mounted to the IP layer, and the mirroring rules are directly distributed to the forwarding rule learning module through the Ethernet Bridge Netfilter framework to achieve the mirroring of data link layer packets. The mirrored packets are then uploaded to the gateway's DPI application for analysis.

Benefits of technology

Without affecting the accelerated forwarding of normal business packets, TCP/IP packet filtering and mirroring at the data link layer of the bridged gateway device were implemented, solving the problem that the gateway device could not perform network service transmission quality monitoring in the bridged state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802806B_ABST
    Figure CN118802806B_ABST
Patent Text Reader

Abstract

This invention discloses a message processing method, apparatus, device, storage medium, and computer program product. The message processing method includes: mounting a forwarding rule learning module in a gateway to the IP layer, so that the forwarding rule learning module mirrors data link layer messages according to mirroring rules, and uploads the mirrored messages to the gateway DPI application. This invention can achieve filtering and mirroring of specific service TCP / IP messages at the data link layer of a gateway device in bridging mode without affecting the accelerated forwarding of normal service messages through message forwarding hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network technology, and in particular to a message processing method, apparatus, device, storage medium, and computer program product. Background Technology

[0002] Network service transmission quality assessment is typically based on filtering, mirroring, and analyzing TCP / IP layer packets. The intelligent gateway, through a Linux kernel forwarding rule learning module, configures forwarding and mirroring rules for the packet forwarding hardware. This allows for IP packet filtering as packets pass through the forwarding hardware, and then, via CPU mirroring, the packets are sent to the gateway application for processing and analysis. The prerequisite for this solution is that data packets must pass through the Linux kernel TCP / IP protocol stack before the forwarding rule learning module and packet forwarding hardware can parse IP layer data rules, thereby achieving the filtering and mirroring of user data.

[0003] However, in existing home broadband, enterprise, government, and private network applications, a large number of gateways act as bridging devices in the access network. Data packets in the gateway only operate at the data link layer, which means that under normal circumstances, the gateway's Linux kernel cannot process the TCP / IP layer information of the data packets. As a result, the intelligent gateway's forwarding rule learning module cannot configure mirroring rules for the packet forwarding hardware, and the packet forwarding hardware cannot filter and mirror the corresponding IP data. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a message processing method, apparatus, device, storage medium and computer program product that can filter and mirror specific business TCP / IP messages of gateway devices in bridging state at the data link layer without affecting the accelerated forwarding of normal business messages through message forwarding hardware.

[0005] To achieve the above objectives, embodiments of the present invention provide a message processing method, including:

[0006] The forwarding rule learning module in the gateway is mounted to the IP layer so that the forwarding rule learning module can mirror the packets of the data link layer according to the mirroring rules and upload the mirrored packets to the gateway DPI application.

[0007] As an improvement to the above scheme, the mirroring rules are sent from the gateway's message mirroring interface to the forwarding rule learning module, and a mirroring IP is configured for the forwarding rule learning module.

[0008] As an improvement to the above solution, after uploading the mirrored message to the gateway DPI application, the method further includes:

[0009] The message is returned to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control.

[0010] As an improvement to the above scheme, the step of returning the packet to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control includes:

[0011] The message is returned to the Bridge layer, where the forwarding rule learning module performs Layer 2 data forwarding rule learning.

[0012] The packet forwarding control module of the gateway configures forwarding rules for the packet forwarding hardware of the gateway, so that the packet forwarding hardware forwards packets that meet the hardware forwarding conditions.

[0013] As an improvement to the above solution, the method further includes:

[0014] The gateway's message mirroring module adds and sets flag bits for messages that need continuous mirroring.

[0015] As an improvement to the above solution, after the packet mirroring module of the gateway adds and sets the flag bit for packets that need to be continuously mirrored, the method further includes:

[0016] When the message returns to the Bridge layer, if the forwarding rule learning module finds that the message has the flag bit and it is set, then there is no need to learn the Layer 2 data forwarding rules for the message.

[0017] This invention also provides a message processing apparatus, comprising:

[0018] The configuration module is used to mount the forwarding rule learning module in the gateway to the IP layer, so that the forwarding rule learning module can mirror the packets of the data link layer according to the mirroring rules and upload the mirrored packets to the gateway DPI application.

[0019] This invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the message processing method described in any of the preceding claims.

[0020] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the message processing method described above.

[0021] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the message processing method described above.

[0022] Compared to existing technologies, the beneficial effects of the packet processing method, apparatus, device, storage medium, and computer program product provided by this invention are as follows: By mounting the forwarding rule learning module in the gateway to the IP layer, the forwarding rule learning module mirrors the packets at the data link layer according to mirroring rules and uploads the mirrored packets to the gateway DPI application. This invention can achieve filtering and mirroring of specific service TCP / IP packets at the data link layer of a gateway device in bridging mode without affecting the accelerated forwarding of normal service packets through packet forwarding hardware. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a preferred embodiment of a message processing method provided by the present invention;

[0024] Figure 2 This is a schematic diagram of the packet forwarding and mirroring process in the existing gateway system;

[0025] Figure 3 This is a schematic diagram of the data flow in the gateway bridging state of the existing gateway system;

[0026] Figure 4 This is a schematic diagram of the data flow in the gateway bridging state in a message processing method provided by the present invention;

[0027] Figure 5 This is a schematic diagram of the message forwarding and mirroring process in a message processing method provided by the present invention;

[0028] Figure 6 This is a schematic diagram of a preferred embodiment of a message processing device provided by the present invention;

[0029] Figure 7 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating a preferred embodiment of a message processing method provided by the present invention. The message processing method includes:

[0032] S1, mount the forwarding rule learning module in the gateway to the IP layer, so that the forwarding rule learning module can mirror the data link layer packets according to the mirroring rules and upload the mirrored packets to the gateway DPI application.

[0033] It should be noted that DPI (Deep Impact Testing) technology is a common method for evaluating network service transmission quality. The network service transmission quality indicators obtained by DPI technology mainly include TCP first and second handshake delays, TCP second and third handshake delays, retransmission rate, jitter, and other metrics. In home networks, many provinces use gateway software probes to measure TCP handshake delays to assess the quality of the home network and network transmission quality; practical use has proven that this data is highly accurate. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of the packet forwarding and mirroring process in an existing gateway system. In existing smart gateway systems, all packet forwarding first passes through the Linux kernel. The forwarding rule learning module in the kernel learns the packet forwarding information, and then the packet forwarding control module configures the forwarding rules and mirroring rules for the packet forwarding hardware. This allows the packet forwarding hardware to simultaneously copy packets that need to be mirrored to the gateway user DPI application via the packet mirroring module without affecting the forwarding of normal user service data, thus meeting the requirements for network service transmission quality assessment.

[0034] However, in existing home broadband, enterprise, government, and private network applications, many gateways act as bridging devices in the access network. Data packets in these gateways only operate at the data link layer, making it impossible for the gateway's Linux kernel to process TCP / IP layer information under normal circumstances. This results in the intelligent gateway's forwarding rule learning module being unable to configure mirroring rules for the packet forwarding hardware, and the packet forwarding hardware being unable to filter and mirror the corresponding IP data. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of the data flow in the bridged state of an existing gateway system. When the gateway is in bridged state, the data flow only passes through the Bridge layer (dashed line), and IP layer data cannot be processed or analyzed.

[0035] Therefore, this invention provides a packet processing method based on the Ethernet Bridge Netfilter framework, applied to a gateway system. The gateway system includes a forwarding rule learning module, a packet forwarding control module, a packet processing module, a packet mirroring interface, a packet mirroring module, and packet forwarding hardware. Please refer to... Figure 4 , Figure 4This is a schematic diagram of the data flow in a gateway bridging state during a message processing method provided by this invention. In existing gateway systems, data packets do not initially pass through the message forwarding hardware. Instead, a forwarding rule learning module first learns the forwarding rules for the service data, and then the message forwarding control module configures the forwarding rules for the message forwarding hardware to achieve hardware-accelerated forwarding of the data packets. Therefore, the message processing method provided in this embodiment of the invention no longer configures mirroring rules for the message forwarding hardware. Instead, it directly distributes the mirroring rules to the forwarding rule learning module and utilizes the bridge netfilter mechanism of the Ethernet Bridge Netfilter framework to mount the forwarding rule learning module to the IP layer (i.e., the network layer). This integrates the forwarding rule learning module at the IP layer, enabling intelligent routing decisions or learning of forwarding rules based on IP layer information during network packet forwarding. When a data packet passes through the mounting point of the forwarding rule learning module, it traverses upwards through the IP layer code. Based on the previously configured mirroring rules, the message mirroring module mirrors the specific data link layer packets and uploads them to the gateway DPI application for analysis.

[0036] This invention enables IP address-based filtering and mirroring of TCP / IP packets forwarded by a bridging gateway at the data link layer without affecting the hardware acceleration of normal packet forwarding.

[0037] In another preferred embodiment, the mirroring rules are sent from the gateway's packet mirroring interface to the forwarding rule learning module, and a mirroring IP is configured for the forwarding rule learning module.

[0038] Specifically, in this embodiment of the invention, the mirroring rules are no longer configured on the packet forwarding hardware. Instead, after receiving the mirroring task issued by the gateway DPI application, the packet mirroring interface of the gateway directly sends the mirroring rules to the forwarding rule learning module and configures the mirroring IP for the forwarding rule learning module.

[0039] In yet another preferred embodiment, after uploading the mirrored message to the gateway DPI application, the method further includes:

[0040] The message is returned to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control.

[0041] Specifically, in this embodiment of the invention, the forwarding rule learning module is mounted to the IP layer. When a data packet passes through the mounting point of the forwarding rule learning module, the IP layer code is traversed upwards. According to the previously configured mirroring rules, the packet mirroring module mirrors the specific packets of the data link layer and uploads them to the gateway DPI application for analysis. The packet is then returned to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control.

[0042] It should be noted that Layer 2 data forwarding, also known as Layer 2 forwarding, is a mechanism in computer networks that uses MAC addresses to forward data packets at the data link layer (i.e., Layer 2). Layer 2 forwarding refers to the process in a local area network (LAN) where network devices (such as switches) forward data frames from the source device to the destination device based on the MAC address information in the data packet.

[0043] In yet another preferred embodiment, returning the packet to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control includes:

[0044] The message is returned to the Bridge layer, where the forwarding rule learning module performs Layer 2 data forwarding rule learning.

[0045] The packet forwarding control module of the gateway configures forwarding rules for the packet forwarding hardware of the gateway, so that the packet forwarding hardware forwards packets that meet the hardware forwarding conditions.

[0046] For details, please refer to Figure 5 , Figure 5 This is a schematic diagram of the packet forwarding and mirroring process in a packet processing method provided by the present invention. In this embodiment, the forwarding rule learning module is mounted to the IP layer. When a data packet passes through the mounting point of the forwarding rule learning module, it traverses upwards through the IP layer code. Based on the previously configured mirroring rules, the packet mirroring module mirrors specific packets at the data link layer and uploads them to the gateway DPI application for analysis. The forwarding process then automatically returns to the forwarding rule learning module at the Bridge layer. The forwarding rule learning module performs Layer 2 data forwarding rule learning, and the gateway's packet forwarding control module configures forwarding rules for the gateway's packet forwarding hardware, enabling the packet forwarding hardware to accelerate the forwarding of packets that meet the hardware forwarding conditions.

[0047] In yet another preferred embodiment, the method further includes:

[0048] The gateway's message mirroring module adds and sets flag bits for messages that need continuous mirroring.

[0049] Specifically, because the forwarding rule learning module identifies Layer 2 data forwarding rules and configures the forwarding rules for the packet forwarding hardware through the packet forwarding control module, the subsequent data flow directly passes through the packet forwarding hardware for hardware acceleration, and cannot pass through the packet mirroring module of the gateway software system again, resulting in incomplete TCP / IP packet capture. Therefore, in order not to affect the gateway packet forwarding performance, and to ensure that normal business packets can be hardware accelerated through the forwarding rule learning module, while avoiding the problem of the packet mirroring module failing to work properly due to hardware acceleration, this embodiment of the invention adds and sets a flag bit for packets that need to be continuously mirrored through the gateway's packet mirroring module. This allows for different operation procedures for normal business packets and mirrored packets, thereby avoiding the problem of data flow directly passing through the packet forwarding hardware without being able to perform packet mirroring. This solves the problem in the prior art that it is impossible to monitor the network service transmission quality of bridging gateways.

[0050] For example, the skbuff structure data can store network packet data at each layer, as well as information for managing and controlling the reception or transmission of data, such as the link layer and network layer. Embodiments of the present invention can add flag bits to the skbuff structure data to achieve different operational procedures for normal service packets and mirrored packets.

[0051] In yet another preferred embodiment, after the packet mirroring module of the gateway adds and sets the flag bit for the packets that need to be continuously mirrored, the method further includes:

[0052] When the message returns to the Bridge layer, if the forwarding rule learning module finds that the message has the flag bit and it is set, then there is no need to learn the Layer 2 data forwarding rules for the message.

[0053] Specifically, when the packet mirroring module executes on TCP / IP packets that need to be mirrored, it adds a skip flag to the link layer header information of the skbuff data structure and sets it for the data streams that need continuous mirroring. According to the bridge netfilter mechanism, when the packet returns to the forwarding rule learning module at the Bridge layer, if the module finds the skip flag in the link layer header information and it is already set, it will no longer perform hardware-accelerated forwarding rule learning. By setting the flag, the packet forwarding hardware no longer performs hardware forwarding on specific data streams that need filtering, thus avoiding the problem of the mirrored stream prematurely entering hardware acceleration and becoming uncopyable. The packet mirroring process can be flexibly configured according to business needs.

[0054] This invention, based on Bridge Netfilter technology, effectively solves the problem that packet forwarding hardware cannot perform TCP / IP packet filtering and mirroring on data link layer data. By adding a flag, it prevents data streams from prematurely entering the hardware acceleration forwarding process caused by the Bridge Netfilter mechanism. Without affecting the gateway forwarding performance, it is not limited to TCP / IP packet capture and analysis only on routing gateway devices, thus satisfying the acquisition and analysis of network service indicator data in the gateway bridging state, and effectively improving the coverage of quality monitoring users.

[0055] Accordingly, the present invention also provides a message processing apparatus capable of implementing all the processes of the message processing method in the above embodiments.

[0056] Please see Figure 6 , Figure 6 This is a schematic diagram of a preferred embodiment of a message processing apparatus provided by the present invention. The message processing apparatus includes:

[0057] Configuration module 601 is used to mount the forwarding rule learning module in the gateway to the IP layer, so that the forwarding rule learning module can mirror the packets of the data link layer according to the mirroring rules and upload the mirrored packets to the gateway DPI application.

[0058] Preferably, the mirroring rules are sent from the gateway's message mirroring interface to the forwarding rule learning module, and a mirroring IP is configured for the forwarding rule learning module.

[0059] Preferably, after uploading the mirrored message to the gateway DPI application, the device is further configured to:

[0060] The message is returned to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control.

[0061] Preferably, returning the message to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control includes:

[0062] The message is returned to the Bridge layer, where the forwarding rule learning module performs Layer 2 data forwarding rule learning.

[0063] The packet forwarding control module of the gateway configures forwarding rules for the packet forwarding hardware of the gateway, so that the packet forwarding hardware forwards packets that meet the hardware forwarding conditions.

[0064] Preferably, the device is further used for:

[0065] The gateway's message mirroring module adds and sets flag bits for messages that need continuous mirroring.

[0066] Preferably, after the packet mirroring module through the gateway adds and sets a flag bit for packets that need to be continuously mirrored, the device is further configured to:

[0067] When the message returns to the Bridge layer, if the forwarding rule learning module finds that the message has the flag bit and it is set, then there is no need to learn the Layer 2 data forwarding rules for the message.

[0068] In specific implementation, the working principle, control process and technical effects of the message processing device provided in the embodiments of the present invention are the same as those of the message processing method in the above embodiments, and will not be repeated here.

[0069] Please see Figure 7 , Figure 7 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. The terminal device includes a processor 701, a memory 702, and a computer program stored in the memory 702 and configured to be executed by the processor 701. When the processor 701 executes the computer program, it implements the message processing method described in any of the above embodiments.

[0070] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 702 and executed by the processor 701 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0071] The processor 701 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 701 can be any conventional processor. The processor 701 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.

[0072] The memory 702 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., while the data storage area can store related data, etc. Furthermore, the memory 702 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital card (SD), and a flash card, or it can be other volatile solid-state storage devices.

[0073] It should be noted that the aforementioned terminal devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 7 The structural diagram is merely an example of the terminal device described above and does not constitute a limitation on the terminal device described above. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components.

[0074] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the message processing method described in any of the above embodiments.

[0075] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the message processing method described in any of the above embodiments.

[0076] This invention provides a packet processing method, apparatus, device, storage medium, and computer program product. By mounting a forwarding rule learning module in a gateway to the IP layer, the forwarding rule learning module mirrors data link layer packets according to mirroring rules and uploads the mirrored packets to the gateway DPI application. This invention enables the filtering and mirroring of specific service TCP / IP packets at the data link layer of a gateway device in bridging mode without affecting the accelerated forwarding of normal service packets through packet forwarding hardware.

[0077] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0078] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A message processing method, characterized in that, include: The forwarding rule learning module in the gateway is mounted to the IP layer, so that the forwarding rule learning module can mirror the packets of the data link layer according to the mirroring rules and upload the mirrored packets to the gateway DPI application; wherein the gateway is in a bridged state; The mirroring rules are sent from the gateway's message mirroring interface to the forwarding rule learning module, and a mirroring IP is configured for the forwarding rule learning module.

2. The message processing method as described in claim 1, characterized in that, After uploading the mirrored message to the gateway DPI application, the method further includes: The message is returned to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control.

3. The message processing method as described in claim 2, characterized in that, The step of returning the message to the Bridge layer for Layer 2 data forwarding rule learning and forwarding control includes: The message is returned to the Bridge layer, where the forwarding rule learning module performs Layer 2 data forwarding rule learning. The packet forwarding control module of the gateway configures forwarding rules for the packet forwarding hardware of the gateway, so that the packet forwarding hardware forwards packets that meet the hardware forwarding conditions.

4. The message processing method as described in claim 3, characterized in that, The method further includes: The gateway's message mirroring module adds and sets flag bits for messages that need continuous mirroring.

5. The message processing method as described in claim 4, characterized in that, After the packet mirroring module of the gateway adds and sets the flag bit for the packets that need to be continuously mirrored, the method further includes: When the message returns to the Bridge layer, if the forwarding rule learning module finds that the message has the flag bit and it is set, then there is no need to learn the Layer 2 data forwarding rules for the message.

6. A message processing apparatus, characterized in that, include: A configuration module is used to mount the forwarding rule learning module in the gateway to the IP layer, so that the forwarding rule learning module can mirror the packets of the data link layer according to the mirroring rules and upload the mirrored packets to the gateway DPI application; wherein the gateway is in a bridged state; The mirroring rules are sent from the gateway's message mirroring interface to the forwarding rule learning module, and a mirroring IP is configured for the forwarding rule learning module.

7. A terminal device, characterized in that, The device includes a processor and a memory, the memory storing a computer program configured to be executed by the processor, wherein the processor, when executing the computer program, implements the message processing method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the message processing method as described in any one of claims 1 to 5.

9. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the message processing method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • CIP asset detection method and device, computer equipment and readable storage medium

    CN112468364A

  • Service message processing method and device and storage medium

    CN114281608A

  • Method and device for accelerating message forwarding, electronic equipment and storage medium

    CN116800672A