Weak network simulation method, weak network testing method and device
By connecting a network impairment device in series between the proxy service device and the public network, the proxy service device receives and forwards data packets, and the network impairment device performs impairment processing, thus solving the problem of quickly simulating and testing weak network environments and improving the user experience.
Patent Information
- Application Number
- CN202310872537.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-07-14
AI Technical Summary
Existing technologies make it difficult to quickly and conveniently simulate and test weak network environments during product development, which affects user experience.
By connecting a network impairment device in series between the proxy service device and the public network, the proxy service device receives, parses, and forwards data packets, while the network impairment device performs network impairment processing on the data, simulating a weak network environment.
It enables quick and convenient simulation and testing of software or hardware products in weak network environments at any geographical location, improving the user experience.
Smart Images

Figure CN116827824B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of network testing technology, and in particular to a weak network simulation method, a weak network testing method and apparatus. Background Technology
[0002] With the development of internet technology, network-dependent software and hardware products are widely used, providing users with a wealth of work and life services. The normal operation of these products typically depends on a stable network environment. However, the real network environment is constantly changing, and users are likely to be in poor network quality environments, i.e., weak network environments. Network communication processes can experience latency, packet loss, bandwidth fluctuations, and other problems, leading to various issues with the products and impacting the user experience. Therefore, during product development, it is usually necessary to conduct weak network testing to understand how the product performs in weak network environments, and then optimize it to improve the actual user experience.
[0003] Therefore, there is a need to provide a weak network simulation and weak network testing method to facilitate and quickly perform weak network testing on products. Summary of the Invention
[0004] To facilitate and quickly simulate weak network environments and perform weak network testing on software or hardware products, this specification provides a weak network simulation method, a weak network testing method, and an apparatus through one or more embodiments.
[0005] Firstly, one or more embodiments of this specification provide a weak network simulation method applied to a proxy service device, wherein a network impairment device is connected in series between the proxy service device and a public network; the method includes:
[0006] Receive data packets sent by the data sender;
[0007] The data packet is parsed to obtain the original data;
[0008] The original data is transmitted to the public network through the network impairment device, so that the network impairment device performs network impairment processing on the original data and outputs the impaired data to the public network.
[0009] In one possible implementation, receiving the data packet sent by the data sender includes: receiving the data packet through a network tunnel; wherein the data packet includes a first data packet that is encapsulated twice based on a tunneling protocol of the network tunnel; the network tunnel is a virtual network channel between the proxy service device and the data sender;
[0010] The step of parsing the data packet includes: parsing the first data packet according to the decapsulation rules corresponding to the tunnel protocol of the network tunnel.
[0011] In one possible implementation, the method further includes:
[0012] Receive a connection request carrying connection verification information sent by the data sending end;
[0013] Verification is performed based on the connection verification information;
[0014] After successful verification, a connection response is sent to the data sending end to establish a network tunnel between the proxy service device and the data sending end, and to communicate through the network tunnel.
[0015] Secondly, one or more embodiments of this specification provide a weak network simulation method applied to a network impairment device, wherein the network impairment device is connected in series between a proxy service device and a public network; the method includes:
[0016] Receive raw data; wherein the raw data includes at least one of the following: first raw data from the proxy service device, or second raw data from the public network;
[0017] The original data is subjected to network impairment processing to obtain impaired data;
[0018] Output the damage data; wherein, outputting the damage data includes at least one of the following: outputting the first damage data corresponding to the first original data to the public network, or outputting the second damage data corresponding to the second original data to the proxy service device.
[0019] In one possible implementation, the network impairment processing of the original data includes:
[0020] The network impairment target strategy corresponding to the original data is determined according to the preset classification rules;
[0021] The original data is subjected to network impairment processing according to the network impairment target strategy.
[0022] In one possible implementation, the method further includes:
[0023] Upon receiving a policy update instruction, obtain network impairment parameters;
[0024] A new network impairment strategy can be generated based on the network impairment parameters, or a pre-stored network impairment strategy can be modified based on the network impairment parameters.
[0025] Thirdly, one or more embodiments of this specification provide a weak network testing method applied to a test terminal. The method includes: sending the data to be tested to a proxy service device, so that the proxy service device performs network impairment processing on the data to be tested through a network impairment device connected to the proxy service device and forwards the damaged data to the target terminal.
[0026] Receive response data forwarded by the proxy service device; the response data is data that the proxy service device forwards after performing network impairment processing on the original response data returned by the target terminal through the network impairment device.
[0027] The response performance under weak network conditions is analyzed based on the response data.
[0028] In one possible implementation, the method further includes:
[0029] Send a connection request to the proxy service device, and establish a network tunnel with the proxy service device based on the connection response returned by the proxy server.
[0030] In one possible implementation, sending the test data to the proxy service device includes:
[0031] The test data is sent to the proxy service device through the network tunnel;
[0032] The receipt of response data returned by the proxy service device includes:
[0033] The response data returned by the proxy service device is received through the network tunnel.
[0034] Fourthly, one or more embodiments of this specification also provide a weak network simulation device applied to a proxy service device, wherein a network impairment device is connected in series between the proxy service device and a public network; the device includes:
[0035] The receiving module is used to receive data packets sent by the data sending end;
[0036] The parsing module is used to parse the data packet to obtain the original data;
[0037] The sending module is used to transmit the original data to the public network through the network impairment device, so that the network impairment device can perform network impairment processing on the original data and output the damaged data to the public network.
[0038] In one possible implementation, the receiving module is used to receive data packets sent by the data sending end, including: the receiving module is used to receive the data packets through a network tunnel; wherein, the data packets include a first data packet that is encapsulated twice based on a tunneling protocol of the network tunnel; the network tunnel is a virtual network channel between the proxy service device and the data sending end;
[0039] The parsing module is used to parse the data packet, including: the parsing module is used to parse the first data packet according to the decapsulation rules corresponding to the tunnel protocol of the network tunnel.
[0040] In one possible implementation, the device further includes:
[0041] The connection control module is used to receive a connection request carrying connection verification information sent by the data sending end, verify the connection according to the connection verification information, and send a connection response to the data sending end after successful verification, so that the proxy service device and the data sending end can establish the network tunnel and communicate through the network tunnel.
[0042] Fifthly, one or more embodiments of this specification also provide a weak network simulation device applied to a network impairment device, wherein the network impairment device is connected in series with a proxy service device and a public network connection; the device includes:
[0043] The data input module is used to receive first raw data from the proxy service device, or to receive second raw data from the public network;
[0044] The data impairment module is used to perform network impairment processing on the first original data to obtain first impaired data, or to perform network impairment processing on the second original data to obtain second impaired data.
[0045] The data output module is used to output the first damage data to the public network, or to output the second damage data to the proxy service device.
[0046] In one possible implementation, the data impairment module is used to perform network impairment processing on the first original data, including: the data impairment module is used to determine the network impairment target strategy corresponding to the first original data according to a preset classification rule, and to perform network impairment processing on the first original data according to the network impairment target strategy.
[0047] In one possible implementation, the apparatus further includes a policy update module, configured to, upon receiving a policy update instruction, acquire network impairment parameters and generate a new network impairment policy based on the network impairment parameters, or modify a pre-stored network impairment policy based on the network impairment parameters.
[0048] Sixthly, one or more embodiments of this specification also provide a weak network testing device for use in a testing terminal, the device comprising:
[0049] The sending module is used to send the test data to the proxy service device, so that the proxy service device performs network impairment processing on the test data through the network impairment device connected to the proxy service device and forwards the impaired test data to the target terminal.
[0050] The receiving module is used to receive response data forwarded by the proxy service device; the response data is data that the proxy service device forwards after performing network impairment processing on the original response data returned by the target terminal through the network impairment device.
[0051] The analysis module is used to analyze the response effect under weak network conditions based on the response data.
[0052] In one possible implementation, the apparatus further includes a connection module, configured to send a connection request to the proxy service device and establish a network tunnel with the proxy service device based on the connection response returned by the proxy server.
[0053] In one possible implementation, the sending module is used to send the test data to the proxy service device, including: the sending module is used to send the test data to the proxy service device through the network tunnel;
[0054] The receiving module is used to receive response data returned by the proxy service device, including: the receiving module is used to receive the response data returned by the proxy service device through the network tunnel.
[0055] In a seventh aspect, one or more embodiments of this specification also provide an electronic device, which includes a memory and a processor; the memory is used to store a computer program product; the processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the weak network simulation method of the first or second aspect described above, or implements the weak network testing method of the third aspect described above.
[0056] Eighthly, one or more embodiments of this specification also provide a computer-readable storage medium storing computer program instructions that, when executed, implement the weak network simulation method of the first or second aspect described above, or implement the weak network testing method of the third aspect described above.
[0057] Ninthly, one or more embodiments of this specification also provide a weak network simulation system, including: a proxy service device and a network impairment device; the network impairment device is connected in series between the proxy service device and a public network; wherein, the proxy service device includes the weak network simulation device described in the fourth aspect above, or performs the weak network simulation method of the first aspect above; the network impairment device includes the weak network simulation device described in the fifth aspect above, or performs the weak network simulation method of the second aspect above.
[0058] In a tenth aspect, one or more embodiments of this specification also provide a weak network testing system, comprising: a test terminal, a proxy service device, and a network impairment device; the network impairment device is connected in series between the proxy service device and a public network; the test terminal communicates with the proxy server through the public network; wherein, the test terminal includes the weak network testing device described in the sixth aspect above, or executes the weak network testing method of the third aspect above; the proxy service device includes the weak network simulation device described in the fourth aspect above, or executes the weak network simulation method of the first aspect above; the network impairment device includes the weak network simulation device described in the fifth aspect above, or executes the weak network simulation method of the second aspect above.
[0059] In summary, to facilitate convenient and rapid simulation of weak network environments and to achieve weak network testing of software or hardware products, this specification provides one or more embodiments of a weak network simulation method, a weak network testing method, and an apparatus. In this method, a proxy service device receives data packets sent by a data sender, parses them to obtain the original data, and forwards it. A network impairment device connected between the proxy service device and the public network then performs network impairment processing on the original data and outputs the impaired data to the public network. Thus, the data received by the data receiver is the impaired data, simulating a weak network environment. Based on this, a test terminal can establish a network connection with the proxy service device to access the weak network environment simulated by the proxy service device and the network impairment device. The proxy service device forwards test data to the target terminal and receives response data forwarded from the target terminal. Both the test data and the response data can undergo network impairment by the network impairment device during forwarding through the proxy service device. By analyzing the impaired response data, the operating status of the product under test in the weak network environment can be obtained.
[0060] In this way, the implementation of weak network simulation and weak network testing using the embodiments of this specification is not limited by geographical location. The data sending end that needs to use the weak network environment can remotely connect to the proxy service device through the network, and the data it sends can be introduced into the network impairment device connected to the proxy service device. The data sending end and the network impairment device do not need to be located in the same geographical location. Therefore, by using the methods and related devices provided in the embodiments of this specification, a weak network environment can be obtained conveniently and quickly anytime and anywhere, and weak network testing can be performed on any software product or hardware product. Attached Figure Description
[0061] To more clearly illustrate the technical solutions of one or more embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of one or more embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This specification provides a schematic diagram of an application scenario for one or more embodiments.
[0063] Figure 2 A flowchart illustrating a weak network simulation method provided in one or more embodiments of this specification;
[0064] Figure 3 A schematic diagram of a weak network simulation system provided for one or more embodiments of this specification;
[0065] Figure 4 A schematic diagram illustrating the changes in data during network transmission provided in one or more embodiments of this specification;
[0066] Figure 5 A flowchart illustrating a weak network simulation method provided in one or more embodiments of this specification;
[0067] Figure 6 A flowchart illustrating a weak network testing method provided in one or more embodiments of this specification;
[0068] Figure 7 A structural block diagram of a weak network simulation device provided in one or more embodiments of this specification;
[0069] Figure 8 A structural block diagram of a weak network simulation device provided in one or more embodiments of this specification;
[0070] Figure 9 A structural block diagram of a weak network testing device provided in one or more embodiments of this specification;
[0071] Figure 10 A structural block diagram of an electronic device provided in one or more embodiments of this specification;
[0072] Figure 11 This is a structural block diagram of a weak network testing system provided in one or more embodiments of this specification. Detailed Implementation
[0073] The present specification describes one or more embodiments in further detail below with reference to the accompanying drawings and examples. Through these descriptions, the features and advantages of one or more embodiments of the present specification will become clearer and more apparent.
[0074] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments. Although various aspects of embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated otherwise.
[0075] Furthermore, the technical features described below in one or more embodiments of this specification may be combined with each other as long as they do not conflict with each other.
[0076] To facilitate understanding, the application scenarios of the technical solutions provided in one or more embodiments of this specification will be described below.
[0077] Figure 1 This diagram illustrates an application scenario provided by one or more embodiments of this specification. (Refer to...) Figure 1 Whether it's communication between smart terminal 101 and server 102 via the network, or communication between different smart terminals, such as smart terminal A and smart terminal B, the communication quality will be affected by the network quality. When the network quality is poor, i.e., in a weak network environment, communication data will be damaged when passing through this environment, such as experiencing delays, packet loss, and out-of-order delivery. Figure 1 The dashed lines represent data corruption after passing through the network, preventing the receiver from receiving accurate or timely communication data, thus affecting the user experience of related software or hardware products. Therefore, during product development, it is usually necessary to conduct weak network testing to understand how the product performs in weak network environments, and then optimize it to avoid performance defects in weak network environments, thereby improving the actual user experience.
[0078] In view of this, in order to facilitate and quickly perform weak network testing on software or hardware products, one or more embodiments of this specification provide a weak network simulation method, a weak network testing method, and an apparatus, which will be described in detail below.
[0079] Figure 2This is a flowchart illustrating a weak network simulation method provided in one embodiment of this specification. Figure 3 This is a schematic diagram of a weak network simulation system provided in one embodiment of this specification. The weak network simulation system 300 includes a proxy service device 301 and a network impairment device 302; wherein, the network impairment device 302 is connected in series on the communication line between the proxy service device 301 and the public network, so that all communication data between the proxy service device 301 and the public network passes through the network impairment device 302. This weak network simulation method can be applied to... Figure 3 The agent service device 301 shown. (Refer to...) Figure 2 and Figure 3 The weak network simulation method includes the following steps.
[0080] Step 1002: Receive the data packet sent by the data sender.
[0081] The aforementioned data sending end can be any device capable of accessing the Internet, such as a smartphone, tablet, laptop, desktop computer, or server, including various IoT-related devices. This data sending end can establish a network connection with the proxy service device 301. After the data sending end transmits data packets through a public network, the proxy service device 301 can receive the data packets.
[0082] Step 1004: Parse the data packet to obtain the original data.
[0083] The parsed raw data includes the target address of the data receiving end. Based on this target address, the proxy service device 301 can forward the raw data so that the data sent by the data sending end eventually reaches the data receiving end.
[0084] Step 1006: The original data is transmitted to the public network through the network impairment device, so that the network impairment device performs network impairment processing on the original data and outputs the impaired data to the public network.
[0085] In this embodiment, since the network impairment device 302 is connected in series in the communication line between the proxy service device 301 and the public network, when the original data is forwarded by the proxy service device, it will pass through the network impairment device 302 to reach the public network. Thus, the network impairment device 302 can impair the original data, ultimately causing the impaired data to be sent to the target address in the public network. That is, the data received by the data receiver at the target address is not the correct original data sent by the data sender, but the impaired data. Therefore, any data forwarded by the proxy service device can be impaired by the network impairment device, achieving the network transmission effect in a real weak network environment.
[0086] As can be seen, the weak network simulation method provided in one or more embodiments of this specification utilizes the proxy forwarding function of a proxy service device to introduce data sent by the data sender into a network impairment device for network impairment processing, so that the data finally forwarded to the data receiver has a network impairment effect equivalent to that in a real weak network environment. Applying the weak network simulation method provided in the embodiments of this specification is not limited by geographical location. The data sender requiring a weak network environment can remotely connect to the proxy service device via the network, and the data it sends can be introduced into the network impairment device connected to the proxy service device. The data sender and the network impairment device do not need to be located in the same geographical location. Therefore, applying the weak network simulation method provided in the embodiments of this specification allows for obtaining a weak network environment anytime, anywhere, to perform weak network testing on software or hardware products.
[0087] In addition, by utilizing the proxy forwarding function of the proxy service device, proxy forwarding of data under various application protocols can be realized, including but not limited to Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Simple Mail Transfer Protocol (SMTP), etc. Therefore, the embodiments in this specification can be used for weak network simulation of various types of application data, and thus can be applied to weak network testing of various software products and hardware products.
[0088] It should be noted that the aforementioned proxy service device 301 can be a proxy server or a computer configured with proxy service functions; the network impairment device 302 can be implemented by hardware or software, that is, the network impairment device 302 can be an independent hardware device, or it can be a chip or computer-readable storage medium embedded in the proxy service device 301 or electronic device that stores a computer program product. When the computer program product is invoked and executed, it can realize the network impairment function.
[0089] In one possible implementation, the data packet received in step 1002 includes a first data packet that is encapsulated twice based on a network tunneling protocol; wherein the network tunnel is a virtual network channel established between the proxy service device and the data sending end.
[0090] Optionally, receiving the data packet sent by the data sending end in step 1002 specifically includes: receiving the first data packet through a network tunnel;
[0091] Optionally, parsing the data packet in step 1004 includes: parsing the first data packet according to the decapsulation rules corresponding to the tunnel protocol of the network tunnel.
[0092] Since the destination address recorded in the original data of the data sender is the IP address (i.e., Internet Protocol address) of the data receiver, in order for the proxy service device 301 to receive the data sent by the data sender instead of receiving it directly by the data receiver, the original data of the data sender can be encapsulated twice, and the IP address of the proxy service device can be added to the header of the encapsulated message. Thus, the proxy service device can receive the data packets sent by the data sender.
[0093] It should be noted that the data sending end and the proxy service device can establish a communication connection based on different network protocols. Depending on the different network protocols, the secondary encapsulation of the original data can be performed in different locations, such as at the data sending end, or through devices such as switches and routers in the network line between the data sending end and the proxy service device. These details will not be elaborated here.
[0094] In one possible implementation, the above weak network simulation method further includes the following steps:
[0095] Step 1012: Receive a connection request carrying connection verification information sent by the data sending end;
[0096] Step 1014: Perform verification based on the connection verification information;
[0097] Step 1016: After successful verification, a connection response is sent to the data sending end to establish a network tunnel between the proxy service device and the data sending end, and to communicate through the network tunnel.
[0098] The aforementioned verification information may include information such as the account, password, and key required to connect to the proxy service device. The proxy service device authenticates the data sender based on this connection verification information, that is, it verifies whether the data sender is a legitimate device registered with the proxy service device. If the verification is successful, the proxy service device authorizes the data sender to establish a connection with the data sender and sends a connection response to the data sender.
[0099] Figure 4 This diagram illustrates the changes in data during network transmission in an embodiment of this specification. Assume the IP address of the proxy service device is C, and a data sender with IP address A wants to send data to an actual data receiver with IP address B; refer to... Figure 4The raw data from the data sender has been encapsulated at least once before transmission to form an IP packet. At this point, the IP address in the packet header is: source address A and actual destination address B. Based on the weak network simulation method provided in the embodiments of this specification, a network tunnel is established between the data sender and the proxy service device. The raw data is encapsulated a second time as it passes through this network tunnel. The encapsulated data packet uses the raw data as payload data and adds the following fields:
[0100] Verification information, such as the account, password, key, etc. mentioned above;
[0101] Tunneling protocol is used to identify the tunneling protocol used by the network tunnel, such as Layer 2 Tunneling Protocol (L2TP), Point-to-Point Tunneling Protocol (PPTP), etc.
[0102] Transport protocol is used to identify the protocol used by the transport layer, such as User Datagram Protocol (UDP) and Transmission Control Protocol (TCP).
[0103] The new header is used to record the new IP address, including the source address A and the proxy destination address C.
[0104] In this way, the routing device reads the proxy destination address C from the new packet header 405 of the re-encapsulated data packet, and then routes the data packet to the proxy service device 301. After receiving the data packet, the proxy service device 301 parses it to obtain the original data, reads the actual destination address B from it, and then forwards it to the actual destination address B. During forwarding, the original data will be damaged by the network impairment device 302, so that the data received by the data receiver corresponding to the actual destination address B is the damaged data.
[0105] Steps 1012, 1014, and 1016 above constitute the process of establishing a network tunnel between the data sender and the proxy service device. Before receiving data, the proxy service device can establish a dedicated virtual network tunnel with the data sender through steps 1012, 1014, and 1016. This ensures that the data transmitted between the data sender and the proxy service device is based on the encapsulation protocol and encryption method specified by the network tunnel, achieving network isolation, preventing third parties from eavesdropping on or modifying data, and guaranteeing the security of data transmission between the two.
[0106] The network damage caused to data by the aforementioned network impairment device is known and predictable. In the embodiments described above, the original data is re-encapsulated, sent, and parsed based on the network tunnel between the data sender and the proxy service device. This ensures the security of the data during transmission between the data sender and the proxy service device, avoids unpredictable network damage during weak network simulation, and thus achieves more accurate weak network simulation.
[0107] Based on the same inventive concept, one or more embodiments of this specification also provide a weak network simulation method, which is applied to a network damage device.
[0108] Figure 5 This specification provides a flowchart illustrating a weak network simulation method applied to a network impairment device for one or more embodiments. (Refer to...) Figure 5 and Figure 3 This weak network simulation method can be applied to Figure 3 The network impairment device 302 in the weak network simulation system 300 shown includes the following steps:
[0109] Step 2002: Receive raw data;
[0110] Optionally, step 2002 includes: step 2012, receiving first raw data from the agent service device.
[0111] Optionally, step 2002 includes: step 2022, receiving second raw data from a public network.
[0112] Step 2004: Perform network impairment processing on the original data to obtain impaired data.
[0113] Optionally, step 2004 includes: step 2014, performing network impairment processing on the first raw data received in step 2012 to obtain first impaired data.
[0114] Optionally, step 2004 includes: step 2024, performing network impairment processing on the second raw data received in step 2022 to obtain second impaired data.
[0115] Step 2006: Output the damage data.
[0116] Optionally, step 2006 includes: step 2016, outputting the first damage data obtained in step 2014 to a public network.
[0117] Optionally, step 2006 includes: step 2026, outputting the second damage data obtained in step 2024 to the proxy service device.
[0118] The network impairment device 302 is logically equivalent to a network cable, or a transparent bridge connecting the proxy service device 301 and the public network. Data transmitted between the proxy service device 301 and the public network can be impaired through the network impairment device 302.
[0119] Understandably, in practical application scenarios, the timing of network impairment can be controlled by configuring the network impairment device 302 according to the needs of weak network usage. This includes: implementing network impairment through steps 2012, 2014, and 2016 above, where network impairment occurs during the process of data being forwarded from the proxy service device 301 to the public network; or implementing network impairment through steps 2022, 2024, and 2026 above, where network impairment occurs during the process of data being transmitted from the public network to the proxy service device 301; or simultaneously using steps 2012-2016 and steps 2022-2026 to perform network impairment twice, before the data is received by the proxy service device 301 and after it is forwarded.
[0120] As can be seen from the above steps, the weak network simulation method provided in one or more embodiments of this specification utilizes the proxy forwarding function of a proxy service device to remotely introduce data into a network impairment device for network impairment processing, achieving a network impairment effect equivalent to that in a real weak network environment. The weak network simulation method provided in the embodiments of this specification is not limited by geographical location; the data sending end requiring a weak network environment can remotely connect to the proxy service device via the network. That is, the data sending end and the network impairment device do not need to be located in the same geographical location. Therefore, by applying the weak network simulation method provided in the embodiments of this specification, a weak network environment can be obtained anytime, anywhere, for weak network testing of software or hardware products.
[0121] In one possible implementation, step 2004 above, which involves performing network impairment processing on the original data, specifically includes:
[0122] The network impairment target strategy corresponding to the original data is determined according to the preset classification rules;
[0123] The original data is subjected to network impairment processing according to the network impairment target strategy.
[0124] It is understood that the raw data may be the first raw data received in step 2012 or the second raw data received in step 2022.
[0125] In the network impairment device 302, various network impairment strategies can be pre-configured. Different network impairment strategies allow for different settings of network impairment parameters. These network impairment parameters include, but are not limited to, bandwidth, latency, jitter, packet loss, replication, out-of-order delivery, and tampering. Correspondingly, bandwidth limits, packet loss rates, and latency precision can be set within the network impairment strategy.
[0126] The aforementioned preset classification rules are used to filter and screen data to be impaired. Different types of data can be impaired using different network impairment strategies. For example, the preset classification rules may include classification based on one or more of the following packet information: source address, destination address, data type, etc.
[0127] Based on the above implementation, different data can correspond to different network impairment target strategies, and are processed in parallel through different network impairment channels in the network impairment device 302. Therefore, the weak network testing method provided by one or more embodiments of this specification can simultaneously provide different weak network environments for multiple testing needs of one or more users, thereby improving the efficiency of weak network testing.
[0128] In one possible implementation, the above-mentioned weak network simulation method may further include the following steps:
[0129] Step 2022: Upon receiving a policy update instruction, obtain network impairment parameters;
[0130] Step 2024: Generate a new network impairment strategy based on the network impairment parameters, or modify a pre-stored network impairment strategy based on the network impairment parameters.
[0131] Based on the above implementation, users can remotely access the control interface of the network impairment device 302, send policy update commands, and input network impairment parameters to modify its preset network impairment policies or add new network impairment policies. Therefore, the weak network simulation method provided in one or more embodiments of this specification can meet users' different needs in weak network environments, configure different weak network environments as needed, and enable remote connection to and control of network impairment policies in weak network environments. It is not limited by geographical location and allows users to use a weak network environment that meets their needs anytime, anywhere, helping to promptly detect and prevent problems with software or hardware products in weak network scenarios.
[0132] Based on the same inventive concept, one or more embodiments of this specification also provide a weak network testing method, which is applied to a test terminal.
[0133] Figure 6 This is a flowchart illustrating a weak network testing method provided in one or more embodiments of this specification. (Refer to...) Figure 6The method includes the following steps:
[0134] Step 3002: Send the test data to the proxy service device so that the proxy service device performs network impairment processing on the test data through the network impairment device connected to the proxy service device and forwards the impaired test data to the target terminal.
[0135] Step 3004: Receive response data forwarded by the proxy service device; the response data is data obtained by performing network impairment processing on the original response data from the target terminal through the network impairment device.
[0136] Step 3006: Analyze the response effect under weak network conditions based on the response data.
[0137] As can be seen from the above steps, in the weak network testing method provided in this specification, the test terminal sends the test data to the target terminal through a proxy service device and receives the response data returned by the target terminal through the proxy service device. Since the data passes through a network impairment device connected to the proxy service device when it is forwarded through the proxy service device, network impairment can be applied to the test data sent by the test terminal and the original response data returned by the target terminal. Thus, the test terminal sends the test data D1, while the target terminal receives the data D1' after D1 is impaired; the target terminal responds based on the impaired data D1', generating the original response data D2; the response data received by the test terminal is also the data D2' after D2 is impaired. By analyzing the response data received by the test terminal, i.e., D2', for example, by comparing D2' with the expected response data, the response effect in a weak network environment can be obtained, thereby obtaining the running effect of the test terminal or the application running on the test terminal in a weak network environment, achieving the purpose of weak network testing.
[0138] As can be seen, the weak network testing method provided in this specification allows the test terminal and related testers to remotely access the weak network environment simulated by the proxy service device and network impairment device without geographical restrictions, enabling weak network testing anytime and anywhere. This helps to promptly detect and prevent problems that may occur in the tested product under weak network conditions.
[0139] In one possible implementation, the weak network testing method further includes the following steps:
[0140] Send a connection request to the proxy service device, and establish a network tunnel with the proxy service device based on the connection response returned by the proxy server.
[0141] Optionally, step 3002 may specifically be: sending the test data to the proxy service device through the network tunnel.
[0142] Optionally, step 3004 may specifically be: receiving response data returned by the proxy service device through the network tunnel.
[0143] The weak network testing method provided in this specification establishes a connection between the test terminal and the proxy service device, enabling data transmission between them through a virtual network tunnel. This prevents data from being eavesdropped on or modified, and avoids unpredictable network damage affecting the test results. Simultaneously, it allows the test terminal to access weak network environments anytime, anywhere by connecting to the proxy service device, thereby achieving weak network testing and improving testing efficiency.
[0144] It is understood that the above embodiments are merely examples, and modifications can be made to the above embodiments in actual implementation. Those skilled in the art will understand that any modifications to the above embodiments that do not require creative effort fall within the protection scope of one or more embodiments of this specification, and will not be described again in the embodiments.
[0145] Based on the same inventive concept, one or more embodiments of this specification also provide a weak network simulation device and system, and a weak network testing device and system. Since the principle of solving the problem by the weak network simulation device and system and the weak network testing device and system is similar to that of the aforementioned weak network simulation method and weak network testing method, the implementation of the weak network simulation device and system and the weak network testing device and system can refer to the implementation of the aforementioned weak network simulation method and weak network testing method, and the repeated parts will not be described again.
[0146] Figure 7 This specification provides a structural block diagram of a weak network simulation device according to one or more embodiments. This device can be applied to a proxy service device, which has a network impairment device connected in series with a public network. Figure 7 As shown, the device 700 may include:
[0147] The receiving module 701 is used to receive data packets sent by the data sending end;
[0148] Parsing module 702 is used to parse the data packet to obtain the original data;
[0149] The sending module 703 is used to transmit the original data to the public network through the network impairment device, so that the network impairment device can perform network impairment processing on the original data and output the damaged data to the public network.
[0150] In one possible implementation, the receiving module 701 is used to receive data packets sent by the data sending end, specifically including: the receiving module 701 is used to receive the data packets through a network tunnel; wherein, the data packets include a first data packet that is encapsulated twice based on a tunneling protocol of the network tunnel; the network tunnel is a virtual network channel between the proxy service device and the data sending end.
[0151] The parsing module 702 is used to parse the data packet, specifically including: the parsing module 702 is used to parse the first data packet according to the decapsulation rules corresponding to the tunnel protocol of the network tunnel.
[0152] In one possible implementation, the aforementioned weak network simulation device 700 further includes:
[0153] The connection control module is used to receive a connection request carrying connection verification information sent by the data sending end, verify the connection according to the connection verification information, and send a connection response to the data sending end after successful verification, so that the proxy service device and the data sending end can establish the network tunnel and communicate through the network tunnel.
[0154] Figure 8 This specification provides a structural block diagram of a weak network simulation device according to one or more embodiments. This device can be applied to a network impairment device, which is connected in series with a proxy service device and a public network connection. Figure 8 As shown, the device 800 may include:
[0155] The data input module 801 is used to receive first raw data from the proxy service device, or to receive second raw data from the public network;
[0156] The data impairment module 802 is used to perform network impairment processing on the first original data to obtain first impaired data, or to perform network impairment processing on the second original data to obtain second impaired data;
[0157] The data output module 803 is used to output the first damage data to the public network, or to output the second damage data to the proxy service device.
[0158] In one possible implementation, the data impairment module 802 is used to perform network impairment processing on the first original data, specifically including: the data impairment module 802 is used to determine the network impairment target strategy corresponding to the first original data according to a preset classification rule, and to perform network impairment processing on the first original data according to the network impairment target strategy.
[0159] In one possible implementation, the aforementioned weak network simulation device 800 further includes:
[0160] The policy update module is used to obtain network impairment parameters when a policy update instruction is received, and generate a new network impairment policy based on the network impairment parameters, or modify a pre-stored network impairment policy based on the network impairment parameters.
[0161] Figure 9 This is a structural block diagram of a weak network testing device provided in one or more embodiments of this specification. This device can be applied to a testing terminal. See also... Figure 9 The weak network testing device 900 includes:
[0162] The sending module 901 is used to send the test data to the proxy service device, so that the proxy service device performs network impairment processing on the test data through the network impairment device connected to the proxy service device and forwards the impaired test data to the target terminal.
[0163] The receiving module 902 is used to receive response data forwarded by the proxy service device; the response data is data that the proxy service device forwards after performing network impairment processing on the original response data returned by the target terminal through the network impairment device.
[0164] Analysis module 903 is used to analyze the response effect under weak network conditions based on the response data.
[0165] In one possible implementation, the aforementioned weak network testing device 900 further includes:
[0166] The connection module is used to send a connection request to the proxy service device and establish a network tunnel with the proxy service device based on the connection response returned by the proxy server.
[0167] In one possible implementation, the sending module 901 is used to send the test data to the proxy service device, specifically including: the sending module 901 is used to send the test data to the proxy service device through the network tunnel;
[0168] The receiving module 902 is used to receive response data returned by the proxy service device, specifically including: the receiving module 902 is used to receive response data returned by the proxy service device through the network tunnel.
[0169] See Figure 10 , Figure 10 This is a structural block diagram of an electronic device provided for one or more embodiments of this specification. Figure 10As shown, the electronic device 500 may include a processor 501 and a memory 502; the memory 502 may be coupled to the processor 501. It is worth noting that... Figure 10 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0170] In one possible implementation, the functionality of the weak network simulation device 700 can be integrated into the processor 501. The processor 501 can be configured to perform the following operations:
[0171] Receive data packets sent by the data sender;
[0172] The data packet is parsed to obtain the original data;
[0173] The original data is transmitted to the public network through the network impairment device, so that the network impairment device performs network impairment processing on the original data and outputs the impaired data to the public network.
[0174] In another possible implementation, the weak network simulation device 700 can be configured separately from the processor 501. For example, the weak network simulation device 700 can be configured as a chip connected to the processor 501, and the weak network simulation can be realized through the control of the processor 501.
[0175] In one possible implementation, the functionality of the weak network simulation device 800 can be integrated into the processor 501. The processor 501 can be configured to perform the following operations:
[0176] Receive raw data; wherein the raw data includes at least one of the following: first raw data from the proxy service device, or second raw data from the public network;
[0177] The original data is subjected to network impairment processing to obtain impaired data;
[0178] Output the damage data; wherein, outputting the damage data includes at least one of the following: outputting the first damage data corresponding to the first original data to the public network, or outputting the second damage data corresponding to the second original data to the proxy service device.
[0179] In another possible implementation, the weak network simulation device 800 can be configured separately from the processor 501. For example, the weak network simulation device 800 can be configured as a chip connected to the processor 501, and the weak network simulation can be realized through the control of the processor 501.
[0180] In one possible implementation, the weak network simulation device 700 and the weak network simulation device 800 can be simultaneously integrated into the processor 501. Accordingly, the processor 501 can be configured to perform the operations performed by the weak network simulation device 700 and the weak network simulation device 800 in any of the above embodiments.
[0181] In one possible implementation, the functionality of the weak network testing device 900 can be integrated into the processor 501. The processor 501 can be configured to perform the following operations:
[0182] The test data is sent to the proxy service device, so that the proxy service device performs network impairment processing on the test data through the network impairment device connected to the proxy service device and forwards the impaired test data to the target terminal.
[0183] Receive response data forwarded by the proxy service device; the response data is data that the proxy service device forwards after performing network impairment processing on the original response data returned by the target terminal through the network impairment device.
[0184] The response performance under weak network conditions is analyzed based on the response data.
[0185] In another possible implementation, the weak network testing device 900 can be configured separately from the processor 501. For example, the weak network testing device 900 can be configured as a chip connected to the processor 501, and the weak network test can be implemented through the control of the processor 501.
[0186] Furthermore, in some alternative implementations, the electronic device 500 may also include: a communication module, an input unit, an audio processor, a display, a power supply, etc. It is worth noting that the electronic device 500 is not necessarily required to include these components. Figure 10 All components shown; in addition, the electronic device 500 may also include Figure 10 For components not shown, please refer to existing technologies.
[0187] In some alternative implementations, the processor 501, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 500.
[0188] The memory 502 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It can store the information related to the weak network simulation device 700, weak network simulation device 800, or weak network testing device 900, and may also store programs for executing that information. The processor 501 can execute the program stored in the memory 502 to perform information storage or processing, etc.
[0189] An input unit can provide input to the processor 501. This input unit may be, for example, a button or touch input device. A power supply can be used to provide power to the electronic device 500. A display can be used to display images and text, etc. This display may be, for example, an LCD display, but is not limited to this.
[0190] Memory 502 can be a solid-state memory, such as read-only memory (ROM), random access memory (RAM), SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROM, etc. Memory 502 can also be some other type of device. Memory 502 includes buffer memory (sometimes referred to as a buffer). Memory 502 may include an application / function storage unit for storing application programs and function programs or processes for executing the operation of electronic device 500 via processor 501.
[0191] The memory 502 may also include a data storage unit for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit of the memory 502 may include various drivers for the computer device for communication functions and / or for performing other functions of the computer device (such as messaging applications, address book applications, etc.).
[0192] The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor 501 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.
[0193] Based on different communication technologies, multiple communication modules can be configured in the same computer device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor is coupled to processor 501, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.
[0194] This specification also provides, in one or more embodiments, a computer-readable storage medium capable of implementing all steps of the weak network simulation method and weak network testing method in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the weak network simulation method or weak network testing method in the above embodiments. Specific steps can be found in the foregoing embodiments and will not be repeated here.
[0195] See Figure 3 One or more embodiments of this specification also provide a weak network simulation system, the weak network simulation system 300 including a proxy service device 301 and a network damage device 302;
[0196] The network damage device 302 is connected in series between the proxy service device 301 and the public network;
[0197] The proxy service device 301 includes the weak network simulation device 700 described in any of the above embodiments, and the network damage device 302 includes the weak network simulation device 800 described in any of the above embodiments.
[0198] In one possible implementation, the proxy service device 301 can be a proxy server or a computer configured with proxy service functions (such as a desktop computer, laptop computer, etc.), and the network impairment device 302 can be a network impairment instrument.
[0199] In one possible implementation, the proxy service device 301 and the network impairment device 302 can be integrated into the same device to achieve the same function as the weak network simulation system 300 described above.
[0200] In one possible implementation, the aforementioned weak network simulation system 300 may further include a network loss control device 303. Figure 3The diagram uses a broken line to illustrate the connection between the network loss control device 303 and the network impairment device 302. This indicates that the network loss control device 303 can be connected to the network impairment device 302 via physical wiring (e.g., network cable, data cable) or a public network. It is used to send policy update commands and network impairment parameters to the network impairment device 302 based on user operations, thereby controlling the network impairment device 302 to update its preset network impairment policy. The network loss control device 303 can be a mobile phone, tablet, laptop, desktop computer, etc., and its settings interface can be accessed through a browser to update and control its network impairment policy.
[0201] This specification also provides a weak network testing system in one or more embodiments, such as Figure 11 As shown, the weak network testing system 400 includes: a test terminal 401, a proxy service device 301, and a network damage device 302.
[0202] The proxy service device 301 and the network impairment device 302 constitute a weak network simulation system. The network impairment device 302 is connected in series between the proxy service device 301 and the public network, and can execute the weak network simulation method described in any of the previous embodiments to simulate the weak network environment required for testing.
[0203] The test terminal 401 communicates with the proxy server 301 through a public network. It may include the weak network testing device described in any of the preceding embodiments and implement the corresponding functions. It accesses the weak network environment simulated by the proxy server 301 and the network impairment device 302 to achieve the purpose of weak network testing.
[0204] In one possible implementation, the aforementioned weak network testing system 400 may further include the aforementioned network loss control device 303 to control the network damage device 302 to update its preset network damage strategy. (See reference) Figure 3 , Figure 11 The connection between the network loss control device 303 and the network damage device 302 is still illustrated by a broken line, indicating that the network loss control device 303 can be connected to and control the network damage device 302 via a wired connection, or it can be connected to and control the network damage device 302 remotely via a public network.
[0205] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual device or client product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0206] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, apparatus (systems), or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0207] This specification describes one or more embodiments of a method, apparatus (system), and computer program product according to one or more embodiments of this specification with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0208] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0209] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0210] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and system embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0211] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Those skilled in the art will understand the specific meaning of the above terms in one or more embodiments of this specification, depending on the specific circumstances.
[0212] It should be noted that, unless otherwise specified, one or more embodiments and features thereof in this specification can be combined with each other. This specification is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or substitution of such aspects and / or embodiments. Furthermore, each aspect and / or embodiment of one or more embodiments of this specification can be used alone or in combination with one or more other aspects and / or embodiments thereof.
[0213] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of one or more embodiments of this specification, and are not intended to limit them. Although one or more embodiments of this specification have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of one or more embodiments of this specification, and they should all be covered within the scope of the claims and the specification of one or more embodiments of this specification.
[0214] The foregoing description of one or more embodiments of this specification has been provided in conjunction with optional implementation methods. However, these embodiments are merely exemplary and serve only an illustrative purpose. Based on this, various substitutions and modifications can be made to one or more embodiments of this specification, all of which fall within the protection scope of one or more embodiments of this specification.
Claims
1. A weak network simulation method, characterized in that, The method is applied to a proxy service device, wherein a network impairment device is connected in series between the proxy service device and a public network, and the network impairment device is a transparent bridge connecting the proxy service device and the public network; the method includes: The data packet is received by the data sending end through a network tunnel established on the public network. The data packet is the original data containing the actual target address of the target terminal, and is a first data packet that is encapsulated by adding a new message header containing the proxy target address of the proxy service device based on the tunneling protocol of the network tunnel. The data sending end is a test terminal that remotely accesses the proxy service device, and the network tunnel is a virtual network channel between the proxy service device and the data sending end. According to the decapsulation rules corresponding to the tunnel protocol of the network tunnel, the first data packet is parsed to obtain the original data; Based on the actual target address, the original data is transmitted to the public network through the network impairment device, so that the network impairment device performs network impairment processing on the original data and outputs the damaged data to the target terminal in the public network; The network impairment device receives the damaged response data returned by the target terminal via the public network, and sends the damaged response data to the test terminal through the network tunnel, so that the test terminal can analyze the response effect in a weak network environment based on the damaged response data; wherein, the original data is the test data, and both the test data and the response data returned by the target terminal are processed by the same network impairment device.
2. The method of claim 1, wherein, The method further includes: Receive a connection request carrying connection verification information sent by the data sending end; Verification is performed based on the connection verification information; After successful verification, a connection response is sent to the data sending end to establish a network tunnel between the proxy service device and the data sending end, and to communicate through the network tunnel.
3. A weak network simulation method, characterized by, The method is applied to a network impairment device, which is connected in series as a transparent bridge between a proxy service device and a public network; the method includes: The system receives first raw data from the proxy service device and second raw data from the public network. The first raw data is the test data obtained by the proxy service device after decapsulating the secondary encapsulated data packet sent by the test terminal that remotely accesses the proxy service device through the network tunnel established on the public network. The second raw data is the raw response data returned by the target terminal. The first raw data is subjected to network impairment processing to obtain first impaired data, and the second raw data is subjected to network impairment processing to obtain second impaired data. The first damage data is output to the public network, and the second damage data is output to the proxy service device, so that the proxy service device returns the second damage data to the test terminal through the network tunnel.
4. The method of claim 3, wherein, The network impairment processing of the original data includes: The network impairment target strategy corresponding to the original data is determined according to the preset classification rules; The original data is subjected to network impairment processing according to the network impairment target strategy.
5. The method of claim 4, wherein, The method further includes: Upon receiving a policy update instruction, obtain network impairment parameters; A new network impairment strategy can be generated based on the network impairment parameters, or a pre-stored network impairment strategy can be modified based on the network impairment parameters.
6. A method of weak network testing, the method comprising: Applied to a test terminal, the method includes: Data packets are sent to a remotely accessed proxy service device via a network tunnel established on a public network. The proxy service device then performs network impairment processing on the test data through a transparent bridge-type network impairment device connected between the proxy service device and the public network, and forwards it to the target terminal according to the actual target address. The data packet is the original data containing the actual target address of the target terminal, and is a first data packet that is re-encapsulated by adding a new header containing the proxy target address of the proxy service device based on the tunneling protocol of the network tunnel. The network tunnel is a virtual network channel between the proxy service device and the test terminal. The network tunnel receives the damaged response data forwarded by the proxy service device; the damaged response data is the data that the proxy service device forwards after the original response data returned by the target terminal enters the network damage device through the public network for network damage processing. The response effect under weak network environment is analyzed based on the response data after the damage, wherein the original data is the test data, and the test data and the response data returned by the target terminal are both processed by the same network damage device.
7. The method of claim 6, wherein, The method further includes: Send a connection request to the proxy service device, and establish a network tunnel with the proxy service device based on the connection response returned by the proxy service device.
8. A weak network simulation apparatus, characterized by, An application is made to a proxy service device, wherein a network impairment device is connected in series between the proxy service device and a public network, and the network impairment device is a transparent bridge connecting the proxy service device and the public network; the device includes: The receiving module is used to receive data packets sent by the data sending end through a network tunnel established on the public network. The data packets are raw data containing the actual target address of the target terminal, and are secondarily encapsulated by adding a new message header containing the proxy target address of the proxy service device based on the tunneling protocol of the network tunnel. The data sending end is a test terminal that remotely accesses the proxy service device, and the network tunnel is a virtual network channel between the proxy service device and the data sending end. The parsing module is used to parse the first data packet according to the decapsulation rules corresponding to the tunnel protocol of the network tunnel to obtain the original data; The sending module is used to transmit the original data to the public network through the network impairment device according to the actual target address, so that the network impairment device can perform network impairment processing on the original data and output the damaged data to the target terminal in the public network; the network impairment device receives the damaged response data returned by the target terminal through the public network, and sends the damaged response data to the test terminal through the network tunnel, so that the test terminal can analyze the response effect in a weak network environment based on the damaged response data; wherein, the original data is the test data, and both the test data and the original response data returned by the target terminal are processed by the same network impairment device.
9. The apparatus of claim 8, wherein, The device further includes: The connection control module is used to receive a connection request carrying connection verification information sent by the data sending end, verify the connection according to the connection verification information, and send a connection response to the data sending end after successful verification, so that the proxy service device and the data sending end can establish the network tunnel and communicate through the network tunnel.
10. A weak network simulation apparatus, characterized by, An application to a network impairment device, wherein the network impairment device is connected in series as a transparent bridge between a proxy service device and a public network; the device includes: The data input module is used to receive first raw data from the proxy service device and second raw data from the public network. The first raw data is the test data obtained by the proxy service device after decapsulating the secondary encapsulated data packet sent by the test terminal that remotely accesses the proxy service device through the network tunnel established on the public network. The second raw data is the raw response data returned by the target terminal. The data impairment module is used to perform network impairment processing on the first original data to obtain first impaired data, and to perform network impairment processing on the second original data to obtain second impaired data. The data output module is used to output the first damage data to the public network and the second damage data to the proxy service device, so that the proxy service device returns the second damage data to the test terminal through the network tunnel.
11. The apparatus of claim 10, wherein, The data impairment module is used to perform network impairment processing on the first original data, including: The data impairment module is used to determine the network impairment target strategy corresponding to the first original data according to the preset classification rules, and to perform network impairment processing on the first original data according to the network impairment target strategy.
12. The apparatus of claim 11, wherein, The device further includes: The policy update module is used to obtain network impairment parameters when a policy update instruction is received, and generate a new network impairment policy based on the network impairment parameters, or modify a pre-stored network impairment policy based on the network impairment parameters.
13. A weak network testing apparatus, characterized by, The device, applied to a testing terminal, includes: The sending module is used to send data packets to a remotely accessed proxy service device through a network tunnel established on a public network. The proxy service device then performs network impairment processing on the test data via a transparent bridge-type network impairment device connected between the proxy service device and the public network, and forwards the data packets to the target terminal according to the actual target address. The data packets are original data containing the actual target address of the target terminal, and are a first data packet that is re-encapsulated by adding a new header containing the proxy target address of the proxy service device based on the tunneling protocol of the network tunnel. The network tunnel is a virtual network channel between the proxy service device and the test terminal. The receiving module is used to receive the damaged response data forwarded by the proxy service device through the network tunnel; the damaged response data is the data that the proxy service device sends out after the original response data returned by the target terminal enters the network damage device through the public network for network damage processing. The analysis module is used to analyze the response effect in a weak network environment based on the response data after the damage, wherein the original data is the test data, and the test data and the response data returned by the target terminal are both processed by the same network damage device.
14. The apparatus of claim 13, wherein, The device further includes: The connection module is used to send a connection request to the proxy service device and establish a network tunnel with the proxy service device based on the connection response returned by the proxy service device.
15. An electronic device, comprising: The electronic device includes: Memory, used to store computer program products; A processor is configured to execute a computer program product stored in the memory, wherein, when the computer program product is executed, it implements the method described in any one of claims 1-2.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed, implement the method described in any one of claims 1-2.
17. An electronic device, comprising: The electronic device includes: Memory, used to store computer program products; A processor is configured to execute a computer program product stored in the memory, wherein, when the computer program product is executed, it implements the method described in any one of claims 3-5.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed, implement the method described in any one of claims 3-5.
19. A weak network simulation system, comprising: include: Proxy service devices and network impairment devices; The network impairment device is connected in series between the proxy service device and the public network; The proxy service device includes the device described in any one of claims 8 to 9, and the network damage device includes the device described in any one of claims 10 to 12.
20. A weak network testing system, comprising: include: Test terminals, proxy service devices, and network impairment devices; The network impairment device is connected in series between the proxy service device and the public network; the test terminal communicates with the proxy service device through the public network. The test terminal includes the device described in any one of claims 13-14, the proxy service device includes the device described in any one of claims 8-9, and the network impairment device includes the device described in any one of claims 10-12.
Citation Information
Patent Citations
Method and device for simulating network anomaly and testing automatic switching of database faults
CN105512343A
