Load balancing method and system for RoCEv2 network, medium and electronic equipment

By using the GRE protocol and VLAN protocol to encapsulate GRE Key and VLAN identification in the RoCEv2 network, the problem of uneven ECMP routing load is solved, full utilization of links and low-latency lossless transmission are achieved, providing a high-quality foundation for network construction in the AI ​​era. facility.

CN118631741APending Publication Date: 2024-09-10XINGRONG METADATA TECH (SUZHOU) CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410738959.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The problem of uneven load of ECMP routes in RoCEv2 networks causes some paths to be overused and some paths to be idle, especially when transmitting massive data in AI and HPC networks, resulting in delays and low efficiency.

Method used

Use GRE protocol and VLAN protocol to encapsulate GRE Key and VLAN identifier into RoCEv2 messages, add a hash operation field, perform hash calculation through GRE Key and VLAN tag, determine the optimal routing path, avoid UDP source port number conflicts, and realize traffic flow Uniformity of distribution.

Benefits of technology

It ensures the full utilization of each link in the switch network, ensures low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios, and provides a more accessible, flexible and low-cost lossless Ethernet construction solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631741A
    Figure CN118631741A
Patent Text Reader

Abstract

The invention discloses a load balancing method and system for a RoCEv2 network, a medium and electronic equipment. The method comprises the steps that a switch receives a first RoCEv2 message which is sent by a sending end server and carries GRE Key and VLAN marks; the first RoCEv2 message is obtained by packaging a GRE Key and a VLAN identifier into a to-be-sent second RoCEv2 message by adopting a GRE protocol and a VLAN protocol, the GRE Key and the VLAN identifier are obtained by operating a local queue pair number and a destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshake and link establishment of a sending end server and a receiving end server; performing equivalent multipath routing according to the first RoCEv2 message to obtain an optimal routing path of the second RoCEv2 message; and the second RoCEv2 message is sent to the receiving end server through the optimal routing path. Therefore, by adopting the embodiment of the invention, each data transmission path can be fully utilized, and low-delay lossless transmission of mass data in an artificial intelligence and high-performance computing scene is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a load balancing method, system, medium and electronic device for a RoCEv2 network. Background Art

[0002] RoCEv2 (RDMA over Converged Ethernet version 2) is a network communication technology that allows remote direct memory access (RDMA) on a standard Ethernet infrastructure. RDMA is a direct memory-to-memory data transmission method that allows the network adapter to transfer data directly to the target computer's memory without the target host's CPU intervening in processing, which can significantly reduce network communication latency and improve data transmission efficiency.

[0003] In the related technology, the ECMP (Equal Cost Multi-Path) routing load of RoCEv2 messages is uneven when passing through the Ethernet network. The working principle of ECMP is that the switch can only hash through the traditional IP five-tuple, among which the most recognizable feature bit is only the UDP source port number (16 bits). However, the 16-bit UDP source port number has the possibility of conflict in large-scale implementation scenarios.

[0004] In AI (artificial intelligence) / HPC (high-performance computing) networks, many flows often share the same source and destination IP and port, which is especially common in large-scale deployments. At this time, the traditional IP five-tuple hashing method cannot effectively distinguish these flows, which will cause some paths to be overused while some paths are relatively idle, resulting in an imbalance. Summary of the invention

[0005] The embodiments of the present application provide a load balancing method, system, medium and electronic device for a RoCEv2 network. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to identify key / important components or describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a preface to the detailed description that follows.

[0006] In a first aspect, an embodiment of the present application provides a load balancing method for a RoCEv2 network, which is applied to a switch, and the method includes:

[0007] Receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; wherein the first RoCEv2 message is obtained by encapsulating the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent using the GRE protocol and the VLAN protocol, the GRE Key and the VLAN identifier are obtained by calculating the local queue pair number and the destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshaking and link establishment between the sending server and the receiving server;

[0008] Perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message;

[0009] The second RoCEv2 message is sent to the receiving server through the optimal routing path.

[0010] Optionally, performing equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message includes:

[0011] Decapsulate the first RoCEv2 message to obtain a second RoCEv2 message, routing parameters, an IP quintuple, a GRE Key, and a VLAN tag;

[0012] Query the routing path of the second RoCEv2 message according to the routing parameters and the preset MAC address table and routing table;

[0013] When there are multiple equal-cost paths in the routing path of the second RoCEv2 message, equal-cost multi-path selection is performed according to the IP quintuple, GREKey and VLAN tag to obtain the optimal routing path of the second RoCEv2 message.

[0014] Optionally, performing equal-cost multi-path selection according to the IP quintuple, the GRE Key, and the VLAN tag to obtain an optimal routing path for the second RoCEv2 message includes:

[0015] Perform hash calculation on the IP quintuple, GRE Key and VLAN tag to obtain a hash value;

[0016] Map the hash value to each routing path to obtain a mapping result of the hash value;

[0017] According to the mapping result of the hash value, an optimal routing path for the second RoCEv2 message is determined.

[0018] Optionally, the method further includes:

[0019] The obtained second RoCEv2 message is pushed to a preset priority queue.

[0020] In a second aspect, an embodiment of the present application provides a load balancing method for a RoCEv2 network, which is applied to a sending server, and the method includes:

[0021] Handshake and establish a link with the receiving server to obtain the local queue pair number and the destination queue pair number;

[0022] The local queue pair number and the destination queue pair number are calculated to obtain the GRE Key used for the GRE protocol and the VLAN ID used for the VLAN protocol;

[0023] The GRE Key and the VLAN tag are encapsulated into a second RoCEv2 message to be sent by using the GRE protocol and the VLAN protocol, so as to obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag;

[0024] Send the first RoCEv2 message to the switch.

[0025] Optionally, the local queue pair number and the destination queue pair number are operated to obtain a GREKey for the GRE protocol and a VLAN identifier for the VLAN protocol, including:

[0026] Inputting the local queue pair number and the destination queue pair number into a predefined summation function to perform a sum operation on the local queue pair number and the destination queue pair number to obtain a target sum;

[0027] Generate random numbers using a predefined random number generation function;

[0028] Perform hash operation on the target sum and the random number to obtain the operation result;

[0029] Perform a modulus operation on the operation result to obtain the final hash value;

[0030] The final hash value is divided according to a preset ratio to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol.

[0031] Optionally, before calculating the local queue pair number and the destination queue pair number, the following steps are further performed:

[0032] Receive a work request from a client, the work request carries a message identifier to be sent;

[0033] According to the message identifier to be sent, the corresponding message content is obtained from the mapping relationship between the message identifier and the message content stored in the memory;

[0034] The message content is encapsulated using the RoCEv2 network communication protocol to obtain a second RoCEv2 message to be sent.

[0035] In a third aspect, an embodiment of the present application provides a load balancing system for a RoCEv2 network, the system comprising:

[0036] Sending server, switch and receiving server;

[0037] The sending end server is used to shake hands and establish a link with the receiving end server to obtain a local queue pair number and a destination queue pair number; perform operations on the local queue pair number and the destination queue pair number to obtain a GREKey for the GRE protocol and a VLAN identifier for the VLAN protocol; use the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent, and obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag; send the first RoCEv2 message to the switch;

[0038] The switch is used to receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for a second RoCEv2 message; and send the second RoCEv2 message to a receiving server through the optimal routing path;

[0039] The receiving end server is used to receive the second RoCEv2 message sent by the switch; and write the message content into the memory according to the received second RoCEv2 message.

[0040] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0041] In a fifth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.

[0042] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0043] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0044] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0046] Figure 1 It is a flow chart of a load balancing method for a RoCEv2 network provided in an embodiment of the present application;

[0047] Figure 2 It is a schematic diagram of the fields of a traditional Hash scheme based on IP quintuple provided by this application and the fields of the Hash scheme described in this patent;

[0048] Figure 3 It is a flow chart of another load balancing method for RoCEv2 network provided by the present application;

[0049] Figure 4 This is a schematic diagram of an original message and an encapsulated message provided by the present application;

[0050] Figure 5 It is a structural diagram of a load balancing system for a RoCEv2 network provided by the present application;

[0051] Figure 6 It is a structural diagram of a load balancing system for a RoCEv2 network provided in an embodiment of the present application;

[0052] Figure 7It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following description and the accompanying drawings sufficiently illustrate specific embodiments of the present application to enable those skilled in the art to practice them.

[0054] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0055] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of systems and methods consistent with some aspects of the present application as detailed in the attached claims.

[0056] In the description of the present application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0057] The present application provides a load balancing method, system, medium and electronic device for RoCEv2 network to solve the problems existing in the above-mentioned related technical problems. In the embodiment of the present application, on the one hand, the present application adopts GRE protocol and VLAN protocol to encapsulate GRE Key and VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operation, thereby improving the uniformity of traffic distribution, and at the same time, GRE Key and VLAN tag can effectively avoid the uneven ECMP routing load caused by UDP source port number conflict, so that each link of the switch network can be fully utilized, ensuring low-latency lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not need to rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of general standards such as RFC and IEEE, a reasonable message encapsulation mechanism is introduced to achieve the balance of ECMP in RoCEv2 network, realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing network and provide high-quality network infrastructure solutions for network construction in the AI ​​era. The following exemplary embodiments are used for detailed description.

[0058] The following will be combined with the attached Figure 1 -Attached Figure 4 , a load balancing method for a RoCEv2 network provided in an embodiment of the present application is introduced in detail. The method can be implemented by a computer program and can be run on a load balancing system for a RoCEv2 network based on a von Neumann system. The computer program can be integrated into an application or run as an independent tool application.

[0059] See also Figure 1 , a flow chart of a load balancing method for a RoCEv2 network is provided for an embodiment of the present application, and is applied to a switch. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:

[0060] S101, receiving a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; wherein the first RoCEv2 message is obtained by encapsulating the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent using the GRE protocol and the VLAN protocol, the GRE Key and the VLAN identifier are obtained by calculating a local queue pair number and a destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshaking and link establishment between the sending server and the receiving server;

[0061] Among them, GRE Key is an optional field in the Generic Routing Encapsulation Protocol (GRE protocol), which is used to provide a simple tunnel traffic identification mechanism. The value range of GRE Key is 0 to 4294967295 (unsigned 32-bit integer). VLAN tag is VLAN (Virtual Local Area Network) tag, which is used to identify different messages in Ethernet frames.

[0062] Among them, GRE (Generic Routing Encapsulation) protocol and VLAN (Virtual Local Area Network) protocol are commonly used technologies in network communication. GRE is an encapsulation protocol that allows datagrams of one network layer protocol to be encapsulated in another network layer protocol. The purpose of this is to establish a communication tunnel between different network layer protocols so that the original data can be transmitted in different network environments. The key technology of the VLAN protocol is the IEEE 802.1Q standard, which inserts a 4-byte VLAN tag in the Ethernet frame to distinguish different VLANs.

[0063] Among them, the destination queue pair number (DQPN) is the QP number of the receiving server, that is, the destination of data transmission; the local queue pair number (LQPN) is the QP number of the device requested by the sending server, that is, the starting point of data transmission. Queue pair (QP), QP is the basic communication mechanism for identifying and managing RDMA sessions. Each QP consists of two queues: send queue (SQ) and receive queue (RQ).

[0064] In an embodiment of the present application, the switch needs to receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server.

[0065] S102, performing equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message;

[0066] In an embodiment of the present application, the specific process of performing equal-cost multi-path selection according to the first RoCEv2 message to obtain the optimal routing path of the second RoCEv2 message includes: decapsulating the first RoCEv2 message to obtain the second RoCEv2 message, routing parameters, IP quintuple, GRE Key and VLAN tag; querying the routing path of the second RoCEv2 message according to the routing parameters and the preset MAC address table and routing table; when there are multiple equal-cost paths in the routing path of the second RoCEv2 message, performing equal-cost multi-path selection according to the IP quintuple, GRE Key and VLAN tag to obtain the optimal routing path of the second RoCEv2 message.

[0067] Specifically, the specific process of performing equal-cost multi-path routing according to the IP quintuple, GRE Key and VLAN tag to obtain the optimal routing path of the second RoCEv2 message includes: performing hash calculation on the IP quintuple, GRE Key and VLAN tag to obtain a hash value; mapping the hash value to each routing path to obtain a mapping result of the hash value; and determining the optimal routing path of the second RoCEv2 message according to the mapping result of the hash value.

[0068] In some embodiments, the mapping result of the hash value is the gap between the hash value and the preset hash value on each path, and the routing path with the smallest gap can be selected as the optimal routing path for the second RoCEv2 message based on the size of the gap.

[0069] Specifically, the acquired second RoCEv2 message is pushed to a preset priority queue.

[0070] The MAC address table contains the MAC address associated with each port connected to the switch. The switch uses this table to decide how to forward packets between different devices within the local area network (LAN). The routing table determines the next hop address of the packet based on the IP address.

[0071] S103: Send the second RoCEv2 message to the receiving server through the optimal routing path.

[0072] In some embodiments, after obtaining the optimal routing path, the second RoCEv2 message can be sent to the receiving server via the optimal routing path.

[0073] In the embodiments of the present application, the traditional hash scheme based on IP quintuple cannot effectively distinguish these flows, resulting in some paths being overused while some paths being relatively idle, thus causing ECMP imbalance. The present application encapsulates additional message features for RoCEv2 messages, namely GRE Key and VLAN tag (VID). When the switch performs hash calculation, it can hash out a more random value due to the increase in hash factor. The fields of the traditional hash scheme based on IP quintuple and the fields of the hash scheme described in this patent are, for example, Figure 2 As shown in the figure, the switch has additional hash factors (GRE Key, VID) when performing ECMP, which ensures that the hash result has stronger randomness and ensures the uniform distribution of ECMP path selection.

[0074] Furthermore, after receiving the second RoCEv2 message, the receiving server sends a WR through the RDMA application, which is converted into a WQE (RQ) by the user-side driver and sent to the network card. The network card decapsulates the second RoCEv2 message received from the switch, extracts the memory address, key and other information, writes the message content to the corresponding memory address, and generates a CQE. The driver converts the CQE into a WC report to the local RDMA application, and the communication is completed.

[0075] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0076] See also Figure 3 , provides a flow chart of a load balancing method for a RoCEv2 network for an embodiment of the present application, which is applied to a sending end server. Figure 3 As shown, the method of the embodiment of the present application may include the following steps:

[0077] S201, handshake and establish a link with the receiving end server to obtain the local queue pair number and the destination queue pair number;

[0078] Among them, link establishment and handshake are very critical steps in RDMA communication, which ensure that the two network terminals can establish an efficient and direct memory-to-memory data transmission channel.

[0079] In some embodiments, before the RDMA communication begins, the sending server and the receiving server need to establish a network connection, which involves using a socket connection or establishing a connection through the InfiniBand connection manager (CM). During this process, the two parties will exchange some necessary information, such as verification information (VA-Virtual Address), the key (Key) used for RDMA operations, and the queue pair number (QPN-Queue Pair Number). Once the link is established, the communicating parties will perform a series of handshake processes, which usually include exchanging security parameters and negotiating connection characteristics. The handshake process may include authentication, negotiation of encryption protocols, and ensuring that the RDMA devices of both parties can understand and support RDMA operations. After the handshake is successful, the local queue pair number and the destination queue pair number are obtained.

[0080] S202, performing calculation on the local queue pair number and the destination queue pair number to obtain a GREKey for the GRE protocol and a VLAN identifier for the VLAN protocol;

[0081] In an embodiment of the present application, before calculating the local queue pair number and the destination queue pair number, it is also necessary to obtain a second RoCEv2 message to be sent, and the process includes: receiving a work request from a client, the work request carrying a message identifier to be sent; according to the message identifier to be sent, obtaining the corresponding message content from the mapping relationship between the message identifier and the message content stored in the memory; using the RoCEv2 network communication protocol to encapsulate the message content to obtain the second RoCEv2 message to be sent.

[0082] In some embodiments, the process of performing operations on the local queue pair number and the destination queue pair number to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol includes: inputting the local queue pair number and the destination queue pair number into a predefined summation function to perform a sum operation on the local queue pair number and the destination queue pair number to obtain a target sum; using a predefined random number generation function to generate a random number; performing a hash operation on the target sum and the random number to obtain an operation result; performing a modulus operation on the operation result to obtain a final hash value; dividing the final hash value according to a preset ratio to obtain the GRE Key for the GRE protocol and the VLAN identifier for the VLAN protocol.

[0083] The preset ratio is to use the first 32 bits of the final hash value as the GRE Key for the GRE protocol, and the last 12 bits as the VLAN identifier for the VLAN protocol.

[0084] Specifically, the calculation process involved is as follows:

[0085] def input_data(LQPN+DQPN), Prime_number=rendom();

[0086] Hash_value=(input_data*prime_number)%(max_value_44bit+1);

[0087] The above formula is explained as follows:

[0088] 1. Define a function input_data, reference the variables LQPN and DQPN, and then perform the sum operation on the two variables

[0089] 2. Define a prime number prime_number, which is a randomly generated prime number

[0090] 3. Hash input_date and prime_number, perform multiplication on them, and then take the modulus of max_value_44bit+1 to ensure that the hash result does not exceed 44 bits.

[0091] S203, using the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent, to obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag;

[0092] In the embodiment of the present application, after obtaining the GRE Key, the VLAN identifier, and the second RoCEv2 message to be sent, the GRE protocol and the VLAN protocol can be used to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent. For example, the comparison diagram of the second RoCEv2 message to be sent and the message encapsulating the GRE Key and the VLAN identifier is as follows: Figure 4 shown.

[0093] In the embodiment of the present application, the implementation of the standard solution only uses the 16-bit information of the UDP source port number to store the 48-bit QPN information, which not only loses 32 bits of information, but more importantly, the 16-bit space is small, and there is a greater possibility of hash conflicts. The method described in this article uses 44 bits to store the 48-bit QPN information, which greatly reduces the possibility of hash conflicts and ensures that each RDMA session has unique traffic characteristics at the level of message encapsulation.

[0094] S204: Send the first RoCEv2 message to the switch.

[0095] In an embodiment of the present application, the first RoCEv2 message may be sent to the switch.

[0096] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0097] See also Figure 5 , which shows a structural diagram of a load balancing system for a RoCEv2 network provided by an exemplary embodiment of the present application, the system includes a sending server, a switch and a receiving server; the sending server, the switch and the receiving server are communicatively connected.

[0098] The sending end server is used to shake hands and establish a link with the receiving end server to obtain a local queue pair number and a destination queue pair number; perform operations on the local queue pair number and the destination queue pair number to obtain a GREKey for the GRE protocol and a VLAN identifier for the VLAN protocol; use the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent, and obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag; send the first RoCEv2 message to the switch;

[0099] The switch is used to receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for a second RoCEv2 message; and send the second RoCEv2 message to a receiving server through the optimal routing path;

[0100] The receiving end server is used to receive the second RoCEv2 message sent by the switch; and write the message content into the memory according to the received second RoCEv2 message.

[0101] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0102] The following is a system embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the system embodiment of the present application, please refer to the method embodiment of the present application.

[0103] See also Figure 6, which shows a schematic diagram of the structure of a load balancing device for a RoCEv2 network provided by an exemplary embodiment of the present application. The load balancing system for a RoCEv2 network can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The system 1 includes a receiving module 10, a generating module 20, and a sending module 30.

[0104] The receiving module 10 is used to receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; wherein the first RoCEv2 message is obtained by encapsulating the GRE Key and the VLAN tag into a second RoCEv2 message to be sent using the GRE protocol and the VLAN protocol, the GRE Key and the VLAN tag are obtained by calculating the local queue pair number and the destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshaking and link establishment between the sending server and the receiving server;

[0105] A generating module 20, configured to perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message;

[0106] The sending module 30 is used to send the second RoCEv2 message to the receiving end server through the optimal routing path.

[0107] It should be noted that the load balancing system for RoCEv2 network provided in the above embodiment only uses the division of the above functional modules as an example when executing the load balancing method for RoCEv2 network. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the load balancing system for RoCEv2 network provided in the above embodiment and the load balancing method embodiment for RoCEv2 network belong to the same concept. The implementation process is detailed in the method embodiment, which will not be repeated here.

[0108] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0109] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0110] The present application also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implement the load balancing method for a RoCEv2 network provided in the above-mentioned various method embodiments.

[0111] The present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the load balancing method for a RoCEv2 network of the above-mentioned various method embodiments.

[0112] See also Figure 7 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .

[0113] The communication bus 1002 is used to realize the connection and communication between these components.

[0114] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.

[0115] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0116] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts within the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.

[0117] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may also be optionally at least one storage system located away from the aforementioned processor 1001. As Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a load balancing application for a RoCEv2 network.

[0118] exist Figure 7In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call the load balancing application for the RoCEv2 network stored in the memory 1005, and specifically perform the following operations:

[0119] Receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; wherein the first RoCEv2 message is obtained by encapsulating the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent using the GRE protocol and the VLAN protocol, the GRE Key and the VLAN identifier are obtained by calculating the local queue pair number and the destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshaking and link establishment between the sending server and the receiving server;

[0120] Perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message;

[0121] The second RoCEv2 message is sent to the receiving server through the optimal routing path.

[0122] In one embodiment, when the processor 1001 performs equal-cost multi-path selection according to the first RoCEv2 message to obtain the optimal routing path of the second RoCEv2 message, the processor 1001 specifically performs the following operations:

[0123] Decapsulate the first RoCEv2 message to obtain a second RoCEv2 message, routing parameters, an IP quintuple, a GRE Key, and a VLAN tag;

[0124] Query the routing path of the second RoCEv2 message according to the routing parameters and the preset MAC address table and routing table;

[0125] When there are multiple equal-cost paths in the routing path of the second RoCEv2 message, equal-cost multi-path selection is performed according to the IP quintuple, GREKey and VLAN tag to obtain the optimal routing path of the second RoCEv2 message.

[0126] In one embodiment, when the processor 1001 performs equal-cost multi-path selection according to the IP quintuple, the GRE Key, and the VLAN tag to obtain the optimal routing path for the second RoCEv2 message, the processor 1001 specifically performs the following operations:

[0127] Perform hash calculation on the IP quintuple, GRE Key and VLAN tag to obtain a hash value;

[0128] Map the hash value to each routing path to obtain a mapping result of the hash value;

[0129] According to the mapping result of the hash value, an optimal routing path for the second RoCEv2 message is determined.

[0130] In one embodiment, the processor 1001 further performs the following operations:

[0131] The obtained second RoCEv2 message is pushed to a preset priority queue.

[0132] Alternatively, the processor 1001 may be used to call a load balancing application for a RoCEv2 network stored in the memory 1005, and specifically perform the following operations:

[0133] Handshake and establish a link with the receiving server to obtain the local queue pair number and the destination queue pair number;

[0134] The local queue pair number and the destination queue pair number are calculated to obtain the GRE Key used for the GRE protocol and the VLAN ID used for the VLAN protocol;

[0135] The GRE Key and the VLAN tag are encapsulated into a second RoCEv2 message to be sent by using the GRE protocol and the VLAN protocol, so as to obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag;

[0136] Send the first RoCEv2 message to the switch.

[0137] In one embodiment, when the processor 1001 performs a calculation on the local queue pair number and the destination queue pair number to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol, the processor 1001 specifically performs the following operations:

[0138] Inputting the local queue pair number and the destination queue pair number into a predefined summation function to perform a sum operation on the local queue pair number and the destination queue pair number to obtain a target sum;

[0139] Generate random numbers using a predefined random number generation function;

[0140] Perform hash operation on the target sum and the random number to obtain the operation result;

[0141] Perform a modulus operation on the operation result to obtain the final hash value;

[0142] The final hash value is divided according to a preset ratio to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol.

[0143] In one embodiment, before executing the operation on the local queue pair number and the destination queue pair number, the processor 1001 further performs the following operations:

[0144] Receive a work request from a client, the work request carries a message identifier to be sent;

[0145] According to the message identifier to be sent, the corresponding message content is obtained from the mapping relationship between the message identifier and the message content stored in the memory;

[0146] The message content is encapsulated using the RoCEv2 network communication protocol to obtain a second RoCEv2 message to be sent.

[0147] In the embodiments of the present application, on the one hand, the present application adopts the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into the second RoCEv2 message to be sent, which can provide more fields for ECMP to perform hash operations, thereby improving the uniformity of traffic distribution. At the same time, the GRE Key and VLAN tags can effectively avoid the uneven ECMP routing load problem caused by the conflict of UDP source port numbers, so that each link of the switch network can be fully utilized, ensuring the low-latency and lossless transmission of massive data in artificial intelligence and high-performance computing scenarios; on the other hand, the present application does not rely on any dedicated hardware equipment and private protocol encapsulation. On the basis of the introduction of a reasonable message encapsulation mechanism, the ECMP balance of the RoCEv2 network is achieved, thereby realizing a more accessible, more flexible and lower-cost lossless Ethernet construction solution, which can effectively accelerate the construction of intelligent computing networks and provide high-quality network infrastructure solutions for network construction in the AI ​​era.

[0148] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program for load balancing of the RoCEv2 network can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program for load balancing of the RoCEv2 network can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0149] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A load balancing method for a RoCEv2 network, characterized in that: Applied to a switch, the method comprises: Receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending server; wherein the first RoCEv2 message is obtained by encapsulating the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent using the GRE protocol and the VLAN protocol, and the GRE Key and the VLAN identifier are obtained by calculating a local queue pair number and a destination queue pair number, and the local queue pair number and the destination queue pair number are obtained by handshaking and link establishment between the sending server and the receiving server; Perform equal-cost multi-path selection according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message; The second RoCEv2 message is sent to the receiving end server through the optimal routing path.

2. The method according to claim 1, characterized in that The performing equal-cost multi-path routing according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message includes: Decapsulate the first RoCEv2 message to obtain a second RoCEv2 message, routing parameters, an IP quintuple, a GRE Key, and a VLAN tag; Query the routing path of the second RoCEv2 message according to the routing parameters and the preset MAC address table and routing table; When there are multiple equal-cost paths in the routing path of the second RoCEv2 message, equal-cost multi-path selection is performed according to the IP quintuple, GRE Key and VLAN tag to obtain the optimal routing path of the second RoCEv2 message.

3. The method according to claim 2, characterized in that The performing equal-cost multi-path routing according to the IP quintuple, the GRE Key, and the VLAN tag to obtain the optimal routing path for the second RoCEv2 message includes: Performing hash calculation on the IP quintuple, GRE Key and VLAN tag to obtain a hash value; Mapping the hash value to each routing path to obtain a mapping result of the hash value; According to the mapping result of the hash value, an optimal routing path for the second RoCEv2 message is determined.

4. The method according to any one of claims 2 to 3, characterized in that: The method further comprises: The obtained second RoCEv2 message is pushed to a preset priority queue.

5. A load balancing method for a RoCEv2 network, characterized in that: Applied to a sending server, the method comprises: Handshake and establish a link with the receiving server to obtain the local queue pair number and the destination queue pair number; Performing calculation on the local queue pair number and the destination queue pair number to obtain a GRE Key for a GRE protocol and a VLAN identifier for a VLAN protocol; Encapsulating the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent by using the GRE protocol and the VLAN protocol, thereby obtaining a first RoCEv2 message carrying the GRE Key and the VLAN tag; Send the first RoCEv2 message to the switch.

6. The method according to claim 1, characterized in that The operating the local queue pair number and the destination queue pair number to obtain a GRE Key for a GRE protocol and a VLAN identifier for a VLAN protocol includes: Inputting the local queue pair number and the destination queue pair number into a predefined summation function to perform a sum operation on the local queue pair number and the destination queue pair number to obtain a target sum; Generate random numbers using a predefined random number generation function; Performing a hash operation on the target sum and the random number to obtain an operation result; Performing a modulo operation on the operation result to obtain a final hash value; The final hash value is divided according to a preset ratio to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol.

7. The method according to claim 1, characterized in that Before the operation on the local queue pair number and the destination queue pair number is performed, the method further includes: Receive a work request from a client, the work request carrying a message identifier to be sent; According to the message identifier to be sent, obtaining the corresponding message content from the mapping relationship between the message identifier and the message content stored in the memory; The message content is encapsulated using the RoCEv2 network communication protocol to obtain a second RoCEv2 message to be sent.

8. A load balancing system for a RoCEv2 network, characterized in that: The system comprises: Sending server, switch and receiving server; The sending end server is used to shake hands and establish a link with the receiving end server to obtain a local queue pair number and a destination queue pair number; perform operations on the local queue pair number and the destination queue pair number to obtain a GRE Key for the GRE protocol and a VLAN identifier for the VLAN protocol; use the GRE protocol and the VLAN protocol to encapsulate the GRE Key and the VLAN identifier into a second RoCEv2 message to be sent, and obtain a first RoCEv2 message carrying the GRE Key and the VLAN tag; send the first RoCEv2 message to the switch; The switch is used to receive a first RoCEv2 message carrying a GRE Key and a VLAN tag sent by a sending end server; perform equal cost multi-path routing according to the first RoCEv2 message to obtain an optimal routing path for the second RoCEv2 message; and send the second RoCEv2 message to the receiving end server through the optimal routing path; The receiving end server is used to receive the second RoCEv2 message sent by the switch; and write the message content into the memory according to the received second RoCEv2 message.

9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Traffic forwarding scheduling method and device

    CN119583435A

  • Method and equipment for planning equivalent multipath load sharing

    CN119945972A

  • Data transmission control method and system

    CN120017603A

  • A data transmission control method and system

    CN120017603B

  • Message processing method and device, computer equipment, readable storage medium and program product

    CN121486288A