Method for testing RoCE network card transmission exception handling function

Through SoftRoCE technology and transmission exception simulation module, the transmission exception problem that RoCE network card is difficult to test is solved, and effective testing of the transmission exception handling function of RoCE network card is realized.

CN119520360APending Publication Date: 2025-02-25NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411627276.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Because of its protocol offload design, RoCE network cards have become a black box for testers, and it is difficult to test their transmission exception handling methods and results.

Method used

Using SoftRoCE technology in the Linux kernel, a transmission exception simulation module is developed, and the RoCE network card is interconnected through SoftRoCE+ Ethernet card to realize the testing of the RoCE network card transmission exception handling function.

Benefits of technology

It successfully obtained the RoCE protocol packets of the RoCE network card and was able to effectively test its transmission exception handling function, solving the black box problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520360A_ABST
    Figure CN119520360A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer networks, and particularly relates to a method for testing a RoCE network card transmission exception handling function. Aiming at the problems that the RoCE network card adopts a protocol unloading mode and realizes RoCE protocol processing in a black box form, so that a RoCE protocol message cannot be acquired, and a transmission exception processing function of the RoCE network card cannot be tested, the RoCE protocol message of the RoCE network card is acquired by adopting a method of interconnecting a SoftRoCE + Ethernet card and the RoCE network card by utilizing the technical characteristic that the RoCE protocol processing is realized in a software form, so that the RoCE protocol message of the RoCE network card can be tested. The transmission exception handling function of the RoCE network card is tested; according to the method, the problem that the protocol processing message cannot be acquired due to the fact that the RoCE network card is a black box is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer networks, and in particular relates to a method for testing a transmission exception processing function of a RoCE (RDMA over Coverage Ethernet) network card. Background Art

[0002] RoCE networks have been widely deployed and used in data center networks for application scenarios such as AI and supercomputing that have high requirements for network latency and CPU utilization due to their low end-to-end latency, low CPU resource consumption, and low deployment cost.

[0003] RoCE is an RDMA (Remote Direct Memory Access) network implemented on the basis of Ethernet IP / UDP protocol. The principle is to encapsulate the Infiniband transport layer message into the Payload of the UDP message, transmit the Infiniband message through the Ethernet IP / UDP protocol, and then implement the RDMA network through Infiniband in the upper layer protocol. RoCE network cards generally support both Ethernet and RDMA working modes. According to the RoCE network protocol specification (Supplement to InfiniBandTM Architecture Specification Volume 1Release1.2.1Annex A17:RoCEv2) and the Infiniband protocol specification (InfiniBand TM ArchitectureSpecification Volume 1Release 1.4), the RoCE network card distinguishes the messages in the two modes by the destination port in the UDP message. If it is UDP protocol and the UDP destination port is 4791, the message is a network message in RDMA mode, and the subsequent processing is completed by the RDMA module in the network card; otherwise, it is an Ethernet message, and the subsequent processing is completed by the Ethernet module in the network card.

[0004] The RoCE network card design adopts the method of protocol unloading, and the network layer and transport layer of the IB network, the Ethernet layer of the Ethernet, the IP layer and the UDP layer of the Ethernet are all implemented in the hardware network card to improve the processing performance as much as possible. However, this design makes the network card a black box for network card testers, and it is difficult to test the processing method and processing results of the network card under abnormal conditions such as network transmission packet loss. To solve this problem, the present invention utilizes the open source SoftRoCE technology in the Linux kernel to develop a transmission exception simulation module to test the transmission exception handling function of the RoCE network card. Summary of the invention

[0005] The technical problem to be solved by the present invention is how to test the transmission exception handling function of the RoCE network card, which is a black box for testers, and obtain its RoCE protocol message.

[0006] Aiming at the problem that the RoCE network card adopts the protocol offloading mode and implements the RoCE protocol processing in the form of a black box, thereby being unable to obtain the RoCE protocol message and being unable to test the transmission exception processing function of the RoCE network card, the present invention utilizes the technical characteristics of SoftRoCE to implement the RoCE protocol processing in the form of software, adopts the method of interconnecting SoftRoCE+Ethernet card with the RoCE network card, obtains the RoCE protocol message of the RoCE network card, and tests the transmission exception processing function of the RoCE network card.

[0007] The present invention is divided into the following steps:

[0008] The first step is to build a RoCE network card transmission exception handling function test system. The test system includes two servers: Server A and Server B. Both servers are installed with Linux-like operating systems, and the operating system kernel version is greater than 4.0; a RoCE network card (the RoCE network card being tested), an Ethernet card with the same interface as the RoCE network card, the RoCE network card is installed on Server A, and the Ethernet card is installed on Server B. The two network cards are directly connected through optical fiber; the RoCE network card driver, RoCE protocol stack and RoCE application A are installed and deployed on Server A; the SoftRoCE module, as well as the message parsing module, transmission exception simulation module, configuration file, transmission exception simulation parameter library, initialization module, transmission exception configuration module and RoCE application B are installed and deployed on Server B.

[0009] Among them, both RoCE application A and RoCE application B are open-source RoCE test programs (for reference, see https: / / github.com / linux-rdma / perftest.git); the RoCE protocol stack and the RoCE network card driver are the protocol stack and driver software supporting the RoCE network card; RoCE application A, the RoCE protocol stack, and the RoCE network card driver are deployed on server A; RoCE application B and the SoftRoCE module are deployed on server B; the configuration file is used to store the initialization transmission exception configuration parameters, including the number of packet loss types N for transmission exception simulation, the packet loss type type[i], and the packet loss rate rate[i] for each packet loss type; N is a positive integer and N is less than or equal to 6, i represents the i-th packet loss type, 0 ≤ i < N, the packet loss type 1 ≤ type[i] ≤ 5, and the packet loss rate rate[i] is a floating-point number, 0 ≤ rate[i] ≤ 1; the initialization module is connected to the configuration file and the transmission exception simulation parameter library; during system initialization, the initialization module reads the number of packet loss types N, the packet loss type type[i], and the packet loss rate rate[i] for each packet loss type from the configuration file, and sends the read number of packet loss types N and all the packet loss types type[i] and packet loss rates rate[i] to the transmission exception simulation parameter library;

[0010] During system operation, the transmission exception configuration module monitors and receives user commands, parses the transmission exception simulation parameters from the user commands, including: the packet loss type type1, 1 ≤ type1 ≤ 5, the packet loss flag flag1, when flag1 is 1, it means that packet loss is implemented for the packets of type type1; when flag1 is 0, it means that packet loss is not implemented for the packets of type type1, and the packet loss rate rate1 for this packet loss type, rate1 is a floating-point number, 0 ≤ rate1 ≤ 1, and sends type1, flag1, and rate1 to the transmission exception simulation parameter library;

[0011] The message parsing module is connected to the Ethernet card, the SoftRoCE module and the transmission anomaly simulation module; when the system is running, the message parsing module monitors the Ethernet card and receives the input Ethernet message from the Ethernet card, analyzes whether the Ethernet message is a RoCE message and the specific type of the RoCE message according to the RoCE protocol specification and the Infiniband protocol specification, and sends the message, the message type and the message source pkt_src to the transmission anomaly simulation module, and the message source pkt_src takes a value of 0 or 1, 0 indicates that the message comes from the Ethernet card, and 1 indicates that the message comes from the SoftRoCE module; at the same time, the message parsing module monitors the SoftRoCE module and the Ethernet card, receives the input Ethernet message from the SoftRoCE module or the Ethernet card, analyzes whether the Ethernet message is a RoCE message and the specific type of the RoCE message according to the RoCE protocol specification and the Infiniband protocol specification, and sends the message, the message type and the message source pkt_src to the transmission anomaly simulation module, and the message source pkt_src takes a value of 0 or 1, 0 indicates that the message comes from the Ethernet card, and 1 indicates that the message comes from the SoftRoCE module;

[0012] The transmission anomaly simulation module is connected to the message parsing module, the transmission anomaly simulation parameter library, the SoftRoCE module and the Ethernet card; when the system is running, the transmission anomaly simulation module monitors the message parsing module, and receives the Ethernet message pkt and the type pkt_type of the message from the message parsing module, and discards the message according to the transmission anomaly parameters or forwards it to the SoftRoCE module or the Ethernet card according to the message source pkt_src, forwards it to the SoftRoCE module when pkt_src is 0, and forwards it to the Ethernet card when pkt_src is 1;

[0013] The second step is to initialize the RoCE network card transmission exception handling function test system

[0014] 2.1 Initialize the configuration file

[0015] According to the requirements of the RoCE network card transmission exception handling function test, the number of network packet loss types N, packet loss type type[i], and packet loss rate rate[i] of each packet loss type are written into the configuration file in order;

[0016] 2.2 Install and deploy the RoCE network card driver, RoCE protocol stack, and RoCE application A on server A according to the instructions for using the RoCE network card.

[0017] 2.3 Install and deploy the SoftRoCE module and RoCE application B on server B, and load the initialization module, message parsing module, transmission exception simulation module, and transmission exception configuration module.

[0018] In the third step, the initialization module initializes the RoCE network card transmission exception handling function test system, the method is:

[0019] 3.1 Read the number of packet loss types N from the configuration file, read the N packet loss types type[i] in sequence, and read the packet loss rates rate[i] of the N packet loss types in sequence.

[0020] 3.2 Send N, type[i] and rate[i] to the transmission exception simulation module.

[0021] In the fourth step, the message parsing module, transmission exception simulation module, transmission exception configuration module, server A, RoCE application A, server B, SoftRoCE module, and RoCE application B jointly complete the test of the RoCE network card network transmission exception handling function; the details are as follows:

[0022] 4.1 The message parsing module is executed according to the methods described in 4.1.1-4.1.11:

[0023] 4.1.1 Monitor the Ethernet card and SoftRoCE module: If a message arrives from the Ethernet card, go to 4.1.2; if a message arrives from the SoftRoCE module, go to 4.1.10; if no message arrives, go to 4.1.1 to continue monitoring;

[0024] 4.1.2 Input Ethernet message pkt from Ethernet card, set pkt_src = 0;

[0025] 4.1.3 Extract the network layer protocol type from the Ethernet message pkt according to the Ethernet message format;

[0026] 4.1.4 Determine whether the network layer protocol type is IPv4 or IPv6: If not, go to 4.1.11; if it is IPv4, extract the IPv4 message ipv4_pkt from pkt, and go to 4.1.5; if it is IPv6, extract the IPv6 message ipv6_pkt from pkt, and go to 4.1.7;

[0027] 4.1.5 Extract the transport layer protocol type from the IPv4 message ipv4_pkt according to the IPv4 message format;

[0028] 4.1.6 Determine whether the transport layer protocol type is UDP: If it is UDP and the UDP destination port is 4791, extract the UDP message content udp_payload and go to 4.1.8; otherwise, go to 4.1.11;

[0029] 4.1.7 Extract the transport layer protocol type from the IPv6 message ipv6_pkt according to the IPv6 message format, and go to 4.1.6;

[0030] 4.1.8 According to the InfiniBand protocol specification (InfiniBand TM Architecture Specification Volume 1 Release 1.4, Chapter 5) Analyze the RoCE message type pkt_type of udp_payload: if the message type is SEND, then pkt_type = 1; if the message type is READ, then pkt_type = 2; if the message type is WRITE, then pkt_type = 3; if the message type is ACK, then pkt_write = 4; if the message type is NACK, then pkt_type = 5; otherwise, pkt_type = 0;

[0031] 4.1.9 Send pkt, pkt_src and pkt_type to the transmission anomaly simulation module and go to 4.1.1 to continue monitoring;

[0032] 4.1.10 Input Ethernet message pkt from SoftRoCE module, set pkt_src=1, and go to 4.1.3;

[0033] 4.1.11 Set the RoCE message type pkt_type to 0, and go to 4.1.9;

[0034] 4.2 The transmission anomaly simulation module is executed according to the methods described in 4.2.1-4.2.9:

[0035] 4.2.1 Initialize the 6-element message statistics array count[i], where count[i] represents the number of messages with pkt_type i, 0≤i≤5, and assign each element to 0;

[0036] 4.2.2 Read the number N of network packet loss types from the transmission anomaly simulation parameter library, read the N packet loss types type[i] in sequence, and read the packet loss rates rate[i] of the N packet loss types in sequence;

[0037] 4.2.3 Monitor the message parsing module. If an Ethernet message arrives, execute 4.2.4. If no message arrives, go to 4.2.2 to continue monitoring.

[0038] 4.2.4 Receive the Ethernet message pkt, the source pkt_src of pkt, and the RoCE message type pkt_type of pkt from the message parsing module;

[0039] 4.2.5 According to the packet loss type array type[i], determine whether pkt_type is an element of type[i]. If not, go to 4.2.9; if yes, assume it is the pkt_ith element of type, go to 4.2.6;

[0040] 4.2.6 Count the number of packets of type pkt_type, and set the packet statistics array count[pkt_type]+1;

[0041] 4.2.7 Determine whether to discard the Ethernet message pkt based on its type, number of messages of this type, and packet loss rate. The method is:

[0042] Calculate drop = count[pkt_type] * rate[pkt_i], and determine whether drop is greater than 1. If drop is greater than 1, it needs to be discarded, and go to 4.2.8; otherwise, it does not need to be discarded, and go to 4.2.9;

[0043] 4.2.8 discards the message pkt, sets count[pkt_type]=0, and goes to 4.2.2 to continue monitoring;

[0044] 4.2.9 If pkt_src is equal to 0, send pkt to the SoftRoCE module and go to 4.2.2 to continue monitoring; if pkt_src is equal to 1, send pkt to the Ethernet card and go to 4.2.2 to continue monitoring;

[0045] 4.3 The transmission exception configuration module is executed according to the methods described in 4.3.1-4.3.7:

[0046] 4.3.1 Read the number of network packet loss types N, the packet loss type array type[i], and the packet loss rate array rate[i] from the transmission anomaly simulation parameter library.

[0047] 4.3.2 Monitor whether any user calls the transmission exception configuration module. If so, execute 4.3.3. If not, go to 4.3.2 and continue monitoring.

[0048] 4.3.3 Receive network packet loss type type1 and network packet loss rate rate1 from the user;

[0049] 4.3.4 Determine whether type1 is an element of array type[i]. If not, go to 4.3.5. If yes, assume it is the type_i-th element and go to 4.3.7.

[0050] 4.3.5 Let type[N]=type1, rate[N]=rate1, N=N+1;

[0051] 4.3.6 Write N, type, and rate into the transmission anomaly simulation parameter library, and go to 4.3.2 to continue monitoring;

[0052] 4.3.7 Set rate[type_i] = rate1, write rate into the transmission anomaly simulation parameter library, and go to 4.3.2 to continue monitoring.

[0053] 4.4 Server A, RoCE application A, server B, SoftRoCE module, and RoCE application B are running normally.

[0054] The following technical effects can be achieved by using the present invention:

[0055] 1) In the first step of the present invention, the SoftRoCE module can simulate the technical characteristics of the RoCE network card function, and a method of connecting the SoftRoCE+Ethernet card to the RoCE network card is proposed to test the abnormal transmission function of the RoCE network card. Since the processing of the RoCE network protocol is completed in the software-implemented SoftRoCE module in server B, tools such as tcpdump can be used on server B to capture and analyze the messages received and sent by the RoCE network card. This method solves the problem that the RoCE network card is a black box and the protocol processing messages cannot be obtained;

[0056] 2) The first step of the present invention is to insert a transmission exception simulation module between the SoftRoCE module and the Ethernet card. The present invention designs the workflow of the transmission exception simulation module in step 4.2. The module can simulate the packet loss of the network link for the RoCE message according to the requirements, and then can assist in the test of the transmission exception handling function of the RoCE network card;

[0057] 3) In step 4.3 of the present invention, the transmission exception configuration module allows the user to set the packet loss rate of a certain type of RoCE message according to the requirements of the RoCE network card test, making the test of the transmission exception handling function of the RoCE network card more flexible;

[0058] 4) The present invention can be used to discover problems in the operation of RoCE network cards, so as to assist in the design of RoCE network cards. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is the overall flow chart of the present invention;

[0060] Figure 2 It is a logical structure diagram of the RoCE network card transmission exception handling function test system constructed in the first step of the present invention. DETAILED DESCRIPTION

[0061] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.

[0062] Figure 1 It is the overall flow chart of the present invention, which is divided into four major steps:

[0063] The first step is to build a RoCE network card transmission exception handling function test system;

[0064] The second step is to initialize the RoCE network card transmission exception handling function test system;

[0065] In the third step, the initialization module initializes the RoCE network card transmission exception handling function test system;

[0066] In the fourth step, the message parsing module, transmission exception simulation module, transmission exception configuration module, server A with RoCE network card installed, RoCE application A, server B with Ethernet card installed, SoftRoCE module, and RoCE application B jointly complete the test of the network transmission exception handling function of the RoCE network card.

[0067] Figure 2 It is a logical structure diagram of the RoCE network card transmission exception handling function test system constructed in the first step of the present invention, including a server A with a RoCE network card installed and a server B with an Ethernet card installed, a RoCE network card driver, a RoCE protocol stack and a RoCE application A are deployed on server A, and a SoftRoCE module, a RoCE application B and a message parsing module, a transmission exception simulation module, a transmission exception configuration module, a transmission exception simulation parameter library, an initialization module and a configuration file are deployed on server B. Among them, the message parsing module, the transmission exception simulation module, the transmission exception configuration module, the transmission exception simulation parameter library, the initialization module and the configuration file are specially designed for the present invention.

[0068] The present invention utilizes the technical characteristics of the SoftRoCE module that can simulate the function of the RoCE network card in software form, connects the server A installed with the RoCE network card with the server B installed with the Ethernet card, designs a RoCE network card transmission exception handling function test system, and solves the RoCE network card. A transmission exception simulation module, a message parsing module, a transmission exception configuration module, and an initialization module are designed on server B to simulate various transmission exceptions on the link. Since these are all software modules, network tools such as tcpdump can be used to capture packets and analyze the behavior of the RoCE network card on server A under different transmission exceptions, and the transmission exception handling function of the RoCE network card is tested.

Claims

1. A method for testing a RoCE network card transmission exception handling function, characterized in that: The method is divided into the following steps: In the first step, a test system for handling RoCE network card transmission anomalies is constructed. The test system includes two servers: Server A and Server B. Both servers are installed with a Linux-like operating system, and the operating system kernel version is greater than 4.

0. One RoCE network card and one Ethernet network card with the same interface as the RoCE network card. The RoCE network card is installed on Server A, and the Ethernet network card is installed on Server B. The two network cards are directly connected by optical fiber. On Server A where the RoCE network card is installed, the RoCE network card driver, RoCE protocol stack, and RoCE application A are installed and deployed. On Server B where the Ethernet network card is installed, the SoftRoCE module, packet parsing module, transmission anomaly simulation module, configuration file, transmission anomaly simulation parameter library, initialization module, transmission anomaly configuration module, and RoCE application B are installed and deployed. The RoCE protocol stack and RoCE network card driver are protocol stacks and driver software that come with the RoCE network card. RoCE application A, RoCE protocol stack, and RoCE network card driver are deployed on Server A. RoCE application B and SoftRoCE module are deployed on Server B. The configuration file is used to store the initialization transmission anomaly configuration parameters, including the number of packet loss types N for transmission anomaly simulation, the packet loss type type[i], and the packet loss rate rate[i] for each packet loss type. N is a positive integer, i represents the i-th packet loss type, 0 ≤ i < N, and the packet loss rate rate[i] is a floating-point number. The initialization module is connected to the configuration file and the transmission anomaly simulation parameter library. During system initialization, the initialization module reads the number of packet loss types N, the packet loss type type[i], and the packet loss rate rate[i] for each packet loss type from the configuration file, and sends the read number of packet loss types N and all the packet loss types type[i] and packet loss rates rate[i] to the transmission anomaly simulation parameter library. During system operation, the transmission anomaly configuration module monitors and receives user commands, parses the transmission anomaly simulation parameters from the user commands, including: the packet loss type type1, 1 ≤ type1 ≤ 5, the packet loss flag flag1. When flag1 is 1, it means packet loss is implemented for the packets of type type1; when flag1 is 0, it means no packet loss is implemented for the packets of type type1, and the packet loss rate rate1 of this packet loss type, where rate1 is a floating-point number, 0 ≤ rate1 ≤ 1, and sends type1, flag1, and rate1 to the transmission anomaly simulation parameter library. The message parsing module is connected to the Ethernet card, the SoftRoCE module and the transmission anomaly simulation module; when the system is running, the message parsing module monitors the Ethernet card and receives the input Ethernet message from the Ethernet card, analyzes whether the Ethernet message is a RoCE message and the specific type of the RoCE message according to the RoCE protocol specification and the Infiniband protocol specification, and sends the message, the message type and the message source pkt_src to the transmission anomaly simulation module, and the message source pkt_src takes a value of 0 or 1, 0 indicates that the message comes from the Ethernet card, and 1 indicates that the message comes from SoftRoCE; at the same time, the message parsing module monitors the SoftRoCE module and the Ethernet card, receives the input Ethernet message from the SoftRoCE module or the Ethernet card, analyzes whether the Ethernet message is a RoCE message and the specific type of the RoCE message according to the RoCE protocol specification and the Infiniband protocol specification, and sends the message, the message type and the message source pkt_src to the transmission anomaly simulation module, and the message source pkt_src takes a value of 0 or 1, 0 indicates that the message comes from the Ethernet card, and 1 indicates that the message comes from the SoftRoCE module; The transmission anomaly simulation module is connected to the message parsing module, the transmission anomaly simulation parameter library, the SoftRoCE module and the Ethernet card; when the system is running, the transmission anomaly simulation module monitors the message parsing module, and receives the Ethernet message pkt and the type pkt_type of the message from the message parsing module, and discards the message according to the transmission anomaly parameters or forwards it to the SoftRoCE module or the Ethernet card according to the message source pkt_src, forwards it to the SoftRoCE module when pkt_src is 0, and forwards it to the Ethernet card when pkt_src is 1; The second step is to initialize the RoCE network card transmission exception handling function test system 2.1 Initialize the configuration file According to the requirements of the RoCE network card transmission exception handling function test, the number of network packet loss types N, packet loss type type[i], and packet loss rate rate[i] of each packet loss type are written into the configuration file in order; 2.2 Install and deploy the RoCE network card driver, RoCE protocol stack, and RoCE application A on server A according to the instructions for using the RoCE network card; 2.3 Install and deploy the SoftRoCE module and RoCE application B on server B, and load the initialization module, message parsing module, transmission exception simulation module, and transmission exception configuration module; In the third step, the initialization module initializes the RoCE network card transmission exception handling function test system, the method is: 3.1 Read the number of packet loss types N from the configuration file, read the N packet loss types type[i] in sequence, and read the packet loss rates rate[i] of the N packet loss types in sequence; 3.2 Send N, type[i] and rate[i] to the transmission anomaly simulation module; In the fourth step, the message parsing module, transmission exception simulation module, transmission exception configuration module, server A, RoCE application A, server B, SoftRoCE module, and RoCE application B jointly complete the test of the RoCE network card network transmission exception handling function; the details are as follows: 4.1 The message parsing module is executed according to the methods described in 4.1.1-4.1.11: 4.1.1 Monitor the Ethernet card and SoftRoCE module: If a message arrives from the Ethernet card, go to 4.1.2; if a message arrives from the SoftRoCE module, go to 4.1.10; if no message arrives, go to 4.1.1 to continue monitoring; 4.1.2 Input Ethernet message pkt from Ethernet card, set pkt_src = 0; 4.1.3 Extract the network layer protocol type from the Ethernet message pkt according to the Ethernet message format; 4.1.4 Determine whether the network layer protocol type is IPv4 or IPv6: If not, go to 4.1.11; if it is IPv4, extract the IPv4 message ipv4_pkt from pkt, and go to 4.1.5; if it is IPv6, extract the IPv6 message ipv6_pkt from pkt, and go to 4.1.7; 4.1.5 Extract the transport layer protocol type from the IPv4 message ipv4_pkt according to the IPv4 message format; 4.1.6 Determine whether the transport layer protocol type is UDP: If it is UDP and the UDP destination port is 4791, extract the UDP message content udp_payload and go to 4.1.8; otherwise, go to 4.1.11; 4.1.7 Extract the transport layer protocol type from the IPv6 message ipv6_pkt according to the IPv6 message format, and go to 4.1.6; 4.1.8 Analyze the RoCE message type pkt_type of udp_payload according to the Infiniband protocol specification: if the message type is SEND, then pkt_type = 1; if the message type is READ, then pkt_type = 2; if the message type is WRITE, then pkt_type = 3; if the message type is ACK, then pkt_write = 4; if the message type is NACK, then pkt_type = 5; otherwise, pkt_type = 0; 4.1.9 Send pkt, pkt_src and pkt_type to the transmission anomaly simulation module and go to 4.1.1 to continue monitoring; 4.1.10 Input Ethernet message pkt from SoftRoCE module, set pkt_src=1, and go to 4.1.3; 4.1.11 Set the RoCE message type pkt_type to 0, and go to 4.1.9; 4.2 The transmission anomaly simulation module is executed according to the methods described in 4.2.1-4.2.9: 4.2.1 Initialize the 6-element message statistics array count[i], where count[i] represents the number of messages with pkt_type i, 0≤i≤5, and assign each element to 0; 4.2.2 Read the number N of network packet loss types from the transmission anomaly simulation parameter library, read the N packet loss types type[i] in sequence, and read the packet loss rates rate[i] of the N packet loss types in sequence; 4.2.3 Monitor the message parsing module. If an Ethernet message arrives, execute 4.2.

4. If no message arrives, go to 4.2.2 to continue monitoring. 4.2.4 Receive the Ethernet message pkt, the source pkt_src of pkt, and the RoCE message type pkt_type of pkt from the message parsing module; 4.2.5 According to the packet loss type array type[i], determine whether pkt_type is an element of type[i]. If not, go to 4.2.9; if yes, assume it is the pkt_ith element of type, go to 4.2.6; 4.2.6 Count the number of packets of type pkt_type, and set the packet statistics array count[pkt_type]+1; 4.2.7 Determine whether to discard the Ethernet message pkt based on its type, number of messages of this type, and packet loss rate; the method is: Calculate drop = count[pkt_type] * rate[pkt_i], and determine whether drop is greater than 1. If drop is greater than 1, it needs to be discarded, and go to 4.2.8; otherwise, it does not need to be discarded, and go to 4.2.9; 4.2.8 discards the message pkt, sets count[pkt_type]=0, and goes to 4.2.2 to continue monitoring; 4.2.9 If pkt_src is equal to 0, send pkt to the SoftRoCE module and go to 4.2.2 to continue monitoring; if pkt_src is equal to 1, send pkt to the Ethernet card and go to 4.2.2 to continue monitoring; 4.3 The transmission exception configuration module is executed according to the methods described in 4.3.1-4.3.7: 4.3.1 Read the number of network packet loss types N, packet loss type array type[i], and packet loss rate array rate[i] from the transmission anomaly simulation parameter library; 4.3.2 Monitor whether any user calls the transmission exception configuration module. If so, execute 4.3.

3. If not, go to 4.3.2 and continue monitoring. 4.3.3 Receive network packet loss type type1 and network packet loss rate rate1 from the user; 4.3.4 Determine whether type1 is an element of array type[i]. If not, go to 4.3.

5. If yes, assume it is the type_i-th element and go to 4.3.

7. 4.3.5 Let type[N]=type1, rate[N]=rate1, N=N+1; 4.3.6 Write N, type, and rate into the transmission anomaly simulation parameter library, and go to 4.3.2 to continue monitoring; 4.3.7 Set rate[type_i] = rate1, write rate into the transmission anomaly simulation parameter library, and go to 4.3.2 to continue monitoring; 4.4 Server A, RoCE application A, server B, SoftRoCE module, and RoCE application B are running normally.

2. The method for testing the RoCE network card transmission exception handling function according to claim 1, characterized in that: RoCE application A and RoCE application B are both open source RoCE test programs.

3. The method for testing the RoCE network card transmission exception handling function according to claim 1, characterized in that: The number of packet loss types N in transmission abnormality simulation is less than or equal to 6.

4. The method for testing the RoCE network card transmission exception handling function according to claim 1, characterized in that: Packet loss type 1≤type[i]≤5.

5. The method for testing the RoCE network card transmission exception handling function according to claim 1, characterized in that: Packet loss rate 0≤rate[i]≤1.

Citation Information

Cited By

  • RoCEv2 network card protocol stack direct connection test method and device

    CN121333978A