Automated testing method, device, equipment and storage medium based on gateway-based quality of service binding
By constructing virtual protocol packets and setting bandwidth thresholds, the efficiency of gateway bandwidth testing is improved, and the problem of low testing efficiency in the prior art is solved.
Patent Information
- Application Number
- CN202510014017.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-06
AI Technical Summary
In the prior art, gateway bandwidth testing is inefficient, requiring multiple computers and complex networking environments, resulting in a long test.
By constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet, it is sent to the gateway under test to obtain trust, set a bandwidth threshold, and send a preset number of transmission control protocol packets to calculate the actual bandwidth to determine whether the bandwidth threshold is effective.
Simplifies the gateway service quality testing process, improves the efficiency of gateway bandwidth testing, and reduces test time and complexity.
Smart Images

Figure CN119420680B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gateway testing technology, and in particular to an automated testing method, device, equipment and storage medium based on gateway-based quality of service binding. Background Art
[0002] At present, when routers, gateways and other products are tested for bandwidth, they are tested manually or with other devices. During the test, multiple computers are required, the networking environment is complex, and the test takes a long time, resulting in low test efficiency. Therefore, how to improve the efficiency of gateway bandwidth testing is a problem that still needs to be solved.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide an automated testing method, device, equipment and storage medium based on gateway-based service quality binding, aiming to solve the technical problem of how to improve the efficiency of gateway bandwidth testing.
[0005] To achieve the above objectives, the present application proposes an automated testing method for gateway-based quality of service binding, the method comprising:
[0006] Constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet; sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; setting the bandwidth threshold of the gateway under test by quality of service; sending a preset number of transmission control protocol packets to the gateway under test, and calculating the actual bandwidth; judging whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automated test of gateway-based quality of service binding.
[0007] In one embodiment, the step of constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet includes:
[0008] Construct a virtual physical address and a virtual network address;
[0009] A virtual network control message protocol packet and a virtual address resolution protocol response packet are constructed according to the physical address and the network address.
[0010] In one embodiment, the step of sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test includes:
[0011] Sending the network control message protocol packet to the gateway under test;
[0012] After receiving the address resolution protocol request packet from the gateway under test, the address resolution protocol response packet is replied to the gateway under test to obtain the trust of the gateway under test.
[0013] In one embodiment, the step of setting the bandwidth threshold of the gateway under test by quality of service includes:
[0014] Obtaining the physical address in the network control message protocol packet;
[0015] The physical address is bound to a quality of service rule, and a bandwidth threshold of the gateway under test is set according to the quality of service and the physical address.
[0016] In one embodiment, the step of sending a preset number of transmission control protocol packets to the gateway under test and calculating the actual bandwidth includes:
[0017] constructing a preset number of transmission control protocol packets;
[0018] Sending the transmission control protocol packet to the local area network interface of the gateway under test through the wireless network, so that the channel bandwidth reaches a saturated state;
[0019] Receiving the transmission control protocol packet from the wide area network interface of the gateway under test through a wired network card;
[0020] The actual bandwidth is calculated according to the size of the transmission control protocol packets received per second.
[0021] In one embodiment, the step of constructing a preset number of transmission control protocol packets includes:
[0022] Obtaining the physical address and network address in the network control message protocol packet;
[0023] Determine the physical address and the network address as source addresses;
[0024] A preset number and preset data are obtained, and the preset number of transmission control protocol packets are constructed according to the source address and the preset data.
[0025] In one embodiment, the step of determining whether the bandwidth threshold is effective according to the actual bandwidth includes:
[0026] Comparing whether the actual bandwidth is consistent with the bandwidth threshold;
[0027] If they are consistent, the bandwidth threshold is effective; if they are inconsistent, the bandwidth threshold is not effective.
[0028] In addition, to achieve the above purpose, the present application also proposes an automated testing device for gateway-based quality of service binding, the automated testing device for gateway-based quality of service binding comprising:
[0029] A construction module, used for constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet;
[0030] A sending module, used for sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test;
[0031] A setting module, used to set the bandwidth threshold of the gateway under test through the quality of service;
[0032] A calculation module, used to send a preset number of transmission control protocol packets to the gateway under test and calculate the actual bandwidth;
[0033] The judgment module is used to judge whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automatic test of the gateway-based service quality binding.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes an automated testing device for gateway-based quality of service binding, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the automated testing method for gateway-based quality of service binding as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the automated testing method for gateway-based service quality binding as described above are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the automated testing method of gateway-based service quality binding as described above.
[0037] The present application provides an automated testing method for gateway-based quality of service binding. The present application constructs a virtual network control message protocol packet and a virtual address resolution protocol response packet; sends the network control message protocol packet and the address resolution protocol response packet to a gateway under test to obtain the trust of the gateway under test; sets a bandwidth threshold of the gateway under test according to the quality of service; sends a preset number of transmission control protocol packets to the gateway under test and calculates the actual bandwidth; determines whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automated testing of gateway-based quality of service binding.
[0038] In summary, the present application simplifies the gateway-based service quality testing process and improves the efficiency of gateway bandwidth testing by constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A flowchart of the first embodiment of the automated testing method for gateway-based quality of service binding provided by the present application;
[0042] Figure 2 A schematic diagram of a connection method provided in Example 1 of an automated testing method for gateway-based quality of service binding of the present application;
[0043] Figure 3 A schematic diagram of the ICMP packet sending process provided in Example 1 of the automated testing method for gateway-based quality of service binding of the present application;
[0044] Figure 4 A schematic diagram of the flow of an ARP request packet provided in Embodiment 1 of the automated testing method for gateway-based quality of service binding of the present application;
[0045] Figure 5 A schematic diagram of the sending process of an ICMP response packet provided in Example 1 of the automated testing method for gateway-based quality of service binding of the present application;
[0046] Figure 6 A flow chart of the second embodiment of the automated testing method for gateway-based quality of service binding provided by the present application;
[0047] Figure 7 A schematic diagram of the TCP packet sending process provided in Example 2 of the automated testing method for gateway-based quality of service binding of the present application;
[0048] Figure 8 This is a schematic diagram of the module structure of an automated testing device based on gateway-based quality of service binding according to an embodiment of the present application;
[0049] Fig. 9This is a schematic diagram of the device structure of the hardware operating environment involved in the automated testing method for gateway-based service quality binding in an embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] The main solution of the present application is to construct a virtual network control message protocol packet and a virtual address resolution protocol response packet; send the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; set the bandwidth threshold of the gateway under test through the quality of service; send a preset number of transmission control protocol packets to the gateway under test and calculate the actual bandwidth; determine whether the bandwidth threshold is effective based on the actual bandwidth to complete the automated test of gateway-based quality of service binding.
[0054] At present, when routers, gateways and other products are tested for bandwidth, they are tested manually or with other devices. During the test, multiple computers are required, the networking environment is complex, and the test takes a long time, resulting in low test efficiency. Therefore, how to improve the efficiency of gateway bandwidth testing is a problem that still needs to be solved.
[0055] The present application simplifies the gateway-based service quality testing process and improves the efficiency of gateway bandwidth testing by constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet.
[0056] Based on this, the embodiment of the present application provides an automated testing method for gateway-based quality of service binding, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the automated testing method for gateway-based quality of service binding of the present application.
[0057] In this embodiment, the gateway-based service quality binding automated testing method includes steps S10 to S50:
[0058] Step S10: constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet;
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an automated test computer based on gateway quality of service binding, etc. The following takes the automated test computer based on gateway quality of service binding as an example to illustrate this embodiment and the following embodiments.
[0060] It should be noted that before testing the gateway, the environment needs to be built. The environment building process of this embodiment is simple and can be referred to Figure 2 , you need to prepare a dual network card computer (wired network card and wireless network card). The computer's wireless network card communicates with the gateway's local area network interface (LAN port) through the wireless access point (Access Point, AP), and communicates with the gateway's wide area network interface (WAN port) through the wired network card.
[0061] It should be noted that the Internet Control Message Protocol (ICMP) and Address Resolution Protocol (ARP) response packets are both network layer protocols. ICMP packets are mainly used to transmit control messages between hosts and gateways. ARP packets are a protocol used to convert IP addresses (network addresses) and MAC addresses (physical addresses).
[0062] In a feasible manner, the step of constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet includes:
[0063] Construct a virtual physical address and a virtual network address;
[0064] A virtual network control message protocol packet and a virtual address resolution protocol response packet are constructed according to the physical address and the network address.
[0065] It is understandable that when testing a gateway, it is more efficient to use a fake physical address and a fake network address for testing than to use multiple devices for testing. In this embodiment, automation is developed in Python. The main Python modules used are: paramikl, scapy, speedtest-cli, openxl, threading, etc. The automated test computer based on the quality of service binding of the gateway is connected to the gateway under test through the python library paramikb module. And in the gateway, the quality of service (Quality of Service, QOS) function is turned on by wire. It is connected to the DUT device (gateway under test) by wire through the paramikl module. When constructing the ICMP packet, it is necessary to construct a virtual mac address and ip address first, and then construct the ICMP packet; and use the virtual mac address and ip address and the ARP response content to construct an ARP response packet.
[0066] Step S20: sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test;
[0067] It is understandable that after the constructed ICMP packet and ARP response packet are sent to the gateway under test, the trust of the gateway under test can be obtained so that the gateway bandwidth can be tested through the virtual MAC address and IP address.
[0068] In a feasible manner, the step of sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test includes:
[0069] Sending the network control message protocol packet to the gateway under test;
[0070] After receiving the address resolution protocol request packet from the gateway under test, the address resolution protocol response packet is replied to the gateway under test to obtain the trust of the gateway under test.
[0071] It is understandable that an ICMP packet can be forged through the scapy module and sent to the DUT (gateway under test). The specific process can be referred to Figure 3 , Figure 3The real mac address of the computer is B4-2E-99-EB-25-0A, and the ip address is 192.168.1.50. The mac address of the ICMP packet forged by the scapy module is B4-2E-99-EB-11-11, and the ip address is 192.168.1.51. It is sent to the gateway through a wireless access point (AP) by broadcasting. Since the mac address table of the tested gateway does not store the mac address in the ICMP packet, the tested gateway will send an ARP query packet in the form of a broadcast to inquire about the ip address corresponding to the mac address in the ICMP packet. For the specific process, please refer to Figure 4 , Figure 4 The gateway under test sends an ARP query packet to inquire about the IP address corresponding to the MAC address. At this time, the automated test computer based on the gateway's service quality binding can reply to the gateway under test by sending an ARP response packet. Figure 5 , Figure 5 The IP address corresponding to B4-2E-99-EB-11-11 in the ARP reply packet is 192.168.1.51. Since the automated test computer based on gateway-based service quality binding is directly connected to the gateway under test, the gateway under test will record the MAC address and IP address in the ICMP packet in the ARP table after receiving the ARP response packet, and will respond to the request of the ICMP packet and reply with an ICMP reply packet. At this time, the ARP spoofing is completed and the trust of the gateway under test is obtained.
[0072] Step S30: Setting the bandwidth threshold of the gateway under test according to the quality of service;
[0073] It is understandable that since the automated test computer based on gateway-based service quality binding has been connected to the gateway under test through the python library paramikb module, commands can be sent to the gateway under test through the background to add the qos function based on mac binding and enable bandwidth size limit.
[0074] In a feasible manner, the step of setting the bandwidth threshold of the gateway under test by quality of service includes:
[0075] Obtaining the physical address in the network control message protocol packet;
[0076] The physical address is bound to a quality of service rule, and a bandwidth threshold of the gateway under test is set according to the quality of service and the physical address.
[0077] It is understandable that when setting the bandwidth, the physical address in the ICMP packet is used to set the bandwidth threshold in order to complete the bandwidth test.
[0078] Step S40: sending a preset number of transmission control protocol packets to the gateway under test, and calculating the actual bandwidth;
[0079] It is understandable that after gaining the trust of the gateway under test, a preset number of transmission control protocol packets may be sent to the gateway under test, with the purpose of filling up the channel bandwidth and testing whether the bandwidth threshold set by QOS is effective.
[0080] Step S50: judging whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automated test of gateway-based quality of service binding.
[0081] It is understandable that after calculating the actual bandwidth, the actual bandwidth and the bandwidth threshold can be compared to determine whether it is effective. Specifically, the actual bandwidth and the bandwidth threshold can be compared to determine whether they are consistent; if they are consistent, the bandwidth threshold is effective, and if they are inconsistent, the bandwidth threshold is not effective.
[0082] This embodiment constructs a virtual network control message protocol packet and a virtual address resolution protocol response packet; sends the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; sets the bandwidth threshold of the gateway under test according to the quality of service; sends a preset number of transmission control protocol packets to the gateway under test and calculates the actual bandwidth; determines whether the bandwidth threshold is effective according to the actual bandwidth to complete the automated test of gateway-based quality of service binding.
[0083] In summary, this embodiment simplifies the gateway-based service quality test process and improves the efficiency of the gateway bandwidth test by constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet.
[0084] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 6 , step S40 includes steps S401 to S404:
[0085] Step S401: constructing a preset number of transmission control protocol packets;
[0086] It should be noted that the Transmission Control Protocol (TCP) packet is a connection-oriented, reliable, byte stream-based transport layer communication protocol that enables paired application processes in an interconnected computer communication network to transmit byte streams by relying on TCP to provide reliable communication services.
[0087] In a feasible manner, the step of constructing a preset number of transmission control protocol packets includes:
[0088] Obtaining the physical address and network address in the network control message protocol packet;
[0089] Determine the physical address and the network address as source addresses;
[0090] A preset number and preset data are obtained, and the preset number of transmission control protocol packets are constructed according to the source address and the preset data.
[0091] It can be understood that the TCP packet is constructed with the virtual MAC address and IP address in the ICMP packet as the source address and the MAC address of the automated test computer bound to the gateway's quality of service as the target address.
[0092] Step S402: sending the transmission control protocol packet to the local area network interface of the gateway under test through the wireless network, so that the channel bandwidth reaches a saturated state;
[0093] It is understandable that the automated test computer based on the gateway's service quality binding sends TCP packets to the gateway under test through the wireless network, and then receives them through the wired network card. This is equivalent to the gateway under test taking on the role of forwarding, so it can be calculated whether the bandwidth threshold of the gateway under test is effective.
[0094] Step S403: receiving the transmission control protocol packet from the wide area network interface of the gateway under test through the wired network card;
[0095] For the specific process of sending and receiving TCP packets, please refer to Figure 7 , Figure 7 In the automated test of gateway-based service quality binding, the MAC address of the computer wireless network card is B4-2E-99-EB-25-0A, the IP address is 192.168.1.50, the MAC address of the wired network card is B4-2E-99-66-66-66, the IP address is 10.0.0.100, and the MAC address of the gateway WAN port network card is B4-2E-99-33-33-33, and the IP address is 10.0.0.1.
[0096] Step S404: Calculate the actual bandwidth according to the size of the transmission control protocol packets received per second.
[0097] It is understandable that a large number of TCP packets forged by threading and scapy modules carry fixed data (1460 bytes) to fill up the channel bandwidth. The specific calculation process can be referred to Figure 7 , Figure 7 The size of all packets received per second is compared with the theoretical download data. The theoretical download speed (KBps) is the bandwidth (Mbps) multiplied by 1024 and divided by 8, which is the actual bandwidth.
[0098] This embodiment constructs a preset number of transmission control protocol packets; sends the transmission control protocol packets to the local area network interface of the gateway under test through a wireless network, so that the channel bandwidth reaches a saturated state; receives the transmission control protocol packets from the wide area network interface of the gateway under test through a wired network card; and calculates the actual bandwidth based on the size of the transmission control protocol packets received per second.
[0099] In summary, this embodiment obtains the actual bandwidth of the gateway under test by constructing and sending a TCP packet, so as to subsequently determine whether the setting of the bandwidth threshold is effective, thereby improving the efficiency of the gateway bandwidth test.
[0100] This application also provides an automated testing device based on gateway-based service quality binding, please refer to Figure 8 , the gateway-based service quality binding automated testing device comprises:
[0101] A construction module 10, used to construct a virtual network control message protocol packet and a virtual address resolution protocol response packet;
[0102] A sending module 20, configured to send the network control message protocol packet and the address resolution protocol response packet to the gateway under test, so as to obtain the trust of the gateway under test;
[0103] A setting module 30, used to set the bandwidth threshold of the gateway under test according to the quality of service;
[0104] A calculation module 40, configured to send a preset number of transmission control protocol packets to the gateway under test and calculate the actual bandwidth;
[0105] The judgment module 50 is used to judge whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automatic test of the gateway-based service quality binding.
[0106] This embodiment constructs a virtual network control message protocol packet and a virtual address resolution protocol response packet; sends the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; sets the bandwidth threshold of the gateway under test according to the quality of service; sends a preset number of transmission control protocol packets to the gateway under test and calculates the actual bandwidth; determines whether the bandwidth threshold is effective according to the actual bandwidth to complete the automated test of gateway-based quality of service binding.
[0107] In summary, this embodiment simplifies the gateway-based service quality test process and improves the efficiency of the gateway bandwidth test by constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet.
[0108] In one embodiment, the construction module 10 is further used to construct a virtual physical address and a virtual network address; and to construct a virtual network control message protocol packet and a virtual address resolution protocol response packet according to the physical address and the network address.
[0109] In one embodiment, the sending module 20 is further used to send the network control message protocol packet to the gateway under test; after receiving the address resolution protocol request packet from the gateway under test, reply the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test.
[0110] In one embodiment, the setting module 30 is further used to obtain the physical address in the network control message protocol packet; bind the physical address to the quality of service regulation, and set the bandwidth threshold of the gateway under test through the quality of service and the physical address.
[0111] In one embodiment, the calculation module 40 is further used to construct a preset number of transmission control protocol packets;
[0112] The transmission control protocol packet is sent to the local area network interface of the gateway under test through the wireless network, so that the channel bandwidth reaches a saturated state; the transmission control protocol packet from the wide area network interface of the gateway under test is received through the wired network card; and the actual bandwidth is calculated according to the size of the transmission control protocol packet received per second.
[0113] In one embodiment, the calculation module 40 is also used to obtain the physical address and the network address in the network control message protocol packet; determine the physical address and the network address as the source address; obtain a preset number and preset data, and construct the preset number of transmission control protocol packets based on the source address and the preset data.
[0114] In one embodiment, the judgment module 50 is further used to compare whether the actual bandwidth is consistent with the bandwidth threshold; if they are consistent, the bandwidth threshold is effective; if they are inconsistent, the bandwidth threshold is not effective.
[0115] The automated testing device based on gateway quality of service binding provided by the present application adopts the automated testing method based on gateway quality of service binding in the above-mentioned embodiment, which can solve the technical problem of how to improve the efficiency of gateway bandwidth testing. Compared with the prior art, the beneficial effects of the automated testing device based on gateway quality of service binding provided by the present application are the same as the beneficial effects of the automated testing method based on gateway quality of service binding provided by the above-mentioned embodiment, and the other technical features in the automated testing device based on gateway quality of service binding are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0116] The present application provides an automated testing device for gateway-based quality of service binding, and the automated testing device for gateway-based quality of service binding includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automated testing method for gateway-based quality of service binding in the above-mentioned embodiment one.
[0117] Reference below Fig. 9 , which shows a schematic diagram of the structure of an automated test device for gateway-based quality of service binding suitable for implementing the embodiment of the present application. The automated test device for gateway-based quality of service binding in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The gateway-based service quality binding automated testing equipment shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Fig. 9As shown, the automated test equipment based on the quality of service binding of the gateway may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the automated test equipment based on the quality of service binding of the gateway are also stored in the RAM 1004. The processing device 1001, the ROM 1002 and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the gateway-based quality of service binding automated test equipment to communicate wirelessly or wired with other devices to exchange data. Although the figure shows the gateway-based quality of service binding automated test equipment with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0120] The automated test device based on gateway quality of service binding provided by the present application adopts the automated test method based on gateway quality of service binding in the above embodiment, which can solve the technical problem of how to improve the efficiency of gateway bandwidth testing. Compared with the prior art, the beneficial effects of the automated test device based on gateway quality of service binding provided by the present application are the same as the beneficial effects of the automated test method based on gateway quality of service binding provided by the above embodiment, and the other technical features of the automated test device based on gateway quality of service binding are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0123] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the automated testing method for gateway-based quality of service binding in the above-mentioned embodiment.
[0124] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0125] The computer-readable storage medium may be included in the automated test device based on gateway quality of service binding; or may exist independently without being assembled into the automated test device based on gateway quality of service binding.
[0126] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the automated test device based on the gateway quality of service binding, the automated test device based on the gateway quality of service binding: constructs a virtual network control message protocol packet and a virtual address resolution protocol response packet; sends the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; sets the bandwidth threshold of the gateway under test through the quality of service; sends a preset number of transmission control protocol packets to the gateway under test and calculates the actual bandwidth; determines whether the bandwidth threshold is effective according to the actual bandwidth to complete the automated test based on the gateway quality of service binding.
[0127] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0130] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned automated testing method for quality of service binding based on gateways, and can solve the technical problem of how to improve the efficiency of gateway bandwidth testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the automated testing method for quality of service binding based on gateways provided by the above-mentioned embodiments, and will not be repeated here.
[0131] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned automated testing method for gateway-based service quality binding when executed by a processor.
[0132] The computer program product provided by the present application can solve the technical problem of how to improve the efficiency of gateway bandwidth testing. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the automated testing method based on gateway quality of service binding provided by the above embodiment, which will not be repeated here.
[0133] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An automated testing method for gateway-based quality of service binding, characterized in that: The method includes: Constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet; Sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; Setting a bandwidth threshold of the gateway under test by quality of service; Send a preset number of TCP packets to the gateway under test and calculate the actual bandwidth; Determining whether the bandwidth threshold is effective according to the actual bandwidth to complete the automated test of gateway-based quality of service binding; The steps of constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet include: Construct a virtual physical address and a virtual network address; A virtual network control message protocol packet and a virtual address resolution protocol response packet are constructed according to the physical address and the network address.
2. The method according to claim 1, characterized in that The step of sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test includes: Sending the network control message protocol packet to the gateway under test; After receiving the address resolution protocol request packet from the gateway under test, the address resolution protocol response packet is replied to the gateway under test to obtain the trust of the gateway under test.
3. The method according to claim 1, characterized in that The step of setting the bandwidth threshold of the gateway under test by quality of service comprises: Obtaining the physical address in the network control message protocol packet; The physical address is bound to a quality of service rule, and a bandwidth threshold of the gateway under test is set according to the quality of service and the physical address.
4. The method according to claim 1, characterized in that The step of sending a preset number of transmission control protocol packets to the gateway under test and calculating the actual bandwidth includes: constructing a preset number of transmission control protocol packets; Sending the transmission control protocol packet to the local area network interface of the gateway under test through the wireless network, so that the channel bandwidth reaches a saturated state; Receiving the transmission control protocol packet from the wide area network interface of the gateway under test through a wired network card; The actual bandwidth is calculated according to the size of the transmission control protocol packets received per second.
5. The method according to claim 4, characterized in that The step of constructing a preset number of transmission control protocol packets comprises: Obtaining the physical address and network address in the network control message protocol packet; Determine the physical address and the network address as source addresses; A preset number and preset data are obtained, and the preset number of transmission control protocol packets are constructed according to the source address and the preset data.
6. The method according to claim 1, characterized in that The step of determining whether the bandwidth threshold is effective according to the actual bandwidth includes: Comparing whether the actual bandwidth is consistent with the bandwidth threshold; If they are consistent, the bandwidth threshold is effective; if they are inconsistent, the bandwidth threshold is not effective.
7. An automated testing device for gateway-based quality of service binding, characterized in that: The device comprises: A construction module, used for constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet; A sending module, used for sending the network control message protocol packet and the address resolution protocol response packet to the gateway under test to obtain the trust of the gateway under test; A setting module, used to set the bandwidth threshold of the gateway under test through the quality of service; A calculation module, used to send a preset number of transmission control protocol packets to the gateway under test and calculate the actual bandwidth; A judgment module, used to judge whether the bandwidth threshold is effective according to the actual bandwidth, so as to complete the automated test of gateway-based service quality binding; The steps of constructing a virtual network control message protocol packet and a virtual address resolution protocol response packet include: Construct a virtual physical address and a virtual network address; A virtual network control message protocol packet and a virtual address resolution protocol response packet are constructed according to the physical address and the network address.
8. An automated test device for quality of service binding based on a gateway, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the automated testing method for gateway-based quality of service binding as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the automated testing method for gateway-based quality of service binding according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for processing address analysis protocol request message
CN101257517A
Bandwidth testing method and system applied under other software interference condition or test equipment poor hardware performance condition
CN107508726A
Dial testing method and device, electronic equipment and storage medium
CN118740665A