A method, device, system, electronic device and medium for forwarding messages

By establishing a TCP connection table and status information record table in the linux kernel, we can determine whether transparent proxy packets need to be bypass or forwarded, which solves the problem of business interruption after proxy crash, and achieves the continuity and efficiency of packet forwarding.

CN116170488BActive Publication Date: 2025-04-25BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211650929.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2025-04-25
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

After the transparent proxy program based on the linux kernel crashes, the newly entered transparent proxy connection cannot connect to the proxy address, resulting in business interruption.

Method used

By establishing a TCP connection table in the kernel, search for transparent proxy messages. If the current transparent proxy message does not exist in the connection table, based on the kernel socket search results, it is determined whether the current transparent proxy message needs to be bypass or forwarded to the kernel, so that the message will continue to forward after the proxy crashes.

Benefits of technology

It realizes that the agent continues to forward messages after the crash, prevents business interruption, reduces memory consumption, and improves the packet processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116170488B_ABST
    Figure CN116170488B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, system, electronic device and medium for message forwarding, the method comprising: searching a forwarding record corresponding to a message to be forwarded in a connection table, wherein the connection table is used to store the correspondence between the message to be forwarded and the forwarding record; confirming that the forwarding record does not exist, searching a second connection information corresponding to the message to be forwarded in a status information record table, wherein the status information record table is used to store the correspondence between the message to be forwarded and the second connection information; confirming that the second connection information does not exist, establishing a connection item for the message to be forwarded in the connection table; forwarding the message to be forwarded based on the connection item. Through some embodiments of the present application, messages can be forwarded continuously after the kernel agent crashes, thereby preventing service interruption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of network security, and specifically to a method, device, system, electronic device and medium for message forwarding. Background Art

[0002] In the related art, in a transparent proxy program based on the Linux kernel, when the proxy program crashes, before the process is restarted, the newly entered transparent proxy connection will not be able to connect to the proxied address, resulting in business interruption. The startup process of some proxy programs may take a long time, affecting business policy access during this period.

[0003] Therefore, how to ensure that services in network security devices are not interrupted becomes a problem that needs to be solved. Summary of the invention

[0004] Embodiments of the present application provide a method, device, system, electronic device and medium for forwarding messages. Through some embodiments of the present application, messages can be continued to be forwarded at least after the kernel agent program crashes, thereby preventing business interruption.

[0005] In a first aspect, the present application provides a method for message forwarding, which is applied to a network security device, and the method comprises: searching a forwarding record corresponding to a message to be forwarded in a connection table, wherein the connection table is used to store the correspondence between the message to be forwarded and the forwarding record; confirming that the forwarding record does not exist, searching a status information record table for second connection information corresponding to the message to be forwarded, wherein the status information record table is used to store the correspondence between the message to be forwarded and the second connection information; confirming that the second connection information does not exist, establishing a connection item for the message to be forwarded in the connection table; and forwarding the message to be forwarded based on the connection item.

[0006] Therefore, the embodiment of the present application searches the connection table and the status information record table for the message to be forwarded, and can determine whether the message to be forwarded needs to be bypassed or forwarded to the local kernel based on the connection table and the status information record table, so that the message can continue to be forwarded after the kernel's agent program crashes, thereby preventing business interruption.

[0007] In combination with the first aspect, in an implementation manner of the present application, before establishing a connection entry for the message to be forwarded in the connection table, the method further includes: confirming that the forwarding request of the message to be forwarded is a new connection request.

[0008] Therefore, the embodiment of the present application can ensure that the service of the new connection request is not interrupted after the kernel agent program crashes by confirming that the message to be forwarded is a new connection request.

[0009] In combination with the first aspect, in an implementation of the present application, before establishing a connection entry for the message to be forwarded in the connection table, the method further includes: confirming that the forwarding request of the message to be forwarded is not a new connection request, and discarding the message to be forwarded.

[0010] Therefore, the embodiment of the present application can reduce memory consumption by discarding messages that are not new connection requests, thereby speeding up message processing.

[0011] In combination with the first aspect, in an implementation manner of the present application, after confirming that the forwarding record does not exist, the method further includes: confirming that the message to be forwarded is a transparent proxy message.

[0012] Therefore, the embodiment of the present application can reduce the memory consumption of the network security device by confirming that the message to be forwarded is a transparent proxy message.

[0013] In combination with the first aspect, in one embodiment of the present application, after searching the status information record table for the second connection information corresponding to the message to be forwarded, the method also includes: confirming the existence of the second connection information, marking the message to be forwarded with an identifier, and obtaining the identified message to be forwarded; saving the identified message to be forwarded in the kernel of the network security device; searching for the policy routing of the message to be forwarded based on the identifier in the kernel; and forwarding the message to be forwarded based on the policy routing.

[0014] Therefore, the embodiment of the present application can find the corresponding policy routing in the kernel by marking the message to be forwarded, thereby improving the efficiency of message forwarding.

[0015] In combination with the first aspect, in an implementation manner of the present application, after establishing a connection entry for the message to be forwarded in the bypass connection table, the method further includes: recording a connection status of the message to be forwarded.

[0016] In a second aspect, the present application provides a device for forwarding a message, which is applied to a network security device, and the device includes: a first search module, configured to search for a forwarding record corresponding to a message to be forwarded in a bypass connection table, wherein the bypass connection table is used to store the correspondence between the message to be forwarded and the forwarding record; a second search module, configured to confirm that the forwarding record does not exist, and search for second connection information corresponding to the message to be forwarded in a status information record table, wherein the status information record table is used to store the correspondence between the message to be forwarded and the second connection information; a table entry establishment module, configured to confirm that the second connection information does not exist, and establish a connection entry for the message to be forwarded in the bypass connection table; a message forwarding module, configured to forward the message to be forwarded based on the connection entry.

[0017] In combination with the second aspect, in an implementation manner of the present application, the table entry establishment module is further configured to: confirm that the forwarding request of the message to be forwarded is a new connection request.

[0018] In combination with the second aspect, in an implementation manner of the present application, the table entry establishment module is further configured to: confirm that the forwarding request of the message to be forwarded is not a new connection request, and discard the message to be forwarded.

[0019] In combination with the second aspect, in an implementation manner of the present application, the second search module is further configured to: confirm that the message to be forwarded is a transparent proxy message.

[0020] In combination with the second aspect, in one embodiment of the present application, the second search module is also configured to: confirm the existence of the second connection information, mark the identifier for the message to be forwarded, and obtain the identified message to be forwarded; save the identified message to be forwarded in the kernel of the network security device; search for the policy routing of the message to be forwarded based on the identifier in the kernel; and forward the message to be forwarded based on the policy routing.

[0021] In combination with the second aspect, in an implementation manner of the present application, the message forwarding module is further configured to: record the connection status of the message to be forwarded.

[0022] In a third aspect, the present application provides a system for message forwarding, the system comprising: a client, configured to send a message to be forwarded; a network security device, configured to receive the message to be forwarded, and forward the message to be forwarded by executing the method described in any embodiment of the first aspect according to the message to be forwarded.

[0023] In a fourth aspect, the present application provides an electronic device comprising: a processor, a memory and a bus; the processor is connected to the memory via the bus, the memory stores a computer program, and when the computer program is executed by the processor, it can implement the method described in any embodiment of the first aspect.

[0024] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of a system composition for message forwarding shown in an embodiment of the present application;

[0026] Figure 2 One of the flow charts of a method for message forwarding shown in an embodiment of the present application;

[0027] Figure 3 The second flowchart of a method for forwarding a message shown in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of the composition of a message forwarding device shown in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of the composition of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0031] The embodiments of the present application can be applied to the scenario where the network security device forwards the message. In order to improve the problems in the background technology, in some embodiments of the present application, a TCP connection table is established in the kernel to search for the transparent proxy message passing through the network security device. If the current transparent proxy message does not exist in the TCP connection table, it is determined whether the current transparent proxy message needs to be bypassed or forwarded to the kernel based on the kernel socket search result.

[0032] The method steps in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0033] Figure 1 A structural diagram of a message transfer system in some embodiments of the present application is provided, and the system includes a client 110 and a network security device 120. Specifically, the client 110 sends a message to be forwarded to the network security device 120, and after receiving the message to be forwarded, the network security device 120 confirms that a forwarding record of the message to be forwarded in the connection table does not exist, and then searches for second connection information corresponding to the message to be forwarded in the state information record table, and then establishes a connection item for the message to be forwarded in the connection table if the second connection information does not exist, and finally forwards the message to be forwarded based on the connection item.

[0034] What is different from the embodiments of the present application is that in the related art, in a transparent proxy program based on the Linux kernel, after the proxy program crashes, before the process is restarted, the newly entered transparent proxy connection will not be able to connect to the proxied address, resulting in a business interruption. The startup process of some proxy programs may take a long time, which affects the policy access of the business during this period. In the present application, when the proxy process exits due to an abnormality, the kernel can send the current message to be forwarded to the transparent proxy address to request a bypass. After the proxy process is started, the newly entered message to be forwarded can continue to be forwarded and processed by the proxy process, and the bypassed transparent proxy connection can remain uninterrupted.

[0035] The following uses a network security device as an example to illustrate the message forwarding solution provided by some embodiments of the present application. It is understandable that the technical solution of the message forwarding method of the embodiment of the present application can be applied to any network security device, such as a firewall product.

[0036] At least for the sake of background technology, such as Figure 2 As shown, some embodiments of the present application provide a method for forwarding a message, the method comprising:

[0037] S210: Search the connection table for a forwarding record corresponding to the message to be forwarded.

[0038] It should be noted that the connection table is a bypass connection table, which is used to store the correspondence between the message to be forwarded and the bypass forwarding record. In other words, the bypass connection table stores the first connection information for forwarding the message by bypass, wherein the first connection information includes five-tuple information, such as source IP address, destination IP address, source port number, destination port number and protocol.

[0039] In one implementation of the present application, before S210, a netfilter module needs to be added to the kernel of the network security device, and the following functions are configured for the module:

[0040] First, for the kernel socket matching interface, the kernel can search for the corresponding sock structure through the structure of the message to be forwarded. Then, register the PRE_ROUTING hook function to obtain the message to be forwarded and serve as the entry for the transparent proxy bypass process. Next, perform connection management. Specifically, according to the five-tuple of the message to be forwarded (source IP, destination IP, source port, destination port and protocol family (IPV4 or IPV6)), the connection search is implemented, and the TCP state machine management is used to realize the recovery of timed-out connections under various states. Finally, policy management, specifically, allows users to configure the monitoring transparent proxy IP, port, protocol family and TCP connection timeout information, and provides a policy matching interface to allow the judgment of whether the message to be forwarded belongs to a certain transparent proxy policy.

[0041] To add policy routing to the network security device, take IPV4 as an example and execute the following command:

[0042] " / sbin / ip rule add fwmark 1lookup 100

[0043] / sbin / ip route add local 0.0.0.0 / 0dev lo table 100”

[0044] It can be understood that the policy routing includes the interface for forwarding messages, the destination device for forwarding, etc., which can be set according to actual conditions, and the embodiments of the present application are not limited to this.

[0045] After the configuration is completed, the transparent proxy policy address configuration is sent down to make the IP, port and protocol family of the kernel and the proxy process consistent, and start the transparent proxy process.

[0046] In one implementation of the present application, after the message to be forwarded is obtained, a forwarding record corresponding to the message to be forwarded is searched in the bypass connection table.

[0047] That is to say, if the forwarding record exists, it means that the message with the same five-tuple information as the current message to be forwarded has been forwarded through bypass. It is sufficient to directly track the connection status (i.e., record the connection status of the message to be forwarded) and forward the message to be forwarded through bypass.

[0048] S220, confirming that the forwarding record does not exist, searching the state information record table for second connection information corresponding to the message to be forwarded.

[0049] It should be noted that the state information record table is used to store the correspondence between the message to be forwarded and the second connection information. Specifically, the state information record table can be called the kernel inet_hashtable table (for example, the state information record table corresponding to ipv6 is inet6_hashtable), which is used to store the TCP connection sock established between the kernel and the outside and the TCP sock monitored by the kernel, and is used to store the connection status, monitoring status, timeout time, etc.

[0050] If the forwarding record does not exist, determine whether the message to be forwarded is a transparent proxy message. If the message to be forwarded is not a transparent proxy message, then directly end the process. If the message to be forwarded is a transparent proxy message, then search the state information record table for the second connection information corresponding to the message to be forwarded.

[0051] If the second connection information exists, first, mark the message to be forwarded with an identifier to obtain the identified message to be forwarded, then save the identified message to be forwarded in the kernel of the network security device, then search for the policy routing of the message to be forwarded based on the identifier in the kernel, and finally forward the message to be forwarded based on the policy routing.

[0052] Specifically, when the second connection information exists, the message to be forwarded is marked as 1, the message to be forwarded with the identification 1 is obtained, and the message is saved in the kernel. After that, the kernel pre-stores a policy route corresponding to the identification, and after the kernel obtains the message to be forwarded with the identification 1, the policy route corresponding to the identification 1 is searched, and finally, the current message to be forwarded is forwarded according to the policy route.

[0053] S230: Confirm that the second connection information does not exist, and establish a connection entry for the message to be forwarded in the connection table.

[0054] If the second connection information does not exist, it is determined whether the forwarding request of the message to be forwarded is a new connection request. If it is not a new connection request, the message to be forwarded is discarded. If it is a new connection request, a connection item is established for the message to be forwarded in the bypass connection table, and then the connection status of the message to be forwarded is recorded, and S240 is executed to forward the message to be forwarded based on the connection item.

[0055] As a specific embodiment of the present application, Figure 3 As shown, the message forwarding method provided in the present application includes: S301 uses a hook function to obtain a message to be forwarded, S302 whether it is a bypass connection, if so, execute S310 to track the connection status, if not, execute S303 whether it is a transparent proxy message, if not, execute S312 to end, if it is a transparent proxy message, execute S304 to find the transparent proxy sock, and then execute S305 whether the sock exists, if so, execute S306 to set the identifier, if not, execute S307 whether it is a new connection, if not a new connection, execute S308 to discard the message, if it is a new connection, execute S309 to create a bypass connection item, S310 to track the connection status and S311 to forward the message, and finally execute S312 to end.

[0056] Specifically, first, when the message to be forwarded passes through the network security device and enters the kernel for processing, it will pass through the kernel netfilter framework and then enter the PRE_ROUTING hook of the kproxy module. In this hook function, it first searches through the connection management interface to determine whether the message to be forwarded is a bypass transparent proxy connection. If so, it tracks the connection status and then forwards the message.

[0057] It is understandable that, since a kernel module is required in the implementation to complete the corresponding functions, the kernel module that implements the method of the present application is referred to as a kproxy module in the present application.

[0058] Secondly, when the message to be forwarded does not belong to the bypass connection, the kproxy module uses the policy matching interface to determine whether the message to be forwarded is a transparent proxy message. If it does not belong to a transparent proxy message, the processing of the message to be forwarded is ignored. For transparent proxy messages to be forwarded, the socket matching module is used to determine whether the kernel has an established sock connection or a monitored sock structure. If the kernel sock structure exists, the mark of the message to be forwarded is set to 1, and the message is routed to the local machine through the routing module.

[0059] Again, if the socket matching module searches the kernel, there is no sock structure in the kernel that is already connected or in the listening state. If the message to be forwarded is a TCP SYN handshake message, it means that the message to be forwarded is a new connection request. At this time, the proxy process exits abnormally and needs to bypass this connection. The kproxy module creates a connection tracking table entry for it, tracks the connection status, and forwards the message. If the message to be forwarded is not a TCP handshake message, the message is discarded.

[0060] Finally, when the proxy process is restarted and re-listens to the transparent proxy address, the message to be forwarded that enters the kernel, if it is a new request for synchronization sequence numbers (SYN), can be matched through the kernel socket and continue to forward the message to the local machine. As for the previously bypassed connection, the hook function first searches through the bypass connection table and directly forwards it to ensure that the connection is uninterrupted.

[0061] Therefore, the present application solves the problem that after a transparent proxy program implemented using the Linux kernel crashes, the newly entered transparent proxy connection cannot be processed until the process is restarted and restored, resulting in service interruption. The present application establishes a connection table in the kernel, tracks the connection of the bypassed transparent proxy traffic, and determines whether the proxy process is abnormal through sock search. When the proxy process exits abnormally and causes the kernel sock search to fail, the message to be forwarded is bypassed; after the proxy process is restarted, the newly entered request can continue to be forwarded and processed through the proxy process, and the previously bypassed transparent proxy connection can remain uninterrupted.

[0062] A specific embodiment of a message forwarding method is described above, and a message forwarding device will be described below.

[0063] like Figure 4 As shown, some embodiments of the present application provide a message forwarding device 400, which includes: a first search module 410, a second search module 420, a table entry establishment module 430 and a message forwarding module 440.

[0064] The first search module 410 is configured to search for a forwarding record corresponding to the message to be forwarded in a bypass connection table, wherein the bypass connection table is used to store the correspondence between the message to be forwarded and the forwarding record; the second search module 420 is configured to confirm that the forwarding record does not exist, and search for second connection information corresponding to the message to be forwarded in a status information record table, wherein the status information record table is used to store the correspondence between the message to be forwarded and the second connection information; the table entry establishment module 430 is configured to confirm that the second connection information does not exist, and establish a connection entry for the message to be forwarded in the bypass connection table; the message forwarding module 440 is configured to forward the message to be forwarded based on the connection entry.

[0065] In an implementation manner of the present application, the table entry establishing module 430 is further configured to: confirm that the forwarding request of the message to be forwarded is a new connection request.

[0066] In an implementation manner of the present application, the table entry establishing module 430 is further configured to: confirm that the forwarding request of the message to be forwarded is not a new connection request, and discard the message to be forwarded.

[0067] In an implementation manner of the present application, the second search module 420 is further configured to: confirm that the message to be forwarded is a transparent proxy message.

[0068] In one embodiment of the present application, the second search module 420 is further configured to: confirm the existence of the second connection information, mark the message to be forwarded with an identifier, and obtain the identified message to be forwarded; save the identified message to be forwarded in the kernel of the network security device; search for the policy route of the message to be forwarded based on the identifier in the kernel; and forward the message to be forwarded based on the policy route.

[0069] In an implementation manner of the present application, the message forwarding module 440 is further configured to: record the connection status of the message to be forwarded.

[0070] In the embodiments of the present application, Figure 4 The modules shown can achieve Figure 1 , Figure 2 and Figure 3 Each process in the method embodiment. Figure 4 The operations and / or functions of each module in Figure 1 , Figure 2 and Figure 3 For details, please refer to the description in the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.

[0071] like Figure 5 As shown, an embodiment of the present application provides an electronic device 500, including: a processor 510, a memory 520 and a bus 530, wherein the processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement a method as described in any one of the above embodiments. For details, please refer to the description in the above method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

[0072] Among them, the bus is used to realize the direct connection and communication of these components. Among them, the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0073] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in the above embodiment may be executed.

[0074] Understandably, Figure 5 The structure shown is for illustration only and may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown. Figure 5 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0075] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, any method described in any of the above-mentioned embodiments is implemented. For details, please refer to the description in the above-mentioned method embodiments. To avoid repetition, the detailed description is appropriately omitted here.

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

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

Claims

1. A method for forwarding a message, characterized in that: Applied to network security equipment, the method comprises: Searching for a forwarding record corresponding to the message to be forwarded in a bypass connection table, wherein the bypass connection table is used to store a corresponding relationship between the message to be forwarded and the forwarding record; Confirming that the forwarding record does not exist, searching for the second connection information corresponding to the message to be forwarded in the state information record table, wherein, if the forwarding record does not exist, determining whether the message to be forwarded is a transparent proxy message, and if the message to be forwarded is not a transparent proxy message, directly terminating the process; if the message to be forwarded is a transparent proxy message, searching for the second connection information corresponding to the message to be forwarded in the state information record table; If the second connection information does not exist, establishing a connection entry for the message to be forwarded in the bypass connection table; and forwarding the message to be forwarded based on the connection entry; or, If the second connection information exists, marking the message to be forwarded with an identifier, obtaining the message to be forwarded with the identifier; saving the message to be forwarded with the identifier in the kernel of the network security device; searching the policy routing of the message to be forwarded based on the identifier in the kernel; forwarding the message to be forwarded based on the policy routing; The state information record table is used to store the corresponding relationship between the message to be forwarded and the second connection information.

2. The method according to claim 1, characterized in that Before establishing a connection entry for the message to be forwarded in the bypass connection table, the method further includes: Confirm that the forwarding request of the message to be forwarded is a new connection request.

3. The method according to claim 1, characterized in that Before establishing a connection entry for the message to be forwarded in the bypass connection table, the method further includes: Confirm that the forwarding request of the message to be forwarded is not a new connection request, and discard the message to be forwarded.

4. The method according to claim 1, characterized in that: After confirming that the forwarding record does not exist, the method further includes: Confirm that the message to be forwarded is a transparent proxy message.

5. The method according to claim 1, characterized in that: After establishing a connection entry for the message to be forwarded in the bypass connection table, the method further includes: Record the connection status of the message to be forwarded.

6. A message forwarding system, characterized in that: The system comprises: The client is configured to send a message to be forwarded; A network security device is configured to receive the message to be forwarded, and execute the method according to any one of claims 1 to 5 to forward the message to be forwarded according to the message to be forwarded.

7. A message forwarding device, characterized in that: Applied to network security equipment, the device comprises: A first search module is configured to search a forwarding record corresponding to the message to be forwarded in a bypass connection table, wherein the bypass connection table is used to store a corresponding relationship between the message to be forwarded and the forwarding record; A second search module is configured to confirm that the forwarding record does not exist, and search for the second connection information corresponding to the message to be forwarded in the state information record table, wherein, if the forwarding record does not exist, it is determined whether the message to be forwarded is a transparent proxy message, and if the message to be forwarded is not a transparent proxy message, the process is directly terminated; if the message to be forwarded is a transparent proxy message, the second connection information corresponding to the message to be forwarded is searched in the state information record table; If the second connection information does not exist, establishing a connection entry for the message to be forwarded in the bypass connection table; forwarding the message to be forwarded based on the connection entry; or, If the second connection information exists, marking the message to be forwarded with an identifier, obtaining the message to be forwarded with the identifier; saving the message to be forwarded with the identifier in the kernel of the network security device; searching the policy routing of the message to be forwarded based on the identifier in the kernel; forwarding the message to be forwarded based on the policy routing; The state information record table is used to store the corresponding relationship between the message to be forwarded and the second connection information.

8. An electronic device, characterized in that: include: processor, memory, and bus; The processor is connected to the memory via the bus, the memory stores a computer program, and the computer program, when executed by the processor, can implement the method as claimed in any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, can implement the method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Systems and methods for multi-level quality of service classification in an intermediary device

    CN103354989A

  • Message forwarding method and device, computing equipment and storage medium

    CN111897681A