Network transmission test method and device, programmable switch, equipment and product
By configuring data transmission packet loss strategy in programmable switches, the problem of insufficient packet loss simulation accuracy and flexibility in RDMA network traffic test is solved, and precise control and flexible testing of network data is achieved, which improves the effectiveness and economicality of the test.
Patent Information
- Application Number
- CN202510435862.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-08
AI Technical Summary
The existing RDMA network traffic testing tools lack accuracy and flexibility when simulating packet loss, making it difficult to effectively control packet loss in dynamic loads and complex network topology, affecting network stability and performance.
By preconfiguring the data transmission packet loss policy in a programmable switch, using P4 programmable switch for precise control and flexible configuration, simulate traffic performance losses under different packet loss conditions, and support various performance testing requirements.
It realizes accurate packet loss test control of network data, flexibly simulates traffic performance losses under different packet loss conditions, meets various performance testing requirements, and improves the flexibility and cost-effectiveness of testing.
Smart Images

Figure CN120281678A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data communication technologies, and in particular, to a network transmission testing method, a network transmission testing device, a programmable switch, an electronic device, and a computer program product. Background Art
[0002] With the rapid development of machine learning, large model training, big data, and high performance computing (HPC) services, Remote Direct Memory Access (RDMA), as a low-latency and high-bandwidth network communication technology, has been widely used. RDMA is a technology that allows computer systems to directly transfer data over the network through memory without the intervention of the operating system or the participation of the host CPU, thus significantly improving the efficiency and speed of data transfer.
[0003] However, with the expansion of the network scale, RDMA data streams are prone to be affected by factors such as network packet loss, packet out-of-order, and bandwidth limitation during the transmission process, resulting in the interruption of RDMA network traffic or the degradation of performance, affecting the stability and reliability of the entire system. Especially in high-load situations, congestion control and packet loss management of RDMA traffic become particularly crucial. Summary of the Invention
[0004] The present disclosure provides a network transmission testing method, a network transmission testing device, a programmable switch, an electronic device, a computer-readable storage medium, and a computer program product to at least solve the problem of insufficient precision control and flexibility in simulating packet loss in the RDMA traffic damage testing solution in related technologies. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a network transmission testing method is provided, including: receiving initial network data, and determining to-be-tested network data based on the initial network data; determining a target test packet loss policy matching the to-be-tested network data based on a pre-configured data transmission packet loss policy, where the data transmission packet loss policy is generated by performing a configuration operation on a programmable switch; performing a packet loss test on the to-be-tested network data according to the target test packet loss policy to obtain a packet loss test result; and determining the data transmission performance of the to-be-tested network data under different data transmission control policies according to the packet loss test result.
[0006] In an exemplary embodiment of the present disclosure, determining the network data to be tested based on the initial network data includes: parsing the initial network data through the programmable switch to obtain a packet parsing result, where the packet parsing result includes packet header information, and the packet header information includes multiple field information; performing field matching processing on the field information in the packet header information to obtain a field matching result; and determining the network data to be tested according to the field matching result.
[0007] In an exemplary embodiment of the present disclosure, the method further includes: determining a data transmission test requirement, where the data transmission test requirement includes one or more of a data identification rule, a packet loss pattern, and packet loss parameters; and performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirement to generate the data transmission packet loss policy.
[0008] In an exemplary embodiment of the present disclosure, performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirement to generate the data transmission packet loss policy includes: determining the specified packet loss quantity corresponding to a single packet and a continuous packet sequence respectively according to the data transmission test requirement; determining the packet loss probability and packet loss accuracy according to the data transmission test requirement; generating a first packet loss policy according to the specified packet loss quantity, packet loss probability, and packet loss accuracy; obtaining the data transmission parameters corresponding to the data transmission of the network data, where the data transmission parameters include one or more of the source address, target address, and port range corresponding to the network data; and generating a second packet loss policy based on the first packet loss policy and the data transmission parameters.
[0009] In an exemplary embodiment of the present disclosure, the number of the data transmission packet loss policies is multiple, and determining the target test packet loss policy matching the network data to be tested based on the pre-configured data transmission packet loss policies includes: determining the packet loss test scenario corresponding to the network data to be tested; and determining the target test packet loss policy corresponding to the packet loss test scenario from the multiple data transmission packet loss policies.
[0010] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes an accurate packet loss scenario. The packet loss test of the network data to be tested according to the target test packet loss strategy to obtain a packet loss test result includes: performing packet matching processing on the network data to be tested to obtain a first test packet; obtaining a pre-configured packet counter; updating the packet counter according to the matched first test packet to obtain a counter value; when the counter value reaches the packet loss quantity threshold, performing a packet loss operation on the first test packet and adding a packet loss mark to the first test packet; and determining the packet loss test result based on the packet loss operation.
[0011] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes a random packet loss scenario. The packet loss test of the network data to be tested according to the target test packet loss strategy to obtain a packet loss test result includes: performing packet matching processing on the network data to be tested to obtain a second test packet; in response to receiving the second test packet, generating a random number based on a random number generator and comparing the random number with a pre-configured packet loss probability threshold; when the random number is less than the packet loss probability threshold, performing a packet loss operation on the second test packet and adding a packet loss mark to the second test packet; and when the random number is greater than or equal to the packet loss probability threshold, forwarding the second test packet.
[0012] In an exemplary embodiment of the present disclosure, the method further includes: using the test packet that already has the packet loss mark as a third test packet; obtaining the number of packet loss packets and the packet loss upper limit threshold during the packet loss test; when the number of packet loss packets is less than the packet loss upper limit threshold, performing a packet loss operation on the third test packet; and when the number of packet loss packets is greater than or equal to the packet loss upper limit threshold, performing a forwarding operation on the third test packet.
[0013] In an exemplary embodiment of the present disclosure, determining the data transmission performance of the network data to be tested under different data transmission control strategies according to the packet loss test result includes: obtaining a packet parsing result corresponding to the network data to be tested, where the packet parsing result includes one or more of the packet type of the network data to be tested and the discarded part of the packet; determining the target network layer corresponding to the programmable switch in the network topology, where the programmable switch is deployed in any network layer of the network topology; and determining the data transmission performance of the target network layer according to the packet loss test result and the packet parsing result.
[0014] According to a second aspect of the embodiments of the present disclosure, there is provided a network transmission testing device, including: a test data determination module, configured to receive initial network data and determine the network data to be tested based on the initial network data; a packet loss policy determination module, configured to determine a target test packet loss policy matching the network data to be tested based on a pre-configured data transmission packet loss policy, where the data transmission packet loss policy is generated by performing a configuration operation on a programmable switch; a packet loss testing module, configured to perform a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result; and a performance determination module, configured to determine the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
[0015] In an exemplary embodiment of the present disclosure, the test data determination module includes a test data determination unit, configured to: perform packet parsing processing on the initial network data through the programmable switch to obtain a packet parsing result, where the packet parsing result includes packet header information, and the packet header information includes multiple field information; perform field matching processing on the field information in the packet header information to obtain a field matching result; and determine the network data to be tested according to the field matching result.
[0016] In an exemplary embodiment of the present disclosure, the packet loss policy determination module includes a packet loss policy generation unit, configured to: determine a data transmission test requirement, where the data transmission test requirement includes one or more of a data identification rule, a packet loss mode, and packet loss parameters; and perform a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirement to generate the data transmission packet loss policy.
[0017] In an exemplary embodiment of the present disclosure, the packet loss policy generation unit includes a packet loss policy generation subunit, configured to: determine the specified packet loss quantity corresponding to a single packet and a continuous packet sequence respectively according to the data transmission test requirement; determine a packet loss probability and a packet loss accuracy according to the data transmission test requirement; generate a first packet loss policy according to the specified packet loss quantity, the packet loss probability, and the packet loss accuracy; obtain data transmission parameters corresponding to the data transmission of the network data, where the data transmission parameters include one or more of a source address, a target address, and a port range corresponding to the network data; and generate a second packet loss policy based on the first packet loss policy and the data transmission parameters.
[0018] In an exemplary embodiment of the present disclosure, the number of the data transmission packet loss policies is multiple, and the packet loss policy determination module further includes a packet loss policy determination unit, configured to: determine a packet loss test scenario corresponding to the network data to be tested; and determine a target test packet loss policy corresponding to the packet loss test scenario from the multiple data transmission packet loss policies.
[0019] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes an accurate packet loss scenario, and the packet loss test module includes a first packet loss test unit for: performing packet matching processing on the network data to be tested to obtain a first test packet; acquiring a pre-configured packet counter; updating the packet counter according to the matched first test packet to obtain a counter value; when the counter value reaches a packet loss quantity threshold, performing a packet loss operation on the first test packet and adding a packet loss mark to the first test packet; and determining the packet loss test result based on the packet loss operation.
[0020] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes a random packet loss scenario, and the packet loss test module includes a second packet loss test unit for: performing packet matching processing on the network data to be tested to obtain a second test packet; in response to receiving the second test packet, generating a random number based on a random number generator and comparing the random number with a pre-configured packet loss probability threshold; when the random number is less than the packet loss probability threshold, performing a packet loss operation on the second test packet and adding a packet loss mark to the second test packet; and when the random number is greater than or equal to the packet loss probability threshold, forwarding the second test packet.
[0021] In an exemplary embodiment of the present disclosure, the network transmission test device further includes a packet loss forwarding processing module for: using the test packet with the packet loss mark as a third test packet; acquiring the number of packet loss packets and a packet loss upper limit threshold during the packet loss test; when the number of packet loss packets is less than the packet loss upper limit threshold, performing a packet loss operation on the third test packet; and when the number of packet loss packets is greater than or equal to the packet loss upper limit threshold, performing a forwarding operation on the third test packet.
[0022] In an exemplary embodiment of the present disclosure, the performance determination module includes a performance determination unit for: acquiring a packet parsing result corresponding to the network data to be tested, where the packet parsing result includes one or more of the packet type of the network data to be tested and the discarded part of the packet; determining a target network layer corresponding to the programmable switch in the network topology, where the programmable switch is deployed in any network layer of the network topology; and determining the data transmission performance of the target network layer according to the packet loss test result and the packet parsing result.
[0023] According to a third aspect of the present disclosure, a programmable switch is provided, including: a control plane and a data plane; the control plane is configured to receive a policy configuration operation, generate a data transmission packet loss policy based on the policy configuration operation, and send the data transmission packet loss policy to the data plane; the data plane is configured to determine to-be-tested network data based on the received initial network data, perform a packet loss test on the to-be-tested network data according to the data transmission packet loss policy, and obtain a packet loss test result; the control plane is further configured to determine the data transmission performance of the to-be-tested network data under different data transmission control policies according to the packet loss test result.
[0024] According to a fourth aspect of the present disclosure, an electronic device is provided, including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the instructions to implement the network transmission test method described in any one of the above.
[0025] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the network transmission test method described in any one of the above.
[0026] According to a sixth aspect of the present disclosure, a computer program product is provided, including a computer program, which when executed by a processor implements the network transmission test method described in any one of the above.
[0027] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0028] On the one hand, by pre-configuring a data transmission packet loss policy in the programmable switch, precise control of the packet loss test of network data can be achieved, and the traffic performance loss under different packet loss conditions can be flexibly simulated. On the other hand, since the programmable switch supports flexible rule configuration, the data transmission packet loss policy can be configured according to different test requirements to meet various performance test requirements.
[0029] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation to the present disclosure.
[0031] Figure 1 A schematic diagram showing a packet loss test of RDMA traffic using an FPGA development board in a related solution is shown.
[0032] Figure 2 The figure shows a schematic diagram of using a network impairment tester to perform packet loss testing on RDMA traffic in a related solution.
[0033] Figure 3 It is a flowchart of a network transmission testing method shown according to an exemplary embodiment.
[0034] Figure 4 It is an overall flowchart of a programmable switch implementing an RDMA traffic impairment testing solution shown according to an exemplary embodiment.
[0035] Figure 5 It is a processing flowchart of the data plane of a programmable switch shown according to an exemplary embodiment.
[0036] Figure 6 It is a flowchart of a packet parser in the data plane of a programmable switch performing packet parsing shown according to an exemplary embodiment.
[0037] Figure 7 It is a network topology diagram of RDMA shown according to an exemplary embodiment.
[0038] Figure 8 It is a block diagram of a network transmission testing device shown according to an exemplary embodiment.
[0039] Figure 9 It schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed implementation manners
[0040] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0042] To improve RDMA performance, different traffic and congestion control algorithms are often adopted in the network, such as rate-based congestion control algorithms, namely, Data Center Quantized Congestion Notification (DCQCN) algorithm, High Precision Congestion Control (HPCC) algorithm, etc. When facing network packet loss, the performance responses of different traffic and congestion control algorithms are significantly different. Therefore, testing the impact of packet loss on these algorithms in the actual network environment is crucial for optimizing the performance of the RDMA network.
[0043] In one technical solution, a Field Programmable Gate Array (FPGA) is used to drop packets from the RDMA traffic. Refer to Figure 1 , Figure 1 which shows a schematic diagram of using an FPGA development board to test packet loss for RDMA traffic in a related solution. The FPGA development board needs to be directly connected to two RDMA Network Interface Controllers (also known as network cards, NICs) that transmit and receive RDMA traffic. An RDMA connection is established between the network cards and traffic packets are sent. When the packets pass through the middle FPGA development board, the FPGA performs packet dropping or forwarding operations, so as to observe the impact of packet loss on the performance of the RDMA network.
[0044] This solution has the following disadvantages: 1) The FPGA development board needs to be directly connected to the network card and cannot be flexibly arranged among various network devices, so the testable network topologies are limited. 2) The high-speed network interfaces of the FPGA development board are limited and cannot conduct tests related to large-scale multi-machine RDMA traffic.
[0045] In another technical solution, a network impairment emulator is used to test packet loss for RDMA traffic. Refer to Figure 2 , Figure 2 which shows a schematic diagram of using a network impairment emulator to test packet loss for RDMA traffic in a related solution. A network impairment emulator is connected between network devices and configured to perform packet dropping operations on the traffic for related tests. However, this solution has the following disadvantages: 1) Insufficient bandwidth: The network rate of a single interface of the network impairment emulator is limited (such as 10G), and it cannot conduct high-performance RDMA traffic tests (usually starting from hundreds of G). 2) Expensive: The network impairment emulator is charged according to the number of opened interfaces, and it is expensive to test large-scale network topologies.
[0046] The above-mentioned RDMA traffic testing methods and devices can usually only passively perform basic statistical analysis and diagnosis after packet loss occurs in the network. These tools are usually insufficient in terms of the accuracy and flexibility of packet loss simulation, and lack precise control means for actively damaging network traffic. Especially in dynamic loads and complex network topologies in actual deployment environments, it is more difficult to deploy tools and devices.
[0047] Based on this, according to the embodiments of the present disclosure, a network transmission testing method, a network transmission testing device, a programmable switch, an electronic device, a computer-readable storage medium, and a computer program product are provided.
[0048] Figure 3 is a flowchart of a network transmission testing method shown according to an exemplary embodiment. As Figure 3 shown, the network transmission testing method can be used in a computer device. Among them, the computer device described in the present disclosure can include mobile terminal devices such as mobile phones, tablet computers, laptop computers, handheld computers, personal digital assistants (PDAs), etc., and fixed terminal devices such as desktop computers. This exemplary embodiment takes the application of this method in a computer device as an example for illustration. It can be understood that this method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. Specifically, it includes the following steps.
[0049] Step S310, receive initial network data, and determine the network data to be tested based on the initial network data.
[0050] Step S320, based on a pre-configured data transmission packet loss policy, determine a target test packet loss policy that matches the network data to be tested. The data transmission packet loss policy is generated by performing a configuration operation on a programmable switch.
[0051] Step S330, perform a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result.
[0052] Step S340, according to the packet loss test result, determine the data transmission performance of the network data to be tested under different data transmission control policies.
[0053] According to the network transmission testing method in this exemplary embodiment, on the one hand, by pre-configuring a data transmission packet loss policy in a programmable switch, precise control of the packet loss test of network data can be achieved, and the traffic performance loss under different packet loss conditions can be flexibly simulated. On the other hand, since the programmable switch supports flexible rule configuration, the data transmission packet loss policy can be configured according to different test requirements to meet various performance test requirements.
[0054] Next, the network transmission test method in this exemplary embodiment will be further described.
[0055] In step S310, initial network data is received, and the network data to be tested is determined based on the initial network data.
[0056] In an exemplary implementation manner of the present disclosure, the initial network data may be network transmission data initially received by a programmable switch. The network data to be tested may be a part of specified network data determined after the programmable switch performs packet parsing processing on the initial network data. A programmable switch is a network device that can customize the forwarding logic according to user requirements. It breaks the limitation of the fixed forwarding rules of traditional switches and has higher flexibility and scalability.
[0057] The data plane of the programmable switch is used to transmit network data. For example, the data plane of the programmable switch may use the received traffic data of a specified type as the initial network data. After receiving the initial network data, packet parsing processing can be performed on it to determine the network data to be tested that meets the conditions. For example, during the network data transmission process, it may be necessary to perform corresponding tests on different types of network data. At this time, a part of the network data that meets the conditions can be filtered out from the initial network data as the network data to be tested, so as to perform corresponding packet loss tests on it later to determine the impact on network performance under different packet loss conditions.
[0058] In step S320, based on the pre-configured data transmission packet loss policy, a target test packet loss policy matching the network data to be tested is determined. The data transmission packet loss policy is generated by performing configuration operations on the programmable switch.
[0059] In an exemplary implementation manner of the present disclosure, the data transmission packet loss policy may be a policy adopted to simulate the performance loss of network data under different packet loss conditions during network communication. The target test packet loss policy may be a specific packet loss policy matching a certain packet loss test condition of the network data to be tested.
[0060] In the present disclosure, when performing traffic loss tests on network data transmission, it can be implemented through a programmable switch. For example, a P4 programmable switch can be used to implement it. P4 (Programming Protocol-independent Packet Processors) is a programming language that can be used to control the packet forwarding plane in network devices (such as routers and switches). The present disclosure can perform policy configuration operations through the control plane (also known as the control layer) of the programmable switch to generate a data transmission packet loss policy.
[0061] Configuration and management operations can be performed through the control plane of a programmable switch. For example, the configuration and management operations may include operations such as configuration parsing and configuration distribution. The configuration distribution function is used to transmit the generated data transmission packet loss policy to the data plane of the programmable switch. For example, the data plane of the programmable switch stores the data transmission packet loss policy in a pre-configured match-action rule table (abbreviated as the rule table). After receiving the network data to be tested, the data plane of the programmable switch can determine the target test packet loss policy that matches it from the rule table, and then perform subsequent packet loss tests.
[0062] In step S330, based on the target test packet loss policy, a packet loss test is performed on the network data to be tested, and a packet loss test result is obtained.
[0063] In an exemplary embodiment of the present disclosure, the packet loss test result may be a test result obtained by performing a packet loss test on the network data to be tested using one or more data transmission packet loss policies.
[0064] After the data plane of the programmable switch matches the specific packet loss policy (i.e., the target test packet loss policy) for performing a packet loss test on the network data to be tested from the rule table, a packet loss test is performed according to the target test packet loss policy, thereby determining the packet loss test result.
[0065] In step S340, according to the packet loss test result, the data transmission performance of the network data to be tested under different data transmission control policies is determined.
[0066] In an exemplary embodiment of the present disclosure, the data transmission control policy may be a traffic control algorithm or a congestion control algorithm, etc. adopted during the network data transmission process. The data transmission performance may be the performance impact caused by different packet loss conditions on the data transmission control policy.
[0067] After obtaining the packet loss test result, the control plane of the programmable switch obtains the transmission situation of the specified type of traffic data from the data plane through the status reading function, realizes traffic monitoring of the specified type of traffic data, and thus determines the data transmission performance of the network data to be tested under different traffic control algorithms or congestion control algorithms according to the traffic monitoring result.
[0068] The present disclosure takes network data of a specified type as RDMA traffic data as an example to illustrate the entire test process. Since network packet loss in RDMA traffic particularly affects the overall communication performance, the present disclosure focuses on describing how to implement packet loss operations on RDMA (RDMA over Converged Ethernet, RoCE) packets based on converged Ethernet in the RDMA traffic using a programmable switch, and simulates the RDMA traffic transmission under different packet loss conditions by precisely controlling the packet loss behavior, so as to test the performance impact of packet loss on different flow control algorithms and / or congestion control algorithms.
[0069] Before performing the packet loss test, the present disclosure can pre-configure and manage the control plane of the programmable switch to generate a data transmission packet loss policy. In an exemplary embodiment of the present disclosure, the data transmission packet loss policy can be generated through the following steps: determining the data transmission test requirements, where the data transmission test requirements include one or more of data identification rules, packet loss modes, and packet loss parameters; performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirements to generate a data transmission packet loss policy.
[0070] Among them, the data transmission test requirements can be a requirements document corresponding to a series of conditions, requirements, and goals that need to be clarified and met during the data transmission test. The control layer of the programmable switch can be one of the core components of the programmable switch, mainly responsible for controlling and managing various functions and behaviors of the switch. For example, the control layer can be used to receive the configuration operations of users and generate a data transmission packet loss policy according to the configuration operations.
[0071] Reference Figure 4 , Figure 4 is an overall flowchart of a programmable switch implementing an RDMA traffic impairment test scheme shown according to an exemplary embodiment. Figure 4 The control plane of the programmable switch in
[0072] is used to perform configuration management operations. The data transmission test requirements can be configured through the control plane, and the data transmission test requirements can include configuration parameters such as traffic identification rules, traffic packet loss modes, and packet loss parameters. Specifically, the parameters involved in the configuration operation can include: data identification rules, also known as traffic identification rules, which can be specific rules used by the programmable switch to identify and process the initial traffic data. The packet loss mode can be different situations or ways of how the test network data is actually treated for packet loss in the network; for example, the packet loss mode can include, but is not limited to, random packet loss, periodic packet loss, burst packet loss, and tail packet loss. The packet loss parameters can be some quantitative indicators used to describe the packet loss situation in the network; for example, the packet loss parameters can include, but are not limited to, packet loss rate, average packet loss interval, consecutive packet loss count, packet loss distribution, etc.
[0073] The control plane can be used to be responsible for reading the data transmission test requirements provided by the user, and perform corresponding policy configuration operations on the control plane according to the data transmission test requirements, and issue the generated data transmission packet loss policy to the data plane. The programmable switch supports flexible rule or policy configuration, enabling users to freely adjust the packet loss policy according to different test requirements to meet various performance test requirements.
[0074] In an exemplary embodiment of the present disclosure, performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirements to generate a data transmission packet loss policy includes: determining the specified packet loss quantity corresponding to a single packet and a continuous packet sequence respectively according to the data transmission test requirements; determining the packet loss probability and packet loss accuracy according to the data transmission test requirements; generating a first packet loss policy according to the specified packet loss quantity, packet loss probability and packet loss accuracy; obtaining the data transmission parameters corresponding to the network data for data transmission, where the data transmission parameters include one or more of the source address, destination address and port range corresponding to the network data; generating a second packet loss policy based on the first packet loss policy and the data transmission parameters.
[0075] Among them, the continuous packet sequence can be a sequence composed of a series of packets arranged in a specific order and continuous in time in data communication. The specified packet loss quantity can be the packet loss quantity corresponding to a single packet and a continuous packet sequence respectively during data transmission. The packet loss probability can refer to the likelihood of packet loss during data transmission. The packet loss accuracy can refer to the accuracy level when measuring or counting network packet loss, which reflects the closeness of the obtained packet loss data to the actual packet loss situation. The first packet loss policy can be a packet loss policy generated based on packet loss related parameters. The data transmission parameters can be the parameter indicators used for data transmission in the network. The source address and destination address are respectively used to identify the information of the data sender and receiver in network communication. The port range can refer to the value range of the port number. The second packet loss policy can be a packet loss policy generated by combining the data transmission parameters on the basis of the first packet loss policy.
[0076] When performing the policy configuration operation, the user can accurately specify the number of packet losses according to the data transmission test requirements, and can accurately set the packet loss quantity from a single packet to a large-scale continuous packet sequence. At the same time, it supports setting the packet loss probability in percentage form, and the range of the packet loss probability covers from a very low probability (such as 0.01%) to a relatively high probability (such as 99%); and the packet loss accuracy can reach an extremely high accuracy level of 2 32 levels to meet different levels of packet loss simulation requirements. According to the specified packet loss quantity, packet loss probability and packet loss accuracy configured by the user, a first packet loss policy can be generated to guide the packet loss test process of the network data to be tested.
[0077] With the above configuration, the programmable switch can support different packet loss modes: the P4 programmable switch can implement different types of packet loss strategies according to test requirements. For example, users can choose random packet loss (such as presetting the packet loss probability), or choose to discard a fixed number of packets (for example, discard 10 packets out of every 100 packets), etc.
[0078] Furthermore, users can further refine the packet loss strategy according to data transmission parameters. The data transmission parameters can include parameters such as the source Internet Protocol Address (IP address), destination IP address, port range, etc. According to the above parameters, the first packet loss strategy is refined to generate a second packet loss strategy, realizing precise packet loss control for specific RDMA traffic sources or destinations.
[0079] Since it supports users' configuration operations, the programmable switch has good flexibility and programmability. For example, the P4 programmable switch can process network data packets according to user-defined rules. Different from the fixed forwarding and processing logic of traditional switches, P4 allows users to define the parsing, matching, modification, and forwarding behaviors of data packets by writing P4 programs, which provides a basis for implementing specific packet loss control for RDMA traffic.
[0080] In an exemplary embodiment of the present disclosure, for step S310, determining the network data to be tested based on the initial network data includes: through a programmable switch, performing packet parsing processing on the initial network data to obtain a packet parsing result, where the packet parsing result includes packet header information, and the packet header information includes multiple field information; performing field matching processing on the field information in the packet header information to obtain a field matching result; and determining the network data to be tested according to the field matching result.
[0081] Among them, the packet parsing result can be the result obtained after performing packet parsing processing on the initial network data. The packet header information can be a section of data located at the beginning of the packet, containing various control and identification information about the packet, which is used to guide the transmission, processing, and reception of the packet in the network. The field information can be the specific field values of the fields included in the packet header. The field matching result can be the specific result obtained after performing matching processing on the field values included in the field information and the field reference values.
[0082] Take the RDMA traffic received on the data plane of the programmable switch as the initial network data. Then, refer to Figure 5 , Figure 5 is a processing flowchart of the data plane of the programmable switch shown according to an exemplary embodiment. In Figure 5In this process, through the packet parser in the data plane, the initial network data is processed by packet parsing to obtain the packet parsing result. Packet parsing occurs in the first stage when the packet enters the switch port, and all the fields required in all subsequent pipelines need to be parsed out during the packet parsing stage as the packet parsing result.
[0083] Since the packet parsing result includes the packet header information, and the packet header information includes multiple field information, by performing field matching processing on the field information in the packet header information, the field matching result can be obtained. According to the field matching result, the network data to be tested corresponding to this packet loss test can be determined from the initial network data. Taking the RDMA data as the network data to be tested as an example, the packet parsing process is described.
[0084] Reference Figure 6 , Figure 6 is a flowchart showing packet parsing by the packet parser in the data plane of a programmable switch according to an exemplary embodiment. The packet header information may include fields at different levels in the Open System Interconnect (OSI) reference model; Figure 6 The Ethernet packet format field (Ethernet) in [[ ]] is equivalent to the field corresponding to the data link layer and the physical layer; the network layer field may include Internet Protocol version 4 (IPv4); the transport protocol field, such as the User Datagram Protocol (UDP), is equivalent to the field at the transport layer. The fields at the application layer may include the RoCE Base Transport Header (BTH) and the RoCE Authentication and Error Tagging Header (AETH), etc.
[0085] Figure 6Taking the parsing process of RDMA RoCE packets as an example, during the packet parsing process, if the protocol ether_type of the frame data field is 4, the packet is considered an IPv4 packet; if ether_type is other values, an error is reported and the current field matching operation ends; continue with the next field matching. If the protocol proto selected for data transmission is UDP, it is considered to meet the matching conditions, otherwise an error is reported and the current field matching operation ends; for packets with proto = UDP, continue with the next field matching operation. If the destination port field dst_port = 4791, it is considered to meet the matching conditions, otherwise an error is reported and the current field matching operation ends; then perform the matching operation on the opcode field. If the opcode field OpCode = 0x11, it is considered to meet the matching conditions, and packets that meet the above conditions are RoCE packets; otherwise an error is reported and the current field matching operation ends. The parsing path of the Parser is as Figure 6 shown, and it needs to be parsed as deep as the RoCE AETH layer at most.
[0086] It is easy for those skilled in the art to understand that this disclosure only takes the parsing process of RDMA RoCE packets as an example. In some other exemplary embodiments of this disclosure, other parameters can also be configured for other types of packets, and this disclosure does not make any special limitations on the specific types of parsed packets.
[0087] Figure 6 When network traffic enters the P4 programmable switch, the data plane first deeply parses the packets. The developed P4 program precisely defines the processing requirements of the data plane for RDMA traffic packets. For example, this disclosure can use RoCE packets to implement the packet loss test of RDMA traffic. When identifying RoCE packets, a variety of packet header information is comprehensively used, such as source and destination IP addresses, port numbers, RoCE protocol-specific identifiers, etc., through a multi-field matching mechanism to ensure that the RDMA traffic that needs to be processed for packet loss is accurately screened out and used as the network data to be tested. Through the packet parsing process, the network data to be tested that needs to be processed for packet loss can be accurately screened out from the initial network data and a packet loss test can be performed.
[0088] In some other exemplary embodiments of this disclosure, other types of network data can also be selected from the initial network data as the network data to be tested according to the test requirements, and this disclosure does not make any special limitations on the specific types of the network data to be tested. The specific parsing process of other types of network data is similar to the above packet parsing process, and this disclosure will not elaborate on it here.
[0089] In an exemplary embodiment of the present disclosure, for step S320, determining a target test packet loss policy that matches the network data to be tested based on a pre-configured data transmission packet loss policy includes: determining a packet loss test scenario corresponding to the network data to be tested; and determining a target test packet loss policy corresponding to the packet loss test scenario from multiple data transmission packet loss policies.
[0090] Continuing to refer to Figure 5 , after determining the network data to be tested, according to the match-action table structure (rule table) predefined in the P4 program, a hardware-accelerated matching algorithm is used to quickly match and search the RoCE packet header information to determine the data transmission packet loss policy that the network data to be tested can adopt.
[0091] For example, determining the packet loss test scenario corresponding to the network data to be tested in the packet loss test. The packet loss test scenario may refer to various situations for detecting and evaluating the packet loss situation in the network under specific conditions. For example, the packet loss test scenario may include an exact packet loss scenario and a random packet loss scenario, etc.
[0092] After determining the packet loss test scenario, a target test packet loss policy is selected from multiple data transmission packet loss policies according to the packet loss test scenario. Thus, the target test packet loss policy is used to perform a packet loss test on the network data to be tested under a specific packet loss test scenario, and the corresponding packet loss test result is obtained. By querying the match-action rule table for the packet, the execution logic corresponding to different packet loss test scenarios can be determined, which is used to distinguish whether subsequent operations need to be performed on the packet.
[0093] In an exemplary embodiment of the present disclosure, performing a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result includes: performing packet matching processing on the network data to be tested to obtain a first test packet; obtaining a pre-configured packet counter; updating the packet counter according to the matched first test packet to obtain a counter value; when the counter value reaches the packet loss quantity threshold, performing a packet loss operation on the first test packet and adding a packet loss mark to the first test packet; and determining the packet loss test result based on the packet loss operation.
[0094] Among them, the exact packet loss scenario may be a scenario where it is necessary to accurately control and simulate the packet loss situation during the network transmission test. The packet matching processing may be a matching process for determining whether the network data to be tested is a certain specific type of packet. The first test packet may be a specified type of test packet used to test the exact packet loss scenario. The packet counter may be a counter for recording the number of packets. The counter value may be the specific value of the packet counter. The packet loss quantity threshold may be a reference threshold for comparing with the packet loss quantity. The packet loss mark may be a mark indicating that a certain packet has been lost.
[0095] Continue to refer to Figure 5 After the message parsing is completed, according to the test requirements, the message matching process is performed on the network data to be tested to obtain the first test message. For example, the current test requirement is to perform an accurate packet loss test on RDMA traffic. Once it is determined that a certain message belongs to the RDMA traffic that needs to perform packet loss processing, it is used as the first test message.
[0096] For the accurate packet loss scenario of RDMA, a high-precision message counter is maintained inside the data plane. When performing an accurate packet loss test, the message counter starts to work. For each successfully matched qualified message, the counter value correspondingly increases by a value and gradually increments. When the counter value reaches the packet loss quantity threshold set by the user, the packet loss action is immediately executed, that is, the message is removed from the data forwarding path, and a packet loss mark is added to the first test message that performs the packet loss operation; at the same time, relevant statistical information is updated, such as the total number of packet losses, the number of forwarded messages, etc., as the packet loss test result.
[0097] In the accurate packet loss scenario, the packet loss policy can be configured to discard the data with the serial number 100 for every 100 data transmitted. For example, when 100 data need to be transmitted, precisely control the packet loss of the data with the serial number 100. For continuous packet loss actions, the number of forwarded packets and the number of packet losses are recorded through the hardware registers of the data plane, and whether to mark packet loss is determined by comparing the count with the rule configuration value. Through the above test process, the packet loss probability, the number of packet losses, and the packet loss mode can be precisely controlled to achieve accurate packet loss control.
[0098] In an exemplary embodiment of the present disclosure, a packet loss test is performed on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result, including: performing a message matching process on the network data to be tested to obtain a second test message; in response to receiving the second test message, generating a random number based on a random number generator, and comparing the random number with a pre-configured packet loss probability threshold; when the random number is less than the packet loss probability threshold, performing a packet loss operation on the second test message and adding a packet loss mark to the second test message; when the random number is greater than or equal to the packet loss probability threshold, forwarding the second test message.
[0099] Among them, the random packet loss scenario refers to the situation where the network data to be tested is packet lost with random numbers in the network environment. The second test message can be a test message used to test the random packet loss scenario. The types of the second test message and the first test message can be the same or different. The packet loss probability threshold can be a reference threshold used to compare with the packet loss probability.
[0100] The present disclosure also provides a random packet loss test for network data to be tested in a random packet loss scenario. The network data to be tested for random packet loss testing can be used as the second test packet. Similarly, for the network data to be tested whose packet parsing has been completed, packet matching processing is performed to obtain the second test packet. The packet types of the second test packet and the first test packet can be the same or different, which can be specifically determined according to the test requirements.
[0101] Continuing to refer to Figure 5 , in a random packet loss scenario, the data plane calls a built-in high-performance random number generator. This random number generator is based on an advanced pseudo-random algorithm and can quickly generate a high-quality random number sequence. Whenever a RoCE packet is matched, a 32-bit random number between 0 and 2 32 -1 is generated. This random number is compared with the packet loss probability threshold set by the user. For example, the random value of the packet is compared with the pre-configured packet loss probability threshold through the hardware register of the data plane. If the random number is less than the packet loss probability threshold, a packet loss operation is performed; otherwise, when the random number is greater than or equal to the packet loss probability threshold, the packet will be processed according to the normal forwarding process.
[0102] In a random packet loss scenario, the packet loss policy can be configured with a packet loss rate of 1%. There is no limit on the sequence numbers of the specifically lost packets. For example, when 10,000 packets need to be transmitted, every 100 packets are transmitted. Instead of specifying that the packet with sequence number 100 is discarded, only 100 packets out of the 10,000 transmitted packets are lost. The above operation process realizes the packet loss test in a random packet loss scenario. To ensure the efficiency and low latency of the packet loss operation, the data plane adopts a pipelined processing architecture, reasonably distributing multiple operation steps such as packet parsing, matching, and packet loss decision to different processing stages to achieve parallel processing, greatly improving the speed and throughput of packet loss processing.
[0103] In an exemplary embodiment of the present disclosure, the test packet with a packet loss mark is used as the third test packet; the number of packet loss packets and the packet loss upper limit threshold during the packet loss test are obtained; when the number of packet loss packets is less than the packet loss upper limit threshold, a packet loss operation is performed on the third test packet; when the number of packet loss packets is greater than or equal to the packet loss upper limit threshold, a forwarding operation is performed on the third test packet.
[0104] Among them, the third test packet can be a packet marked with a packet loss mark in the packet loss test. The number of packet loss packets can be the number of packets for which packet loss operations have been performed in the simulated test scenario, that is, the number of packet loss packets can be the sum of the numbers of packets with packet loss marks in the first test packet and the second test packet. The packet loss upper limit threshold can be a reference threshold for the maximum number of packet loss packets for which packet loss operations have been completed.
[0105] Continue to refer to Figure 5 , in Figure 5 , after determining the test packet to perform continuous packet loss test and random packet loss test, the test packet with the packet loss mark added is used as the test packet for packet loss. For the packet marked with packet loss, the hardware register on the data plane is used to judge the upper limit of packet loss for the number of packet loss packets and the pre-configured upper limit threshold of packet loss. If the number of packet loss packets is less than the upper limit threshold of packet loss, the packet is lost. When the number of packet loss packets is greater than or equal to the upper limit threshold of packet loss, the packet is forwarded. Finally, the packets forwarded by the programmable switch and the packet loss packets are determined. Through the above steps, the programmable switch can implement the forwarding and packet loss test of the received RDMA traffic, so as to determine the network performance according to the packet loss test result later.
[0106] In an exemplary embodiment of the present disclosure, for step S340, according to the packet loss test result, determine the data transmission performance of the network data to be tested under different data transmission control strategies, including: obtaining the packet parsing result corresponding to the network data to be tested, where the packet parsing result includes one or more of the packet type of the network data to be tested and the packet discarded part; determining the target network layer corresponding to the programmable switch in the network topology, and the programmable switch is deployed in any network layer of the network topology; according to the packet loss test result and the packet parsing result, determine the data transmission performance of the target network layer.
[0107] Among them, the packet type of the network data to be tested can be the specific type of the packet corresponding to the network data to be tested. The packet discarded part can be the specific part of the packet loss data in the network data to be tested, including the head, middle and tail.
[0108] Continue to refer to Figure 4 , through Figure 4 , the packet parsing result corresponding to the network data to be tested can be obtained by the packet parser on the data plane in . In the packet parsing stage, all the fields required in all subsequent pipelines need to be parsed out for subsequent use. The status reading function of the control plane can obtain the packet loss test result generated by the packet loss test on the data plane through the traffic monitoring operation.
[0109] For the message parsing results, the test requirements need to verify the impact of packet loss of different types of messages in the network on performance, as well as the impact of discarding Acknowledge character (ACK) messages and Negative Acknowledgment (NAK) messages on network performance, etc. Different types of messages can also include the impact of different packet discard parts of discarded data on network performance. For example, it includes the impact of the first, middle, and last parts of the message on performance. Different parts of the message can be determined by matching the option code. The message parsing results all contain the fields required for the test requirements.
[0110] Since the RDMA traffic transmission is carried out through the communication network, in order to test the impact of packet loss on network performance at different network levels, programmable switches can be deployed between devices at each level of the network topology to facilitate packet loss testing at all levels and test the impact of packet loss on the RDMA network performance on different levels of RDMA links. Refer to Figure 7 , Figure 7 is a network topology diagram of RDMA shown according to an exemplary embodiment.
[0111] From Figure 7 it can be seen that programmable switches can be deployed between devices at each level of the network topology. For example, a P4 programmable switch can be deployed between the network levels where the RDMA "Spine" switch is located and the network level where the RDMA "Leaf" switch is located; a P4 programmable switch can be deployed between the network levels where the RDMA Leaf is located and the network level where the RDMA Top of Rack (RDMA ToR) switch is located to test the impact of packet loss at different network levels on the RDMA network performance.
[0112] During the traffic monitoring process, the target network level corresponding to the programmable switch in the network topology can be determined. For example, if the programmable switch is deployed between the RDMA Leaf and the RDMA ToR, the network level where the programmable switch is located in the network topology is used as the target network level. Subsequently, based on the packet loss test results and the message parsing results, the impact on the data transmission performance of the target network level under different packet loss conditions can be determined. The RDMA network transmission test scheme based on the P4 programmable switch can implement the above functions of packet loss, out-of-order, and delay; for example, accurately controlling the number of network packet losses; controlling the packet loss position (head / middle / tail packet); and accurately matching and controlling the packet loss messages.
[0113] Continue to refer to Figure 4 ,Figure 4 When performing traffic monitoring on the programmable switch in , detailed statistics and analysis can be carried out for packet loss events, and relevant information such as independent packet loss count records and forwarding count records can be made for each rule. According to the packet loss test results, the data transmission performance of different network levels in the entire network topology can be determined, so as to test the impact of packet loss on the data transmission performance of different network levels in the entire network topology under different traffic control algorithms or congestion control algorithms.
[0114] In summary, for the network transmission test method of the present disclosure, a pre-configured data transmission packet loss policy is obtained, and the data transmission packet loss policy is generated by performing configuration operations on the programmable switch; initial network data is received, and the network data to be tested is determined based on the initial network data; packet loss testing is performed on the network data to be tested based on the data transmission packet loss policy to obtain a packet loss test result; according to the packet loss test result, the data transmission performance of the network data to be tested under different data transmission control policies is determined. On the one hand, by pre-configuring the data transmission packet loss policy in the programmable switch, precise control of the packet loss test of network data can be achieved, such as precisely controlling the packet loss position and packet loss messages, and flexibly simulating the traffic performance loss under different packet loss conditions. On the other hand, since the programmable switch supports flexible rule configuration, the data transmission packet loss policy can be configured according to different test requirements to meet various performance test requirements. On the other hand, the programmable switch can be flexibly arranged in the network topology, improving the flexibility of the packet loss test, and having a high cost performance, which can effectively save the test cost. On the other hand, since the RDMA traffic in the data center usually has the characteristics of high bandwidth and low latency. The P4 programmable switch has the ability to process data at high speed and can meet the requirements of line speed processing of RDMA traffic, ensuring that the accuracy of the test results is not affected by the switch performance bottleneck during the simulation of packet loss.
[0115] In addition, the present disclosure also provides a programmable switch. Continuing to refer to Figure 4 , Figure 4 the programmable switch includes: a control plane and a data plane. Specifically, the control plane is used to receive policy configuration operations, generate a data transmission packet loss policy based on the policy configuration operations, and send the data transmission packet loss policy to the data plane; the data plane is used to determine the network data to be tested based on the received initial network data, perform packet loss testing on the network data to be tested according to the data transmission packet loss policy, and obtain a packet loss test result; the control plane is further used to determine the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
[0116] On the one hand, the programmable switch provided by the present disclosure can achieve precise control of packet loss testing for network data by pre-configuring a packet loss policy for data transmission in the programmable switch. For example, it can precisely control the packet loss position and packet loss messages, and flexibly simulate the traffic performance loss under different packet loss conditions. On the other hand, since the programmable switch supports flexible rule configuration, the packet loss policy for data transmission can be configured according to different test requirements to meet various performance test requirements. On the other hand, it can be deployed between devices at all levels of the network topology, facilitating packet loss testing at all levels, testing the impact of packet loss on the RDMA network performance on different levels of RDMA links, and being inexpensive.
[0117] Figure 8 is a block diagram of a network transmission test device shown according to an exemplary embodiment. Referring to Figure 8 FIG. 800, the network transmission test device 800 includes: a test data determination module 810, a packet loss policy determination module 820, a packet loss test module 830, and a performance determination module 840.
[0118] Specifically, the test data determination module 810 is configured to receive initial network data and determine the network data to be tested based on the initial network data; the packet loss policy acquisition module 820 is configured to determine a target test packet loss policy that matches the network data to be tested based on a pre-configured packet loss policy for data transmission, and the packet loss policy for data transmission is generated by performing a configuration operation on the programmable switch; the packet loss test module 830 is configured to perform a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result; the performance determination module 840 is configured to determine the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
[0119] In an exemplary embodiment of the present disclosure, the test data determination module 810 includes a test data determination unit, configured to: perform packet parsing processing on the initial network data through the programmable switch to obtain a packet parsing result, where the packet parsing result includes packet header information, and the packet header information includes multiple field information; perform field matching processing on the field information in the packet header information to obtain a field matching result; and determine the network data to be tested according to the field matching result.
[0120] In an exemplary embodiment of the present disclosure, the packet loss policy determination module 820 includes a packet loss policy generation unit, configured to: determine data transmission test requirements, where the data transmission test requirements include one or more of a data identification rule, a packet loss mode, and packet loss parameters; and perform a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirements to generate a packet loss policy for data transmission.
[0121] In an exemplary embodiment of the present disclosure, the packet loss policy generation unit includes a packet loss policy generation subunit, which is configured to: determine the specified packet loss quantity corresponding to a single packet and a continuous packet sequence respectively according to the data transmission test requirements; determine the packet loss probability and packet loss accuracy according to the data transmission test requirements; generate a first packet loss policy according to the specified packet loss quantity, packet loss probability and packet loss accuracy; obtain the data transmission parameters corresponding to the network data for data transmission, where the data transmission parameters include one or more of the source address, target address and port range corresponding to the network data; generate a second packet loss policy based on the first packet loss policy and the data transmission parameters.
[0122] In an exemplary embodiment of the present disclosure, the number of data transmission packet loss policies is multiple, and the packet loss policy determination module 820 further includes a packet loss policy determination unit, which is configured to: determine the packet loss test scenario corresponding to the network data to be tested; determine the target test packet loss policy corresponding to the packet loss test scenario from multiple data transmission packet loss policies.
[0123] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes an exact packet loss scenario, and the packet loss test module 830 includes a first packet loss test unit, which is configured to: perform packet matching processing on the network data to be tested to obtain a first test packet; obtain a pre-configured packet counter; update the packet counter according to the matched first test packet to obtain a counter value; when the counter value reaches the packet loss quantity threshold, perform a packet loss operation on the first test packet and add a packet loss mark to the first test packet; determine the packet loss test result based on the packet loss operation.
[0124] In an exemplary embodiment of the present disclosure, the packet loss test scenario includes a random packet loss scenario, and the packet loss test module 830 includes a second packet loss test unit, which is configured to: perform packet matching processing on the network data to be tested to obtain a second test packet; in response to receiving the second test packet, generate a random number based on a random number generator and compare the random number with a pre-configured packet loss probability threshold; when the random number is less than the packet loss probability threshold, perform a packet loss operation on the second test packet and add a packet loss mark to the second test packet; when the random number is greater than or equal to the packet loss probability threshold, forward the second test packet.
[0125] In an exemplary embodiment of the present disclosure, the network transmission test device 800 further includes a packet loss forwarding processing module, which is configured to: use the test packet with a packet loss mark as a third test packet; obtain the number of packet loss packets and the packet loss upper limit threshold during the packet loss test; when the number of packet loss packets is less than the packet loss upper limit threshold, perform a packet loss operation on the third test packet; when the number of packet loss packets is greater than or equal to the packet loss upper limit threshold, perform a forwarding operation on the third test packet.
[0126] In an exemplary implementation of the present disclosure, the performance determination module 840 includes a performance determination unit configured to: obtain a packet parsing result corresponding to the network data to be tested, where the packet parsing result includes one or more of the packet type of the network data to be tested and the discarded part of the packet; determine the target network layer corresponding to the programmable switch in the network topology, where the programmable switch is deployed at any network layer in the network topology; and determine the data transmission performance of the target network layer according to the packet loss test result and the packet parsing result.
[0127] Reference is now made to Figure 9 describe the electronic device 900 according to this embodiment of the present disclosure. Figure 9 The illustrated electronic device 900 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0128] As Figure 9 shown, the electronic device 900 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one of the above-mentioned processing units 910, at least one of the above-mentioned storage units 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
[0129] Wherein, the storage unit stores program code, and the program code can be executed by the processing unit 910, so that the processing unit 910 executes the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0130] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 921 and / or a cache storage unit 922, and may further include a read-only storage unit (ROM) 923.
[0131] The storage unit 920 may include a program / utility 924 having a set (at least one) of program modules 925. Such program modules 925 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0132] The bus 930 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any bus structure in a variety of bus structures.
[0133] The electronic device 900 can also communicate with one or more external devices 970 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 950. Moreover, the electronic device 900 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 960. As shown in the figure, the network adapter 960 communicates with other modules of the electronic device 900 through the bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0134] In an exemplary embodiment, there is also provided a computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of the device to complete the above network transmission test method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0135] In an exemplary embodiment, there is also provided a computer program product including a computer program, and when the computer program is executed by a processor, it implements the network transmission test method described in any one of the above.
[0136] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0137] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A network transmission testing method, characterized in that, Including: Receiving initial network data and determining network data to be tested based on the initial network data; Determining a target test packet loss policy matching the network data to be tested based on a pre-configured data transmission packet loss policy, where the data transmission packet loss policy is generated by performing a configuration operation on a programmable switch; Performing a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result; Determining the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
2. The method according to claim 1, wherein The determining the network data to be tested based on the initial network data includes: Performing packet parsing processing on the initial network data through the programmable switch to obtain a packet parsing result, where the packet parsing result includes packet header information, and the packet header information includes multiple field information; Performing field matching processing on the field information in the packet header information to obtain a field matching result; Determining the network data to be tested according to the field matching result.
3. The method according to claim 1, characterized in that, The method further includes: Determining a data transmission test requirement, where the data transmission test requirement includes one or more of a data identification rule, a packet loss mode, and packet loss parameters; Performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirement to generate the data transmission packet loss policy.
4. The method according to claim 3, wherein The performing a policy configuration operation on the control layer of the programmable switch based on the data transmission test requirement to generate the data transmission packet loss policy includes: Determining a specified packet loss quantity corresponding to each of a single packet and a continuous packet sequence according to the data transmission test requirement; Determining a packet loss probability and a packet loss accuracy according to the data transmission test requirement; Generating a first packet loss policy according to the specified packet loss quantity, the packet loss probability, and the packet loss accuracy; Obtaining data transmission parameters corresponding to the data transmission of the network data, where the data transmission parameters include one or more of a source address, a target address, and a port range corresponding to the network data; Generating a second packet loss policy based on the first packet loss policy and the data transmission parameters.
5. The method according to claim 1, wherein The number of the data transmission packet loss policies is multiple, and the determining a target test packet loss policy matching the network data to be tested based on the pre-configured data transmission packet loss policy includes: Determining a packet loss test scenario corresponding to the network data to be tested; Determining a target test packet loss policy corresponding to the packet loss test scenario from multiple data transmission packet loss policies.
6. The method according to claim 5, characterized in that The packet loss test scenario includes an exact packet loss scenario, and the performing a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result includes: Performing packet matching processing on the network data to be tested to obtain a first test packet; Obtaining a pre-configured packet counter; Updating the packet counter according to the matched first test packet to obtain a counter value; When the counter value reaches a packet loss quantity threshold, performing a packet loss operation on the first test packet and adding a packet loss mark to the first test packet; Determining the packet loss test result based on the packet loss operation.
7. The method according to claim 5, wherein The packet loss test scenario includes a random packet loss scenario. The packet loss test of the network data to be tested according to the target test packet loss policy to obtain a packet loss test result includes: Perform packet matching processing on the network data to be tested to obtain a second test packet; In response to receiving the second test packet, generate a random number based on a random number generator, and compare the random number with a pre-configured packet loss probability threshold; When the random number is less than the packet loss probability threshold, perform a packet loss operation on the second test packet and add a packet loss mark to the second test packet; When the random number is greater than or equal to the packet loss probability threshold, forward the second test packet.
8. The method according to claim 6 or 7, characterized in that, The method further includes: Use the test packet with the packet loss mark as the third test packet; Obtain the number of packet loss packets and the packet loss upper limit threshold during the packet loss test process; When the number of packet loss packets is less than the packet loss upper limit threshold, perform a packet loss operation on the third test packet; When the number of packet loss packets is greater than or equal to the packet loss upper limit threshold, perform a forwarding operation on the third test packet.
9. The method according to claim 1, characterized in that Determining the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result includes: Obtain the packet parsing result corresponding to the network data to be tested, where the packet parsing result includes one or more of the packet type of the network data to be tested and the discarded part of the packet; Determine the target network layer corresponding to the programmable switch in the network topology, and the programmable switch is deployed at any network layer of the network topology; According to the packet loss test result and the packet parsing result, determine the data transmission performance of the target network layer.
10. A network transmission testing device, characterized in that, Includes: A test data determination module, configured to receive initial network data and determine network data to be tested based on the initial network data; A packet loss policy determination module, configured to determine a target test packet loss policy matching the network data to be tested based on a pre-configured data transmission packet loss policy, and the data transmission packet loss policy is generated by performing a configuration operation on a programmable switch; A packet loss test module, configured to perform a packet loss test on the network data to be tested according to the target test packet loss policy to obtain a packet loss test result; A performance determination module, configured to determine the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
11. A programmable switch, characterized in that, Includes: A control plane and a data plane; The control plane is configured to receive a policy configuration operation, generate a data transmission packet loss policy based on the policy configuration operation, and send the data transmission packet loss policy to the data plane; The data plane is configured to determine network data to be tested based on the received initial network data, and perform a packet loss test on the network data to be tested according to the data transmission packet loss policy to obtain a packet loss test result; The control plane is further configured to determine the data transmission performance of the network data to be tested under different data transmission control policies according to the packet loss test result.
12. An electronic device, characterized in that, Includes: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the network transmission test method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the network transmission test method according to any one of claims 1 to 9.