Data transmission method and device, request end, response end and storage medium
By creating a primary QP and a backup QP in an RDMA connection and seamlessly switching to the backup QP when the primary QP fails, the problems of long fault recovery time and low connection reliability are solved, achieving fast fault recovery and reliable data transmission.
Patent Information
- Application Number
- CN202511206249.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-12-23
AI Technical Summary
In Remote Direct Memory Access (RDMA) communication, fault recovery time is long and connection reliability is low, especially when the number of retransmission failures exceeds a threshold, the queue pair (QP) is set to an error state, resulting in data transmission interruption.
When establishing an RDMA connection, a primary queue pair QP and a backup QP are created, and the information of the primary QP is synchronized to the backup QP. When an anomaly is detected in the primary QP, seamless switching to the backup QP is performed for data transmission by generating a switch notification message and switching the state.
It reduces connection failure recovery time, enhances the reliability of RDMA connections, and ensures the continuity of data transmission.
Smart Images

Figure CN121193753A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a data transmission method, apparatus, requesting end, responding end, and storage medium. Background Technology
[0002] In Remote Direct Memory Access (RDMA) communication, Reliable Connected (RC) ensures reliable data transmission through PSN (Packet Sequence Number), ACK (Acknowledgment), and retransmission mechanisms.
[0003] However, when a fault occurs, the RC connection will trigger a retransmission mechanism (such as Go-Back-N or Selective Repeat SR). If the number of retransmission failures exceeds the threshold, the RNIC (RDMA Network Interface Card) will set the QP (Queue Pair) to an error state. It may take a long time (e.g., more than 5ms) to restore the QP from the error state to the normal working state, which will cause data transmission interruption and reduce the reliability of the RDMA connection. Summary of the Invention
[0004] The data transmission method, apparatus, requesting end, responding end, and storage medium disclosed herein are intended to solve the technical problems of long fault recovery time and low connection reliability in the aforementioned methods.
[0005] According to a first aspect of the present disclosure, a data transmission method is provided, applied to a requesting end, comprising:
[0006] Send a Remote Direct Memory Access (RDMA) connection request to the responding end, and create a primary queue pair (QP) and a backup QP.
[0007] An RDMA connection is established between the primary QP and the response terminal, and the information of the primary QP is synchronized to the backup QP.
[0008] In response to the detection of an anomaly in the primary QP, the primary QP and the backup QP are switched in state;
[0009] A handover notification message is generated based on the configuration information of the backup QP, and the handover notification message is sent to the responding end.
[0010] The system receives confirmation information sent by the response end and performs data transmission with the response end based on the backup QP.
[0011] Optionally, in this embodiment of the disclosure, synchronizing the information of the primary QP to the backup QP includes:
[0012] When an RDMA connection is established with the response end, the first information of the primary QP is synchronized to the backup QP, wherein the first information includes at least one of queue pair number QPN, global identifier GID and maximum transmission unit MTU;
[0013] When data is transmitted with the response end via RDMA connection, the second information of the primary QP is synchronized to the backup QP through a target synchronization method, wherein the target synchronization method includes real-time incremental synchronization or periodic snapshots, and the second information includes at least one of the following:
[0014] Current data packet sequence number;
[0015] Unacknowledged data packets or unacknowledged job request descriptors (WQE);
[0016] Flow and congestion control parameters.
[0017] Optionally, in this embodiment of the disclosure, when the target synchronization method is real-time incremental synchronization, synchronizing the second information of the primary QP to the backup QP through the target synchronization method includes:
[0018] After the primary QP sends or receives data, it synchronizes the second information to the backup QP through shared memory or RDMA Write operation.
[0019] Optionally, in this embodiment of the disclosure, when the target synchronization method is a periodic snapshot, synchronizing the second information of the primary QP to the backup QP through the target synchronization method includes:
[0020] A state snapshot of the primary QP is periodically generated, and the second information of the primary QP is synchronized to the backup QP based on the state snapshot.
[0021] Optionally, in this embodiment of the disclosure, the step of switching the state of the primary QP and the backup QP in response to detecting an anomaly in the primary QP includes:
[0022] The response status of the main QP is monitored to detect whether the main QP is abnormal;
[0023] If an anomaly is detected in the main QP, the unfinished operations of the main QP are sealed, and the state of the main QP is switched to a non-primary state.
[0024] The state of the primary QP is fully synchronized to the backup QP, and the state of the backup QP is switched to the primary state after synchronization is completed.
[0025] Optionally, in this embodiment of the disclosure, monitoring the response status of the main QP and detecting whether the main QP is abnormal includes:
[0026] The unacknowledged data packet queue or bitmap of the primary QP is monitored. If the number of ACK retransmissions exceeds a first threshold, an anomaly is detected in the primary QP; and / or
[0027] The connection communication between the main QP and the response end is monitored by heartbeat detection. If the number of times the heartbeat response message sent by the response end is not received within a time threshold exceeds a second threshold, an anomaly is detected in the main QP.
[0028] Optionally, in this embodiment of the disclosure, the handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the backup QP, and the second configuration field is used to configure the GID of the backup QP.
[0029] Optionally, in this embodiment of the disclosure, the handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
[0030] Optionally, in this embodiment of the disclosure, the data transmission between the backup QP and the response end includes:
[0031] The target data packet in the main QP that needs to be retransmitted is determined based on the packet sequence number PSN;
[0032] The target data packet is transmitted to the response end via the backup QP.
[0033] Optionally, in this embodiment of the disclosure, the method further includes:
[0034] The primary QP is subjected to a fault recovery process and becomes a backup QP after it returns to normal.
[0035] According to a second aspect of the present disclosure, a data transmission method is provided, applied to a response end, comprising:
[0036] Receive the RDMA connection request sent by the requesting end;
[0037] An RDMA connection is established between the requesting end and the main QP of the requesting end.
[0038] Receive the handover notification message sent by the requesting end, and verify the handover notification message;
[0039] If the verification is successful, the target QP that establishes an RDMA connection with the requesting end will be updated to the backup QP in the handover notification message, and an acknowledgment message will be sent to the requesting end.
[0040] Optionally, in this embodiment of the disclosure, the handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the backup QP, and the second configuration field is used to configure the GID of the backup QP.
[0041] Optionally, in this embodiment of the disclosure, verifying the handover notification message includes:
[0042] If the indicated field is the first value, then the switching status is determined to be switched and the verification is successful.
[0043] Optionally, in this embodiment of the disclosure, the handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
[0044] Optionally, in this embodiment of the disclosure, verifying the handover notification message includes:
[0045] If the opcode field is the second value, then determine whether the third value in the third configuration field is the QPN of the main QP;
[0046] If it is determined that the third value in the third configuration field is the QPN of the main QP, then the verification is successful.
[0047] According to a third aspect of the present disclosure, a data transmission apparatus is provided, disposed at a requesting end, comprising:
[0048] The first receiving module is used to send an RDMA connection request to the responding end and create a primary queue pair (QP) and a backup QP.
[0049] The synchronization module is used to establish an RDMA connection between the primary QP and the response terminal, and to synchronize the information of the primary QP to the backup QP;
[0050] A switching module is used to switch the state of the primary QP and the backup QP in response to detecting an abnormality in the primary QP.
[0051] The sending module is used to generate a handover notification message based on the configuration information of the backup QP, and send the handover notification message to the responding end;
[0052] The second receiving module is used to receive the confirmation information sent by the responding end and to transmit data with the responding end based on the backup QP.
[0053] According to a fourth aspect of the present disclosure, a data transmission apparatus is provided, disposed at a response end, comprising:
[0054] The first sending module is used to receive RDMA connection requests sent by the requesting end;
[0055] Establishment module, used to establish an RDMA connection between the requesting end and the requesting end based on the main QP of the requesting end;
[0056] The verification module is used to receive the handover notification message sent by the requesting end and verify the handover notification message.
[0057] The second sending module is used to update the target QP that establishes an RDMA connection with the requesting end to the backup QP in the handover notification message if the verification is successful, and to send confirmation information to the requesting end.
[0058] According to a fifth aspect of the present disclosure, a request terminal is provided, comprising: a first processor and a first memory for storing a computer program capable of running on the processor, wherein the first processor, when running the computer program, performs the steps of the method described in any of the preceding first aspects.
[0059] According to a sixth aspect of the present disclosure, a response terminal is provided, comprising: a second processor and a second memory for storing a computer program capable of running on the processor, wherein the second processor, when running the computer program, performs the steps of the method described in any of the preceding second aspects.
[0060] According to a seventh aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, the computer storage medium storing computer-executable instructions; the computer-executable instructions, when executed by a processor, are capable of implementing the steps in the methods described in the first or second aspect.
[0061] According to an eighth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in the first or second aspect.
[0062] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0063] This disclosure discloses a data transmission method, apparatus, requesting end, responding end, and storage medium. The method includes sending an RDMA connection request to a responding end, creating a primary QP and a backup QP; establishing an RDMA connection with the responding end based on the primary QP, and synchronizing the information of the primary QP to the backup QP; switching the state of the primary QP and backup QP in response to detecting an anomaly in the primary QP; generating a switching notification message based on the configuration information of the backup QP, and sending the switching notification message to the responding end; receiving confirmation information sent by the responding end, and transmitting data with the responding end based on the backup QP. This disclosure embodiment creates a primary QP and a backup QP simultaneously when establishing an RDMA connection, and seamlessly switches to the backup QP for data transmission in the event of an anomaly in the primary QP, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0064] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0065] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0066] Figure 1 This is a schematic flowchart illustrating a data transmission method according to some embodiments of the present disclosure;
[0067] Figure 2 This is a schematic diagram illustrating the structure of a custom message according to some embodiments of this disclosure;
[0068] Figure 3 This is a schematic flowchart illustrating a data transmission method according to some embodiments of the present disclosure;
[0069] Figure 4 This is a schematic flowchart illustrating a data transmission method according to some embodiments of the present disclosure;
[0070] Figure 5 This is a schematic flowchart illustrating a data transmission apparatus according to some embodiments of the present disclosure;
[0071] Figure 6 This is a schematic flowchart illustrating a data transmission apparatus according to some embodiments of the present disclosure;
[0072] Figure 7 This is a schematic diagram of the structure of a request terminal according to some embodiments of the present disclosure;
[0073] Figure 8 This is a schematic diagram of the structure of a response terminal according to some embodiments of the present disclosure. Detailed Implementation
[0074] Some embodiments of this disclosure will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. Various changes, modifications, and equivalents of the methods, systems, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted.
[0075] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of systems and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0076] In related technologies, InfiniBand is a network protocol specifically designed for RDMA, ensuring the high throughput and low latency requirements of high-performance data center networks. InfiniBand can provide data transmission based on iWarp (Internet Wide-Area RDMA Protocol) based on TCP (Transmission Control Protocol) and RoCE (RDMA over Converged Ethernet) based on UDP (User Datagram Protocol). In IB network technology, RC ensures reliable data transmission through PSN, ACK acknowledgment, and retransmission mechanisms.
[0077] In RoCEv2 (RDMA over Converged Ethernet version 2) connection, the RC and UC modes establish a connection through QP and complete parameter exchange and state transition through CM (Communication Manager).
[0078] Specifically, the RoCEv2 RC QP setup process can include the following steps:
[0079] 1. The requesting and responding ends create CM IDs and bind them to local addresses;
[0080] 2. The requesting end starts listening for connection requests;
[0081] 3. The responding end parses the requesting end's address and initiates a connection request;
[0082] 4. The requesting end accepts the connection request, creates a QP, configures it to RTR state, and sends response information to the responding end;
[0083] 5. After receiving the response information, the response end configures QP to RTS state;
[0084] 6. Once the RDMA connection is established, both parties can begin RDMA operations.
[0085] In the connection establishment steps described above, the QP establishment of RC in RoCEv2 relies on the CM service to coordinate the exchange of QP parameters between the requesting and responding ends, and follows the state transition sequence (RESET→INIT→RTR→RTS), thereby ensuring the correctness of the underlying configuration of the reliable connection and laying the foundation for high-performance RDMA communication.
[0086] Furthermore, QP parameters can include QPN (Queue Pair Number), GID (Global Identifier), MTU (Maximum Transmission Unit), and service level. These QP parameters can be exchanged between the requesting and responding ends via CM messages, ensuring that the QP configurations on both sides are consistent.
[0087] Figure 1 This is a flowchart illustrating a data transmission method according to some embodiments of the present disclosure, applied to the requesting end, such as... Figure 1 As shown, the method may include the following steps:
[0088] Step 101: Send an RDMA connection request to the responding end to create a primary QP and a backup QP.
[0089] In this embodiment of the disclosure, the requesting end can be a server or a client that sends data.
[0090] In this embodiment of the disclosure, after sending an RDMA connection request to the responding end, the requesting end can create a primary QP and a backup QP, and establish an RDMA connection with the responding end based on the primary QP through CM messages.
[0091] In this embodiment of the disclosure, when creating the primary QP and the backup QP, the backup QP can dynamically load the Context information of the primary QP to the network card, thereby saving network card resources without having to occupy hardware resources separately.
[0092] Specifically, in this embodiment of the disclosure, when creating the primary QP, the Context information is fully configured to enable normal communication through the primary QP. The Context information may include queue depth, PSN table, and DMA (Direct Memory Access) memory mapping. When creating the backup QP, minimal resources (such as QPN and GID) can be allocated, and the complete Context information is not initialized. When communicating with the responding end through the backup QP, the Context information of the primary QP can be loaded into the hardware register of the backup QP, and the Context mapping of the primary QP can be removed, thus avoiding the need to occupy hardware resources separately and saving network card resources.
[0093] Furthermore, in this embodiment of the disclosure, the primary QP and the backup QP can be bound to different physical ports or network paths to avoid single points of failure and ensure the reliability of the RDMA connection.
[0094] In this embodiment of the disclosure, the primary QP and the backup QP can share storage, thereby persisting the QP context and ensuring that the data states corresponding to the primary QP and the backup QP are consistent after the switch.
[0095] Step 102: Establish an RDMA connection between the primary QP and the response end, and synchronize the information of the primary QP to the backup QP.
[0096] In this embodiment of the disclosure, after creating the primary QP and the backup QP, an RDMA connection can be established between the CM and the responding end based on the primary QP.
[0097] In this embodiment of the disclosure, after establishing an RDMA connection between the primary QP and the responding end, it is necessary to synchronize the information of the primary QP to the backup QP so that in the event of a failure of the primary QP, a seamless switch to the backup QP can be made for data transmission, thereby reducing the connection failure recovery time and enhancing the reliability of the RDMA connection.
[0098] In this embodiment of the disclosure, the timing of synchronizing the information of the primary QP to the backup QP is different, and the corresponding synchronization content and method are also different.
[0099] Specifically, in this embodiment of the disclosure, the method for synchronizing the information of the primary QP to the backup QP may include the following steps:
[0100] Step 1021: When an RDMA connection is established with the responder, the first information of the primary QP is synchronized to the backup QP.
[0101] In this real-time example, when the requesting end and the responding end establish an RDMA connection, the primary QP and the responding end do not transmit data at this time. Based on this, the first information of the primary QP can be synchronized to the backup QP.
[0102] In this embodiment of the disclosure, the first information may include at least one of QPN, GID and MTU.
[0103] Step 1022: When data is transmitted with the response end via RDMA connection, the second information of the primary QP is synchronized to the backup QP through target synchronization.
[0104] In this embodiment of the disclosure, when the requesting end and the responding end transmit data through an RDMA connection, the primary QP and the responding end transmit data. Based on this, it is necessary to synchronize the changed second information to the backup QP after each data transmission so that in the event of a failure of the primary QP, the data can be seamlessly switched to the backup QP to avoid data asynchrony.
[0105] In this embodiment of the disclosure, the second information may include at least one of the following:
[0106] Current data packet sequence number;
[0107] Unacknowledged data packets or unacknowledged WQEs (Work Queue Entry).
[0108] Flow and congestion control parameters.
[0109] In this embodiment of the disclosure, the current data packet sequence number can be a PSN (sequence number); an unacknowledged data packet can be a data packet that has not received an ACK; the flow and congestion control parameters can include at least one of the flow control window size and timeout retransmission parameters.
[0110] Furthermore, in this embodiment of the disclosure, the target synchronization method may include real-time incremental synchronization or periodic snapshots.
[0111] In this embodiment of the disclosure, the method of synchronizing the second information of the master QP to the backup QP by means of the target synchronization method is also different when the target synchronization method is different.
[0112] Specifically, in one embodiment of this disclosure, when the target synchronization method is real-time incremental synchronization, the method of synchronizing the second information of the primary QP to the backup QP through the target synchronization method may include: after the primary QP sends or receives data, synchronizing the second information to the backup QP through shared memory or RDMA Write operation.
[0113] In this embodiment of the disclosure, after the master QP sends or receives data, it writes the corresponding second information into the shared memory. The backup QP accesses the shared memory through polling and synchronizes the second information in the shared memory.
[0114] In this embodiment of the disclosure, after the primary QP sends or receives data, it writes the corresponding second information into the context storage area of the backup QP through an RDMA Write operation to complete the synchronization of the second information.
[0115] In this embodiment of the disclosure, when the second information of the primary QP is synchronized to the backup QP through real-time incremental synchronization, atomic operations (such as CAS) can be used to ensure the synchronization process, so as to avoid synchronization conflicts between multiple nodes.
[0116] In another embodiment of this disclosure, when the target synchronization method is periodic snapshot, the method for synchronizing the second information of the primary QP to the backup QP via the target synchronization method may include: periodically generating a state snapshot of the primary QP, and synchronizing the second information of the primary QP to the backup QP based on the state snapshot. The period can be set as needed, such as 10ms.
[0117] In this embodiment of the disclosure, the primary QP can write a state snapshot to the context storage area of the backup QP through an RDMA Write operation. The backup QP obtains the second information by parsing the state snapshot and updates it to maintain information synchronization with the primary QP.
[0118] Step 103: In response to the detection of an anomaly in the primary QP, switch the primary QP and the backup QP in a different state.
[0119] In this embodiment of the disclosure, after data transmission is performed between the primary QP and the response end, the primary QP can be monitored to detect whether the primary QP is abnormal. If an abnormality is detected in the primary QP, the primary QP and the backup QP are switched, so that data transmission is performed between the backup QP and the response end, thereby reducing the connection failure recovery time and enhancing the reliability of the RDMA connection.
[0120] In this embodiment of the disclosure, after switching the status of the primary QP and the backup QP, the backup QP can be used as the primary QP to transmit data with the response end, and the original primary QP can be used as the backup QP.
[0121] Step 104: Generate a handover notification message based on the configuration information of the standby QP, and send the handover notification message to the responding end.
[0122] In this embodiment of the disclosure, after the state switch between the primary QP and the backup QP is completed through the above steps, a switch notification message can be generated based on the configuration information of the backup QP and sent to the responding end.
[0123] In one embodiment of this disclosure, a standard CNP message can be extended to generate a handover notification message.
[0124] Specifically, in this embodiment of the disclosure, the CNP field in the standard CNP message can be expanded to generate a handover notification message. Specifically, in this embodiment of the disclosure, the target configuration field is expanded within the CNP field.
[0125] In this embodiment of the disclosure, the target configuration field may include an indication field, a first configuration field, and a second configuration field. The indication field can be used to indicate the switching state, the first configuration field can be used to configure the QPN of the standby QP, and the second configuration field is used to configure the GID of the standby QP. Furthermore, in this embodiment of the disclosure, the extended target configuration field may also include the original target configuration field.
[0126] Furthermore, in this embodiment of the disclosure, the indicator field can be uint8_t (unsigned integer type), and the indicator field can be 1 byte. In this embodiment of the disclosure, the switching state corresponding to the indicator field is different when the value in the indicator field is different. Specifically, in this embodiment of the disclosure, if the value in the indicator field is a first value, the switching state corresponding to the indicator field is determined to be switched; if the value in the indicator field is a value other than the first value, the switching state corresponding to the indicator field is determined to be not switched.
[0127] In this embodiment of the disclosure, the first value can be set as needed. For example, assuming the first value is 1, when the value in the indicator field is 1, it is determined that the primary QP and the backup QP need to be switched.
[0128] Furthermore, in this embodiment of the disclosure, the first configuration field can be uint32_t (precise-width unsigned integer type), and the second configuration field can be uint8_t, thereby ensuring byte alignment.
[0129] In another embodiment of this disclosure, a handover notification message can be generated based on a custom message.
[0130] Figure 2 This is a schematic diagram illustrating the structure of a custom message according to an embodiment of this disclosure. Figure 2 As shown, the custom message includes an Ethernet header, an IP header, a UDP header, a BTH (Base Transport Header) header, an IB Payload, an ICRC, and an FCS.
[0131] In this embodiment of the disclosure, the Ethernet header includes a destination MAC address, a source MAC address, and an EtherType field. The EtherType field can be used to identify whether the upper-layer protocol is an IP protocol, and when the EtherType field identifies the upper-layer protocol as an IP protocol, it can indicate that the next header is an IP header.
[0132] In this embodiment of the disclosure, the IP header and UDP header can be encapsulated using the RoCEv2 standard, with a corresponding destination port of 4791. Specifically, the value corresponding to the IP protocol number field in the IP header can identify that the data packet carries the UDP protocol. Furthermore, the dport field in the UDP header can identify that the next header is an InfiniBand BTH header.
[0133] In this embodiment of the disclosure, the BTH header may include an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field can be used to indicate QP switching, the third configuration field can be used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
[0134] In this embodiment of the disclosure, the opcode field can be uint8_t, and the opcode field can be 1 byte. Furthermore, the opcode field can be used to indicate QP switching, and when the opcode field is a second value, the operation corresponding to the opcode field is determined to be QP switching; and when the opcode field is another value, other operations corresponding to the opcode can also be determined.
[0135] Furthermore, in this embodiment of the disclosure, the aforementioned second value can be set as needed. For example, assuming the second value is 255, when the value in the indicator field is 255, it is determined that the primary QP and the backup QP need to be switched.
[0136] Furthermore, in this embodiment of the disclosure, the third configuration field can be uint32_t, the fourth configuration field can be uint32_t, and the fifth configuration field can be uint8_t, thereby ensuring byte alignment.
[0137] In this embodiment of the disclosure, when the operation corresponding to the operation code field is a QP switch, it can be determined whether the third value in the third configuration field is the same as the QPN of the current master QP. If it is determined that the third value in the third configuration field is the same as the QPN of the current master QP, then the QP switch operation corresponding to the operation code field is determined to be valid; otherwise, the QP switch operation corresponding to the operation code field is determined to be invalid, so as to complete the verification of the switch notification message.
[0138] Furthermore, in this embodiment of the disclosure, the BTH header may further include a checksum field, which can be a uint32_t and can be verified using a verification algorithm. The verification algorithm can be the CRC32 algorithm.
[0139] Furthermore, in this embodiment of the disclosure, the IB Payload can be left blank or carry additional information (such as a switching timestamp).
[0140] Furthermore, in this embodiment of the disclosure, the requesting end can implement the aforementioned handover notification message through IBTA standard extensions or proprietary options.
[0141] Furthermore, in this embodiment of the present disclosure, after the requesting end generates a handover notification message based on the configuration information of the standby QP, it can send the handover notification message to the responding end through the CM.
[0142] Step 105: Receive the confirmation information sent by the response end, and transmit data with the response end based on the backup QP.
[0143] In this embodiment, after sending a handover notification message to the responding end through the above steps and receiving the acknowledgment information (ACK information) sent by the responding end, it is determined that the handover between the primary QP and the backup QP is successful. At this time, an RDMA connection can be established between the backup QP and the responding end, and data transmission can be performed between the backup QP and the responding end. It should be noted that the RDMA connection based on the primary QP and the RDMA connection based on the backup QP are two independent connections.
[0144] In this embodiment of the disclosure, the method for data transmission between the backup QP and the response end may include the following steps:
[0145] Step 1051: Determine the target data packet in the primary QP that needs to be retransmitted based on PSN;
[0146] Step 1052: Transmit the target data packet to the responding end via the backup QP.
[0147] In this embodiment of the disclosure, the last confirmed data packet in the PSN can be determined as the target data packet through the PSN increment mechanism, thereby avoiding data packet loss.
[0148] In this embodiment of the disclosure, the backup QP transmits the target data packet to the response end, thereby restoring the transmission with the response end.
[0149] In this embodiment of the disclosure, the above method can also perform a fault recovery process on the original primary QP and serve as a backup QP after the original primary QP returns to normal.
[0150] Furthermore, in this embodiment of the disclosure, if the requesting end does not receive confirmation information from the responding end, a retransmission mechanism is triggered. The maximum number of retries in the retransmission mechanism is configurable, such as 3.
[0151] This disclosure proposes a data transmission method, which includes sending an RDMA connection request to a responding end, creating a primary QP and a backup QP; establishing an RDMA connection with the responding end based on the primary QP, and synchronizing the information of the primary QP to the backup QP; switching the state of the primary QP and backup QP in response to detecting a primary QP failure; generating a switchover notification message based on the configuration information of the backup QP, and sending the switchover notification message to the responding end; receiving confirmation information sent by the responding end, and transmitting data with the responding end based on the backup QP. The embodiments of this disclosure simultaneously create a primary QP and a backup QP when establishing an RDMA connection, and seamlessly switch to the backup QP for data transmission in the event of a primary QP failure, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0152] In this embodiment of the disclosure, as a detailed explanation of step 103, such as Figure 3 As shown, it may also include:
[0153] Step 301: Monitor the response status of the main QP and detect whether the main QP is abnormal.
[0154] In this embodiment of the disclosure, the method for monitoring the response status of the master QP and detecting whether the master QP is abnormal includes: monitoring the unacknowledged data packet queue or bitmap of the master QP, and if the number of ACK retransmissions exceeds a first threshold, the master QP is detected as abnormal; and / or, monitoring the connection communication between the master QP and the responding end through heartbeat detection, and if the number of times a heartbeat response message sent by the responding end is not received within a time threshold exceeds a second threshold, the master QP is detected as abnormal.
[0155] In this embodiment of the disclosure, unacknowledged data packets can be confirmed by the PSN bitmap, and the number of ACK retransmissions of unacknowledged data packets can be determined by the corresponding WQE. If the number of ACK retransmissions exceeds the first threshold, it indicates that the main QP has failed, and the main QP is detected as abnormal.
[0156] In this embodiment of the disclosure, the first threshold can be set as needed, such as 2.
[0157] In this embodiment of the disclosure, the time threshold can be set as needed, such as 2s; the second threshold can be set as needed, such as 3s.
[0158] Step 302: If an anomaly is detected in the main QP, the unfinished operations of the main QP are sealed, and the state of the main QP is switched to a non-primary state.
[0159] Step 303: Fully synchronize the status of the primary QP to the backup QP, and switch the status of the backup QP to the primary status after synchronization is complete.
[0160] In this embodiment of the disclosure, after sealing the incomplete operations of the primary QP through the above steps, the state of the primary QP can be fully synchronized to the secondary QP before the secondary QP is switched to the primary state, so as to ensure that the secondary QP and the primary QP remain completely consistent.
[0161] In this embodiment of the disclosure, after detecting an anomaly in the primary QP, the state of the primary QP and the state of the backup QP can be switched to complete the state switching between the primary QP and the backup QP. This allows for seamless switching to the backup QP for data transmission when the primary QP is faulty, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0162] Figure 4 This is a flowchart illustrating a data transmission method according to some embodiments of the present disclosure, applied to the response end, such as... Figure 4 As shown, the method may include the following steps:
[0163] Step 401: Receive the RDMA connection request sent by the requesting end.
[0164] Step 402: Establish an RDMA connection between the requesting client's master QP and the requesting client.
[0165] For details regarding steps 401 to 402, please refer to the detailed description in the above embodiments. This disclosure will not repeat the details here.
[0166] Step 403: Receive the handover notification message sent by the requesting end and verify the handover notification message.
[0167] In one embodiment of this disclosure, the handover notification message can be generated by extending a standard CNP message.
[0168] In this embodiment of the disclosure, the target configuration field in the handover notification message may include an indication field, a first configuration field, and a second configuration field. The indication field can be used to indicate the handover status, the first configuration field can be used to configure the QPN of the standby QP, and the second configuration field is used to configure the GID of the standby QP. Furthermore, in this embodiment of the disclosure, the extended target configuration field may also include the original target configuration field.
[0169] Furthermore, in this embodiment of the disclosure, the indicator field can be uint8_t (unsigned integer type), and the indicator field can be 1 byte. In this embodiment of the disclosure, the switching state corresponding to the indicator field is different when the value in the indicator field is different. Specifically, in this embodiment of the disclosure, if the value in the indicator field is a first value, the switching state corresponding to the indicator field is determined to be switched; if the value in the indicator field is a value other than the first value, the switching state corresponding to the indicator field is determined to be not switched.
[0170] In this embodiment of the disclosure, the first value can be set as needed. For example, assuming the first value is 1, when the value in the indicator field is 1, it is determined that the primary QP and the backup QP need to be switched.
[0171] Furthermore, in this embodiment of the disclosure, the first configuration field can be uint32_t (precise-width unsigned integer type), and the second configuration field can be uint8_t, thereby ensuring byte alignment.
[0172] In this embodiment of the disclosure, when the handover notification message is generated by extending the standard CNP message, the method for verifying the handover notification message may include: if the indication field is a first value, then the handover status is determined to be a handover and the verification is successful; otherwise, the verification fails.
[0173] In another embodiment of this disclosure, the aforementioned handover notification message may be generated based on a custom message.
[0174] In this embodiment of the disclosure, the custom message includes an Ethernet header, an IP header, a UDP header, a BTH header, an IBPayload, an ICRC, and an FCS.
[0175] In this embodiment of the disclosure, the Ethernet header includes a destination MAC address, a source MAC address, and an EtherType field. The EtherType field can be used to identify whether the upper-layer protocol is an IP protocol, and when the EtherType field identifies the upper-layer protocol as an IP protocol, it can indicate that the next header is an IP header.
[0176] In this embodiment of the disclosure, the IP header and UDP header can be encapsulated using the RoCEv2 standard, with a corresponding destination port of 4791. Specifically, the value corresponding to the IP protocol number field in the IP header can identify that the data packet carries the UDP protocol. Furthermore, the dport field in the UDP header can identify that the next header is an InfiniBand BTH header.
[0177] In this embodiment of the disclosure, the BTH header may include an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field can be used to indicate QP switching, the third configuration field can be used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
[0178] In this embodiment of the disclosure, the opcode field can be uint8_t, and the opcode field can be 1 byte. Furthermore, the opcode field can be used to indicate QP switching, and when the opcode field is a second value, the operation corresponding to the opcode field is determined to be QP switching; and when the opcode field is another value, other operations corresponding to the opcode can also be determined.
[0179] Furthermore, in this embodiment of the disclosure, the aforementioned second value can be set as needed. For example, assuming the second value is 255, when the value in the indicator field is 255, it is determined that the primary QP and the backup QP need to be switched.
[0180] Furthermore, in this embodiment of the disclosure, the third configuration field can be uint32_t, the fourth configuration field can be uint32_t, and the fifth configuration field can be uint8_t, thereby ensuring byte alignment.
[0181] In this embodiment of the disclosure, when the handover notification message is generated based on a custom message, the method for verifying the handover notification message may include: if the operation code field is a second value, then determining whether the third value in the third configuration field is the QPN of the primary QP; if it is determined that the third value in the third configuration field is the QPN of the primary QP, then the verification is successful.
[0182] Furthermore, in this embodiment of the present disclosure, the responding end can receive the handover notification message sent by the requesting end through the CM and verify the handover notification message.
[0183] Step 404: If the verification is successful, update the target QP that establishes an RDMA connection with the requesting end to the backup QP in the handover notification message, and send an acknowledgment message to the requesting end.
[0184] In this embodiment of the disclosure, if the verification is successful, the target QP that establishes an RDMA connection with the requesting end is updated to the backup QP in the handover notification message, and an ACK confirmation message is sent to the requesting end.
[0185] This disclosure proposes a data transmission method, which includes receiving an RDMA connection request sent by a requesting end; establishing an RDMA connection with the requesting end based on the primary QP of the requesting end; receiving a handover notification message sent by the requesting end and verifying the handover notification message; if the verification is successful, updating the target QP for establishing the RDMA connection with the requesting end to the backup QP in the handover notification message, and sending an acknowledgment message to the requesting end. In this embodiment, when establishing an RDMA connection, both a primary QP and a backup QP are created simultaneously, and in the event of a failure of the primary QP, seamless handover to the backup QP is performed for data transmission, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0186] Figure 5This is a data transmission apparatus illustrated according to some embodiments of the present disclosure, such as... Figure 5 As shown, the device may include:
[0187] The first receiving module 501 is used to send an RDMA connection request to the responding end and create a primary queue pair QP and a backup QP;
[0188] Synchronization module 502 is used to establish an RDMA connection between the primary QP and the response end, and to synchronize the information of the primary QP to the backup QP;
[0189] The switching module 503 is used to switch the status of the primary QP and the backup QP in response to the detection of an abnormality in the primary QP.
[0190] The sending module 504 is used to generate a handover notification message based on the configuration information of the standby QP and send the handover notification message to the responding end.
[0191] The second receiving module 505 is used to receive the confirmation information sent by the responding end and to transmit data with the responding end based on the backup QP.
[0192] In this embodiment of the disclosure, the synchronization module 502 is specifically used for:
[0193] When an RDMA connection is established with the responder, the first information of the primary QP is synchronized to the backup QP, wherein the first information includes at least one of the queue pair number QPN, global identifier GID and maximum transmission unit MTU.
[0194] When data is transmitted with the response end via RDMA connection, the second information of the primary QP is synchronized to the backup QP through a target synchronization method. This target synchronization method includes real-time incremental synchronization or periodic snapshots, and the second information includes at least one of the following:
[0195] Current data packet sequence number;
[0196] Unacknowledged data packets or unacknowledged WQE;
[0197] Flow and congestion control parameters.
[0198] Optionally, in this embodiment of the disclosure, the synchronization module 502 is further configured to:
[0199] After the primary QP sends or receives data, it synchronizes the second information to the backup QP through shared memory or RDMA write operations.
[0200] Optionally, in this embodiment of the disclosure, the synchronization module 502 is further configured to:
[0201] Periodically generate state snapshots of the primary QP, and synchronize the secondary information of the primary QP to the backup QP based on the state snapshots.
[0202] Optionally, in this embodiment of the disclosure, the switching module 503 is specifically used for:
[0203] Monitor the response status of the main QP and detect whether the main QP is abnormal;
[0204] If an anomaly is detected in the primary QP, the unfinished operations of the primary QP are sealed, and the state of the primary QP is switched to a non-primary state.
[0205] The state of the primary QP is fully synchronized to the backup QP, and the state of the backup QP is switched to the primary state after the synchronization is completed.
[0206] Optionally, in this embodiment of the disclosure, the switching module 503 is further configured to:
[0207] Monitor the unacknowledged packet queue or bitmap of the primary QP. If the number of ACK retransmissions exceeds a first threshold, a primary QP anomaly is detected; and / or
[0208] The connection communication between the main QP and the response end is monitored by heartbeat detection. If the number of times the heartbeat response message sent by the response end is not received within a time threshold exceeds a second threshold, an anomaly is detected in the main QP.
[0209] Optionally, in this embodiment of the present disclosure, the handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the standby QP, and the second configuration field is used to configure the GID of the standby QP.
[0210] Optionally, in this embodiment of the present disclosure, the aforementioned handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
[0211] Optionally, in this embodiment of the disclosure, the second receiving module 504 is specifically used for:
[0212] The target data packets in the main QP that need to be retransmitted are determined based on the PSN.
[0213] The target data packet is transmitted to the responding end via the backup QP.
[0214] Optionally, in this embodiment of the disclosure, the above-described apparatus is further used for:
[0215] Implement a fault recovery process for the primary QP, and use it as a backup QP after it returns to normal.
[0216] This disclosure discloses a data transmission apparatus, which includes sending an RDMA connection request to a responding end, creating a primary QP and a backup QP; establishing an RDMA connection with the responding end based on the primary QP, and synchronizing the information of the primary QP to the backup QP; switching the state of the primary QP and backup QP in response to detecting an anomaly in the primary QP; generating a switchover notification message based on the configuration information of the backup QP, and sending the switchover notification message to the responding end; receiving confirmation information sent by the responding end, and transmitting data with the responding end based on the backup QP. The embodiments of this disclosure simultaneously create a primary QP and a backup QP when establishing an RDMA connection, and seamlessly switch to the backup QP for data transmission in the event of an anomaly in the primary QP, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0217] Figure 6 This is a data transmission apparatus illustrated according to some embodiments of the present disclosure, such as... Figure 6 As shown, the device may include:
[0218] The first sending module 601 is used to receive the RDMA connection request sent by the requesting end;
[0219] Establishment module 602 is used to establish an RDMA connection between the requesting end's master QP and the requesting end;
[0220] The verification module 603 is used to receive the handover notification message sent by the requesting end and verify the handover notification message;
[0221] The second sending module 604 is used to update the target QP that establishes an RDMA connection with the requesting end to the backup QP in the handover notification message if the verification is successful, and to send confirmation information to the requesting end.
[0222] In this embodiment of the disclosure, the handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the backup QP, and the second configuration field is used to configure the GID of the backup QP.
[0223] Optionally, in this embodiment of the disclosure, the verification module 603 is specifically used for:
[0224] If the indicator field is the first value, then the switching status is determined to be switched and the verification is successful.
[0225] Optionally, in this embodiment of the disclosure, the handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the standby QP, and the fifth configuration field is used to configure the GID of the standby QP.
[0226] Optionally, in this embodiment of the disclosure, the verification module 603 is further configured to:
[0227] If the opcode field is the second value, then determine whether the third value in the third configuration field is the QPN of the main QP;
[0228] If the third value in the third configuration field is determined to be the QPN of the primary QP, then the verification passes.
[0229] This disclosure discloses a data transmission apparatus, which includes receiving an RDMA connection request sent by a requesting end; establishing an RDMA connection with the requesting end based on the primary QP of the requesting end; receiving a handover notification message sent by the requesting end and verifying the handover notification message; if the verification is successful, updating the target QP for establishing the RDMA connection with the requesting end to the backup QP in the handover notification message, and sending an acknowledgment message to the requesting end. In this embodiment, when establishing an RDMA connection, both a primary QP and a backup QP are created simultaneously, and in the event of a failure of the primary QP, seamless handover to the backup QP for data transmission is performed, reducing connection failure recovery time and enhancing the reliability of the RDMA connection.
[0230] Based on the hardware implementation of the above program modules, and in order to implement the request-side method of this disclosure embodiment, this disclosure embodiment also provides a request-side, such as... Figure 7 As shown, the requesting terminal 700 includes:
[0231] The first communication interface 701 is capable of exchanging information with other devices (such as the responder);
[0232] The first processor 702 is connected to the first communication interface 701 to enable information interaction with other devices and to execute the methods provided by one or more technical solutions on the requesting end when running a computer program.
[0233] The computer program is stored in the first memory 703.
[0234] Specifically, the first processor 702 is used for:
[0235] In conjunction with the first communication interface 701, a Remote Direct Memory Access (RDMA) connection request is sent to the responding end to create a primary queue pair (QP) and a backup QP; an RDMA connection is established between the primary QP and the responding end, and the information of the primary QP is synchronized to the backup QP; in response to the detection of an anomaly in the primary QP, a state switch is performed between the primary QP and the backup QP; a switchover notification message is generated based on the configuration information of the backup QP and sent to the responding end; an acknowledgment message is received from the responding end, and data is transmitted between the backup QP and the responding end.
[0236] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0237] When an RDMA connection is established with the responder, the first information of the primary QP is synchronized to the backup QP, wherein the first information includes at least one of the queue pair number QPN, global identifier GID and maximum transmission unit MTU.
[0238] When data is transmitted with the response end via RDMA connection, the second information of the primary QP is synchronized to the backup QP through a target synchronization method. This target synchronization method includes real-time incremental synchronization or periodic snapshots, and the second information includes at least one of the following:
[0239] Current data packet sequence number;
[0240] Unacknowledged data packets or unacknowledged job request descriptors (WQE);
[0241] Flow and congestion control parameters.
[0242] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0243] After the primary QP sends or receives data, it synchronizes the second information to the backup QP through shared memory or RDMA write operations.
[0244] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0245] Periodically generate state snapshots of the primary QP, and synchronize the secondary information of the primary QP to the backup QP based on the state snapshots.
[0246] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0247] Monitor the response status of the main QP and detect whether the main QP is abnormal;
[0248] If an anomaly is detected in the primary QP, the unfinished operations of the primary QP are sealed, and the state of the primary QP is switched to a non-primary state.
[0249] The state of the primary QP is fully synchronized to the backup QP, and the state of the backup QP is switched to the primary state after the synchronization is completed.
[0250] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0251] Monitor the unacknowledged packet queue or bitmap of the primary QP. If the number of ACK retransmissions exceeds a first threshold, a primary QP anomaly is detected; and / or
[0252] The connection communication between the main QP and the response end is monitored by heartbeat detection. If the number of times the heartbeat response message sent by the response end is not received within a time threshold exceeds a second threshold, an anomaly is detected in the main QP.
[0253] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0254] The target data packet in the main QP that needs to be retransmitted is determined based on the packet sequence number PSN.
[0255] The target data packet is transmitted to the responding end via the backup QP.
[0256] In this embodiment of the disclosure, the first processor 702 is specifically used for:
[0257] Implement a fault recovery process for the primary QP, and use it as a backup QP after it returns to normal.
[0258] It should be noted that the specific processing procedures of the first processor 702 and the first communication interface 701 can be understood by referring to the above method.
[0259] In practical applications, the various components in the requesting end 700 are coupled together through the bus system 704. It can be understood that the bus system 704 is used to implement communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 7 The general designated all buses as Bus System 704.
[0260] The first memory 703 in this embodiment of the present disclosure is used to store various types of data to support the operation of the requesting end 700. Examples of such data include any computer program used to operate on the requesting end 700.
[0261] The methods disclosed in the above embodiments of this disclosure can be applied to, or implemented by, the first processor 702. The first processor 702 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware or by instructions in software form within the first processor 702. The first processor 702 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 702 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically a first memory 703. The first processor 702 reads information from the first memory 703 and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0262] In an exemplary embodiment, the requesting terminal 700 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0263] Based on the hardware implementation of the above program modules, and in order to implement the method on the response side of the embodiments of this application, the embodiments of this application also provide a response terminal, such as... Figure 8 As shown, the response terminal 800 includes:
[0264] The second communication interface 801 is capable of exchanging information with other devices (such as the requesting end);
[0265] The second processor 802 is connected to the second communication interface 801 to enable information exchange with the requesting end.
[0266] When running a computer program, the method provided by one or more technical solutions on the response side is executed;
[0267] The computer program is stored in the second memory 803.
[0268] Specifically, the second communication interface 801 mentioned above is used to: receive an RDMA connection request sent by the requesting end;
[0269] The second processor 802 is configured to: establish an RDMA connection between the primary QP of the requesting end and the requesting end; receive a handover notification message sent by the requesting end and verify the handover notification message; if the verification is successful, update the target QP that has established an RDMA connection with the requesting end to the backup QP in the handover notification message.
[0270] The aforementioned second communication interface 801 is also used to send confirmation information to the requesting end.
[0271] In this embodiment of the disclosure, the handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the standby QP, and the second configuration field is used to configure the GID of the standby QP.
[0272] In this embodiment of the disclosure, when the handover notification message includes a target configuration field, the second processor 802 is specifically used to: if the indication field is a first value, determine that the handover status is a handover and verify that the handover is successful.
[0273] In this embodiment of the disclosure, the handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the standby QP, and the fifth configuration field is used to configure the GID of the standby QP.
[0274] In this embodiment of the disclosure, when the handover notification message includes a BTH header, the second processor 802 is specifically configured to: if the opcode field is a second value, determine whether the third value in the third configuration field is the QPN of the primary QP; if it is determined that the third value in the third configuration field is the QPN of the primary QP, then the verification is successful.
[0275] It should be noted that the specific processing procedures of the second processor 802 and the second communication interface 801 can be understood by referring to the above method.
[0276] In practical applications, the various components in the response terminal 800 are coupled together through the bus system 804. It can be understood that the bus system 804 is used to implement communication between these components. In addition to the data bus, the bus system 804 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general labeled all buses as Bus System 804.
[0277] The second memory 803 in this embodiment of the disclosure is used to store various types of data to support the operation of the response terminal 800. Examples of such data include any computer program used to operate on the response terminal 800.
[0278] The methods disclosed in the above embodiments can be applied to, or implemented by, the second processor 802. The second processor 802 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware or by instructions in software form within the second processor 802. The second processor 802 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The second processor 802 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically a second memory 803. The second processor 802 reads information from the second memory 803 and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0279] In an exemplary embodiment, the response terminal 800 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.
[0280] It is understood that the memories (first memory 703, second memory 803) in the embodiments of this disclosure can be volatile memories or non-volatile memories, or both. Non-volatile memories can be read-only memories (ROM), programmable read-only memories (PROM), erasable programmable read-only memories (EPROM), electrically erasable programmable read-only memories (EEPROM), magnetic random access memories (FRAM), flash memories, magnetic surface memories, optical discs, or compact disc read-only memories (CD-ROM); magnetic surface memories can be disk storage or magnetic tape storage. Volatile memories can be random access memories (RAM), which are used as external caches. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this disclosure are intended to include, but are not limited to, these and any other suitable types of memories.
[0281] In exemplary embodiments, this disclosure also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium. For example, it may include a first memory 703 storing a computer program, which can be executed by a first processor 702 of a requesting end 700 to complete the steps described in the aforementioned requesting end method. Another example is a second memory 803 storing a computer program, which can be executed by a second processor 802 of a responding end 800 to complete the steps described in the aforementioned responding end method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0282] In an exemplary embodiment, this disclosure also provides a computer program product, including a computer program that can be executed by a first processor 702 of a requesting end 700 to complete the steps of the aforementioned requesting end-side method, or the computer program can be executed by a second processor 802 of a responding end 800 to complete the steps of the aforementioned responding end-side method.
[0283] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0284] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data transmission method, characterized in that, Applied to the requesting end, including: Send a Remote Direct Memory Access (RDMA) connection request to the responding end, and create a primary queue pair (QP) and a backup QP. An RDMA connection is established between the primary QP and the response terminal, and the information of the primary QP is synchronized to the backup QP. In response to the detection of an anomaly in the primary QP, the primary QP and the backup QP are switched in state; A handover notification message is generated based on the configuration information of the backup QP, and the handover notification message is sent to the responding end. The system receives confirmation information sent by the response end and performs data transmission with the response end based on the backup QP.
2. The method as described in claim 1, characterized in that, The step of synchronizing the information of the primary QP to the backup QP includes: When an RDMA connection is established with the response end, the first information of the primary QP is synchronized to the backup QP, wherein the first information includes at least one of queue pair number QPN, global identifier GID and maximum transmission unit MTU; When data is transmitted with the response end via RDMA connection, the second information of the primary QP is synchronized to the backup QP through a target synchronization method, wherein the target synchronization method includes real-time incremental synchronization or periodic snapshots, and the second information includes at least one of the following: Current data packet sequence number; Unacknowledged data packets or unacknowledged job request descriptors (WQE); Flow and congestion control parameters.
3. The method as described in claim 2, characterized in that, When the target synchronization method is real-time incremental synchronization, the step of synchronizing the second information of the primary QP to the backup QP through the target synchronization method includes: After the primary QP sends or receives data, it synchronizes the second information to the backup QP through shared memory or RDMA Write operation.
4. The method as described in claim 2, characterized in that, When the target synchronization method is a periodic snapshot, synchronizing the second information of the primary QP to the backup QP via the target synchronization method includes: A state snapshot of the primary QP is periodically generated, and the second information of the primary QP is synchronized to the backup QP based on the state snapshot.
5. The method as described in claim 1, characterized in that, The step of switching the state of the primary QP and the backup QP in response to detecting an anomaly in the primary QP includes: The response status of the main QP is monitored to detect whether the main QP is abnormal; If an anomaly is detected in the main QP, the unfinished operations of the main QP are sealed, and the state of the main QP is switched to a non-primary state. The state of the primary QP is fully synchronized to the backup QP, and the state of the backup QP is switched to the primary state after synchronization is completed.
6. The method as described in claim 5, characterized in that, The monitoring of the response status of the main QP and the detection of whether the main QP is abnormal include: The unacknowledged data packet queue or bitmap of the primary QP is monitored. If the number of ACK retransmissions exceeds a first threshold, an anomaly is detected in the primary QP; and / or The connection communication between the main QP and the response end is monitored by heartbeat detection. If the number of times the heartbeat response message sent by the response end is not received within a time threshold exceeds a second threshold, an anomaly is detected in the main QP.
7. The method as described in claim 1, characterized in that, The handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the backup QP, and the second configuration field is used to configure the GID of the backup QP.
8. The method as described in claim 1, characterized in that, The handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
9. The method as described in claim 1, characterized in that, The data transmission between the backup QP and the response end includes: The target data packet in the main QP that needs to be retransmitted is determined based on the packet sequence number PSN; The target data packet is transmitted to the response end via the backup QP.
10. The method as described in claim 1, characterized in that, The method further includes: The primary QP is subjected to a fault recovery process and becomes a backup QP after it returns to normal.
11. A data transmission method, characterized in that, Applied to the response end, including: Receive the RDMA connection request sent by the requesting end; An RDMA connection is established between the requesting end and the main QP of the requesting end. Receive the handover notification message sent by the requesting end, and verify the handover notification message; If the verification is successful, the target QP that establishes an RDMA connection with the requesting end will be updated to the backup QP in the handover notification message, and an acknowledgment message will be sent to the requesting end.
12. The method as described in claim 11, characterized in that, The handover notification message includes a target configuration field, which includes an indication field, a first configuration field, and a second configuration field. The indication field is used to indicate the handover status, the first configuration field is used to configure the QPN of the backup QP, and the second configuration field is used to configure the GID of the backup QP.
13. The method as described in claim 12, characterized in that, The verification of the handover notification message includes: If the indicated field is the first value, then the switching status is determined to be switched and the verification is successful.
14. The method as described in claim 11, characterized in that, The handover notification message includes a BTH header, which includes an opcode field, a third configuration field, a fourth configuration field, and a fifth configuration field. The opcode field is used to indicate QP handover, the third configuration field is used to configure the QPN of the primary QP, the fourth configuration field is used to configure the QPN of the backup QP, and the fifth configuration field is used to configure the GID of the backup QP.
15. The method as described in claim 14, characterized in that, The verification of the handover notification message includes: If the opcode field is the second value, then determine whether the third value in the third configuration field is the QPN of the main QP; If it is determined that the third value in the third configuration field is the QPN of the main QP, then the verification is successful.
16. A data transmission device, characterized in that, Settings are configured on the requesting side, including: The first receiving module is used to send an RDMA connection request to the responding end and create a primary queue pair (QP) and a backup QP. The synchronization module is used to establish an RDMA connection between the primary QP and the response terminal, and to synchronize the information of the primary QP to the backup QP; A switching module is used to switch the state of the primary QP and the backup QP in response to detecting an abnormality in the primary QP. The sending module is used to generate a handover notification message based on the configuration information of the backup QP, and send the handover notification message to the responding end; The second receiving module is used to receive the confirmation information sent by the responding end and to transmit data with the responding end based on the backup QP.
17. A data transmission device, characterized in that, Settings on the response side include: The first sending module is used to receive RDMA connection requests sent by the requesting end; Establishment module, used to establish an RDMA connection between the requesting end and the requesting end based on the main QP of the requesting end; The verification module is used to receive the handover notification message sent by the requesting end and verify the handover notification message. The second sending module is used to update the target QP that establishes an RDMA connection with the requesting end to the backup QP in the handover notification message if the verification is successful, and to send confirmation information to the requesting end.
18. A requesting terminal, characterized in that, include: A first processor and a first memory for storing a computer program capable of running on the processor, wherein the first processor, when running the computer program, performs the steps of the method according to any one of claims 1 to 10.
19. A response terminal, characterized in that, include: A second processor and a second memory for storing a computer program capable of running on the processor, wherein the second processor, when running the computer program, performs the steps of the method according to any one of claims 11 to 15.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 10 or 11 to 15.
21. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10 or 11 to 15.
Citation Information
Cited By
Communication method and device based on queue pair switching, equipment, medium and program product
CN121814676A
Communication method, apparatus, device, medium and program product based on queue pair switching
CN121814676B