CN117749681A - Network testing method and device, storage medium and electronic equipment - Google Patents

Network testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117749681A
CN117749681A CN202311737232.0A CN202311737232A CN117749681A CN 117749681 A CN117749681 A CN 117749681A CN 202311737232 A CN202311737232 A CN 202311737232A CN 117749681 A CN117749681 A CN 117749681A
Authority
CN
China
Prior art keywords
test
rule
network
data packet
programmable switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311737232.0A
Other languages
Chinese (zh)
Inventor
梁芷馨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202311737232.0A priority Critical patent/CN117749681A/en
Publication of CN117749681A publication Critical patent/CN117749681A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a network testing method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a test rule, wherein the test rule is used for indicating the programmable switch to process and forward a data packet; sending the test rule to a programmable switch, and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet; and obtaining a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network. By adopting the technical scheme, the problem that the traditional test scheme cannot adapt to changeable test scenes and has poor test flexibility when network test is carried out is solved.

Description

Network testing method and device, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a network testing method and device, a storage medium and electronic equipment.
Background
Network function and performance testing is the ability to evaluate and verify the performance and function of a network device, application, or system under different conditions. Such testing typically involves simulating real network environments and traffic to determine the performance of the system under high load, high traffic, or different network conditions. With the development of modern network technology, especially in the fields of large-scale data centers, virtual network function deployment and network security, network complexity is rising and emerging technologies are continuously emerging, so that solutions for testing network functions and performances are more and more complex, and the necessity of testing is also increasing.
The common network test system schemes mainly comprise the following three types:
(1) Network testing is performed using various commercial network testing equipment provided by companies and suppliers, such as network analyzers, load generators, performance monitoring tools, and the like; commercial network test equipment is generally high in price, depends on technical support and maintenance of suppliers and is poor in flexibility;
(2) The software tool on the host machine such as tcpreplay, hping, scapy, tcpping is used for directly performing tasks such as simple network traffic generation, performance test and delay measurement in a mode of generating and simulating network traffic on the host machine, but the mode cannot be used for testing a complex network environment;
(3) Network performance and functionality are assessed using network simulators (e.g., GNS3, cisco VIRL) or emulators (e.g., NS-3) to simulate and test network topologies and scenarios in virtual environments, but testing is done in a virtual manner, failing to completely simulate the complex environment in a real network.
In short, the existing network test mode generally has fixed functions and test modes, and cannot flexibly instruct the test scheme according to different test requirements.
Aiming at the problems of the prior art that the traditional test scheme cannot adapt to changeable test scenes and the test flexibility is poor when the network test is carried out, no effective solution is proposed at present.
Disclosure of Invention
The embodiment of the application provides a network testing method and device, a storage medium and electronic equipment, which are used for at least solving the problems that a traditional testing scheme cannot adapt to changeable testing scenes and testing flexibility is poor when network testing is carried out.
According to one embodiment of the present application, there is provided a network testing method including: acquiring a test rule, wherein the test rule is used for indicating a programmable switch to process and forward a data packet; sending the test rule to a programmable switch, and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet; and obtaining a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
In one exemplary embodiment, obtaining the test rule includes: acquiring a message generation rule, a message modification rule and a flow mode rule; wherein the test rule comprises: the message generation rule, the message modification rule and the flow mode rule.
In an exemplary embodiment, after obtaining the test rule, the method further comprises: sending the test rule to a message generator; and indicating the message generator to generate the target data packet according to the test rule, and sending the target data packet to the programmable switch.
In an exemplary embodiment, after obtaining the test rule, the method further comprises: and indicating upstream network equipment of the equipment to be tested to send the target data packet to the programmable switch.
In an exemplary embodiment, after obtaining the test result corresponding to the target data packet from the device to be tested, the method further includes: analyzing the test result through a test result analysis module to obtain an analysis result, wherein the test result comprises: message forwarding rate, delay and packet loss rate; the analysis result is used for representing the network performance of the target network; and displaying the analysis result through a visual interface.
In an exemplary embodiment, the method further comprises: and configuring the programmable switch through a configuration management module, and determining the test scene of the programmable switch.
According to another embodiment of the present application, there is also provided a network test apparatus including: the first acquisition module is used for acquiring a test rule, wherein the test rule is used for indicating the programmable switch to process and forward the data packet; the sending module is used for sending the test rule to the programmable switch and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet; and the second acquisition module is used for acquiring a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
According to another embodiment of the present application, the apparatus comprises: the first acquisition module is used for acquiring a message generation rule, a message modification rule and a flow mode rule; wherein the test rule comprises: the message generation rule, the message modification rule and the flow mode rule.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the present application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device for testing the data packet, the testing rule is obtained, the testing rule is sent to the programmable switch, the programmable switch is instructed to send the target data packet to the device to be tested through the target network, and the testing result corresponding to the target data packet is obtained from the device to be tested. The method and the device have the advantages that the high performance and the customization capability of the programmable switch are utilized, the test rule is used for flexibly processing and forwarding the target data packet, the problem that the traditional test scheme cannot adapt to changeable test scenes when network test is carried out, the test flexibility is poor is solved, and the technical effects of improving the network test flexibility and improving the network test efficiency are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a hardware block diagram of a mobile terminal of a network testing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a network testing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a programmable switch based embodiment of the present application;
fig. 4 is a block diagram of a network testing device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of a network testing method according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store computer programs, such as software programs and modules of application software, such as computer programs corresponding to the network testing method in the embodiments of the present application, and the processor 102 executes the computer programs stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a network testing method is provided, and fig. 2 is a flowchart of a network testing method in this embodiment, as shown in fig. 2, where the flowchart includes the following steps:
step S202, a test rule is obtained, wherein the test rule is used for indicating a programmable switch to process and forward a data packet;
as an alternative embodiment, the programmable switch should have flexible packet processing and forwarding capabilities, such as a switch using a Tofino chip.
As an alternative embodiment, the programmable switch may dynamically adjust network settings and routing rules according to network traffic and demand, thereby enabling efficient data forwarding and management. Meanwhile, based on the programmability of the target object, customized configuration can be carried out according to the requirements of the target object so as to meet different requirements.
It should be noted that, the programmable switch processes and forwards the target data packet mainly according to the test rule.
As an alternative example, a test rule definition interface may be displayed by the test controller, and the test controller may obtain the test rule defined by the target object (e.g., a tester) through the test rule definition interface.
As an alternative example, a test controller may be used to manage and control the behavior of a programmable switch. The test controller may communicate with the programmable switch using a particular programming language or API to configure test scenarios, issue test rules, and collect test data. The test controller comprises a test rule definition module, a programmable switch configuration management module and a visual interface module.
In an exemplary embodiment, the acquisition of the test rule may be implemented by the following step S11:
step S11: acquiring a message generation rule, a message modification rule and a flow mode rule;
it should be noted that the test rule includes: the message generation rule, the message modification rule and the flow mode rule.
As an optional embodiment, the message generating rule includes a format, content, a field and a generating condition of a message, where the format of the message includes a message header format, a message body and a message tail structure, the content of the message includes data, a command, status information and the like, and the generating condition of the message includes a triggering condition and a time condition of the message.
As an alternative embodiment, the modification rules of the message include defining a modifiable portion of the message, modification conditions, modification methods, and the like.
As an alternative embodiment, traffic pattern rules are used to define the type, pattern and optimization of traffic.
It should be noted that, the test rule needs to be uniformly stored in an xml file format.
In an exemplary embodiment, after the test rules are obtained, there are also the following steps S21-S22:
step S21: sending the test rule to a message generator;
step S22: and indicating the message generator to generate the target data packet according to the test rule, and sending the target data packet to the programmable switch.
As an alternative embodiment, the test controller may send the test rule to the message generator, and the message generator further generates the target data packet according to the test rule, and sends the target data packet to the programmable switch.
It should be noted that the message generator may support custom message formats and fields to meet different test requirements.
As an alternative embodiment, the message generator generates the target data packet according to the test rule, which may be implemented by the following steps S1-S5:
s1: analyzing the test rule: the message generator needs to analyze the test rule, including message type, field requirement, data format, etc.;
s2: generating a message header: generating header information of the message according to the message type and field requirements in the test rule, wherein the header information comprises a start identifier, a length, verification and the like of the message;
s3: generating message data: generating a data part of the message according to the data format requirement in the test rule, wherein the data part comprises a value range, a data type and the like of each field;
s4: generating a message tail: generating tail information of the message according to the checksum requirement in the test rule, wherein the tail information comprises a calculated value of a checksum field;
s5: assembling a message: and the message generator assembles the head information, the data information and the tail information of the generated message according to a specified format to generate a final data packet.
In an exemplary embodiment, after the test rule is acquired, there is also the following step S31:
step S31: and indicating upstream network equipment of the equipment to be tested to send the target data packet to the programmable switch.
As an optional embodiment, when the real traffic scenario needs to be restored, the message generator may also be an upstream network device of the real device under test, and perform customization processing and testing directly for the real network traffic.
Step S204, the test rule is sent to a programmable switch, and the programmable switch is instructed to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet;
as an alternative embodiment, the programmable switch first parses the packet in the data packet, determines the destination address of the packet, and determines the device to be tested according to the destination address of the packet.
As an alternative embodiment, the target network includes, but is not limited to, a local area network, a wide area network, a metropolitan area network, a storage area network, and the like, which may be flexibly determined according to a test environment, and the embodiments of the present application are not further limited.
As an alternative embodiment, the test controller and the programmable switch may be externally connected for better management and control of the programmable switch by the test controller.
Step S206, obtaining a test result corresponding to the target data packet from the device to be tested, where the test result is used to evaluate the network performance of the target network.
As an alternative embodiment, the test results include, but are not limited to, performance indicators such as packet forwarding rate, delay, packet loss rate, etc.
In an exemplary embodiment, following step S206, the following steps S41-S42 are also provided:
step S41: analyzing the test result through a test result analysis module to obtain an analysis result, wherein the test result comprises: message forwarding rate, delay and packet loss rate; the analysis result is used for representing the network performance of the target network;
step S42: and displaying the analysis result through a visual interface.
As an alternative embodiment, after the analysis result is obtained, the test result analysis module may send the analysis result to the test controller, and then the test controller displays the analysis result through the visual interface.
As an alternative embodiment, the test result analysis module can convert the analysis result into a form of a table through a graphic tool, and meanwhile, filtering and screening functions are added, so that the target object can compare only for a certain dimension, and in addition, notes and labels can be added in the result to assist the target object in better understanding the content of the analysis result.
As an alternative embodiment, the analysis results support multidimensional data presentation so that the target object can compare and analyze the relationships of multiple variables.
Through the steps S202-S206, a test rule is obtained, the test rule is sent to a programmable switch, the programmable switch is instructed to send a target data packet to a device to be tested through a target network, and a test result corresponding to the target data packet is obtained from the device to be tested. The method and the device have the advantages that the high performance and the customization capability of the programmable switch are utilized, the test rule is used for flexibly processing and forwarding the target data packet, the problem that the traditional test scheme cannot adapt to changeable test scenes when network test is carried out, the test flexibility is poor is solved, and the technical effects of improving the network test flexibility and improving the network test efficiency are achieved.
In an exemplary embodiment, the above method further has the following step S51:
step S51: and configuring the programmable switch through a configuration management module, and determining the test scene of the programmable switch.
As an alternative embodiment, the configuration management module includes, but is not limited to, a module for predefined test configurations, issuing and switching of rules, and the like.
It will be apparent that the embodiments described above are only some, but not all, of the embodiments of the present application. For better understanding of the above method, the following description will explain the above process with reference to the examples, but is not intended to limit the technical solutions of the embodiments of the present application, specifically:
fig. 3 is a schematic diagram of a programmable switch based principle according to an embodiment of the present application, and as shown in the drawing, the network test system includes the following modules:
(1) Programmable switch: a programmable switch is selected that is suitable for the test requirements, such as a switch using a Tofino chip. The programmable switch should have flexible packet processing and forwarding capabilities to meet various testing requirements.
(2) And (3) a test controller: a controller is designed to manage and control the behavior of the programmable switch. The controller may communicate with the switch using a specific programming language or application programming interface (Application Programming Interface, abbreviated API) to configure the test scenarios, issue test rules, and collect test data. The system comprises a test rule definition, a programmable switch configuration management and a visual interface module.
(3) Test rule definition: defining test rules including message generation rules, message modification rules, traffic pattern rules, etc. These rules will direct the programmable switch to process and forward packets during testing. The test rules are uniformly stored in an extensible markup language (eXtensible Markup Language, abbreviated as XML) file format and issued to the programmable switch by the test controller.
(4) Message generator: and designing a message generator module for generating a data packet required by the test according to the test rule. The message generator should support custom message formats and fields to meet different test requirements. The host device uses a Scapy and other network programming libraries to generate test messages; if the real traffic scene needs to be restored, the message generator can also be an upstream network device of the real device to be tested, and the customization processing and the test are directly carried out aiming at the real network traffic.
(5) Analysis of test results: and designing a result analysis module for analyzing performance indexes such as data packets, delay, packet loss rate and the like processed by the test object equipment. This will help evaluate the performance and reliability of the network.
(6) Programmable switch configuration management: a mechanism is provided to manage the configuration of programmable switches including predefined test configurations, the issuing and switching of rules, and the like. In this way, different test scenarios and rules can be easily switched.
(7) Visual interface: a friendly user interface is designed for configuring and monitoring the status of the test equipment, displaying test results and reports, and providing interactive operation and analysis functions.
(8) Test object device: the device as the test object may be other hosts, servers, network devices, etc., connected to the programmable switch for testing network performance and function.
In summary, a network test device based on a programmable switch should include components such as the programmable switch, the test controller, the message generator, the result analysis module, and the like, and provide flexible configuration and management mechanisms to meet different test scenarios and requirements.
The specific test flow using the programmable switch based network test system is as follows:
step 1: design test rules: defining test rules including message generation rules, traffic pattern rules, message modification rules, etc. These rules will direct the packet handling and forwarding behavior of the programmable switch;
step 2: writing a test controller: software modules of the test controller are designed and written for configuring the programmable switch, issuing test rules, and collecting test data. The test controller should communicate with the programmable switch to control the execution of the test and the collection of the results;
step 3: constructing a test message: and generating a data packet required by the test according to the test rule by using a message generator module. The message generator should support custom message formats and fields to meet different test requirements;
step 4: sending a test message: and sending the constructed test message to the programmable switch and sending the test message to the test object equipment through a network. The programmable exchanger processes and forwards the message according to the test rule;
step 5: collecting and analyzing the results: and collecting test data and results, including performance indexes such as message forwarding rate, delay, packet loss rate and the like. The collected data is analyzed and visualized using a result analysis module to evaluate the performance and reliability of the network.
It should be noted that, the core of the present application is:
(1) Using a programmable switch to process and forward highly customized messages according to network test requirements of equipment to be tested;
(2) The test controller is used to manage and control the behavior of the programmable switch, and it should be noted that the controller may communicate with the switch using a specific programming language or API to configure the test scenario, issue test rules, and collect test data. The system comprises a test rule definition, a programmable switch configuration management and a visual interface module;
(3) The test rule definition module comprises a message generation rule, a message modification rule, a flow mode rule and the like. These rules will direct the programmable switch to process and forward packets during testing. The test rules are uniformly stored in an xml file format and issued to the programmable switch through the test controller;
(4) The message generator module is used for generating a data packet required by the test according to the test rule. The message generator should support custom message formats and fields to meet different test requirements. The specific implementation can be that the host equipment uses a Scapy and other network programming libraries to generate test messages or real upstream network equipment of the equipment to be tested;
(5) The programmable switch configuration management module provides a mechanism to manage the configuration of the programmable switch, including predefined test configuration, rule issuing and switching, etc.;
(6) And sending the constructed test message to the programmable switch and sending the test message to the test object equipment through a network. And the programmable switch processes and forwards the message according to the test rule.
Compared with other network test schemes, the network test system based on the programmable switch has the following advantages:
(1) High performance packet processing: the programmable switch performs packet processing at the hardware level, providing excellent throughput and low latency. Compared with a software tool on a host, the programmable switch can process larger-scale message flow, and is suitable for high-speed network testing, such as a data center or a high-performance computing environment;
(2) Customized message processing: the programmable switch can process and forward highly customized messages according to test requirements. Through programming, a self-defined message format, field analysis and modification rules can be defined so as to adapt to different test scenes and requirements;
(3) High expansibility and flexibility: the programmable switch can quickly adapt to new protocols or technologies by updating the programming logic of the programmable switch, so that the support of new functions can be realized more easily; the openness and flexibility of the programmable switch allows the test behavior to be more freely customized and controlled;
(4) And (3) simulating a real network environment: the programmable switch can simulate message processing and forwarding in a real network environment, and is closer to the actual network condition. Testing based on programmable switches may provide more accurate test results than virtualized environments or simulation tools;
(5) Network function test: the programmable switch can simulate the behavior of network function equipment, such as a firewall, load balancing, intrusion detection and the like, so that the performance and effect of the functions can be tested in an actual network;
(6) Distributed test capability: the programmable switch supports distributed deployment, can test at different positions, and simulates a distributed network environment. This is very valuable for testing distributed systems and network behavior across geographic locations;
(7) And (3) resource release: the use of software tools on the host may burden the computational resources of the host, while the use of programmable switches may shift the load of message processing and forwarding to the switch, freeing up host resources;
(8) Test efficiency and accuracy: the high performance and customization capability of the programmable switch may improve test efficiency and accuracy. You can test more quickly and get more accurate test results.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
In this embodiment, a network testing device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 4 is a block diagram of a network testing device according to an embodiment of the present application, as shown in fig. 4, where the device includes:
a first obtaining module 42, configured to obtain a test rule, where the test rule is used to instruct the programmable switch to process and forward a data packet;
a sending module 44, configured to send the test rule to a programmable switch, and instruct the programmable switch to send a target data packet to a device to be tested through a target network, where the data packet includes the target data packet;
a second obtaining module 46, configured to obtain a test result corresponding to the target data packet from the device to be tested, where the test result is used to evaluate network performance of the target network.
Through the device, the test rule is obtained, the test rule is sent to the programmable switch, the programmable switch is instructed to send the target data packet to the equipment to be tested through the target network, and the test result corresponding to the target data packet is obtained from the equipment to be tested. The method and the device have the advantages that the high performance and the customization capability of the programmable switch are utilized, the test rule is used for flexibly processing and forwarding the target data packet, the problem that the traditional test scheme cannot adapt to changeable test scenes when network test is carried out, the test flexibility is poor is solved, and the technical effects of improving the network test flexibility and improving the network test efficiency are achieved.
In an exemplary embodiment, the first obtaining module 42 is further configured to obtain a message generation rule, a message modification rule, and a traffic pattern rule; wherein the test rule comprises: the message generation rule, the message modification rule and the flow mode rule.
In an exemplary embodiment, the apparatus further comprises: the first processing module is used for sending the test rule to the message generator after the test rule is acquired; and indicating the message generator to generate the target data packet according to the test rule, and sending the target data packet to the programmable switch.
In an exemplary embodiment, the first processing module is further configured to instruct an upstream network device of the device to be tested to send the target data packet to the programmable switch.
In an exemplary embodiment, the apparatus further comprises: the second processing module is configured to, after obtaining a test result corresponding to the target data packet from the device to be tested, analyze the test result through the test result analysis module to obtain an analysis result, where the test result includes: message forwarding rate, delay and packet loss rate; the analysis result is used for representing the network performance of the target network; and displaying the analysis result through a visual interface.
In an exemplary embodiment, the apparatus further comprises: and the configuration module is used for configuring the programmable switch through the configuration management module and determining the test scene of the programmable switch.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, acquiring a test rule, wherein the test rule is used for indicating the programmable switch to process and forward a data packet;
s2, sending the test rule to a programmable switch, and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet;
s3, obtaining a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring a test rule, wherein the test rule is used for indicating the programmable switch to process and forward a data packet;
s2, sending the test rule to a programmable switch, and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet;
s3, obtaining a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A network testing method, comprising:
acquiring a test rule, wherein the test rule is used for indicating a programmable switch to process and forward a data packet;
sending the test rule to a programmable switch, and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet;
and obtaining a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
2. The method of claim 1, wherein obtaining the test rule comprises:
acquiring a message generation rule, a message modification rule and a flow mode rule;
wherein the test rule comprises: the message generation rule, the message modification rule and the flow mode rule.
3. The method of claim 1, wherein after obtaining the test rule, the method further comprises:
sending the test rule to a message generator;
and indicating the message generator to generate the target data packet according to the test rule, and sending the target data packet to the programmable switch.
4. The method of claim 1, wherein after obtaining the test rule, the method further comprises:
and indicating upstream network equipment of the equipment to be tested to send the target data packet to the programmable switch.
5. The method of claim 1, wherein after obtaining the test result corresponding to the target data packet from the device under test, the method further comprises:
analyzing the test result through a test result analysis module to obtain an analysis result, wherein the test result comprises: message forwarding rate, delay and packet loss rate; the analysis result is used for representing the network performance of the target network;
and displaying the analysis result through a visual interface.
6. The method according to claim 1, wherein the method further comprises:
and configuring the programmable switch through a configuration management module, and determining the test scene of the programmable switch.
7. A network testing apparatus, comprising:
the first acquisition module is used for acquiring a test rule, wherein the test rule is used for indicating the programmable switch to process and forward the data packet;
the sending module is used for sending the test rule to the programmable switch and indicating the programmable switch to send a target data packet to equipment to be tested through a target network, wherein the data packet comprises the target data packet;
and the second acquisition module is used for acquiring a test result corresponding to the target data packet from the equipment to be tested, wherein the test result is used for evaluating the network performance of the target network.
8. The apparatus of claim 7, wherein the apparatus comprises: the first acquisition module is used for acquiring a message generation rule, a message modification rule and a flow mode rule; wherein the test rule comprises: the message generation rule, the message modification rule and the flow mode rule.
9. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 6.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 6 when the computer program is executed.
CN202311737232.0A 2023-12-15 2023-12-15 Network testing method and device, storage medium and electronic equipment Pending CN117749681A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311737232.0A CN117749681A (en) 2023-12-15 2023-12-15 Network testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311737232.0A CN117749681A (en) 2023-12-15 2023-12-15 Network testing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117749681A true CN117749681A (en) 2024-03-22

Family

ID=90282623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311737232.0A Pending CN117749681A (en) 2023-12-15 2023-12-15 Network testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117749681A (en)

Similar Documents

Publication Publication Date Title
CN109802852B (en) Method and system for constructing network simulation topology applied to network target range
CN107368405B (en) Test system, test method, mock platform, interceptor and client
JP6336606B2 (en) Method and apparatus for visual network operation and maintenance
CN111181801B (en) Node cluster testing method and device, electronic equipment and storage medium
CN109726128A (en) A kind of method for generating test case, device and server
CN111400127B (en) Service log monitoring method and device, storage medium and computer equipment
CN112714047A (en) Industrial control protocol flow based test method, device, equipment and storage medium
CN112732572A (en) Service testing method, device and system, storage medium and electronic device
CN111611121A (en) Hardware simulation test method, device and equipment
CN108092854A (en) The test method and device of train grade ethernet device based on IEC61375 agreements
CN109542786A (en) Visual testing method and device
JP2007208633A (en) Device, method and program for designing network
CN111782524A (en) Application testing method and device, storage medium and electronic device
CN104468288A (en) Terminal network data testing method and device
CN109981377B (en) Distributed data center link monitoring method and system
CN110876155B (en) Simulation system and method for wireless mesh network
CN117176802B (en) Full-link monitoring method and device for service request, electronic equipment and medium
US9329960B2 (en) Methods, systems, and computer readable media for utilizing abstracted user-defined data to conduct network protocol testing
CN117749681A (en) Network testing method and device, storage medium and electronic equipment
CN112527453B (en) Virtualization information simulation system, method and computer-readable storage medium
CN105207803A (en) Method for simulating trap messages of multiple network elements and system
GB2424498A (en) Test simulation using live real-world characteristics
CN111294250B (en) Pressure testing method, device and system
Catal et al. Visualization of traffic flows in a simulated network environment to investigate abnormal network behavior in complex network infrastructures
CN117130318B (en) Industrial data acquisition method, device, system and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination