Message processing method and device, electronic equipment and storage medium

Through offload processing and port conversion of traffic data, the problem of low packet processing efficiency between LAC and LNS is solved, and efficient data transmission and performance improvement are achieved.

CN118740925AActive Publication Date: 2024-10-01CHINA TELECOM CORP LTD

Patent Information

Application Number
CN202411000664.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-01
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively balance the data transmission packet processing flow between LAC and LNS, resulting in low packet processing efficiency. Especially when large-scale LAC access occurs, packet loss is severe and cannot meet high-performance requirements.

Method used

By obtaining the traffic data transmitted by the client, perform offload processing based on the identification data, determine the message type and perform port conversion, decapsulation and encapsulation processing, adapt the original message protocol type of the client and server, reduce CPU pressure and improve processing efficiency.

Benefits of technology

It achieves efficient packet processing, reduces packet loss rate, improves LNS performance, and adapts to the needs of large-scale LAC access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740925A_ABST
    Figure CN118740925A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining traffic data transmitted by a client; carrying out shunting processing on the traffic data based on the identification data carried by the traffic data; the message is divided into a to-be-unpacked message and a to-be- Determining the message type of the to-be-decapsulated message according to the flag bit of the to-be-decapsulated message; performing first port conversion processing on the to-be-decapsulated message of which the message type is the session data message, and converting a destination port of the to-be-decapsulated message into a target format from a source format; performing deblocking processing on the to-be-deblocked message in the target format to obtain a deblocked message; performing destination network address translation on the to-be-decapsulated message to obtain a preorder processing message; carrying out packaging processing on the preorder processing message to obtain a packaged message; and performing second port conversion processing on the packaged message, and converting the destination port of the packaged message from the target format to the source format. The message processing method can efficiently process the message and can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a message processing method, device, electronic equipment and storage medium. Background Art

[0002] L2TP tunnel technology is widely implemented and applied in Internet access. With the increase of the number of LAC (client) access terminals and the increase of traffic, the performance requirements on the LNS (server) side are getting higher and higher. In the current market, in order to save costs to a certain extent, various Internet companies usually use lower-cost servers, such as using general-purpose X86 servers to implement LNS. Although the relevant servers have strong flexibility and low cost, their poor performance has become a huge disadvantage that cannot be ignored, especially when dealing with large-scale LAC access, the packet loss is serious and it is completely incompetent. In this regard, the existing technology cannot balance the message processing flow of data transmission between LAC and LNS. In view of the usage characteristics of the server, the message processing efficiency is low. Summary of the invention

[0003] The present invention provides a message processing method, device, electronic device and storage medium, aiming to solve one of the technical problems in the related art at least to a certain extent.

[0004] On the one hand, an embodiment of the present invention provides a message processing method, including:

[0005] Obtaining traffic data transmitted by the client; the traffic data carries identification data;

[0006] Diverting the traffic data based on the identification data; the diverting result includes the message to be decapsulated and the message to be encapsulated;

[0007] Determine the message type of the message to be decapsulated according to the flag bit of the message to be decapsulated;

[0008] Performing a first port conversion process on a to-be-unsealed message whose message type is a session data message, converting a destination port of the to-be-unsealed message from a source format to a target format;

[0009] Decapsulating the to-be-decapsulated message in the target format to obtain the decapsulated message;

[0010] Perform destination network address translation on the unsealed message to obtain a pre-processed message;

[0011] Encapsulate the previously processed message to obtain an encapsulated message;

[0012] The encapsulated message is subjected to a second port conversion process to convert the destination port of the encapsulated message from a target format to a source format.

[0013] Optionally, the identification data includes a network layer identification and a transport layer identification; and performing flow diversion processing on the traffic data based on the identification data includes the following steps:

[0014] Determine the communication protocol used by the network layer and the destination IP of the network layer according to the network layer identifier;

[0015] Determine the transport protocol used by the transport layer and the destination port of the transport layer according to the transport layer identifier;

[0016] When the communication protocol, destination IP, transmission protocol and destination port meet the first preset requirement, the traffic data is determined to be a message to be unsealed;

[0017] When the communication protocol, destination IP, transmission protocol and destination port meet the second preset requirement, the flow data is determined to be a message to be encapsulated.

[0018] Optionally, the message type includes a control message, a session data message, and a non-session data message; and determining the message type of the message to be unsealed according to a flag bit of the message to be unsealed comprises the following steps:

[0019] When the first byte of the message to be decapsulated is set with a control flag bit, it is determined that the message to be decapsulated is a control message;

[0020] When the message to be decapsulated is not a control message, the protocol field of the message to be decapsulated is matched with the target field;

[0021] When the protocol field matches the target field successfully, it is determined that the message to be decapsulated is a session data message; otherwise, it is determined that the message to be decapsulated is a non-session data message.

[0022] Optionally, the method further comprises the following steps:

[0023] Send the unsealed message whose message type is not a session data message to the CPU for preset processing;

[0024] Among them, the CPU represents the server to which the client is connected.

[0025] Optionally, the method further comprises the following steps:

[0026] Perform source network address translation on the deblocked message;

[0027] Transmit the result of source network address translation to the server.

[0028] Optionally, encapsulating the pre-processed message to obtain an encapsulated message includes the following steps:

[0029] Match the IP data of the preceding processed message according to the destination IP of the preceding processed message, and encapsulate the corresponding tunnel header based on the IP data to obtain an encapsulated message;

[0030] The destination IP is determined based on the network layer identifier in the identification data.

[0031] Optionally, the method further comprises the following steps:

[0032] Send the encapsulated message in the source format back to the client.

[0033] On the other hand, an embodiment of the present invention provides a message processing device, including:

[0034] The first module is used to obtain the traffic data transmitted by the client; the traffic data carries identification data;

[0035] The second module is used to perform diversion processing on the traffic data based on the identification data; the result of the diversion processing includes the message to be decapsulated and the message to be encapsulated;

[0036] The third module is used to determine the message type of the message to be unsealed according to the flag bit of the message to be unsealed;

[0037] The fourth module is used to perform a first port conversion process on the to-be-unsealed message whose message type is a session data message, and convert the destination port of the to-be-unsealed message from a source format to a target format;

[0038] The fifth module is used to perform unsealing processing on the to-be-unsealed message of the target format to obtain an unsealed message;

[0039] The sixth module is used to convert the destination network address of the message to be unsealed to obtain a pre-processed message;

[0040] The seventh module is used to encapsulate the pre-processed message to obtain an encapsulated message;

[0041] The eighth module is used to perform a second port conversion process on the encapsulated message, and convert the destination port of the encapsulated message from a target format to a source format.

[0042] Optionally, the identification data includes a network layer identification and a transport layer identification; and the second module is specifically used for:

[0043] Determine the communication protocol used by the network layer and the destination IP of the network layer according to the network layer identifier;

[0044] Determine the transport protocol used by the transport layer and the destination port of the transport layer according to the transport layer identifier;

[0045] When the communication protocol, destination IP, transmission protocol and destination port meet the first preset requirement, the traffic data is determined to be a message to be unsealed;

[0046] When the communication protocol, destination IP, transmission protocol and destination port meet the second preset requirement, the flow data is determined to be a message to be encapsulated.

[0047] Optionally, the message type includes a control message, a session data message, and a non-session data message; and the third module is specifically used for:

[0048] When the first byte of the message to be decapsulated is set with a control flag bit, it is determined that the message to be decapsulated is a control message;

[0049] When the message to be decapsulated is not a control message, the protocol field of the message to be decapsulated is matched with the target field;

[0050] When the protocol field matches the target field successfully, it is determined that the message to be decapsulated is a session data message; otherwise, it is determined that the message to be decapsulated is a non-session data message.

[0051] Optionally, the device further comprises:

[0052] A ninth module, configured to send the to-be-decapsulated message whose message type is not a session data message to the CPU for preset processing;

[0053] Among them, the CPU represents the server to which the client is connected.

[0054] Optionally, the device further comprises:

[0055] The tenth module is used to perform source network address translation on the deblocked message;

[0056] The eleventh module is used to transmit the result of source network address translation to the server.

[0057] Optionally, the seventh module is specifically used for:

[0058] Match the IP data of the preceding processed message according to the destination IP of the preceding processed message, and encapsulate the corresponding tunnel header based on the IP data to obtain an encapsulated message;

[0059] The destination IP is determined based on the network layer identifier in the identification data.

[0060] Optionally, the device further comprises:

[0061] The eleventh module is used to send the encapsulated message in the source format back to the client.

[0062] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned message processing method.

[0063] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. The program executable by the processor is used to implement the above-mentioned message processing method when executed by the processor.

[0064] The embodiment of the present invention obtains flow data transmitted by a client; the flow data carries identification data; the flow data is diverted based on the identification data; the result of the diversion processing includes a message to be unsealed and a message to be encapsulated; the message type of the message to be unsealed is determined according to the flag bit of the message to be unsealed; the message to be unsealed is subjected to a first port conversion processing, which is a message type of a session data message, and the destination port of the message to be unsealed is converted from a source format to a target format; the message to be unsealed in the target format is unsealed to obtain an unsealed message; the message to be unsealed is subjected to a destination network address conversion to obtain a pre-order processed message; the pre-order processed message is encapsulated to obtain an encapsulated message; the encapsulated message is subjected to a second port conversion processing to convert the destination port of the encapsulated message from the target format to the source format. The method of the present invention can be applied to a data processing computing unit independent of a CPU, and can reduce the pressure on the CPU by transferring the message processing process, specifically by shunting the acquired process data, and then adaptively decapsulating and encapsulating, and by format conversion for port conversion, so that the decapsulation result and the encapsulation result are adapted to the original message protocol type of the client and the server. The embodiment of the present invention can efficiently process messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0066] Figure 1 A schematic diagram of an implementation environment for message processing provided by an embodiment of the present invention;

[0067] Figure 2 A schematic diagram of a flow chart of a message processing method provided by an embodiment of the present invention;

[0068] Figure 3 A schematic diagram of the expansion process of the diversion process provided by an embodiment of the present invention;

[0069] Figure 4 A schematic diagram of an expanded process of determining a message type provided in an embodiment of the present invention;

[0070] Figure 5 A schematic diagram of an example of the L2TP-PPP-IPV4 message format provided in an embodiment of the present invention;

[0071] Figure 6 A schematic diagram of an example of a 2-layer MPLS label OVER UDP message format provided in an embodiment of the present invention;

[0072] Figure 7 A schematic diagram of an extended flow chart of the message processing method provided in an embodiment of the present invention;

[0073] Figure 8 A schematic diagram of a process principle of a specific application of message processing provided by an embodiment of the present invention;

[0074] Fig. 9 A schematic diagram of the structure of a message processing device provided by an embodiment of the present invention;

[0075] Fig.10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0077] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0078] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0079] It is understandable that the message processing method provided in the embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.

[0080] To facilitate the understanding of the technical solution of the present invention, the technical feature terms that may appear in the embodiments of the present invention are first explained:

[0081] L2TP: Layer 2 Tunneling Protocol.

[0082] LNS: L2TP network server, that is, the server.

[0083] LAC: L2TP access concentrator, that is, L2TP access client.

[0084] SNAT: Source Network Address Translation.

[0085] DNAT: Destination Network Address Translation.

[0086] DPU: Data processing unit, a hardware device that specializes in processing data packets.

[0087] SW: Software layer, refers to general-purpose CPU processors, usually ARM or X86, etc.

[0088] HW: Hardware layer, refers to the dedicated processor, compared with SW.

[0089] MAF: Match, modify, and forward, an abbreviation for the three major processes of message processing.

[0090] PIPE: Hardware acceleration pipeline, a pipeline on the DPU specifically used to accelerate MAF of messages, with high system performance.

[0091] DPDK: Data Plane Development Kit, a development framework for processing data packets using general-purpose CPUs.

[0092] FLOW: Flow refers to the reciprocal messages of the five-tuple, which is the connection in the transport layer.

[0093] Uplink: port refers to the actual physical optical port on the BLUEFILED DPU.

[0094] SF: Auxiliary port, a virtual network port used in the BLUEFILED DPU system-on-chip.

[0095] VF: Virtual port, a virtual network port used in the Host system, mainly used for virtualization.

[0096] PF: physical port, the physical port of the BLUEFILED DPU seen in the host system.

[0097] OFFLOAD: Offloading, that is, transferring the traffic processing calculation to the DPU.

[0098] NAT: Network Address Translation.

[0099] NAPT: Network Address Port Translation.

[0100] CGN: Carrier-level NAT, with the characteristics of large scale and high stability.

[0101] BlueField-2 DPU: A commercial DPU produced by NVIDIA.

[0102] IPv4: Internet Protocol version 4, also known as the fourth version of the Internet Protocol, is the fourth revision in the development of the Internet Protocol and the first widely deployed version of the protocol. IPv4 is the core of the Internet and the most widely used version of the Internet Protocol.

[0103] UDP: User Datagram Protocol.

[0104] The OSI seven-layer model Q is a framework for understanding and describing computer network communications. It breaks down network communications into seven different layers, including L1 (physical layer), L2 (data link layer), L3 (network layer), L4 (transport layer), L5 (session layer), L6 (presentation layer) and L7 (application layer).

[0105] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.

[0106] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0107] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0108] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present invention.

[0109] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a message processing method, which is described below using the message processing method applied in the terminal 102 as an example. It can be understood that the message processing method can also be applied in the server 101.

[0110] Reference Figure 2 , Figure 2 A flowchart of a message processing method applied to a terminal (for example, the terminal may be a DPU) provided in an embodiment of the present invention. The execution subject of the message processing method may be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method comprises the following steps:

[0111] S100, obtaining traffic data transmitted by the client;

[0112] The traffic data carries identification data; specifically, multiple PIPEs can be created on the DPU to implement subsequent process steps.

[0113] For example, in some specific implementations, obtaining the traffic data transmitted by the client can be implemented as follows: the LAC can use the L2TP tunnel to send the session upstream traffic to the DPU; similarly, the DPU can also use the L2TP tunnel to send the session downstream traffic to the LAC. Due to the introduction of the L2TP tunnel, the fixed processing method of L2TP tunnel encapsulation and decapsulation OFFLOAD to the DPU has much better performance than executing on the CPU.

[0114] S200, performing flow diversion processing on the flow data based on the identification data;

[0115] The result of the traffic diversion process includes messages to be decapsulated and messages to be encapsulated;

[0116] It should be noted that the identification data includes a network layer identification and a transport layer identification; in some embodiments, such as Figure 3 As shown, step S200 may include the following steps: S201, determining the communication protocol adopted by the network layer and the destination IP of the network layer according to the network layer identifier; S202, determining the transmission protocol adopted by the transport layer and the destination port of the transport layer according to the transport layer identifier; S203, when the communication protocol, destination IP, transmission protocol and destination port meet the first preset requirement, determining that the flow data is a message to be unpacked; S204, when the communication protocol, destination IP, transmission protocol and destination port meet the second preset requirement, determining that the flow data is a message to be encapsulated.

[0117] Exemplarily, in some specific implementations, step S200 can be implemented through the first acceleration pipeline. Specifically, an upper UP_DN_DIST_PIPE (downlink traffic diversion PIPE, i.e., the first acceleration pipeline) is created on the DPU, and all traffic entering the DPU first enters the UP_DN_DIST_PIPE for traffic diversion, and the diversion is achieved by adding a MAF rule in the PIPE; the specific upstream traffic matching rule is: L3 is IPv4, and the destination IP of L3 is the LNS IP, and L4 is UDP, and the destination port of L4 is 1701 (the fixed port used by the L2TP protocol); the traffic that meets this rule is sent to L2TP_CONTRL_FILTERPIPE (L2TP control message diversion PIPE, also known as the second acceleration pipeline) for L2TP control / data message diversion; the specific downstream traffic matching rule is: L3 is IPv4, and the destination IP of L3 belongs to the public network IP set configured by the LNS; the traffic that meets this rule is sent to the downstream traffic DNAT_PIPE (third acceleration pipeline) for DNAT processing.

[0118] S300, determining the message type of the message to be unsealed according to the flag bit of the message to be unsealed;

[0119] It should be noted that the message types include control messages, session data messages and non-session data messages; in some embodiments, such as Figure 4 As shown, step S300 may include the following steps: S301, when the first byte of the message to be unsealed is set with a control flag bit, determining that the message to be unsealed is a control message; S302, when the message to be unsealed is not a control message, matching the protocol field of the message to be unsealed with the target field; S303, when the protocol field matches the target field successfully, determining that the message to be unsealed is a session data message, otherwise, determining that the message to be unsealed is a non-session data message.

[0120] In some embodiments, the method may further include the following steps: sending the to-be-decapsulated message whose message type is not a session data message to a CPU for preset processing; wherein the CPU represents the server end to which the client is connected.

[0121] For example, in some specific implementations, a rule needs to be set in L2TP_CONTRL_FILTER PIPE (the second acceleration pipeline) to divert session data packets and control packets. The differentiation rule is whether the control flag bit is set in the first byte of the L2TP packet; if yes, it is sent to the CPU for L2TP control packet processing; otherwise, it is sent to PPP_IPV4_FILTER_PIPE (PPP IPV4 load diversion PIPE, also known as the fourth acceleration pipeline) for diversion;

[0122] The rule of PPP_IPV4_FILTER_PIPE is to match whether the protocol field of the ppp message is 0x0021, that is, whether the PPP carries an IPV4 message; if so, it indicates that this is a session data message and is sent to L2TP_TO_MPLSOUDP_PIPE (the fifth acceleration pipeline, L2TP converted to MPLS OVER UDP) for conversion processing; otherwise, it is sent to the CPU for PPP non-session data processing.

[0123] S400, performing a first port conversion process on a to-be-unsealed message whose message type is a session data message, converting the destination port of the to-be-unsealed message from a source format to a target format;

[0124] For example, in some specific implementations, since BlueField DPU currently does not support the decapsulation and encapsulation of L2TP tunnels, but supports the decapsulation and encapsulation of MPLS OVER UDP tunnels, the message structure of the L2TP tunnel encapsulating PPP+IPV4 data message is exactly the same as the message structure of the 2-layer MPLS label OVER UDP (the two message formats are as follows: Figure 5 and Figure 6 ); so you only need to change the L2TP destination port from 1701 (source format) to 6635 (target format) to convert it to MPLSOVER UDP tunnel message.

[0125] S500, performing unsealing processing on the to-be-unsealed message in the target format to obtain an unsealed message;

[0126] For example, in some specific implementations, the message is converted into an MPLS OVER UDP tunnel message and then sent to L2TP_DECAP_PIPE (the sixth acceleration pipeline) for L2TP decapsulation. The decapsulated message is a common IPV4 message, that is, an actual session uplink message.

[0127] Among them, in some embodiments, such as Figure 7 As shown, the method may further include the following steps: T100, performing source network address translation on the deblocked message; T200, transmitting the result of the source network address translation to the server.

[0128] Exemplarily, in some specific implementations, after unsealing, the data is sent to SNAT_PIPE (the seventh acceleration pipeline) for subsequent processing (eg, source network address translation).

[0129] S600, performing destination network address translation on the message to be unsealed to obtain a pre-processed message;

[0130] Exemplarily, in some specific implementations, DNAT processing is performed on the downstream traffic DNAT_PIPE (third acceleration pipe).

[0131] S700, encapsulate the previously processed message to obtain an encapsulated message;

[0132] It should be noted that, in some embodiments, step S700 may include the following steps: matching the IP data of the preceding processed message according to the destination IP of the preceding processed message, encapsulating the corresponding tunnel header based on the IP data, and obtaining an encapsulated message; wherein the destination IP is determined based on the network layer identifier in the identification data.

[0133] For example, in some specific implementations, the message after the preamble is completed needs to be encapsulated by L2TP. Since BlueField DPU does not support L2TP encapsulation, it can only be encapsulated according to the MPLS OVER UDP format first, so the message after the preamble processing enters MPLS_ENCAP_PIPE (the eighth acceleration pipeline); at the same time, MPLS_ENCAP_PIPE needs to set rules, because different sessions have different L2TP tunnel encapsulations, and each session has its own LAC IP (that is, the source IP when LAC and DPU establish L2TP), its own L2TP tunnel ID, and PPP session ID;

[0134] Specifically, the matching field is the destination IP of L3, that is, the session IP. The downlink message of each session will match its own IP (that is, IP data) in MPLS_ENCAP_PIPE and encapsulate the corresponding MPLS OVER UDP tunnel header (actually encapsulated according to the fields of the L2TP tunnel).

[0135] S800: Perform a second port conversion process on the encapsulated message to convert the destination port of the encapsulated message from a target format to a source format.

[0136] In some embodiments, the method may further include the following steps: sending the encapsulated message in the source format back to the client.

[0137] For example, in some specific implementations, since the encapsulated UDP port is 6635 (target format), it needs to be changed to 1701 (source format), so the message is sent to MPLSOUDP_TO_L2TP_PIPE to modify the port, and then sent to LAC after completion.

[0138] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0139] First of all, it should be noted that in view of the problems existing in the prior art, the embodiment of the present invention adopts a new data processing mode, that is, introducing DPU to accelerate the data plane, release the CPU computing power, and transfer the L2TP encapsulation and decapsulation processing of the message to the DPU. Compared with the general CPU, its processing performance is much higher. However, the BlueField-2 DPU chip does not support the L2TP protocol. In order to support the offloading of L2TP services to the BlueField-2 DPU, the present invention adopts a special method to implement the BlueField-2 DPU encapsulation and decapsulation of the L2TP message header.

[0140] For example, Figure 8 As shown, the technical solution of the present invention can be implemented through the following process:

[0141] The LAC uses the L2TP tunnel to send the session upstream traffic to the DPU, and the DPU also uses the L2TP tunnel to send the session downstream traffic to the LAC.

[0142] Due to the introduction of L2TP tunnels, the fixed processing method of L2TP tunnel encapsulation and decapsulation OFFLOADed to the DPU has much better performance than executing on the CPU.

[0143] Create an upstream UP_DN_DIST_PIPE (downstream traffic diversion PIPE) on the DPU. All traffic entering the DPU first enters the UP_DN_DIST_PIPE for traffic diversion. Diversion is achieved by adding MAF rules in the PIPE. The specific upstream traffic matching rule is: L3 is IPv4, and the destination IP of L3 is the LNS IP, and L4 is UDP, and the destination port of L4 is 1701 (the fixed port used by the L2TP protocol). Traffic that meets this rule is sent to the L2TP_CONTRL_FILTER PIPE (L2TP control message diversion PIPE) for L2TP control / data message diversion. The specific downstream traffic matching rule is: L3 is IPv4, and the destination IP of L3 belongs to the public network IP set configured by the LNS. Traffic that meets this rule is sent to the downstream traffic DNAT_PIPE for DNAT processing. DNAT_PIPE contains a large number of DNAT rules. These rules are generated by the CPU together with the SNAT rules and loaded onto the DPU when a user generates a new flow. After the rules are loaded, the subsequent packets of the flow will hit these SNAT / DNAT rules. The processing of all subsequent packets of the flow is completed on the DPU, and the missed packets (i.e., MISSFLOW TO CPU) are uploaded to the CPU. The missed packets are the first few packets of each new flow.

[0144] The traffic diversion judgment condition of DNAT_PIPE / SNAT_PIPE is the SNAT / DNAT rule.

[0145] Composition of SNAT / DNAT rules: The modification items of SNAT rules are L3 src ip and L4 src port, and the modification items of DNAT rules are L3 dst ip and L4 dst port; the matching items are different in different NAT modes.

[0146] In full cone NAT mode, the matching items of DNAT rules include L3 dst ip and L4 dst port; the matching items of SNAT rules include L3 src ip and L4 src port;

[0147] In symmetric NAT mode, the matching items of SNAT and DNAT rules are the same, including L3 src ip, dst_ip, L4 src port, dst port, but the source and destination of SNAT rules and DNAT rules are opposite;

[0148] Rules need to be set in L2TP_CONTRL_FILTER PIPE to divert session data packets and control packets. The differentiation rule is whether the control flag bit is set in the first byte of the L2TP packet. If yes, it is sent to the CPU for L2TP control packet processing; otherwise, it is sent to PPP_IPV4_FILTER_PIPE (PPP IPV4 load diversion PIPE) for diversion.

[0149] The rule of PPP_IPV4_FILTER_PIPE is to match whether the protocol field of the ppp message is 0x0021, that is, whether the PPP message is an IPV4 message; if it is, it indicates that this is a session data message, which is sent to L2TP_TO_MPLSOUDP_PIPE (L2TP converted to MPLS OVER UDP) for conversion processing; otherwise, it is sent to the CPU for PPP non-session data processing;

[0150] Since BlueField DPU currently does not support the decapsulation and encapsulation of L2TP tunnels, it supports the decapsulation and encapsulation of MPLS OVERUDP tunnels. It happens that the message structure of the L2TP tunnel encapsulating PPP+IPV4 data message is the same as the message structure of the 2-layer MPLS label OVER UDP (the two message formats are as follows Figure 5 and Figure 6); therefore, you only need to change the L2TP destination port to 6635 to convert it into an MPLS OVER UDP tunnel message, and then send it to L2TP_DECAP_PIPE for L2TP decapsulation. The decapsulated message is an ordinary IPV4 message, that is, the actual session uplink message; after decapsulation, it is sent to SNAT_PIPE for subsequent processing. Specifically, the user uplink message after SNAT_PIPE has been completely processed and exposed, and is sent to the Internet direction (IPV4 TO INTERNET TX, that is, the data flow sent to the server).

[0151] Similarly, the message after the pre-processing is completed needs to be encapsulated by L2TP. Since BlueField DPU does not support L2TP encapsulation, it can only be encapsulated according to the MPLS OVER UDP format. Therefore, the message after the pre-processing enters MPLS_ENCAP_PIPE; At the same time, MPLS_ENCAP_PIPE needs to set rules, because different sessions have different L2TP tunnel encapsulations. Each session has its own LAC IP (that is, the source IP when LAC and DPU establish L2TP), its own L2TP tunnel ID, and PPP session ID.

[0152] The matching field is the destination IP of L3, which is the session IP. The downstream message of each session will match its own IP in MPLS_ENCAP_PIPE and encapsulate the corresponding MPLS OVER UDP tunnel header (actually encapsulated according to the field of L2TP tunnel). Since the encapsulated UDP port is 6635, it needs to be changed to 1701, so the message is sent to MPLSOUDP_TO_L2TP_PIPE to modify the port, and then sent to LAC.

[0153] Specifically, the present invention implements the processing of L2TP data messages by BlueField-2 DPU. By taking advantage of the fact that the length of the L2TP message header and the MPLS OVER UDP frame structure are the same, the received L2TP data message port is changed to the MPLS data message port, and the decapsulation of the message is realized by utilizing the function of BlueField-2 DPU to process MPLS OVER UDP messages. Similarly, the function of BlueField-2 DPU to encapsulate MPLS OVER UDP is utilized to encapsulate the L2TP message header into the MPLS OVERUDP message, and then the final encapsulation into the L2TP message header is realized by modifying the port.

[0154] The invention is based on NVIDIA's BlueField-2 DPU. In the invention, we mainly use BlueField-2 DPU to implement the function of LNS, supporting the encapsulation and decapsulation of L2TP protocol data message headers:

[0155] L2TP message encapsulation:

[0156] Encapsulate the corresponding MPLS OVER UDP tunnel header (actually encapsulated according to the fields of the L2TP tunnel); since the encapsulated UDP port is 6635, it also needs to be changed to 1701, so the message is sent to MPLSOUDP_TO_L2TP_PIPE to modify the port, and then sent to LAC after completion.

[0157] Decapsulation of L2TP packets:

[0158] Changing the L2TP destination port 1701 to 6635 can convert it into an MPLS OVER UDP tunnel message, which is then sent to L2TP_DECAP_PIPE for L2TP decapsulation.

[0159] The detailed implementation scheme of L2TP data packet header encapsulation is as follows:

[0160] After the pre-processing is completed, the message needs to be encapsulated by L2TP. Since BlueField DPU does not support L2TP encapsulation, it can only be encapsulated according to the MPLS OVER UDP format. Therefore, the message after the pre-processing enters MPLS_ENCAP_PIPE; At the same time, MPLS_ENCAP_PIPE needs to set rules, because different sessions have different L2TP tunnel encapsulations. Each session has its own LAC IP (that is, the source IP when LAC and DPU establish L2TP), its own L2TP tunnel ID, and PPP session ID.

[0161] The matching field is the destination IP of L3, which is the session IP. The downstream message of each session will match its own IP in MPLS_ENCAP_PIPE and encapsulate the corresponding MPLS OVER UDP tunnel header (actually encapsulated according to the field of L2TP tunnel). Since the encapsulated UDP port is 6635, it needs to be changed to 1701, so the message is sent to MPLSOUDP_TO_L2TP_PIPE to modify the port, and then sent to LAC.

[0162] The detailed solution for L2TP data packet header decapsulation is as follows:

[0163] Since BlueField DPU currently does not support the decapsulation and encapsulation of L2TP tunnels, it supports the decapsulation and encapsulation of MPLS OVERUDP tunnels. It happens that the message structure when the L2TP tunnel encapsulates PPP+IPV4 data messages is the same as the message structure of the 2-layer MPLS label OVER UDP; so you only need to change the L2TP destination port to 6635 to convert it into an MPLSOVER UDP tunnel message, and then send it to L2TP_DECAP_PIPE for L2TP decapsulation. The decapsulated message is an ordinary IPV4 message, that is, the actual session uplink message; after decapsulation, it is sent to SNAT_PIPE for subsequent processing.

[0164] In summary, the technical solution of the present invention adopts a creative method to solve the problem that BlueField DPU does not support L2TP data packets, expands the scope of use of BlueField DPU, and also meets the requirements of offloading services to DPU for execution, thereby greatly improving service forwarding performance, robustness and security. Compared with the prior art, the present invention has at least the following beneficial effects:

[0165] 1. Creativity: The solution of the present invention enables BlueField DPU to support the processing of L2TP data messages, which has a high degree of creativity.

[0166] 2. Regarding the forwarding performance advantage: Compared with the cloud platform CPU-based message data processing solution, the present invention has a greater performance advantage by processing network messages (including deblocking and encapsulating L2TP tunnel messages, etc.) through hardware, as well as lower latency, less CPU occupancy, and less energy consumption.

[0167] 3. Regarding stability: Compared with pure software solutions based on cloud platforms, the DPU smart network card hardware processing of network messages is not affected by abnormal message packets, and there is no possibility of program hanging and downtime, which has great robustness and security.

[0168] Specifically, the present invention can be widely used in VPDN networking scenarios, helping customers to build an enterprise-level private network isolated from the Internet at a relatively low cost, which can not only solve the weakness of the high cost of traditional fiber-optic VPN networking, but also solve the defects of general network performance degradation and insufficient stability. The networking technology based on the present invention can provide private network services, Internet access services, cloud services, etc. required by enterprises or individuals, and can provide customized value-added services such as application identification and network optimization. It has the characteristics of efficient, flexible, and visualized networking, high-speed, stable, and low-cost connections, and helps enterprises upgrade their network to the cloud.

[0169] On the other hand, Fig. 9 As shown, an embodiment of the present invention provides a message processing device 900, including:

[0170] The first module 910 is used to obtain traffic data transmitted by the client; the traffic data carries identification data;

[0171] The second module 920 is used to perform diversion processing on the traffic data based on the identification data; the diversion processing result includes the message to be decapsulated and the message to be encapsulated;

[0172] The third module 930 is used to determine the message type of the message to be unsealed according to the flag bit of the message to be unsealed;

[0173] The fourth module 940 is used to perform a first port conversion process on the to-be-unsealed message whose message type is a session data message, and convert the destination port of the to-be-unsealed message from a source format to a target format;

[0174] The fifth module 950 is used to perform decapsulation processing on the to-be-decapsulated message in the target format to obtain a decapsulated message;

[0175] The sixth module 960 is used to perform destination network address translation on the message to be deblocked to obtain a pre-processed message;

[0176] The seventh module 970 is used to encapsulate the pre-processed message to obtain an encapsulated message;

[0177] The eighth module 980 is used to perform a second port conversion process on the encapsulated message, and convert the destination port of the encapsulated message from a target format to a source format.

[0178] In some embodiments, the identification data includes a network layer identification and a transport layer identification; and the second module is specifically used for:

[0179] Determine the communication protocol used by the network layer and the destination IP of the network layer according to the network layer identifier;

[0180] Determine the transport protocol used by the transport layer and the destination port of the transport layer according to the transport layer identifier;

[0181] When the communication protocol, destination IP, transmission protocol and destination port meet the first preset requirement, the traffic data is determined to be a message to be unsealed;

[0182] When the communication protocol, destination IP, transmission protocol and destination port meet the second preset requirement, the flow data is determined to be a message to be encapsulated.

[0183] In some embodiments, the message types include control messages, session data messages, and non-session data messages; the third module may be specifically used for:

[0184] When the first byte of the message to be decapsulated is set with a control flag bit, it is determined that the message to be decapsulated is a control message;

[0185] When the message to be decapsulated is not a control message, the protocol field of the message to be decapsulated is matched with the target field;

[0186] When the protocol field matches the target field successfully, it is determined that the message to be decapsulated is a session data message; otherwise, it is determined that the message to be decapsulated is a non-session data message.

[0187] In some embodiments, the apparatus may further include:

[0188] A ninth module, configured to send the to-be-decapsulated message whose message type is not a session data message to the CPU for preset processing;

[0189] Among them, the CPU represents the server to which the client is connected.

[0190] In some embodiments, the apparatus may further include:

[0191] The tenth module is used to perform source network address translation on the deblocked message;

[0192] The eleventh module is used to transmit the result of source network address translation to the server.

[0193] In some embodiments, the seventh module may be specifically used for:

[0194] Match the IP data of the preceding processed message according to the destination IP of the preceding processed message, and encapsulate the corresponding tunnel header based on the IP data to obtain an encapsulated message;

[0195] The destination IP is determined based on the network layer identifier in the identification data.

[0196] In some embodiments, the apparatus may further include:

[0197] The eleventh module is used to send the encapsulated message in the source format back to the client.

[0198] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0199] On the other hand, an embodiment of the present invention further provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above sensitive information method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0200] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0201] like Fig.10 As shown, Fig.10 A specific example of the hardware structure of an electronic device according to an embodiment is shown, and the electronic device includes:

[0202] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0203] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the network node population optimization method of the embodiment of the present invention;

[0204] Input / output interface 1003, used to implement information input and output;

[0205] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0206] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0207] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0208] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0209] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0210] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.

[0211] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read to Only Memory, CD to ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0212] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0213] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0214] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0215] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0216] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.

[0217] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0218] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0219] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0220] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.

[0221] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0222] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0223] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0224] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0225] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A message processing method, characterized in that: The following steps are involved: Acquire traffic data transmitted by the client; the traffic data carries identification data; Performing a diversion process on the traffic data based on the identification data; the result of the diversion process includes a message to be decapsulated and a message to be encapsulated; Determining the message type of the message to be unsealed according to the flag bit of the message to be unsealed; Performing a first port conversion process on the to-be-unsealed message whose message type is a session data message, converting the destination port of the to-be-unsealed message from a source format to a target format; Performing unsealing processing on the to-be-unsealed message in the target format to obtain an unsealed message; Performing destination network address translation on the message to be unsealed to obtain a pre-processed message; Encapsulating the pre-processed message to obtain an encapsulated message; A second port conversion process is performed on the encapsulated message to convert the destination port of the encapsulated message from the target format to the source format.

2. The message processing method according to claim 1, characterized in that: The identification data includes a network layer identification and a transport layer identification; the flow data is diverted based on the identification data, including the following steps: Determine the communication protocol used by the network layer and the destination IP of the network layer according to the network layer identifier; Determine the transport protocol used by the transport layer and the destination port of the transport layer according to the transport layer identifier; When the communication protocol, the destination IP, the transmission protocol and the destination port meet the first preset requirement, determining that the traffic data is the message to be unsealed; When the communication protocol, the destination IP, the transmission protocol and the destination port meet the second preset requirement, it is determined that the traffic data is the message to be encapsulated.

3. The message processing method according to claim 1, characterized in that: The message types include control messages, session data messages and non-session data messages; and determining the message type of the message to be unsealed according to the flag bit of the message to be unsealed includes the following steps: When the first byte of the message to be unsealed is set with a control flag bit, determining that the message to be unsealed is the control message; When the message to be unsealed is not the control message, matching the protocol field of the message to be unsealed with the target field; When the protocol field matches the target field successfully, it is determined that the message to be unsealed is the session data message; otherwise, it is determined that the message to be unsealed is the non-session data message.

4. The message processing method according to claim 1 or 3, characterized in that: The method further comprises the following steps: Sending the to-be-unsealed message whose message type is not the session data message to the CPU for preset processing; The CPU represents the server to which the client is connected.

5. The message processing method according to claim 1, characterized in that: The method further comprises the following steps: Performing source network address translation on the deblocked message; The result of the source network address translation is transmitted to the server.

6. The message processing method according to claim 1, characterized in that: The encapsulating the pre-processed message to obtain an encapsulated message comprises the following steps: Matching the IP data of the preceding processed message according to the destination IP of the preceding processed message, and encapsulating the corresponding tunnel header based on the IP data to obtain the encapsulated message; The destination IP is determined based on the network layer identifier in the identification data.

7. The message processing method according to claim 1, characterized in that: The method further comprises the following steps: The encapsulated message in the source format is sent back to the client.

8. A message processing device, characterized in that: include: The first module is used to obtain traffic data transmitted by the client; The flow data carries identification data; The second module is used to perform a diversion process on the traffic data based on the identification data; the result of the diversion process includes a message to be decapsulated and a message to be encapsulated; The third module is used to determine the message type of the message to be unsealed according to the flag bit of the message to be unsealed; A fourth module is used to perform a first port conversion process on the to-be-unsealed message whose message type is a session data message, and convert the destination port of the to-be-unsealed message from a source format to a target format; A fifth module is used to perform unsealing processing on the to-be-unsealed message in the target format to obtain an unsealed message; The sixth module is used to perform destination network address translation on the message to be unsealed to obtain a pre-processed message; The seventh module is used to encapsulate the pre-processed message to obtain an encapsulated message; The eighth module is used to perform a second port conversion process on the encapsulated message, converting the destination port of the encapsulated message from the target format to the source format.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • Data transmission method, apparatus and system

    CN104982062A

  • A national cryptographic algorithm acceleration processing system based on an FPGA

    CN109902043A

  • Data transmission method, apparatus and system

    US20160192266A1

Cited By

  • Evaluation method and device of processing unit on DPU, equipment and medium

    CN120295877A