Performance testing methods, apparatus, equipment, storage media, and program products
By setting the switch to FEC mode and using iperf software for data transmission and CRC analysis, the problem of universality in traditional network performance testing is solved, and efficient evaluation of network performance is achieved.
Patent Information
- Application Number
- CN202310555725.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-05-16
AI Technical Summary
Traditional technologies lack universally applicable network performance testing methods, especially in the absence of dedicated instruments and equipment, making it impossible to effectively test network performance.
By sending mode setting commands to the switch, the FEC mode of the server network card and the switch port is adjusted, and the iperf software is used to test data transmission, receive and analyze the number of CRC errors to determine network performance.
It enables highly universal network performance testing without the need for specialized instruments and equipment, and can effectively evaluate FEC performance and network card transmission performance.
Smart Images

Figure CN116614409B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a performance testing method, apparatus, device, storage medium, and program product. Background Technology
[0002] When network performance is low in a network environment, data transmission often results in a large number of data packets being lost. To avoid this problem, it is necessary to conduct network performance testing on the network environment.
[0003] In traditional technologies, network performance testing is conducted using specialized instruments and equipment, such as using the N4891A 400GBASEFEC to test the network's FEC (Forward Error Correction) performance.
[0004] However, without instruments and equipment for testing network performance, it is impossible to test network performance. Therefore, traditional methods for testing network performance have low universality. Summary of the Invention
[0005] Therefore, it is necessary to provide a performance testing method, apparatus, equipment, storage medium, and program product with high universality to address the above-mentioned technical problems.
[0006] Firstly, this application provides a performance testing method. The method includes sending a mode setting command to a switch in a target test network; wherein the target test network includes a switch, a first server, and a second server, the network interface card (NIC) in the first server is communicatively connected to the switch via a first port, and the NIC in the second server is communicatively connected to the switch via a second port; the mode setting command instructs the switch to set the FEC mode of the first and second ports according to the mode setting command; sending a test command to the first server, the test command instructing the first server to send test data to the second server via the switch; receiving test results output by the second server based on the test data, and determining the network performance of the target test network based on the test results.
[0007] In one embodiment, the mode setting instruction includes a first mode setting instruction, which instructs the switch to set the FEC mode of the first port and the second port to FEC enabled mode, receive test results output by the second server based on test data, and determine the network performance of the target test network based on the test results, including: receiving test results output by the second server based on test data, and determining the FEC performance of the target test network based on the test results.
[0008] In this embodiment, because the network interface cards (NICs) of the first server and the second server auto-negotiate with the first and second ports, the first mode setting command causes the switch to set the FEC mode of the first and second ports to FEC enabled. Consequently, the NICs of the first and second servers automatically adjust their FEC modes to FEC enabled. Therefore, during the transmission of test data between the first server, the switch, and the second server, FEC technology is utilized. The test results output by the second server based on the test data can then be used as a basis for judging the FEC performance of the target test network. This method of testing the FEC performance of the target test network by sending the first mode setting command and test commands to the target test network has higher versatility compared to traditional technologies.
[0009] In one embodiment, the mode setting instruction includes a second mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC off mode, receive the test results output by the second server based on the test data, and determine the network performance of the target test network based on the test results, including: receiving the test results output by the second server based on the test data, and determining the network card transmission performance of the target test network based on the test results.
[0010] In this embodiment, because the network interface cards (NICs) of the first server and the second server auto-negotiate with the first and second ports, the second mode setting command causes the switch to set the FEC mode of the first and second ports to FEC disabled. Consequently, the NICs of the first and second servers automatically adjust their FEC modes to FEC disabled. Therefore, whether packet loss occurs during data transmission between the first server, the switch, and the second server depends primarily on the transmission performance of the NICs in the first and second servers. The test results output by the second server based on the test data can then be used as a basis for judging the transmission performance of the NICs in the target test network. This method of testing the transmission performance of the target test network's NICs by sending second mode setting commands and test commands to the target test network has higher versatility compared to traditional technologies.
[0011] In one embodiment, the test results include the number of Cyclic Redundancy Check (CRC) errors. Determining the network performance of the target test network based on the test results includes: determining the network performance of the target test network based on the number of CRC errors and a preset threshold.
[0012] In this embodiment, the method of determining the network performance of the target test network based on the number of CRC errors and a preset threshold has the advantages of being simple and effective.
[0013] In one embodiment, before sending a test command to the first server, the method further includes: sending verification commands to the first server and the second server respectively, wherein the verification commands are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch respectively; correspondingly, sending a test command to the first server includes: after the negotiation results indicate that the first server and the second server have self-negotiated the FEC mode of the first port and the second port, sending a test command to the first server.
[0014] In this embodiment, verification commands are sent to the first server and the second server respectively to ensure that the first server and the second server have negotiated the FEC mode of the first port and the second port, thus ensuring that the corresponding test results are obtained under different FEC modes, thereby ensuring the accuracy of the test results used to judge FEC performance and network card transmission performance.
[0015] In one embodiment, the test instruction carries a test duration, which instructs the first server to continuously send test data to the second server via a switch within the test duration.
[0016] Secondly, this application also provides a performance testing apparatus. The apparatus includes: a first sending module, used to send a mode setting command to a switch in a target test network; wherein the target test network includes a switch, a first server, and a second server, the network interface card (NIC) in the first server is communicatively connected to the switch through a first port, and the NIC in the second server is communicatively connected to the switch through a second port; the mode setting command is used to instruct the switch to set the FEC mode of the first and second ports according to the mode setting command; a second sending module, used to send a test command to the first server, the test command being used to instruct the first server to send test data to the second server through the switch; and a determining module, used to receive the test results output by the second server based on the test data, and determine the network performance of the target test network based on the test results.
[0017] In one embodiment, the mode setting instruction includes a first mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC enabled mode. The determining module is also used to receive the test results output by the second server based on the test data, and determine the FEC performance of the target test network based on the test results.
[0018] In one embodiment, the mode setting instruction includes a second mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC off mode. The determining module is also used to receive the test results output by the second server based on the test data, and determine the network card transmission performance of the target test network according to the test results.
[0019] In one embodiment, the test results include the number of Cyclic Redundancy Check (CRC) errors. The determination module is specifically used to determine the network performance of the target test network based on the number of CRC errors and a preset threshold.
[0020] In one embodiment, the device further includes a third sending module, which is used to send verification instructions to the first server and the second server respectively. The verification instructions are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch respectively.
[0021] Correspondingly, the second sending module is specifically used to send a test command to the first server after the negotiation result indicates that the first server and the second server have negotiated the FEC mode of the first port and the second port.
[0022] In one embodiment, the test instruction carries a test duration, which instructs the first server to continuously send test data to the second server via a switch within the test duration.
[0023] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in any of the first aspects above.
[0024] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0025] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0026] The aforementioned performance testing method, apparatus, equipment, storage medium, and program product achieve network performance testing by sending mode setting instructions to switches in a target test network. The target test network includes switches, a first server, and a second server. The network interface cards (NICs) in the first server are connected to the switch via a first port, and the NICs in the second server are connected to the switch via a second port. The mode setting instructions instruct the switches to set the FEC mode of the first and second ports according to the instructions. Then, test instructions are sent to the first server, instructing it to send test data to the second server via the switch. Finally, the test results output by the second server based on the test data are received, and the network performance of the target test network is determined based on the test results. Thus, network performance testing can be achieved simply by sending mode setting instructions and test instructions to the target test network, without requiring dedicated network performance testing equipment. Therefore, it has higher versatility compared to traditional technologies. Attached Figure Description
[0027] Figure 1 This is a diagram illustrating the application environment of a performance testing method in one embodiment;
[0028] Figure 2 This is a flowchart illustrating a performance testing method in one embodiment;
[0029] Figure 3 This is a flowchart illustrating another performance testing method in one embodiment;
[0030] Figure 4 This is a structural block diagram of the performance testing apparatus in another embodiment;
[0031] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] Data transmission in network environments often suffers from significant packet loss. Specifically, optical signals degrade during transmission due to various factors, leading to misinterpretations at the receiver. For example, a "1" signal might be misinterpreted as a "0," or vice versa. This issue is closely related to the network interface card's (NIC) transmission performance and the network's Functional Error Correction (FEC) performance. Therefore, network performance testing is necessary, including testing both NIC transmission performance and FEC performance. NIC transmission performance is inherently related to its hardware capabilities, while FEC performance is related to the FEC technology used in the network—essentially, it's software-dependent. FEC technology involves pre-encoding the signal using a specific algorithm before it enters the transmission channel, adding redundant codes characteristic of the signal itself. At the receiving end, the received signal is decoded using a corresponding algorithm to identify and correct errors generated during transmission. In essence, it reduces the BER (Bit Error Ratio) of the received signal.
[0034] Currently, network performance testing utilizes specialized instruments and equipment, such as the N4891A 400GBASE FEC interactive physical layer receiver test solution, which can characterize and quantify the actual BER (Bit Error Rate) and FEC performance of silicon communication devices. However, this solution relies on specialized instruments and equipment, resulting in low universality. Therefore, it is necessary to propose effective technical means to address this issue.
[0035] The performance testing method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with target test network 104 via a network. Target test network 104 includes a switch, a first server, and a second server. Terminal 102 sends test commands to the first server, instructing the first server to send test data to the second server via the switch. Then, terminal 102 receives the test results output by the second server based on the test data and determines the network performance of the target test network according to the test results. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, and tablets. The first server and the second server can be implemented using independent servers or a server cluster consisting of multiple servers.
[0036] In one embodiment, such as Figure 2 The diagram illustrates a performance testing method, which is then applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:
[0037] Step 201: Send a mode setting command to the switch in the target test network; wherein, the target test network includes a switch, a first server and a second server, the network card in the first server is connected to the switch through the first port of the switch, and the network card in the second server is connected to the switch through the second port of the switch; the mode setting command is used to instruct the switch to set the FEC mode of the first port and the second port according to the mode setting command.
[0038] For example, the switch includes an optical module supporting FEC technology, a first port, a second port, and a control module, wherein both the first port and the second port are in full-duplex mode and both support FEC technology.
[0039] The iperf software is installed on both the first and second servers. The first server acts as the client, and the second server acts as the server. The network interface cards (NICs) are server NICs that support FEC technology. Various types of NICs are available, including 10G, 25G, 40G, and 100G NICs. FEC modes include FEC-enabled and FEC-disabled modes.
[0040] The data transmission principle in the target test network is as follows: The network card in the first server packages the data to be transmitted using FEC technology and sends it to the optical module through the first port. The optical module performs electro-optical conversion and sends the data to be transmitted in the form of an optical signal to the network card of the second server. The network card of the second server uses FEC technology to unpack the packaged data to be transmitted and obtain the data to be transmitted.
[0041] Optionally, the terminal remotely logs into the control module of the switch and sends a mode setting command to the control module. After receiving the mode setting command, the control module sets the FEC mode of the first port and the second port according to the mode setting command. When the network cards of the first server and the second server send data to each other through the switch, they will negotiate the FEC mode of the first port and the second port respectively, thereby changing their own FEC mode.
[0042] Step 202: Send a test command to the first server. The test command is used to instruct the first server to send test data to the second server through the switch.
[0043] For example, the test data consists of binary data composed of 0s and 1s.
[0044] Optionally, the terminal sends the test command "iperf -c IP" to the iperf server in the first server to make the first server a client, where IP is the IP address of the second server, and then sends the enable command "iperf -s" to the iperf server in the second server to make the second server a server.
[0045] After receiving the test command, the iperf in the first server outputs the test data. The network card of the first server processes the test data with FEC technology or does not process it with FEC technology according to the FEC mode negotiated by auto-negotiation. Then, the processed or unprocessed test data is sent to the second server through the switch.
[0046] Step 203: Receive the test results output by the second server based on the test data, and determine the network performance of the target test network based on the test results.
[0047] Optionally, after receiving the test data, iperf in the second server performs a CRC (Cyclic Redundancy Check) on the test data, processes data with CRC errors, obtains the test results, and outputs them to the terminal. The terminal then determines the network performance of the target test network based on the test results.
[0048] CRC is a channel coding technique that generates a short, fixed-length checksum based on data such as network data packets or computer files. It is mainly used to detect or verify errors that may occur after data transmission or storage. Specifically, it uses the principle of division and remainder to perform error detection.
[0049] In summary, by sending mode setting commands to switches in the target test network (which includes switches, a first server, and a second server), where the network interface cards (NICs) of the first server communicate with the switch via the first port and the NICs of the second server communicate with the switch via the second port, the mode setting commands instruct the switches to set the FEC mode of the first and second ports accordingly. Then, test commands are sent to the first server, instructing it to send test data to the second server via the switch. Finally, the test results output by the second server based on the test data are received, and the network performance of the target test network is determined based on the test results. This method achieves network performance testing by sending mode setting and test commands to the target test network without requiring dedicated network performance testing equipment, thus offering greater versatility compared to traditional technologies.
[0050] In one embodiment, the mode setting instruction includes a first mode setting instruction, which instructs the switch to set the FEC mode of the first port and the second port to FEC enabled mode, receive test results output by the second server based on test data, and determine the network performance of the target test network based on the test results, including: receiving test results output by the second server based on test data, and determining the FEC performance of the target test network based on the test results.
[0051] For example, the switch is Mellanox, and the first mode setting command is "fec-override rs-fecforce".
[0052] Optionally, the terminal remotely logs into the switch's control module and sends a first mode setting command to the control module. Upon receiving the first mode setting command, the control module sets the FEC mode of the first port and the second port to FEC enabled mode according to the command. The network cards of the first server and the second server respectively perform self-negotiation with the first port and the second port, and automatically adjust their own FEC mode to FEC enabled mode according to the FEC enabled mode obtained through self-negotiation.
[0053] The terminal sends a test command to the iperf server on the first server. After receiving the test command, the iperf server on the first server outputs test data. The network card on the first server packages the test data using FEC technology and then sends the packaged test data to the network card on the second server through a switch. The network card on the second server unpacks the received packaged test data using FEC technology to obtain the test data. After receiving the test data, the iperf server on the second server performs CRC on the test data, processes data with CRC errors, obtains the test result, and outputs it to the terminal. Then, the terminal determines the FEC performance of the target test network based on the test result.
[0054] In this embodiment, because the network interface cards (NICs) of the first server and the second server auto-negotiate with the first and second ports, the first mode setting command causes the switch to set the FEC mode of the first and second ports to FEC enabled. Consequently, the NICs of the first and second servers automatically adjust their FEC modes to FEC enabled. Therefore, during the transmission of test data between the first server, the switch, and the second server, FEC technology is utilized. The test results output by the second server based on the test data can then be used as a basis for judging the FEC performance of the target test network. This method of testing the FEC performance of the target test network by sending the first mode setting command and test commands to the target test network has higher versatility compared to traditional technologies.
[0055] In one embodiment, the mode setting instruction includes a second mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC off mode, receive the test results output by the second server based on the test data, and determine the network performance of the target test network based on the test results, including: receiving the test results output by the second server based on the test data, and determining the network card transmission performance of the target test network based on the test results.
[0056] For example, the switch is Mellanox, and the second mode setting command is "fec-override no-fecforce".
[0057] Optionally, the terminal remotely logs into the switch's control module and sends a second mode setting command to the control module. Upon receiving the second mode setting command, the control module sets the FEC mode of the first port and the second port to FEC disabled mode according to the command. The network cards of the first server and the second server respectively perform self-negotiation with the first port and the second port, and automatically adjust their own FEC mode to FEC disabled mode according to the negotiated FEC disabled mode.
[0058] The terminal sends a test command to the iperf server on the first server. After receiving the test command, the iperf server on the first server outputs test data. The network card on the first server does not perform FEC (Fault-Corrected Packet) packaging on the test data, that is, it packages the data normally. Then, it sends the packaged test data to the network card on the second server through the switch. The network card on the second server unpacks the packaged test data, that is, it unpacks the data normally, and obtains the test data. After receiving the test data, the iperf server on the second server performs CRC on the test data, processes the data with CRC errors, obtains the test result, and outputs it to the terminal. Then, the terminal determines the network card transmission performance of the target test network based on the test result.
[0059] In this embodiment, because the network interface cards (NICs) of the first server and the second server auto-negotiate with the first and second ports, the second mode setting command causes the switch to set the FEC mode of the first and second ports to FEC disabled. Consequently, the NICs of the first and second servers automatically adjust their FEC modes to FEC disabled. Therefore, whether packet loss occurs during data transmission between the first server, the switch, and the second server depends primarily on the transmission performance of the NICs in the first and second servers. The test results output by the second server based on the test data can then be used as a basis for judging the transmission performance of the NICs in the target test network. This method of testing the transmission performance of the target test network's NICs by sending second mode setting commands and test commands to the target test network has higher versatility compared to traditional technologies.
[0060] In one embodiment, the test instruction carries a test duration, which instructs the first server to continuously send test data to the second server via a switch within the test duration.
[0061] For example, the test command sent to the first server is "iperf -c IP -t", where t represents the test duration in milliseconds, which can be set as needed.
[0062] Optionally, after the FEC mode of a network card is enabled, it generally requires a long period of testing to determine its FEC performance. For example, if a first mode setting command is sent to the switch, the test command sent to the first server can be "iperf -c IP -43200"; if a second mode setting command is sent to the switch, the test command sent to the first server can be "iperf -c IP -100".
[0063] In one embodiment, the test results include the number of Cyclic Redundancy Check (CRC) errors. Determining the network performance of the target test network based on the test results includes: determining the network performance of the target test network based on the number of CRC errors and a preset threshold.
[0064] For example, after receiving the test data, iperf in the second server performs a CRC check on the test data.
[0065] For CRC error data output or marked "CRC ERROR", then count the number of "CRC ERROR", which is the number of CRC errors.
[0066] Optionally, if the FEC performance of the target test network is being tested, the preset threshold is 0. That is, after sending the first mode setting command to the switch and the test command carrying the test duration to the first server, if the number of CRC errors received from the second server is 0, it means that the FEC performance of the target test network is good, that is, the test is passed; otherwise, the test is failed.
[0067] Optionally, if the test is to assess the network interface card (NIC) transmission performance of the target test network, the preset threshold is determined based on the NIC type. For example, the preset threshold is 250 for a 25G NIC, 1000 for a 100G (4*25G) NIC, and 100000 for a 100G (2*50G) NIC. That is, after sending a second mode setting command to the switch and a test command carrying the test duration to the first server, for a 25G NIC, if the number of CRC errors is less than 250, the target test network's NIC transmission performance is good; for a 100G (4*25G) NIC, if the number of CRC errors is less than 1000, the target test network's NIC transmission performance is good; for a 100G (2*50G) NIC, if the number of CRC errors is less than 100000, the target test network's NIC transmission performance is good, meaning the test passes; otherwise, the test fails.
[0068] In this embodiment, the method of determining the network performance of the target test network based on the number of CRC errors and a preset threshold has the advantages of being simple and effective.
[0069] In one embodiment, before sending a test command to the first server, the method further includes: sending verification commands to the first server and the second server respectively, wherein the verification commands are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch respectively; correspondingly, sending a test command to the first server includes: after the negotiation results indicate that the first server and the second server have self-negotiated the FEC mode of the first port and the second port, sending a test command to the first server.
[0070] For example, both the first and second servers are equipped with Linux OS operating systems. The ethtool tool that comes with the Linux OS can be used to directly view the FEC mode of the network card. Specifically, the FEC mode of the first and second servers can be viewed using the verification command "ethtool --show-fec ethx".
[0071] Optionally, after sending the first mode setting command to the switch, a verification command is sent to the first server and the second server respectively. If it is found that the FEC mode of the first server and the second server are both in FEC enabled mode, it means that the first server and the second server have respectively negotiated the FEC enabled mode of the first port and the second port of the switch. Then, a test command is sent to the first server.
[0072] Optionally, after sending the second mode setting command to the switch, a verification command is sent to the first server and the second server respectively. If the FEC mode of the first server and the second server is found to be FEC off mode, it means that the first server and the second server have respectively negotiated the FEC off mode of the first port and the second port of the switch. Then, a test command is sent to the first server.
[0073] In this embodiment, verification commands are sent to the first server and the second server respectively to ensure that the first server and the second server have negotiated the FEC mode of the first port and the second port, thus ensuring that the corresponding test results are obtained under different FEC modes, thereby ensuring the accuracy of the test results used to judge FEC performance and network card transmission performance.
[0074] In summary, such as Figure 3The diagram illustrates another performance testing method, which is also the most detailed embodiment of this application. The target test network includes a switch, a first server, and a second server. The network interface card (NIC) in the first server communicates with the switch through the first port of the switch, and the NIC in the second server communicates with the switch through the second port of the switch. The network performance test of the target test network is divided into two aspects: FEC performance testing and NIC transmission performance testing. The specific steps are as follows:
[0075] (1) For FEC performance testing:
[0076] Step S1: Send a first mode setting command to the switch in the target test network. The first mode setting command is used to instruct the switch to set the FEC mode of the first port and the second port to FEC enabled mode.
[0077] In step S2, the first server and the second server send verification commands respectively. The verification commands are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch.
[0078] Step S3: After the negotiation result indicates that the first server and the second server have negotiated the FEC enable mode of the first port and the second port, the first server sends a test instruction carrying the test duration to the first server. The test instruction carrying the test duration is used to instruct the first server to continuously send test data to the second server through the switch within the test duration.
[0079] Step S4: Receive the number of CRC errors output by the second server based on the test data. If the number of CRC errors is 0, the FEC performance of the target test network passes the test; otherwise, the test fails.
[0080] (2) For network card transmission performance testing:
[0081] Step S1: Send a second mode setting command to the switches in the target test network. The second mode setting command is used to instruct the switches to set the FEC mode of the first port and the second port to FEC disabled mode.
[0082] In step S2, the first server and the second server send verification commands respectively. The verification commands are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch.
[0083] Step S3: After the negotiation result indicates that the first server and the second server have negotiated the FEC off mode of the first port and the second port, the first server sends a test instruction carrying the test duration to the first server. The test instruction carrying the test duration is used to instruct the first server to continuously send test data to the second server through the switch within the test duration.
[0084] Step S4: Receive the number of CRC errors output by the second server based on the test data. If the number of CRC errors is less than a preset threshold, the network card transmission performance of the target test network passes the test; otherwise, the test fails. The preset threshold is determined according to the type of network card.
[0085] This application can perform FEC performance testing by sending a first mode setting command and a test command to the target test network, and can perform network card transmission performance testing by sending a second mode setting command and a test command, which has higher universality compared with traditional technologies.
[0086] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0087] Based on the same inventive concept, this application also provides a performance testing apparatus for implementing the performance testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more performance testing apparatus embodiments provided below can be found in the limitations of the performance testing method described above, and will not be repeated here.
[0088] In one embodiment, such as Figure 4 As shown, a structural block diagram of a performance testing device is provided. The performance testing device includes: a first transmitting module 401, a second transmitting module 402, and a determining module 403, wherein:
[0089] The first sending module 401 is used to send a mode setting command to a switch in the target test network. The target test network includes a switch, a first server, and a second server. The network card in the first server is connected to the switch through the first port of the switch, and the network card in the second server is connected to the switch through the second port of the switch. The mode setting command is used to instruct the switch to set the FEC mode of the first port and the second port according to the mode setting command.
[0090] The second sending module 402 is used to send a test command to the first server. The test command is used to instruct the first server to send test data to the second server through the switch.
[0091] The determination module 403 is used to receive the test results output by the second server based on the test data, and determine the network performance of the target test network based on the test results.
[0092] In one embodiment, the mode setting instruction includes a first mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC enabled mode. The determining module 403 is also used to receive the test results output by the second server based on the test data, and determine the FEC performance of the target test network based on the test results.
[0093] In one embodiment, the mode setting instruction includes a second mode setting instruction, which is used to instruct the switch to set the FEC mode of the first port and the second port to FEC off mode. The determining module 403 is also used to receive the test results output by the second server based on the test data, and determine the network card transmission performance of the target test network according to the test results.
[0094] In one embodiment, the test results include the number of Cyclic Redundancy Check (CRC) errors. The determination module 403 is specifically used to determine the network performance of the target test network based on the number of CRC errors and a preset threshold.
[0095] In one embodiment, the device further includes a third sending module, which is used to send verification instructions to the first server and the second server respectively. The verification instructions are used to instruct the first server and the second server to output the negotiation results after self-negotiation with the switch respectively.
[0096] Correspondingly, the second sending module 402 is specifically used to send a test command to the first server after the negotiation result indicates that the first server and the second server have negotiated the FEC mode of the first port and the second port.
[0097] In one embodiment, the test instruction carries a test duration, which instructs the first server to continuously send test data to the second server via a switch within the test duration.
[0098] Each module in the aforementioned performance testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0099] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a performance testing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0100] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0101] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0102] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0103] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0104] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0105] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0106] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A performance testing method, characterized in that, The method includes: A mode setting command is sent to the switch in the target test network. The target test network includes the switch, a first server, and a second server. The network interface cards (NICs) in the first server are connected to the switch via a first port, and the NICs in the second server are connected to the switch via a second port. The mode setting command instructs the switch to set the FEC mode of both the first and second ports to either FEC enabled or FEC disabled. The NICs in the first server adjust their FEC mode to match the FEC mode of the first port through auto-negotiation with the first port, and the NICs in the second server adjust their FEC mode to match the FEC mode of the second port through auto-negotiation with the second port. Send a test command to the first server, the test command being used to instruct the first server to send test data to the second server through the switch; The system receives the test results output by the second server based on the test data, and determines the network performance of the target test network based on the test results. The network performance includes FEC performance and network card transmission performance.
2. The method according to claim 1, characterized in that, The mode setting instructions include a first mode setting instruction, which instructs the switch to set the FEC mode of the first port and the second port to FEC enabled mode. Receiving the test results output by the second server based on the test data, and determining the network performance of the target test network based on the test results, includes: Receive the test results output by the second server based on the test data, and determine the FEC performance of the target test network based on the test results.
3. The method according to claim 1, characterized in that, The mode setting instruction includes a second mode setting instruction, which instructs the switch to set the FEC mode of the first port and the second port to FEC disabled mode. Receiving the test results output by the second server based on the test data, and determining the network performance of the target test network based on the test results, includes: Receive the test results output by the second server based on the test data, and determine the network card transmission performance of the target test network according to the test results.
4. The method according to any one of claims 1-3, characterized in that, The test results include the number of Cyclic Redundancy Check (CRC) errors. Determining the network performance of the target test network based on the test results includes: The network performance of the target test network is determined based on the number of CRC errors and a preset threshold.
5. The method according to any one of claims 1-3, characterized in that, Before sending the test command to the first server, the method further includes: A verification command is sent to the first server and the second server respectively, the verification command being used to instruct the first server and the second server to output the negotiation result after self-negotiation with the switch respectively; Correspondingly, sending the test command to the first server includes: After the negotiation result indicates that the first server and the second server have negotiated the FEC mode for the first port and the second port, a test command is sent to the first server.
6. The method according to claim 5, characterized in that, The test instruction carries a test duration, which is used to instruct the first server to continuously send the test data to the second server through the switch within the test duration.
7. A performance testing device, characterized in that, The device includes: A first sending module is used to send a mode setting command to a switch in a target test network. The target test network includes the switch, a first server, and a second server. A network interface card (NIC) in the first server is communicatively connected to the switch via a first port, and a NIC in the second server is communicatively connected to the switch via a second port. The mode setting command instructs the switch to set the FEC mode of both the first and second ports to either FEC enabled or FEC disabled. The NICs in the first server negotiate with the first port to adjust their FEC mode to match the FEC mode of the first port, and the NICs in the second server negotiate with the second port to adjust their FEC mode to match the FEC mode of the second port. The second sending module is used to send a test command to the first server, the test command being used to instruct the first server to send test data to the second server through the switch; The determination module is used to receive the test results output by the second server based on the test data, and determine the network performance of the target test network according to the test results, wherein the network performance includes FEC performance and network card transmission performance.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Switch port adaptation method, system and device and readable storage medium
CN115604374A
Method and apparatus for monitoring bit-error rate
US20080120524A1