CN114978959B - Performance test method and device for network equipment - Google Patents
Performance test method and device for network equipment Download PDFInfo
- Publication number
- CN114978959B CN114978959B CN202210595792.6A CN202210595792A CN114978959B CN 114978959 B CN114978959 B CN 114978959B CN 202210595792 A CN202210595792 A CN 202210595792A CN 114978959 B CN114978959 B CN 114978959B
- Authority
- CN
- China
- Prior art keywords
- message
- test mode
- cache space
- shared cache
- information
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 34
- 238000011056 performance test Methods 0.000 title description 40
- 238000012360 testing method Methods 0.000 claims abstract description 263
- 238000004891 communication Methods 0.000 claims abstract description 16
- 230000001360 synchronised effect Effects 0.000 claims description 47
- 238000007689 inspection Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000001914 filtration Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 description 14
- 238000013461 design Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000010998 test method Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the application belongs to the technical field of communication, and discloses a performance testing method and device of network equipment, which are used for solving the problems of low testing efficiency and low resource utilization rate. Specifically, a first message corresponding to a current test mode is generated, and the first message is sent to network equipment; acquiring first information and a storage position, and storing the first information in a shared cache space according to the storage position, wherein the size of the shared cache space is preset according to the maximum cache space of network equipment; receiving a second message sent by the network equipment; acquiring second information, and updating the first information stored in the shared cache space into the second information; and under the condition that the next message sending is determined, determining the performance parameters of the network equipment according to the second information stored in the shared buffer space.
Description
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a performance test method and device of network equipment.
Background
Typically, a series of tests are performed to verify that each performance indicator meets design requirements before the network device (e.g., switch, network card, etc.) is put into service.
At present, a tester adopts test equipment to test by adopting a test method corresponding to the performance index to be tested, and the test methods adopted by different performance indexes are different. However, the number of performance indicators of the network device is large. The existing test method is used for testing a plurality of performance indexes of the network equipment, so that the test time is long, the test efficiency is low, and the resource utilization rate is low.
Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the application provides a performance testing method and device of network equipment, so as to solve the problems of low testing efficiency and low resource utilization rate.
In a first aspect, the present application provides a method for testing performance of a network device, including: generating a first message corresponding to the current test mode, and sending the first message to the network equipment, so that the first message can be forwarded through the network equipment conveniently; acquiring first information and a storage position, and storing the first information in a shared cache space according to the storage position, wherein the size of the shared cache space is preset according to the maximum cache space of network equipment; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, and if the current test mode is other modes except the synchronous service test mode, the first information comprises a sending identifier; the sending identifier is used for representing that the first message is sent; receiving a second message sent by the network equipment; acquiring second information, and updating the first information stored in the shared cache space into the second information; if the current test mode is a synchronous service test mode, the second information is the service type of the second message; if the current test mode is other modes except the synchronous service test mode, the second information comprises an update identifier; and under the condition that the next message sending is determined, determining the performance parameters of the network equipment according to the second information stored in the shared buffer space.
According to the embodiment of the application, the shared cache depth of the performance testing device is configured according to the maximum cache space of the tested equipment, so that the utilization rate of resources is effectively improved. No matter which test mode, the performance testing device can determine the performance parameters of the network equipment by utilizing the information stored in the shared cache space, and the test efficiency is higher.
In one possible design, the current test mode includes, but is not limited to, a packet loss rate test mode, an acknowledge ACK protocol test mode, a traffic loss test mode, a traffic filtering test mode, and a synchronous traffic test mode. The depth of the shared cache space is greater than or equal to the depth of the maximum cache space; the width of the shared buffer space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n M+1-n, the maximum buffer space of the network device>0. The shared buffer space includes the same sizeAnd a second shared cache space.
In another possible design, the obtaining the first information and the storage location, and storing the first information in the shared cache space according to the storage location includes:
if the current test mode is a packet loss rate test mode, taking the lower n bits in the sequence number of the first message as storage positions; adding a first preset character to the last bit of m-n bits in the sequence number of the first message, and taking a character string obtained by adding the first preset character as a transmission identifier, wherein the first preset character is used for representing that the first message is transmitted; storing a transmission identifier in a storage position of a first shared cache space, and then storing a second preset character in a storage position of a second shared cache space;
If the current test mode is a service loss test mode, determining the initial position of the first shared cache space as a storage position; determining the low 16 bits of the destination MAC address of the first message as the high 16 bits of the sending identifier; storing a transmission identifier in a storage position of a first shared cache space, and then storing a second preset character in a storage position of a second shared cache space;
if the current test mode is the synchronous service test mode, determining that the storage position is the starting position of the first shared cache space, acquiring the service type, and storing the service type in the starting position of the first shared cache space.
In another possible design, the obtaining the first information and the storage location, and storing the first information in the shared cache space according to the storage location includes:
if the current test mode is other modes, determining a storage area range and an inspection area range of the shared cache space according to the storage position; the first information is stored in the storage area range, and the second preset character is stored in the inspection area range.
In another possible design manner, determining the storage area range and the check area range of the shared buffer space according to the storage location includes:
If the storage position is the address k of the first shared cache space, determining the storage areaThe address range is: [ Address k+1,2 of first shared cache space ] n -1]And [ start address of second shared cache space, start address of second shared cache space +k ]];
The address range of the examination zone is determined as follows: [ initial Address of first shared cache space, +k ]]And [ addresses k+1,2 of the second shared cache space ] n -1]。
In another possible design, the method for obtaining the second information and updating the first information to the second information includes:
if the current test mode is a synchronous service test mode, acquiring a service type of the second message, and updating the service type stored in the first shared cache space into the service type of the second message;
if the current test mode is other modes, determining an updating position according to the sequence number of the second message and the address range of the checking area; determining whether the second message is a retransmission message according to the storage content in the updating position in the storage area; if the second message is not a retransmission message, updating the last character of the storage content positioned at the updating position in the storage area to a second preset character so as to generate an updating identification.
In another possible design manner, determining whether the second message is a retransmission message according to the storage content located at the update position in the storage area includes:
determining whether an end character of the stored content located at the updated position in the storage area is a second preset character;
if yes, determining that the second message is a retransmission message;
if not, determining that the second message is not the retransmission message.
In another possible design, the performance test method further includes:
if the current test mode is a packet loss rate test mode or a service loss mode, reading end characters of contents in the check area; if the read last character is a second preset character, determining that the sent message is not lost; if the read last character is a first preset character, determining that the sent message is lost;
if the current test mode is a synchronous service test mode, reading a service type from the initial position of the first shared cache space; and comparing the read service type with the service type in the second message to determine the type of the lost synchronous frame.
In a second aspect, a performance testing apparatus is provided. The performance test device includes: generating unit, transmitting unit, obtaining unit, receiving unit and determining unit.
And the generating unit is used for generating a first message corresponding to the current test mode. And the sending unit is used for sending the first message to the network equipment and facilitating forwarding of the first message through the network equipment. The network equipment comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring first information and a storage position, and storing the first information in a shared cache space according to the storage position, and the size of the shared cache space is preset according to the maximum cache space of the network equipment; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, and if the current test mode is other modes except the synchronous service test mode, the first information comprises a sending identifier; the transmission identity is used to characterize that the first message has been transmitted. And the receiving unit is used for receiving the second message sent by the network equipment. And the acquisition unit is also used for acquiring the second information. The storage unit is used for updating the first information stored in the shared cache space into the second information; if the current test mode is a synchronous service test mode, the second information is the service type of the second message; if the current test mode is other than the synchronous service test mode, the second information includes an update identification. And the determining unit is used for determining the performance parameters of the network equipment according to the second information stored in the shared buffer space under the condition of determining the next message sending.
In a third aspect, the present application provides a network performance testing apparatus comprising a memory and a processor. The memory is coupled to the processor. The memory is for storing computer program code, the computer program code comprising computer instructions. When the processor executes the computer instructions, the network performance testing apparatus performs the network performance testing method as described in the first aspect and any one of its possible designs.
In a fourth aspect, the present application provides a chip system, the chip system being applied to a network performance testing apparatus; the system-on-chip includes one or more interface circuits, and one or more processors. The interface circuit and the processor are interconnected through a circuit; the interface circuit is configured to receive a signal from a memory of the network performance testing apparatus and to send the signal to the processor, the signal including computer instructions stored in the memory. When the processor executes the computer instructions, the network performance testing apparatus performs the network performance testing method as described in the first aspect and any one of its possible designs.
In a fifth aspect, the present application provides a computer readable storage medium comprising computer instructions which, when run on a network performance testing apparatus, cause the network performance testing apparatus to perform a network performance testing method according to the first aspect and any one of its possible designs.
In a sixth aspect, the present application provides a computer program product comprising computer instructions which, when run on a network performance testing apparatus, cause the network performance testing apparatus to perform a network performance testing method according to the first aspect and any one of its possible designs.
For a detailed description of the second aspect and various implementations thereof in this application, reference may be made to the detailed description of the first aspect and various implementations thereof; moreover, the advantages of the second aspect and the various implementations thereof may be referred to as analyzing the advantages of the first aspect and the various implementations thereof, and will not be described herein.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings needed in the embodiments of the present application, and it is obvious that the drawings described below are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a communication system provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a computing device provided in an embodiment of the present application;
fig. 3 is a flowchart of a performance test method of a network device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a partition structure of a shared cache area according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a performance testing apparatus according to an embodiment of the present application.
Detailed Description
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
The embodiment of the application provides a performance test method of network equipment, which is applicable to a communication system comprising test equipment and tested equipment. Fig. 1 shows the structure of the communication system. As shown in fig. 1, the communication system includes a test device 10 and at least one device under test 11, each device under test 11 being connected to the test device 10. The device under test 11 and the test device 10 may be connected by a wired connection or a wireless connection, which is not specifically limited in the embodiment of the present application.
The test device 10 may be a centralized controller, a network manager, or a device that performs performance index analysis of a network device. The device under test 11 may be a switch, a router, or other network devices such as a network card.
The test device 10 may be one device, or may refer to a collection of multiple devices (e.g., a cluster with a network device performance index analysis function). The embodiment of the present application is not particularly limited thereto. The test device 10 may be a functional module, and is integrated on a specific physical device, or may refer to a physical device for implementing the functions implemented by the performance index test apparatus of a network device in the embodiments of the present application.
Messages are transmitted between the test device 10 and the device under test 11. The test device 10 in this embodiment of the present application is preconfigured with a shared buffer space, and the size of the shared buffer space is preset according to the maximum buffer space of the device under test. The shared buffer space is used for storing information about messages (first information as referred to below) sent by the test device 10 to the device under test 11 and information about messages (second information as referred to below) sent to the test device 10 after being forwarded via the device under test 11. In the subsequent process of sending the message, the test device 10 may determine the performance parameter (such as the frame loss rate) of the tested device according to the second information stored in the shared buffer space.
The basic hardware architecture of the test device 10 and the device under test 11 described above is similar, including the elements included in the computing apparatus shown in fig. 2. The hardware configuration of the test apparatus 10 and the device under test 11 will be described below using the computing device shown in fig. 2 as an example. As shown in fig. 2, the computing device may include a processor 21, a memory 22, a communication interface 23, and a bus 24. The processor 21, the memory 22 and the communication interface 23 may be connected by a bus 24.
The processor 21 is a control center of the computing device, and may be one processor or a collective term of a plurality of processing elements. For example, the processor 21 may be a general-purpose central processing unit (central processing unit, CPU), or may be another general-purpose processor. Wherein the general purpose processor may be a microprocessor or any conventional processor or the like.
As one example, processor 21 may include one or more CPUs, such as CPU 0 and CPU1 shown in fig. 2.
Memory 22 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), magnetic disk storage or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In a possible implementation, the memory 22 may exist separately from the processor 21, and the memory 22 may be connected to the processor 21 by a bus 24 for storing instructions or program code. The processor 21, when calling and executing instructions or program codes stored in the memory 22, can implement the performance test method of the network device provided in the following embodiments of the present application.
In the embodiment of the present application, the software programs stored in the test device 10 and the device under test 11 are different, so that the functions realized by the test device 10 and the device under test 11 are different. The functions performed with respect to the respective devices will be described in connection with the following flowcharts.
In another possible implementation, the memory 22 may also be integrated with the processor 21.
A communication interface 23 for connecting the computing device with other devices via a communication network, which may be an ethernet, a radio access network (radio access network, RAN), a wireless local area network (wireless local area networks, WLAN), etc. The communication interface 23 may include a receiving unit for receiving data, and a transmitting unit for transmitting data.
Bus 24 may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 2, but not only one bus or one type of bus.
It should be noted that the structure shown in fig. 2 is not limiting of the computing device, and the computing device may include more or less components than those shown in fig. 2, or may combine some components, or a different arrangement of components.
The execution body of the performance test method of the network device provided in the embodiment of the present application is a performance test device (hereinafter referred to simply as a performance test device) of the network device. The performance test device may be the test apparatus 10, a CPU in the test apparatus 10, or a control module for testing performance of a network device in the test apparatus 10. In the embodiment of the present application, a performance test method for executing a performance test method for a network device by using a performance test apparatus is taken as an example, and the performance test method for a network device provided in the present application is described.
The following describes a method for testing performance of a network device according to an embodiment of the present application with reference to the accompanying drawings.
As shown in fig. 3, the performance testing method of the network device provided in the embodiment of the present application includes the following steps.
S300, the performance testing device generates a first message corresponding to the current testing mode, and sends the first message to the network equipment (namely the tested equipment 11 in FIG. 1), so that the first message is conveniently forwarded through the network equipment.
The current test mode includes, but is not limited to, a packet loss rate test mode, an Acknowledgement (ACK) protocol test mode, a traffic loss test mode, a traffic filtering test mode, and a synchronous traffic test mode.
In practical application, the current test mode can be switched according to the actual requirement. Under different test modes, the performance testing device can determine the performance parameters of the network equipment according to the information of the received and transmitted messages. In this way, some/all of the modules in the performance testing apparatus for determining performance parameters may be reused. Compared with the existing test method, the method effectively improves the resource utilization rate.
Message formats corresponding to different test modes are different.
S301, the performance testing device acquires the first information and the storage position, and stores the first information in the shared cache space according to the storage position.
The size of the shared buffer space is preset according to the maximum buffer space of the network device. If the current test mode is the synchronous service test mode, the first information is the service type of the first message. If the current test mode is other than the synchronous service test mode, the first information includes a transmission identifier. The transmission identity is used to characterize that the first message has been transmitted.
The depth of the shared buffer space is greater than or equal to the depth of the maximum buffer space of the network device. The width of the shared buffer space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n M+1-n, the maximum buffer space for the network device>0。
The shared cache space comprises a first shared cache space and a second shared cache space which are the same in size.
Illustratively, the shared cache space is formed by a ping-pong structure, and includes two identical storage areas: a memory area a and a memory area B. The sequence number length of the message is 48, and the depth of the storage area A and the storage area B is 2 n Both widths are 49-n.
Under different test modes, the ways of the performance test device to acquire the first information and store the first information are different.
Optionally, if the current test mode is a packet loss rate test mode, the performance test device uses the lower n bits in the sequence number of the first message as a storage position; adding a first preset character (used for representing that the message is sent) to the last bit of m-n bits in the sequence number of the first message, and taking a character string obtained by adding the first preset character as a sending identifier; and storing the sending identifier in the storage position of the first shared cache space, and storing the second preset character in the storage position of the second shared cache space.
The content of the first preset character and the second preset character is not limited in the embodiment of the present application. In practical application, the configuration can be carried out according to practical requirements.
Illustratively, the sequence number in the first message is 48 bits in length, and the lower n bits are used as the address where the transmission identifier is stored. The performance testing device adds 1 (corresponding to the first preset character) to the tail of the other 48-n bits except the lower n bits in the serial number, and generates a transmission mark with the bit width of 49-n. Wherein the tail added 1 indicates that the message with the serial number is sent for the performance test device to judge whether the message is lost or retransmitted.
The transmitting side of the performance testing device adds a 48-bit serial number at the tail of the message data load. The serial numbers in the messages sent by the performance testing device are gradually increased one by one. When the performance test device sends the first message, firstly, the sending identifier is stored in the storage address of the storage area A, and then all zeros (corresponding to the second preset character) are stored in the same address of the storage area B. When the storage address of the storage area A is equal to the maximum cache space, the performance testing device stores the sending identification into the storage address of the storage area B when sending the message, and then stores all zeros into the same address in the storage area A, so that the performance testing device alternates back and forth.
Optionally, if the current test mode is a service loss test mode, the performance test device determines that the starting position of the first shared buffer space is a storage position; determining the low 16 bits of the destination MAC address of the first message as the high 16 bits of the sending identifier; and storing the sending identifier in the storage position of the first shared cache space, and storing the second preset character in the storage position of the second shared cache space.
Illustratively, in the traffic loss test mode, the lower 16 bits of the destination MAC address of the first packet are virtual link numbers, and the upper 16 bits of the transmission identifier are virtual link numbers of the packet.
Optionally, if the current test mode is the synchronous service test mode, the performance test device determines that the storage position is the starting position of the first shared buffer space, acquires the service type, and stores the service type in the starting position of the first shared buffer space.
For example: the performance testing device acquires the service type and stores the acquired service type in the 0 address of the storage area A. A number identified as the service type is sent.
It can be seen that the existence of the shared buffer space constructed by the ping-pong structure can save the resource space and reserve enough message identifications so as to ensure that the identifications of the messages still in the receiving transmission link are not covered when writing new message identifications. The low n bits are used as the address for transmitting the identification storage to realize sharing.
Specifically, if the current test mode is other modes, the method for storing the first information in the shared buffer space by the performance test device includes: determining a storage area range and an inspection area range of the shared cache space according to the storage position; the first information is stored in the memory area range, and the second preset character is stored in the check area range.
If the storage location is the address k of the first shared cache space, the performance testing device determines that the address range of the storage area is: [ Address k+1,2 of first shared cache space ] n -1]And [ start address of second shared cache space, start address of second shared cache space +k ]]。
The address range of the examination zone is determined as follows: [ initial Address of first shared cache space, +k ]]And [ addresses k+1,2 of the second shared cache space ] n -1]。
For example, as shown in fig. 4, the first shared buffer space is a buffer space a, and the second shared buffer space is a buffer space B, and then the buffer space a and the buffer space B may be divided into a check sum storage area according to the above method.
S302, the performance testing device receives a second message sent by the network equipment.
S303, the performance testing device acquires the second information and updates the first information stored in the shared cache space to the second information.
If the current test mode is the synchronous service test mode, the second information is the service type of the second message. If the current test mode is other than the synchronous service test mode, the second information includes an update identification.
Specifically, if the current test mode is the synchronous service test mode, the performance test device acquires the service type of the second message, and updates the service type stored in the first shared buffer space to the service type of the second message.
If the current test mode is other modes, the performance test device determines an update position according to the sequence number of the second message and the address range of the check area; and determining whether the second message is a retransmission message according to the storage content in the storage area at the updating position. If the second message is not a retransmission message, the performance testing device updates the last character of the storage content positioned at the updating position in the storage area to a second preset character so as to generate an updating identification.
For example, if the current test mode is a mode other than the synchronous service test mode, when a message is forwarded to the performance test apparatus via the device under test, the performance test apparatus extracts a 48-bit sequence number from the received message, and generates an update address and an update identifier according to the sequence number.
There is no overlapping area between the storage area range and the inspection area range of the shared cache space, so the performance test apparatus determines the update position based on the address ranges of the low n bits of the 48-bit serial number and the inspection area range.
The performance testing device determines whether the second message is a retransmission message according to the storage content in the updating position in the storage area, and the method comprises the following steps: the performance test means determines whether or not the last character of the stored content located at the updated position in the memory area is 0. If yes, determining that the second message is a retransmission message. If not, determining that the second message is not the retransmission message.
For example, if the last bit of the storage content in the storage area at the update position is zero, the performance test device determines that the second message is a retransmission message. The performance test device directly records the extracted 48-bit serial number into a register, and the upper layer application reads the serial number, and even the virtual link number can be extracted for the upper layer application to read. If the last bit of the storage content in the storage area at the updating position is not zero, the performance testing device is not informed of receiving the message, namely the performance testing device determines that the second message is not a retransmission message. The performance testing device sets the last position in the character string with the bit width of 49-n in the shared cache space as 0, and other bits are unchanged, so that the update identification can be obtained. The update identifies that the message characterizing this sequence number has been successfully received.
It can be seen that the performance test device stores the first information in the shared buffer space, which is beneficial to determining whether the tested device works normally. The performance test device stores the second information in the shared buffer space, which is beneficial to determining whether the message is lost or not according to the second information.
And S304, under the condition of sending the message next time, the performance testing device determines the performance parameters of the network equipment according to the second information stored in the shared buffer space.
If the current test mode is a packet loss rate test mode or a service loss mode, reading end characters of contents in the check area; if the read last character is a second preset character, determining that the sent message is not lost; if the read last character is a first preset character, determining that the sent message is lost;
if the current test mode is a synchronous service test mode, when the test equipment sends a message again, the service type is firstly extracted from the initial position of the storage area A, and the read service type and the sent service type are compared to judge which type of synchronous frame is lost.
For example, if the current test mode is the packet loss rate test mode, when the performance test device sends a message again, the number of the sent messages is increased by one, because the storage position of the sent message is located in the storage area, when whether the message is lost or not is checked, the storage content is extracted from the same address of the checking area. If the last bit of the storage content is 0, the message is not lost, and the number of the received messages is increased by one. The last bit of the storage content is 1, which indicates that the message is lost and the number of the received messages is unchanged. And the first 48-n bits of the stored content plus the current check address may be used to derive the sequence number of the missing message.
If the current test mode is a service loss mode, when the performance test device sends the message again, the stored content is firstly extracted from the same address of the check area, if the last bit of the stored content is 1, the message is indicated to be lost, the first 16 bits of the stored content, namely the virtual link number, can be extracted and reported to the upper layer application, and the service is indicated to be lost.
If the current test mode is the synchronous service test mode, when the performance test device sends the message again, the service type is firstly extracted from the address 0 of the storage area A, and the read service type and the sent service type are compared to judge which type of synchronous frame is lost.
It can be seen that the performance testing apparatus determines the performance parameters (such as the packet loss rate) of the network device when the message is sent again, so as to determine the real-time performance and accuracy of the performance parameters.
The performance test method provided by the embodiment of the application can effectively distinguish the retransmission and the loss of the message. In the test process, the influence of retransmission on the calculation of the packet loss rate can be effectively ignored, the test result is more accurate, and the applicability is wider. For the performance testing device, not only the performance parameters of the network equipment can be determined through message retransmission or message loss, but also the type of service of the network equipment is effectively determined to be abnormal according to the sequence number of the message.
According to the embodiment of the application, the shared cache depth of the performance testing device is configured according to the maximum cache space of the tested equipment, so that the utilization rate of resources is effectively improved. According to the maximum buffer space configuration performance test device of the tested equipment, the two problems are effectively solved by utilizing the ping-pong buffer, the resource is saved, the conflict is avoided, and the advantage is obvious.
The foregoing description of the solution provided in the embodiments of the present application has been mainly presented in terms of a method. To achieve the above functions, it includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application also provides a performance testing device of the network equipment. Fig. 5 is a schematic structural diagram of a performance testing apparatus 50 of a network device according to an embodiment of the present application. The performance testing apparatus 50 of the network device is configured to perform the performance testing method of the network device shown in fig. 3. The performance test apparatus 50 of the network device may include a generation unit 501, a communication unit 502, a storage unit 503, an update unit 504, and a determination unit 505. Of course, the performance testing apparatus 50 of the network device provided in the embodiment of the present application includes, but is not limited to, the above modules.
The generating unit 501 is configured to generate a first packet corresponding to a current test mode.
The communication unit 502 is configured to send the first message to the network device, so as to forward the first message via the network device.
A storage unit 503, configured to obtain the first information and the storage location, and store the first information in a shared buffer space according to the storage location, where the size of the shared buffer space is preset according to a maximum buffer space of the network device; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, and if the current test mode is other modes except the synchronous service test mode, the first information comprises a sending identifier and a storage position; the transmission identity is used to characterize that the first message has been transmitted.
The communication unit 502 is further configured to receive a second packet sent by the network device.
An updating unit 504, configured to obtain the second information, and update the first information stored in the shared buffer space to the second information; if the current test mode is a synchronous service test mode, the second information is the service type of the second message; if the current test mode is other than the synchronous service test mode, the second information includes an update identification.
A determining unit 505, configured to determine, when determining that the message is to be sent next, a performance parameter of the network device according to the second information stored in the shared buffer space.
Optionally, the current test mode includes, but is not limited to, a packet loss rate test mode, an acknowledge ACK protocol test mode, a traffic loss test mode, a traffic filtering test mode, a synchronous traffic test mode.
The depth of the shared cache space is greater than or equal to the depth of the maximum cache space; the width of the shared buffer space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n M+1-n, the maximum buffer space for the network device>0;
The shared cache space comprises a first shared cache space and a second shared cache space which are the same in size.
Optionally, the storage unit 503 is specifically configured to:
if the current test mode is a packet loss rate test mode, taking the lower n bits in the sequence number of the first message as storage positions; adding a first preset character to the last bit of m-n bits in the sequence number of the first message, and taking a character string obtained by adding the first preset character as a transmission identifier, wherein the first preset character is used for representing that the first message is transmitted; storing a transmission identifier in a storage position of a first shared cache space, and then storing a second preset character in a storage position of a second shared cache space;
if the current test mode is a service loss test mode, determining the initial position of the first shared cache space as a storage position; determining the low 16 bits of the destination MAC address of the first message as the high 16 bits of the sending identifier; storing a transmission identifier in a storage position of a first shared cache space, and then storing a second preset character in a storage position of a second shared cache space;
if the current test mode is a synchronous service test mode, determining that the storage position is the initial position of the first shared cache space; and acquiring the service type and storing the service type in the initial position of the first shared cache space.
Optionally, the storage unit 503 is specifically configured to:
If the current test mode is other modes, determining a storage area range and an inspection area range of the shared cache space according to the storage position;
the determining unit 505 is specifically configured to store the first information in the storage area range and the second preset character in the inspection area range:
if the storage location is the address m of the first shared cache space, determining the address range of the storage area as follows: [ Address m+1,2 of first shared cache space ] n -1]And [ start address of second shared cache space, start address of second shared cache space +m ]];
The address range of the examination zone is determined as follows: [ initial Address of first shared cache space, +m]And [ addresses m+1,2 of the second shared cache space ] n -1]。
Optionally, the updating unit 504 is specifically configured to: if the current test mode is a synchronous service test mode, acquiring a service type of the second message, and updating the service type stored in the first shared cache space into the service type of the second message;
if the current test mode is other modes, determining an updating position according to the sequence number of the second message and the address range of the checking area; determining whether the second message is a retransmission message according to the storage content in the updating position in the storage area; if the second message is not a retransmission message, updating the last character of the storage content positioned at the updating position in the storage area to a second preset character so as to generate an updating identification.
Optionally, the updating unit 504 is specifically configured to: determining whether an end character of the stored content located at the updated position in the storage area is a second preset character;
if yes, determining that the second message is a retransmission message;
if not, determining that the second message is not the retransmission message.
Alternatively, the determining unit 505 is specifically configured to:
if the current test mode is other modes, reading the end character of the content in the range of the check area; if the read last character is a second preset character, determining that the message is not lost; if the read last character is a first preset character, determining that the message is lost;
if the current test mode is a synchronous service test mode, reading a service type from the initial position of the first shared cache space; and comparing the read service type with the service type in the second message to determine the type of the lost synchronous frame.
In actual implementation, the generating unit 501, the updating unit 504, and the determining unit 505 may be implemented by the processor 21 shown in fig. 2 calling the program code in the memory 22. The specific implementation process may refer to the description of the performance test method part of the network device shown in fig. 3, which is not repeated here.
Another embodiment of the present application further provides a computer readable storage medium, where computer instructions are stored, where the computer instructions, when executed on a performance testing apparatus of a network device, cause the performance testing apparatus of the network device to execute each step executed by the performance testing apparatus of the network device in the method flow shown in the foregoing method embodiment.
Another embodiment of the present application further provides a chip system, where the chip system is applied to a performance testing apparatus of a network device. The system-on-chip includes one or more interface circuits, and one or more processors. The interface circuit and the processor are interconnected by a wire. The interface circuit is configured to receive a signal from a memory of a performance testing apparatus of a network device and to send the signal to a processor, the signal including computer instructions stored in the memory. When the processor executes the computer instructions, the performance testing apparatus of the network device executes the steps executed by the performance testing apparatus of the network device in the method flow shown in the method embodiment.
In another embodiment of the present application, there is also provided a computer program product including instructions that, when executed on a performance testing apparatus of a network device, cause the performance testing apparatus of the network device to perform the steps performed by the performance testing apparatus of the network device in the method flow shown in the method embodiment described above.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer-executable instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, a website, computer, server, or data center via a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices including one or more servers, data centers, etc. that can be integrated with the media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The foregoing is merely a specific embodiment of the present application. Variations and alternatives will occur to those skilled in the art from the detailed description provided herein and are intended to be included within the scope of the present application. It should be noted that the implementation of the embodiments of the present application may be implemented by hardware, software, or a combination of software and hardware. The hardware portion may be implemented using dedicated logic; the software portions may be stored in a memory and executed by a suitable instruction execution system, such as a microprocessor or special purpose design hardware. Those of ordinary skill in the art will appreciate that the apparatus and methods described above may be implemented using computer executable instructions and/or embodied in processor control code, such as provided on a carrier medium such as a magnetic disk, CD or DVD-ROM, a programmable memory such as read only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The device and the modules thereof according to the embodiments of the present application may be implemented by a hardware circuit such as a very large scale integrated circuit or gate array, a semiconductor such as a logic chip, a transistor, or a programmable hardware device such as a field programmable gate array, a programmable logic device, or the like, or may be implemented by software executed by various types of processors, or may be implemented by a combination of the above hardware circuit and software, for example, firmware.
The foregoing is merely a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any modifications, equivalents, improvements and etc. made by those skilled in the art within the scope of the embodiments of the present application within the spirit and principles of the embodiments of the present application should be covered by the protection scope of the embodiments of the present application.
Claims (10)
1. A method for testing performance of a network device, comprising:
generating a first message corresponding to a current test mode, and sending the first message to the network equipment, so that the first message can be forwarded conveniently through the network equipment;
acquiring first information and a storage position, and storing the first information in a shared cache space according to the storage position, wherein the size of the shared cache space is preset according to the maximum cache space of the network equipment; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, and if the current test mode is other modes except the synchronous service test mode, the first information comprises a sending identifier; the sending identifier is used for representing that the first message is sent;
Receiving a second message sent by the network equipment;
acquiring second information, and updating the first information stored in the shared cache space into the second information; if the current test mode is the synchronous service test mode, the second information is the service type of the second message; if the current test mode is other modes except the synchronous service test mode, the second information comprises an update identifier;
and under the condition that the next message sending is determined, determining the performance parameter of the network equipment according to the second information stored in the shared cache space.
2. The method of claim 1, wherein,
the current test mode comprises a packet loss rate test mode, an acknowledgement ACK protocol test mode, a service loss test mode, a service filtering test mode and the synchronous service test mode;
the depth of the shared cache space is greater than or equal to the depth of the maximum cache space; the width of the shared buffer space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n M+1-n, the maximum buffer space of the network device >0;
The shared cache space comprises a first shared cache space and a second shared cache space which are the same in size.
3. The performance testing method according to claim 2, wherein the acquiring the first information and the storage location, and storing the first information in the shared cache space according to the storage location, includes:
if the current test mode is the packet loss rate test mode, taking the lower n bits in the serial number of the first message as the storage position; adding a first preset character to the last position of m-n bits in the sequence number of the first message, and taking a character string obtained by adding the first preset character as the sending identifier, wherein the first preset character is used for representing that the first message is sent; storing the sending identifier in the storage position of the first shared cache space, and then storing a second preset character in the storage position of the second shared cache space;
if the current test mode is the service loss test mode, determining that the initial position of the first shared cache space is the storage position; determining the low 16 bits of the destination MAC address of the first message as the high 16 bits of the sending identifier; storing the sending identifier in the storage position of the first shared cache space, and then storing a second preset character in the storage position of the second shared cache space;
If the current test mode is the synchronous service test mode, determining that the storage position is the initial position of the first shared cache space; and acquiring the service type and storing the service type in the initial position of the first shared cache space.
4. The performance testing method according to claim 3, wherein the acquiring the first information and the storage location, and storing the first information in the shared buffer space according to the storage location, comprises:
if the current test mode is the other mode, determining a storage area range and an inspection area range of the shared cache space according to the storage position;
the first information is stored in the storage area range, and the second preset character is stored in the inspection area range.
5. The performance testing method according to claim 4, wherein determining the storage area range and the check area range of the shared cache space according to the storage location includes:
if the storage location is the address k of the first shared cache space, determining the address range of the storage area as: [ Address k+1,2 of the first shared cache space ] n -1]And [ the start address of the second shared cache space, the start address of the second shared cache space +k ]];
Determining the address range of the checking area is as follows: [ starting Address of the first shared cache space, starting Address of the first shared cache space +k ]]And [ the second shared cache space ]Addresses k+1,2 of (2) n -1]。
6. The performance testing method of claim 5, wherein the obtaining the second information and updating the first information to the second information comprises:
if the current test mode is the synchronous service test mode, acquiring the service type of the second message, and updating the service type stored in the first shared cache space into the service type of the second message;
if the current test mode is the other mode, determining an update position according to the sequence number of the second message and the address range of the check area; determining whether the second message is a retransmission message according to the storage content in the storage area at the updating position; and if the second message is not a retransmission message, updating the last character of the storage content positioned at the updating position in the storage area into the second preset character to generate the updating identification.
7. The performance testing method according to claim 6, wherein the determining whether the second message is a retransmission message according to the storage content located in the update location in the storage area includes:
determining whether the last character of the storage content located at the updating position in the storage area is the second preset character;
if yes, determining that the second message is a retransmission message;
if not, determining that the second message is not a retransmission message.
8. The performance testing method of claim 4, further comprising:
if the current test mode is the other mode, reading the end character of the content in the range of the check area; if the read last character is a second preset character, determining that the message is not lost; if the read last character is a first preset character, determining that the message is lost;
if the current test mode is a synchronous service test mode, reading a service type from the initial position of the first shared cache space; and comparing the read service type with the service type in the second message to determine the type of the lost synchronous frame.
9. A performance testing apparatus for a network device, comprising:
the generating unit is used for generating a first message corresponding to the current test mode;
a communication unit, configured to send the first packet to the network device, so that the first packet is forwarded via the network device;
the storage unit is used for acquiring first information and a storage position, and storing the first information in a shared cache space according to the storage position, wherein the size of the shared cache space is preset according to the maximum cache space of the network equipment; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, and if the current test mode is other modes except the synchronous service test mode, the first information comprises a sending identifier; the sending identifier is used for representing that the first message is sent;
the communication unit is further configured to receive a second packet sent by the network device;
the updating unit is used for acquiring second information and updating the first information stored in the shared cache space into the second information; if the current test mode is the synchronous service test mode, the second information is the service type of the second message; if the current test mode is other modes except the synchronous service test mode, the second information comprises an update identifier;
And the determining unit is used for determining the performance parameter of the network equipment according to the second information stored in the shared buffer space under the condition of determining the next message sending.
10. A performance testing device of a network device, wherein the performance testing device of the network device comprises a memory and a processor; the memory is coupled to the processor; the memory is used for storing computer program codes, and the computer program codes comprise computer instructions; the performance testing apparatus of a network device performing the performance testing method of a network device according to any one of claims 1-8 when the processor executes the computer instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210595792.6A CN114978959B (en) | 2022-05-27 | 2022-05-27 | Performance test method and device for network equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210595792.6A CN114978959B (en) | 2022-05-27 | 2022-05-27 | Performance test method and device for network equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114978959A CN114978959A (en) | 2022-08-30 |
CN114978959B true CN114978959B (en) | 2024-01-23 |
Family
ID=82957279
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210595792.6A Active CN114978959B (en) | 2022-05-27 | 2022-05-27 | Performance test method and device for network equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114978959B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006105707A1 (en) * | 2005-04-04 | 2006-10-12 | Hangzhou H3C Technologies Co., Ltd. | A network performance testing method and the system, the device thereof |
CN109639534A (en) * | 2019-01-11 | 2019-04-16 | 锐捷网络股份有限公司 | A kind of method, apparatus and computer storage medium of test network transmission performance |
CN110380932A (en) * | 2019-07-17 | 2019-10-25 | 中国工商银行股份有限公司 | Test method and device and test macro for safety equipment |
CN113360389A (en) * | 2021-06-23 | 2021-09-07 | 平安普惠企业管理有限公司 | Performance test method, device, equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7321655B2 (en) * | 2005-02-07 | 2008-01-22 | Adomo, Inc. | Caching user information in an integrated communication system |
-
2022
- 2022-05-27 CN CN202210595792.6A patent/CN114978959B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006105707A1 (en) * | 2005-04-04 | 2006-10-12 | Hangzhou H3C Technologies Co., Ltd. | A network performance testing method and the system, the device thereof |
CN109639534A (en) * | 2019-01-11 | 2019-04-16 | 锐捷网络股份有限公司 | A kind of method, apparatus and computer storage medium of test network transmission performance |
CN110380932A (en) * | 2019-07-17 | 2019-10-25 | 中国工商银行股份有限公司 | Test method and device and test macro for safety equipment |
CN113360389A (en) * | 2021-06-23 | 2021-09-07 | 平安普惠企业管理有限公司 | Performance test method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114978959A (en) | 2022-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100711738B1 (en) | Bitmap-based automatic repeat request engine and method for the same | |
CN107995068A (en) | Network interface test method and equipment | |
CN111726872B (en) | Control information format processing method, base station and user equipment | |
CN110719199A (en) | Network automatic test and fault positioning method and device | |
WO2021134418A1 (en) | Data checking method and apparatus | |
CN114978959B (en) | Performance test method and device for network equipment | |
CN112165505B (en) | Decentralized data processing method, electronic device and storage medium | |
CN113672416B (en) | Method and device for positioning cause of hard buffer leakage | |
CN106878177B (en) | Route processing method and device | |
CN113271286B (en) | Method, equipment and system for realizing BGP (Border gateway protocol) anomaly detection | |
CN116303173B (en) | Method, device and system for reducing RDMA engine on-chip cache and chip | |
CN113660260B (en) | Message detection method, system, computer equipment and readable storage medium | |
CN115454896A (en) | SMBUS-based SSD MCTP control message verification method and device, computer equipment and storage medium | |
CN114244692B (en) | Fault rapid positioning method suitable for ultra-large scale interconnection network | |
CN115408184A (en) | Method for acquiring fault information of fault integration module and related equipment thereof | |
CN114978725A (en) | Message processing method and device, electronic equipment and medium | |
CN114697319A (en) | Tenant business management method and device of public cloud | |
CN115712493A (en) | Request processing method, device and system | |
CN113407444A (en) | Interface test case generation method, device, equipment and storage medium | |
CN112383447A (en) | Service quality measuring method, device, equipment and storage medium | |
CN113891385B (en) | Method, device and equipment for detecting link state of network equipment | |
CN113328832B (en) | Data transmission method, device and system | |
CN117376061B (en) | Service access method, device, electronic equipment and storage medium | |
CN114071481B (en) | Network anchor deployment method, device, server and computer readable storage medium | |
CN109218119B (en) | Network packet loss diagnosis method and network equipment |
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 |