RoCE network card design method compatible with RoCE and UDP (User Datagram Protocol) applications

By designing a message judgment module in the RoCE network card and distinguishing RoCE messages with source port and destination port, the problem of poor compatibility between RoCE network and UDP application is solved, and better compatibility and network services are achieved.

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

Patent Information

Application Number
CN202411627274.3
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

The existing RoCE network has poor compatibility with UDP applications and cannot communicate normally, especially when UDP applications use destination port 4791.

Method used

By designing a message judgment module in the RoCE network card, combining the source port and the destination port to distinguish RoCE messages, instead of distinguishing methods based on the destination port only, the impact of RoCE network messages on the general UDP protocol application is reduced.

Benefits of technology

It realizes better compatibility between RoCE network and UDP applications, avoids compatibility issues caused by simply judging the destination port, and ensures that the network card can provide both normal RoCE network services and complete UDP network services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520643A_ABST
    Figure CN119520643A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer networks, and particularly relates to a RoCE and UDP (User Datagram Protocol) application compatible RoCE network card design method, which is realized by modifying an existing RoCE network card under the existing RoCE and UDP protocol specifications on the basis of the reality that the value ranges of a source port and a destination port which can be used by a universal UDP protocol application are limited to a certain extent. The method for distinguishing the RoCE messages according to the source port and the destination port at the same time is used for replacing a distinguishing method only according to the destination port, the influence of the RoCE network messages on the universal UDP protocol application is reduced, and better compatibility of the RoCE network to the UDP is achieved; according to the method, network cards in Ethernet and RoCE modes can be supported at the same time, RoCE network messages and normal Ethernet messages with UDP destination ports being 4791 are distinguished, and the network cards can provide normal RoCE network services and can also provide complete UDP network services.
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 RoCE (RDMA over Coverage Ethernet) network card design method which is compatible with RoCE and UDP applications. 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. Its 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 (Supplement to InfiniBandTM Architecture Specification Volume 1 Release 1.2.1 Annex A17: RoCEv2), RoCE network cards distinguish messages in the two modes by the destination port in the UDP message. If it is the UDP protocol and the UDP destination port is 4791, the message is a network message in the 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] For the design of network cards that support both Ethernet and RoCE modes, how to distinguish RoCE network messages from normal Ethernet messages with UDP destination port 4791 is a key technical issue in achieving compatibility between RoCE networks and UDP applications.

[0005] At present, the research on RoCE network mainly focuses on the implementation of RDMA network itself, such as protocol offloading, reliable transmission, congestion control and performance optimization, and there is less research on the compatibility of RoCE network and upper-layer UDP applications. For example, the RoUD (He Zhiqiang, Chen Yuxin, Hua Bei. RoUD: scalable RDMA over UD in lossy data center networks [C] / / Proceedings of the IEEE / ACM 23rd International Symposium on Cluster, Cloud Internet Computing. Bangalore, India: IEEE, 2023) proposed by the University of Science and Technology of China and the 1RMA (Singhvi A, Akella A, Gibson D, et al. 1RMA: re-envisioning remote memory access for multi-tenant datacenters [C] / / Proceedings of the Annual conference of the ACM Special Interest Group on Data Communication on the applications, technologies, architectures, protocols for computer communication. New York, NY, USA: Association for Computing Machinery, 2020) proposed by the University of Wisconsin-Madison will upload the reliable transmission function to the software transport layer; in terms of congestion control, Microsoft has made a breakthrough in the field of reliable transmission at the SIGCOMM DCQCN algorithm proposed in 2015 (Zhu Yibo, Eran H, Firestone D, et al. Congestioncontrol for large-scale RDMA deployments[C] / / Proceedings of the 2015ACMConference on Special Interest Group on Data Communication.New York, NY, USA: Association for Computing Machinery, 2015) has been applied in the design of some RoCE network cards; Nanjing University proposed the RET algorithm at ICNP 2022 (Tang Jian, Xu Tingting, Nguyen C, et al. Tuning target delay for RTT-based congestion control [C] / / Proceedings of the 2022 IEEE 30th International Conference on Network Protocols (ICNP). Lexington, KY, USA: IEEE, 2022); NVIDIA uses ML (machine learning) for congestion control based on RTT information (Fuhrer B, Shpigelman Y, Tessler C, et al. Implementing reinforcement learning data center congestion control in NVIDIA NICs [C] / / Proceedings of the 2023 IEEE / ACM 23rd International Symposium on Cluster, Cloud and Internet Computing (CCGrid). Bangalore, India: IEEE, 2022); In terms of performance optimization, in 2022, Huazhong University of Science and Technology combined RDMA technology to optimize the distributed block storage system Flame from three aspects: communication model, transmission strategy and RDMA resource management (Chen Sixin. Research on RDMA Communication Optimization in Distributed Block Storage System [D]. China: Huazhong University of Science and Technology, 2022); Microsoft Azure proposed to apply RDMA on both the front-end and back-end in NSDI2023 (Azure. Azure blockchain service [EB / OL]. [2024-03-19], https: / / azure.microsoft.com / en-us / services / blockchain-service / ) to optimize the performance of the storage system. .

[0006] In summary, there is no analysis or research on the compatibility of RoCE networks and UDP applications. Our actual test results on the RoCE network card of Mellanox CX-5 show that when UDP applications use destination port 4791, they cannot communicate normally.

[0007] How to be compatible with upper - layer UDP protocol applications while running the RoCE network is a technical problem that highly concerns those skilled in the art. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to propose a design method for a RoCE network card that is compatible with RoCE and UDP applications, so as to support network cards in both Ethernet and RoCE modes simultaneously, distinguish RoCE network packets from normal Ethernet packets with a UDP destination port of 4791, enabling the network card to provide both normal RoCE network services and complete UDP network services.

[0009] Aiming at the deficiencies in the implementation of existing RoCE network cards, under the existing RoCE and UDP protocol specifications, based on the fact that there are certain restrictions on the value ranges of source ports and destination ports that can be used by general UDP protocol applications, the present invention modifies the implementation of existing RoCE network cards to distinguish RoCE packets according to both source ports and destination ports instead of only according to destination ports, reducing the impact of RoCE network packets on general UDP protocol applications and achieving better compatibility of the RoCE network with UDP.

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

[0011] The first step is to construct a RoCE - UDP application compatibility system. This system runs on the RoCE network end - system and is deployed together with the RoCE network card and driver.

[0012] The RoCE - UDP application compatibility system consists of a source port configuration file, an initialization module, a source port library configuration module, a first source port library, a second source port library, a source port generation module, and a packet judgment module; among them, the source port configuration file is a file of the RoCE network card driver; the initialization module, the source port library configuration module, and the source port generation module are deployed as part of the RoCE network card driver during deployment; the first source port library exists in the RoCE network card driver as system memory; the second source port library exists inside the RoCE network card as network card memory; the packet judgment module is deployed inside the network card and works together with the RoCE network processing logic inside the network card;

[0013] The source port configuration file is used to store the number N of available source ports and the values sport_array[i] of the available source ports. N is a positive integer and N is greater than or equal to 3; i represents the i - th available source port, 0 < i < N, and the available source port values are: 512 ≤ sport_array[i] ≤ 1023;

[0014] The initialization module is connected to the source port configuration file, the first source port library, and the second source port library. When the RoCE network card driver is loaded, the initialization module reads the available source port number N and N source port values ​​from the source port configuration file, and writes the read source port number and all source port values ​​into the first source port library and the second source port library.

[0015] The first source port library exists in the RoCE network card driver, storing the number of available source ports N and N available source port values ​​sport_array1[i]. The second source port library exists in the RoCE network card hardware, storing the number of available source ports N and N available source port values ​​sport_array2[i].

[0016] The source port library configuration module is connected to the first source port library deployed on the RoCE network card driver and the second source port library deployed on the RoCE network card, and interacts with the user through the user interface. When the system is running, the source port library configuration module obtains the source port value to be added or deleted from the user and updates it to the first source port library and the second source port library.

[0017] The source port generation module is connected to the first source port library and the QP creation module in the RoCE network card driver. When the application creates a QP (Queue Pair, a queue pair established by both communicating parties in the RoCE network to complete communication) through the RoCE network card driver, the source port generation module is called by the QP creation module in the RoCE network card, and generates a source port for the QP according to the parameters flow_label and QP number qpn input when the RoCE application creates the QP and the available source ports in the first source port library, and the QP creation is subsequently completed by the QP creation module.

[0018] The message judgment module is connected to the second source port library and the external message receiving module and the RoCE processing module in the RoCE network card. The message judgment module receives the Ethernet message received by the network card from the external message receiving module, and judges whether the Ethernet message is a RoCE message according to the data in the second source port library. If it is a RoCE message, the message is sent to the RoCE processing module, and if it is not a RoCE message, the message is discarded.

[0019] The second step is to initialize the source port configuration file.

[0020] According to the actual network environment when the RoCE and UDP application compatibility system is applied, the number of available source ports N and the values ​​of N available source ports are written into the source port configuration file.

[0021] In the third step, the initialization module initializes the RoCE and UDP application compatibility system by:

[0022] 3.1 Read the number of available source ports N from the source port configuration file, and read N available source port values ​​sport_array[i] in sequence.

[0023] 3.2 Send sport_array[i] and N to the first source port library and the second source port library.

[0024] In the fourth step, the RoCE and UDP application compatibility system realizes the compatibility of RoCE network messages and UDP applications by generating and using special UDP source ports of RoCE network messages. This step is coordinated by the source port generation module, message judgment module, source port library configuration module, QP creation module, external message receiving module and RoCE processing module. The specific steps are as follows:

[0025] 4.1 The source port generation module is executed according to the method described in 4.1.1-4.1.10:

[0026] 4.1.1 Read the available source port quantity N and N available source port values ​​from the first source port library and store them in the array sport_array1[i].

[0027] 4.1.2 Monitor whether the QP creation module calls the source port generation module. If so, execute 4.1.3. If not, go to 4.1.2 to continue monitoring.

[0028] 4.1.3 Receive qpn and flow_label from QP creation module.

[0029] 4.1.4 Calculate the source port number num used by the QP created this time based on qpn and flow_label. The calculation method is:

[0030] 4.1.4.1 Get the last byte value of flow_label: dat_lo = flow_label | 0X000000FF;

[0031] 4.1.4.2 Get the second last byte value of qpn: dat_hi = qpn | 0X0000FF00;

[0032] 4.1.4.3 The above 2-byte combination value is used as the source port number used by QP: dat = dat_lo + dat_hi;

[0033] 4.1.4.4 When the value of dat is greater than the number of source ports N, the remainder of dat to N is taken as the serial number of the source port used by QP: num = dat% N;

[0034] 4.1.5 Take out sport_array1[num] from the first source port library.

[0035] 4.1.6 Return sport_array1[num] to the QP creation module.

[0036] 4.1.7 Go to 4.1.2 to continue monitoring.

[0037] 4.2 The message judgment module is executed according to the method described in 4.2.1-4.2.13:

[0038] 4.2.1 Read the number of available source ports N and N available source port values ​​from the second source port library and store them in the array sport_array2[i].

[0039] 4.2.2 Monitor whether the external message receiving module calls the message judgment module. If so, execute 4.2.3. If not, go to 4.2.2 to continue monitoring.

[0040] 4.2.3 Input the Ethernet message eth_packet received by the network card from the external message receiving module.

[0041] 4.2.4 Extract the network layer protocol type from eth_packet according to the Ethernet message format.

[0042] 4.2.5 Determine whether the network layer protocol type is IPv4 or IPv6. If not, go to 4.2.12; if it is IPv4, extract the IPv4 packet ipv4_packet from eth_packet, go to 4.2.6; if it is IPv6, extract the IPv6 packet ipv6_packet from eth_packet, go to 4.2.10;

[0043] 4.2.6 Extract the transport layer protocol type from ipv4_packet according to the IPv4 message format.

[0044] 4.2.7 Determine whether the transport layer protocol type is UDP. If not, go to 4.2.12; if yes, extract the UDP packet ipv4_udp_packet from ipv4_packet and go to 4.2.8.

[0045] 4.2.8 According to the UDP message format, extract the source port value sport and the destination port value dport from the UDP message, where sport is an element in the array sport_array.

[0046] 4.2.9 Determine whether dport is equal to 4791 (the destination port value defined in the RoCE network protocol) and whether sport is an element in the array sport_array2[i]. If yes, go to 4.2.12; if not, go to 4.2.13.

[0047] 4.2.10 Extract the transport layer protocol type from ipv6_packet according to the IPv6 message format.

[0048] 4.2.11 Determine whether the transport layer protocol type is UDP. If not, go to 4.2.12; if yes, extract the UDP packet ipv6_udp_packet from ipv6_packet and go to 4.2.8.

[0049] 4.2.12 Discard the Ethernet message eth_packet and go to 4.2.2 to continue monitoring the external message receiving module.

[0050] 4.2.13 Send the Ethernet message eth_packet to the RoCE processing module and go to 4.2.2 to continue monitoring the external message receiving module.

[0051] 4.3 The source port library configuration module is executed according to the methods described in 4.3.1-4.3.10:

[0052] 4.3.1 Monitor whether there is a user calling the source port library configuration module. If so, execute 4.3.2. If not, go to 4.3.1 and continue monitoring.

[0053] 4.3.2 Receive source port library configuration command from user. The command includes operation instruction and operand, the operation instruction is add or delete, and the operand is source port value sport1.

[0054] 4.3.3 Determine whether sport1 is within the range of [512,1023]. If not, go to 4.3.1 to continue monitoring; if yes, go to 4.3.4.

[0055] 4.3.4 If the source port library configuration command is "add", go to 4.3.5 to add available source ports to the first source port library and the second source port library; if the source port library configuration command is "delete", go to 4.3.8 to delete sport1 from the first source port library and the second source port library; otherwise, go to 4.3.1 to continue monitoring.

[0056] 4.3.5 Determine whether sport1 is an element in the available source port array sport_array1[i] in the first source port library. If yes, go to 4.3.1 to continue monitoring; if not, go to 4.3.6 to add an available source port to the first source port library.

[0057] 4.3.6 In the first available source port library, let sport_array1[N]=sport1, let N=N+1, go to 4.3.7, and add available source ports to the second source port library.

[0058] 4.3.7 In the second available source port library, set sport_array2[N] = sport1, and set N = N + 1. Complete the processing of the add source port command, go to 4.3.1, and continue monitoring.

[0059] 4.3.8 Determine whether sport1 is an element in the available source port array sport_array1[i] in the first source port library. If not, go to 4.3.1 to continue monitoring; if yes, go to 4.3.9 to delete sport1 from the first source port library.

[0060] 4.3.9 Find out the serial number N1 of sport1 in the available source port array in the first source port library (i.e. sport_array1[N1]=sport1, N1<N). If N1<N-2, then loop and assign sport_array1[i]=sport_array1[i+1], i=N1, N1+1, ..., N-2; if N1=N-1, set sport_array1[N1]=0. Set N=N-1, delete sport1 from the first source port library, and go to 4.3.10;

[0061] 4.3.10 Find out the serial number N1 of sport1 in the available source port array in the second source port library (i.e. sport_array2[N1]=sport1, N1<N). If N1<N-2, then loop and assign sport_array2[i]=sport_array2[i+1], i=N1, N1+1, ..., N-2; if N1=N-1, set sport_array2[N1]=0. Set N=N-1, delete sport1 from the second source port library, go to 4.3.1, and continue monitoring;

[0062] 4.4 The QP creation module monitors whether the application creates a QP. When the application creates a QP, it generates qpn and flow_label according to the RoCE network protocol, and uses them as parameters to call the source port generation module to obtain the source port number, and then uses the source port number to complete the QP creation according to the RoCE network protocol.

[0063] 4.5 The external message receiving module monitors the input end of the network card. When a RoCE message arrives on the network, it receives the RoCE message and sends the RoCE message to the multicast message parsing module.

[0064] 4.6 The RoCE processing module monitors the message judgment module and processes the input Ethernet message eth_packet according to the RoCE network protocol.

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

[0066] 1) In the first step of the present invention, a message judgment module is designed in the RoCE network card. In step 4.2, the work flow of the message judgment module is designed. The module judges whether it is a RoCE message according to the destination port and source port of the UDP message at the same time, which can reduce the compatibility problem with Ethernet UDP applications caused by the judgment method based solely on the destination port;

[0067] 2) The second step of the present invention specifies that the available source port value range is [512, 1023], which does not overlap with the source port value range of the Ethernet UDP application [1024, 65535]. Combined with the work flow of the message judgment module in step 4.2, the compatibility problem with the Ethernet UDP application caused by the existing implementation can be completely avoided;

[0068] 3) In step 4.3 of the present invention, the source port library configuration module enables the user to add or delete the source port used in the RoCE protocol according to the actual network environment, thereby improving the applicability of the application of the present invention;

[0069] 4) The present invention can be used to assist in the design of RoCE network cards to improve the compatibility of RoCE network cards with upper-layer Ethernet applications. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0071] Figure 2 It is a logical structure diagram of the RoCE and UDP application compatible system constructed in the first step of the present invention;

[0072] Figure 3 This is the flow chart of step 4.2 described in the fourth step of the present invention. DETAILED DESCRIPTION

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

[0074] Figure 1 This is the overall flow chart of the present invention. The present invention proposes a RoCE network card design method that is compatible with RoCE and UDP applications, which is divided into four major steps:

[0075] The first step is to build a RoCE and UDP application compatible system, which runs on the RoCE network end system and is deployed together with the RoCE network card and driver;

[0076] The second step is to initialize the source port configuration file: according to the actual network environment when the application compatible system is applied, the available source port number N and the N available source port values ​​are written into the source port configuration file;

[0077] Step 3: The initialization module initializes the RoCE and UDP application compatibility system;

[0078] Step 4: The RoCE and UDP application compatibility system realizes the compatibility between RoCE network packets and UDP applications by generating and using the UDP source ports of special RoCE network packets. This step is carried out in parallel by the source port generation module, the packet judgment module, the source port library configuration module, the QP creation module, the external packet receiving module, and the RoCE processing module.

[0079] Figure 2 It is the logical structure diagram of the RoCE network and UDP application compatibility system constructed in the first step of the present invention. The RoCE and UDP application compatibility system consists of a source port configuration file, an initialization module, a source port library configuration module, a first source port library, a second source port library, a source port generation module, and a packet judgment module; among them, the source port configuration file is a file of the RoCE network card driver; the initialization module, the source port library configuration module, and the source port generation module are deployed as part of the RoCE network card driver; the first source port library exists in the RoCE network card driver as system memory; the second source port library exists inside the RoCE network card as network card memory; the packet judgment module is deployed inside the network card and works together with the RoCE network processing logic inside the network card;

[0080] The source port configuration file is used to store the number N of available source ports and the values sport_array[i] of the available source ports. N is a positive integer and N is greater than or equal to 3; i represents the i-th available source port, 0 < i < N, and the value of the i-th available source port: 512 ≤ sport_array[i] ≤ 1023;

[0081] The initialization module is connected to the source port configuration file, the first source port library, and the second source port library. When the RoCE network card driver is loaded, the initialization module reads the number N of available source ports and the N source port values from the source port configuration file, and writes the read source port number and all source port values into the first source port library and the second source port library.

[0082] The first source port library exists in the RoCE network card driver and stores the number N of available source ports and the N available source port values sport_array1[i]; the second source port library exists in the RoCE network card hardware and stores the number N of available source ports and the N available source port values sport_array2[i].

[0083] The source port library configuration module is connected to the first source port library deployed on the RoCE network card driver and the second source port library deployed on the RoCE network card, and interacts with the user through the user interface. When the system is running, the source port library configuration module obtains the source port value to be added or deleted from the user and updates it to the first source port library and the second source port library.

[0084] The source port generation module is connected to the first source port library and the QP creation module in the RoCE network card driver. When the application creates a QP (Queue Pair, a queue pair established by both communicating parties in the RoCE network to complete communication) through the RoCE network card driver, the source port generation module is called by the QP creation module in the RoCE network card, and generates a source port for the QP according to flow_label (a parameter input when the RoCE application creates the QP) and qpn (the number of the QP) and the available source ports in the first source port library, and the QP creation module completes the QP creation later.

[0085] The message judgment module is connected to the second source port library and the external message receiving module and the RoCE processing module in the RoCE network card. The message judgment module receives the Ethernet message received by the network card from the external message receiving module, and judges whether the Ethernet message is a RoCE message according to the data in the second source port library. If it is a RoCE message, the message is sent to the RoCE processing module, and if it is not a RoCE message, the message is discarded.

[0086] Figure 3 This is the flowchart of step 4.2 described in the fourth step of the present invention. The message judgment module executes the method described in 4.2.1-4.2.13:

[0087] 4.2.1 Read the number of available source ports N and N available source port values ​​from the second source port library and store them in the array sport_array2[i].

[0088] 4.2.2 Monitor whether the external message receiving module calls the message judgment module. If so, execute 4.2.3. If not, go to 4.2.2 to continue monitoring.

[0089] 4.2.3 Input the Ethernet message eth_packet received by the network card from the external message receiving module.

[0090] 4.2.4 Extract the network layer protocol type from eth_packet according to the Ethernet message format.

[0091] 4.2.5 Determine whether the network layer protocol type is IPv4 or IPv6. If not, go to 4.2.12; if it is IPv4, extract the IPv4 packet ipv4_packet from eth_packet, go to 4.2.6; if it is IPv6, extract the IPv6 packet ipv6_packet from eth_packet, go to 4.2.10;

[0092] 4.2.6 Extract the transport layer protocol type from ipv4_packet according to the IPv4 message format.

[0093] 4.2.7 Determine whether the transport layer protocol type is UDP. If not, go to 4.2.12; if yes, extract the UDP packet ipv4_udp_packet from ipv4_packet and go to 4.2.8.

[0094] 4.2.8 According to the UDP message format, extract the source port value sport and the destination port value dport from the UDP message, where sport is an element in the array sport_array.

[0095] 4.2.9 Determine whether dport is equal to 4791 (the destination port value defined in the RoCE network protocol) and whether sport is an element in the array sport_array2[i]. If yes, go to 4.2.12; if not, go to 4.2.13.

[0096] 4.2.10 Extract the transport layer protocol type from ipv6_packet according to the IPv6 message format.

[0097] 4.2.11 Determine whether the transport layer protocol type is UDP. If not, go to 4.2.12; if yes, extract the UDP packet ipv6_udp_packet from ipv6_packet and go to 4.2.8.

[0098] 4.2.12 Discard the Ethernet message eth_packet and go to 4.2.2 to continue monitoring the external message receiving module.

[0099] 4.2.13 Send the Ethernet message eth_packet to the RoCE processing module and go to 4.2.2 to continue monitoring the external message receiving module.

[0100] The present invention is implemented by modifying the existing RoCE network card under the existing RoCE and UDP protocol specifications, so as to distinguish RoCE messages according to both the source port and the destination port instead of only distinguishing according to the destination port, which can largely solve the compatibility problem between the RoCE message and the UDP protocol.

Claims

1. A RoCE network card design method compatible with RoCE and UDP applications, characterized in that: The method is divided into the following steps: The first step is to build a RoCE and UDP application compatible system, which runs on the RoCE network end system and is deployed together with the RoCE network card and driver; The second step is to initialize the source port configuration file: According to the actual network environment when the application compatible system is applied, the available source port number N and the N available source port values ​​sport_array[i] are written into the source port configuration file; In the third step, the initialization module initializes the RoCE and UDP application compatibility system by: 3.1 Read the available source port number N from the source port configuration file, and read N available source port values ​​in sequence; 3.2 Send sport_array[i] and N to the first source port library and the second source port library; Step 4: The RoCE and UDP application compatibility system realizes the compatibility of RoCE network messages and UDP applications by generating and using the UDP source port of special RoCE network messages. This step is coordinated by the source port generation module, message judgment module, source port library configuration module, QP creation module, external message receiving module and RoCE processing module. The specific steps are as follows: 4.1 The source port generation module is executed according to the method described in 4.1.1-4.1.10: 4.1.1 Read the available source port quantity N and N available source port values ​​from the first source port library and store them in the array sport_array1[i]; 4.1.2 Monitor whether the QP creation module calls the source port generation module. If so, execute 4.1.

3. If not, go to 4.1.2 to continue monitoring. 4.1.3 Receive qpn and flow_label from the QP creation module; 4.1.4 Calculate the source port number num used by the QP created this time based on qpn and flow_label; 4.1.5 Take out sport_array1[num] from the first source port library; 4.1.6 Return sport_array1[num] to the QP creation module; 4.1.7 Go to 4.1.2 and continue monitoring; 4.2 The message judgment module is executed according to the method described in 4.2.1-4.2.13: 4.2.1 Read the available source port quantity N and N available source port values ​​from the second source port library and store them in the array sport_array2[i]; 4.2.2 Monitor whether the external message receiving module calls the message judgment module. If so, execute 4.2.

3. If not, go to 4.2.2 to continue monitoring. 4.2.3 Input the Ethernet message eth_packet received by the network card from the external message receiving module; 4.2.4 Extract the network layer protocol type from eth_packet according to the Ethernet message format; 4.2.5 Determine whether the network layer protocol type is IPv4 or IPv6; if not, go to 4.2.12; if it is IPv4, extract IPv4 packet ipv4_packet from eth_packet, go to 4.2.6; if it is IPv6, extract IPv6 packet ipv6_packet from eth_packet, go to 4.2.10; 4.2.6 Extract the transport layer protocol type from ipv4_packet according to the IPv4 message format; 4.2.7 Determine whether the transport layer protocol type is UDP; if not, go to 4.2.12; if yes, extract the UDP packet ipv4_udp_packet from ipv4_packet, and go to 4.2.8; 4.2.8 According to the UDP message format, extract the source port value sport and the destination port value dport from the UDP message, where sport is an element in the array sport_array; 4.2.9 Determine whether dport is equal to 4791 and whether sport is an element in the array sport_array2[i]; if so, go to 4.2.12; if not, go to 4.2.13; 4.2.10 Extract the transport layer protocol type from ipv6_packet according to the IPv6 message format; 4.2.11 Determine whether the transport layer protocol type is UDP; if not, go to 4.2.12; if yes, extract the UDP packet ipv6_udp_packet from ipv6_packet, go to 4.2.8; 4.2.12 Discard the Ethernet message eth_packet and go to 4.2.2 to continue monitoring the external message receiving module; 4.2.13 Send the Ethernet message eth_packet to the RoCE processing module, and go to 4.2.2 to continue monitoring the external message receiving module; 4.3 The source port library configuration module is executed according to the methods described in 4.3.1-4.3.10: 4.3.1 Monitor whether there is a user calling the source port library configuration module; if so, execute 4.3.2; if not, go to 4.3.1 and continue monitoring; 4.3.2 Receive a source port library configuration command from the user. The command includes an operation instruction and an operand. The operation instruction is add or delete, and the operand is the source port value sport1; 4.3.3 Determine whether sport1 is within the range of [512,1023]; if not, go to 4.3.1 to continue monitoring; if yes, go to 4.3.4; 4.3.4 If the source port library configuration command is "add", go to 4.3.5 to add available source ports to the first source port library and the second source port library; If the source port library configuration command is "delete", go to 4.3.8 and delete sport1 from the first source port library and the second source port library; Otherwise, go to 4.3.1 to continue monitoring; 4.3.5 Determine whether sport1 is an element in the available source port array sport_array1[i] in the first source port library; if so, go to 4.3.1 to continue monitoring; if not, go to 4.3.6 to add an available source port to the first source port library; 4.3.6 In the first available source port library, let sport_array1[N]=sport1, let N=N+1, go to 4.3.7, add available source ports to the second source port library; 4.3.7 In the second available source port library, set sport_array2[N]=sport1, set N=N+1, complete the processing of adding the source port command, go to 4.3.1, and continue monitoring; 4.3.8 Determine whether sport1 is an element in the available source port array sport_array1[i] in the first source port library; if not, go to 4.3.1 to continue monitoring; if yes, go to 4.3.9 to delete sport1 from the first source port library; 4.3.9 Find out the serial number N1 of sport1 in the available source port array in the first source port library. If N1<N-2, then loop and assign sport_array1[i]=sport_array1[i+1], i=N1, N1+1, ..., N-2; if N1=N-1, set sport_array1[N1]=0; set N=N-1, delete sport1 from the first source port library, and go to 4.3.10; 4.3.10 Find out the serial number N1 of sport1 in the available source port array in the second source port library. If N1<N-2, then loop and assign sport_array2[i]=sport_array2[i+1], i=N1, N1+1, ..., N-2; if N1=N-1, set sport_array2[N1]=0; set N=N-1, delete sport1 from the second source port library, go to 4.3.1, and continue monitoring; 4.4 The QP creation module monitors whether the application creates a QP; when the application creates a QP, it generates qpn and flow_label according to the RoCE network protocol, and uses these as parameters to call the source port generation module to obtain the source port number, and then uses the source port number to complete the QP creation according to the RoCE network protocol; 4.5 The external message receiving module monitors the input end of the network card. When a RoCE message arrives on the network, it receives the RoCE message and sends the RoCE message to the multicast message parsing module; 4.6 The RoCE processing module monitors the message judgment module and processes the input Ethernet message eth_packet according to the RoCE network protocol.

2. The RoCE network card design method compatible with RoCE and UDP applications according to claim 1, characterized in that: In the first step, the RoCE and UDP application compatible system is built as follows: The RoCE and UDP application compatible system consists of a source port configuration file, an initialization module, a source port library configuration module, a first source port library, a second source port library, a source port generation module and a message judgment module; wherein the source port configuration file is a file of the RoCE network card driver; The initialization module, source port library configuration module, and source port generation module are deployed as part of the RoCE network card driver; The first source port library exists in the RoCE network card driver as system memory; the second source port library exists inside the RoCE network card as network card memory; the message judgment module is deployed inside the network card and works with the RoCE network processing logic in the network card; The source port configuration file is used to store the number N of available source ports and the value sport_array[i] of available source ports, where N is a positive integer; i represents the i-th available source port, 0 represents the <i<N; The initialization module is connected to the source port configuration file, the first source port library, and the second source port library; when the RoCE network card driver is loaded, the initialization module reads the available source port number N and N source port values ​​from the source port configuration file, and writes the read source port number and all source port values ​​into the first source port library and the second source port library; The first source port library exists in the RoCE network card driver, storing the number of available source ports N and N available source port values ​​sport_array1[i]; the second source port library exists in the RoCE network card hardware, storing the number of available source ports N and N available source port values ​​sport_array2[i]; The source port library configuration module is connected to the first source port library deployed on the RoCE network card driver and the second source port library deployed on the RoCE network card, and interacts with the user through the user interface; when the system is running, the source port library configuration module obtains the source port value to be added or deleted from the user, and updates it to the first source port library and the second source port library; The source port generation module is connected to the first source port library and the QP creation module in the RoCE network card driver; when the application creates a queue pair QP established by the communicating parties in the RoCE network to complete the communication through the RoCE network card driver, the source port generation module is called by the QP creation module in the RoCE network card, and generates a source port for the QP according to the parameters flow_label and the QP number qpn input when the RoCE application creates the QP and the available source ports in the first source port library, and the QP creation is subsequently completed by the QP creation module; The message judgment module is connected to the second source port library and the external message receiving module and the RoCE processing module in the RoCE network card; the message judgment module receives the Ethernet message received by the network card from the external message receiving module, and judges whether the Ethernet message is a RoCE message according to the data in the second source port library. If it is a RoCE message, the message is sent to the RoCE processing module; if it is not a RoCE message, the message is discarded.

3. The RoCE network card design method compatible with RoCE and UDP applications according to claim 2, characterized in that: The number N of available source ports is greater than or equal to 3.

4. The RoCE network card design method compatible with RoCE and UDP applications according to claim 2, characterized in that: The value of the available source port: 512≤sport_array[i]≤1023.

5. The method for designing a RoCE network card compatible with RoCE and UDP applications according to any one of claims 1 to 4, characterized in that: In 4.1.4, the calculation method for calculating the source port number num used by the QP created this time is as follows based on qpn and flow_label: 4.1.4.1 Get the last byte value of flow_label: dat_lo = flow_label | 0X000000FF; 4.1.4.2 Get the second last byte value of qpn: dat_hi = qpn | 0X0000FF00; 4.1.4.3 The above 2-byte combination value is used as the source port number used by QP: dat = dat_lo + dat_hi; 4.1.4.4 When the dat value is greater than the number of source ports N, the remainder of dat to N is taken as the serial number of the source port used by QP: num = dat%N.