Data transmission method and device, electronic equipment, chip, storage medium and computer program product
By setting up a primary/backup device relationship between RDMA devices and utilizing the reserved fields of the RoCEv2 protocol for primary/backup switching, the problem of data transmission failure caused by the failure of the entire network card is solved, thus achieving reliable and continuous data transmission.
Patent Information
- Application Number
- CN202411448673.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Existing RDMA technology suffers from data transmission failures when the entire network interface card (NIC) fails, particularly due to insufficient reliability between data transfer gateway devices.
By setting up a primary/backup device relationship between RDMA devices and utilizing the reserved fields of the RoCEv2 protocol for primary/backup switching, data transmission information is dynamically synchronized, ensuring that the backup device continues to complete data transmission when the primary device fails.
It improves the reliability and continuity of data transmission, ensuring that data transmission tasks can still be completed in the event of a complete machine failure, thereby enhancing the efficiency and reliability of network communication.
Smart Images

Figure CN119341691B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of communication, in particular to a data transmission method, a data transmission device, an electronic device, a chip, a storage medium and a computer program product. BACKGROUND
[0002] Remote Direct Memory Access (RDMA) is a network technology that allows a near-end computer to directly access the memory of a far-end computer without intervention of the central processing unit (CPU) of the far-end computer. This network technology greatly reduces the delay of data transmission, reduces the load of the CPU, and improves the efficiency of network communication. In order to improve the reliability of data transmission, the reliability scheme proposed in the current RDMA related specifications and standards is that the ports of the same network card are mutually primary and backup ports. However, in actual application, the entire network card may fail, resulting in data transmission failure. SUMMARY
[0003] To solve the technical problem that the entire network card fails and causes data transmission failure, embodiments of the present application provide a data transmission method, a data transmission device, an electronic device, a chip, a storage medium and a computer program product.
[0004] The data transmission method provided by the embodiments of the present application is applied to a second device, and includes:
[0005] In the process of transmitting a target data packet by a first device to a third device, when the first device fails, a first data packet is sent to the third device; the first data packet includes first information, and the first information is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet;
[0006] An acknowledge (ACK) packet sent by the third device is received;
[0007] According to the ACK packet, the target data packet is transmitted to the third device.
[0008] The data transmission method provided by the embodiments of the present application is applied to a third device, and includes:
[0009] In the process of receiving a target data packet transmitted by a first device, a first data packet sent by a second device is received; the first data packet includes first information, and the first information is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet;
[0010] According to the first data message, a peer device in a queue pair (QP) is changed to the second device; an ACK message is sent to the second device; the ACK message includes second information, and the second information represents a packet sequence number (PSN) of a last data message successfully received by the third device;
[0011] The target data message transmitted by the second device is received.
[0012] The data transmission method provided by the embodiment of the present application is applied to a fourth device, and includes the following steps:
[0013] When the third device fails in a process in which the first device transmits a target data message to the third device, an ACK message is sent to the first device; the ACK message includes fourth information and fifth information, the fourth information is used to indicate that a target data message receiving device is changed from the third device to the fourth device, and the fifth information is used to indicate a PSN of a last data message successfully received;
[0014] The target data message transmitted by the first device is received.
[0015] The data transmission method provided by the embodiment of the present application is applied to a first device, and includes the following steps:
[0016] In a process in which a target data message is transmitted to a third device, an ACK message sent by a fourth device is received; the ACK message includes fourth information and fifth information, the fourth information is used to indicate that a target data message receiving device is changed from the third device to the fourth device, and the fifth information is used to indicate a PSN of a last data message successfully received;
[0017] Based on the ACK message, the target data message is transmitted to the fourth device.
[0018] The data transmission apparatus provided by the embodiment of the present application is applied to a second device, and includes the following steps:
[0019] A first processing unit is configured to, when a first device fails in a process in which the first device transmits a target data message to a third device, send a first data message to the third device; the first data message includes first information, the first information is used to indicate that a target data message sending device is changed from the first device to the second device, and the first data message is a data message in the target data message;
[0020] The first processing unit is further configured to receive an ACK message sent by the third device;
[0021] The first processing unit is further configured to transmit the target data packet to the third device according to the ACK packet.
[0022] The data transmission apparatus provided by the embodiments of the present application is applied to a third device and comprises:
[0023] The second processing unit is configured to receive a first data packet sent by a second device in the process of receiving the target data packet transmitted by the first device; the first data packet comprises first information, the first information being used to indicate that the target data packet sending device is changed from the first device to the second device; and the first data packet is a data packet in the target data packet.
[0024] The second processing unit is further configured to change a peer device in the QP to the second device according to the first data packet, send an ACK packet to the second device, and the ACK packet comprises second information, the second information representing a PSN of a last data packet successfully received by the third device.
[0025] The second processing unit is further configured to receive the target data packet transmitted by the second device.
[0026] The data transmission apparatus provided by the embodiments of the present application is applied to a fourth device and comprises:
[0027] The third processing unit is configured to send an ACK packet to the first device when the third device fails in the process of transmitting the target data packet by the first device to the third device; the ACK packet comprises fourth information and fifth information, the fourth information being used to indicate that the target data packet receiving device is changed from the third device to the fourth device, and the fifth information being used to indicate a PSN of a last data packet successfully received.
[0028] The third processing unit is further configured to receive the target data packet transmitted by the first device.
[0029] The data transmission apparatus provided by the embodiments of the present application is applied to a first device and comprises:
[0030] The fourth processing unit is configured to receive an ACK packet sent by a fourth device in the process of transmitting the target data packet to the third device; the ACK packet comprises fourth information and fifth information, the fourth information being used to indicate that the target data packet receiving device is changed from the third device to the fourth device, and the fifth information being used to indicate a PSN of a last data packet successfully received.
[0031] The fourth processing unit is further configured to transmit the target data packet to the fourth device according to the ACK packet.
[0032] The electronic device provided by the embodiments of the present application comprises a processor and a memory, the memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory to execute any data transmission method provided by the embodiments of the present application.
[0033] The chip provided by the embodiments of the present application comprises a processor, which is used for calling and running a computer program from a memory, so that a device installed with the chip executes any data transmission method provided by the embodiments of the present application.
[0034] The storage medium provided by the embodiments of the present application is used for storing a computer program, and the computer program causes a computer to execute any data transmission method provided by the embodiments of the present application.
[0035] The computer program product provided by the embodiments of the present application comprises a computer program, and the computer program realizes any data transmission method provided by the embodiments of the present application when executed by a processor.
[0036] The data transmission method provided by the embodiments of the present application sets a second device, when a whole machine fault occurs in the process that a first device transmits a target data packet to a third device, the second device can continue to transmit the target data packet with the assistance of the third device, and the reliability of data transmission is improved. BRIEF DESCRIPTION OF DRAWINGS
[0037] The accompanying drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute improper limitations on the present application. In the drawings:
[0038] Figure 1 The networking schematic provided by the embodiments of the present application Figure 1 ;
[0039] Figure 2 The networking schematic provided by the embodiments of the present application Figure 2 ;
[0040] Figure 3 The implementation flow schematic of the data transmission method provided by the embodiments of the present application Figure 1 ;
[0041] Figure 4 The structure schematic of the RoCEv2 protocol packet provided by the embodiments of the present application
[0042] Figure 5 The structure schematic of the Basic Transport Header (BTH) provided by the embodiments of the present application
[0043] Figure 6Data transmission process provided by the embodiment of the present application Figure 1 ;
[0044] Figure 7 Implementation process of the data transmission method provided by the embodiment of the present application Figure 2 ;
[0045] Figure 8 Data transmission process provided by the embodiment of the present application Figure 2 ;
[0046] Figure 9 Implementation process of the data transmission method provided by the embodiment of the present application Figure 3 ;
[0047] Figure 10 Implementation process of the data transmission method provided by the embodiment of the present application Figure 4 ;
[0048] Figure 11 Data transmission process provided by the embodiment of the present application Figure 3 ;
[0049] Figure 12 Structure and composition of the data transmission device 1200 provided by the embodiment of the present application
[0050] Figure 13 Structure and composition of the data transmission device 1300 provided by the embodiment of the present application
[0051] Figure 14 Structure and composition of the data transmission device 1400 provided by the embodiment of the present application
[0052] Figure 15 Structure and composition of the data transmission device 1500 provided by the embodiment of the present application
[0053] Figure 16 Schematic structure diagram of the electronic device provided by the embodiment of the present application
[0054] Figure 17 Schematic structure diagram of the chip of the embodiment of the present application DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0056] It should be noted that in the embodiments of the present application, the term "and / or" is merely to describe the association relationship of the associated objects, and can represent the existence of three relationships, for example, A and / or B, which can represent the existence of A alone, the existence of A and B together, and the existence of B alone. In addition, in the embodiments of the present application, the character " / " generally represents an "or" relationship between the front and rear associated objects.
[0057] In the description of the embodiments of the present application, the term "corresponding" can represent a direct or indirect corresponding relationship between the two, can also represent an associated relationship between the two, and can also indicate a relationship such as data transmission and data transmission.
[0058] In order to facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies of the embodiments of the present application are described as follows, and the following related technologies can be combined with the technical solutions of the embodiments of the present application in any way, which all belong to the protection scope of the embodiments of the present application.
[0059] The second generation RDMA protocol based on converged Ethernet (RDMA over Converged Ethernet version 2, RoCEv2) is a protocol specially designed for low delay and high throughput data transmission in an Ethernet environment. RoCEv2 protocol reduces the participation of CPU and reduces communication delay. RoCEv2 protocol provides strong support for high-performance computing (High Performance Computing, HPC) environment, data center and cloud computing architecture, and other scenarios that require high-speed and efficient data transmission.
[0060] RoCEv2 protocol is gradually moving out of the data center, and more and more research focuses on using RDMA technology to achieve reliable high-throughput data transmission in wide area networks. By modifying the RoCEv2 protocol for wide area networks, the effective throughput can be greatly improved, and the transmission efficiency can be improved. Taking the data transfer between data centers in a wide area network as an example, a common networking method is as follows Figure 1 As shown, Figure 1 The networking schematic provided by the embodiments of the present application Figure 1 The data express gateway provides wide area reliable high-throughput services for data centers. Data from the data source of data center 1 is transmitted to the data express gateway in the form of a normal Ethernet message. The data express gateways between data center 1 and data center 2 run the RoCEv2 protocol, and the data express gateway of data center 2 sends data to the data source of data center 2 in the form of a normal Ethernet message.
[0061] The data express gateway needs to have certain reliability to provide data express service. The reliability proposed in the current RDMA related specifications and standards is mainly that different ports of the same network card are mutually standby. For example, InfiniBand (IB) and RoCEv2 support fast switching between different ports of the same network card to deal with port failure problems. However, in actual networks, the whole machine may fail, or the whole network card may fail, so the reliability between different devices of the data express gateway is also very important.
[0062] Data express traffic has two transmission modes. The first mode is that data is copied from a data source to a data express gateway and stored in advance, and the data express gateway is responsible for transmitting data in the local hard disk to the remote end in the form of RDMA. In this mode, data is stored in the local storage of the data express gateway, and once the whole machine fails, even if it is switched to a standby device, it still cannot complete the transmission task. The second mode is that data is sent from a data source to a data gateway device, and the data gateway device converts it into RDMA form in real time and transmits it to the remote end. The present application mainly aims at the reliability problem of whole machine failure in the second mode.
[0063] Reference Figure 2 , Figure 2 The networking schematic provided by the embodiment of the present application Figure 2 As Figure 2 shown, two data express gateways are set in the requestor data center 1, one is the primary data express gateway G1 and the other is the standby data express gateway G1', two data express gateways are set in the responder data center 2, one is the primary data express gateway G2 and the other is the standby data express gateway G2', and when the primary data express gateway fails, the standby data express gateway completes the data transmission service.
[0064] Figure 3 The implementation flow schematic of the data transmission method provided by the embodiment of the present application Figure 1 As Figure 3 shown, the data transmission method provided by the embodiment of the present application, the method is applied to the second device, and includes the following steps:
[0065] Step 301: when the first device fails in the process of transmitting the target data packet to the third device, the first data packet is sent to the third device; the first data packet includes first information, the first information is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet.
[0066] In the embodiment of the present application, the first device, the second device and the third device are RDMA devices, which can be network cards, switches and routers, etc., or other devices, and the present application does not limit this.
[0067] The data transmission method provided in the embodiments of the present application can be applied to the write request write in the reliable connection mode of the RoCEv2 protocol, and can also be applied to other scenarios in actual application, and the embodiments of the present application do not limit this.
[0068] In the embodiments of the present application, the first device and the second device are near-end devices, and the near-end devices are devices initiating RDMA operations, wherein the first device is a near-end primary device, and the second device is a near-end backup device; when the first device does not fail, the first device performs data transmission services; and when the first device fails, the second device performs data transmission services.
[0069] In the embodiments of the present application, the third device is a far-end device, and the far-end device is a device receiving RDMA operations, and the third device is a far-end primary device.
[0070] Based on this, in an optional embodiment of the present application, the first device and the third device interact through the RoCEv2 protocol; the second device and the third device interact through the RoCEv2 protocol; the first device is a near-end primary device, the second device is a near-end backup device, and the third device is a far-end primary device.
[0071] In the embodiments of the present application, heartbeat detection can be performed between the first device and the second device, and when N consecutive heartbeats cannot be received, it is judged that the other party fails; or the first device and the second device are uniformly controlled by an independent management plane device, and when the management plane finds that the first device fails, the second device is notified to replace the first device to perform data packet transmission; in actual application, other methods can also be used, and the embodiments of the present application do not limit the state sensing method between the first device and the second device.
[0072] In the embodiments of the present application, the target data packet includes one or more data packets, and the first data packet is one of the target data packets. Preferably, the first data packet can be a data packet that should be sent in the sending window of the second device. This is because the sending windows of the first device and the second device are synchronized, the data packet that should be sent in the sending window of the second device is the same as the data packet that should be sent before the first device fails, and the data packet can also be a data packet expected to be received by the receiving window of the third device, thereby improving the efficiency of data transmission.
[0073] Based on this, in an optional embodiment of the present application, the first data packet is a data packet that should be sent in the current sending window of the second device.
[0074] In the embodiments of the present application, the first information is represented by a reserved field 7 in the RoCEv2 protocol packet.
[0075] ReferenceFigure 4 , Figure 4 This is a schematic diagram of the structure of the RoCEv2 protocol message provided in the embodiments of this application, as shown below. Figure 4 As shown, the RoCEv2 protocol message includes: Ethernet L2 Header; EtherType data type field; IP Header (Internet Protocol Header); Protocol field Proto# following the IP Header; UDP Header (User Datagram Protocol Header); Protocol field Proto# following the UDP Header; InfiniBand Base Transport Header + L4 Header (IB BTH + (L4Hdr)); InfiniBand Payload (IB Payload); InfiniBand Cyclic Redundancy Check (ICRC); Frame Check Sequence (FCS).
[0076] refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of the BTH message header provided in the embodiments of this application, as shown below. Figure 5 As shown, the BTH header includes: an opcode (OpCode) indicating the specific operation to be performed on the data packet, such as sending, receiving, or atomic operations; a send error flag (SE), which, if set, indicates that an error occurred during the transmission of the previous data packet; more (M), indicating whether more data packets will be sent with the current data packet; padding padding to meet specific byte alignment requirements; transport version (TVer), indicating the transport protocol version used; partition key, used to identify different traffic flows or resource groups in the network; and F / Reserved field 1 (Flag / Reserved1, F / Res1). a B / Reserved1 (Bit / Reserved1, B / Res1) is used to identify some flag bits and is reserved as a field for future expansion. a ), used to identify some flag bits and reserved as a field for future expansion; Reserved field 6. a, Destination QP, used to indicate the destination QP number, indicating which receive queue pair the data packet should be sent to; Acknowledgement A, used to represent whether the data packet is an acknowledgement packet, if this bit is set, it means that the data packet is an acknowledgement packet; Reserved 7, used for future expansion; Packet Sequence Number PSN, used to track the order of data packets, to ensure that they are received in order.
[0077] In the embodiments of the present application, two bits in Reserved 7 are used to represent the first information. For example, if the two bits are 11, it means that the primary and backup switching occurs, and the target data packet sending device is changed from the first device to the second device. If the two bits are 00, it is the default case, and the normal arithmetic is performed. For example, the first bit in the two bits represents whether the primary and backup switching occurs, and the second bit represents whether the data transmission device is a primary device or a backup device. When the first bit is 1, it means that the primary and backup switching occurs, and when the first bit is 0, it means that the primary and backup switching does not occur. When the second bit is 0, it means that the data transmission device is a primary device, and when the second bit is 1, it means that the data transmission device is a backup device.
[0078] Step 302: receiving an acknowledgement ACK packet sent by the third device.
[0079] In an optional embodiment of the present application, the ACK packet includes second information, and the second information represents the packet sequence number PSN of the last data packet successfully received by the third device.
[0080] In the RoCEv2 protocol, the responder can use a single acknowledgement data packet to acknowledge multiple completed request data packets, i.e. those PSNs earlier than the PSN contained in the response data packet BTH, which is called acknowledgement merging. For RDMA WRITE operation, this means positive acknowledgement for all PSNs earlier than the PSN in the response data packet BTH, i.e. in the responder, all request data packets with PSNs earlier than the PSN in the response data packet BTH have been completed.
[0081] In an optional embodiment of the present application, the ACK packet further includes third information, and the third information represents that the peer device in the queue pair QP of the third device is changed to the second device.
[0082] The second device and the third device need to continue to complete the transmission of the target data message, the third device wants to interact with the second device, needs to change the opposite device in the QP of the third device to the second device, and needs to inform the second device of the change success information, so as to ensure that the information of the second device and the third device is aligned.
[0083] In the embodiment of the application, the third information can be represented by using two bits in the reserved 7. For example, if the two bits are 01, it represents that the third device has received the near-end device master-backup switching notification, and the third device has changed the opposite device in the QP to the second device.
[0084] Based on this, in an optional embodiment of the application, the first information and / or the third information is represented by the reserved field 7 in the RoCEv2 protocol message.
[0085] In the embodiment of the application, preferably, the first information and / or the third information can be represented by the first two bits of the reserved 7.
[0086] In the connection-oriented mode of RoCEv2, the RDMA device uses the queue pair context (QPC) to store the ID and QPN of the opposite device in the connection, and the related parameters of the connection negotiation. These information represents a connection between the local end and the opposite end. In the embodiment of the application, in the master-backup mode, the QPC of the RDMA device can increase the backup connection information of the opposite device, wherein the ID and QPN of the backup device of the opposite device need to be added, and other parameters can reuse the master device connection. The device information of the opposite backup device is configured in the RDMA device in advance, when the opposite master device fails, the device information of the opposite backup device saved locally can be directly used, so as to improve the data transmission efficiency. In the embodiment of the application, the master-backup mode refers to that the near-end device includes two devices, one of which is a near-end master device, and the other is a near-end backup device, and the far-end device includes two devices, one of which is a far-end master device, and the other is a far-end backup device.
[0087] For example, in the embodiment of the application, the first device is a near-end master device, the second device is a near-end backup device, and the third device is a far-end device. The third device adds the ID and QPN of the second device in the QPC, which can be DGID_B representing the opposite backup device address information, which is the interface IP address of the opposite backup device, and QPN_B representing the opposite backup device QP number, which is the QPN in the opposite backup device.
[0088] Based on this, in an optional embodiment of the application, the queue pair context QPC of the third device includes the device information of the second device; the device information includes device address information and a QP number.
[0089] Step 303: transmitting the target data packet to the third device according to the ACK packet.
[0090] In the embodiment of the application, the ACK packet carries the PSN of the last data packet successfully received by the third device, for example, the PSN is m, which indicates that the third device has successfully received all data packets with PSN less than or equal to m, and then the second device continues to transmit the data packet with PSN m+1 to the third device.
[0091] Based on this, in an optional embodiment of the application, the transmitting the target data packet to the third device according to the ACK packet comprises:
[0092] According to the ACK packet, a second data packet is sent to the third device, wherein the second data packet is the next data packet of the last data packet successfully received by the third device.
[0093] In the embodiment of the application, in order to maintain the master-slave relationship of the RDMA device, a back-up mapping table can be added in the master device and the standby device, and the back-up mapping table records the address information and QPN of the two devices as master and standby devices. For example, the back-up mapping table is created by the management surface, and the master-slave relationship of the two devices can be specified during initial configuration or automatically negotiated by the two devices. For example, the near-end device includes two devices, and the master-slave relationship of the two devices can be specified by the management surface or negotiated by the two devices. The QP master-slave relationship can also be specified in advance by the management surface or automatically assigned during operation.
[0094] In the embodiment of the application, in order to ensure the continuity of the data flow between the master device and the standby device, the application of the connection parameters needs to be associated and synchronized in real time. Specifically, in RoCEv2, the port, QP, etc. are isolated by using partitions, and the partition key P_Key is configured by the management surface. Each partition corresponds to a P_Key, and the QP, port, etc. of the two devices as master and standby devices need to use the same partition and the same P_Key. For example, the first device and the second device have the same partition and the same P_Key.
[0095] In the embodiment of the application, L_Key and R_Key are memory keys used to access the memory when the memory is applied, which correspond to the physical address of the memory. The application locally accesses the memory using L_Key, and sends R_Key to the peer device to authorize the peer device to read and write the memory. After the device supports the master-slave capability, the master device synchronizes the memory key to the standby device, and the standby device locally applies the memory by specifying the memory key, so as to ensure that the memory keys of the master device and the standby device are the same.
[0096] In the embodiments of the present application, the management plane software simultaneously issues transmission tasks under the master gateway and the backup gateway, including memory application, issuing WQE on the QP of the master device and the backup device, and the like. The management plane software can be centralized control software or a program running in a distributed manner on the RDMA device.
[0097] In the embodiments of the present application, in the process of transmitting the target data message by the first device, the second device also needs to be dynamically synchronized with the data transmission related information, for example, the completion queue event CQE, the ACK message, and the master / backup switching information of the remote device, so as to synchronize the information between the second device and the first device and improve the transmission efficiency.
[0098] Based on this, in an optional embodiment of the present application, the transmission tasks of the first device and the second device are the same.
[0099] The partitions of the first device and the second device are the same.
[0100] The first device and the second device have a backup mapping table for data transmission; the backup mapping table includes device information of the first device and the second device; the device information includes address information and a QP number; and the method further includes:
[0101] receiving first synchronization information sent by the first device, and updating the data transmission information of the second device based on the first synchronization information; wherein the first synchronization information includes one or more of the following information: a completion queue event CQE, and master / backup switching information of a remote device.
[0102] In the embodiments of the present application, the synchronization message interaction mode between the master device and the backup device can be based on a TCP / IP socket or a dedicated RDMA message, or other custom message forms, and the embodiments of the present application do not limit this.
[0103] Reference Figure 6 , Figure 6 Data transmission process provided by the embodiments of the present application Figure 1 For example Figure 6As shown, the embodiment is a normal data transmission process, S1 is a request end switch, S2 is a response end switch, G1 is a near-end master device, G1' is a near-end backup device, G2 is a far-end master device, and G2' is a far-end backup device. Normally, a data source sends data to G1 and G1' after copying in an internal switch, G1 normally performs data forwarding, G1' only receives data without forwarding, G2 normally feeds back an ACK after receiving data, and synchronizes the ACK to G2'. G2' updates a receiving window and the like according to the ACK content. G1 synchronizes the ACK to G1', and G1' updates a receiving window and cleans up memory data according to the ACK content. When G1 completes a transmission task, it synchronizes a completion queue event (CQE) to G1', notifies a corresponding WQE transmission task that has been completed, and G1 updates local task information.
[0104] Reference Figure 7 , Figure 7 An implementation process of a data transmission method provided by the embodiment of the application Figure 2 As shown in the figure, Figure 7 The data transmission method provided by the embodiment of the application is applied to a third device, and includes the following steps:
[0105] Step 701: In the process of receiving a target data packet transmitted by a first device, a first data packet sent by a second device is received; the first data packet includes first information, and the first information is used to indicate that a target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet.
[0106] In the embodiment of the application, the first device, the second device and the third device are RDMA devices, which can be a network card, a switch, a router and the like, or other devices, and the embodiment of the application does not limit this.
[0107] The data transmission method provided by the embodiment of the application can be applied to a write request (write) in a RoCEv2 protocol reliable connection mode, and in actual application, can also be applied to other scenes, and the embodiment of the application does not limit this.
[0108] In the embodiment of the application, the first device and the second device are near-end devices, and the near-end device is a device initiating an RDMA operation, wherein the first device is a near-end master device, and the second device is a near-end backup device. When the first device does not fail, the first device performs a data transmission service; when the first device fails, the second device performs the data transmission service.
[0109] In the embodiment of the application, the third device is a far-end device, and the far-end device is a device receiving an RDMA operation, and the third device is a far-end master device.
[0110] Based on this, in an optional embodiment of the present application, the first device and the third device interact through the RoCEv2 protocol; the second device and the third device interact through the RoCEv2 protocol; the first device is a near-end primary device, the second device is a near-end backup device, and the third device is a far-end primary device.
[0111] In the embodiment of the present application, two bits in the reserved field 7 of the RoCEv2 protocol message are used to represent the first information. For example, if the two bits are 11, it represents that the primary-backup switchover occurs, and the target data message sending device is changed from the first device to the second device; if the two bits are 00, it is the default case, and the normal arithmetic is performed.
[0112] Step 702: According to the first data message, the opposite end device in the QP is changed to the second device; an ACK message is sent to the second device; the ACK message includes second information, which represents the PSN of the last data message successfully received by the third device.
[0113] After the third device receives the first data message, according to the first information, the opposite end device in the QP is changed to the second device, so as to perform data transmission with the second device.
[0114] In the connection-oriented mode of RoCEv2, the RDMA device is used to maintain the connection information in the queue pair context QPC, which stores the ID and QPN of the opposite end device in the connection, as well as the related parameters of the connection negotiation. These information represents a connection between the local end and the opposite end. In the embodiment of the present application, in the primary-backup mode, the QPC of the RDMA device can increase the backup connection information of the opposite end device, wherein the ID and QPN of the backup device of the opposite end device need to be added, and other parameters can reuse the main connection. The device information of the opposite end backup device is configured in the RDMA device in advance, so that when the opposite end primary device fails, the device information of the opposite end backup device can be directly used, and the data transmission efficiency is improved. In the embodiment of the present application, the primary-backup mode refers to that the near-end device includes two devices, one of which is a near-end primary device, and the other is a near-end backup device; the far-end device includes two devices, one of which is a far-end primary device, and the other is a far-end backup device.
[0115] For example, in the embodiment of the present application, the first device is a near-end primary device, the second device is a near-end backup device, and the third device is a far-end device; the third device adds the ID and QPN of the second device in the QPC, which can be DGID_B and QPN_B, respectively, representing the opposite end backup device address information, which is the interface IP address of the opposite end backup device; and the opposite end backup device QP number, which is the QPN of the opposite end backup device.
[0116] Based on this, in an optional embodiment of the present application, the device information of the second device is contained in the QPC of the third device; the device information includes address information and a QP number.
[0117] In an optional embodiment of the present application, the ACK message further carries third information; the third information represents that the opposite end device in the QP of the third device is changed to the second device.
[0118] In the embodiment of the present application, the third information can be represented by using two bit positions in Reserved7, for example, if the two bit positions are 01, it represents that the third device has received the notification of the active-standby switching of the near-end device, and the third device has changed the opposite end device in the QP to the second device.
[0119] Based on this, in an optional embodiment of the present application, the first information and / or the third information is represented by using the reserved field 7 in the RoCEv2 protocol message.
[0120] In the embodiment of the present application, preferably, the first information and / or the third information can be represented by using the first two bit positions of reserved7.
[0121] In the embodiment of the present application, after the third device receives the first data message, the third device compares the PSN of the first data message with the receiving window, if the first data message is the data message expected to be received by the receiving window of the third device, the third device normally replies the ACK message of the first data message. If the first data message is not the data message expected to be received by the receiving window of the third device, the third device re-sends the last sent ACK message.
[0122] Based on this, in an optional embodiment of the present application, the sending of the ACK message to the second device includes:
[0123] If the PSN of the first data message is the PSN expected to be received by the third device, the ACK message of the first data message is sent to the second device;
[0124] If the PSN of the first data message is not the PSN expected to be received by the third device, the last sent ACK message is re-sent to the second device.
[0125] Step 703: receiving the target data message transmitted by the second device.
[0126] The third device and the second device continue to complete the transmission of the target data message.
[0127] In the embodiment of the present application, the remote device further includes a fourth device, the fourth device being a remote backup device, and the third device and the fourth device being in a master-slave relationship. In the embodiment of the present application, in order to maintain the master-slave relationship of the RDMA device, a Back-up Mapping table can be added in the master device and the backup device, and the Back-up Mapping table records the address information and QPN of the two devices in the master-slave relationship. For example, the Back-up Mapping table is created by the management plane, and the master-slave relationship of the two devices can be specified during initial configuration or automatically negotiated by the two devices. For example, the near-end device includes two devices, and the master-slave relationship of the two devices can be specified by the management plane or negotiated by the two devices. The QP master-slave relationship can also be specified in advance by the management plane or automatically assigned during operation.
[0128] In the embodiment of the present application, in order to ensure the continuity of the data flow between the master device and the backup device, the application of the connection parameters needs to be associated and synchronized in real time between the master device and the backup device. Specifically, in RoCEv2, partitions are used to isolate ports, QPs, and the like, and the partition key P_Key is configured by the management plane. Each partition corresponds to a P_Key, and the QPs, ports, and the like of the two devices in the master-slave relationship need to use the same partition and the same P_Key.
[0129] In the embodiment of the present application, L_Key and R_Key are memory keys used to access the memory when the memory is applied, and correspond to the physical address of the memory. The application locally accesses the memory using L_Key, and sends R_Key to the peer device to authorize the peer device to read and write the memory. After the device supports the master-slave capability, the master device should synchronize the memory key to the backup device, and the backup device specifies the memory key to locally apply for memory, so as to ensure that the memory keys of the master device and the backup device are the same.
[0130] In the embodiment of the present application, the management plane software simultaneously issues transmission tasks, including memory application, WQE, and the like on the QP of the master device and the backup device. The management plane software can be centralized control software or a program running on the RDMA device in a distributed manner.
[0131] In the embodiment of the present application, during the process of transmitting the target data message by the third device, the fourth device also needs to be dynamically synchronized with the data transmission related information, such as the completion queue event CQE, the ACK message, and the master-slave switching information of the remote device, so as to synchronize the information between the fourth device and the third device and improve the transmission efficiency.
[0132] Based on this, in an optional embodiment of the present application, the method further comprises: sending second synchronization information to a fourth device; the fourth device is a remote backup device; and the second synchronization information comprises one or more of the following information: CQE, ACK message, and active-standby switching information of the near-end device.
[0133] In the embodiments of the present application, the synchronization message interaction mode between the active and standby devices can be based on TCP / IP sockets or dedicated RDMA messages, or other custom messages, and the embodiments of the present application do not limit this.
[0134] Reference Figure 8 , Figure 8 Data transmission process provided by the embodiments of the present application Figure 2 As Figure 8 shown, the embodiment is a data transmission process when the near-end active device fails, S1 is a request-end switch, S2 is a response-end switch, G1 is a near-end active device, G1' is a near-end backup device, G2 is a remote active device, G2' is a remote backup device, G1 sends target data messages to G2, when G1 fails, G1' becomes the active device, G1' continues to send first data messages to G2 according to the local sending window state, assuming that the PSN of the first data message is n and it carries an active-standby switching flag; G2 receives the first data message, judges that the peer device has active-standby switching, updates the local QP, updates the DGID to G1', updates the DGID_B to empty, updates the QPN to QPN_B, and updates the QPN_B to empty, and notifies G2' that the near-end device has active-standby switching. G2 compares the PSN of the received first data message with the local receiving window according to the local receiving window, checks whether the PSN of the first data message is the PSN number of the expected received data message, if yes, normally replies an ACK message; if not, re-sends the last sent ACK message, assuming that the PSN of the last sent ACK message is m and it carries third information, then G1' starts to send target data messages to G2 from the data message with PSN=m+1 after receiving the ACK.
[0135] Reference Figure 9 , Figure 9 Implementation process of the data transmission method provided by the embodiments of the present application Figure 3 As Figure 9 shown, the data transmission method provided by the embodiments of the present application is applied to a fourth device, and comprises the following steps:
[0136] Step 901: when the third device fails in the process that the first device transmits the target data packet to the third device, an ACK packet is sent to the first device; the ACK packet comprises fourth information and fifth information, the fourth information is used to indicate that the target data packet receiving device is changed from the third device to the fourth device, and the fifth information is used to indicate the PSN of the last successfully received data packet.
[0137] In the embodiment of the application, the first device, the third device and the fourth device are RDMA devices, which can be network cards, switches, routers and the like, or other devices, and the embodiment of the application does not limit this.
[0138] The data transmission method provided in the embodiment of the application can be applied to the write request write in the RoCEv2 protocol reliable connection mode, and in actual application, can also be applied to other scenarios, and the embodiment of the application does not limit this.
[0139] In the embodiment of the application, the first device is a near-end device, and the near-end device is a device initiating an RDMA operation, wherein the first device is a near-end master device.
[0140] In the embodiment of the application, the third device and the fourth device are far-end devices, the far-end device is a device receiving an RDMA operation, the third device is a far-end master device, and the fourth device is a far-end backup device, wherein when the third device does not fail, the third device performs a data transmission service, and when the third device fails, the fourth device performs the data transmission service.
[0141] Based on this, in an optional embodiment of the application, the first device and the third device interact through the RoCEv2 protocol, the second device and the third device interact through the RoCEv2 protocol, the first device is a near-end master device, the second device is a near-end backup device, and the third device is a far-end master device.
[0142] In the embodiment of the application, heartbeat detection can be performed between the third device and the fourth device, when N consecutive heartbeats cannot be received, it is judged that the other party fails, or a separate management plane device uniformly controls the third device and the fourth device, when the management plane finds that the third device fails, the fourth device is notified to replace the third device to perform data packet transmission, and in actual application, other methods can also be used, and the embodiment of the application does not limit the state sensing method between the third device and the fourth device.
[0143] In the embodiment of the application, two bits in Reserved7 are used to represent the fourth information, for example, if the two bits are 01, it is represented that the master-backup switching occurs, and the target data packet receiving device is changed from the third device to the fourth device.
[0144] In the embodiments of the present application, preferably, the first two bits of reserved7 can be used to represent the fourth information.
[0145] When the third device fails, the fourth device repeatedly sends the last ACK packet to the first device according to the receiving window, i.e., the ACK packet sent by the remote device.
[0146] In the embodiments of the present application, in order to maintain the master-slave relationship of the RDMA device, a Back-up Mapping table can be added in the master device and the backup device, and the Back-up Mapping table records the address information and QPN of the two devices as master and backup. For example, the Back-up Mapping table is created by the management plane, and the master-slave relationship of the two devices can be specified during initial configuration or automatically negotiated by the two devices. For example, the near-end device includes two devices, and the master-slave relationship of the two devices can be specified by the management plane or negotiated by the two devices. The QP master-slave relationship can also be specified in advance by the management plane or automatically assigned during operation.
[0147] In the embodiments of the present application, in order to ensure the continuity of the data flow between the master device and the backup device, the application of the connection parameters needs to be associated and synchronized in real time. Specifically, in RoCEv2, the port, QP, etc. are isolated by using partition, and the partition key P_Key is configured by the management plane. Each partition corresponds to a P_Key, and the QP, port, etc. of the two devices as master and backup need to use the same partition and the same P_Key. For example, the third device and the fourth device have the same partition and the same P_Key.
[0148] In the embodiments of the present application, L_Key and R_Key are memory keys used to access the memory when the memory is applied, which correspond to the physical address of the memory. The application locally accesses the memory using L_Key, and sends R_Key to the opposite device to authorize the opposite device to read and write the memory. After the device supports the master-slave capability, the master device should synchronize the memory key to the backup device, and the backup device specifies the memory key to locally apply the memory, so as to ensure that the memory keys of the master device and the backup device are the same.
[0149] In the embodiments of the present application, the management plane software simultaneously issues transmission tasks under the master and backup gateways, including memory application, and issues WQE on the QP of the master device and the backup device. The management plane software can be centralized control software or a program running on the RDMA device in a distributed manner.
[0150] In the embodiment of the application, in the process of transmitting the target data message by the third device, the fourth device also needs to be dynamically synchronized with data transmission related information, for example, a completion queue event CQE, an ACK message, and master / standby switching information of a remote device, so that the second device and the first device complete information synchronization and improve transmission efficiency.
[0151] Based on this, in an optional embodiment of the application, the method further includes:
[0152] receiving second synchronization information sent by the third device, and updating data transmission information according to the second synchronization information; the second synchronization information includes one or more of the following information: a CQE, an ACK message, and master / standby switching information of a near-end device.
[0153] In the embodiment of the application, the synchronization message interaction mode between the master device and the standby device can be based on a TCP / IP socket or a dedicated RDMA message, or other custom message forms, and the embodiment of the application does not limit this.
[0154] Step 902: receiving the target data message transmitted by the first device.
[0155] The first device and the fourth device continue to complete transmission of the target data message.
[0156] Reference Figure 10 , Figure 10 The implementation flow of the data transmission method provided in the embodiment of the application is shown in Figure 4 As shown in Figure 10 The data transmission method provided in the embodiment of the application is applied to a first device and includes the following steps:
[0157] Step 1001: In the process of transmitting a target data message to a third device, an ACK message sent by a fourth device is received; the ACK message includes fourth information and fifth information, the fourth information is used to indicate that a target data message receiving device is changed from the third device to the fourth device, and the fifth information is used to indicate a PSN of a last successfully received data message.
[0158] In the embodiment of the application, the first device, the third device, and the fourth device are RDMA devices, which can be network cards, switches, routers, or other devices, and the embodiment of the application does not limit this.
[0159] The data transmission method provided in the embodiment of the application can be applied to a write request (write) in a RoCEv2 protocol reliable connection mode, and in actual application, can also be applied to other scenarios, and the embodiment of the application does not limit this.
[0160] In the embodiments of the present application, the first device is a near-end device, and the near-end device is a device initiating an RDMA operation, wherein the first device is a near-end master device.
[0161] In the embodiments of the present application, the third device and the fourth device are far-end devices, the far-end device is a device receiving an RDMA operation, the third device is a far-end master device, and the fourth device is a far-end backup device. When the third device does not fail, the third device performs a data transmission service; and when the third device fails, the fourth device performs the data transmission service.
[0162] In the embodiments of the present application, two bits in the Reserved7 are used to represent the fourth information. For example, if the two bits are 01, it indicates that a master-backup switching occurs, and the target data packet receiving device is changed from the third device to the fourth device.
[0163] In the embodiments of the present application, preferably, the first two bits of the reserved7 are used to represent the fourth information.
[0164] In the embodiments of the present application, in order to maintain the master-backup relationship of the RDMA device, a Back-up Mapping table can be added in the master device and the backup device. The Back-up Mapping table records the address information and the QPN of the two devices that are the master and backup of each other. For example, the Back-up Mapping table is created by a management surface, and the master-backup relationship of the two devices can be specified when initially configured, or can be automatically negotiated by the two devices. For example, the near-end device includes two devices, and the master-backup relationship of the two devices can be specified by the management surface or negotiated by the two devices. The QP master-backup relationship can also be specified in advance by the management surface or automatically assigned during operation.
[0165] In the embodiments of the present application, in order to ensure the continuity of the data flow between the master and backup devices, the application of the connection parameters between the master and backup devices needs to be associated and synchronized in real time. Specifically, in RoCEv2, the port, QP and the like are isolated by using a partition. The partition key P_Key is configured by a management surface. Each partition corresponds to a P_Key. The QP, port and the like of the two devices that are the master and backup of each other need to use the same partition and the same P_Key. For example, the near-end device further includes a second device, the second device is a near-end backup device, the first device and the second device have the same partition and the same P_Key.
[0166] In the embodiments of the present application, L_Key and R_Key are memory keys obtained when an application applies for a memory, and correspond to the physical address of the memory. The application locally accesses the memory using L_Key, and sends R_Key to the opposite device to authorize the opposite device to read and write the memory. After the device supports the master and backup capability, the master device should synchronize the memory key to the backup device, and the backup device locally applies for the memory by specifying the memory key to ensure that the memory keys of the master and backup devices are the same.
[0167] In the embodiments of the present application, the management plane software simultaneously issues transmission tasks under the master and backup gateways, including memory application, and issuing WQE on the QP of the master and backup devices. The management plane software can be centralized control software, or a program running in a distributed manner on an RDMA device.
[0168] In the embodiments of the present application, in the process of transmitting the target data message by the first device, the first device also needs to dynamically synchronize data transmission related information to the second device, for example, CQE, ACK message, and master and backup switching information of the remote device, so that the second device and the first device complete information synchronization and improve transmission efficiency.
[0169] Based on this, in an optional embodiment of the present application, the first device and the third device interact through the RoCEv2 protocol; the first device and the fourth device interact through the RoCEv2 protocol; the first device is a near-end master device, the third device is a remote master device, and the fourth device is a remote backup device; the method further includes:
[0170] sending first synchronization information to the second device; the second device is a near-end backup device; wherein the first synchronization information includes one or more of the following information: CQE, ACK message, and master and backup switching information of the remote device.
[0171] In the embodiments of the present application, the synchronization message interaction mode between the master and backup devices can be based on a TCP / IP socket or a dedicated RDMA message, or other custom message forms, and the embodiments of the present application do not limit this.
[0172] Step 1002: based on the ACK message, transmitting the target data message to the fourth device.
[0173] For example, if the PSN of the ACK message is m, the first device starts from the data message with PSN m+1 and continues to transmit the target data message to the fourth device.
[0174] Reference Figure 11 , Figure 11 Data transmission process provided by the embodiments of the present application Figure 3 For example, Figure 11As shown, the embodiment is a data transmission flow when a remote master device fails, S1 is a request end switch, S2 is a response end switch, G1 is a near-end master device, G1' is a near-end backup device, G2 is a remote master device, G2' is a remote backup device, G1 sends a target data packet to G2, when G2 fails, G2' is promoted to a master device, G2' repeatedly sends a last ACK packet to a request party according to a current receiving window, a PSN of the last ACK packet is n, G2' repeatedly sends an ACK packet with a PSN of n and carrying a master-backup switching flag; after G1 receives the ACK packet sent by G2', it is judged that a master-backup switching of a peer device occurs, a local QP is updated, DGID is updated to G2', DGID_B is updated to be empty, QPN is updated to a QPN of G2', QPN_B is updated to be empty, and G1' is notified that a remote device master-backup switching occurs. After receiving the ACK, G1 sends target data packets to G2' starting from a data packet with a PSN of n+1.
[0175] The embodiment of the application further provides a data transmission device 1200, which refers to Figure 12 The data transmission device 1200 in the embodiment is applied to a second device and comprises:
[0176] The first processing unit is used for sending a first data packet to a third device when the first device fails in a process in which the first device transmits a target data packet to the third device; the first data packet comprises first information, and the first information is used for indicating that a target data packet sending device is changed from the first device to the second device; and the first data packet is a data packet in the target data packet.
[0177] The first processing unit is further used for receiving an ACK packet sent by the third device.
[0178] The first processing unit is further used for transmitting the target data packet to the third device according to the ACK packet.
[0179] In the embodiment of the application, the first device and the third device interact through a RoCEv2 protocol, the second device and the third device interact through the RoCEv2 protocol, the first device is a near-end master device, the second device is a near-end backup device, and the third device is a remote master device.
[0180] In the embodiment of the application, the first data packet is a data packet that should be sent in a sending window of the second device.
[0181] In an embodiment of the present application, the ACK message comprises second information, and the second information represents a packet sequence number PSN of a last data message successfully received by the third device; the first processing unit is configured to send a second data message to the third device according to the ACK message; and the second data message is a next data message of the last data message successfully received by the third device.
[0182] In an embodiment of the present application, the ACK message further comprises third information; and the third information represents that a peer device in a queue pair QP of the third device is changed to the second device.
[0183] In an embodiment of the present application, the first information and / or the third information are represented by a reserved field 7 in a RoCEv2 protocol message.
[0184] In an embodiment of the present application, a Back-up Mapping table is used for data transmission in the first device and the second device; the Back-up Mapping table comprises device information of the first device and the second device; the device information comprises address information and a QP number; and the first processing unit is configured to receive first synchronization information sent by the first device, and update data transmission information of the second device based on the first synchronization information; wherein the first synchronization information comprises one or more of the following information: a completion queue event CQE, an ACK message, and primary / backup switching information of a remote device.
[0185] In an embodiment of the present application, device information of the second device is contained in a queue pair context QPC of the third device; and the device information comprises device address information and a QP number.
[0186] Those skilled in the art should understand that, Figure 12 The implementation function of each unit in the data transmission apparatus 1200 shown can be understood with reference to the related description of the foregoing method. Figure 12 The function of each unit in the data transmission apparatus 1200 shown can be implemented by a program running on a processor, or by a specific logic circuit.
[0187] An embodiment of the present application further provides a data transmission apparatus 1300, which refers to Figure 13 The data transmission apparatus 1300 in this embodiment is applied to a third device, and comprises:
[0188] The second processing unit is configured to receive a first data message sent by the second device in a process of receiving a target data message transmitted by the first device; the first data message comprises first information, and the first information is used to indicate that a target data message sending device is changed from the first device to the second device; and the first data message is a data message in the target data message.
[0189] The second processing unit is further configured to change a peer device in the QP of the third device to the second device according to the first data message, and send an ACK message to the second device, wherein the ACK message comprises second information, and the second information indicates a PSN of a last data message successfully received by the third device.
[0190] The second processing unit is further configured to receive the target data message transmitted by the second device.
[0191] In an embodiment of the present application, the first device and the third device interact through the RoCEv2 protocol, the second device and the third device interact through the RoCEv2 protocol, the first device is a near-end primary device, the second device is a near-end backup device, and the third device is a far-end primary device.
[0192] In an embodiment of the present application, the second processing unit is configured to send an ACK message of the first data message to the second device if the PSN of the first data message is the PSN expected to be received by the third device, and re-send a last sent ACK message to the second device if the PSN of the first data message is not the PSN expected to be received by the third device.
[0193] In an embodiment of the present application, the ACK message further comprises third information, and the third information indicates that the peer device in the QP of the third device is changed to the second device.
[0194] In an embodiment of the present application, the first information and / or the third information are indicated by a reserve field in a RoCEv2 protocol message.
[0195] In an embodiment of the present application, the QP of the third device comprises device information of the second device, and the device information comprises address information and a QP number.
[0196] In an embodiment of the present application, the second processing unit is configured to send second synchronization information to a fourth device, the fourth device is a far-end backup device, and the second synchronization information comprises one or more of the following information: a CQE, an ACK message, and near-end device primary-backup switching information.
[0197] Those skilled in the art should understand that, Figure 13 The implementation function of each unit in the data transmission apparatus 1300 shown can be understood with reference to the related description of the foregoing method. Figure 13 The function of each unit in the data transmission apparatus 1300 shown can be implemented by a program running on a processor, or by a specific logic circuit.
[0198] The embodiment of the present application further provides a data transmission device 1400, referring to Figure 14 The data transmission device 1400 in the embodiment is applied to a fourth device and comprises:
[0199] The third processing unit is further configured to send an ACK message to the first device when the third device fails in the process of transmitting the target data message by the first device to the third device; the ACK message comprises fourth information and fifth information; the fourth information is used to indicate that the target data message receiving device is changed from the third device to the fourth device; and the fifth information is used to indicate the PSN of the last data message successfully received.
[0200] The third processing unit is further configured to receive the target data message transmitted by the first device.
[0201] In the embodiment of the present application, the first device and the third device interact through the RoCEv2 protocol; the first device and the fourth device interact through the RoCEv2 protocol; the first device is a near-end master device, the third device is a far-end master device, and the fourth device is a far-end backup device; the third processing unit is configured to receive second synchronization information sent by the third device, and update data transmission information according to the second synchronization information; the second synchronization information comprises one or more of the following information: CQE, ACK message and near-end device master / backup switching information.
[0202] Those skilled in the art should understand that Figure 14 The implementation functions of the units in the data transmission device 1400 shown can be understood with reference to the related descriptions of the foregoing method. Figure 14 The functions of the units in the data transmission device 1400 shown can be implemented through programs running on the processor, or through specific logic circuits.
[0203] The embodiment of the present application further provides a data transmission device 1500, referring to Figure 15 The data transmission device 1500 in the embodiment is applied to a first device and comprises:
[0204] The fourth processing unit is configured to receive an ACK message sent by a fourth device in the process of transmitting a target data message to a third device; the ACK message comprises fourth information and fifth information; the fourth information is used to indicate that the target data message receiving device is changed from the third device to the fourth device; and the fifth information is used to indicate the PSN of the last data message successfully received.
[0205] The fourth processing unit is further configured to transmit the target data message to the fourth device based on the ACK message.
[0206] In the embodiments of the present application, the first device and the third device interact through the RoCEv2 protocol; the first device and the fourth device interact through the RoCEv2 protocol; the first device is a near-end master device, the third device is a far-end master device, and the fourth device is a far-end backup device; the fourth processing unit is configured to send first synchronization information to a second device; the second device is a near-end backup device; and the first synchronization information includes one or more of the following information: CQE, ACK message, and master-backup switching information of a far-end device.
[0207] Those skilled in the art should understand that, Figure 15 The implementation functions of the units in the data transmission apparatus 1500 shown can be understood with reference to the related descriptions of the foregoing methods. Figure 15 The functions of the units in the data transmission apparatus 1500 shown can be implemented through programs running on the processor, or through specific logic circuits.
[0208] Figure 16 An electronic device 1600 is shown in the schematic structural diagram. Figure 16 The electronic device 1600 shown includes a processor 1610, which can invoke and run computer programs from a memory to implement the methods in the embodiments of the present application.
[0209] Optionally, as shown, Figure 16 The electronic device 1600 shown can further include a memory 1620. The processor 1610 can invoke and run computer programs from the memory 1620 to implement the methods in the embodiments of the present application.
[0210] The memory 1620 can be a separate device independent of the processor 1610, or can be integrated in the processor 1610.
[0211] Optionally, as shown, Figure 16 The electronic device 1600 shown can further include a transceiver 1630, which the processor 1610 can control to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices.
[0212] The transceiver 1630 can include a transmitter and a receiver. The transceiver 1630 can further include an antenna, and the number of antennas can be one or more.
[0213] The electronic device 1600 can be specifically the data transmission apparatus 1200 / data transmission apparatus 1300 / data transmission apparatus 1400 / data transmission apparatus 1500 of the embodiments of the present application, and can implement the corresponding processes in the various methods of the embodiments of the present application implemented by the data transmission apparatus 1200 / data transmission apparatus 1300 / data transmission apparatus 1400 / data transmission apparatus 1500. For brevity, details are not repeated here.
[0214] Exemplarily, the embodiments of the present application also provide a computer program product, comprising a computer program executable by the processor 1610 of the electronic device 1600 to complete the steps of any of the preceding methods.
[0215] Figure 17 is a schematic structural diagram of a chip of the embodiments of the present application. Figure 17 The chip 1700 shown includes a processor 1710, which can call and run a computer program from a memory to implement the method in the embodiments of the present application.
[0216] Optionally, as shown in Figure 17 The chip 1700 can also include a memory 1720. The processor 1710 can call and run a computer program from the memory 1720 to implement the method in the embodiments of the present application.
[0217] The memory 1720 can be a separate device independent of the processor 1710, or can be integrated in the processor 1710.
[0218] Optionally, the chip 1700 can also include an input / output interface 1730. The processor 1710 can control the input / output interface 1730 to communicate with other devices or chips, and specifically can obtain information or data sent by other devices or chips.
[0219] Optionally, the chip 1700 can also include an output interface 1740. The processor 1710 can control the output interface 1740 to communicate with other devices or chips, and specifically can output information or data to other devices or chips.
[0220] The chip can be applied to the electronic device 1600 in the embodiments of the present application, and the chip can implement the corresponding processes in the various methods of the embodiments of the present application implemented by the electronic device 1600. For brevity, details are not repeated here.
[0221] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.
[0222] It should be understood that the processor of the embodiments of the present application can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the method embodiments described above can be completed by the integrated logic circuit of hardware in the processor or the instructions in the form of software. The processor described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware coding processor for execution, or a combination of hardware and software modules in the coding processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the storage, and the processor reads the information in the storage, and combines the hardware to complete the steps of the above method.
[0223] It is to be understood that the memory in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the system and method described herein is intended to include, but not limited to, these and any other suitable types of memory.
[0224] It should be understood that the above-mentioned memory is exemplary but not limiting, for example, the memory in the embodiments of the present application can also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and the like. That is, the memory in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0225] The embodiment of the present application further provides a storage medium for storing a computer program. The storage medium can be applied to the electronic device 1600 in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process realized by the electronic device 1600 in each method of the embodiment of the present application. For brevity, details are not repeated here.
[0226] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0227] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0228] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical network element division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0229] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0230] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0231] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or an electronic device 1600, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data transmission method, characterized in that, Applied to a second device, including: During the transmission of a target data packet from the first device to the third device, if the first device malfunctions, it sends a first data packet to the third device. The first data packet includes first information, which is used to indicate that the target data packet sending device is changed from the first device to the second device. The first data packet is the data packet in the target data packet. Receive the ACK message sent by the third device; Based on the ACK message, the target data packet is transmitted to the third device.
2. The method according to claim 1, characterized in that, The first device and the third device interact via the RoCEv2 protocol; the second device and the third device interact via the RoCEv2 protocol; the first device is a near-end master device, the second device is a near-end backup device, and the third device is a remote master device.
3. The method according to claim 2, characterized in that, The first data packet is the data packet that should be sent in the current sending window of the second device.
4. The method according to claim 2, characterized in that, The ACK message includes second information, which represents the PSN of the last data packet successfully received by the third device; The step of transmitting the target data packet to the third device according to the ACK message includes: Based on the ACK message, a second data packet is sent to the third device; The second data packet is the next data packet after the last data packet successfully received by the third device.
5. The method according to claim 4, characterized in that, The ACK message also includes third information; the third information indicates that the peer device in the queue pair QP of the third device has been changed to the second device.
6. The method according to claim 5, characterized in that, The first information and / or the third information are represented by reserved field 7 in the RoCEv2 protocol message.
7. The method according to any one of claims 2 to 6, characterized in that, The first device and the second device have the same transmission task; The first device and the second device have the same partition; The first device and the second device transmit data using a backup mapping table; the backup mapping table includes device information of the first device and the second device. The device information includes address information and QP number; The method further includes: The device receives first synchronization information sent by the first device and updates the data transmission information of the second device based on the first synchronization information; wherein, the first synchronization information includes one or more of the following: completion queue event CQE, ACK message, and master / slave switchover information of the remote device.
8. The method according to any one of claims 1 to 6, characterized in that, The queue pair context (QPC) of the third device contains the device information of the second device; the device information includes device address information and QP number.
9. A data transmission method, characterized in that, Applied to third-party devices, including: During the process of receiving the target data packet transmitted by the first device, a first data packet sent by the second device is received; the first data packet includes first information, which is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is the data packet in the target data packet. Based on the first data packet, the peer device in QP is changed to the second device; an ACK packet is sent to the second device; the ACK packet includes second information, which represents the PSN of the last data packet successfully received by the third device; Receive the target data packet transmitted by the second device.
10. The method according to claim 9, characterized in that, The first device and the third device interact via the RoCEv2 protocol; the second device and the third device interact via the RoCEv2 protocol; the first device is a near-end master device, the second device is a near-end backup device, and the third device is a remote master device.
11. The method according to claim 10, characterized in that, Sending an ACK message to the second device includes: If the PSN of the first data packet is the PSN that the third device expects to receive, then send an ACK packet of the first data packet to the second device; If the PSN of the first data packet is not the PSN that the third device expects to receive, then the last ACK packet that has been sent is resent to the second device.
12. The method according to claim 10, characterized in that, The ACK message also includes third information; the third information indicates that the peer device in the QP of the third device has been changed to the second device.
13. The method according to claim 12, characterized in that, The first information and / or the third information are represented by reserved field 7 in the RoCEv2 protocol message.
14. The method according to any one of claims 9 to 13, characterized in that, The QPC of the third device contains the device information of the second device; the device information includes address information and QP number.
15. The method according to any one of claims 9 to 13, characterized in that, Also includes: Send second synchronization information to the fourth device; the fourth device is a remote backup device; the second synchronization information includes one or more of the following: CQE, ACK messages and primary / backup switching information of the near-end device.
16. A data transmission method, characterized in that, Applied to the fourth device, including: During the transmission of a target data packet from the first device to the third device, if the third device malfunctions, it sends an ACK message to the first device. The ACK message includes fourth and fifth information. The fourth information is used to indicate that the target data packet receiving device has changed from the third device to the fourth device. The fifth information is used to indicate the PSN of the last successfully received data packet. Receive the target data packet transmitted by the first device.
17. The method according to claim 16, characterized in that, The first device interacts with the third device via the RoCEv2 protocol; the first device interacts with the fourth device via the RoCEv2 protocol; the first device is a near-end master device, the third device is a remote master device, and the fourth device is a remote backup device; the method further includes: The device receives second synchronization information sent by a third device and updates the data transmission information based on the second synchronization information. The second synchronization information includes one or more of the following: CQE, ACK messages, and near-end device master / slave switching information.
18. A data transmission method, characterized in that, Applied to the first device, including: During the transmission of a target data packet to a third device, an ACK packet is received from a fourth device. The ACK packet includes fourth information and fifth information. The fourth information is used to indicate that the target data packet receiving device has changed from the third device to the fourth device. The fifth information is used to indicate the PSN of the last successfully received data packet. The target data packet is transmitted to the fourth device based on the ACK message.
19. The method according to claim 18, characterized in that, The first device interacts with the third device via the RoCEv2 protocol; the first device interacts with the fourth device via the RoCEv2 protocol; the first device is a near-end master device, the third device is a remote master device, and the fourth device is a remote backup device; the method further includes: Send first synchronization information to the second device; the second device is a near-end backup device; wherein, the first synchronization information includes one or more of the following: CQE, ACK messages and master / slave switching information of the remote device.
20. A data transmission device, applied to a second device, characterized in that, include: First processing unit: used to send a first data packet to the third device when the first device malfunctions during the transmission of the target data packet from the first device to the third device; The first data packet includes first information, which is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet; The first processing unit is further configured to receive an ACK message sent by the third device; The first processing unit is further configured to transmit the target data packet to the third device based on the ACK message.
21. A data transmission device, applied to a third device, characterized in that, include: Second processing unit: used to receive the first data packet sent by the second device during the process of receiving the target data packet transmitted by the first device; The first data packet includes first information, which is used to indicate that the target data packet sending device is changed from the first device to the second device; the first data packet is a data packet in the target data packet; The second processing unit is further configured to change the peer device in QP to the second device according to the first data packet; Send an ACK message to the second device; the ACK message includes second information, which represents the PSN of the last data packet successfully received by the third device; The second processing unit is further configured to receive the target data packet transmitted by the second device.
22. A data transmission device, applied to a fourth device, characterized in that, include: The third processing unit is used to send an ACK message to the first device when the third device malfunctions during the transmission of a target data packet from the first device to the third device. The ACK message includes fourth and fifth information. The fourth information is used to indicate that the target data packet receiving device has been changed from the third device to the fourth device. The fifth information is used to indicate the PSN of the last successfully received data packet. The third processing unit is further configured to receive the target data packet transmitted by the first device.
23. A data transmission device, applied to a first device, characterized in that, include: Fourth processing unit: used to receive ACK messages sent by the fourth device during the transmission of target data packets to the third device; The ACK message includes a fourth message and a fifth message. The fourth message is used to indicate that the target data packet receiving device has been changed from the third device to the fourth device. The fifth message is used to indicate the PSN of the last successfully received data packet. The fourth processing unit is further configured to transmit the target data packet to the fourth device based on the ACK message.
24. An electronic device, characterized in that, include: A processor and a memory, the memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the data transmission method as described in any one of claims 1 to 8, or the data transmission method as described in any one of claims 9 to 15, or the data transmission method as described in any one of claims 16 to 17, or the data transmission method as described in any one of claims 18 to 19.
25. A chip, characterized in that, include: A processor for retrieving and running a computer program from memory, causing a device having the chip mounted to perform the data transmission method of any one of claims 1 to 8, or the data transmission method of any one of claims 9 to 15, or the data transmission method of any one of claims 16 to 17, or the data transmission method of any one of claims 18 to 19.
26. A storage medium, characterized in that, Used to store a computer program that causes a computer to perform the data transmission method as described in any one of claims 1 to 8, or the data transmission method as described in any one of claims 9 to 15, or the data transmission method as described in any one of claims 16 to 17, or the data transmission method as described in any one of claims 18 to 19.
27. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data transmission method as described in any one of claims 1 to 8, or the data transmission method as described in any one of claims 9 to 15, or the data transmission method as described in any one of claims 16 to 17, or the data transmission method as described in any one of claims 18 to 19.
Citation Information
Patent Citations
Communication method and communication equipment
CN113660161A
Data communication security management method and device, electronic equipment and storage medium
CN118741492A