Virtual router testing method, apparatus, device, and medium

By utilizing network interface card (NIC) communication connections to automate parameter configuration during virtual router testing, the problems of low testing efficiency and inaccurate results in virtual network device testing are solved, ensuring the efficiency and accuracy of the testing process.

CN117014350BActive Publication Date: 2026-03-17CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing virtual network device testing methods are inefficient and produce inaccurate results, mainly due to mismatched parameter configurations.

Method used

By establishing a network interface communication connection between the test management program and the test execution program, packet sending parameters and routing forwarding parameters are automatically configured to ensure parameter matching during virtual router testing, and test results are obtained through the test management program.

Benefits of technology

It enables efficient and accurate virtual router testing, avoids the impact of parameter mismatch, and improves testing efficiency and result accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117014350B_ABST
    Figure CN117014350B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and medium for testing virtual routers. The method is applied to a test management program sub-device, which is configured with a preset test program. The method includes: acquiring multiple preset packet sending parameter configuration information, and performing the following operations based on each packet sending parameter configuration information to obtain test results of the virtual router under each packet sending parameter configuration information: controlling a test execution program to perform routing forwarding configuration on the virtual router that matches the packet sending parameter configuration information; controlling the test execution program to run the virtual router after the routing forwarding configuration is completed; configuring packet sending parameters for the preset test program and controlling the preset test program to execute tests on the virtual router; and generating test results of the virtual router under the packet sending parameter configuration information. The method of this application can efficiently and accurately test virtual routers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a method, apparatus, device, and medium for testing virtual routers. Background Technology

[0002] Virtual network devices implement the same functions as hardware network devices using software. Similar to hardware network devices, virtual network devices also require packet forwarding performance testing. Packet sending test software creates virtual packets and sends them to the virtual network device's data receiving port. After processing by the virtual network device, the packets are then sent from the virtual network device's data sending port to the receiving port of the packet receiving test software. The packet forwarding performance of the virtual network device is determined based on the amount of packets sent and received.

[0003] When performing performance testing on virtual network devices, the parameter configurations of the virtual network devices need to match those of the packet sending test software. Currently, this is mainly done manually by staff in both the virtual network devices and the packet sending test software, followed by manual testing and recording of the results. Because performance testing involves numerous parameters, manual configuration is prone to errors, leading to mismatches between the virtual network device and packet sending test software parameters, thus affecting the test results.

[0004] In summary, existing virtual network device testing methods suffer from low efficiency and inaccurate test results. Summary of the Invention

[0005] This application provides a virtual router testing method, apparatus, device, and medium to solve the problems of low efficiency and inaccurate test results in existing virtual network device testing methods.

[0006] According to a first aspect of this application, a virtual router testing method is provided. The method is applied to a test management program sub-device, which is configured with a test management program and is located within a test management device. The test management device further includes a test program sub-device configured with a preset test program. The test management program is configured with a first control network interface card (NIC), and the preset test program is configured with a first test NIC. The test management device is located within a preset network architecture, which also includes a test execution device. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program. The test execution program is configured with a second control network interface card (NIC), and the virtual router is configured with a second test NIC. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control NICs. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test NICs.

[0007] The method includes:

[0008] Obtain multiple preset packet sending parameter configurations, and based on each packet sending parameter configuration, perform the following operations to obtain the test results of the virtual router under each packet sending parameter configuration:

[0009] The control test execution program configures the virtual router to match the packet sending parameter configuration information, and then runs the virtual router after the routing configuration is completed.

[0010] The preset test program is configured with packet sending parameters according to the packet sending parameter configuration information, and after the packet sending parameter configuration is completed, the preset test program is controlled to perform a test on the virtual router; during the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets.

[0011] In response to the completion of the virtual router test, the test execution program is controlled to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program;

[0012] Read the round-trip data packet transmission and reception records of the preset test program, and generate the test results of the virtual router under the packet sending parameter configuration information. The test results include the routing forwarding records and the round-trip data packet transmission and reception records.

[0013] According to a second aspect of this application, a virtual router testing method is provided. The method is applied to a test execution program sub-device, which is configured with a test execution program and is located within a test execution device. The test execution device also includes a virtual router. The test execution program is configured with a second control network interface card (NIC), and the virtual router is configured with a second test network interface card (NIC). The test execution device is located within a preset network architecture, which further includes a test management device. The test management device includes a test management program sub-device and a test program sub-device. The test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program. The test management program is configured with a first control network interface card (NIC), and the preset test program is configured with a first test network interface card (NIC). Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network interfaces. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network interfaces.

[0014] The method includes:

[0015] In response to the control of the test management program, the virtual router is configured with routing and forwarding information that matches the packet sending parameter configuration information. After the configuration is completed, the virtual router is run in response to the control of the test management program. During the operation of the virtual router, the virtual router communicates with the first test network card through the second test network card to send and receive test round-trip data packets.

[0016] In response to the control of the test management program, the routing and forwarding records of the virtual router are read and sent to the test management program.

[0017] According to a third aspect of this application, a virtual router testing apparatus is provided. The apparatus is applied to a test management program sub-device, which is configured with a test management program and is located within a test management device. The test management device further includes a test program sub-device configured with a preset test program. The test management program is configured with a first control network interface card (NIC), and the preset test program is configured with a first test NIC. The test management device is located within a preset network architecture, which further includes a test execution device. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program. The test execution program is configured with a second control network interface card (NIC), and the virtual router is configured with a second test NIC. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network interfaces. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test NICs.

[0018] The device includes:

[0019] The acquisition module is used to acquire multiple preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, perform the following operations to obtain the test results of the virtual router under each packet sending parameter configuration information:

[0020] The control test execution program configures the virtual router to match the packet sending parameter configuration information, and then runs the virtual router after the routing configuration is completed.

[0021] The preset test program is configured with packet sending parameters according to the packet sending parameter configuration information, and after the packet sending parameter configuration is completed, the preset test program is controlled to perform a test on the virtual router; during the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets.

[0022] In response to the completion of the virtual router test, the test execution program is controlled to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program;

[0023] Read the round-trip data packet transmission and reception records of the preset test program, and generate the test results of the virtual router under the packet sending parameter configuration information. The test results include the routing forwarding records and the round-trip data packet transmission and reception records.

[0024] According to a fourth aspect of this application, a virtual router testing apparatus is provided. The apparatus is applied to a test execution program sub-device, which is configured with a test execution program and is located within a test execution device. The test execution device also includes a virtual router. The test execution program is configured with a second control network interface card (NIC), and the virtual router is configured with a second test network interface card (NIC). The test execution device is located within a preset network architecture, which further includes a test management device. The test management device includes a test management program sub-device and a test program sub-device. The test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program. The test management program is configured with a first control network interface card (NIC), and the preset test program is configured with a first test network interface card (NIC). Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network interfaces. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network interfaces.

[0025] The device includes:

[0026] The first response module is used to respond to the control of the test management program, configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information, and after the configuration is completed, run the virtual router in response to the control of the test management program; during the operation of the virtual router, it communicates with the first test network card through the second test network card to send and receive test round-trip data packets;

[0027] The second response module is used to respond to the control of the test management program, read the routing and forwarding records of the virtual router, and send the routing and forwarding records to the test management program.

[0028] According to a fifth aspect of this application, a test management program sub-device is provided, comprising: a memory, a processor, and a transceiver;

[0029] The memory, the processor, and the transceiver circuitry are interconnected;

[0030] The memory stores computer-executed instructions;

[0031] The transceiver is used to send and receive data;

[0032] The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect.

[0033] According to a sixth aspect of this application, a test executor sub-device is provided, comprising: a memory, a processor, and a transceiver;

[0034] The memory, the processor, and the transceiver circuitry are interconnected;

[0035] The memory stores computer-executed instructions;

[0036] The transceiver is used to send and receive data;

[0037] The processor executes computer execution instructions stored in the memory to implement the method as described in the second aspect.

[0038] According to a seventh aspect of this application, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, are used to implement the method as described in the first or second aspect.

[0039] According to an eighth aspect of this application, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in the first or second aspect.

[0040] The virtual router testing method, apparatus, device, and medium provided in this application, in a preset network architecture, include a test management device and a test execution device. The test management device includes a test management program sub-device and a test program sub-device. The test management program sub-device is configured with a test management program and a first control network interface card (NIC). The test program sub-device is configured with a preset test program and a first test NIC. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program and a second control network interface card (NIC). The virtual router is configured with a second test NIC. The test management program and the test execution program interact through a communication connection between the first and second control NICs. The preset test program and the virtual router interact through a communication connection between the first and second test NICs.

[0041] The virtual testing method is applied to the test management program sub-device and includes: acquiring multiple preset packet sending parameter configuration information, and performing the following operations based on each packet sending parameter configuration information to obtain the test results of the virtual router under each packet sending parameter configuration information: controlling the test execution program to perform routing and forwarding configuration on the virtual router that matches the packet sending parameter configuration information, and controlling the test execution program to run the virtual router after the routing and forwarding configuration is completed; configuring the packet sending parameters of the preset test program according to the packet sending parameter configuration information, and controlling the preset test program to execute the test on the virtual router after the packet sending parameter configuration is completed; during the execution of the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets; in response to the end of the test on the virtual router, controlling the test execution program to read the routing and forwarding records of the virtual router and sending the routing and forwarding records to the test management program; reading the round-trip data packet sending and receiving records of the preset test program and generating the test results of the virtual router under the packet sending parameter configuration information, the test results including routing and forwarding records and round-trip data packet sending and receiving records.

[0042] The virtual router testing method is applied to a test execution program sub-device and includes: in response to the control of a test management program, configuring the virtual router to match the packet sending parameter configuration information, and after the configuration is completed, running the virtual router in response to the control of the test management program; during the operation of the virtual router, communicating with the first test network card through the second test network card to send and receive test round-trip data packets; and in response to the control of the test management program, reading the routing and forwarding records of the virtual router and sending the routing and forwarding records to the test management program.

[0043] The virtual router testing method, apparatus, device, and medium provided in this application, because the test management program obtains multiple preset packet sending parameter configuration information, and for each packet sending parameter configuration information, the test management program configures the packet sending parameters of the preset test program according to the packet sending parameter configuration information, and controls the test execution program to configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information, can avoid mismatch between the parameter configuration of the preset test program and the virtual router. At the same time, the test management program can control the preset test program to execute tests on the virtual router, and can obtain the forwarding records of the virtual router and the round-trip data packet transmission and reception records of the preset test program. Therefore, the test management program can efficiently test the virtual router and obtain the test results of the virtual router under each packet sending parameter configuration information. Furthermore, because the test management program and the test execution program interact through the first control network card and the second control network card, and the preset test program and the virtual router interact through the first test network card and the second test network card, the interaction between the test management program and the test execution program will not affect the performance of the virtual router, ensuring the accuracy of the test results for the virtual router. In summary, the solution proposed in this application can efficiently and accurately test virtual routers and obtain performance test results for virtual routers. Attached Figure Description

[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0045] Figure 1 This is a network architecture diagram corresponding to the application scenario of the virtual router testing method provided in the embodiments of this application;

[0046] Figure 2 This is a flowchart illustrating the virtual router testing method provided in Embodiment 1 of this application;

[0047] Figure 3 This is a flowchart illustrating the virtual router testing method provided in Embodiment 2 of this application;

[0048] Figure 4 This is a flowchart illustrating the virtual router testing method provided in Embodiment 3 of this application;

[0049] Figure 5 This is a schematic diagram of the structure of the virtual router testing device provided in Embodiment 5 of this application;

[0050] Figure 6 This is a schematic diagram of the structure of the test management program sub-device provided in Embodiment Six of this application;

[0051] Figure 7This is a schematic diagram of the structure of the test execution program sub-device provided according to Embodiment 7 of this application.

[0052] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0053] The terms "first," "second," "third," etc., used in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0054] The prior art involved in this application will be described in detail and analyzed below.

[0055] A virtual router is a form of Network Functions Virtualization (NFV). A virtual router can perform the same functions as hardware network devices through software functions, such as routing, switching, security, and Virtual Private Network (VPN), to provide network communication services to users.

[0056] Both hardware network devices and virtual network devices require performance testing. Hardware devices use dedicated hardware packet sending test equipment, while virtual network devices use network testing tools such as iperf, pktgen, and netperf. The hardware packet sending test equipment or network testing tool creates packets with different physical MAC addresses, different Internet Protocol (IP) addresses, different ports, and different communication protocols, and sends them to the data receiving port of the device under test. After processing by the device under test, the packets are then sent from the device under test's data sending port to the receiving packet test hardware or testing tool.

[0057] Performance testing of virtual network devices requires obtaining parameters such as throughput, packet loss rate, and full-duplex line-speed forwarding capability. Testing different performance parameters requires different configurations for the virtual network device and network testing tools. Currently, virtual network devices and network testing tools are typically configured on different hardware devices. When testing different performance parameters, operators configure matching parameters separately in the virtual network device and the network testing tool. For example, to test the pure routing forwarding performance of a virtual router, such as Source Address Translation (SNAT) performance, the source IP address range of the test packets generated by the network testing tool and the IP address range for source address translation performed by the virtual network device need to be configured. Because operators need to manually configure matching parameters in both the virtual network device and the network testing tool, and there are many parameters to configure, errors are prone to occur. Incompatibility between the network testing tool and the virtual network device configuration may affect the test results. Furthermore, operators also need to manually record the test results after the test, leading to low testing efficiency.

[0058] In summary, existing virtual network device testing methods suffer from low efficiency and inaccurate test results.

[0059] In addressing the problems in existing technologies, the inventors, through creative research, have developed a method to improve the testing efficiency of virtual network devices. Furthermore, to ensure parameter matching between the virtual network device and the network testing tool during testing, the packet sending parameter configuration information in both the virtual network device and the network testing tool can be pre-defined for the performance parameters to be tested. This ensures that the configurations of the virtual network device and the network testing tool match when testing the same performance parameter, guaranteeing accurate test results. Additionally, an automated testing process can be pre-configured to sequentially test different performance parameters and output the results, reducing manual intervention and improving testing efficiency and accuracy.

[0060] Therefore, the inventors propose a virtual router testing method, which is applied to a test management program sub-device. The test management program sub-device is configured with a test management program and is located within a test management device. The test management device also includes a test program sub-device configured with a preset test program. The test management program is configured with a first control network card, and the preset test program is configured with a first test network card. The test management device is located within a preset network architecture, which also includes a test execution device. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program. The test execution program is configured with a second control network card, and the virtual router is configured with a second test network card. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network cards. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network cards. The virtual router testing method of this application includes: obtaining multiple preset packet sending parameter configuration information, and performing the following operations based on each packet sending parameter configuration information to obtain the test results of the virtual router under each packet sending parameter configuration information: controlling the test execution program to perform routing forwarding configuration on the virtual router that matches the packet sending parameter configuration information, and controlling the test execution program to run the virtual router after the routing forwarding configuration is completed; configuring the packet sending parameters of the preset test program according to the packet sending parameter configuration information, and controlling the preset test program to perform the test on the virtual router after the packet sending parameter configuration is completed; during the execution of the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets; in response to the end of the test on the virtual router, controlling the test execution program to read the routing forwarding record of the virtual router and sending the routing forwarding record to the test management program; reading the round-trip data packet sending and receiving records of the preset test program, and generating the test results of the virtual router under the packet sending parameter configuration information, the test results including routing forwarding records and round-trip data packet sending and receiving records. Because the test management program obtains multiple preset packet sending parameter configurations, and for each packet sending parameter configuration, the test management program configures the preset test program according to the packet sending parameter configuration, and controls the test execution program to configure the virtual router to perform routing and forwarding configurations that match the packet sending parameter configuration, mismatches between the preset test program and the virtual router's parameter configurations can be avoided. Simultaneously, the test management program can control the preset test program to execute tests on the virtual router and can obtain the virtual router's forwarding records and the preset test program's round-trip data packet transmission and reception records. Therefore, the test management program can efficiently test the virtual router and obtain test results for the virtual router under various packet sending parameter configurations.Furthermore, since the test management program and the test execution program interact through the first control network card and the second control network card, and the preset test program interacts with the virtual router through the first test network card and the second test network card, the interaction between the test management program and the test execution program will not affect the performance of the virtual router, thus ensuring the accuracy of the test results for the virtual router. In summary, the solution of this application can efficiently and accurately test the virtual router and obtain its performance test results.

[0061] The virtual router testing method, apparatus, device, and medium provided in this application aim to solve the above-mentioned technical problems of the prior art. The technical solutions of this application and how they solve the aforementioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0062] The network architecture and application scenarios of the virtual router testing method provided in the embodiments of this application will be described below. When the following description refers to the accompanying drawings, unless otherwise indicated, the same data in different drawings represent the same or similar elements.

[0063] Figure 1 This is a network architecture diagram corresponding to the application scenario of the virtual router testing method provided in this application embodiment. For example... Figure 1 As shown in the embodiment of this application, a network architecture corresponding to an application scenario includes: a test management device 11 and a test execution device 12. The test management device 11 includes a test management program sub-device 111 and a test program sub-device 112, and the test execution device 12 includes a test execution program sub-device 121 and a virtual router 122.

[0064] Test management program sub-device 111 is configured with test management program 1111, test program sub-device 112 is configured with preset test program 1121, test management program is configured with first control network card 113, and preset test program is configured with first test network card 114.

[0065] The test execution program sub-device 121 is configured with a test execution program 1211, the test execution program 1211 is configured with a second control network card 123, and the virtual router 122 is configured with a second test network card 124.

[0066] The first control network card 113 is communicatively connected to the second control network card 123, and the first test network card 114 is communicatively connected to the second test network card 124.

[0067] The test management program 1111 and the test execution program 1211 interact through the communication connection between the first control network card 113 and the second control network card 123; the preset test program 1121 and the virtual router 122 interact through the communication connection between the first test network card 114 and the second test network card 124.

[0068] The test management program sub-device 111 obtains multiple preset packet sending parameter configuration information, and performs the following operations based on each packet sending parameter configuration information to obtain the test results of the virtual router 122 under each packet sending parameter configuration information:

[0069] The control test execution program 1211 performs routing forwarding configuration on the virtual router 122 that matches the packet sending parameter configuration information, and after the routing forwarding configuration is completed, the control test execution program 1211 runs the virtual router 122;

[0070] The preset test program 1121 is configured with packet sending parameters according to the packet sending parameter configuration information, and after the packet sending parameter configuration is completed, the preset test program 1121 is controlled to perform the test on the virtual router 122; during the test on the virtual router 122, the preset test program 1121 communicates with the second test network card 124 through the first test network card 114 to send and receive test round-trip data packets.

[0071] In response to the completion of the test on the virtual router 122, the control test execution program 1211 reads the routing forwarding record of the virtual router 122 and sends the routing forwarding record to the test management program 1111;

[0072] Read the round-trip data packet transmission and reception records of the preset test program 1121, and generate the test results of the virtual router 122 under the packet transmission parameter configuration information. The test results of the virtual router 122 include packet transmission parameter configuration information, routing forwarding records, and round-trip data packet transmission and reception records.

[0073] In response to the control of the test management program 1111, the test execution program sub-device 121 performs routing and forwarding configuration on the virtual router 122 that matches the packet sending parameter configuration information. After the configuration is completed, in response to the control of the test management program 1111, the virtual router 122 runs. During the operation, the virtual router 122 communicates with the first test network card 114 through the second test network card 124 to send and receive test round-trip data packets.

[0074] In response to the control of the test management program 1111, the test execution program sub-device 121 reads the routing and forwarding records of the virtual router 122 and sends the routing and forwarding records to the test management program 1111.

[0075] The embodiments of this application will now be described with reference to the accompanying drawings. The embodiments described below do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0076] Example 1

[0077] Figure 2 This is a flowchart illustrating the virtual router testing method provided in Embodiment 1 of this application. The execution entity in this embodiment is a virtual router testing device, which is located within a test management program sub-device. The test management program sub-device is configured with a test management program. The test management program sub-device is located within a test management device, which also includes a test program sub-device configured with a preset test program. The test management program is configured with a first control network card, and the preset test program is configured with a first test network card. The test management device is located within a preset network architecture, which also includes a test execution device. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program, and the test execution program is configured with a second control network card. The virtual router is configured with a second test network card. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network cards. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network cards.

[0078] like Figure 2 As shown, the virtual router testing method provided in this embodiment includes steps 201 to 205.

[0079] Step 201: Obtain multiple preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, perform the following operations to obtain the test results of the virtual router under each packet sending parameter configuration information. The following operations include steps 202 to 205.

[0080] In this embodiment, the test management program runs in the test management program sub-device, and the test execution program runs in the test execution program sub-device.

[0081] The packet sending parameter configuration information contains matching routing and forwarding parameter configuration information. This packet sending parameter configuration information is used to configure network testing tools, while the routing and forwarding parameter configuration information is used to configure routing and forwarding on the virtual router. The network testing tool can be a preset test program. The packet sending configuration parameters are preset based on multiple performance indicators that need to be tested on the virtual router.

[0082] The performance metrics that need to be tested for virtual routers include: source address translation (SNAT) performance, destination address translation (DNAT) performance, and access control list (ACL) performance.

[0083] The packet sending parameter configuration information includes multiple preset packet sending parameters. These preset parameters include: the performance indicator under test, the length of the data packet, the source MAC address of the data packet, the destination MAC address of the data packet, the sub-interface identifier of the data packet, the source IP address range of the data packet, the destination IP address range of the data packet, the source port number range of the data packet, the destination port number range of the data packet, the communication protocol used by the data packet, the packet sending duration, and the number of concurrent data packets.

[0084] The length of the data packet is one of several preset data packet lengths. For example, the data packet length can be 64 bytes, 128 bytes, 256 bytes, 512 bytes, or 1000 bytes.

[0085] The source MAC and destination MAC of the data packet can both be the MAC of the network card configured in the preset test program, such as the MAC of the first test network card.

[0086] The packet sub-interface identifier is the same as the packet receiving sub-interface identifier of the virtual router.

[0087] The communication protocol used by the data packet is one of several preset communication protocols. For example, the communication protocol used by the data packet can be TCP / IP, UDP or ICMP.

[0088] The packet sending duration can be a preset duration or one of multiple preset durations. For example, the packet sending duration can be 100 seconds.

[0089] The source port range of the data packets can be randomly generated or be a preset range.

[0090] The routing forwarding parameter configuration information includes several preset routing forwarding parameters. These preset parameters include: the performance metric under test, the packet receiving sub-interface identifier, and the packet sending sub-interface identifier.

[0091] When the performance metric to be tested in the routing forwarding parameter configuration information is SNAT performance, several preset routing forwarding parameters also include: the range of source IP addresses to be converted, and a mapping table between the source IP addresses to be converted and the converted source IP addresses.

[0092] When the performance metric to be tested in the routing forwarding parameter configuration information is DNAT performance, several preset routing forwarding parameters also include: the range of destination IP addresses to be converted, and a mapping table between the destination IP addresses to be converted and the converted destination IP addresses.

[0093] When the performance metric to be tested in the routing forwarding parameter configuration information is ACL performance, the multiple preset routing forwarding parameters also include at least one of the following: the range of allowed source IP addresses, the range of allowed destination IP addresses, and the range of allowed destination ports.

[0094] Matching packet sending parameter configuration information and routing forwarding parameter configuration information have the same tested performance indicators.

[0095] When the performance metric being tested is SNAT performance, the range of source IP addresses in the packet sending parameter configuration information is the same as the range of source IP addresses to be translated in the matching route forwarding parameter configuration information.

[0096] When the performance metric being tested is DNAT performance, the range of destination IP addresses in the packet sending parameter configuration information is the same as the range of destination IP addresses to be translated in the matching routing forwarding parameter configuration information.

[0097] When the performance metric being tested is ACL performance, if the matching routing and forwarding parameter configuration information includes a range of allowed source IP addresses, then the range of source IP addresses in the packet sending parameter configuration information is the same as the range of allowed source IP addresses included in the matching routing and forwarding parameter configuration information; if the matching routing and forwarding parameter configuration information includes a range of allowed destination IP addresses, then the range of destination IP addresses in the packet sending parameter configuration information is the same as the range of allowed destination IP addresses included in the matching routing and forwarding parameter configuration information; if the matching routing and forwarding parameter configuration information includes a range of allowed destination ports, then the range of destination ports for data packets in the packet sending parameter configuration information is the same as the range of allowed destination ports included in the matching routing and forwarding parameter configuration information.

[0098] In this embodiment, the preset multiple packet sending parameter configuration information can be represented as preset multiple packet sending parameter configuration files.

[0099] Step 202: Control the test execution program to configure the virtual router to match the packet sending parameter configuration information, and after the routing configuration is completed, control the test execution program to run the virtual router.

[0100] In this embodiment, the test management program and the test execution program are connected via a first control network interface card (NIC) and a second control NIC. Therefore, during the process of obtaining the test results of the virtual router under each packet sending parameter configuration information, the test management program can send the current packet sending parameter configuration information to the test execution program. After receiving the current packet sending parameter configuration information, the test execution program can configure the virtual router to perform route forwarding configuration that matches the packet sending parameter configuration information.

[0101] After the virtual router completes the routing and forwarding configuration that matches the current packet sending parameter configuration information, the test management program can also control the test execution program to run the virtual router.

[0102] Optionally, step 202, "controlling the test execution program to configure the virtual router to match the packet sending parameter configuration information, and controlling the test execution program to run the virtual router after the routing configuration is completed," is further refined to include steps 301 to 302.

[0103] Step 301: Send a parameter configuration instruction to the test execution program. The parameter configuration instruction includes packet sending parameter configuration information, which is used to control the test execution program to configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information.

[0104] In this embodiment, the test management program can send parameter configuration instructions to the test execution program through the communication connection between the first control network card and the second control network card. The parameter configuration instructions include the current packet sending parameter configuration information.

[0105] After receiving the parameter configuration instruction, the test execution program configures the virtual router for routing and forwarding according to the current packet sending parameter configuration information, so that the routing and forwarding configuration of the virtual router matches the current packet sending parameter configuration information.

[0106] After completing the routing and forwarding configuration of the virtual router, the test execution program can send a parameter configuration response to the test management program so that the test management program can determine that the routing and forwarding configuration of the virtual router matches the current packet sending parameter configuration information.

[0107] Step 302: In response to receiving the parameter configuration response sent by the test executor, a test start command is sent to the test executor; the test start command is used to control the test executor to run the virtual router.

[0108] In this embodiment, after receiving the parameter configuration response, the test management program can determine that the routing and forwarding configuration of the virtual router matches the current packet sending parameter configuration information. Therefore, it can send a test start command to the test execution program so that the test execution program can run the virtual router.

[0109] After receiving the test start command, the test execution program runs the virtual router, which can perform routing forwarding functions through its configured second test network card.

[0110] The virtual router testing method provided in this embodiment configures the routing and forwarding of the virtual router through a test management program and a test execution program. This ensures that the routing and forwarding parameters of the virtual router match the packet sending parameters of the preset test program during the test, thereby ensuring the accuracy of the test results.

[0111] Step 203: Configure the packet sending parameters of the preset test program according to the packet sending parameter configuration information, and control the preset test program to perform the test on the virtual router after the packet sending parameters are configured; during the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets.

[0112] Optionally, the packet sending parameter configuration information includes multiple preset packet sending parameters, and step 203, "configure the packet sending parameters of the preset test program according to the packet sending parameter configuration information", is further refined to include step 401.

[0113] Step 401: Call the packet sending parameter configuration interface of the preset test program to pass each preset packet sending parameter to the preset test program, and complete the packet sending parameter configuration of the preset test program.

[0114] In this embodiment, the preset test program has a packet sending parameter configuration interface. The test management program sub-device can start the preset test program through a first preset shell command and call the packet sending parameter configuration interface through a second preset shell command to pass the preset packet sending parameters, including the packet sending parameter configuration information, to the preset test program to complete the packet sending parameter configuration, so that the packet sending parameter configuration of the preset test program matches the routing and forwarding parameter configuration of the virtual router. The shell command, after being interpreted by the preset command interpreter, can be passed to the hardware for execution by the operating system kernel.

[0115] After receiving the packet sending parameter configuration file, the preset test program can read the multiple preset packet sending parameters included in the packet sending parameter configuration file and configure the configurable packet sending parameters in the preset test program as preset packet sending parameters.

[0116] The virtual router testing method provided in this embodiment allows the test management program sub-device to conveniently and quickly configure the packet sending parameters of the preset test program by calling the packet sending parameter configuration interface, so that the packet sending parameter configuration of the preset test program matches the routing and forwarding parameter configuration of the virtual router.

[0117] Optionally, step 203, "controlling the preset test program to perform tests on the virtual router", can be further refined to include step 501.

[0118] Step 501: Run the preset test program so that the preset test program generates test data packets according to the packet sending parameter configuration information and sends the test data packets to the virtual router; the test data packets are used to instruct the virtual router to perform preset processing on the test data packets and send the processed test data packets to the preset test program.

[0119] In this embodiment, running the preset test program means controlling the preset test program to start generating and sending test data packets. The test management program sub-device can run the preset test program through a third preset shell command. After the preset test program runs, it will generate test data packets according to the configured packet sending parameters and send the test data packets to the virtual router through the communication connection between the first test network card and the second test network card.

[0120] After receiving the test data packet, the virtual router performs preset processing on the test data packet according to the configured routing and forwarding parameters, such as SNAT translation, DANT translation, ACL filtering, etc., and forwards the test data according to the destination MAC or destination IP address of the test data packet, such as forwarding the test data packet to the preset test program through the communication connection between the second test network card and the first test network card.

[0121] The preset test program receives processed test data packets sent by the virtual router through the communication connection between the first test network card and the second test network card.

[0122] The virtual router testing method provided in this embodiment can run a preset test program through the test management program sub-device, which can avoid manual intervention and efficiently and accurately test the virtual router.

[0123] Step 204: In response to the completion of the test on the virtual router by the preset test program, control the test execution program to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program.

[0124] In this embodiment, the test management program sub-device can determine the end of the test for the virtual router after the preset test program has run for a preset duration. The preset duration is greater than or equal to the packet transmission duration in the packet transmission parameter configuration information.

[0125] Optionally, step 204, "controlling the test execution program to read the routing and forwarding records of the virtual router and sending the routing and forwarding records to the test management program," can be further refined to include step 601.

[0126] Step 601: Send a test result collection instruction to the test execution program; the test result collection instruction is used to instruct the test execution program to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program.

[0127] In this embodiment, the virtual router has a routing forwarding data export interface. The test management program sub-device can send test result acquisition commands to the test execution program through the communication connection between the first control network card and the second control network card.

[0128] After receiving the test result acquisition command, the test execution program can use the fourth preset shell command to call the virtual router's routing forwarding data export interface to read the virtual router's routing forwarding records. Furthermore, the test execution program can send the routing forwarding records to the test management program through the communication connection between the second and first control network cards.

[0129] The test management program receives routing and forwarding records of the virtual router sent by the test execution program.

[0130] The virtual router testing method provided in this embodiment allows the test management program sub-device to obtain routing and forwarding records by controlling the test execution program, eliminating the need for manual recording of test results and improving the testing efficiency of virtual routers.

[0131] Step 205: Read the round-trip data packet transmission and reception records of the preset test program, and generate the test results of the virtual router under the packet transmission parameter configuration information. The test results include routing forwarding records and round-trip data packet transmission and reception records.

[0132] In this embodiment, the preset test program also has a test data export interface. The test management program sub-device can call the test data export interface of the preset test program through the fifth preset shell command to read the round-trip data packet transmission and reception records of the preset test program.

[0133] In this embodiment, the test management program can determine the current packet sending parameter configuration information, routing forwarding records, and round-trip data packet sending and receiving records as the test results of the virtual router under the current packet sending parameter configuration information.

[0134] Optionally, after the test management program obtains the test results of the virtual router under the configuration information of each packet sending parameter, it can generate a lightweight data exchange format file and output it. The lightweight data exchange format can be JSON format.

[0135] The virtual router testing method provided in this embodiment obtains multiple preset packet sending parameter configuration information and performs the following operations based on each packet sending parameter configuration information to obtain the test results of the virtual router under each packet sending parameter configuration information: The test execution program is controlled to perform routing and forwarding configuration on the virtual router that matches the packet sending parameter configuration information, and after the routing and forwarding configuration is completed, the test execution program is controlled to run the virtual router; the preset test program is configured with packet sending parameters according to the packet sending parameter configuration information, and after the packet sending parameter configuration is completed, the preset test program is controlled to execute the test on the virtual router; during the execution of the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets; in response to the end of the test on the virtual router, the test execution program is controlled to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program; the round-trip data packet sending and receiving records of the preset test program are read, and the test results of the virtual router under the packet sending parameter configuration information are generated, including routing and forwarding records and round-trip data packet sending and receiving records. Because the test management program obtains multiple preset packet sending parameter configuration information, and for each packet sending parameter configuration information, the test management program configures the preset test program according to the packet sending parameter configuration information, and controls the test execution program to configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information, mismatches between the preset test program and the virtual router's parameter configurations can be avoided. Simultaneously, the test management program can control the preset test program to execute tests on the virtual router and can obtain the virtual router's forwarding records and the preset test program's round-trip data packet transmission and reception records. Therefore, the test management program can efficiently test the virtual router and obtain test results for the virtual router under various packet sending parameter configuration information. Furthermore, since the test management program and the test execution program interact through the first and second control network cards, and the preset test program and the virtual router interact through the first and second test network cards, the interaction between the test management program and the test execution program does not affect the performance of the virtual router, ensuring the accuracy of the test results. In summary, the solution of this application can efficiently and accurately test virtual routers and obtain performance test results for the virtual router.

[0136] Optionally, after step 204, "in response to the completion of the test of the virtual router by the preset test program, the test execution program is controlled to read the routing and forwarding records of the virtual router", steps 701 to 702 are also included.

[0137] Step 701: Send a test reset command to the test executor to reset the routing and forwarding records of the virtual router, and stop running the virtual router after resetting the routing and forwarding records of the virtual router.

[0138] In this embodiment, the test management program sub-device can send a test reset command to the test execution program through the communication connection between the first control network card and the second control network card.

[0139] After receiving the test reset command through the communication connection between the second and first control network cards, the test execution program can reset the virtual router's routing records using the sixth preset shell command. The sixth preset shell command resets the virtual router's routing records, that is, it clears the routing data recorded by the virtual router to zero. After resetting the virtual router's routing records, the test execution program can also stop the virtual router using the seventh preset shell command. After stopping the virtual router, it no longer has the same routing forwarding functionality as a hardware router.

[0140] Step 702: Reset the round-trip data packet transmission and reception records of the preset test program.

[0141] The test management program sub-device can recharge the round-trip data packet transmission and reception records of the preset test program through the eighth preset shell command.

[0142] Optionally, the test management program sub-device can also stop running the preset test program after resetting the round-trip data packet transmission and reception records of the preset test program.

[0143] The virtual router testing method provided in this embodiment allows the test management program sub-device to reset the virtual router's routing and forwarding records through the test execution program, and reset the round-trip data packet transmission and reception records of the preset test program. This ensures that each obtained routing and forwarding record and round-trip data packet transmission and reception record corresponds to the current packet sending parameter configuration information, thereby improving the efficiency of testing the virtual router.

[0144] Optionally, the round-trip data packet transmission and reception records include: the number of data packets sent by the preset test software, the number of bytes of data packets sent by the preset test software, the number of data packets received by the preset test software, and the number of bytes of data packets received by the preset test software. The routing and forwarding records include: the number of data packets received by the virtual router, the number of bytes of data packets received by the virtual router, the number of data packets sent by the virtual router, the number of bytes of data packets sent by the virtual router, the number of data packets that failed to be received by the second test network card (rx-miss), the number of data packets dropped by the virtual router, the number of data packets that the virtual router misidentified, and the number of bytes of data packets forwarded per second by the virtual router.

[0145] The number of packets that failed to be received by the second test network card (rx-miss) is the number of packets that were not successfully received due to the performance limitations of the second test network card. The number of packets dropped by the virtual router is the number of packets that were not processed according to the default settings due to the performance limitations of the virtual router. The number of packets that the virtual router misidentified is the number of packets that were not processed according to the default settings due to reasons such as incorrect communication protocols.

[0146] Example 2

[0147] Figure 3 This is a flowchart illustrating the virtual router testing method provided in Embodiment 2 of this application. The execution entity in this embodiment is a virtual router testing device, which is located within a test execution program sub-device. The test execution program sub-device is configured with a test execution program and is located within a test execution device, which also includes a virtual router. The test execution program is configured with a second control network card, and the virtual router is configured with a second test network card. The test execution device is located within a preset network architecture, which also includes a test management device. The test management device includes a test management program sub-device and a test program sub-device; the test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program; the test management program is configured with a first control network card, and the preset test program is configured with a first test network card. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network cards; interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network cards. Figure 3 As shown, the virtual router testing method provided in this embodiment includes steps 801 to 802.

[0148] Step 801: In response to the control of the test management program, configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information. After the configuration is completed, in response to the control of the test management program, run the virtual router. During operation, the virtual router communicates with the first test network card through the second test network card to send and receive test round-trip data packets.

[0149] In this embodiment, the test execution program runs in the test execution program sub-device, and the test management program runs in the test management program sub-device.

[0150] In this embodiment, the test management program sub-device controls the test execution program to configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information by sending parameter configuration instructions to the test execution program.

[0151] Optionally, step 801, "in response to the control of the test management program, configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information, and after the configuration is completed, in response to the control of the test management program, run the virtual router," is further refined to include steps 901 to 905.

[0152] Step 901: Receive parameter configuration instructions sent by the test management program; the parameter configuration instructions include packet sending parameter configuration information.

[0153] In this embodiment, the test execution program receives parameter configuration instructions sent by the test management program through the communication connection between the second control network card and the first control network card. The parameter configuration instructions include packet sending parameter configuration information.

[0154] Step 902: In response to the parameter configuration command, configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information.

[0155] In this embodiment, after receiving the parameter configuration instruction, the test execution program sub-device can generate routing forwarding configuration information that matches the packet sending parameter configuration information, and configure the virtual router for routing forwarding using the routing forwarding configuration information that matches the packet sending parameter configuration information, so that the packet sending parameter configuration of the preset test program matches the routing forwarding parameter configuration of the virtual router.

[0156] Optionally, step 902, "configuring the virtual router with routing and forwarding information that matches the packet sending parameter configuration information," can be further refined to include steps 1001 to 1002.

[0157] Step 1001: Obtain the target route forwarding parameter configuration information that matches the packet sending parameter configuration information from a plurality of preset route forwarding parameter configuration information; the route forwarding parameter configuration information includes at least a plurality of preset route forwarding parameters.

[0158] In this embodiment, the test execution program sub-device may pre-store multiple preset routing forwarding parameter configuration information. After the test execution program receives the parameter configuration instruction, it can obtain the target routing forwarding parameter configuration information that matches the packet sending parameter configuration information from the multiple preset routing forwarding parameter configuration information. Specifically, the preset routing forwarding parameter configuration information whose included performance indicators are the same as those included in the packet sending parameter configuration information can be determined as the target routing forwarding parameter configuration information that matches the packet sending parameter configuration information.

[0159] Step 1002: Call the routing forwarding parameter configuration interface of the virtual router to pass the preset routing forwarding parameters included in the target routing forwarding parameter configuration information to the virtual router, thereby completing the routing forwarding configuration of the virtual router.

[0160] In this embodiment, the virtual router has a routing forwarding parameter configuration interface. The test execution program sub-device can call the routing forwarding parameter configuration interface of the virtual router through the eighth preset shell command to pass the preset routing forwarding parameters included in the target routing forwarding parameter configuration information to the virtual router, so as to complete the routing forwarding configuration of the virtual router and make the routing forwarding parameter configuration of the virtual router match the packet sending parameter configuration of the preset test program.

[0161] The virtual router testing method provided in this embodiment allows the test execution program sub-device to conveniently and quickly configure the routing and forwarding parameters of the virtual router by calling the routing and forwarding parameter configuration interface, so that the routing and forwarding parameter configuration of the virtual router matches the packet sending parameter configuration of the preset test program.

[0162] Step 903: In response to the completion of routing forwarding configuration, a parameter configuration response is sent to the test management program.

[0163] In this embodiment, after the virtual router successfully configures the routing forwarding parameters, it can return a routing parameter configuration success message through the routing forwarding parameter configuration interface. The test execution program sub-device receives the routing parameter configuration success message through the routing forwarding parameter configuration interface and confirms that the routing forwarding configuration is complete.

[0164] After completing the routing and forwarding configuration of the router, the test execution program sub-device sends a parameter configuration response to the test management program through the communication connection between the second control network card and the first control network card.

[0165] Step 904: Receive the test start command sent by the test management program.

[0166] In this embodiment, the test start command is sent by the test management program to the test execution program after the test management program receives the parameter configuration response.

[0167] Step 905: In response to the test start command, run the virtual router.

[0168] In this embodiment, the test execution program responds to the test start command and runs the virtual router via the ninth preset shell command. After the virtual router is running, it has the same routing and forwarding functions as the hardware router.

[0169] The virtual router testing method provided in this embodiment configures the routing and forwarding of the virtual router through a test execution program and a test management program. This ensures that the routing and forwarding parameters of the virtual router match the packet sending parameters of the preset test program during the test, thereby guaranteeing the accuracy of the test results.

[0170] Step 802: In response to the control of the test management program, read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program.

[0171] Optionally, step 802, "in response to the control of the test management program, read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program," is further refined to include steps 1101 to 1102.

[0172] Step 1101: In response to the control of the test management program, receive the test result collection instruction sent by the test management program.

[0173] Step 1102: In response to the test result collection command, read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program.

[0174] In this embodiment, the specific implementation process of steps 1101 and 1102 can be found in the description in step 601, and will not be repeated here.

[0175] In this embodiment, the test execution program reads the routing and forwarding records of the virtual router and sends the forwarding records of the virtual router to the test management program. This eliminates the need for manual recording of test results and improves the testing efficiency of the virtual router.

[0176] The virtual router testing method provided in this embodiment, in response to the control of the test management program, configures the virtual router with routing and forwarding information that matches the packet sending parameter configuration information. After configuration, it runs the virtual router in response to the control of the test management program. During operation, the virtual router communicates with the first test network card through the second test network card to send and receive test round-trip data packets. In response to the control of the test management program, it reads the routing and forwarding records of the virtual router and sends them to the test management program. Because the test execution program configures the virtual router with routing and forwarding information that matches the packet sending parameter configuration information, it avoids mismatches between the preset test program and the virtual router's parameter configuration. The test execution program sends the forwarding records of the virtual router to the test management program, which can directly obtain the test results of the virtual router under each packet sending parameter configuration information, improving test efficiency. Furthermore, since the test management program and the test execution program interact through the first and second control network cards, and the preset test program and the virtual router interact through the first and second test network cards, the interaction between the test management program and the test execution program does not affect the performance of the virtual router, ensuring the accuracy of the test results.

[0177] Optionally, after step 802, "in response to the control of the test management program, read the routing forwarding record of the virtual router and send the routing forwarding record to the test management program", steps 1201 to 1202 are also included.

[0178] Step 1201: Receive the test reset command sent by the test management program.

[0179] Step 1202: In response to the test reset command, reset the routing and forwarding records of the virtual router, and stop running the virtual router after resetting the routing and forwarding records of the virtual router.

[0180] In this embodiment, the specific implementation process of steps 1201 and 1202 can be found in the description in step 701, and will not be repeated here.

[0181] The virtual router testing method provided in this embodiment resets the routing and forwarding records of the virtual router through the test execution program sub-device. This ensures that each routing and forwarding record obtained by the test management program corresponds to the current packet sending parameter configuration information, thereby improving the efficiency of testing the virtual router.

[0182] Example 3

[0183] Figure 4 This is a flowchart illustrating the virtual router testing method provided in Embodiment 3 of this application. Figure 4 As shown, the testing method for the virtual router provided in this embodiment includes steps 1301 to 1302.

[0184] Step 1301: The test management program obtains multiple preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, executes steps 1302 to 1322 to obtain the test results of the virtual router under each packet sending parameter configuration information.

[0185] Step 1302: The test management program sends a parameter configuration instruction to the test execution program. The parameter configuration instruction includes packet sending parameter configuration information.

[0186] Step 1303: In response to the parameter configuration command, the test execution program obtains the target route forwarding parameter configuration information that matches the packet sending parameter configuration information from a set of preset route forwarding parameter configuration information.

[0187] Step 1304: The test execution program calls the routing forwarding parameter configuration interface of the virtual router, passes the preset routing forwarding parameters included in the target routing forwarding parameter configuration information to the virtual router, and completes the routing forwarding configuration of the virtual router.

[0188] Step 1305: In response to completing the routing forwarding configuration, the test execution program sends a parameter configuration response to the test management program.

[0189] Step 1306: In response to receiving the parameter configuration response from the test execution program, the test management program sends a test start command to the test execution program.

[0190] Step 1307: The test execution program should run the virtual router upon the test startup command.

[0191] Step 1308: The test management program configures the packet sending parameters for the preset test program according to the packet sending parameter configuration information.

[0192] Step 1309: After the packet sending parameters are configured, the test management program runs the preset test program.

[0193] Step 1310: The preset test program generates a test data packet based on the packet sending parameter configuration information.

[0194] Step 1311: The preset test program sends the test data packet to the virtual router.

[0195] Step 1312: The virtual router performs preset processing on the test data packets.

[0196] Step 1313: The virtual router sends the processed test data packets to the preset test program.

[0197] Step 1314: In response to the completion of the virtual router test by the preset test program, the test management program sends a test result collection instruction to the test execution program.

[0198] Step 1315: In response to the test result acquisition command, the test execution program reads the routing and forwarding records of the virtual router.

[0199] Step 1316: The test execution program sends the routing forwarding record to the test management program.

[0200] Step 1317: The test management program reads the round-trip data packet transmission and reception records of the preset test program.

[0201] Step 1318: After receiving the routing forwarding record, the test management program sends a test reset command to the test execution program.

[0202] Step 1319: In response to the test reset command, the test execution program resets the routing and forwarding records of the virtual router.

[0203] Step 1320: After resetting the routing and forwarding records of the virtual router, the test execution program stops running the virtual router.

[0204] Step 1321: The test management program resets the round-trip data packet transmission and reception records of the preset test program.

[0205] Step 1322: Test the management program and generate test results for the virtual router under the packet sending parameter configuration information.

[0206] It should be noted that, in Figure 4 The steps shown are not intended to limit the scope of this application. In other embodiments of this application, the testing method for virtual routers may include methods that are more complex than those described above. Figure 4 More or fewer steps Figure 4 The order of some steps can be changed. Figure 4 Some steps in the process can be replaced by steps with the same function, or... Figure 4 Some steps in the process can be broken down into multiple steps.

[0207] Example 4

[0208] The virtual router testing device provided in this embodiment is applied to a test management program sub-device. The test management program sub-device is configured with a test management program and is located within a test management device. The test management device also includes a test program sub-device configured with a preset test program. The test management program is configured with a first control network card, and the preset test program is configured with a first test network card. The test management device is located in a preset network architecture, which also includes a test execution device. The test execution device includes a test execution program sub-device and a virtual router. The test execution program sub-device is configured with a test execution program. The test execution program is configured with a second control network card, and the virtual router is configured with a second test network card. Interaction between the test management program and the test execution program is achieved through a communication connection between the first and second control network cards. Interaction between the preset test program and the virtual router is achieved through a communication connection between the first and second test network cards. The virtual router testing device includes: an acquisition module.

[0209] The acquisition module is used to: acquire multiple preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, perform the following operations to obtain the test results of the virtual router under each packet sending parameter configuration information: control the test execution program to configure the virtual router to route forwarding according to the packet sending parameter configuration information, and control the test execution program to run the virtual router after the route forwarding configuration is completed; configure the packet sending parameters of the preset test program according to the packet sending parameter configuration information, and control the preset test program to execute the test on the virtual router after the packet sending parameter configuration is completed; during the execution of the test on the virtual router, the preset test program communicates with the first test network card and the second test network card to send and receive test round-trip data packets; in response to the end of the test on the virtual router, control the test execution program to read the routing forwarding record of the virtual router and send the routing forwarding record to the test management program; read the round-trip data packet sending and receiving records of the preset test program, and generate the test results of the virtual router under the packet sending parameter configuration information, the test results including routing forwarding records and round-trip data packet sending and receiving records.

[0210] Optionally, the acquisition module is specifically used to: send a parameter configuration instruction to the test execution program, the parameter configuration instruction including packet sending parameter configuration information, which is used to control the test execution program to configure the virtual router to perform routing forwarding configuration that matches the packet sending parameter configuration information; in response to receiving the parameter configuration response sent by the test execution program, send a test start instruction to the test execution program; the test start instruction is used to control the test execution program to run the virtual router.

[0211] Optionally, the acquisition module is further configured to: send a test reset command to the test executor so that the test executor resets the routing and forwarding records of the virtual router, and after resetting the routing and forwarding records of the virtual router, stop running the virtual router; and reset the round-trip data packet transmission and reception records of the preset test program.

[0212] Optionally, the acquisition module is specifically used to: call the packet sending parameter configuration interface of the preset test program, pass each preset packet sending parameter to the preset test program, and complete the packet sending parameter configuration of the preset test program.

[0213] Optionally, the acquisition module is specifically used to: run a preset test program so that the preset test program generates test data packets according to the packet sending parameter configuration information and sends the test data packets to the virtual router; the test data packets are used to instruct the virtual router to perform preset processing on the test data packets and send the processed test data packets to the preset test program.

[0214] Optionally, the acquisition module is specifically used to: send a test result acquisition instruction to the test execution program; the test result acquisition instruction is used to instruct the test execution program to read the routing and forwarding records of the virtual router and send the routing and forwarding records to the test management program.

[0215] The virtual router testing device provided in this embodiment can execute any of the virtual router testing methods provided in Embodiment 1 above. The specific implementation and principle are similar, and will not be described again here.

[0216] Example 5

[0217] Figure 5 This is a schematic diagram of the structure of a virtual router testing device according to Embodiment 5 of this application. Figure 5 As shown, the virtual router testing device 50 provided in this embodiment is applied to a test execution program sub-device. The test execution program sub-device is configured with a test execution program and is located within the test execution device. The test execution device also includes a virtual router. The test execution program is configured with a second control network card, and the virtual router is configured with a second test network card. The test execution device is located in a preset network architecture, which also includes a test management device. The test management device includes a test management program sub-device and a test program sub-device. The test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program. The test management program is configured with a first control network card, and the preset test program is configured with a first test network card. The interaction between the test management program and the test execution program is realized through a communication connection between the first control network card and the second control network card. The interaction between the preset test program and the virtual router is realized through a communication connection between the first test network card and the second test network card.

[0218] The virtual router testing device 50 includes: a first response module 51 and a second response module 52.

[0219] The first response module 51 is used to respond to the control of the test management program, configure the virtual router to perform routing and forwarding configuration that matches the packet sending parameter configuration information, and after the configuration is completed, run the virtual router in response to the control of the test management program; during the operation of the virtual router, it communicates with the first test network card through the second test network card to send and receive test round-trip data packets.

[0220] The second response module 52 is used to respond to the control of the test management program, read the routing and forwarding records of the virtual router, and send the routing and forwarding records to the test management program.

[0221] Optionally, the first response module 51 is specifically used for: receiving a parameter configuration instruction sent by the test management program; the parameter configuration instruction includes packet sending parameter configuration information; in response to the parameter configuration instruction, configuring the virtual router to perform routing forwarding that matches the packet sending parameter configuration information; in response to completing the routing forwarding configuration, sending a parameter configuration response to the test management program; receiving a test start instruction sent by the test management program; and in response to the test start instruction, running the virtual router.

[0222] Optionally, the second response module 52 is further configured to: receive a test reset command sent by the test management program; in response to the test reset command, reset the routing and forwarding records of the virtual router, and stop running the virtual router after resetting the routing and forwarding records of the virtual router.

[0223] Optionally, the first response module 51 is further configured to: obtain target routing forwarding parameter configuration information that matches the packet sending parameter configuration information from a plurality of preset routing forwarding parameter configuration information; the routing forwarding parameter configuration information includes at least a plurality of preset routing forwarding parameters; call the routing forwarding parameter configuration interface of the virtual router to pass each preset routing forwarding parameter included in the target routing forwarding parameter configuration information to the virtual router, thereby completing the routing forwarding configuration of the virtual router.

[0224] Optionally, the second response module 52 is further configured to: receive a test result collection instruction sent by the test management program in response to the control of the test management program; and read the routing and forwarding records of the virtual router in response to the test result collection instruction, and send the routing and forwarding records to the test management program.

[0225] The virtual router testing device provided in this embodiment can execute any of the virtual router testing methods provided in Embodiment 2 above. The specific implementation method and principle are similar, and will not be described again here.

[0226] Example 6

[0227] Figure 6 This is a schematic diagram of the structure of the test management program sub-device provided according to Embodiment Six of this application. Figure 6 As shown, the test management program sub-device 60 includes: a memory 61, a processor 62, and a transceiver 63.

[0228] The memory 61, processor 62 and transceiver 63 are interconnected.

[0229] Memory 61 stores computer-executed instructions.

[0230] Transceiver 63 is used for sending and receiving data;

[0231] The processor 62 executes the computer execution instructions stored in the memory 61 to implement any of the virtual router testing methods provided in Embodiment 1. The specific implementation method and principle are similar and will not be described in detail here.

[0232] Example 7

[0233] Figure 7 This is a schematic diagram of the structure of the test execution program sub-device provided according to Embodiment Seven of this application. Figure 7As shown, the test execution program sub-device 70 includes: a memory 71, a processor 72, and a transceiver 73.

[0234] The memory 71, processor 72 and transceiver 73 are interconnected.

[0235] Memory 71 stores computer-executed instructions.

[0236] Transceiver 73 is used for sending and receiving data.

[0237] The processor 72 executes the computer execution instructions stored in the memory 71 to implement any of the virtual router testing methods provided in Embodiment 2. The specific implementation method and principle are similar and will not be described in detail here.

[0238] exist Figure 6 and Figure 7 In a corresponding embodiment, the memory, processor, and transceiver are interconnected via a bus. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized into address bus, data bus, control bus, etc. For ease of representation, Figure 6 and Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0239] exist Figure 6 and Figure 7 In corresponding embodiments, the memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk, etc. The transceiver can be a network interface card (NIC).

[0240] Both the test management program sub-device and the test execution program sub-device can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the corresponding virtual router test methods described above.

[0241] Embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these instructions are used to implement the virtual router testing method provided in any of the above embodiments. The specific implementation and principle are similar and will not be repeated here. Exemplarily, the computer-readable storage medium can be a read-only memory, random access memory, magnetic tape, floppy disk, or optical data storage device, etc.

[0242] The embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the virtual router testing method provided in any of the above embodiments. The specific implementation method and principle are similar and will not be described again here.

[0243] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can be implemented in other ways. For example, the module division in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, unless otherwise specified, the functional modules in the various embodiments of this application can be integrated into one module, or each module can exist physically separately, or two or more modules can be integrated together. The integrated modules described above can be implemented in hardware or in the form of software program modules.

[0244] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0245] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0246] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0247] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of testing a virtual router, the method comprising: The method is applied to a test management program sub-device, the test management program sub-device is configured with a test management program, and the test management program sub-device is located in a test management device; the test management device further includes a test program sub-device, and the test program sub-device is configured with a preset test program; the test management program is configured with a first control network card, and the preset test program is configured with a first test network card; the test management device is located in a preset network architecture, and the preset network architecture further includes a test execution device; the test execution device includes a test execution program sub-device and a virtual router, and the test execution program sub-device is configured with a test execution program; the test execution program is configured with a second control network card, and the virtual router is configured with a second test network card; The test management program and the test execution program are interacted through the communication connection between the first control network card and the second control network card; The preset test program and the virtual router are interacted through the communication connection between the first test network card and the second test network card; The method comprises the following steps: Obtaining a plurality of preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, performing the following operations to obtain the test result of the virtual router under each packet sending parameter configuration information: Controlling the test execution program to perform routing forwarding configuration on the virtual router matched with the packet sending parameter configuration information, and after the routing forwarding configuration is completed, controlling the test execution program to run the virtual router; According to the packet sending parameter configuration information, the preset test program is configured with packet sending parameters, and after the packet sending parameter configuration is completed, the preset test program is controlled to perform the test on the virtual router; in the process of performing the test on the virtual router, the preset test program transmits and receives test round-trip data packets through the communication between the first test network card and the second test network card; In response to the end of the test on the virtual router by the preset test program, the test execution program reads the routing forwarding record of the virtual router, and sends the routing forwarding record to the test management program; Reading the round-trip data packet transmission and reception record of the preset test program, and generating the test result of the virtual router under the packet sending parameter configuration information, wherein the test result of the virtual router includes the routing forwarding record and the round-trip data packet transmission and reception record.

2. The method of claim 1, wherein, The control of the test execution program to perform routing forwarding configuration on the virtual router matched with the packet sending parameter configuration information, and after the routing forwarding configuration is completed, the control of the test execution program to run the virtual router, comprises the following steps: Sending a parameter configuration instruction to the test execution program, wherein the parameter configuration instruction includes the packet sending parameter configuration information, and is used to control the test execution program to perform routing forwarding configuration on the virtual router matched with the packet sending parameter configuration information; In response to receiving the parameter configuration response sent by the test execution program, a test start instruction is sent to the test execution program; the test start instruction is used to control the test execution program to run the virtual router.

3. The method of claim 1, wherein, After the control of the test execution program to read the routing forwarding record of the virtual router in response to the end of the test on the virtual router by the preset test program, the method further comprises the following steps: sending a test reset instruction to the test execution program to make the test execution program reset the routing forwarding record of the virtual router and stop running the virtual router after resetting the routing forwarding record of the virtual router; resetting the round-trip packet transmission record of the preset test program.

4. The method of claim 1, wherein, The packet sending parameter configuration information comprises a plurality of preset packet sending parameters, and the packet sending parameter configuration of the preset test program comprises: calling a packet sending parameter configuration interface of the preset test program, and passing each preset packet sending parameter to the preset test program to complete the packet sending parameter configuration of the preset test program.

5. The method of claim 1, wherein, The control of the preset test program to perform the test on the virtual router comprises: running the preset test program to make the preset test program generate a test data packet according to the packet sending parameter configuration information and send the test data packet to the virtual router; the test data packet is used to instruct the virtual router to perform a preset processing on the test data packet and send the processed test data packet to the preset test program.

6. The method according to any one of claims 1 to 5, characterized in that, The control of the test execution program to read the routing forwarding record of the virtual router and send the routing forwarding record to the test management program comprises: sending a test result collection instruction to the test execution program; the test result collection instruction is used to instruct the test execution program to read the routing forwarding record of the virtual router and send the routing forwarding record to the test management program.

7. A method of testing a virtual router, the method comprising: The method is applied to a test execution program sub-device, the test execution program sub-device is configured with a test execution program, and the test execution program sub-device is located in a test execution device; the test execution device further comprises a virtual router; the test execution program is configured with a second control network card, and the virtual router is configured with a second test network card; the test execution device is located in a preset network architecture, and the preset network architecture further comprises a test management device; the test management device comprises a test management program sub-device and a test program sub-device; the test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program; the test management program is configured with a first control network card, and the preset test program is configured with a first test network card; the test management program and the test execution program are interacted through the communication connection between the first control network card and the second control network card; the preset test program and the virtual router are interacted through the communication connection between the first test network card and the second test network card; The method comprises: in response to the control of the test management program, performing routing forwarding configuration on the virtual router that matches the packet sending parameter configuration information, and in response to the control of the test management program after the configuration is completed, running the virtual router; in the running process of the virtual router, the test round-trip data packet is transmitted and received through the communication between the second test network card and the first test network card; in response to the control of the test management program, reading the routing forwarding record of the virtual router and sending the routing forwarding record to the test management program.

8. The method of claim 7, wherein, The response to the control of the test management program, the routing forwarding configuration on the virtual router that matches the packet sending parameter configuration information, and the running of the virtual router in response to the control of the test management program after the configuration is completed, comprise: receive a parameter configuration instruction sent by the test management program; the parameter configuration instruction includes the packet sending parameter configuration information; in response to the parameter configuration instruction, perform route forwarding configuration on the virtual router that matches the packet sending parameter configuration information; in response to completion of the route forwarding configuration, send a parameter configuration response to the test management program; receive a test start instruction sent by the test management program; in response to the test start instruction, run the virtual router.

9. The method of claim 7, wherein, After the reading of the route forwarding record of the virtual router and the sending of the route forwarding record to the test management program in response to the control of the test management program, the method further includes: receive a test reset instruction sent by the test management program; in response to the test reset instruction, reset the route forwarding record of the virtual router, and stop running the virtual router after the route forwarding record of the virtual router is reset.

10. The method of claim 7, wherein, The route forwarding configuration on the virtual router that matches the packet sending parameter configuration information includes: from a plurality of preset route forwarding parameter configuration information, obtain target route forwarding parameter configuration information that matches the packet sending parameter configuration information; the route forwarding parameter configuration information includes at least a plurality of preset route forwarding parameters; call a route forwarding parameter configuration interface of the virtual router, and pass each preset route forwarding parameter included in the target route forwarding parameter configuration information to the virtual router to complete the route forwarding configuration on the virtual router.

11. The method according to any one of claims 7-10, characterized in that, The reading of the route forwarding record of the virtual router and the sending of the route forwarding record to the test management program in response to the control of the test management program include: in response to the control of the test management program, receive a test result collection instruction sent by the test management program; in response to the test result collection instruction, read the route forwarding record of the virtual router and send the route forwarding record to the test management program.

12. A virtual router test apparatus, comprising: The device is applied to a test management program sub-device, the test management program sub-device is configured with a test management program, and the test management program sub-device is located in a test management device; the test management device further includes a test program sub-device, and the test program sub-device is configured with a preset test program; the test management program is configured with a first control network card, and the preset test program is configured with a first test network card; the test management device is located in a preset network architecture, and the preset network architecture further includes a test execution device; the test execution device includes a test execution program sub-device and a virtual router, and the test execution program sub-device is configured with a test execution program; the test execution program is configured with a second control network card, and the virtual router is configured with a second test network card; the test management program and the test execution program are interacted through the communication connection between the first control network card and the second control network card; the preset test program and the virtual router are interacted through the communication connection between the first test network card and the second test network card; the device includes: an obtaining module, configured to obtain a plurality of preset packet sending parameter configuration information, and based on each packet sending parameter configuration information, perform the following operations to obtain a test result of the virtual router under each packet sending parameter configuration information: The control test execution program controls the virtual router to perform the routing forwarding configuration matched with the packet sending parameter configuration information, and controls the test execution program to run the virtual router after the routing forwarding configuration is completed; The preset test program is configured with the packet sending parameter according to the packet sending parameter configuration information, and the preset test program performs the test on the virtual router after the packet sending parameter configuration is completed; in the process of performing the test on the virtual router, the preset test program transmits and receives the test round-trip data packet by communicating with the second test network card through the first test network card; In response to the end of the test on the virtual router, the control test execution program reads the routing forwarding record of the virtual router, and sends the routing forwarding record to the test management program; The round-trip data packet transmission and reception record of the preset test program is read, and the test result of the virtual router under the packet sending parameter configuration information is generated, wherein the test result includes the routing forwarding record and the round-trip data packet transmission and reception record.

13. A virtual router test apparatus, comprising: The device is applied to a test execution program sub-device, the test execution program sub-device is configured with a test execution program, and the test execution program sub-device is located in a test execution device; the test execution device further includes a virtual router; the test execution program is configured with a second control network card, and the virtual router is configured with a second test network card; the test execution device is located in a preset network architecture, and the preset network architecture further includes a test management device; the test management device includes a test management program sub-device and a test program sub-device; the test management program sub-device is configured with a test management program, and the test program sub-device is configured with a preset test program; the test management program is configured with a first control network card, and the preset test program is configured with a first test network card; the test management program and the test execution program are interacted through the communication connection between the first control network card and the second control network card; The preset test program and the virtual router are interacted through the communication connection between the first test network card and the second test network card; The device includes: A first response module is configured to, in response to the control of the test management program, perform the routing forwarding configuration matched with the packet sending parameter configuration information on the virtual router, and in response to the control of the test management program, run the virtual router after the configuration is completed; in the running process of the virtual router, the virtual router transmits and receives the test round-trip data packet by communicating with the first test network card through the second test network card; A second response module is configured to, in response to the control of the test management program, read the routing forwarding record of the virtual router, and send the routing forwarding record to the test management program.

14. A test management program sub-device, characterized by It includes: A memory, a processor and a transceiver; The memory, the processor and the transceiver are circuit-interconnected; The memory stores computer execution instructions; The transceiver is used for transmitting and receiving data; The processor executes the computer execution instructions stored in the memory to realize the method in any one of claims 1-6.

15. A test execution program sub-device, characterized by It includes: A memory, a processor and a transceiver; The memory, the processor and the transceiver are circuit-interconnected; The memory stores computer execution instructions; The transceiver is used for transmitting and receiving data; The processor executes computer-executable instructions stored in the memory to implement the method of any of claims 7-11.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the method of any of claims 1-11.

Citation Information

Patent Citations

  • Method and apparatus for automated testing in NFV

    CN109491889A

  • Network function test method and device and medium

    CN116389306A