Network performance testing methods, packet interception methods, equipment and media
By deploying interception devices in the network transmission link to intercept test packets with the TCP flag containing PSH and forward packets without PSH, the problem of insufficient server processing capacity is solved, and low-cost, high-accuracy network performance testing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2026-04-03
AI Technical Summary
In network performance testing, the server, as the receiver of TCP traffic, has its processing capacity as a bottleneck, which limits the amount of test traffic and increases costs by upgrading server hardware configuration.
Deploy an interception device in the network transmission link between the client and the server, configure the first forwarding rule to intercept test packets with the TCP flag containing PSH, and the second forwarding rule to forward test packets without PSH, and construct test packets using raw sockets for transmission.
This avoids excessive reliance on server hardware resources, reduces testing costs, improves the accuracy of network performance testing, and ensures that test traffic is not limited by the server's network card performance.
Smart Images

Figure CN120567726B_ABST
Abstract
Description
Technical Field
[0001] This manual relates to the field of computer network technology, and in particular to network performance testing methods, packet interception methods, devices, and media. Background Technology
[0002] An Internet Data Center (IDC) primarily consists of master and slave devices. Master devices mainly include communication equipment such as switches, routers, and firewalls, as well as computing power equipment such as servers. Slave devices include power supply and distribution systems and cooling systems. When testing network performance of forwarding devices such as switches and routers, or network bandwidth, on the network transmission link between the client and server, the server, as the receiver of TCP traffic, typically needs to construct massive amounts of TCP traffic on the client side and send it to the server in the Internet Data Center to test the network performance of the network transmission link between the client and server.
[0003] As the traffic receiver, the server's ability to process TCP traffic becomes a bottleneck in testing. For example, when the server's network card has insufficient processing power, it causes the client to limit its sending speed, and the amount of traffic sent cannot reach the expected bandwidth. Upgrading the server's hardware configuration (such as a high-bandwidth network card) will increase the testing cost. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this manual provides network performance testing methods, packet interception methods, equipment, and media.
[0005] According to a first aspect of the embodiments of this specification, a method for testing network performance is provided, the method being applied to a client, comprising:
[0006] Construct a test message based on the TCP protocol using raw sockets;
[0007] The test message is sent to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH, and the second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server.
[0008] According to a second aspect of the embodiments of this specification, a method for intercepting packets is provided, the method being applied to an interception device located at any position in a network transmission link between a client and a server, comprising:
[0009] Receive a test message based on the TCP protocol sent by the client; wherein the test message is used to test the network performance of the network transmission link between the client and the interception device, and the test message is constructed based on a raw socket;
[0010] Intercept test packets whose TCP flags contain PSH sent by the client based on the first forwarding rule;
[0011] Based on the second forwarding rule, the test message sent by the client whose TCP flag does not contain PSH is forwarded to the server.
[0012] According to a third aspect of the embodiments of this specification, a network performance testing apparatus is provided, the apparatus being applied to a client, comprising:
[0013] The test message construction module is used to construct test messages based on the TCP protocol using raw sockets;
[0014] The test message sending module is used to send the test message to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH, and the second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server.
[0015] According to a fourth aspect of the embodiments of this specification, a message interception apparatus is provided, the apparatus being applied to an interception device located at any position in a network transmission link between a client and a server, comprising:
[0016] The message receiving module is used to receive test messages based on the TCP protocol sent by the client; wherein the test messages are used to test the network performance of the network transmission link between the client and the interception device, and the test messages are constructed based on raw sockets;
[0017] The message interception module is used to intercept test messages sent by the client whose TCP flag contains PSH, based on the first forwarding rule;
[0018] The message forwarding module is used to forward test messages sent by the client whose TCP flags do not contain PSH to the server based on the second forwarding rule.
[0019] According to a fifth aspect of the embodiments of this specification, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in the first or second aspect.
[0020] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method as described in the first or second aspect.
[0021] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:
[0022] In this embodiment, the solution deploys an interception device at any point in the network transmission link between the client and the server. This interception device is configured with a first forwarding rule to intercept test packets with the TCP flag containing PSH, ensuring that such test packets do not reach the server's protocol stack. This avoids network card congestion on the server, conserves server bandwidth resources, and ultimately achieves the goal of testing the network performance of the data transmission link without excessive reliance on the server's hardware resources. Furthermore, to ensure that test packets establishing a communication connection between the client and the server can be transmitted normally to the server, the interception device is configured with a second forwarding rule to forward test packets without the TCP flag containing PSH to the server. Additionally, to ensure that the client can continuously send test packets even without a server response, the test packets sent to the server are constructed using raw sockets. By combining the interception device and raw sockets, the goal of testing the network performance of the network transmission link between the client and the interception device can be achieved without sending test packets to the server. As can be seen, for network performance testing scenarios involving the network transmission link between the client and the server, this solution can avoid the impact of server hardware resources on the network performance testing of the network transmission link, thereby improving the accuracy of the network performance testing of the network transmission link.
[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0025] Figure 1 This is a schematic diagram illustrating a network performance test scenario according to an exemplary embodiment of this specification.
[0026] Figure 2 This is a flowchart illustrating a network performance testing method according to an exemplary embodiment of this specification.
[0027] Figure 3 This is a flowchart illustrating a message interception method according to an exemplary embodiment of this specification.
[0028] Figure 4 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this specification.
[0029] Figure 5 This is a block diagram illustrating a network performance testing apparatus according to an exemplary embodiment of this specification.
[0030] Figure 6 This is a block diagram illustrating a message interception device according to an exemplary embodiment of this specification. Detailed Implementation
[0031] An Internet Data Center (IDC) mainly consists of master and slave equipment. Master equipment primarily includes communication devices such as switches, routers, and firewalls, as well as computing power equipment such as servers. Slave equipment includes power supply and distribution systems and cooling systems. Figure 1 As shown, several routers 121, switches 122, and servers 123 are deployed in the Internet data center 12. Of course, other equipment such as firewalls, power supply and distribution systems, and cooling systems (not shown in the figure) may also be present in the Internet data center 12. It should be noted that the Internet data center 12 is merely an exemplary application scenario illustrated to help those skilled in the art understand the implementation of this solution; this solution does not impose any special limitations on the Internet data center 12.
[0032] In a network performance testing scenario targeting the network transmission link between client 10 and server 123, the network transmission link could be a network connecting network 11, router 121, and switch 122. The test could focus on the network bandwidth of this transmission link or the forwarding performance of router 121 and switch 122 on that link. Typically, a large amount of TCP traffic needs to be generated on the client and sent to the server. This traffic must travel through the network transmission link between the client and server to reach the server, thus enabling network performance testing of the network transmission link between them. The server, as the receiver of the TCP traffic, has its TCP traffic processing capacity as a bottleneck in the test. For example, if the server's network card processing capacity is insufficient, it can cause the client to limit its sending speed, preventing the sent traffic from reaching the expected bandwidth. Upgrading the server's hardware configuration (such as high-bandwidth network cards) increases the testing cost. For instance, assuming 1TB of TCP traffic is generated on the client, at least 10 100G network cards are needed. Assuming a server can accommodate 4 network cards, at least 3 physical servers are required to meet the requirements for processing this test traffic.
[0033] To address the aforementioned technical issues, this specification provides a network performance testing method that reduces excessive reliance on server hardware resources when testing the network performance of the network transmission link between the client and the server, thereby reducing testing costs while improving testing accuracy.
[0034] The embodiments described in this specification will now be described in detail.
[0035] Figure 2 This is a flowchart illustrating a network performance testing method according to an exemplary embodiment of this specification. Figure 2 As shown, this method can be applied to client 10, including steps 201-202:
[0036] Step 201: Construct a test message based on the TCP protocol using raw sockets.
[0037] Step 202: Send the test message to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH, and the second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server.
[0038] This solution tests the network transmission link between the client and the server, excluding the server itself. Since the server's network performance isn't tested, the test packets sent by the client can perform network performance testing on the transmission link without reaching the server. Therefore, this solution deploys an interception device at any location on the network transmission link. This interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule intercepts test packets with the TCP flag containing PSH, and the second forwarding rule forwards test packets without the TCP flag containing PSH.
[0039] PSH is a flag in TCP packets, short for Push. When the TCP flag contains PSH (i.e., the client sets PSH=1), the server's TCP stack immediately submits the data in the current receive buffer to the upper-layer application. To reduce the overhead of the server processing packets with the PSH flag, these packets are intercepted, preventing them from reaching the server's network interface card (NIC). Simultaneously, to meet the needs of certain types of clients that require establishing normal communication connections with the server—for example, private clients needing to establish a network connection between private and public networks—packets without the PSH flag are forwarded to the server.
[0040] The interception device can be a standalone unit specifically designed to intercept test packets containing the PSH flag in the TCP header and to forward test packets without the PSH flag. For example, an interception device can be specifically configured on the network transmission link between the client and server. Alternatively, any forwarding device in the internet data center capable of intercepting TCP traffic can implement both interception and forwarding functions. For instance, this device could be a switch, with a first forwarding rule and a second forwarding rule configured on it. This way, interception and forwarding functions can be achieved without changing the equipment layout of the internet data center or adding new equipment.
[0041] This solution does not impose any restrictions on the location of the intercepting device within the network transmission link. Typically, the test object is the entire network transmission link, i.e., the complete network transmission link between the client and the server. In this case, the first and second forwarding rules can be configured on the access switch directly connected to the server to test the network performance of the entire network transmission link. Of course, if the intercepting device is located elsewhere, the network performance of the portion of the network transmission link between the client and the intercepting device can be specifically tested, without testing the network performance of the network transmission link between the intercepting device and the server.
[0042] It should be noted that the above solution can be applied to both private network clients and public network clients. In an exemplary network performance testing scenario, multiple clients can send test packets to the same or different servers in an internet data center. Any client can be either a private network client or a public network client. It is understood that this solution does not depend on the client's network environment; both public and private network clients can implement this solution, making it suitable for network performance testing in complex network environments (i.e., network performance testing scenarios where both public and private network clients exist simultaneously).
[0043] Next, we will introduce the two types of clients separately:
[0044] If all clients are public network clients, meaning each client uses a public IP address for external communication, then the first forwarding rule configured on the intercepting device can block test packets with the TCP flag containing PSH, as well as test packets without the TCP flag containing PSH. This means all test packets are blocked, ensuring that none of the test packets sent by public network clients reach the server. Even without a real server, the purpose of testing the network transmission link between the client and the intercepting device can be achieved. In this network performance testing scenario, it does not rely on server hardware resources at all; the client can construct an unlimited number of test packets for testing the network transmission link's performance.
[0045] In related technologies, raw sockets are generally used in network security to customize message content to simulate specific network environments (such as retransmission and congestion control). This solution constructs test messages based on the TCP protocol using raw sockets, enabling continuous sending of test messages to the server even without a response. This ensures a continuous flow of test traffic for network performance testing even if interception devices block the test messages.
[0046] In one embodiment, the server's network interface card (NIC) may be configured with a public IP address, and a listening port may be set on that public IP address for access by clients during network performance testing. This solution does not impose any restrictions on the number of public IP addresses or listening ports.
[0047] The first forwarding rule configured on the intercepting device can be to intercept packets whose destination IP address is the server's IP address, whose destination port is the server's listening port, and whose TCP flag contains PSH.
[0048] The client can construct a test message based on the TCP protocol using a raw socket. For example, an IP header is constructed, with the destination address of the IP header being the server's IP address; a TCP header is constructed, with the destination port of the TCP header being the server's listening port; payload data is constructed; and the IP header, TCP header, and payload data are encapsulated into a test message using a raw socket.
[0049] For example, suppose the server is configured with IP addresses 1.1.1.1 and 1.1.1.2, and listens on TCP port 2000 on both IP addresses 1.1.1.1 and 1.1.1.2 respectively.
[0050] The first forwarding rule configured on the intercepting device is: intercept packets with a destination IP of 1.1.1.1 or 1.1.1.2, a TCP destination port of 2000, and a TCP flag containing PSH.
[0051] If the client is a public network client, assuming the source IP address configured on the client is 2.2.2.2, the IP header can be constructed with the following parameters:
[0052]
[0053] Construct the TCP header using the following parameters:
[0054]
[0055] Randomly construct load data.
[0056] By encapsulating the IP header, TCP header, and payload data into a test packet using a raw socket, a test packet is constructed that is sent from a random port with a source IP address of 2.2.2.2 to a port 20000 with a destination IP address of 1.1.1.1.
[0057] The constructed test packet is sent to the server via a raw socket. The test packet is continuously forwarded by nodes along the network transmission link until it reaches the intercepting device. If the test packet does not conform to the first forwarding rule, it is intercepted and will not reach the server. Therefore, the size of the test traffic is not limited by the server's network card performance bottleneck.
[0058] Unlike public network clients that can directly access servers, private network clients only have private network addresses. They need to use a translation gateway to translate their private network addresses into public network addresses before they can continue communicating with the server. For example, this translation gateway can be a Network Address Port Translation (NAPT) device.
[0059] When sending a test message to the server, the private network client sends the test message to the conversion gateway, so that the conversion gateway forwards the test message to the server according to the network conversion relationship between the private network and the public network of the private network client.
[0060] To establish this network translation relationship in the translation gateway, the private network client and the server need to first establish a communication connection. For example, the private network client constructs a connection request using a regular socket to establish a communication connection with the server and sends the connection request to the server, allowing the translation gateway to determine the network translation relationship between the private network client's private network and the public network. The second forwarding rule of the intercepting device is used to forward the connection request sent by the private network client to the server. For example, since the TCP flags in the connection request's TCP packet do not contain PSH, the second forwarding rule can specifically be used to forward packets whose TCP flags do not contain PSH to the server.
[0061] Since the second forwarding rule does not intercept connection requests to establish a communication connection with the server (specifically, it can be a packet without PSH in the TCP flag), while the first forwarding rule intercepts packets with PSH in the TCP flag, the interception device will not affect the communication connection between the private network client and the server based on ordinary sockets used to configure the network conversion relationship at the conversion gateway. After the network conversion relationship between the private network client's private network and the public network is established in the conversion gateway, the first forwarding rule of the interception device can intercept the data transmission packets (i.e., test packets with PSH in the TCP flag) sent by the private network client to the server. Therefore, by setting the first and second forwarding rules, the interception device in this scheme can both ensure that the conversion gateway establishes the network conversion relationship between the private network client's private network and the public network, and also ensure the interception of test packets with PSH in the TCP flag sent by either the private network client or the public network client.
[0062] For example, assume the private network client's source IP address is 192.168.0.1, source port is 20000, and the server's IP address is 1.1.1.1, listening port is 20000. A connection request to establish a communication connection with the server is constructed using a regular socket and sent to the server. The conversion gateway replaces the private network client's source IP address with a public IP address (e.g., 3.3.3.3) and the source port with a local random port (e.g., 30000). The conversion gateway then sends the connection request to the interception device. Since the second forwarding rule of the interception device will not block this connection request, a communication connection can be established between the private network client and the server, allowing the conversion gateway to determine the network conversion relationship between the private network client's private network and public network. For example, the conversion relationship between 192.168.0.1:20000 and 3.3.3.3:30000.
[0063] After the conversion gateway establishes the network conversion relationship, the private network client can send test packets based on the TCP protocol constructed using raw sockets to the server through the conversion gateway.
[0064] For example, an IP header can be constructed with the following parameters:
[0065]
[0066] The TCP header can be constructed using the following parameters:
[0067]
[0068] Construct load data.
[0069] The IP header, TCP header, and payload data are encapsulated into a test packet using a raw socket. This constructs a test packet sent from port 20000 at source IP address 2192.168.0.1 to port 20000 at destination IP address 1.1.1.1.
[0070] Figure 3 This is a flowchart illustrating a message interception method according to an exemplary embodiment of this specification. Figure 3 As shown, this method can be applied to an interception device located at any point in the network transmission link between the client and the server, including steps 301-303:
[0071] Step 301: Receive a test message based on the TCP protocol sent by the client; wherein the test message is used to test the network performance of the network transmission link between the client and the interception device, and the test message is constructed based on a raw socket.
[0072] Step 302: Based on the first forwarding rule, intercept the test packet sent by the client whose TCP flag contains PSH.
[0073] Step 303: Based on the second forwarding rule, forward the test message sent by the client whose TCP flag does not contain PSH to the server.
[0074] In this embodiment, an interception device is installed at any point in the network transmission link between the client and the server. This interception device is configured with a first forwarding rule to intercept test packets with the TCP flag containing PSH, thereby ensuring that such test packets do not reach the server's protocol stack, thus avoiding server network card congestion, saving server bandwidth resources, and ultimately achieving the goal of testing the network performance of the data transmission link without overly relying on the server's hardware resources. Furthermore, to ensure that packets establishing a communication connection between the client and the server can be transmitted normally to the server, the interception device is configured with a second forwarding rule to forward test packets without the TCP flag containing PSH to the server. Additionally, to ensure that the client can continue to send test packets normally even without a server response, the test packets sent to the server are constructed using raw sockets. By combining the interception device and raw sockets, the network performance of the network transmission link between the client and the interception device can be tested without sending test packets to the server. As can be seen, for network performance testing scenarios involving the network transmission link between the client and the server, this solution can avoid the impact of server hardware resources on the network performance testing of the network transmission link, thereby improving the accuracy of the network performance testing of the network transmission link.
[0075] Corresponding to the embodiments of the foregoing methods, this specification also provides embodiments of the apparatus and the terminal to which it is applied.
[0076] Figure 4 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. Figure 4 As shown, at the hardware level, the electronic device 400 includes a processor 402, an internal bus 404, a network interface 406, memory 408, and non-volatile memory 410, and may also include other hardware required for business operations. One or more embodiments of this specification can be implemented in software, for example, the processor 402 reads the corresponding computer program from the non-volatile memory 410 into memory 408 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.
[0077] Figure 5 This is a block diagram illustrating a network performance testing apparatus according to an exemplary embodiment of this specification. Figure 5 As shown, this device can be applied to, for example Figure 4 The electronic device 400 shown implements the technical solution of this specification. The device includes:
[0078] Test message construction module 502 is used to construct test messages based on the TCP protocol using raw sockets.
[0079] The test message sending module 504 is used to send the test message to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH, and the second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server.
[0080] Optionally, the test message construction module 502 is specifically used to construct an IP header, the destination address of which is the IP address of the server; construct a TCP header, the destination port of which is the listening port of the server; construct payload data; and encapsulate the IP header, the TCP header, and the payload data into a test message using a raw socket.
[0081] Optionally, the client is a private network client deployed on a private network, and the test message sending module 504 is specifically used to send the test message to the conversion gateway, so that the conversion gateway forwards the test message to the server according to the network conversion relationship between the private network and the public network of the private network client.
[0082] Optionally, the device further includes a communication connection establishment module for establishing a communication connection between the private network client and the server, so that the conversion gateway can determine the network conversion relationship between the private network client's private network and public network.
[0083] Optionally, the communication connection establishment module is specifically used to construct a connection request for establishing a communication connection with the server through a normal socket, and send the connection request to the server, so that the conversion gateway determines the network conversion relationship between the private network and the public network of the private network client; the interception device is also configured with a second forwarding rule for forwarding the connection request sent by the private network client to the server.
[0084] Figure 6This is a block diagram illustrating a message interception device according to an exemplary embodiment of this specification. Figure 6 As shown, this device can be applied to, for example Figure 4 The electronic device 400 shown implements the technical solution of this specification. The device includes:
[0085] The message receiving module 602 is used to receive test messages based on the TCP protocol sent by the client; wherein the test messages are used to test the network performance of the network transmission link between the client and the interception device, and the test messages are constructed based on raw sockets.
[0086] The message interception module 604 is used to intercept test messages sent by the client whose TCP flags contain PSH, based on the first forwarding rule.
[0087] The message forwarding module 606 is used to forward test messages sent by the client whose TCP flags do not contain PSH to the server based on the second forwarding rule.
[0088] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0089] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0090] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned network performance testing methods or packet interception methods provided in this application.
[0091] Specifically, computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks.
[0092] This specification also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of any of the aforementioned network performance testing methods or packet interception methods.
Claims
1. A method for testing network performance, characterized in that, The method is applied to the client and includes: Construct a test message based on the TCP protocol using raw sockets; The test message is sent to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH so that the test messages containing PSH will not reach the server's protocol stack. The second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server so that the test message for establishing a communication connection between the client and the server is transmitted to the server.
2. The method according to claim 1, characterized in that, The construction of a test message based on the TCP protocol using a raw socket includes: Construct an IP packet header, wherein the destination address of the IP packet header is the IP address of the server; Construct a TCP header, wherein the destination port of the TCP header is the listening port of the server; Construct load data; The IP header, TCP header, and payload data are encapsulated into a test packet using a raw socket.
3. The method according to claim 1, characterized in that, The client is a private network client deployed on a private network. Sending the test message to the server includes: The test message is sent to the conversion gateway, so that the conversion gateway forwards the test message to the server according to the network conversion relationship between the private network and the public network of the private network client.
4. The method according to claim 3, characterized in that, The method further includes: A communication connection is established between the private network client and the server, so that the conversion gateway can determine the network conversion relationship between the private network and the public network of the private network client.
5. The method according to claim 4, characterized in that, Establishing a communication connection between the private network client and the server, so that the conversion gateway can determine the network conversion relationship between the private network client's private network and public network, includes: A connection request for establishing a communication connection with the server is constructed using a normal socket, and the connection request is sent to the server so that the conversion gateway can determine the network conversion relationship between the private network client's private network and the public network.
6. A method for intercepting messages, characterized in that, The method is applied to an interception device located at any position in the network transmission link between the client and the server, including: Receive a test message based on the TCP protocol sent by the client; wherein the test message is used to test the network performance of the network transmission link between the client and the interception device, and the test message is constructed based on a raw socket; Based on the first forwarding rule, the test packets with PSH in the TCP flag sent by the client are intercepted so that the test packets with PSH do not reach the server's protocol stack. Based on the second forwarding rule, the test message sent by the client whose TCP flag does not contain PSH is forwarded to the server, so that the test message for establishing a communication connection between the client and the server is transmitted to the server.
7. A network performance testing device, characterized in that, The device is applied to a client and includes: The test message construction module is used to construct test messages based on the TCP protocol using raw sockets; The test message sending module is used to send the test message to the server to test the network performance of the network transmission link between the client and the interception device. The interception device is located at any position in the network transmission link between the client and the server. The interception device is configured with a first forwarding rule and a second forwarding rule. The first forwarding rule is used to intercept test messages with the TCP flag containing PSH so that the test messages containing PSH will not reach the server's protocol stack. The second forwarding rule is used to forward test messages without the TCP flag containing PSH to the server so that the test message for establishing a communication connection between the client and the server is transmitted to the server.
8. A message interception device, characterized in that, The device is applied to an interception device located at any point in the network transmission link between the client and the server, including: The message receiving module is used to receive test messages based on the TCP protocol sent by the client; wherein the test messages are used to test the network performance of the network transmission link between the client and the interception device, and the test messages are constructed based on raw sockets; The message interception module is used to intercept test messages sent by the client whose TCP flag contains PSH based on the first forwarding rule, so that the test messages containing PSH will not reach the server's protocol stack. The message forwarding module is used to forward test messages sent by the client whose TCP flag does not contain PSH to the server based on the second forwarding rule, so that test messages for establishing a communication connection between the client and the server are transmitted to the server.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method as described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
A method and system for preventing from TCP attack based on network stream technology
CN101170402A
A method and device for testingand simulating a database communication network
CN109257224A