A network card testing system and method

By using a combination of two-way socket communication and packet generator capture in the network card testing system, the existing network card testing time and cost problems are solved, and fast and accurate network card performance testing is achieved to meet most testing needs.

CN116566875BActive Publication Date: 2024-10-08SHENZHEN LIANRUI ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310752922.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2024-10-08
Estimated Expiration
2043-06-25

AI Technical Summary

Technical Problem

Existing network card testing methods are time-consuming and costly, and may result in inaccurate test results due to manual errors.

Method used

Using a combination of hardware and system, through the two-way socket communication connection between the test client and the test server, use the packet generator and packet capturer to generate and capture packets, and compare them through the network loopback interface to achieve automated testing , reduce testing costs and improve efficiency.

Benefits of technology

It achieves fast, accurate, and stable network card performance testing to meet most testing needs. It is easy to configure using the Python tool environment and reduces testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116566875B_ABST
    Figure CN116566875B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network card detection, in particular to a network card testing system and method, comprising a network card port and a testing server connected to the network card port, wherein the network card port comprises a testing client and a network card interface, the network card interface is used to connect the network card to be tested, the testing client and the testing server are connected via a bidirectional socket communication, a data packet generator and a data packet capturer are arranged in the testing client, a network loopback interface is arranged in the testing server, data packets are sent and received between the testing client and the testing server via the network card communication, the received data packets are parsed and analyzed by the testing client, and compared with the data packets generated and sent by the data packet generator, the invention can test the network card, analyze the test results, obtain the test data and test performance of the network card, and improve the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network card detection, and specifically relates to a network card testing system and method. Background Art

[0002] After production, the performance of each module used in the computer needs to be tested to ensure the normal stability of the product. For the test of the network card, it is usually necessary to set up one or several test servers as the test platform, connect to the network manually through the actual network cable, and test in a series of ways such as transmitting data files in the network. This approach takes a long time to connect to the network, the test cost is high, and the test results may be inaccurate due to manual errors that may occur in the actual network connection. Summary of the invention

[0003] In view of the deficiencies in the prior art, the present invention aims to provide a network card testing system and method, which adopts a combination of hardware and system to achieve low-cost testing, reduce testing costs and improve testing efficiency.

[0004] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a network card testing system, comprising a network card port and a test server connected to the network card port, characterized in that: the network card port comprises a test client and a network card interface, the network card interface is used to connect to the network card to be tested, the test client and the test server are connected via a two-way socket communication, a data packet generator and a data packet capturer are arranged in the test client, a network loopback interface is arranged in the test server, the data packet generator can generate a data packet of a preset configuration and send it to the test server via the network card, the test server returns the received data packet to the network card via the network loopback interface, the data packet capturer captures all data packets received from the network card, the received data packets are parsed and analyzed by the test client, and compared with the data packets generated and sent by the data packet generator.

[0005] In some of the embodiments, the test client performs parameter configuration according to the rate and bandwidth of the network card to be tested, and establishes a connection with the test server through a socket.

[0006] In some of the embodiments, the test server receives a test request sent by a test client, and receives a data packet generated by the test client according to the request, and returns the received data packet to the test client. The test client receives the data packet transmitted from the test server, and verifies the correctness of the data packet based on the size and type of the data packet.

[0007] In some embodiments, the test client is created by:

[0008] Install the Python tool environment on the test device and configure the test data.

[0009] In some embodiments, the Python tool environment in the test client is configured as follows:

[0010] Import the socket library through the Python tool;

[0011] Create a client socket object;

[0012] Then connect to the server.

[0013] In some embodiments, the test server is created as follows:

[0014] A socket object is created in Python, and the connection with the test client is established by binding the IP address and port and the listening function.

[0015] In some embodiments, the test server creates a connection with the test client in the following manner:

[0016] Import the socket library through the Python tool;

[0017] Create a socket object in Python;

[0018] Get the local host name of the test client and set the port number;

[0019] Bind port number and IP address;

[0020] Set the maximum number of connections, and queue after exceeding the limit;

[0021] Loop waiting for client connection;

[0022] Establish a client connection.

[0023] In some of the embodiments, a verification comparison is performed between the data packet sent by the test client and the data packet received, and the verification method is to ensure the correctness of the data by checking the data packet header, data packet length, data packet type, and data packet content.

[0024] In some embodiments, the test client further includes a delay jitter test module, and the delay jitter calculation method is:

[0025] J=|(R xi+1 -T xi+1 )-(R xi -T xi )|

[0026] Where R xiis the sending time of the ith data packet, T xi is the receiving time of the ith data packet, R xi+1 is the sending time of the i+1th data packet, T xi+1 is the receiving time of the i+1th data packet.

[0027] To achieve the above object, the present invention also provides the following technical solution: a method for testing a network card system, the steps of which are:

[0028] (1) Connect the network card to be tested to the network card interface of the test client, and configure the parameter data packet through the test client based on the performance of the network card;

[0029] (2) Generate a data packet to be sent through a data packet generator, and transmit the data packet to the test server through a network card;

[0030] (3) The test server sends the received data packets completely to the test client through the network loopback interface;

[0031] (4) The packet capturer captures all packets received from the network card;

[0032] (5) The test client parses and analyzes the received data packets and saves the test results to a file;

[0033] (6) Calculate the delay jitter between the test client sending a data packet and receiving a data packet;

[0034] (7) Based on the complete data of the data packet, detect the first frame of the received data packet, and record the delay value of the first frame, then record the delay value of the second frame, record the delay values ​​of all frames of the data packet in sequence, and record the delay jitter data according to the delay jitter calculation method;

[0035] (8) Record the minimum delay jitter value, the maximum delay jitter value, and the average delay jitter value and generate a file;

[0036] (9) Testers classify and number the network cards under test according to the test files.

[0037] Compared with the prior art, the invention has the following beneficial effects: the test system is implemented based on Python artifacts and is easy to use. The test results show that the system can quickly, accurately and stably test the performance of the network card and can meet most test requirements.

[0038] Details of one or more embodiments of the present application are presented in the following drawings and descriptions to make other features, purposes and advantages of the present application more concise and understandable. The present application is fully described and understood through the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a system block diagram of the present invention;

[0040] Figure 2 This is a delay jitter test flow chart of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] See also Figures 1 to 2 The present invention provides a technical solution: a network card testing system, comprising a network card port and a test server connected to the network card port, the network card port comprising a test client and a network card interface, the network card interface is used to connect to the network card to be tested, the test client and the test server are connected via a two-way socket communication, a data packet generator and a data packet capturer are arranged in the test client, a network loopback interface is arranged in the test server, the data packet generator can generate a data packet with a preset configuration and send it to the test server via the network card, the test server returns the received data packet to the network card via the network loopback interface, the data packet capturer captures all data packets received from the network card, the received data packets are parsed and analyzed by the test client, and compared with the data packets generated and sent by the data packet generator.

[0043] The test client and the test server communicate through a two-way socket. The test client sends data packets of different types, sizes and quantities to the test server, and the test server sends the received data packets of different types, sizes and quantities to the test client through the network card. Finally, the test client verifies the correctness of the received data packets according to the type and size. The test results will be displayed on the test client.

[0044] The test client configures parameters according to the rate and bandwidth of the network card to be tested, and establishes a connection with the test server through a socket.

[0045] The test server receives the test request sent by the test client, and receives the data packet generated by the test client according to the request, and returns the received data packet to the test client. The test client receives the data packet transmitted from the test server and verifies the correctness of the data packet according to the size and type of the data packet.

[0046] The test client is created as follows:

[0047] Install the Python tool environment on the test device and configure the test data.

[0048] The Python tool environment configuration method in the test client is:

[0049] #Import the socket library

[0050] import socket

[0051] #Create a client socket object

[0052] client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

[0053] #Connect to server

[0054] client_socket.connect(('server IP address',8888)).

[0055] The test server is created as follows:

[0056] A socket object is created in Python, and the connection with the test client is established by binding the IP address and port and the listening function.

[0057] The way to create a connection with the test client in the test server is:

[0058] #Import the socket library

[0059] import socket

[0060] #Create a socket object

[0061] server_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

[0062] #Get the local host name

[0063] host = socket.gethostname()

[0064] #Set the port number

[0065] port=8888

[0066] #Bind port number and IP address

[0067] server_socket.bind((host,port))

[0068] #Set the maximum number of connections, and queue after exceeding it

[0069] server_socket.listen(5)

[0070] #Loop waiting for client connection

[0071] while True:

[0072] #Establish client connection

[0073] client_socket,addr=server_socket.accept()

[0074] print('Successfully connected to the client:',addr).

[0075] The data packets sent by the test client are compared with the data packets received. The verification method is to ensure the correctness of the data by checking the data packet header, data packet length, data packet type, and data packet content.

[0076] It is known that there may be byte errors when a data packet is transmitted in the network, so it is necessary to verify the received data packet. The verification algorithm can ensure the correctness of the data by checking the data packet header, data packet length, data packet type, data packet content, etc.

[0077] like Figure 2 As shown, the test client also includes a delay jitter test module, and the delay jitter calculation method is:

[0078] J=|(R xi+1 -T xi+1 )-(R xi -T xi )|

[0079] Where R xi is the sending time of the ith data packet, T xi is the receiving time of the ith data packet, R xi+1 is the sending time of the i+1th data packet, T xi+1 is the receiving time of the i+1th data packet.

[0080] Delay jitter is an important indicator for network monitoring and measurement. Data packets are sent in a continuous stream with uniform distances between packets. Due to network congestion, improper queuing or errors, this stable stream may become blocky, or the delay between each packet may change instead of remaining constant, and large jitter may have a negative impact on the service. It is caused by the network delay between any two adjacent data packets of the same application during transmission, so it is necessary to perform a delay jitter test on the network card and calculate and record the delay jitter data of the network card.

[0081] A method for testing a network card system, comprising the following steps:

[0082] (1) Connect the network card to be tested to the network card interface of the test client, and configure the parameter data packet through the test client based on the performance of the network card;

[0083] (2) Generate a data packet to be sent through a data packet generator, and transmit the data packet to the test server through a network card;

[0084] (3) The test server sends the received data packets completely to the test client through the network loopback interface;

[0085] (4) The packet capturer captures all packets received from the network card;

[0086] (5) The test client parses and analyzes the received data packets and saves the test results to a file;

[0087] (6) Calculate the delay jitter between the test client sending a data packet and receiving a data packet;

[0088] (7) Based on the complete data of the data packet, detect the first frame of the received data packet, and record the delay value of the first frame, then record the delay value of the second frame, record the delay values ​​of all frames of the data packet in sequence, and record the delay jitter data according to the delay jitter calculation method;

[0089] (8) Record the minimum delay jitter value, the maximum delay jitter value, and the average delay jitter value and generate a file;

[0090] (9) Testers classify and number the network cards under test according to the test files.

[0091] Through the technical solution of this application, in actual tests, different types, sizes and numbers of data packets are tested, and indicators such as reception success rate, reception packet loss rate, and average reception time are observed. The test results show that this test system can quickly, accurately and stably test the receiving ability of the network card, and can meet the test requirements in most scenarios.

[0092] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

[0093] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A network card testing system, comprising a network card port and a testing server connected to the network card port, characterized in that: The network card port includes a test client and a network card interface, the network card interface is used to connect to the network card to be tested, the test client is connected to the test server through a two-way socket communication, a data packet generator and a data packet capturer are arranged in the test client, a network loopback interface is arranged in the test server, the data packet generator generates a data packet of a preset configuration, and sends it to the test server through the network card to be tested, the test server returns the received data packet to the network card to be tested through the network loopback interface, the data packet capturer captures all data packets received from the network card to be tested, parses and analyzes the received data packets through the test client, and compares them with the data packets generated and sent by the data packet generator; The test client configures parameters according to the rate and bandwidth of the network card to be tested, and establishes a connection with the test server through a socket; The test server receives the test request sent by the test client, receives the data packet generated by the test client according to the request, and returns the received data packet to the test client. The test client receives the data packet transmitted from the test server and verifies the correctness of the data packet according to the size and type of the data packet. The test client is created as follows: Install the Python tool environment on the test device and configure the test data; Among them, the Python tool environment configuration method in the test client is: Import the socket library through the Python tool; Create a client socket object; Then connect to the test server; The test server is created as follows: Create a socket object in Python and connect to the test client by binding the IP address, port number and listening function. The test client also includes a delay jitter test module, and the delay jitter calculation method is: J=|(R xi+1 -T xi+1 )-(R xi -T xi )| Where R xi is the sending time of the ith data packet, T xi is the receiving time of the ith data packet, R xi+1 is the sending time of the i+1th data packet, T xi+1 is the receiving time of the i+1th data packet; The way to create a connection with the test client in the test server is: Import the socket library through the Python tool; Create a socket object in Python; Get the local host name of the test client and set the port number; Bind port number and IP address; Set the maximum number of connections, and queue after exceeding the limit; Loop and wait for the test client to connect; Establish a test client connection.

2. A network card testing system according to claim 1, characterized in that: The data packets sent by the test client are compared with the data packets received. The verification method is to ensure the correctness of the data by checking the data packet header, data packet length, data packet type and data packet content.

3. A method for implementing the network card testing system as claimed in claim 1, characterized in that: The steps are: (1) Connecting the network card to be tested to the network card interface of the test client, and configuring a parameter data packet through the test client based on the performance of the network card to be tested; (2) Generate a data packet to be sent through a data packet generator, and transmit the data packet to the test server through the network card to be tested; (3) The test server sends the received data packets completely to the test client through the network loopback interface; (4) The packet capturer captures all packets received from the network card under test; (5) The test client parses and analyzes the received data packets and saves the test results to a file; (6) Calculate the delay jitter between the test client sending a data packet and receiving a data packet; (7) Based on the complete data of the data packet, detect the first frame of the received data packet, and record the delay value of the first frame, then record the delay value of the second frame, record the delay values ​​of all frames of the data packet in sequence, and record the delay jitter data according to the delay jitter calculation method; (8) Record the minimum delay jitter value, the maximum delay jitter value, and the average delay jitter value and generate a file; (9) Testers classify and number the network cards under test according to the test files.