CN113489625A - Network card testing method and device, electronic equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN113489625A
CN113489625A CN202110826711.4A CN202110826711A CN113489625A CN 113489625 A CN113489625 A CN 113489625A CN 202110826711 A CN202110826711 A CN 202110826711A CN 113489625 A CN113489625 A CN 113489625A
Authority
CN
China
Prior art keywords
terminal
test
parameters
data packet
forwarding
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.)
Granted
Application number
CN202110826711.4A
Other languages
Chinese (zh)
Other versions
CN113489625B (en
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.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing Co Ltd
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 Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202110826711.4A priority Critical patent/CN113489625B/en
Publication of CN113489625A publication Critical patent/CN113489625A/en
Application granted granted Critical
Publication of CN113489625B publication Critical patent/CN113489625B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a network card testing method, a network card testing device, electronic equipment and a computer readable storage medium, and belongs to the technical field of computers. The method comprises the steps of obtaining pre-configured basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof; remotely logging in a second terminal according to the basic parameters, and installing a network driving component required by testing on the first terminal; sending a data packet defined based on the customization parameters to the second terminal for customization testing, and controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters; and receiving the data packet forwarded by the second terminal and counting related data until the set test time is reached, and ending the test to obtain a test result. The method can automatically acquire the configured test parameters, automatically install the required drive components, start the test and collect the result, automatically realize the customized test of the network card, and save the test time and the hardware cost of using the bale-issuing machine.

Description

Network card testing method and device, electronic equipment and computer readable storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a network card testing method, a network card testing device, electronic equipment and a computer readable storage medium.
Background
With the advent of the internet era, operators have made higher and higher demands on network service performance. In such an environment, detecting the network capability of the operating platform infrastructure (server network) becomes a key technical index for acceptance. The network card pressure and performance test is an important test for judging the network quality of the server. At present, a professional chartered plane tool (physical hardware) is mainly used for testing the network card, so that the cost is high.
Disclosure of Invention
In view of the above, an object of the present application is to provide a network card testing method, an apparatus, an electronic device and a readable storage medium, so as to solve the problem of high hardware cost in the conventional network card testing using a chartered plane tool.
The embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a network card testing method, which is applied to a first terminal, and the method includes: acquiring pre-configured basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof; remotely logging in a second terminal according to the basic parameters, and installing a network driving component required by testing on the first terminal; sending a data packet defined based on the customization parameters to the second terminal for customization test, and controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters; and receiving the data packet forwarded by the second terminal and counting related data until the set test time is reached, and ending the test to obtain a test result. In the embodiment of the application, the customized test of the network card is automatically realized by automatically acquiring the configured test parameters (basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof), remotely logging in the second terminal, automatically installing the required driving component, and starting the test and result collection, so that the test time and the hardware cost for using the chartered plane are saved.
With reference to a possible implementation manner of the embodiment of the first aspect, the forwarding manner in the customized parameter is forwarding through a forwarding tool or forwarding through a kernel. In the embodiment of the application, the forwarding modes can be defined as required, so that the influence caused by different forwarding modes can be tested, and the applicability of the scheme is improved.
With reference to a possible implementation manner of the embodiment of the first aspect, if a forwarding manner in the customized parameter is forwarding through a kernel, before sending a data packet defined based on the customized parameter to the second terminal, the method further includes: and establishing an ARP binding relationship between the IP address and the MAC address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP address and the MAC address of the first terminal on the second terminal. In the embodiment of the application, if the forwarding mode in the customized parameter is forwarding through the kernel, before sending the data packet defined based on the customized parameter to the second terminal, an ARP binding relationship between the IP address and the MAC address of the second terminal is established on the first terminal based on the basic parameter, and an ARP binding relationship between the IP address and the MAC address of the first terminal is established on the second terminal, so that ARP resolution actions in a test process can be saved, and network performance is improved.
With reference to a possible implementation manner of the embodiment of the first aspect, if a forwarding manner in the customized parameter is forwarding through a forwarding tool, before sending a data packet defined based on the customized parameter to the second terminal, the method further includes: and installing a DPDK environment required by data transmission on the second terminal, wherein the DPDK environment comprises the forwarding tool. In this embodiment of the application, if the forwarding manner in the customized parameter is forwarding through a forwarding tool, before sending the data packet defined based on the customized parameter to the second terminal, a DPDK environment required for data transmission is installed on the second terminal, where the DPDK environment includes the forwarding tool, so as to ensure that data can be correctly forwarded.
With reference to a possible implementation manner of the embodiment of the first aspect, before sending the data packet defined based on the customized parameter to the second terminal, the method further includes: and determining that the first terminal and the second terminal can normally communicate with each other. In the embodiment of the present application, before sending the data packet defined based on the customized parameter to the second terminal, it is necessary to ensure that the first terminal and the second terminal can normally communicate with each other, so as to ensure that the scheme can be correctly implemented, and improve the testing efficiency.
With reference to one possible implementation manner of the embodiment of the first aspect, the customized test includes one of a network card function test, a performance test, and a pressure test. In the embodiment of the application, the method can realize various tests such as network card function test, performance test and pressure test, so that the use cost of the scheme is lower, and the tool use threshold is reduced.
In a second aspect, an embodiment of the present application further provides a network card testing apparatus, which is applied to a first terminal, and the apparatus includes: the device comprises a parameter acquisition module, a login module and a test module; the parameter acquisition module is used for acquiring pre-configured basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof; the login module is used for remotely logging in the second terminal according to the basic parameters; and the test module is used for installing a network driving component required by the test on the first terminal, sending a data packet defined based on the customization parameters to the second terminal for customization test, controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters, receiving the data packet forwarded by the second terminal and counting related data, and ending the test until a set test time is reached to obtain a test result.
With reference to a possible implementation manner of the embodiment of the second aspect, if the forwarding manner in the customized parameter is forwarding through a kernel, before sending the data packet defined based on the customized parameter to the second terminal, the test module is further configured to: and establishing an ARP binding relationship between the IP address and the MAC address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP address and the MAC address of the first terminal on the second terminal.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory and a processor, the processor coupled to the memory; the memory is used for storing programs; the processor is configured to invoke a program stored in the memory to perform the method according to the first aspect embodiment and/or any possible implementation manner of the first aspect embodiment.
In a fourth aspect, this application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method in the foregoing first aspect and/or any possible implementation manner of the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts. The foregoing and other objects, features and advantages of the application will be apparent from the accompanying drawings. Like reference numerals refer to like parts throughout the drawings. The drawings are not intended to be to scale as practical, emphasis instead being placed upon illustrating the subject matter of the present application.
Fig. 1 shows a schematic usage flow diagram of a network card testing method provided in an embodiment of the present application.
Fig. 2 shows a schematic flowchart of a network card testing method provided in an embodiment of the present application.
Fig. 3 is a schematic diagram illustrating a test result of the network card testing method provided in the embodiment of the present application.
Fig. 4 shows a schematic module diagram of a network card testing apparatus according to an embodiment of the present application.
Fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, relational terms such as "first," "second," and the like may be used solely in the description herein to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Further, the term "and/or" in the present application is only one kind of association relationship describing the associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The embodiment of the application provides a network card testing method based on a TRex tool, the TRex tool is developed based on Python language and is used for customized testing of a network card, wherein the TRex tool is an open source pushed by DPDK, is low in cost, and is a stateful and stateless flow generator which can generate flows of an L3-L7 layer in a simulation mode, namely, the flow of an application layer, a presentation layer, a session layer, a transmission layer and a network layer can be generated in a simulation mode. The customized test may be a function test, a performance test (e.g., RFC2544 test), a stress test, and the like of the network card. The following describes a hardware environment required by the network card testing method of the present application. The network card testing method needs to involve two terminals, namely a first terminal and a second terminal, and the two terminals are connected back to back. For convenience of description, it is specified that a terminal running the TRex tool is a first terminal or a Server (Server) terminal, and an opposite terminal is a second terminal or a Client (Client) terminal.
The following describes the use flow of the network card testing method of the present application, as shown in fig. 1. Before the TRex tool is applied, the first terminal and the second terminal need to be manually configured, including: the method comprises the steps of installing a Linux system (such as installing a Centos 7664-bit system), installing a network card driver, configuring a fixed IP for a network port to be tested, closing a system firewall function and configuring a large memory page (aiming at replacing a traditional 4kb memory page by using a large-page memory so as to adapt to the larger and larger system memory and enable an operating system to support the function of large page capacity), and restarting the machine after configuration is completed. When a fixed IP is configured for the portal to be tested, the IPs configured by the first terminal and the second terminal should belong to the same network segment, for example, the IP configured by the first terminal is "192.168.1.11", and the IP configured by the second terminal is "192.168.1.10".
Before the first terminal runs the test program, it needs to configure test parameters, the test parameters include two parts, which are basic parameters for network communication and customized parameters for defining network data packet and its forwarding mode, when the customized parameters are not modified, the initial values defined by the program are used by default, and the customized parameters can be modified according to the customized test requirements. Py file may be saved in the test parameters. And then, running a test program at the first terminal, automatically connecting to the opposite terminal according to the test parameters, carrying out customized test based on a TRex tool, and outputting a test result to a screen and saving the test result to a file after the test is finished.
Next, with reference to fig. 2, a test flow of the network card test method provided in the embodiment of the present application will be described. The execution main body of the network card testing method is a first terminal.
S1: the method comprises the steps of obtaining pre-configured basic parameters for network communication and customized parameters for defining network data packets and forwarding modes thereof.
After the first terminal runs the test program, the program can automatically acquire the pre-configured basic parameters for network communication and the customized parameters for defining the network data packet and the forwarding mode thereof.
Wherein, the basic parameters comprise:
(1) a Client port IP (Client _ IP);
(2) a Client port name (Client _ INTERFACE);
(3) a Client port MAC address (Client _ MAC);
(4) a Client end system login user name (Client _ USERNAME);
(5) a Client end system login PASSWORD (Client _ PASSWORD);
(6) a Server port IP (Server _ IP);
(7) a Server-side port name (Server _ INTERFACE);
(8) a Server port MAC address (Server _ MAC).
Examples of basic parameters are as follows:
Client_IP=“192.168.1.10”;
Client_INTERFACE=“etho”;
Client_MAC=“00:00:00:00:00:01”;
Client_USERNAME=“root”;
Client_PASSWORD=“password”;
Server_IP=“192.168.1.11”;
Server_INTERFACE“etho”;
Server_MAC=“00:00:00:00:00:02”。
the support customization parameters are as follows:
(1) FORWARDING MODE (forward _ MODE): a Client terminal forwarding mode which comprises two modes, wherein a data packet is forwarded through a forwarding tool (such as a testpmd tool) or a kernel (kernel);
(2) DURATION of test (DURATION): the unit is second;
(3) RFC2544 tests whether enabled (RFC 2544): whether a standard RFC2544 throughput rate test is executed, if the test is False, the test is not started, and if the test is True, the test is started;
(4) packet SIZE (SIZE);
(5) magnitude of pressure (multipressure): there are three ways to set the pressure, which can specify one of bps (bit per second, i.e. number of bits transmitted per second), pps (packets per second, i.e. sending multiple packets per second), and bandwidth percentage;
(6) packet format (PKT _ TYPE): specifying a data packet in a UDP (User Datagram Protocol)/TCP (Transmission Control Protocol) format;
(7) number of data STREAMs (STREAM _ NUM): number of data streams for multiple streams;
(8) multi-stream TYPE (TUPLE _ TYPE): whether the 4-tuple change mode is sequential change (inc) or random change (random) in the case of multiple data streams;
(9) data STREAM TYPE (STREAM _ TYPE): designating a data stream as a continuous stream (Cont) or a multi-burst (MultiBurst);
(10) BURST number (MULTI _ BURST _ consts): total number of bursts;
(11) BURST PPS (MULTI _ BURST _ PPS): number of pps per burst;
(12) BURST number PER BURST (MULTI _ BURST _ PKTS _ PER _ BURST): total number of packets per burst;
(13) BURST stream BURST interval (MULTI _ BURST _ IBG) each time: the time interval between each burst, in microseconds;
(14) CAPTURE packet enabled (CAPTURE): a switch for capturing a data packet, wherein the format of the captured data packet is pcap, if False, the captured data packet is not started, and if True, the captured data packet is started;
(15) number of captured packets (CAPTURE _ PKTS _ NUM): total number of captured packets;
(16) captured packet SIZE limit (CAPTURE _ PKTS _ SIZE): the size of the captured data packet is set, and the data packet larger than or equal to the set size is captured.
The customization parameters are exemplified as follows:
FORWARDING_MODE=“testpmd”#<testpmd/kernel>;
DURATION=10 #test time;
RFC2544=False #<False/True>;
SIZE=[64,128];
MULTIPLIER='100%'#<10gbps/1mbps/5kpps/85%>;
PKT_TYPE='UDP'#<UDP/TCP>;
STREAM_NUM=4;
TUPLE_TYPE='inc'#<inc/random>;
STREAM_TYPE='Cont'#<Cont/MultiBurst>;
MULTI _ BURST _ configurations ═ 5 #, this parameter takes effect when the value 'STREAM _ TYPE' is set to 'MultiBurst';
multiple _ BURST _ PPS is 10 # this parameter is valid when the value of 'STREAM _ TYPE' is set to 'MultiBurst';
MULTI _ BURST _ PKTS _ PER _ BURST is 4 #, which is valid when the value of 'STREAM _ TYPE' is set to 'MultiBurst';
multiple _ BURST _ IBG 1000000.0 #, this parameter being in effect when the value 'STREAM _ TYPE' is set to 'MultiBurst';
CAPTURE=False #<False/True>;
CAPTURE _ PKTS _ NUM ═ 20 # this parameter takes effect when 'CAPTURE' is set to 'True';
CAPTURE _ PKTS _ SIZE 60 # this parameter takes effect when 'CAPTURE' is set to 'True'.
S2: and remotely logging in a second terminal according to the basic parameters, and installing a network driving component required by testing on the first terminal.
After the basic parameters for network communication and the customized parameters for defining the network data packet and the forwarding mode thereof are obtained, the second terminal can be remotely logged in according to the basic parameters, for example, the second terminal can be remotely logged in according to the three parameters of Client _ IP, Client _ user name and Client _ PASSWORD in the basic parameters. And installing network driving components required for data transmission on the first terminal, such as installing a DPDK component (the Trex tool needs to depend on the DPDK environment) and mounting a large memory page (improving the system performance). In addition, three parameters, namely, Server _ INTERFACE, Server _ IP and Client _ IP, in the basic parameters are called to modify a Trex configuration file (Trex _ cfg.yaml), the IP addresses of the network port and the two ends in the configuration file are modified into the IP addresses of the network port and the two ends defined in the basic parameters, and the IP addresses are copied to/etc directory, the IP addresses of the network port and the two ends for testing are defined in the Trex _ cfg.yaml, and the Trex tool depends on the configuration file when being executed.
S3: and sending a data packet defined based on the customization parameters to the second terminal for customization test, and controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters.
After logging in a second terminal remotely according to the basic parameters and installing a network driving component required by the test on the first terminal, the test program calls a Trex tool, sends a data packet defined based on the customized parameters to the second terminal for customized test, and controls the second terminal to forward the data packet to the first terminal based on a forwarding mode (forwarding through a forwarding tool or forwarding through a kernel) in the customized parameters. The size, format, number of data streams, type of multi-stream, type of data stream, and amount of pressure generated, etc. of the data packet are consistent with the parameters defined in the customized parameters.
And the forwarding mode in the customized parameters is forwarding through a forwarding tool or forwarding through a kernel. If the forwarding manner in the customized parameter is forwarding through the kernel, in an optional implementation manner, before sending the data packet defined based on the customized parameter to the second terminal, the network card testing method further includes: establishing an ARP (Address Resolution Protocol) binding relationship between the IP Address and the MAC Address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP Address and the MAC Address of the first terminal on the second terminal. After the IP address and the MAC address are ARP bound, ARP analysis actions in the test process can be saved, and network performance is improved.
For example, if the IP address of host a is 192.168.0.1, which needs to communicate with host B with IP 192.168.0.8, the following actions will be performed:
a host inquires an ARP cache list of the host, if a MAC address item corresponding to a destination IP address 192.168.0.8 is found, the host directly uses the MAC address item to construct and send an Ethernet data packet, and if the corresponding MAC address item is not found, the host continues to the next step;
2, the A host sends an ARP resolution request broadcast, the destination MAC address is FF, and the request IP is 192.168.0.8 host reply MAC address;
after receiving the ARP analysis request broadcast, the B host replies an ARP response data packet to the A host, wherein the ARP response data packet comprises the IP address and the MAC address of the B host;
after receiving the ARP reply of the host B, the host A puts the MAC address of the host B into an ARP cache list of the host B, then uses the MAC address of the host B as a target MAC address and the IP address (192.168.0.8) of the host B as a target IP address, constructs and sends an Ethernet data packet;
5. if the a-host also sends 192.168.0.8 a packet, since it already has the MAC address of IP address 192.168.0.8 in the ARP cache list, the a-host sends the packet directly using this MAC address and does not send any more ARP resolution request broadcast.
After the IP address and the MAC address are ARP bound, ARP analysis action in the test process can be saved, and network performance is improved.
If the forwarding mode in the customized parameters is forwarding through a forwarding tool, before sending the data packet defined based on the customized parameters to the second terminal, the network card testing method further comprises the following steps: and installing a DPDK environment required for data transmission on the second terminal, wherein the DPDK environment comprises a forwarding tool, such as a testpmd tool. In this embodiment, after acquiring the customized parameters defining the network packet and its forwarding mode, based on the forwarding mode defined in the customized parameters, it may be determined whether a DPDK environment required for data transmission needs to be installed on the second terminal, and if the forwarding mode in the customized parameters is forwarding through a forwarding tool, after logging in the second terminal remotely according to the basic parameters, the DPDK environment required for data transmission needs to be installed on the second terminal, the DPDK environment is dependent on the DPDK environment, and a large memory page is mounted (system performance is improved).
The customized test comprises one of a network card function test, a performance test and a pressure test. The specific testing process is consistent with the existing testing process by the bale opener, is well known to those skilled in the art, and is not described herein.
In an optional implementation manner, before sending the data packet defined based on the customized parameter to the second terminal, the network card testing method further includes: and determining that the first terminal and the second terminal can normally communicate with each other, for example, determining that the first terminal and the second terminal can normally ping and ssh communicate with each other. Only if it is determined that the first terminal and the second terminal can ping and ssh communicate with each other, the first terminal sends a packet defined based on the customized parameters to the second terminal. Wherein, ping is an internet packet explorer, a program for testing network connection amount. ssh is an abbreviation for secure shell, a protocol specific to providing security for telnet sessions and other network services.
It should be noted that, the process of checking whether the first terminal and the second terminal can ping and ssh communicate with each other may also be performed when the first terminal and the second terminal are manually configured, that is, when the first terminal and the second terminal are manually configured, it may be checked whether the first terminal and the second terminal can ping and ssh communicate with each other through the fixed IP configured in the above step.
S4: and receiving the data packet forwarded by the second terminal and counting related data until the set test time is reached, and ending the test to obtain a test result.
And then, the first terminal receives the data packet forwarded by the second terminal and counts related data until the set test time is reached, and then the test is finished to obtain a test result. The test time may be obtained from "DURATION" in the customized parameters. In the process, the first terminal continuously sends the data packet defined based on the customized parameter to the second terminal, controls the second terminal to forward the data packet to the first terminal based on the forwarding mode in the customized parameter, and receives the data packet forwarded by the second terminal and counts related data until the test is finished. And then outputting the test result to a screen and saving the test result to a file, wherein the test result is shown in figure 3. When the first terminal performs the correlation data statistics, it will count the data shown in fig. 3, and the main parameters in the test result are explained as follows:
port statistics is port statistics, Owner is a system user, link is a network card connection State, State is a transmission State, speed is a network card rated bandwidth, CPU util is CPU utilization rate, Line util is network port bandwidth utilization rate, Tx (Transport) represents transmitted data, Rx (receive) represents received data, bps represents a transmission bit number per second, pps represents how many packet data packets are transmitted per second, Tx bps L2 is data (including packet heads, frame intervals and the like) obtained by counting all bytes of the transmitted packet data, Tx bps L1 pointer counts the bytes occupied by the transmitted packet data, opengrams is transmitted packet data, ipgrams is received packet data, bytes is total transmitted packet capacity, ibytes is total received packet capacity, Tx-pkts is transmitted packet number, rx-pkts is received packet number, Tx-pkts is transmitted packet number, Tx-byts is transmitted packet number, rx-bytes is the number of bytes received, Mbps refers to megabits per second, which is a unit of transmission rate, which refers to the number of bits transmitted per second, Kpps refers to thousand packets per second, which is a unit of packet forwarding rate, which is the number of packets forwarded per second, and Gpkts is a G packet, which is a billion data packet.
By the network card testing method, automatic testing environment configuration, starting test and result collection can be achieved, customized test of the network card is automatically achieved, tool use doorways are reduced, quick starting test is achieved, testing time is saved, and hardware cost of a package issuing machine is saved.
Based on the same inventive concept, the embodiment of the present application further provides a network card testing apparatus 100 applied to the first terminal, as shown in fig. 4. The network card testing apparatus 100 includes: an acquisition parameter module 110, a login module 120, and a test module 130.
The parameter obtaining module 110 is configured to obtain preconfigured basic parameters for network communication and customized parameters for defining a network packet and a forwarding manner thereof.
A login module 120, configured to remotely log in to the second terminal according to the basic parameters.
The test module 130 is configured to install a network driver component required for testing on the first terminal, send a data packet defined based on the customization parameters to the second terminal for performing customization testing, control the second terminal to forward the data packet to the first terminal based on a forwarding manner in the customization parameters, receive the data packet forwarded by the second terminal and count related data, and end the test until a set test time is reached to obtain a test result.
Wherein, the forwarding manner in the customized parameter is forwarding through a forwarding tool or forwarding through a kernel, and if the forwarding manner in the customized parameter is forwarding through the kernel, the test module is further configured to, before sending the data packet defined based on the customized parameter to the second terminal: and establishing an ARP binding relationship between the IP address and the MAC address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP address and the MAC address of the first terminal on the second terminal. If the forwarding manner in the customized parameter is forwarding through a forwarding tool, before sending the data packet defined based on the customized parameter to the second terminal, the test module is further configured to: and installing a DPDK environment required by data transmission on the second terminal, wherein the DPDK environment comprises the forwarding tool.
Optionally, before sending the data packet defined based on the customized parameter to the second terminal, the testing module is further configured to: and determining that the first terminal and the second terminal can normally communicate with each other.
The network card testing device 100 provided in the embodiment of the present application has the same implementation principle and technical effect as those of the foregoing method embodiments, and for brief description, reference may be made to corresponding contents in the foregoing method embodiments for the parts of the device embodiments that are not mentioned.
As shown in fig. 5, fig. 5 is a block diagram illustrating a structure of an electronic device 200 according to an embodiment of the present disclosure. The electronic device 200 includes: a transceiver 210, a memory 220, a communication bus 230, and a processor 240.
The elements of the transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, the components may be electrically coupled to each other via one or more communication buses 230 or signal lines. The transceiver 210 is used for transceiving data. The memory 220 is used for storing a computer program, such as the software functional module shown in fig. 4, i.e., the network card testing apparatus 100. The network card testing apparatus 100 includes at least one software functional module, which may be stored in the memory 220 in the form of software or Firmware (Firmware) or solidified in an Operating System (OS) of the electronic device 200. The processor 240 is configured to execute an executable module stored in the memory 220, such as a software functional module or a computer program included in the network card testing apparatus 100. For example, the processor 240 is configured to obtain preconfigured basic parameters for network communication and customized parameters for defining a network packet and a forwarding manner thereof; remotely logging in a second terminal according to the basic parameters, and installing a network driving component required by testing on the first terminal; sending a data packet defined based on the customization parameters to the second terminal for customization test, and controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters; and receiving the data packet forwarded by the second terminal and counting related data until the set test time is reached, and ending the test to obtain a test result.
The Memory 220 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 240 may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 240 may be any conventional processor or the like.
The electronic device 200 includes, but is not limited to, a computer, such as a server.
The embodiment of the present application further provides a non-volatile computer-readable storage medium (hereinafter, referred to as a storage medium), where the storage medium stores a computer program, and the computer program is executed by the computer, such as the electronic device 200, to execute the network card testing method described above.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a notebook computer, a server, or an electronic device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1.A network card testing method is applied to a first terminal, and the method comprises the following steps:
acquiring pre-configured basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof;
remotely logging in a second terminal according to the basic parameters, and installing a network driving component required by testing on the first terminal;
sending a data packet defined based on the customization parameters to the second terminal for customization test, and controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters;
and receiving the data packet forwarded by the second terminal and counting related data until the set test time is reached, and ending the test to obtain a test result.
2. The method of claim 1, wherein the customized parameters are forwarded by a forwarding tool or by a kernel.
3. The method according to claim 2, wherein if the forwarding manner in the customized parameters is forwarding through a kernel, before sending the data packet defined based on the customized parameters to the second terminal, the method further comprises:
and establishing an ARP binding relationship between the IP address and the MAC address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP address and the MAC address of the first terminal on the second terminal.
4. The method according to claim 2, wherein if the forwarding manner in the customized parameters is forwarding by a forwarding tool, before sending the data packet defined based on the customized parameters to the second terminal, the method further comprises:
and installing a DPDK environment required by data transmission on the second terminal, wherein the DPDK environment comprises the forwarding tool.
5. The method of claim 1, wherein before sending the data packet defined based on the customization parameters to the second terminal, the method further comprises:
and determining that the first terminal and the second terminal can normally communicate with each other.
6. The method of claim 1, wherein the customized test comprises one of a network card function test, a performance test, and a stress test.
7. The utility model provides a network card testing arrangement which characterized in that is applied to first terminal, the device includes:
the parameter acquisition module is used for acquiring pre-configured basic parameters for network communication and customized parameters for defining a network data packet and a forwarding mode thereof;
the login module is used for remotely logging in the second terminal according to the basic parameters;
and the test module is used for installing a network driving component required by the test on the first terminal, sending a data packet defined based on the customization parameters to the second terminal for customization test, controlling the second terminal to forward the data packet to the first terminal based on a forwarding mode in the customization parameters, receiving the data packet forwarded by the second terminal and counting related data, and ending the test until a set test time is reached to obtain a test result.
8. The apparatus of claim 1, wherein if the forwarding manner in the customized parameter is forwarding through a kernel, the testing module, before sending the packet defined based on the customized parameter to the second terminal, is further configured to: and establishing an ARP binding relationship between the IP address and the MAC address of the second terminal on the first terminal based on the basic parameters, and establishing an ARP binding relationship between the IP address and the MAC address of the first terminal on the second terminal.
9. An electronic device, comprising:
a memory and a processor, the processor coupled to the memory;
the memory is used for storing programs;
the processor to invoke a program stored in the memory to perform the method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110826711.4A 2021-07-21 2021-07-21 Network card testing method and device, electronic equipment and computer readable storage medium Active CN113489625B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110826711.4A CN113489625B (en) 2021-07-21 2021-07-21 Network card testing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110826711.4A CN113489625B (en) 2021-07-21 2021-07-21 Network card testing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113489625A true CN113489625A (en) 2021-10-08
CN113489625B CN113489625B (en) 2023-04-07

Family

ID=77941907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110826711.4A Active CN113489625B (en) 2021-07-21 2021-07-21 Network card testing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113489625B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020618A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 High-availability test method and system based on FPGA and DPDK
CN114900450A (en) * 2022-04-27 2022-08-12 北京计算机技术及应用研究所 Network forwarding performance testing method based on high-speed data processing platform
CN115022215A (en) * 2022-05-25 2022-09-06 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547304A (en) * 2017-07-13 2018-01-05 紫光华山信息技术有限公司 Network card testing method, device and machinable medium
CN107547299A (en) * 2017-06-01 2018-01-05 新华三信息安全技术有限公司 A kind of method of testing and system
CN110351156A (en) * 2018-04-03 2019-10-18 大唐移动通信设备有限公司 A kind of test method and device
CN111786855A (en) * 2020-06-30 2020-10-16 曙光信息产业(北京)有限公司 Network card pressure testing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547299A (en) * 2017-06-01 2018-01-05 新华三信息安全技术有限公司 A kind of method of testing and system
CN107547304A (en) * 2017-07-13 2018-01-05 紫光华山信息技术有限公司 Network card testing method, device and machinable medium
CN110351156A (en) * 2018-04-03 2019-10-18 大唐移动通信设备有限公司 A kind of test method and device
CN111786855A (en) * 2020-06-30 2020-10-16 曙光信息产业(北京)有限公司 Network card pressure testing method and device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020618A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 High-availability test method and system based on FPGA and DPDK
CN114020618B (en) * 2021-10-30 2023-10-03 江苏信而泰智能装备有限公司 High availability test method and system based on FPGA and DPDK
CN114900450A (en) * 2022-04-27 2022-08-12 北京计算机技术及应用研究所 Network forwarding performance testing method based on high-speed data processing platform
CN115022215A (en) * 2022-05-25 2022-09-06 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit
CN115022215B (en) * 2022-05-25 2023-06-02 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit

Also Published As

Publication number Publication date
CN113489625B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN113489625B (en) Network card testing method and device, electronic equipment and computer readable storage medium
US7742415B1 (en) Non-intrusive knowledge suite for evaluation of latencies in IP networks
CN111294399B (en) Data transmission method and device
WO2013163852A1 (en) Home gateway and method for analyzing network accessing behavior of user and monitoring network quality
CN108664395B (en) Application program testing method, device, equipment and storage medium
US20060288096A1 (en) Integrated monitoring for network and local internet protocol traffic
US20120230202A1 (en) Virtual network interface with packet filtering hooks
CN101595686A (en) Trigger the flow analysis at intermediate equipment place
CN109660422B (en) Network card bandwidth testing method, device, terminal and storage medium based on multiple processes
CN110769009B (en) User identity authentication method and system
WO2013097476A1 (en) Method and device for detecting rule optimization configuration
US20160277265A1 (en) Distributed stability and quality monitoring, testing, and trending of data communications networks
WO2020135429A1 (en) Traffic analysis method and apparatus, and traffic detection method and apparatus
CN104468265A (en) Method and device for detecting online states of local area network terminals
CN112019407A (en) Forwarding equipment data testing method and device, computer equipment and storage medium
CN113067810A (en) Network packet capturing method, device, equipment and medium
CN115277806A (en) Cloud desktop connection method, device and equipment
EP3811572A1 (en) Processing local area network diagnostic data
US20160292245A1 (en) Method and Device for Implementing Matching Between Acquisition System and Analysis System
WO2023173876A1 (en) Data communication method and apparatus, device and medium
CN111786932A (en) Account login method and device, electronic equipment and computer storage medium
CN108173717A (en) A kind of method under User space by obtaining ICMP error message monitoring network situations
CN113285904A (en) RDP-based method for analyzing disk mapping file information
CN111641623A (en) AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap
JP2021529470A (en) Data stream protocol identification

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
GR01 Patent grant
GR01 Patent grant