CN114978959B - A performance testing method and device for network equipment - Google Patents

A performance testing method and device for network equipment Download PDF

Info

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
cache space
test mode
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
Application number
CN202210595792.6A
Other languages
Chinese (zh)
Other versions
CN114978959A (en
Inventor
潘伟涛
祝钊华
邱智亮
王钱江
郭旭
高璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN202210595792.6A priority Critical patent/CN114978959B/en
Publication of CN114978959A publication Critical patent/CN114978959A/en
Application granted granted Critical
Publication of CN114978959B publication Critical patent/CN114978959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing 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

一种网络设备的性能测试方法及装置A performance testing method and device for network equipment

技术领域Technical field

本申请实施例涉及通信技术领域,尤其涉及一种网络设备的性能测试方法及装置。The embodiments of the present application relate to the field of communication technology, and in particular, to a performance testing method and device for network equipment.

背景技术Background technique

通常,在网络设备(如交换机、网卡等)投入使用之前,需要进行一系列的测试,以验证各项性能指标是否达到了设计要求。Usually, before network equipment (such as switches, network cards, etc.) is put into use, a series of tests need to be conducted to verify whether various performance indicators meet the design requirements.

目前,测试人员利用测试设备采取与待测性能指标对应的测试方法进行测试,不同性能指标采用的测试方法不同。但是,网络设备的性能指标数量较多。采用现有的测试方法对网络设备的多个性能指标进行测试,会花费较长时间,测试效率较低,且资源利用率较低。Currently, testers use test equipment to conduct testing using test methods corresponding to the performance indicators to be tested. Different test methods are used for different performance indicators. However, the number of performance indicators for network equipment is larger. Using existing testing methods to test multiple performance indicators of network equipment will take a long time, the testing efficiency is low, and the resource utilization rate is low.

发明内容Contents of the invention

针对现有技术存在的问题,本申请实施例提供了一种网络设备的性能测试方法及装置,以解决测试效率低、资源利用率低的问题。In view of the problems existing in the existing technology, embodiments of the present application provide a performance testing method and device for network equipment to solve the problems of low testing efficiency and low resource utilization.

第一方面,本申请提供了一种网络设备的性能测试方法,包括:生成与当前测试模式对应的第一报文,并向网络设备发送第一报文,便于经由网络设备转发第一报文;获取第一信息和存储位置,并根据存储位置将第一信息存储于共享缓存空间中,共享缓存空间的大小是根据网络设备的最大缓存空间预先设置的;若当前测试模式为同步业务测试模式,第一信息为第一报文的业务类型,若当前测试模式是除同步业务测试模式之外的其他模式,第一信息包括发送标识;发送标识用于表征第一报文已被发送;接收网络设备发送的第二报文;获取第二信息,并将共享缓存空间中存储的第一信息更新为第二信息;若当前测试模式为同步业务测试模式,第二信息为第二报文的业务类型;若当前测试模式是除同步业务测试模式之外的其他模式,第二信息包括更新标识;在确定下次发送报文的情况下,根据共享缓存空间中存储的第二信息确定网络设备的性能参数。In a first aspect, this application provides a performance testing method for network equipment, including: generating a first message corresponding to the current test mode, and sending the first message to the network device to facilitate forwarding of the first message via the network device. ; Obtain the first information and storage location, and store the first information in the shared cache space according to the storage location. The size of the shared cache space is preset according to the maximum cache 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. If the current test mode is a mode other than the synchronous service test mode, the first information includes a sending identifier; the sending identifier is used to represent that the first message has been sent; received The second message sent by the network device; obtain the second information, and update 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 second message Service type; if the current test mode is a mode other than the synchronous service test mode, the second information includes an update identifier; when it is determined to send a message next time, the network device is determined according to the second information stored in the shared cache space performance parameters.

本申请实施例根据被测设备的最大缓存空间配置性能测试装置的共享缓存深度,有效地提高了资源的利用率。无论是哪一测试模式,性能测试装置均利用共享缓存空间中存储的信息即可确定网络设备的性能参数,测试效率较高。The embodiment of the present application configures the shared cache depth of the performance testing device according to the maximum cache space of the device under test, effectively improving resource utilization. No matter which test mode it is, the performance testing device can determine the performance parameters of the network equipment by using the information stored in the shared cache space, and the testing efficiency is high.

在一种可能的设计方式中,当前测试模式包括但不局限于丢包率测试模式、确认ACK协议测试模式、业务丢失测试模式、业务过滤测试模式、同步业务测试模式。共享缓存空间的深度大于或等于最大缓存空间的深度;共享缓存空间的宽度为m+1-n,m为报文的序列号的长度,m为正整数,2n为所述网络设备的最大缓存空间,m+1-n>0。共享缓存空间包括大小相同的第一共享缓存空间和第二共享缓存空间。In a possible design approach, the current test modes include but are not limited to packet loss rate test mode, confirmation ACK protocol test mode, service loss test mode, service filtering test mode, and synchronization 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 cache space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, and 2 n is the maximum length of the network device. Cache space, m+1-n>0. The shared cache space includes a first shared cache space and a second shared cache space of the same size.

在另一种可能的设计方式中,获取第一信息和存储位置,并根据所述存储位置将第一信息存储于共享缓存空间中,包括:In another possible design approach, obtaining the first information and storage location, and storing the first information in the shared cache space according to the storage location includes:

若当前测试模式为丢包率测试模式,将第一报文的序列号中低n位作为存储位置;将第一报文的序列号中m-n位的末位添加第一预设字符,并将添加第一预设字符得到的字符串作为发送标识,第一预设字符用于表征已被发送;在第一共享缓存空间的存储位置存入发送标识,之后在第二共享缓存空间的存储位置存入第二预设字符;If the current test mode is the packet loss rate test mode, use the lower n bits of the sequence number of the first message as the storage location; add the first preset character to the last bit of the m-n bits of the sequence number of the first message, and add The string obtained by adding the first preset character is used as a sending identifier. The first preset character is used to represent that it has been sent; the sending identifier is stored in the storage location of the first shared cache space, and then is stored in the storage location of the second shared cache space. Store the second preset character;

若当前测试模式为业务丢失测试模式,确定第一共享缓存空间的起始位置为存储位置;将第一报文的目的MAC地址的低16位确定为发送标识的高16位;在第一共享缓存空间的存储位置存入发送标识,之后在第二共享缓存空间的存储位置存入第二预设字符;If the current test mode is the service loss test mode, determine the starting position of the first shared cache space as the storage location; determine the lower 16 bits of the destination MAC address of the first message as the upper 16 bits of the sending identifier; in the first shared The sending identifier is stored in the storage location of the cache space, and then the second preset character is stored in the storage location of the second shared cache space;

若当前测试模式为同步业务测试模式,确定存储位置为第一共享缓存空间的起始位置获取业务类型,并将业务类型存储于第一共享缓存空间的起始位置。If the current test mode is the synchronous service test mode, the storage location is determined to be the starting location of the first shared cache space, the service type is obtained, and the service type is stored at the starting location of the first shared cache space.

在另一种可能的设计方式中,获取第一信息和存储位置,并根据存储位置将第一信息存储于共享缓存空间中,包括:In another possible design approach, obtaining the first information and storage location, and storing the first information in the shared cache space according to the storage location includes:

若当前测试模式为其他模式,根据存储位置,确定共享缓存空间的存储区范围以及检查区范围;在存储区范围中存储第一信息,及在检查区范围中存储第二预设字符。If the current test mode is another mode, determine the storage area range and check area range of the shared cache space according to the storage location; store the first information in the storage area range, and store the second preset character in the check area range.

在另一种可能的设计方式中,根据存储位置,确定共享缓存空间的存储区范围以及检查区范围,包括:In another possible design approach, determine the storage area range and check area range of the shared cache space based on the storage location, including:

若存储位置为第一共享缓存空间的地址k,则确定存储区的地址范围为:[第一共享缓存空间的地址k+1,2n-1],以及[第二共享缓存空间的起始地址,第二共享缓存空间的起始地址+k];If the storage location is the address k of the first shared cache space, then the address range of the storage area is determined to be: [address k+1, 2 n -1 of the first shared cache space], and [the start of the second shared cache space Address, starting address of the second shared cache space + k];

确定检查区的地址范围为:[第一共享缓存空间的起始地址,第一共享缓存空间的起始地址+k],以及[第二共享缓存空间的地址k+1,2n-1]。The address range of the check area is determined to be: [the starting address of the first shared cache space, the starting address of the first shared cache space + k], and [the address of the second shared cache space k+1, 2 n -1] .

在另一种可能的设计方式中,获取第二信息,并将第一信息更新为第二信息,包括:In another possible design approach, obtaining the second information and updating the first information to the second information includes:

若当前测试模式为同步业务测试模式,则获取第二报文的业务类型,并将第一共享缓存空间中存储的业务类型更新为第二报文的业务类型;If the current test mode is the synchronous service test mode, obtain the service type of the second message, and update the service type stored in the first shared cache space to the service type of the second message;

若当前测试模式为其他模式,根据第二报文的序列号和检查区的地址范围确定更新位置;根据存储区中位于更新位置的存储内容,确定第二报文是否为重发报文;若第二报文不为重发报文,则将存储区中位于更新位置的存储内容的末尾字符更新为第二预设字符,以生成更新标识。If the current test mode is another mode, determine the update position based on the sequence number of the second message and the address range of the check area; determine whether the second message is a retransmitted message based on the storage content at the update position in the storage area; if If the second message is not a retransmission message, the last character of the storage content at the update position in the storage area is updated to the second preset character to generate an update identifier.

在另一种可能的设计方式中,根据存储区中位于更新位置的存储内容,确定第二报文是否为重发报文,包括:In another possible design method, determining whether the second message is a retransmission message is based on the storage content at the updated location in the storage area, including:

确定存储区中位于更新位置的存储内容的末尾字符是否为第二预设字符;Determine whether the last character of the storage content located at the updated position in the storage area is the second preset character;

若是,则确定第二报文是重发报文;If so, it is determined that the second message is a retransmitted message;

若否,则确定第二报文不是重发报文。If not, it is determined that the second message is not a retransmitted message.

在另一种可能的设计方式中,所述性能测试方法还包括:In another possible design approach, the performance testing method also includes:

若当前测试模式为丢包率测试模式或者业务丢失模式,读取检查区中的内容的末尾字符;若读取到的末尾字符为第二预设字符,则确定已发送的报文未丢失;若读取到的末尾字符为第一预设字符,则确定已发送的报文已丢失;If the current test mode is the packet loss rate test mode or the service loss mode, read the last character of the content in the check area; if the last character read is the second preset character, it is determined that the sent message has not been lost; If the last character read is the first preset character, it is determined that the sent message has been lost;

若当前测试模式为同步业务测试模式,从第一共享缓存空间的起始位置读取业务类型;对比读取到的业务类型和第二报文中的业务类型,确定被丢失的同步帧的类型。If the current test mode is the synchronous service test mode, read the service type from the starting position of the first shared cache space; compare the read service type with the service type in the second message to determine the type of the lost synchronization frame .

第二方面,提供一种性能测试装置。该性能测试装置包括:生成单元、发送单元、获取单元、接收单元以及确定单元。In the second aspect, a performance testing device is provided. The performance testing device includes: a generating unit, a sending unit, an acquiring unit, a receiving unit and a determining unit.

生成单元,用于生成与当前测试模式对应的第一报文。发送单元,用于并向网络设备发送第一报文,便于经由网络设备转发第一报文。获取单元,用于获取第一信息和存储位置,并根据存储位置将第一信息存储于共享缓存空间中,共享缓存空间的大小是根据网络设备的最大缓存空间预先设置的;若当前测试模式为同步业务测试模式,第一信息为第一报文的业务类型,若当前测试模式是除同步业务测试模式之外的其他模式,第一信息包括发送标识;发送标识用于表征第一报文已被发送。接收单元,用于接收网络设备发送的第二报文。获取单元,还用于获取第二信息。存储单元,用于将共享缓存空间中存储的第一信息更新为第二信息;若当前测试模式为同步业务测试模式,第二信息为第二报文的业务类型;若当前测试模式是除同步业务测试模式之外的其他模式,第二信息包括更新标识。确定单元,用于在确定下次发送报文的情况下,根据共享缓存空间中存储的第二信息确定网络设备的性能参数。The generating unit is used to generate the first message corresponding to the current test mode. The sending unit is configured to send the first message to the network device to facilitate forwarding of the first message via the network device. The acquisition unit is used to obtain the first information and the storage location, and store the first information in the shared cache space according to the storage location. The size of the shared cache space is preset according to the maximum cache space of the network device; if the current test mode is In 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 sending identifier; the sending identifier is used to indicate that the first message has been is sent. The receiving unit is configured to receive the second message sent by the network device. The acquisition unit is also used to acquire the second information. The storage unit is used to update 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 except synchronization In modes other than the business test mode, the second information includes an update identifier. The determining unit is configured to determine the performance parameters of the network device according to the second information stored in the shared cache space when determining to send the message next time.

第三方面,本申请提供一种网络性能测试装置,该网络性能测试装置包括存储器和处理器。上述存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行该计算机指令时,网络性能测试装置执行如第一方面及其任一种可能的设计方式所述的网络性能测试方法。In a third aspect, this application provides a network performance testing device, which includes a memory and a processor. The above-mentioned memory is coupled to the processor. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instruction, the network performance testing device executes the network performance testing method described in the first aspect and any possible design manner thereof.

第四方面,本申请提供一种芯片系统,该芯片系统应用于网络性能测试装置;所述芯片系统包括一个或多个接口电路,以及一个或多个处理器。所述接口电路和所述处理器通过线路互联;所述接口电路用于从所述网络性能测试装置的存储器接收信号,并向所述处理器发送所述信号,所述信号包括所述存储器中存储的计算机指令。当所述处理器执行所述计算机指令时,所述网络性能测试装置执行如第一方面及其任一种可能的设计方式所述的网络性能测试方法。In a fourth aspect, this application provides a chip system, which is applied to a network performance testing device; the chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory of the network performance testing device and send the signals to the processor, where the signals include information in the memory. Stored computer instructions. When the processor executes the computer instructions, the network performance testing device executes the network performance testing method described in the first aspect and any possible design manner thereof.

第五方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在网络性能测试装置上运行时,使得所述网络性能测试装置执行如第一方面及其任一种可能的设计方式所述的网络性能测试方法。In a fifth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are run on a network performance testing device, the network performance testing device causes the network performance testing device to execute the first step. The network performance testing method described in any aspect and any possible design method.

第六方面,本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,当所述计算机指令在网络性能测试装置上运行时,使得所述网络性能测试装置执行如第一方面及其任一种可能的设计方式所述的网络性能测试方法。In a sixth aspect, the present application provides a computer program product. The computer program product includes computer instructions. When the computer instructions are run on a network performance testing device, the network performance testing device causes the network performance testing device to execute the first aspect and any of the above. One possible design approach describes the network performance testing method.

本申请中第二方面到第六方面及其各种实现方式的具体描述,可以参考第一方面及其各种实现方式中的详细描述;并且,第二方面到第六方面及其各种实现方式的有益效果,可以参考第一方面及其各种实现方式中的有益效果分析,此处不再赘述。For specific descriptions of the second to sixth aspects and their various implementations in this application, please refer to the detailed description of the first aspect and its various implementations; and, the second to sixth aspects and their various implementations can be referred to For the beneficial effects of the method, please refer to the analysis of the beneficial effects in the first aspect and its various implementation methods, which will not be described again here.

附图说明Description of the drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图做简单的介绍,显而易见地,下面所描述的附图仅仅是本申请实施例的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the drawings required to be used in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some examples of the embodiments of the present application. , for those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1是本申请实施例提供的通信系统的结构示意图;Figure 1 is a schematic structural diagram of a communication system provided by an embodiment of the present application;

图2是本申请实施例提供的计算装置的结构示意图;Figure 2 is a schematic structural diagram of a computing device provided by an embodiment of the present application;

图3是本申请实施例提供的网络设备的性能测试方法的流程示意图;Figure 3 is a schematic flowchart of a performance testing method for network equipment provided by an embodiment of the present application;

图4是本申请实施例提供的共享缓存区域的划分结构示意图;Figure 4 is a schematic diagram of the division structure of a shared cache area provided by an embodiment of the present application;

图5是本申请实施例提供的性能测试装置的结构示意图。Figure 5 is a schematic structural diagram of a performance testing device provided by an embodiment of the present application.

具体实施方式Detailed ways

以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms “first” and “second” are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

本申请实施例提供一种网络设备的性能测试方法,该性能测试方法适用包括测试设备和被测设备的通信系统。图1示出了该通信系统的结构。如图1所示,通信系统包括测试设备10和至少一个被测设备11,每个被测设备11均与测试设备10连接。被测设备11与测试设备10之间可以采用有线连接,也可以无线连接,本申请实施例对此不作具体限定。Embodiments of the present application provide a performance testing method for network equipment. The performance testing method is applicable to a communication system including a testing device and a device under test. Figure 1 shows the structure of this communication system. As shown in FIG. 1 , the communication system includes a test device 10 and at least one device under test 11 , and each device under test 11 is connected to the test device 10 . The device under test 11 and the test device 10 may be connected through wired or wireless connections, which are not specifically limited in the embodiments of the present application.

测试设备10可以是集中控制器,也可以是网管,还可以是执行网络设备性能指标分析的设备。被测设备11可以是交换机,也可以是路由器,还可以是网卡等其他网络设备。The test device 10 may be a centralized controller, a network management device, or a device that performs network device performance index analysis. The device under test 11 may be a switch, a router, or other network equipment such as a network card.

测试设备10可以是一个设备,也可以是指多个设备的集合(如具备网络设备性能指标分析功能的集群)。本申请实施例对此不作具体限定。测试设备10可以是功能模块,集成在具体的物理设备上,也可以是指用于实现本申请实施例中网络设备的性能指标测试装置所述实现的功能的物理设备。The test device 10 may be one device, or may refer to a collection of multiple devices (such as a cluster with the function of analyzing network device performance indicators). The embodiments of the present application do not specifically limit this. The test equipment 10 may be a functional module integrated on a specific physical device, or it may refer to a physical device used to implement the functions described in the performance index testing device for network equipment in the embodiment of the present application.

测试设备10与被测设备11之间传输报文。本申请实施例中的测试设备10预先配置有共享缓存空间,且共享缓存空间的大小是根据被测设备的最大缓存空间预先设置。共享缓存空间用于存储测试设备10向被测设备11发送的报文的相关信息(如下文涉及到的第一信息),以及存储经由被测设备11转发后发送给测试设备10的报文的相关信息(如下文涉及到的第二信息)。测试设备10在后续发送报文的过程中,可根据共享缓存空间存储的第二信息确定被测设备的性能参数(如丢帧率)。Messages are transmitted between the test device 10 and the device under test 11 . The test device 10 in the embodiment of the present application is pre-configured with a shared cache space, and the size of the shared cache space is pre-set according to the maximum cache space of the device under test. The shared cache space is used to store relevant information of the packets sent by the test device 10 to the device under test 11 (such as the first information mentioned below), and to store the information of the packets sent to the test device 10 after being forwarded by the device under test 11 Relevant information (such as the second information mentioned below). During the subsequent process of sending messages, the test device 10 may determine the performance parameters (such as frame loss rate) of the device under test based on the second information stored in the shared cache space.

上述测试设备10和被测设备11的基本硬件结构类似,都包括图2所示计算装置所包括的元件。下面以图2所示的计算装置为例,介绍测试设备10和被测设备11的硬件结构。如图2所示,计算装置可以包括处理器21,存储器22、通信接口23、总线24。处理器21,存储器22以及通信接口23之间可以通过总线24连接。The basic hardware structures of the above-mentioned test equipment 10 and the equipment under test 11 are similar, and both include elements included in the computing device shown in FIG. 2 . Taking the computing device shown in FIG. 2 as an example, the hardware structures of the test equipment 10 and the device under test 11 are introduced below. 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 through a bus 24.

处理器21是计算装置的控制中心,可以是一个处理器,也可以是多个处理元件的统称。例如,处理器21可以是一个通用中央处理单元(central processing unit,CPU),也可以是其他通用处理器等。其中,通用处理器可以是微处理器或者是任何常规的处理器等。The processor 21 is the control center of the computing device, and may be a processor or a collective name for multiple processing elements. For example, the processor 21 may be a general-purpose central processing unit (CPU) or other general-purpose processor. The general processor may be a microprocessor or any conventional processor.

作为一种实施例,处理器21可以包括一个或多个CPU,例如图2中所示的CPU 0和CPU1。As an embodiment, the processor 21 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 2 .

存储器22可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electricallyerasable programmable read-only memory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 22 may be 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 that can store information and instructions. A dynamic storage device can also be an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or can be used to carry or store instructions or data structures. without limitation, any other medium that can program code and be accessed by a computer.

一种可能的实现方式中,存储器22可以独立于处理器21存在,存储器22可以通过总线24与处理器21相连接,用于存储指令或者程序代码。处理器21调用并执行存储器22中存储的指令或程序代码时,能够实现本申请下述实施例提供的网络设备的性能测试方法。In a possible implementation, the memory 22 may exist independently of the processor 21, and the memory 22 may be connected to the processor 21 through the bus 24 for storing instructions or program codes. When the processor 21 calls and executes the instructions or program codes stored in the memory 22, it can implement the performance testing method of network equipment provided by the following embodiments of the present application.

在本申请实施例中,对于测试设备10和被测设备11中存储的软件程序不同,所以测试设备10和被测设备11实现的功能不同。关于各设备所执行的功能将结合下面的流程图进行描述。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 the functions implemented by the test device 10 and the device under test 11 are different. The functions performed by each device will be described in conjunction with the flow chart below.

另一种可能的实现方式中,存储器22也可以和处理器21集成在一起。In another possible implementation, the memory 22 can also be integrated with the processor 21 .

通信接口23,用于计算装置与其他设备通过通信网络连接,所述通信网络可以是以太网,无线接入网(radio access network,RAN),无线局域网(wireless local areanetworks,WLAN)等。通信接口23可以包括用于接收数据的接收单元,以及用于发送数据的发送单元。The communication interface 23 is used to connect the computing device with other devices through a communication network. The communication network may be Ethernet, wireless access network (radio access network, RAN), 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.

总线24,可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 24 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 2, but it does not mean that there is only one bus or one type of bus.

需要指出的是,图2中示出的结构并不构成对该计算装置的限定,除图2所示部件之外,该计算装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It should be noted that the structure shown in Figure 2 does not constitute a limitation of the computing device. In addition to the components shown in Figure 2, the computing device may include more or less components than shown in the figure, or a combination of certain components. components, or different component arrangements.

本申请实施例提供的网络设备的性能测试方法的执行主体为网络设备的性能测试装置(下文简称为性能测试装置)。该性能测试装置可以是上述测试设备10,也可以是上述测试设备10中的CPU,还可以是上述测试设备10中用于测试网络设备性能的控制模块。本申请实施例以性能测试装置执行网络设备的性能测试方法为例,对本申请提供的网络设备的性能测试方法进行说明。The execution subject of the performance testing method for network equipment provided by the embodiment of the present application is the performance testing device of the network device (hereinafter referred to as the performance testing device for short). The performance testing device may be the above-mentioned testing device 10, or may be a CPU in the above-mentioned testing device 10, or may be a control module in the above-mentioned testing device 10 for testing the performance of network equipment. The embodiments of this application take the performance testing method of the network equipment performed by the performance testing device as an example to illustrate the performance testing method of the network equipment provided by this application.

下面结合附图对本申请实施例提供的网络设备的性能测试方法进行描述。The performance testing method of network equipment provided by the embodiment of the present application will be described below with reference to the accompanying drawings.

如图3所示,本申请实施例提供的网络设备的性能测试方法包括如下步骤。As shown in Figure 3, the performance testing method of network equipment provided by the embodiment of the present application includes the following steps.

S300、性能测试装置生成与当前测试模式对应的第一报文,并向网络设备(即图1中的被测设备11)发送第一报文,便于经由网络设备转发第一报文。S300. The performance testing device generates a first message corresponding to the current test mode, and sends the first message to the network device (ie, the device under test 11 in Figure 1) to facilitate forwarding of the first message via the network device.

当前测试模式包括但不局限于丢包率测试模式、确认(Acknowledge,ACK)协议测试模式、业务丢失测试模式、业务过滤测试模式、同步业务测试模式。Current test modes include but are not limited to packet loss rate test mode, Acknowledge (ACK) protocol test mode, service loss test mode, service filtering test mode, and synchronization service test mode.

在实际应用中,当前测试模式可根据实际需求切换。在不同测试模式下,性能测试装置均可根据收发报文的信息确定网络设备的性能参数。这样,性能测试装置中用于确定性能参数的部分/全部模块即可复用。相比于现有测试方法,有效地提高了资源利用率。In actual applications, the current test mode can be switched according to actual needs. In different test modes, the performance testing device can determine the performance parameters of the network equipment based on the information of sent and received messages. In this way, some/all modules used to determine performance parameters in the performance testing device can be reused. Compared with existing testing methods, resource utilization is effectively improved.

不同测试模式对应的报文格式不同。Different test modes correspond to different message formats.

S301、性能测试装置获取第一信息和存储位置,并根据存储位置将第一信息存储于共享缓存空间中。S301. The performance testing device obtains the first information and the storage location, and stores the first information in the shared cache space according to the storage location.

其中,共享缓存空间的大小是根据网络设备的最大缓存空间预先设置的。若当前测试模式为同步业务测试模式,第一信息为第一报文的业务类型。若当前测试模式是除同步业务测试模式之外的其他模式,第一信息包括发送标识。该发送标识用于表征第一报文已被发送。Among them, the size of the shared cache space is preset according to the maximum cache 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. If the current test mode is a mode other than the synchronization service test mode, the first information includes a sending identifier. The sending identifier is used to indicate that the first message has been sent.

共享缓存空间的深度大于或等于网络设备的最大缓存空间的深度。共享缓存空间的宽度为m+1-n,m为报文的序列号的长度,m为正整数,2n为网络设备的最大缓存空间,m+1-n>0。The depth of the shared cache space is greater than or equal to the depth of the maximum cache space of the network device. The width of the shared cache space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n is the maximum cache space of the network device, m+1-n>0.

共享缓存空间包括大小相同的第一共享缓存空间和第二共享缓存空间。The shared cache space includes a first shared cache space and a second shared cache space of the same size.

示例性的,共享缓存空间采用乒乓结构组成,包括相同的两个存储区:存储区A和存储区B。报文的序列号长度为48,存储区A和存储区B的深度都是2n,两者宽度都是49-n。For example, the shared cache space adopts a ping-pong structure and includes the same two storage areas: storage area A and storage area B. The sequence number length of the message is 48, the depth of storage area A and storage area B are both 2 n , and the width of both is 49-n.

不同测试模式下,性能测试装置获取第一信息并存储第一信息的方式不同。In different test modes, the performance testing device obtains the first information and stores the first information in different ways.

可选地,若当前测试模式为丢包率测试模式,性能测试装置将第一报文的序列号中低n位作为存储位置;将第一报文的序列号中m-n位的末位添加第一预设字符(用于表征已被发送),并将添加第一预设字符得到的字符串作为发送标识;在第一共享缓存空间的存储位置存入发送标识,在第二共享缓存空间的存储位置存入第二预设字符。Optionally, if the current test mode is the packet loss rate test mode, the performance testing device uses the lower n bits of the sequence number of the first message as the storage location; adds the last bit of m-n bits in the sequence number of the first message. A preset character (used to represent that it has been sent), and the string obtained by adding the first preset character is used as the sending identification; the sending identification is stored in the storage location of the first shared cache space, and the sending identification is stored in the storage location of the second shared cache space. The storage location stores the second preset character.

其中,本申请实施例对第一预设字符和第二预设字符的内容不作限定。实际应用中,可根据实际需求配置。Among them, the embodiment of the present application does not limit the contents of the first preset character and the second preset character. In actual applications, it can be configured according to actual needs.

示例性的,第一报文中序列号长度为48位,低n位会被作为发送标识存储的地址。性能测试装置在序列号中除低n位之外的其他48-n的尾部加一个1(对应第一预设字符),生成位宽为49-n的发送标识。其中尾部加的1表示有此序列号的报文发送过,用于性能测试装置是否有报文丢失或重发。For example, the length of the sequence number in the first message is 48 bits, and the low n bits will be used as the address where the sending identifier is stored. The performance testing device adds a 1 (corresponding to the first preset character) to the tail of the other 48-n bits in the serial number, except for the low n bits, to generate a sending identifier with a bit width of 49-n. The 1 added at the end indicates that a packet with this sequence number has been sent, and is used to test whether any packets are lost or retransmitted by the performance test device.

性能测试装置发送侧在报文数据载荷的尾部添加48位的序列号。其中,性能测试装置发送的报文中的序列号逐一递增。性能测试装置发送第一报文时,首先会向存储区A的存储地址中存入发送标识,接着向存储区B的相同地址中存入全零(对应第二预设字符)。当存储区A的存储地址等于最大缓存空间后,性能测试装置在发送报文时又会向存储区B的存储地址里存入发送标识,并接着向存储区A中的相同地址里存入全零,如此往返交替。The sending side of the performance test device adds a 48-bit sequence number at the end of the message data load. Among them, the sequence numbers in the packets sent by the performance testing device increase one by one. When the performance testing device sends the first message, it first stores the sending identifier in the storage address of storage area A, and then stores all zeros (corresponding to the second preset character) in the same address of storage area B. When the storage address of storage area A is equal to the maximum cache space, the performance testing device will store the sending identifier in the storage address of storage area B when sending a message, and then store the full address in the same address in storage area A. Zero, and so on.

可选地,若当前测试模式为业务丢失测试模式,性能测试装置确定第一共享缓存空间的起始位置为存储位置;将第一报文的目的MAC地址的低16位确定为发送标识的高16位;在第一共享缓存空间的存储位置存入发送标识,在第二共享缓存空间的存储位置存入第二预设字符。Optionally, if the current test mode is the service loss test mode, the performance testing device determines the starting position of the first shared cache space as the storage location; determines the lower 16 bits of the destination MAC address of the first message as the higher sending identifier. 16 bits; store the sending identifier in the storage location of the first shared cache space, and store the second preset character in the storage location of the second shared cache space.

示例性的,在业务丢失测试模式中,第一报文的目的MAC地址的低16位为虚拟链路号,则发送标识的高16位为报文的虚拟链路号。For example, in the service loss test mode, the lower 16 bits of the destination MAC address of the first message are the virtual link number, and the higher 16 bits of the sending identifier are the virtual link number of the message.

可选地,若当前测试模式为同步业务测试模式,性能测试装置确定存储位置为第一共享缓存空间的起始位置,并获取业务类型,以及将业务类型存储于第一共享缓存空间的起始位置。Optionally, if the current test mode is a synchronous service test mode, the performance testing device determines the storage location as the starting location of the first shared cache space, obtains the service type, and stores the service type at the beginning of the first shared cache space. Location.

例如:性能测试装置获取业务类型,并在存储区A的0地址存入获取到的业务类型。发送标识为业务类型的编号。For example: the performance testing device obtains the service type and stores the obtained service type in address 0 of storage area A. Send a number identifying the business type.

可以看出,乒乓结构构建的共享缓存空间的存在,在节省资源空间的同时可以保留足够的报文标识,以确保写入新的报文标识时仍在接收传输链路中的报文的标识不会被覆盖。低n位作为发送标识存储的地址即可实现共享。It can be seen that the existence of the shared cache space constructed by the ping-pong structure can save resource space while retaining sufficient message identifiers to ensure that the identifiers of the messages in the transmission link are still being received when writing new message identifiers. will not be overwritten. The lower n bits can be shared as the address where the sending identification is stored.

具体的,若当前测试模式为其他模式,性能测试装置将第一信息存储于共享缓存空间的方法包括:根据存储位置,确定共享缓存空间的存储区范围以及检查区范围;存储区范围中存储第一信息,以及在检查区范围中存储第二预设字符。Specifically, if the current test mode is another mode, the method for the performance testing device to store the first information in the shared cache space includes: determining the storage area range and the inspection area range of the shared cache space according to the storage location; storing the first information in the storage area range. a piece of information, and store a second preset character in the inspection area range.

其中,若存储位置为第一共享缓存空间的地址k,则性能测试装置确定存储区的地址范围为:[第一共享缓存空间的地址k+1,2n-1],以及[第二共享缓存空间的起始地址,第二共享缓存空间的起始地址+k]。Wherein, 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 n -1 of the first shared cache space], and [second shared cache space The starting address of the cache space, the starting address of the second shared cache space + k].

确定检查区的地址范围为:[第一共享缓存空间的起始地址,第一共享缓存空间的起始地址+k],以及[第二共享缓存空间的地址k+1,2n-1]。The address range of the check area is determined to be: [the starting address of the first shared cache space, the starting address of the first shared cache space + k], and [the address of the second shared cache space k+1, 2 n -1] .

示例性的,如图4所示,第一共享缓存空间为缓存空间A,第二共享缓存空间为缓存空间B,则缓存空间A和缓存空间B均可按照上述方法划分为检查去和存储区。For example, as shown in Figure 4, the first shared cache space is cache space A, and the second shared cache space is cache space B. Then both cache space A and cache space B can be divided into checksum storage areas according to the above method. .

S302、性能测试装置接收网络设备发送的第二报文。S302. The performance testing device receives the second message sent by the network device.

S303、性能测试装置获取第二信息,并将共享缓存空间中存储的第一信息更新为第二信息。S303. The performance testing device obtains the second information, and updates the first information stored in the shared cache 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 a mode other than the synchronization service test mode, the second information includes an update identifier.

具体的,若当前测试模式为同步业务测试模式,则性能测试装置获取第二报文的业务类型,并将第一共享缓存空间中存储的业务类型更新为第二报文的业务类型。Specifically, if the current test mode is the synchronous service test mode, the performance testing device obtains the service type of the second message, and updates the service type stored in the first shared cache space to the service type of the second message.

若当前测试模式为其他模式,则性能测试装置根据第二报文的序列号和检查区的地址范围确定更新位置;并根据存储区中位于更新位置的存储内容,确定第二报文是否为重发报文。若第二报文不为重发报文,则性能测试装置将存储区中位于更新位置的存储内容的末尾字符更新为第二预设字符,以生成更新标识。If the current test mode is another mode, the performance testing device determines the update position based on the sequence number of the second message and the address range of the check area; and determines whether the second message is a duplicate based on the storage content located at the update position in the storage area. Send message. If the second message is not a retransmission message, the performance testing device updates the last character of the storage content located at the update position in the storage area to the second preset character to generate an update identifier.

示例性的,若当前测试模式为除同步业务测试模式之外的其他模式,当报文经由被测设备转发至性能测试装置,性能测试装置从接收的报文中提取48位的序列号,并且根据序列号产生更新地址和更新标识。For example, if the current test mode is other than the synchronous service test mode, when the packet is forwarded to the performance test device via the device under test, the performance test device extracts the 48-bit sequence number from the received packet, and Generate update address and update ID based on the serial number.

共享缓存空间的存储区范围和检查区范围之间没有交叠区域,故性能测试装置根据48位序列号的低n位和检查区范围的地址范围,确定更新位置。There is no overlapping area between the storage area range and the check area range of the shared cache space, so the performance testing device determines the update position based on the lower n bits of the 48-bit serial number and the address range of the check area range.

性能测试装置根据存储区中位于更新位置的存储内容,确定第二报文是否为重发报文的方法为:性能测试装置确定存储区中位于更新位置的存储内容的末尾字符是否为0。若是,则确定第二报文是重发报文。若否,则确定第二报文不是重发报文。The method for the performance testing device to determine whether the second message is a retransmitted message based on the storage content at the updated position in the storage area is: the performance testing device determines whether the last character of the storage content at the updated position in the storage area is 0. If so, it is determined that the second message is a retransmitted message. If not, it is determined that the second message is not a retransmitted message.

示例性的,若存储区中位于更新位置的存储内容的最后一位为零,说明此序列号的报文已被性能测试装置接收过,即性能测试装置确定该第二报文为重发报文。性能测试装置直接将提取的48位序列号记录至寄存器中,供上层应用读取,甚至还可以提取虚拟链路号供上层应用读取。如果存储区中位于更新位置的存储内容的最后一位不为零,则说明性能测试装置未接收过该报文,即性能测试装置确定该第二报文不为重发报文。性能测试装置将共享缓存空间中位宽为49-n的字符串中的最后一位置为0,其他位不变,即可得到更新标识。该更新标识用于表征这个序列号的报文已被成功接收。For example, if the last bit of the storage content at the update position in the storage area is zero, it means that the message with this serial number has been received by the performance testing device, that is, the performance testing device determines that the second message is a retransmission message. arts. The performance testing device directly records the extracted 48-bit serial number into the register for the upper-layer application to read, and can even extract the virtual link number for the upper-layer application to read. If the last bit of the storage content located at the updated position in the storage area is not zero, it means that the performance testing device has not received the message, that is, the performance testing device determines that the second message is not a retransmitted message. The performance testing device sets the last position in the string with a bit width of 49-n in the shared cache space to 0 and leaves the other bits unchanged to obtain the update identifier. The update identifier is used to indicate that the message with this sequence number has been successfully received.

可以看出,性能测试装置将第一信息存储于共享缓存空间中,有利于确定被测设备是否工作正常。性能测试装置将第二信息存储于共享缓存空间中,有利于根据第二信息确定是否有报文丢失。It can be seen that the performance testing device stores the first information in the shared cache space, which is helpful for determining whether the device under test is working normally. The performance testing device stores the second information in the shared cache space, which is helpful for determining whether a packet is lost based on the second information.

S304、在下次发送报文的情况下,性能测试装置根据共享缓存空间中存储的第二信息确定网络设备的性能参数。S304. When sending a message next time, the performance testing device determines the performance parameters of the network device according to the second information stored in the shared cache space.

若当前测试模式为丢包率测试模式或者业务丢失模式,读取检查区中的内容的末尾字符;若读取到的末尾字符为第二预设字符,则确定已发送的报文未丢失;若读取到的末尾字符为第一预设字符,则确定已发送的报文已丢失;If the current test mode is the packet loss rate test mode or the service loss mode, read the last character of the content in the check area; if the last character read is the second preset character, it is determined that the sent message has not been lost; If the last character read is the first preset character, it is determined that the sent message has been lost;

若当前测试模式为同步业务测试模式,当测试设备再次发送报文时,会在存储区A的起始位置中先提取业务类型,比对读取的业务类型和发送的业务类型以判别何种类型的同步帧丢失。If the current test mode is the synchronous service test mode, when the test device sends a message again, it will first extract the service type from the starting position of storage area A, and compare the read service type and the sent service type to determine which type Type of sync frame lost.

示例性的,若当前测试模式为丢包率测试模式,当性能测试装置再次发送报文时,发送报文数加一,因为发送报文的存储位置位于存储区,在检查是否有报文丢失时,会在检查区的同一地址中先提取出存储内容。如果存储内容最后一位为0,表明报文并没有丢失,接收报文数加一。果存储内容最后一位为1,表明报文丢失,接收报文数不变。并且可以用存储内容的前48-n位加上当前的检查地址得出丢失报文的序列号。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 sent messages is increased by one, because the storage location of the sent message is in the storage area. When checking whether any message is lost, When , the stored content will be extracted first from the same address in the check area. If the last bit of the stored content is 0, it indicates that the message has not been lost, and the number of received messages is increased by one. If the last bit of the stored content is 1, it indicates that the message is lost and the number of received messages remains unchanged. And the sequence number of the lost message can be obtained by adding the first 48-n bits of the stored content to the current check address.

若当前测试模式为业务丢失模式,当性能测试装置再次发送报文时,会在检查区的同一地址中先提取出存储内容,如果存储内容最后一位为1,表明报文丢失,可以提取存储内容的前16位,即虚拟链路号,报告给上层应用,表明何种业务丢失。If the current test mode is service loss mode, when the performance test device sends a message again, the stored content will be extracted from the same address in the inspection area. If the last bit of the stored content is 1, it indicates that the message is lost and the stored content can be extracted. The first 16 bits of the content, that is, the virtual link number, are reported to the upper-layer application to indicate what kind of service is lost.

若当前测试模式为同步业务测试模式下,当性能测试装置再次发送报文时,会在存储区A的地址0中先提取业务类型,比对读取的业务类型和发送的业务类型以判别何种类型的同步帧丢失。If the current test mode is the synchronous service test mode, when the performance test device sends a message again, it will first extract the service type from address 0 of storage area A, and compare the read service type and the sent service type to determine which A type of synchronization frame loss.

可以看出,再次发送报文时性能测试装置确定网络设备的性能参数(如丢包率),可以确定性能参数的实时性和准确度。It can be seen that when the message is sent again, the performance testing device determines the performance parameters (such as packet loss rate) of the network equipment, and can determine the real-time and accuracy of the performance parameters.

本申请实施例提供的性能测试方法能够有效区分报文重发和丢失。在测试过程中,能够有效忽略重发对丢包率计算的影响,测试结果更准确,适用性更广。对于性能测试装置而言,不仅可以通过报文重发或报文丢失确定网络设备的性能参数,还能根据报文的序列号,有效地确定出网络设备的哪一类型业务存在异常。The performance testing method provided by the embodiments of this application can effectively distinguish between message retransmission and loss. During the test process, the impact of retransmission on packet loss rate calculation can be effectively ignored, making the test results more accurate and more applicable. For performance testing equipment, not only can the performance parameters of network equipment be determined through packet retransmission or packet loss, but also which type of business of the network equipment is abnormal can be effectively determined based on the sequence number of the packet.

本申请实施例根据被测设备的最大缓存空间配置性能测试装置的共享缓存深度,有效地提高了资源的利用率。根据被测设备的最大缓存空间配置性能测试装置的共享缓存深度,利用乒乓缓存,有效地解决了上述两个问题,做到了节省资源和避免冲突,优势明显。The embodiment of the present application configures the shared cache depth of the performance testing device according to the maximum cache space of the device under test, effectively improving resource utilization. Configure the shared cache depth of the performance test device according to the maximum cache space of the device under test, and use ping-pong cache to effectively solve the above two problems, save resources and avoid conflicts, with obvious advantages.

上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above mainly introduces the solutions provided by the embodiments of the present application from the perspective of methods. In order to realize the above functions, it includes hardware structures and/or software modules corresponding to each function. Persons skilled in the art should easily realize that, with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

本申请实施例还提供一种网络设备的性能测试装置。如图5所示,为本申请实施例提供的一种网络设备的性能测试装置50的结构示意图。网络设备的性能测试装置50用于执行图3所示的网络设备的性能测试方法。网络设备的性能测试装置50可以包括生成单元501、通信单元502、存储单元503、更新单元504以及确定单元505。当然,本申请实施例提供的网络设备的性能测试装置50包括但不限于上述模块。An embodiment of the present application also provides a performance testing device for network equipment. As shown in FIG. 5 , it is a schematic structural diagram of a performance testing device 50 for network equipment provided by an embodiment of the present application. The network equipment performance testing device 50 is used to execute the network equipment performance testing method shown in FIG. 3 . The performance testing device 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 device 50 for network equipment provided by the embodiment of the present application includes but is not limited to the above modules.

生成单元501,用于生成与当前测试模式对应的第一报文。Generating unit 501, configured to generate a first message corresponding to the current test mode.

通信单元502,用于向网络设备发送第一报文,便于经由网络设备转发第一报文。The communication unit 502 is configured to send the first message to the network device to facilitate forwarding of the first message via the network device.

存储单元503,用于获取第一信息和存储位置,并根据存储位置将第一信息存储于共享缓存空间中,共享缓存空间的大小是根据网络设备的最大缓存空间预先设置的;若当前测试模式为同步业务测试模式,第一信息为第一报文的业务类型,若当前测试模式是除同步业务测试模式之外的其他模式,第一信息包括发送标识以及存储位置;发送标识用于表征第一报文已被发送。Storage unit 503 is used to obtain the first information and storage location, and store the first information in the shared cache space according to the storage location. The size of the shared cache space is preset according to the maximum cache space of the network device; if the current test mode It is a synchronous service test mode, and the first information is the service type of the first message. If the current test mode is a mode other than the synchronous service test mode, the first information includes a sending identifier and a storage location; the sending identifier is used to characterize the first message. A message has been sent.

通信单元502,还用于接收网络设备发送的第二报文。The communication unit 502 is also used to receive the second message sent by the network device.

更新单元504,用于获取第二信息,并将共享缓存空间中存储的第一信息更新为第二信息;若当前测试模式为同步业务测试模式,第二信息为第二报文的业务类型;若当前测试模式是除同步业务测试模式之外的其他模式,第二信息包括更新标识。The update unit 504 is used to obtain the second information and update 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 a mode other than the synchronization service test mode, the second information includes an update identifier.

确定单元505,用于在确定下次发送报文的情况下,根据共享缓存空间中存储的第二信息确定网络设备的性能参数。The determining unit 505 is configured to determine the performance parameters of the network device according to the second information stored in the shared cache space when it is determined to send a message next time.

可选地,当前测试模式包括但不局限于丢包率测试模式、确认ACK协议测试模式、业务丢失测试模式、业务过滤测试模式、同步业务测试模式。Optionally, the current test mode includes but is not limited to packet loss rate test mode, confirmation ACK protocol test mode, service loss test mode, service filtering test mode, and synchronization service test mode.

共享缓存空间的深度大于或等于最大缓存空间的深度;共享缓存空间的宽度为m+1-n,m为报文的序列号的长度,m为正整数,2n为网络设备的最大缓存空间,m+1-n>0;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 cache space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n is the maximum cache space of the network device ,m+1-n>0;

共享缓存空间包括大小相同的第一共享缓存空间和第二共享缓存空间。The shared cache space includes a first shared cache space and a second shared cache space of the same size.

可选地,存储单元503具体用于:Optionally, storage unit 503 is specifically used for:

若当前测试模式为丢包率测试模式,将第一报文的序列号中低n位作为存储位置;将第一报文的序列号中m-n位的末位添加第一预设字符,并将添加第一预设字符得到的字符串作为发送标识,第一预设字符用于表征已被发送;在第一共享缓存空间的存储位置存入发送标识,之后在第二共享缓存空间的存储位置存入第二预设字符;If the current test mode is the packet loss rate test mode, use the lower n bits of the sequence number of the first message as the storage location; add the first preset character to the last bit of the m-n bits of the sequence number of the first message, and add The string obtained by adding the first preset character is used as a sending identifier. The first preset character is used to represent that it has been sent; the sending identifier is stored in the storage location of the first shared cache space, and then is stored in the storage location of the second shared cache space. Store the second preset character;

若当前测试模式为业务丢失测试模式,确定第一共享缓存空间的起始位置为存储位置;将第一报文的目的MAC地址的低16位确定为发送标识的高16位;在第一共享缓存空间的存储位置存入发送标识,之后在第二共享缓存空间的存储位置存入第二预设字符;If the current test mode is the service loss test mode, determine the starting position of the first shared cache space as the storage location; determine the lower 16 bits of the destination MAC address of the first message as the upper 16 bits of the sending identifier; in the first shared The sending identifier is stored in the storage location of the cache space, and then the second preset character is stored in the storage location of the second shared cache space;

若当前测试模式为同步业务测试模式,确定存储位置为第一共享缓存空间的起始位置;获取业务类型,并将业务类型存储于第一共享缓存空间的起始位置。If the current test mode is the synchronous service test mode, determine the storage location as the starting location of the first shared cache space; obtain the service type, and store the service type at the starting location of the first shared cache space.

可选地,存储单元503具体用于:Optionally, storage unit 503 is specifically used for:

若当前测试模式为其他模式,根据存储位置,确定共享缓存空间的存储区范围以及检查区范围;If the current test mode is another mode, determine the storage area range and check area range of the shared cache space based on the storage location;

在存储区范围中存储第一信息,及在检查区范围中存储第二预设字符可选地,确定单元505具体用于:Store the first information in the storage area range, and store the second preset character in the inspection area range. Optionally, the determination unit 505 is specifically used to:

若存储位置为第一共享缓存空间的地址m,则确定存储区的地址范围为:[第一共享缓存空间的地址m+1,2n-1],以及[第二共享缓存空间的起始地址,第二共享缓存空间的起始地址+m];If the storage location is the address m of the first shared cache space, then the address range of the storage area is determined to be: [address m+1, 2 n -1 of the first shared cache space], and [the start of the second shared cache space Address, starting address of the second shared cache space + m];

确定检查区的地址范围为:[第一共享缓存空间的起始地址,第一共享缓存空间的起始地址+m],以及[第二共享缓存空间的地址m+1,2n-1]。The address range of the check area is determined to be: [the starting address of the first shared cache space, the starting address of the first shared cache space + m], and [the address of the second shared cache space m+1, 2 n -1] .

可选地,更新单元504具体用于:若当前测试模式为同步业务测试模式,则获取第二报文的业务类型,并将第一共享缓存空间中存储的业务类型更新为第二报文的业务类型;Optionally, the update unit 504 is specifically configured to: if the current test mode is the synchronous service test mode, obtain the service type of the second message, and update the service type stored in the first shared cache space to the service type of the second message. business type;

若当前测试模式为其他模式,根据第二报文的序列号和检查区的地址范围确定更新位置;根据存储区中位于更新位置的存储内容,确定第二报文是否为重发报文;若第二报文不为重发报文,则将存储区中位于更新位置的存储内容的末尾字符更新为第二预设字符,以生成更新标识。If the current test mode is another mode, determine the update position based on the sequence number of the second message and the address range of the check area; determine whether the second message is a retransmitted message based on the storage content at the update position in the storage area; if If the second message is not a retransmission message, the last character of the storage content at the update position in the storage area is updated to the second preset character to generate an update identifier.

可选地,更新单元504具体用于:确定存储区中位于更新位置的存储内容的末尾字符是否为第二预设字符;Optionally, the update unit 504 is specifically configured to: determine whether the last character of the storage content located at the update position in the storage area is the second preset character;

若是,则确定第二报文是重发报文;If so, it is determined that the second message is a retransmitted message;

若否,则确定第二报文不是重发报文。If not, it is determined that the second message is not a retransmitted message.

可选地,确定单元505具体用于:Optionally, the determining unit 505 is specifically used to:

若当前测试模式为其他模式,读取检查区范围中内容的末尾字符;若读取到的末尾字符为第二预设字符,则确定报文未丢失;若读取到的末尾字符为第一预设字符,则确定报文已丢失;If the current test mode is other modes, read the last character of the content in the check area range; if the last character read is the second preset character, it is determined that the message has not been lost; if the last character read is the first If the preset characters are set, it is determined that the message has been lost;

若当前测试模式为同步业务测试模式,从第一共享缓存空间的起始位置读取业务类型;对比读取到的业务类型和第二报文中的业务类型,确定被丢失的同步帧的类型。If the current test mode is the synchronous service test mode, read the service type from the starting position of the first shared cache space; compare the read service type with the service type in the second message to determine the type of the lost synchronization frame .

在实际实现时,生成单元501、更新单元504以及确定单元505可以由图2所示的处理器21调用存储器22中的程序代码来实现。其具体的执行过程可参考图3所示的网络设备的性能测试方法部分的描述,这里不再赘述。In actual implementation, the generation unit 501, the update unit 504 and the determination unit 505 can be implemented by the processor 21 shown in FIG. 2 calling the program code in the memory 22. For its specific execution process, please refer to the description of the performance testing method of the network device shown in Figure 3, which will not be described again here.

本申请另一实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当计算机指令在网络设备的性能测试装置上运行时,使得网络设备的性能测试装置执行上述方法实施例所示的方法流程中网络设备的性能测试装置执行的各个步骤。Another embodiment of the present application also provides a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When the computer instructions are run on the performance testing device of the network equipment, the performance testing device of the network equipment is caused to execute. Various steps performed by the performance testing device of the network device in the method flow shown in the above method embodiment.

本申请另一实施例还提供一种芯片系统,该芯片系统应用于网络设备的性能测试装置。所述芯片系统包括一个或多个接口电路,以及一个或多个处理器。接口电路和处理器通过线路互联。接口电路用于从网络设备的性能测试装置的存储器接收信号,并向处理器发送所述信号,所述信号包括所述存储器中存储的计算机指令。当处理器执行计算机指令时,网络设备的性能测试装置执行上述方法实施例所示的方法流程中网络设备的性能测试装置执行的各个步骤。Another embodiment of the present application also provides a chip system, which is applied to a performance testing device of network equipment. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by wires. The interface circuit is configured to receive signals from the memory of the performance testing device of the network equipment and send the signals to the processor, where the signals include computer instructions stored in the memory. When the processor executes the computer instructions, the performance testing device of the network device executes each step performed by the performance testing device of the network device in the method flow shown in the above method embodiment.

在本申请另一实施例中,还提供一种计算机程序产品,该计算机程序产品包括指令,当指令在网络设备的性能测试装置上运行时,使得网络设备的性能测试装置执行上述方法实施例所示的方法流程中网络设备的性能测试装置执行的各个步骤。In another embodiment of the present application, a computer program product is also provided. The computer program product includes instructions. When the instructions are run on a performance testing device of a network device, the performance testing device of the network device performs the steps of the above method embodiment. Each step performed by the performance testing device of the network equipment in the method flow shown.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机执行指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digitalsubscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。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 execution instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., computer instructions may be transmitted from a website, computer, server or data center via a wired (e.g. Coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center. Computer-readable storage media can be any available media that can be accessed by a computer or include one or more data storage devices such as servers and data centers that can be integrated with the media. Available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.

以上所述,仅为本申请的具体实施方式。熟悉本技术领域的技术人员根据本申请提供的具体实施方式,可想到变化或替换,都应涵盖在本申请的保护范围之内。应当注意,本申请实施例的实施方式可以通过硬件、软件或者软件和硬件的结合来实现。硬件部分可以利用专用逻辑来实现;软件部分可以存储在存储器中,由适当的指令执行系统,例如微处理器或者专用设计硬件来执行。本领域的普通技术人员可以理解上述的设备和方法可以使用计算机可执行指令和/或包含在处理器控制代码中来实现,例如在诸如磁盘、CD或DVD-ROM的载体介质、诸如只读存储器(固件)的可编程的存储器或者诸如光学或电子信号载体的数据载体上提供了这样的代码。本申请实施例的设备及其模块可以由诸如超大规模集成电路或门阵列、诸如逻辑芯片、晶体管等的半导体、或者诸如现场可编程门阵列、可编程逻辑设备等的可编程硬件设备的硬件电路实现,也可以用由各种类型的处理器执行的软件实现,也可以由上述硬件电路和软件的结合例如固件来实现。The above are only specific implementations of the present application. Those skilled in the art may think of changes or substitutions based on the specific implementations provided in this application, and they shall all be covered by the protection scope of this application. It should be noted that the implementation of the embodiments of the present application can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in memory and executed by an appropriate instruction execution system, such as a microprocessor or specially designed hardware. Those of ordinary skill in the art will understand that the above-described apparatus and methods may be implemented using computer-executable instructions and/or included in processor control code, for example on a carrier medium such as a disk, CD or DVD-ROM, such as a read-only memory. Such code is provided on a programmable memory (firmware) or on a data carrier such as an optical or electronic signal carrier. The devices and modules thereof in the embodiments of the present application may be composed of hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc. Implementation can also be implemented by software executed by various types of processors, or by a combination of the above-mentioned hardware circuits and software, such as firmware.

以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,凡在本申请实施例的精神和原则之内所作的任何修改、等同替换和改进等,都应涵盖在本申请实施例的保护范围之内。The above are only specific implementation modes of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person familiar with the technical field can, within the technical scope disclosed in the embodiments of the present application, Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be covered by the protection scope of the embodiments of the present application.

Claims (10)

1.一种网络设备的性能测试方法,其特征在于,包括:1. A performance testing method for network equipment, characterized by including: 生成与当前测试模式对应的第一报文,并向所述网络设备发送所述第一报文,便于经由所述网络设备转发所述第一报文;Generate a first message corresponding to the current test mode, and send the first message to the network device to facilitate forwarding of the first message via the network device; 获取第一信息和存储位置,并根据所述存储位置将所述第一信息存储于共享缓存空间中,所述共享缓存空间的大小是根据所述网络设备的最大缓存空间预先设置的;若所述当前测试模式为同步业务测试模式,所述第一信息为所述第一报文的业务类型,若所述当前测试模式是除所述同步业务测试模式之外的其他模式,所述第一信息包括发送标识;所述发送标识用于表征所述第一报文已被发送;Obtain the first information and storage location, and store the first information in a shared cache space according to the storage location. The size of the shared cache space is preset according to the maximum cache space of the network device; if The current test mode is a synchronous service test mode, and the first information is a service type of the first message. If the current test mode is other modes except the synchronous service test mode, the first information is a service type of the first message. The information includes a sending identifier; the sending identifier is used to represent that the first message has been sent; 接收所述网络设备发送的第二报文;Receive the second message sent by the network device; 获取第二信息,并将所述共享缓存空间中存储的所述第一信息更新为所述第二信息;若所述当前测试模式为所述同步业务测试模式,所述第二信息为所述第二报文的业务类型;若所述当前测试模式是除所述同步业务测试模式之外的其他模式,所述第二信息包括更新标识;Obtain the second information, and update the first information stored in the shared cache space to the second information; if the current test mode is the synchronization service test mode, the second information is the The service type of the second message; if the current test mode is a mode other than the synchronization service test mode, the second information includes an update identifier; 在确定下次发送报文的情况下,根据所述共享缓存空间中存储的所述第二信息确定所述网络设备的性能参数。When it is determined to send a message next time, the performance parameters of the network device are determined according to the second information stored in the shared cache space. 2.根据权利要求1所述的性能测试方法,其特征在于,2. The performance testing method according to claim 1, characterized in that, 所述当前测试模式包括丢包率测试模式、确认ACK协议测试模式、业务丢失测试模式、业务过滤测试模式、所述同步业务测试模式;The current test mode includes a packet loss rate test mode, a confirmation ACK protocol test mode, a service loss test mode, a service filtering test mode, and the synchronization service test mode; 所述共享缓存空间的深度大于或等于所述最大缓存空间的深度;所述共享缓存空间的宽度为m+1-n,m为所述报文的序列号的长度,m为正整数,2n为所述网络设备的最大缓存空间,m+1-n>0;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 cache space is m+1-n, m is the length of the sequence number of the message, m is a positive integer, 2 n is the maximum cache space of the network device, m+1-n>0; 所述共享缓存空间包括大小相同的第一共享缓存空间和第二共享缓存空间。The shared cache space includes a first shared cache space and a second shared cache space of the same size. 3.根据权利要求2所述的性能测试方法,其特征在于,所述获取第一信息和存储位置,并根据所述存储位置将所述第一信息存储于共享缓存空间中,包括:3. The performance testing method according to claim 2, wherein obtaining the first information and storage location, and storing the first information in a shared cache space according to the storage location includes: 若所述当前测试模式为所述丢包率测试模式,将所述第一报文的序列号中低n位作为所述存储位置;将所述第一报文的序列号中m-n位的末位添加第一预设字符,并将添加所述第一预设字符得到的字符串作为所述发送标识,所述第一预设字符用于表征已被发送;在所述第一共享缓存空间的所述存储位置存入所述发送标识,之后在所述第二共享缓存空间的所述存储位置存入第二预设字符;If the current test mode is the packet loss rate test mode, use the lower n bits of the sequence number of the first message as the storage location; use the last m-n bits of the sequence number of the first message. Add a first preset character to a bit, and use the string obtained by adding the first preset character as the sending identifier. The first preset character is used to represent that it has been sent; in the first shared cache space The sending identifier is stored in the storage location, and then the second preset character is stored in the storage location of the second shared cache space; 若所述当前测试模式为所述业务丢失测试模式,确定所述第一共享缓存空间的起始位置为所述存储位置;将所述第一报文的目的MAC地址的低16位确定为所述发送标识的高16位;在所述第一共享缓存空间的所述存储位置存入所述发送标识,之后在所述第二共享缓存空间的所述存储位置存入第二预设字符;If the current test mode is the service loss test mode, determine the starting position of the first shared cache space as the storage location; determine the lower 16 bits of the destination MAC address of the first message as the The high-order 16 bits of the sending identifier; store the sending identifier in the storage location of the first shared cache space, and then store the second preset character in the storage location of the second shared cache space; 若所述当前测试模式为所述同步业务测试模式,确定所述存储位置为所述第一共享缓存空间的起始位置;获取所述业务类型,并将所述业务类型存储于所述第一共享缓存空间的起始位置。If the current test mode is the synchronous service test mode, determine the storage location as the starting position of the first shared cache space; obtain the service type, and store the service type in the first shared cache space The starting location of the shared cache space. 4.根据权利要求3所述的性能测试方法,其特征在于,所述获取第一信息和存储位置,并根据所述存储位置将第一信息存储于共享缓存空间中,包括:4. The performance testing method according to claim 3, characterized in that said obtaining the first information and 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 other mode, determine the storage area range and inspection area range of the shared cache space according to the storage location; 在所述存储区范围中存储所述第一信息,及在所述检查区范围中存储所述第二预设字符。The first information is stored in the storage area range, and the second preset character is stored in the check area range. 5.根据权利要求4所述的性能测试方法,其特征在于,所述根据所述存储位置,确定所述共享缓存空间的存储区范围以及检查区范围,包括:5. The performance testing method according to claim 4, wherein determining the storage area range and inspection area range of the shared cache space according to the storage location includes: 若所述存储位置为所述第一共享缓存空间的地址k,则确定所述存储区的地址范围为:[所述第一共享缓存空间的地址k+1,2n-1],以及[所述第二共享缓存空间的起始地址,所述第二共享缓存空间的起始地址+k];If the storage location is the address k of the first shared cache space, then the address range of the storage area is determined to be: [address k+1, 2 n -1 of the first shared cache space], and [ The starting address of the second shared cache space, the starting address of the second shared cache space + k]; 确定所述检查区的地址范围为:[所述第一共享缓存空间的起始地址,所述第一共享缓存空间的起始地址+k],以及[所述第二共享缓存空间的地址k+1,2n-1]。The address range of the check area is determined to be: [the starting address of the first shared cache space, the starting address of the first shared cache space + k], and [the address k of the second shared cache space +1, 2 n -1]. 6.根据权利要求5所述的性能测试方法,其特征在于,所述获取第二信息,并将所述第一信息更新为所述第二信息,包括:6. The performance testing method according to claim 5, characterized in that obtaining the second information and updating the first information to the second information includes: 若所述当前测试模式为所述同步业务测试模式,则获取所述第二报文的业务类型,并将所述第一共享缓存空间中存储的业务类型更新为所述第二报文的业务类型;If the current test mode is the synchronous service test mode, obtain the service type of the second message, and update the service type stored in the first shared cache space to the service of the second message type; 若所述当前测试模式为所述其他模式,根据所述第二报文的序列号和所述检查区的地址范围确定更新位置;根据所述存储区中位于所述更新位置的存储内容,确定所述第二报文是否为重发报文;若所述第二报文不为重发报文,则将所述存储区中位于所述更新位置的存储内容的末尾字符更新为所述第二预设字符,以生成所述更新标识。If the current test mode is the other mode, determine the update location based on the sequence number of the second message and the address range of the inspection area; determine based on the storage content located at the update location in the storage area. Whether the second message is a resend message; if the second message is not a resend message, update the last character of the storage content located at the update position in the storage area to the third Two preset characters to generate the update identification. 7.根据权利要求6所述的性能测试方法,其特征在于,所述根据所述存储区中位于所述更新位置的存储内容,确定所述第二报文是否为重发报文,包括:7. The performance testing method according to claim 6, wherein determining whether the second message is a retransmission message according to the storage content located at the update position in the storage area includes: 确定所述存储区中位于所述更新位置的存储内容的末尾字符是否为所述第二预设字符;Determine whether the last character of the storage content located at the update position in the storage area is the second preset character; 若是,则确定所述第二报文是重发报文;If so, determine that the second message is a retransmitted message; 若否,则确定所述第二报文不是重发报文。If not, it is determined that the second message is not a retransmission message. 8.根据权利要求4所述的性能测试方法,其特征在于,所述性能测试方法还包括:8. The performance testing method according to claim 4, characterized in that the performance testing method further includes: 若所述当前测试模式为所述其他模式,读取所述检查区范围中内容的末尾字符;若读取到的末尾字符为第二预设字符,则确定报文未丢失;若读取到的末尾字符为第一预设字符,则确定报文已丢失;If the current test mode is the other mode, read the last character of the content in the check area range; if the last character read is the second preset character, it is determined that the message has not been lost; if the read The last character of is the first preset character, then it is determined that the message has been lost; 若所述当前测试模式为同步业务测试模式,从所述第一共享缓存空间的起始位置读取业务类型;对比读取到的业务类型和所述第二报文中的业务类型,确定被丢失的同步帧的类型。If the current test mode is a synchronous service test mode, read the service type from the starting position of the first shared cache space; compare the read service type with the service type in the second message to determine The type of sync frame that was lost. 9.一种网络设备的性能测试装置,其特征在于,包括:9. A performance testing device for network equipment, characterized by including: 生成单元,用于生成与当前测试模式对应的第一报文;A generation unit, used to generate the first message corresponding to the current test mode; 通信单元,用于向所述网络设备发送所述第一报文,便于经由所述网络设备转发所述第一报文;A communication unit configured to send the first message to the network device to facilitate forwarding of the first message via the network device; 存储单元,用于获取第一信息和存储位置,并根据所述存储位置将所述第一信息存储于共享缓存空间中,所述共享缓存空间的大小是根据所述网络设备的最大缓存空间预先设置的;若所述当前测试模式为同步业务测试模式,所述第一信息为所述第一报文的业务类型,若所述当前测试模式是除所述同步业务测试模式之外的其他模式,所述第一信息包括发送标识;所述发送标识用于表征所述第一报文已被发送;A storage unit configured to obtain the first information and a storage location, and store the first information in a shared cache space according to the storage location. The size of the shared cache space is preset based on the maximum cache space of the network device. Set; if the current test mode is a synchronous service test mode, the first information is the service type of the first message, if the current test mode is other modes except the synchronous service test mode , the first information includes a sending identifier; the sending identifier is used to represent that the first message has been sent; 所述通信单元,还用于接收所述网络设备发送的第二报文;The communication unit is also used to receive the second message sent by the network device; 更新单元,用于获取第二信息,并将所述共享缓存空间中存储的所述第一信息更新为所述第二信息;若所述当前测试模式为所述同步业务测试模式,所述第二信息为所述第二报文的业务类型;若所述当前测试模式是除所述同步业务测试模式之外的其他模式,所述第二信息包括更新标识;An update unit, configured to obtain second information and update the first information stored in the shared cache space to the second information; if the current test mode is the synchronization service test mode, the The second information is the service type of the second message; if the current test mode is a mode other than the synchronization service test mode, the second information includes an update identifier; 确定单元,用于在确定下次发送报文的情况下,根据所述共享缓存空间中存储的所述第二信息确定所述网络设备的性能参数。A determining unit configured to determine the performance parameters of the network device according to the second information stored in the shared cache space when it is determined to send a message next time. 10.一种网络设备的性能测试装置,其特征在于,所述网络设备的性能测试装置包括存储器和处理器;所述存储器和所述处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述处理器执行所述计算机指令时,所述网络设备的性能测试装置执行如权利要求1-8中任意一项所述的网络设备的性能测试方法。10. A performance testing device for network equipment, characterized in that the performance testing device for network equipment includes a memory and a processor; the memory is coupled to the processor; the memory is used to store computer program code, so The computer program code includes computer instructions; when the processor executes the computer instructions, the performance testing device of the network device executes the performance testing method of the network device according to any one of claims 1-8.
CN202210595792.6A 2022-05-27 2022-05-27 A performance testing method and device for network equipment Active CN114978959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210595792.6A CN114978959B (en) 2022-05-27 2022-05-27 A performance testing 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 A performance testing 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 A performance testing method and device for network equipment

Country Status (1)

Country Link
CN (1) CN114978959B (en)

Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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
CN101163051A (en) Network card transmission speed testing system and method
US20070179733A1 (en) Methods and apparatus for testing a link between chips
CN113872826B (en) Network card port stability test method, system, terminal and storage medium
WO2021134418A1 (en) Data checking method and apparatus
CN115514682B (en) A data transmission method, device, equipment and storage medium
CN100438453C (en) A system and method to test network card
US20230261795A1 (en) Method for Retransmitting Data and Apparatus
US20250211544A1 (en) Method and apparatus for transmitting packet
JPH0691538B2 (en) Packet end signal generator
CN117014361A (en) Data transmission method, device, equipment and storage medium
CN112422485B (en) Communication method and device of transmission control protocol
EP4270183A1 (en) Public cloud tenant service management method and device
CN114978959B (en) A performance testing method and device for network equipment
CN106161143A (en) A kind of network performance test method based on ARM server and device
CN111885613B (en) SIG MESH-based networking method, node equipment and computer equipment
CN114244692B (en) Fault rapid positioning method suitable for ultra-large scale interconnection network
CN116886490A (en) Server inspection method, device and computer-readable storage medium
CN116405420A (en) Network tester, network testing system and network testing method
CN115454896A (en) SMBUS-based SSD MCTP control message verification method and device, computer equipment and storage medium
CN111698125B (en) Communication test method and device
TWI317585B (en) System and method for testing the transmission speed of network interface cards
CN1770132A (en) Connecting device between processor and subscriber identity card
CN102377661A (en) Blade server and method for building shortest blade transmission path in blade server
US20220050139A1 (en) System, apparatus and method for communicating debug messages on a sideband of a serial link according to a debug type messaging protocol
US11606274B1 (en) Method for operations of virtual machines in monitoring cloud activities, system, and device applying the method

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