WO2025201534A1 - 一种丢包恢复方法、接收端设备、发送端设备及存储介质 - Google Patents

一种丢包恢复方法、接收端设备、发送端设备及存储介质

Info

Publication number
WO2025201534A1
WO2025201534A1 PCT/CN2025/085872 CN2025085872W WO2025201534A1 WO 2025201534 A1 WO2025201534 A1 WO 2025201534A1 CN 2025085872 W CN2025085872 W CN 2025085872W WO 2025201534 A1 WO2025201534 A1 WO 2025201534A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
data packets
packet
redundant repair
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/085872
Other languages
English (en)
French (fr)
Inventor
杨红伟
朱树永
左天宇
李文啸
张玉军
赵广宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Research Institute of China Mobile Communication Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Research Institute of China Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, Research Institute of China Mobile Communication Co Ltd filed Critical China Mobile Communications Group Co Ltd
Publication of WO2025201534A1 publication Critical patent/WO2025201534A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Definitions

  • a RDMA Network Data Transmission Method Based on Erasure Codes proposes to reduce transmission latency through fine-grained transmission and multi-path parallel transmission.
  • this method has the following disadvantages in the wide area network RDMA transmission scenario: (1) The receiving end notifies the sending end to perform erasure code encoding and check block transmission after discovering RDMA transmission packet loss.
  • the receiving end must wait for the requested check block to be completely received before it can recover the lost RDMA data packet, resulting in a large amount of additional transmission latency; (2)
  • the transmission of redundant data requires the use of additional (Queue Pair, QP) queue pairs, which requires the use of more RDMA network card hardware resources, reducing resource utilization.
  • QP Quality of Packe Pair
  • the implementing legislation of this application provides a packet loss recovery method, a receiving device, a sending device and a storage medium, which can perform real-time packet loss recovery without consuming additional CPU resources and RDMA network card hardware resources, thereby improving resource utilization.
  • an embodiment of the present application provides a packet loss recovery method, which is applied to a receiving device and includes:
  • Recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet.
  • an embodiment of the present application provides a packet loss recovery method, which is applied to a transmitting device and includes:
  • the m data packets and the corresponding r redundant repair data packets are respectively sent to a receiving end device, so that the receiving end device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets.
  • an embodiment of the present application provides a receiving device, the receiving device comprising: an identification and recovery module,
  • the identification and recovery module is used to receive m data packets and r redundant repair data packets sent by a sending device; wherein m and r are both positive integers; and is also used to determine r first target decoding values based on the m data packets when packet loss is determined based on the m data packets; and is further used to perform recovery processing based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packets.
  • the first memory is used to store a computer program that can be run on the processor
  • the redundancy generation module is configured to receive s original data packets sent by a remote direct memory access (RDMA) protocol stack module, and group the s original data packets to obtain q original data packet groups; wherein the q original data packet groups each include m data packets, and s, m, and q are all positive integers; and to determine r corresponding redundant repair data packets based on the m data packets; wherein r is a positive integer; and to send the m data packets and the corresponding r redundant repair data packets to a receiving device, respectively, so that the receiving device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain lost data packets.
  • RDMA remote direct memory access
  • an embodiment of the present application provides a transmitting end device, the transmitting end device comprising: a second processor and a second memory; wherein,
  • the second memory is used to store a computer program that can be run on the processor
  • an embodiment of the present application provides a computer-readable storage medium, characterized in that computer program code is stored on the storage medium, and when the computer program code is executed by a computer, the packet loss recovery method as described above is implemented.
  • an embodiment of the present application provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, it implements the packet loss recovery method as described above.
  • An embodiment of the present application provides a packet loss recovery method, a receiving device, a sending device, and a storage medium, wherein the receiving device receives m data packets and r redundant repair data packets sent by the sending device; wherein m and r are both positive integers; when packet loss is determined based on the m data packets, r first target decoding values are determined based on the m data packets; recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet; the sending device receives s original data packets sent by the RDMA protocol stack module, and grouping the s original data packets to obtain q original data packet groups; wherein the q original data packet groups each include m data packets, and s, m, and q are all positive integers; corresponding r redundant repair data packets are determined based on the m data packets; wherein r is a positive integer; the m data packets and the corresponding r redundant repair data packet
  • the receiving device can receive m data packets and r redundant repair data packets at the same time. If packet loss is detected, recovery processing can be performed based on the r redundant repair data packets and r first target decoding values to obtain the lost data packet, thereby enabling real-time packet loss recovery.
  • the receiving device does not need to request the sending device to retransmit the lost data packet after detecting data packet loss, thereby avoiding delay problems.
  • the present application can determine r first target decoding values based on m data packets; and then recovery processing can be performed based on r redundant repair data packets and r first target decoding values without the CPU participating in the recovery processing, thereby saving valuable CPU resources.
  • the m data packets and r redundant repair data packets are received simultaneously by the receiving device, so there is no need to introduce a new QP queue pair, thereby reducing the use of RDMA network card hardware resources and improving resource utilization.
  • FIG1 is a schematic diagram of a packet loss recovery method according to an embodiment of the present application.
  • FIG2 is a second schematic diagram of the packet loss recovery method proposed in an embodiment of the present application.
  • FIG3 is a third schematic diagram of the packet loss recovery method proposed in an embodiment of the present application.
  • FIG4 is a schematic diagram of the structure of a redundant repair data packet proposed in an embodiment of the present application.
  • FIG5 is a fourth schematic diagram of the packet loss recovery method proposed in an embodiment of the present application.
  • FIG6 is a schematic diagram of the workflow of the WAN RDMA real-time packet loss recovery technology based on forward error correction proposed in an embodiment of the present application;
  • FIG7 is a schematic diagram of the structure of a forward error correction redundancy generation module proposed in an embodiment of the present application.
  • FIG8 is a schematic diagram of the structure of a packet loss identification and recovery module at the receiving end proposed in an embodiment of the present application.
  • FIG9 is a schematic diagram of switching conditions between three states proposed in an embodiment of the present application.
  • FIG10 is a schematic diagram of the first structure of a receiving device according to an embodiment of the present application.
  • FIG11 is a second schematic diagram of the structure of the receiving end device proposed in an embodiment of the present application.
  • FIG12 is a schematic diagram of the first structure of a transmitting end device according to an embodiment of the present application.
  • FIG13 is a second schematic diagram of the composition structure of the sending end device proposed in an embodiment of the present application.
  • RDMA Remote Direct Memory Access
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • RDMA eliminates the need to copy data to the operating system buffer via the RDMA network card, transferring data directly between application memories. This saves significant CPU (Central Processing Unit) resources, while improving system throughput and reducing network communication latency.
  • CPU Central Processing Unit
  • the RDMA protocol uses a Go-Back-N (GBN) retransmission mechanism to address packet loss. Packet loss can lead to a rapid degradation of RDMA transmission performance.
  • GBN Go-Back-N
  • WANs wide area networks
  • Packet loss caused by traffic congestion and other factors in WAN environments hinders the efficient deployment and application of RDMA transmission technology. Therefore, research is needed on real-time packet loss recovery techniques during RDMA transmission over WANs to mitigate the performance degradation caused by packet loss.
  • FEC forward error correction
  • the patent "A RDMA Network Data Transmission Method Based on Erasure Codes” discloses a method for reducing transmission delay through fine-grained transmission and multi-path parallel transmission, and using erasure codes to eliminate the long tail effect of network transmission and simplify the reordering operation at the receiving end.
  • the erasure code hardware of the RDMA network card is used to offload the calculation of the erasure code, thereby reducing CPU computing overhead.
  • this method has the following disadvantages in the wide area network RDMA transmission scenario: (1) The receiving end notifies the sending end to perform erasure code encoding and check block transmission after discovering that the RDMA transmission has lost packets.
  • the receiving end must wait for the requested check block to be completely received before it can recover the lost RDMA data packet, resulting in a significant additional transmission delay; (2)
  • the transmission of redundant data requires the use of additional (Queue Pair, QP) queue pairs, which requires the use of more RDMA network card hardware resources, reducing resource utilization.
  • QP Quality of Packe Pair
  • the RDMA network data transmission method has a delay problem when performing packet loss recovery, and consumes additional CPU resources and RDMA network card hardware resources, thereby reducing resource utilization.
  • embodiments of the present application provide a packet loss recovery method, a receiving device, a sending device, and a storage medium.
  • the receiving device receives m data packets and r redundant repair data packets sent by a sending device, wherein m and r are both positive integers.
  • m and r are both positive integers.
  • r first target decoding values are determined based on the m data packets.
  • Recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet.
  • the sending device receives s original data packets sent by an RDMA protocol stack module and grouping the s original data packets to obtain q original data packet groups, wherein the q original data packet groups each include m data packets, and s, m, and q are all positive integers.
  • R corresponding redundant repair data packets are determined based on the m data packets, wherein r is a positive integer.
  • the m data packets and the corresponding r redundant repair data packets are respectively sent to the receiving device, so that the receiving device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packet.
  • the receiving device can receive m data packets and r redundant repair data packets at the same time. If packet loss is detected, recovery processing can be performed based on the r redundant repair data packets and r first target decoding values to obtain the lost data packet, thereby enabling real-time packet loss recovery. The receiving device does not need to request the sending device to retransmit the lost data packet after detecting data packet loss, thereby avoiding the delay problem.
  • r first target decoding values can be determined based on m data packets; and then recovery processing can be performed based on the r redundant repair data packets and r first target decoding values without the CPU participating in the recovery processing, thereby saving valuable CPU resources.
  • the m data packets and r redundant repair data packets are received simultaneously by the receiving device, so there is no need to introduce a new QP queue pair, thereby reducing the use of RDMA network card hardware resources and improving resource utilization.
  • the present application provides a packet loss recovery method, which is applied to a receiving device.
  • the receiving device may include an identification and recovery module.
  • FIG1 is a schematic diagram of the packet loss recovery method proposed in the present application. As shown in FIG1 , the packet loss recovery method may include the following steps:
  • Step 101 Receive m data packets and r redundant repair data packets sent by a sending device; where m and r are both positive integers.
  • a receiving device may receive m data packets and r redundant repair data packets sent by a sending device; wherein m and r are both positive integers.
  • the receiving device may be a receiving RDMA network card, and the present application does not specifically limit the type of the receiving device.
  • the newly added identification and recovery module of the present application works on the receiving-end RDMA network card, so it does not add additional CPU burden, thereby saving CPU resources.
  • FIG2 is a second schematic diagram of the packet loss recovery method proposed in the embodiment of the present application.
  • the receiving device may further include the following steps:
  • Step 104 When the value of the first preset field in the m data packets is the first preset value, determine that the identity information corresponding to the m data packets is the redundant repair data packet identity; when the value of the first preset field in the m data packets is not the first preset value, determine that the identity information corresponding to the m data packets is the original data packet identity; when the value of the second preset field in the r redundant repair data packets is the first preset value, determine that the identity information corresponding to the r redundant repair data packets is the redundant repair data packet identity; when the value of the second preset field in the r redundant repair data packets is not the first preset value, determine that the identity information corresponding to the r redundant repair data packets is the original data packet identity.
  • the identification and recovery module in the receiving device can determine the packet sequence number (PSN) corresponding to the f-th data packet among m data packets; wherein f is a positive integer less than or equal to m; when the PSN corresponding to the f-th data packet is different from the preset PSN, it is determined that packet loss occurs.
  • PSN packet sequence number
  • the identification and recovery module in the receiving device determines that the PSN corresponding to the f-th data packet among m data packets is 60, and assuming that the preset PSN is 55, if the PSN corresponding to the f-th data packet is different from the preset PSN, it can be considered that packet loss occurs.
  • the identification and recovery module in the receiving device can determine that the state of the receiving device is an ordered state when the first data packet among the m data packets received is the first data packet of the current group; accordingly, when there is packet loss among the m data packets, the state of the receiving device can be updated to a disordered state; when there is no packet loss among the m data packets, the state of the receiving device can be maintained in an ordered state.
  • the identification and recovery module in the receiving device can determine that the state of the receiving device is an ordered state when the first data packet among the 128 data packets received is the first data packet of the current group, that is, the first data packet in the new group. If there is packet loss among the m data packets, the state of the receiving device can be updated to a disordered state; if there is no packet loss among the m data packets, the state of the receiving device can be maintained in an ordered state.
  • the first preset condition may be that the number of packet losses is greater than r, where r is a positive integer.
  • the present application does not specifically limit the size of r.
  • the second preset condition may include that the source segment starting point (Source Start) PSN field of the redundant repair data packet does not match the PSN field of the first original data packet of the current group of the receiving end, and/or, the receiving end device is in a failed state (invalid state), and/or, the receiving end is in an unordered state, but has received all k original data packets related to the generation of the redundant repair data packet, and/or, the receiving end is in an ordered state, but the received redundant repair data packets are not sufficient to restore the lost original data packets (the number of lost packets meets the first preset condition), and/or, the receiving end device is in an ordered state and has received all the original data packets in the current group.
  • Source Start source segment starting point
  • Step 102 When it is determined based on the m data packets that packet loss occurs, r first target decoding values are determined based on the m data packets.
  • the identification and recovery module in the receiving device can determine r first target decoding values based on the m data packets when it is determined that packet loss exists based on the m data packets.
  • the m data packets can be grouped to determine r data packet groups; wherein each data packet group includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet... the i+[(m/r)-1] ⁇ r-th data packet among the m data packets, where i is an integer greater than or equal to 0 and less than or equal to r-1; and then the corresponding r first target decoding values can be determined based on the r data packet groups.
  • the identification and recovery module in the receiving device can receive the first set of data sent by the redundancy generation module in the sending device, that is, 128 data packets and 8 redundant repair data packets, and then the 128 data packets can be grouped to determine 8 data packet groups, each of which includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet...
  • the first data packet group includes the 0th data packet, the 8th data packet, the 16th data packet... the 0th+[(128/8)-1] ⁇ 8 data packets, assuming i is 1, the second data packet group includes the 1st data packet, the 9th data packet, the 17th data packet...
  • RDMA(i) represents the i-th data packet
  • RDMA(i+r) represents the i+r-th data packet
  • the identification and recovery module can perform an XOR operation on the 16th data packet and DEC(0), that is, update DEC(0) to obtain a second decoding value, assuming that i is 1, when the 17th data packet is received, the 17th data packet and DEC(1) can be XORed, that is, DEC(1) is updated to obtain a second decoding value, ..., until i is 7, when the 23rd data packet is received, the 23rd data packet and DEC(7) can be XORed, that is, DEC(7) is updated to obtain a second decoding value, thereby completing the update process of the 8 first decoding values and obtaining 8 second decoding values.
  • the redundancy generation module in the sending device when it determines the corresponding r data packet groups based on m data packets, it can group the m data packets to determine r data packet groups; wherein each data packet group includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet... the i+[(m/r)-1] ⁇ r-th data packet among the m data packets, where i is an integer greater than or equal to 0 and less than or equal to r-1.
  • FIG4 is a schematic diagram of the redundant repair data packet structure proposed in an embodiment of the present application.
  • the redundant repair data packet includes a first header field; the first header field may be a Repair Header header field, and may also include an Ethernet field, an Internet Protocol (IP) field, a User Datagram Protocol (UDP) field, a Redundancy Payload field, and an ICRC field; wherein, the first header field may include at least a second preset field, a third preset field, a fourth preset field, a fifth preset field, a sixth preset field, and a seventh preset field; the second preset field may be an RC_RDMA_REPAIR field, the third preset field may be a Destination QP field, the fourth preset field may be a Source start PSN field, the fifth preset field may be a Shift size field, the sixth preset field may be a Total repairs number field, and the seventh preset field may be a
  • IP Internet Protocol
  • UDP User Datagram Protocol
  • Step 203 Send the m data packets and the corresponding r redundant repair data packets to the receiving device respectively, so that the receiving device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets.
  • the redundancy generation module in the sending device determines the corresponding r redundant repair data packets based on the m data packets, it can send the m data packets and the corresponding r redundant repair data packets to the receiving device respectively, so that the receiving device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets.
  • the redundancy generation module in the sending device can group m data packets to determine r data packet groups, and then determine corresponding r redundant repair data packets based on the r data packet groups.
  • the m data packets and the corresponding r redundant repair data packets can then be sent together to the receiving device, so that the receiving device can perform packet loss recovery based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets without introducing new QP queue pairs. Therefore, no modifications need to be made to the application, maintaining compatibility with existing applications. At the same time, there is no need to consume more RDMA network card hardware resources, reducing resource utilization.
  • An embodiment of the present application provides a packet loss recovery method, which is applied to a sending device, wherein the sending device receives s original data packets sent by an RDMA protocol stack module, and groups the s original data packets to obtain q original data packet groups; wherein the q original data packet groups each include m data packets, and s, m, and q are all positive integers; r corresponding redundant repair data packets are determined based on the m data packets; wherein r is a positive integer; the m data packets and the corresponding r redundant repair data packets are respectively sent to a receiving device, so that the receiving device performs packet loss recovery based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets.
  • the sending device can determine the corresponding r redundant repair data packets based on the m data packets, and then can send the m data packets and the corresponding r redundant repair data packets together to the receiving device, so that the receiving device performs packet loss recovery based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packets, without introducing a new QP queue pair, and therefore without making any modifications to the application, maintaining compatibility with existing applications, and without consuming more RDMA network card hardware resources, thereby reducing resource utilization.
  • FIG5 is a fourth schematic diagram of the packet loss recovery method proposed in the embodiment of the present application.
  • the packet loss recovery method may include the following steps:
  • Step 301 The sending end device receives s original data packets sent by the RDMA protocol stack module and performs grouping processing on the s original data packets to obtain q original data packet groups; wherein the q original data packet groups each include m data packets, and s, m and q are all positive integers.
  • the sending end device may include a redundancy generation module.
  • the newly added redundancy generation module of the present application works on the sending end RDMA network card, which does not increase the additional CPU burden, thereby saving CPU resources.
  • the redundancy generation module in the sending device receives 1152 original data packets sent by the RDMA protocol stack module, and can group the same RDMA transmission data stream.
  • 9 original data packet groups can be obtained by grouping 128 original data packets per group, that is, each original data packet group includes 128 original data packets.
  • Step 302 The transmitting device determines r corresponding redundant repair data packets based on the m data packets, where r is a positive integer.
  • the redundancy generation module in the sending device determines the corresponding r redundant repair data packets based on m data packets, it can determine the corresponding r data packet groups based on the m data packets; and then it can determine the corresponding r redundant repair data packets based on the r data packet groups.
  • the redundancy generation module in the sending device when it determines the corresponding r data packet groups based on m data packets, it can group the m data packets to determine r data packet groups; wherein each data packet group includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet... the i+[(m/r)-1] ⁇ r-th data packet among the m data packets, where i is an integer greater than or equal to 0 and less than or equal to r-1.
  • the 128 data packets can be grouped to determine 8 data packet groups, each of which includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet...the i+[(m/r)-1] ⁇ r-th data packet in the 128 data packets, where i is an integer greater than or equal to 0 and less than or equal to 7; assuming that i is 0, the first data packet group includes the 0th data packet, the 8th data packet, the 16th data packet...the 0th+[(128/8)-1] ⁇ 8 data packets; assuming that i is 1, the second data packet group includes the 1st data packet, the 9th data packet, the 17th data packet...the 1st+[(128/8)-1] ⁇ 8 data packets, until
  • r first code values can be determined based on the i-th data packet and the i+r-th data packet; after receiving the i+2r-th data packet, the r first code values can be updated based on the i+2r-th data packet to obtain r second code values; until the i+[(m/r)-1] ⁇ r-th data packet is received, the r N-th code values can be updated based on the i+[(m/r)-1] ⁇ r-th data packet to obtain r first target code values; wherein the r N-th code values are obtained by updating the r N-1-th code values based on the i+[(m/r)-2] ⁇ r-th data packet; and then the corresponding r redundant repair data packets
  • the redundancy generation module when determining r first coding values based on the i-th data packet and the i+r-th data packet, as shown in the above formula (3), the i-th data packet and the i+r-th data packet can be subjected to an XOR operation, thereby obtaining r first coding values, for example, XOR(0), XOR(1), ..., XOR(r-1), respectively; i is an integer greater than or equal to 0 and less than or equal to r-1.
  • the redundancy generation module can perform an exclusive OR operation on the i+2r-th data packet and the r first code values respectively when updating the r first code values based on the i+2r-th data packet, thereby updating the r first code values and obtaining r second code values.
  • the redundancy generation module can perform an XOR operation on the 16th data packet and XOR(0), that is, update XOR(0) to obtain a second coding value, assuming that i is 1, when the 17th data packet is received, the 17th data packet can be XORed with XOR(1), that is, update XOR(1) to obtain a second coding value, ..., until i is 7, when the 23rd data packet is received, the 23rd data packet can be XORed with XOR(7), that is, update XOR(7) to obtain a second coding value, thereby completing the update process of the 8 first coding values and obtaining 8 second coding values.
  • the receiving device when it determines r first target decoding values based on m data packets, it can group the m data packets to determine r data packet groups; wherein each data packet group includes the i-th data packet, the i+r-th data packet, the i+2r-th data packet... the i+[(m/r)-1] ⁇ r-th data packet among the m data packets, where i is an integer greater than or equal to 0 and less than or equal to r-1; and then the corresponding r first target decoding values can be determined based on the r data packet groups.
  • FIG. 6 is a workflow diagram of the wide area network RDMA real-time packet loss recovery technology based on forward error correction proposed in an embodiment of the present application.
  • the sending end device includes an RDMA protocol stack and a forward error correction redundancy generation module (redundancy generation module)
  • the receiving end device may include an RDMA protocol stack and a packet loss identification and recovery module (identification and recovery module).
  • the main function of the forward error correction redundancy generation module (redundancy generation module) at the sending end is: to perform forward error correction encoding on the original data packet sent by the RDMA protocol stack at the sending end, generate redundant repair data packets and send them to the receiving end together with the original data packets;
  • the main function of the packet loss identification and recovery module (identification recovery module) at the receiving end is: to determine whether the original data packet is lost according to the PSN field in the header of the RDMA original data packet received from the lossy wide area network, to temporarily store the disordered original data packets caused by the packet loss by using the reordering buffer, and to instantly recover the lost original data packets by using the redundant repair data packets that arrive at the receiving end together with the original data packets, and to transmit the recovered ordered and lossless original data packets to the RDMA protocol stack module at the receiving end.
  • the working principle of the forward error correction redundancy generation module (redundancy generation module) at the sending end is as follows: the sending end divides the same RDMA transmission data stream into groups. During the data transmission process of the RDMA protocol stack, the packet sequence number (PSN) of all RDMA original data packets in the same data stream is continuously incremented when no loss occurs. In order to effectively generate redundant repair data packets, a redundancy calculation method based on groups is adopted to group the data packets according to their PSNs. When grouping, according to the specified group size, an appropriate first PSN is selected to align the groups, thereby ensuring that it is possible to accurately determine whether two data packets belong to the same group based on the PSN and group size.
  • PSN packet sequence number
  • each redundant repair data packet XOR(i) generated by the same group has the following relationship with the data packet DATA(i) in the same group.
  • the generated r redundant repair data packets are sent to the receiving end corresponding to the current group before the RDMA original data packet of the next group is sent.
  • the receiving-end packet loss identification and recovery module operates as follows: upon receiving any data packet from the sending end, the receiving end first determines the packet type, i.e., whether it is an original packet or a redundant repair packet, based on the RDMA operation code field in the packet header. Based on the packet type determination, the receiving end will take different processing actions depending on its current state.
  • the ordered state indicates that all received data packets are in order and have been passed to the receiving end's RDMA protocol stack;
  • the reordered (out of order) state indicates that the RDMA data packet currently being processed has been lost, so the original data packets received subsequently are stored in the reordering buffer, and a bitmap is used to identify whether they exist;
  • the invalid (invalid) state indicates that the current packet has been irrecoverably lost, and all the data in the reordering buffer has been passed to the receiving end's RDMA protocol stack.
  • the decoding principle at the receiving end is consistent with the encoding process at the transmitting end. Both fully utilize the divisible nature of the XOR calculation to disperse the XOR redundant repair calculation into each individual data packet reception process. To achieve this goal, the receiving end needs to pre-set r storage units DEC(0) to DEC(r). These storage units are the same size as the redundant repair data packets and are used to store the intermediate results of the receiving end's XOR redundant repair calculation process. The initial value of each storage unit DEC(i) is 0.
  • the receiving end will use the redundant repair data packet XOR(i) and DEC(i) to perform an exclusive OR operation.
  • the result obtained will be the lost original data packet RDMA(i+p*r).
  • the reordering buffer submits the repaired ordered original data packet to the RDMA protocol stack of the receiving end.
  • the present application sets up q shared reorder buffers, each of which is equal to the size of one encoding packet, that is, contains m data packets.
  • Each reorder buffer is equipped with a timeout timer, which is updated when a new data packet enters the reorder buffer. If the timer times out, all data in the reorder buffer will be passed to the receiving end's RDMA protocol stack.
  • the processing flow involved in receiving an RDMA original data packet at the receiving end is as follows: (1) If the received original data packet does not belong to the current group of the receiving end, that is, the PSN indicates that the position of the data packet is outside the current group, the receiving end can make the following judgments: a. If the PSN position of the original data packet is greater than r, it means that more than r data packets have been lost in front of it. In this case, the redundancy mechanism cannot recover these lost data packets. Therefore, the receiving end will directly pass the data packet to the RDMA protocol stack and trigger the retransmission mechanism of the RDMA protocol stack. The receiving end enters the failure state at the same time; b.
  • the receiving end will pass the data packet to the reordering buffer after passing the existing data packets in the reordering buffer to the RDMA protocol stack and clearing the buffer, and at the same time update the information of the current group of the receiving end. At this time, the receiving end enters the out-of-order state; c. If the PSN of the received RDMA data packet indicates that it is the first data packet in the group, this means that a new data packet grouping has begun.
  • the receiving end will directly pass the data packet to the RDMA protocol stack, and update the information of the current packet of the receiving end, and the receiving end will enter the ordered state; (2) If the received original data packet belongs to the current packet of the receiving end, that is, the PSN indicates that the position of the data packet is within the current packet, the receiving end can make the following judgments: a. If the receiving end is in an out-of-order state, add the original data packet to the reordering buffer and update the corresponding bitmap information to mark that the data packet has been received; b.
  • the receiving end If the receiving end is in an ordered state, and the PSN of the original data packet is equal to the PSN (preset PSN) of the next ordered data packet expected by the receiving end (referred to as "EPSN"), then pass the data packet to the receiving end RDMA protocol stack and update the value of EPSN; c. If the receiving end is in an ordered state, but the PSN of the received original data packet does not match the EPSN, it means that a packet loss has occurred. In this case, the receiving end will enter an out-of-order state and add the original data packet and subsequent original data packets that may be received in the current packet to the reordering buffer; d. If the receiving end is in an invalid state, pass the original data packet directly to the receiving end RDMA protocol stack.
  • the receiving end is in an ordered state and has received all the original data packets in the current group. Data packet; (2) If the repair packet is not discarded, the redundant repair data packet will be used to repair the lost data packet: a. If the receiving end is in an ordered state, the lost original data packet recovered by the above steps will be directly transferred to the receiving end RDMA protocol stack; b. If the receiving end is in an out-of-order state, the lost original data packet recovered by the above steps will be passed to the reordering buffer, and after each repair, it will be checked whether all the lost packets of the current group have been repaired; c.
  • the group contains 128 RDMA original data packets, whose PSNs are set from 0 to 127.
  • the sending end RDMA protocol stack After the sending end RDMA protocol stack generates the RDMA original data packets of the group, all the original data packets of the group enter the sending end forward error correction redundancy generation module (redundancy generation module) to generate redundant repair data packets.
  • redundant repair data packets for forward error correction due to the characteristics of XOR calculation, it is not necessary to cache the data packets involved in the calculation.
  • RDMA(0), RDMA(8), ..., RDMA(112), and RDMA(120) as an example, when the original data packet RDMA(0) is sent through the RDMA network card, it is XOR-calculated with XOR(0) which is initially 0, and the value of XOR(0) is updated as shown in the following formula (7).
  • RDMA(8), ..., RDMA(112), and RDMA(120) are generated and sent through the RDMA network card, they are XOR-calculated with XOR(0) and the value of XOR(0) is updated.
  • the final XOR (0) (the first target code value) is the XOR calculation result of RDMA (0), RDMA (8), ..., RDMA (112), and RDMA (120).
  • the RDMA network card only needs to save the intermediate value results of the redundant repair data packets corresponding to each group, without having to save the original data of all data packets involved in the forward error correction calculation, which helps save a large amount of network card hardware resources.
  • XOR(0) XOR(0) ⁇ RDMA(0) (7)
  • the RDMA network card at the sending end will send all the redundant repair data packets XOR (0) to XOR (7).
  • a Repair Header header is added, and the various fields of the header are filled accordingly according to the context of the QP queue pair used in this RDMA transmission and the setting of the forward error correction mechanism.
  • the receiving end receives RDMA original data packets RDMA(0) to RDMA(127) with PSNs 0 to 127, and uses the received redundant repair data packets XOR(0) to XOR(7) to recover data packets lost during the reception process.
  • the RDMA original data packets with PSNs 0 to 42 and 50 to 127 and all redundant repair data packets are successfully received by the receiving end, while the RDMA data packets with PSNs 43 to 49 are lost during transmission.
  • the receiving end when the receiving end receives an RDMA data packet with a PSN equal to 1, since the receiving end has already updated the current group to the group being received, the EPSN and PSN are compared according to step b in the processing flow (2) of the data packet belonging to the current group in the original data packet processing flow. Since EPSN and PSN are both equal to 1, the receiving end will submit this data packet to the receiving end RDMA protocol stack and update the value of EPSN to 2. At the same time, the receiving end will record in the bitmap that the original data packet with a PSN equal to 1 has been received. This process will be repeated until the data packet with a PSN equal to 43 is received.
  • each original data packet will participate in the update of the corresponding DEC(i) value to ensure that the intermediate value is correctly calculated, as shown in the following formula (9).
  • DEC(i mod r) DEC(i mod r) ⁇ RDMA(i) (9)
  • the receiving end when the receiving end receives subsequent original data packets with PSNs from 50 to 127, because the receiving end is currently in the reordering state, it follows step a of the processing flow (2) of the original data packet processing flow for the data packets belonging to the current group. It records the receipt of these data packets in the bitmap, uses them to update the corresponding DEC values DEC(i), and then stores them in the reordering buffer.
  • the recovered original data packet is placed in the reordering buffer. Finally, it is checked that the receiving end has still not received all the lost original data packets, so the receiving end state and reordering buffer are not changed. The same process is also executed for XOR (1) and XOR (3) to XOR (7).
  • the receiving end when the receiving end receives the XOR (2) redundant repair data packet, since all the original data packets involved in the generation of XOR (2) have been received, the receiving end directly discards the redundant repair data packet according to the processing flow (1).
  • the receiving end when the receiving end receives the XOR (7) redundant repair data packet, it performs the same processing flow as XOR (0). However, after placing the repaired lost original data packet into the reordering buffer, according to the original data packet information recorded in the bitmap that has been received, the receiving end has received all RDMA original data packets in the current group. Therefore, it is necessary to send all RDMA original data packets temporarily stored in the entire reordering buffer to the RDMA protocol stack and clear the contents of the reordering buffer.
  • the receiving-end RDMA protocol stack completely and sequentially receives all original RDMA data packets with PSNs 0 to 127, without triggering the RDMA protocol stack's existing GBN retransmission mechanism. Because the time required to recover from lost packets is much shorter than the time required to recover from lost packets through retransmission in a wide area network, real-time recovery of lost RDMA data packets is achieved.
  • the redundancy generation module in the sending device can group m data packets to determine r data packet groups, and then determine corresponding r redundant repair data packets based on the r data packet groups, and then send the m data packets and the corresponding r redundant repair data packets to the receiving device together without introducing a new QP queue pair. Therefore, no modification to the application is required, maintaining compatibility with existing applications. At the same time, there is no need to consume more RDMA network card hardware resources, reducing resource utilization.
  • the newly added redundancy generation module and identification and recovery module in this application respectively work on the sending end RDMA network card and the receiving end RDMA network card, so there is no additional CPU burden, thereby saving CPU resources.
  • the identification and recovery module in the receiving device can simultaneously receive the m data packets and r redundant repair data packets sent by the redundancy generation module in the sending device. In the event of packet loss, the identification and recovery module can recover the lost data packets through the received redundant repair data packets in a very short time, thus having the advantage of real-time packet loss recovery.
  • An embodiment of the present application provides a packet loss recovery method, which is applied to a receiving device and a sending device, wherein the receiving device includes an identification and recovery module, and the sending device includes a redundancy generation module.
  • the identification and recovery module in the receiving device receives m data packets and r redundant repair data packets sent by the redundancy generation module in the sending device, wherein m and r are both positive integers.
  • r first target decoding values are determined based on the m data packets.
  • Recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet.
  • the sending device receives s original data packets sent by an RDMA protocol stack module and grouping the s original data packets to obtain q original data packet groups, wherein the q original data packet groups each include m data packets, and s, m, and q are all positive integers.
  • R corresponding redundant repair data packets are determined based on the m data packets, wherein r is a positive integer.
  • the m data packets and the corresponding r redundant repair data packets are respectively sent to the receiving device, so that the receiving device performs packet loss recovery processing based on the m data packets and the corresponding r redundant repair data packets to obtain the lost data packet.
  • the receiving device can receive m data packets and r redundant repair data packets at the same time. If packet loss is detected, recovery processing can be performed based on the r redundant repair data packets and r first target decoding values to obtain the lost data packet, thereby enabling real-time packet loss recovery.
  • the receiving device does not need to request the sending device to retransmit the lost data packet after detecting data packet loss, thereby avoiding the delay problem; and the identification and recovery module in the present application can determine the r first target decoding values based on the m data packets; and then recovery processing can be performed based on the r redundant repair data packets and r first target decoding values without the CPU participating in the recovery processing, thereby saving valuable CPU resources.
  • the m data packets and the r redundant repair data packets are received simultaneously by the receiving device, so there is no need to introduce a new QP queue pair, thereby reducing the use of RDMA network card hardware resources, thereby improving resource utilization.
  • FIG10 is a structural diagram of the receiving device. As shown in FIG10 , the receiving device 10 includes: an identification and recovery module 11;
  • the identification and recovery module 11 is configured to receive m data packets and r redundant repair data packets sent by a transmitting device; wherein m and r are both positive integers;
  • the identification and recovery module 11 is further configured to determine r first target decoding values based on the m data packets when it is determined that packet loss exists based on the m data packets;
  • the identification and recovery module 11 is further configured to perform recovery processing based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packets.
  • Figure 11 is a second schematic diagram of the composition structure of the receiving device.
  • the receiving device 10 proposed in the embodiment of the present application may also include a first processor 12, and a first memory 13 storing executable instructions of the first processor 12.
  • the receiving device 10 may also include a first communication interface 14, and a first bus 15 for connecting the first processor 12, the first memory 13 and the first communication interface 14.
  • the first processor 12 can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • DSPD digital signal processing device
  • PLD programmable logic device
  • FPGA field programmable gate array
  • CPU central processing unit
  • the receiving device 10 can also include a first memory 13, which can be connected to the first processor 12, wherein the first memory 13 is used to store executable program code, which includes computer operating instructions.
  • the first memory 13 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
  • the first bus 15 is used to connect the first communication interface 14, the first processor 12, and the first memory 13, as well as to facilitate mutual communication between these devices.
  • the first memory 13 is used to store instructions and data.
  • the first processor 12 is configured to receive m data packets and r redundant repair data packets sent by a redundancy generation module in a transmitting device, wherein m and r are both positive integers; in a case where packet loss is determined based on the m data packets, r first target decoding values are determined based on the m data packets; and recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packets.
  • the above-mentioned first memory 13 can be a volatile memory (volatile memory), such as random-access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the first processor 12.
  • volatile memory such as random-access memory (Random-Access Memory, RAM)
  • non-volatile memory such as read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the first processor 12.
  • An embodiment of the present application provides a receiving device, which includes an identification and recovery module.
  • the identification and recovery module in the receiving device receives m data packets and r redundant repair data packets sent by a redundancy generation module in a sending device; wherein m and r are both positive integers; when it is determined that packet loss exists based on the m data packets, r first target decoding values are determined based on the m data packets; and recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet. It can be seen that the receiving device can receive m data packets and r redundant repair data packets at the same time.
  • recovery processing can be performed based on the r redundant repair data packets and r first target decoding values to obtain the lost data packet, thereby enabling real-time packet loss recovery.
  • the receiving device does not need to request the sending device to retransmit the lost data packet after detecting data packet loss, thereby avoiding the delay problem; and the identification and recovery module in the present application can determine the r first target decoding values based on the m data packets; and then recovery processing can be performed based on the r redundant repair data packets and r first target decoding values without the CPU participating in the recovery processing, thereby saving valuable CPU resources.
  • the m data packets and the r redundant repair data packets are received simultaneously by the receiving device, so there is no need to introduce a new QP queue pair, thereby reducing the use of RDMA network card hardware resources, thereby improving resource utilization.
  • An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which implements the packet loss recovery method described above when executed by a processor.
  • the program instructions corresponding to a packet loss recovery method in this embodiment can be stored on a storage medium such as an optical disk, a hard disk, or a USB flash drive.
  • a storage medium such as an optical disk, a hard disk, or a USB flash drive.
  • Recovery processing is performed based on the r redundant repair data packets and the r first target decoding values to obtain the lost data packet.
  • each flow and/or box in the flow diagram and/or block diagram and the combination of the flow and/or box in the flow diagram and/or block diagram can be implemented by computer program instructions.
  • These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow diagram or multiple flows and/or one block or multiple blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

本申请实施例提供了一种丢包恢复方法、接收端设备、发送端设备及存储介质,该方法应用于接收端设备,该方法包括:接收端设备接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,而无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,从而可以进行实时丢包恢复。

Description

一种丢包恢复方法、接收端设备、发送端设备及存储介质
相关申请的交叉引用
本申请基于申请号为202410382582.8、申请日为2024年3月29日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及传输与承载技术领域,尤其涉及一种丢包恢复方法、接收端设备、发送端设备及存储介质。
背景技术
远程直接内存访问(Remote Direct Memory Access,RDMA)是一种绕过远程主机操作系统内核访问其内存中数据的技术。与传统的传输控制协议/网际协议(Transmission Control Protocol/Internet Protocol,TCP/IP)软硬件架构涉及多次内核拷贝、系统中断和上下文切换不同,RDMA通过RDMA网卡消除了数据到操作系统缓冲区的复制过程,直接在应用程序内存间传输数据。现阶段,广域网场景下高性能数据传输的需求越来越广泛,广域网环境下,由于流量拥塞等原因造成的数据包丢失使得RDMA传输技术不能得到高效的部署及应用。因此,需要研究广域网环境下RDMA传输过程中的实时丢包恢复技术,避免由于数据包丢失带来的RDMA传输性能损失。
《一种基于纠删码的RDMA网络数据传输方法》提出了通过细粒度传输和多路径并行传输降低传输时延。然而该方法在广域网RDMA传输场景下存在以下缺点:(1)接收端在发现RDMA传输发送丢包后才通知发送端进行纠删码编码和校验块发送,接收端必须等待其所请求的校验块被完全接收后,才能实现丢失RDMA数据包的恢复,产生了极大的额外传输时延;(2)对丢包的判断、对数据的编码和对数据的解码均需CPU持续参与控制,占用大量的CPU时间,产生了额外的CPU负担;(3)对冗余数据进行传输必须使用额外的(Queue Pair,QP)队列对,因而需要使用更多RDMA网卡硬件资源,降低了资源利用率。综上所述,RDMA网络数据传输方法在进行丢包恢复时存在时延问题,且消耗了额外的CPU资源和RDMA网卡硬件资源,从而降低了资源利用率。
发明内容
本申请实施法例提供了一种丢包恢复方法、接收端设备、发送端设备及存储介质,可以进行实时丢包恢复,且无需消耗额外的CPU资源和RDMA网卡硬件资源,从而可以提升资源利用率。
本申请实施例的技术方案是这样实现的:
第一方面,本申请实施例提供了一种丢包恢复方法,所述方法应用于接收端设备,所述方法包括:
接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;
在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;
基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
第二方面,本申请实施例提供了一种丢包恢复方法,所述方法应用于发送端设备,所述方法包括:
接收RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;
基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;
将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
第三方面,本申请实施例提供了一种接收端设备,所述接收端设备包括:识别恢复模块,
所述识别恢复模块,用于接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;还用于在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;还用于基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
第四方面,本申请实施例提供了一种接收端设备,所述接收端设备包括:第一处理器和第一存储器;其中,
所述第一存储器,用于存储能够在所述处理器上运行的计算机程序;
所述第一处理器,用于在运行所述计算机程序时,执行如上所述的丢包恢复方法。
第五方面,本申请实施例提供了一种发送端设备,所述发送端设备包括:冗余生成模块,
所述冗余生成模块,用于接收远程直接内存访问RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;还用于基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;还用于将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
第六方面,本申请实施例提供了一种发送端设备,所述发送端设备包括:第二处理器和第二存储器;其中,
所述第二存储器,用于存储能够在所述处理器上运行的计算机程序;
所述第二处理器,用于在运行所述计算机程序时,执行如上所述的丢包恢复方法。
第七方面,本申请实施例提供了一种计算机可读存储介质,其特征在于,所述存储介质上存储有计算机程序代码,当所述计算机程序代码被计算机执行时,实现如上所述的丢包恢复方法。
第八方面,本申请实施例提供了一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序在被处理器执行时,实现如上所述的丢包恢复方法。
本申请实施例提供了一种丢包恢复方法、接收端设备、发送端设备及存储介质,接收端设备接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包;发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
附图说明
图1为本申请实施例提出的丢包恢复方法示意图一;
图2为本申请实施例提出的丢包恢复方法示意图二;
图3为本申请实施例提出的丢包恢复方法示意图三;
图4为本申请实施例提出的冗余修复数据包结构示意图;
图5为本申请实施例提出的丢包恢复方法示意图四;
图6为本申请实施例提出的基于前向纠错的广域网RDMA实时丢包恢复技术的工作流程示意图;
图7为本申请实施例提出的前向纠错冗余生成模块结构示意图;
图8为本申请实施例提出的接收端的丢包识别与恢复模块的结构示意图;
图9为本申请实施例提出的三个状态之间的切换条件示意图;
图10为本申请实施例提出的接收端设备的组成结构示意图一;
图11为本申请实施例提出的接收端设备的组成结构示意图二;
图12为本申请实施例提出的发送端设备的组成结构示意图一;
图13为本申请实施例提出的发送端设备的组成结构示意图二。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。
远程直接内存访问(Remote Direct Memory Access,RDMA)是一种绕过远程主机操作系统内核访问其内存中数据的技术。与传统的TCP/IP(Transmission Control Protocol/Internet Protocol,传输控制协议/网际协议)软硬件架构涉及多次内核拷贝、系统中断和上下文切换不同,RDMA通过RDMA网卡消除了数据到操作系统缓冲区的复制过程,直接在应用程序内存间传输数据,从而节省了大量的CPU(Central Processing Unit,中央处理器)资源,同时提高了系统的吞吐量,降低了系统的网络通信延迟。
由于RDMA网卡的硬件资源限制,RDMA协议使用回退N步(Go-Back-N,GBN)重传机制应对数据包丢失情况,数据包丢失会带来RDMA传输性能的快速下降。现阶段,广域网场景下高性能数据传输的需求越来越广泛。广域网环境下,由于流量拥塞等原因造成的数据包丢失使得RDMA传输技术不能得到高效的部署及应用。因此,需要研究广域网环境下RDMA传输过程中的实时丢包恢复技术,避免由于数据包丢失带来的RDMA传输性能损失。
在通信信道存在潜在数据丢失的情况下,通过前向纠错(Forward Error Correction,FEC)引入适度的数据冗余被广泛认可为一种有效策略,数据包级前向纠错(Packet-Level FEC)已经成为解决分组交换网络中不利网络条件的一种常见方法。通过对原始数据包进行前向纠错计算,产生额外的冗余修复数据包,并将其与原始数据包一同传送至接收端。这使得当原始数据包在传输中丢失时,接收端能够通过已接收的冗余修复数据包来还原丢失的数据包,从而避免由数据包丢失引起的性能下降问题。
《一种基于纠删码的RDMA网络数据传输方法》该专利公开了通过细粒度传输和多路径并行传输降低传输时延,并利用纠删码消除网络传输的长尾效应和简化接收端的重排序操作,同时利用RDMA网卡的纠删码硬件卸载计算纠删码,降低CPU计算开销。然而该方法在广域网RDMA传输场景下存在以下缺点:(1)接收端在发现RDMA传输发送丢包后才通知发送端进行纠删码编码和校验块发送,接收端必须等待其所请求的校验块被完全接收后,才能实现丢失RDMA数据包的恢复,产生了极大的额外传输时延;(2)对丢包的判断、对数据的编码和对数据的解码均需CPU持续参与控制,占用大量的CPU时间,产生了额外的CPU负担;(3)对冗余数据进行传输必须使用额外的(Queue Pair,QP)队列对,因而需要使用更多RDMA网卡硬件资源,降低了资源利用率。综上所述,RDMA网络数据传输方法在进行丢包恢复时存在时延问题,且消耗了额外的CPU资源和RDMA网卡硬件资源,从而降低了资源利用率。
为了解决目前进行丢包恢复时存在时延且消耗了额外的CPU资源和RDMA网卡硬件资源,从而降低了资源利用率的问题,本申请实施例提供了一种丢包恢复方法、接收端设备、发送端设备及存储介质,接收端设备接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包;发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请中可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
实施例一
本申请实施例提供了一种丢包恢复方法,该方法应用于接收端设备,接收端设备可以包括识别恢复模块,图1为本申请实施例提出的丢包恢复方法示意图一,如图1所示,丢包恢复方法可以包括以下步骤:
步骤101、接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数。
在本申请的实施例中,接收端设备可以接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数。
需要说明的是,在本申请的实施例中,接收端设备可以是接收端RDMA网卡,本申请对接收端设备的类型不做具体限定。
需要说明的是,在本申请的实施例中,本申请新增的识别恢复模块工作在接收端RDMA网卡,因此不会增加额外的CPU负担,从而节省了CPU资源。
需要说明的是,在本申请的实施例中,图2为本申请实施例提出的丢包恢复方法示意图二,如图2所示,接收端设备在接收发送端设备发送的m个数据包和r个冗余修复数据包之后,即步骤101之后,还可以包括以下步骤:
步骤104、在m个数据包中的第一预设字段值为第一预设值的情况下,确定m个数据包对应的身份信息为冗余修复数据包身份;在m个数据包中的第一预设字段值不为第一预设值的情况下,确定m个数据包对应的身份信息为原始数据包身份;在r个冗余修复数据包中的第二预设字段值为第一预设值的情况下,确定r个冗余修复数据包对应的身份信息为冗余修复数据包身份;在r个冗余修复数据包中的第二预设字段值不为第一预设值的情况下,确定r个冗余修复数据包对应的身份信息为原始数据包身份。
需要说明的是,在本申请的实施例中,第一预设字段值可以是RC_RDMA_REPAIR字段的值,RC_RDMA_REPAIR字段可以为数据包中的Repair Header头部字段中的前8个比特的字段,本申请对第一预设字段值的大小不做具体限定。
需要说明的是,在本申请的实施例中,第一预设值可以是0x1F,本申请对第一预设值的大小不做具体限定。
需要说明的是,在本申请的实施例中,第二预设字段值可以是RC_RDMA_REPAIR字段的值,本申请对第二预设字段值的大小不做具体限定。
也就是说,在本申请的实施例中,接收端设备中的识别恢复模块在接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包之后,可以对m个数据包和r个冗余修复数据包的身份信息进行判断和区分,即可以根据数据包头部中的RC_RDMA_REPAIR字段判断接收到的数据包的类型,即是原始数据包还是冗余修复数据包。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块可以确定m个数据包中的第f个数据包对应的包序列号(Packet Sequence Number,PSN);其中,f为小于或者等于m的正整数;在第f个数据包对应的PSN与预设PSN不同的情况下,判定存在丢包行为。
示例性的,在本申请的实施例中,假设接收端设备中的识别恢复模块确定m个数据包中的第f个数据包对应的PSN为60,假设预设PSN为55,在第f个数据包对应的PSN与预设PSN不同,则可以认为存在丢包行为。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在接收到的m个数据包中的第一个数据包为当前组的第一个数据包的情况下,可以确定接收端设备的状态为有序状态;相应地,在m个数据包中存在丢包行为的情况下,则可以将接收端设备的状态更新为无序状态;在m个数据包中不存在丢包行为的情况下,可以保持接收端设备的状态为有序状态。
示例性的,在本申请的实施例中,假设128个数据包为一组数据包,接收端设备中的识别恢复模块在接收到的128个数据包中的第一个数据包为当前组的第一个数据包的情况下,即是新分组内的首个数据包,可以确定接收端设备的状态为有序状态,如果在m个数据包中存在丢包行为的情况下,则可以将接收端设备的状态更新为无序状态;在m个数据包中不存在丢包行为的情况下,可以保持接收端设备的状态为有序状态。
需要说明的是,在本申请的实施例中,在m个数据包中的丢包数量满足第一预设条件的情况下,将接收端设备的当前状态切换为无效状态。
需要说明的是,在本申请的实施例中,第一预设条件可以是丢包数量大于r,r为正整数,本申请对r的大小不做具体限定。
需要说明的是,在本申请的实施例中,在r个冗余修复数据包满足第二预设条件的情况下,将r个冗余修复数据包进行丢弃处理。
需要说明的是,在本申请的实施例中,第二预设条件可以包括冗余修复数据包的源段起点(Source Start)PSN字段与接收端当前分组的首个原始数据包的PSN字段不匹配,和/或,接收端设备处于失效状态(无效状态),和/或,接收端处于无序状态,但已接收到了冗余修复数据包生成相关的所有k个原始数据包,和/或,接收端处于有序状态,但接收到的冗余修复数据包不足以恢复丢失的原始数据包(丢包数量满足第一预设条件),和/或,接收端设备处于有序状态,并已接收当前分组内所有的原始数据包。
步骤102、在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值。
在本申请的实施例中,接收端设备中的识别恢复模块在接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包之后,可以在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在基于m个数据包确定r个第一目标解码值时,可以对m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于r-1的整数;进而可以基于r个数据包组确定对应的r个第一目标解码值。
示例性的,在本申请的实施例中,假设m为128,r为8,接收端设备中的识别恢复模块可以接收发送端设备中的冗余生成模块发送的第一组数据,即128个数据包和8个冗余修复数据包,然后可以对128个数据包进行分组,确定8个数据包组,每一个数据包组包括128个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于7的整数;假设i为0,则第一个数据包组包括第0个数据包、第8个数据包、第16个数据包……第0+[(128/8)-1]×8个数据包,假设i为1,则第二个数据包组包括第1个数据包、第9个数据包、第17个数据包……第1+[(128/8)-1]×8个数据包,直至假设i为7,可以确定第八个数据包组,从而可以依次确定8个数据包组,进而可以基于8个数据包组确定对应的8个第一目标解码值。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在基于r个数据包组确定对应的r个第一目标解码值时,当接收到第i个数据包和第i+r个数据包之后,可以基于第i个数据包和第i+r个数据包确定r个第一解码值;当接收到第i+2r个数据包之后,可以基于第i+2r个数据包分别对r个第一解码值进行更新处理,获得r个第二解码值;当直到接收第i+[(m/r)-1]×r个数据包之后,基于第i+[(m/r)-1]×r个数据包分别对r个第N解码值进行更新处理,获得r个第一目标解码值;其中,r个第N解码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1解码值进行更新处理获得的。
需要说明的是,在本申请的实施例中,当接收到第i个数据包和第i+r个数据包之后,接收端设备中的识别恢复模块在基于第i个数据包和第i+r个数据包确定r个第一解码值时,可以基于下述公式(1)获得r个第一解码值,即可以将第i个数据包和第i+r个数据包进行异或运算,从而可以获得r个第一解码值,例如分别为DEC(0)、DEC(1),……,DEC(r-1);i为大于等于0小于等于r-1的整数。
DEC(i)=RDMA(i)^RDMA(i+r)  (1)
其中,RDMA(i)表示第i个数据包,RDMA(i+r)表示第i+r个数据包。
需要说明的是,在本申请的实施例中,当接收到第i+2r个数据包之后,接收端设备中的识别恢复模块在基于第i+2r个数据包分别对r个第一解码值进行更新处理时,可以将第i+2r个数据包和r个第一解码值分别进行异或运算,从而对r个第一解码值进行更新处理,获得r个第二解码值。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当接收到第16个数据包之后,识别恢复模块可以将第16个数据包和DEC(0)进行异或运算,即对DEC(0)进行更新,获得第二解码值,假设i为1,当接收到第17个数据包时,可以将第17个数据包和DEC(1)进行异或运算,即对DEC(1)进行更新,获得第二解码值,……,直至i为7,当接收到第23个数据包时,可以将第23个数据包和DEC(7)进行异或运算,即对DEC(7)进行更新,获得第二解码值,从而完成对8个第一解码值进行更新处理,获得8个第二解码值。
需要说明的是,在本申请的实施例中,当直到接收第i+[(m/r)-1]×r个数据包之后,即接收到r个数据包组中的最后一个数据包,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N解码值进行更新处理,获得r个第一目标解码值;其中,r个第N解码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1解码值进行更新处理获得的。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当直到接收第120个数据包之后,可以将第120个数据包和第N解码值(DEC(0))进行异或运算,从而可以对DEC(0)进行更新处理,获得第一目标解码值,假设i为1,当直到接收第121个数据包之后,可以将第121个数据包和第N解码值(DEC(1))进行异或运算,从而可以对DEC(1)进行更新处理,获得第一目标解码值,……,假设i为7,直至当直到接收第127个数据包之后,可以将第127个数据包和第N解码值(DEC(7))进行异或运算,从而可以对DEC(7)进行更新处理,获得第一目标解码值,从而可以获得8个第一目标解码值。
步骤103、基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包。
在本申请的实施例中,接收端设备中的识别恢复模块在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值之后,可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包时,可以基于r个数据包组确定丢失的数据包对应的目标组别;其中,目标组别为r个数据包组中的任意一组;然后可以基于目标组别和r个冗余修复数据包确定丢失的数据包对应的目标冗余修复数据包;进而可以基于目标组别和r个第一目标解码值确定丢失的数据包对应的第二目标解码值;从而可以基于目标冗余修复数据包和第二目标解码值确定丢失的数据包。
示例性的,在本申请的实施例中,假设r为8,假设8个冗余修复数据包为XOR(0)~XOR(7),8个数据包组分别与8个冗余修复数据包一一对应,即第一个数据包组对应的冗余修复数据包为XOR(0),若丢失的数据包为RDMA(48),则识别恢复模块可以基于8个数据包组确定丢失的数据包对应的目标组别为第一个数据包组,然后可以基于目第一个数据包组和8个冗余修复数据包确定丢失的数据包对应的目标冗余修复数据包为第一个冗余修复数据包XOR(0),进而可以基于第一个数据包组和8个第一目标解码值确定丢失的数据包对应的第二目标解码值为DEC(0),从而可以基于目标冗余修复数据包XOR(0)和第二目标解码值DEC(0)确定丢失的数据包,如下述公式(2)所示,丢失的数据包可以通过目标冗余修复数据包XOR(0)和第二目标解码值DEC(0)进行异或运算获得。
RDMA(i+p*r) = XOR(i) ^ DEC(i)           (2)
其中,XOR(i)表示目标冗余修复数据包,DEC(i)表示第二目标解码值,i为大于等于0小于等于r-1的整数。
需要说明的是,在本申请的实施例中,接收端设备能够在接收数据包的同时进行实时的丢包恢复,减少了需要暂存整个数据包序列的需求,降低了内存资源占用,并在极短时间内可以通过收到的冗余修复数据包对丢失数据包进行恢复,因而具有实时丢包恢复的优点,并且避免了重传对RDMA传输性能造成的负面影响。
综上所述,本申请新增的识别恢复模块工作在接收端RDMA网卡,不会增加额外的CPU负担,从而节省了CPU资源,且接收端设备中的识别恢复模块可以同时接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包,在存在丢包的情况下,识别恢复模块可以在极短时间内可以通过收到的冗余修复数据包对丢失数据包进行恢复,因而具有实时丢包恢复的优点。
本申请实施例提供了一种丢包恢复方法,该方法应用于接收端设备,接收端设备接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
实施例二
基于上述实施例,本申请的再一实施例提供了一种丢包恢复方法,该方法应用于发送端设备,发送端设备可以包括冗余生成模块,图3为本申请实施例提出的丢包恢复方法示意图三,如图3所示,丢包恢复方法可以包括以下步骤:
步骤201、接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数。
在本申请的实施例中,发送端设备中的冗余生成模块可以接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组。
需要说明的是,在本申请的实施例中,发送端设备可以是发送端RDMA网卡,本申请对发送端设备的类型不做具体限定。
需要说明的是,在本申请的实施例中,本申请新增的冗余生成模块工作在发送端RDMA网卡,不会增加额外的CPU负担,从而节省了CPU资源。
示例性的,在本申请的实施例中,发送端设备中的冗余生成模块接收到RDMA协议栈模块发送的1152个原始数据包,可以对相同RDMA传输数据流进行分组划分,例如每128个原始数据包为一组,可以获得9个原始数据包组,即每个原始数据包组均包括128个原始数据包。
步骤202、基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数。
在本申请的实施例中,发送端设备中的冗余生成模块在接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组之后,可以基于m个数据包确定对应的r个冗余修复数据包。
需要说明的是,在本申请的实施例中,发送端设备中的冗余生成模块在基于m个数据包确定对应的r个冗余修复数据包时,可以基于m个数据包确定对应的r个数据包组;然后可以基于r个数据包组确定对应的r个冗余修复数据包。
需要说明的是,在本申请的实施例中,发送端设备中的冗余生成模块在基于m个数据包确定对应的r个数据包组时,可以对m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于r-1的整数。
示例性的,在本申请的实施例中,假设m为128,r为8,发送端设备中的冗余生成模块在基于128个数据包确定对应的8个数据包组时,可以对128个数据包进行分组,确定8个数据包组,每一个数据包组包括128个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于7的整数;假设i为0,则第1个数据包组包括第0个数据包、第8个数据包、第16个数据包……第0+[(128/8)-1]×8个数据包;假设i为1,则第2个数据包组包括第1个数据包、第9个数据包、第17个数据包……第1+[(128/8)-1]×8个数据包,直至假设i为7,可以确定第8个数据包组,从而可以依次确定8个数据包组。
需要说明的是,在本申请的实施例中,冗余生成模块在基于r个数据包组确定对应的r个冗余修复数据包时,当接收到第i个数据包和第i+r个数据包之后,可以基于第i个数据包和第i+r个数据包确定r个第一编码值;当接收到第i+2r个数据包之后,可以基于第i+2r个数据包分别对r个第一编码值进行更新处理,获得r个第二编码值;当直到接收第i+[(m/r)-1]×r数据包之后,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N编码值进行更新处理;获得r个第一目标编码值;其中,r个第N编码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1编码值进行更新处理获得的;进而可以基于r个第一目标编码值分别确定对应的r个冗余修复数据包;i为大于等于0小于等于r-1的整数。
需要说明的是,在本申请的实施例中,当冗余生成模块接收到第i个数据包和第i+r个数据包之后,在基于第i个数据包和第i+r个数据包确定r个第一编码值时,如下述公式(3)所示,可以将第i个数据包和第i+r个数据包进行异或运算,从而可以获得r个第一编码值,例如分别为XOR(0)、XOR(1),……,XOR(r-1);i为大于等于0小于等于r-1的整数。
XOR(i) = DATA(i) ^ DATA(i+r)                 (3)
其中,DATA(i)表示第i个数据包,DATA(i+r)表示第i+r个数据包。
需要说明的是,在本申请的实施例中,当接收到第i+2r个数据包之后,冗余生成模块在基于第i+2r个数据包分别对r个第一编码值进行更新处理时,可以将第i+2r个数据包和r个第一编码值分别进行异或运算,从而对r个第一编码值进行更新处理,获得r个第二编码值。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当接收到第16个数据包之后,冗余生成模块可以将第16个数据包和XOR(0)进行异或运算,即对XOR(0)进行更新,获得第二编码值,假设i为1,当接收到第17个数据包时,可以将第17个数据包和XOR(1)进行异或运算,即对XOR(1)进行更新,获得第二编码值,……,直至i为7,当接收到第23个数据包时,可以将第23个数据包和XOR(7)进行异或运算,即对XOR(7)进行更新,获得第二编码值,从而完成对8个第一编码值进行更新处理,获得8个第二编码值。
需要说明的是,在本申请的实施例中,当直到接收第i+[(m/r)-1]×r个数据包之后,即接收到r个数据包组中的最后一个数据包,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N编码值进行更新处理,获得r个第一目标编码值;其中,r个第N编码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1编码值进行更新处理获得的。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当直到接收第120个数据包之后,可以将第120个数据包和第N编码值(XOR(0))进行异或运算,从而可以对XOR(0)进行更新处理,获得第一目标编码值,假设i为1,当直到接收第121个数据包之后,可以将第121个数据包和第N编码值(XOR(1))进行异或运算,从而可以对XOR(1)进行更新处理,获得第一目标编码值,……,假设i为7,直至当直到接收第127个数据包之后,可以将第127个数据包和第N编码值(XOR(7))进行异或运算,从而可以对XOR(7)进行更新处理,获得第一目标编码值,从而可以获得8个第一目标编码值。
进一步地,在本申请的实施例中,冗余生成模块在获得r个第一目标编码值之后,可以基于r个第一目标编码值分别确定对应的r个冗余修复数据包,例如,假设r为8,获得的8个第一目标编码值即为对应的8个冗余修复数据包。
需要说明的是,在本申请的实施例中,冗余修复数据包包括第一头部字段;第一头部字段至少包括第二预设字段、第三预设字段、第四预设字段、第五预设字段、第六预设字段以及第七预设字段;其中,第二预设字段用于接收端设备判断冗余修复数据包对应的身份信息;其中,身份信息包括原始数据包身份或者冗余修复数据包身份,第三预设字段用于表征目标队列对编号(Queue Pair Number,QPN),第四预设字段用于表征源段起点PSN,第五预设字段用于表征交织间隔的包的个数,第六预设字段用于表征冗余修复数据包的个数,第七预设字段用于表征当前冗余修复数据包的编号,本申请对第一头部字段包括的预设字段数量不做具体限定。
示例性的,在本申请的实施例中,图4为本申请实施例提出的冗余修复数据包结构示意图,如图4所示,冗余修复数据包包括第一头部字段;第一头部字段可以是Repair Header头部字段,还可以包括Ethernet字段、网际互连协议(Internet Protocol,IP)字段、用户数据报协议(User Datagram Protocol,UDP)字段、冗余负载(Redundancy Payload)字段以及ICRC字段;其中,第一头部字段至少可以包括第二预设字段、第三预设字段、第四预设字段、第五预设字段、第六预设字段以及第七预设字段;第二预设字段可以是RC_RDMA_REPAIR字段、第三预设字段可以是Destination QP字段、第四预设字段可以是Source start PSN字段、第五预设字段可以是Shift size字段、第六预设字段可以是Total repairs number字段以及第七预设字段可以是Repair number字段。
步骤203、将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
在本申请的实施例中,发送端设备中的冗余生成模块在基于m个数据包确定对应的r个冗余修复数据包之后,可以将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
综上所述,发送端设备中的冗余生成模块可以对m个数据包进行分组,确定r个数据包组,然后可以基于r个数据包组确定对应的r个冗余修复数据包,进而可以将m个数据包和对应的r个冗余修复数据包一同发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包,而无需引入新的QP队列对,因此无需对应用程序做出任何修改,保持了对已有应用程序的兼容性,同时也无需消耗更多RDMA网卡硬件资源,降低了资源利用率。
本申请实施例提供了一种丢包恢复方法,该方法应用于发送端设备,发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,发送端设备可以基于m个数据包确定对应的r个冗余修复数据包,然后可以将m个数据包和对应的r个冗余修复数据包一同发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包,而无需引入新的QP队列对,因此无需对应用程序做出任何修改,保持了对已有应用程序的兼容性,同时也无需消耗更多RDMA网卡硬件资源,降低了资源利用率。
实施例三
基于上述实施例,本申请的再一实施例提供了一种丢包恢复方法,该方法应用于接收端设备和发送端设备,图5为本申请实施例提出的丢包恢复方法示意图四,如图5所示,丢包恢复方法可以包括以下步骤:
步骤301、发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数。
需要说明的是,在本申请的实施例中,发送端设备可以是发送端RDMA网卡,本申请对发送端设备的类型不做具体限定。
需要说明的是,在本申请的实施例中,发送端设备可以包括冗余生成模块,本申请新增的冗余生成模块工作在发送端RDMA网卡,不会增加额外的CPU负担,从而节省了CPU资源。
示例性的,在本申请的实施例中,发送端设备中的冗余生成模块接收到RDMA协议栈模块发送的1152个原始数据包,可以对相同RDMA传输数据流进行分组划分,例如每128个原始数据包为一组,可以获得9个原始数据包组,即每个原始数据包组均包括128个原始数据包。
步骤302、发送端设备基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数。
需要说明的是,在本申请的实施例中,发送端设备中的冗余生成模块在基于m个数据包确定对应的r个冗余修复数据包时,可以基于m个数据包确定对应的r个数据包组;然后可以基于r个数据包组确定对应的r个冗余修复数据包。
需要说明的是,在本申请的实施例中,发送端设备中的冗余生成模块在基于m个数据包确定对应的r个数据包组时,可以对m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于r-1的整数。
示例性的,在本申请的实施例中,假设m为128,r为8,发送端设备中的冗余生成模块在基于128个数据包确定对应的8个数据包组时,可以对128个数据包进行分组,确定8个数据包组,每一个数据包组包括128个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于7的整数;假设i为0,则第1个数据包组包括第0个数据包、第8个数据包、第16个数据包……第0+[(128/8)-1]×8个数据包;假设i为1,则第2个数据包组包括第1个数据包、第9个数据包、第17个数据包……第1+[(128/8)-1]×8个数据包,直至假设i为7,可以确定第8个数据包组,从而可以依次确定8个数据包组。
需要说明的是,在本申请的实施例中,冗余生成模块在基于r个数据包组确定对应的r个冗余修复数据包时,当接收到第i个数据包和第i+r个数据包之后,可以基于第i个数据包和第i+r个数据包确定r个第一编码值;当接收到第i+2r个数据包之后,可以基于第i+2r个数据包分别对r个第一编码值进行更新处理,获得r个第二编码值;当直到接收第i+[(m/r)-1]×r数据包之后,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N编码值进行更新处理;获得r个第一目标编码值;其中,r个第N编码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1编码值进行更新处理获得的;进而可以基于r个第一目标编码值分别确定对应的r个冗余修复数据包;i为大于等于0小于等于r-1的整数。
需要说明的是,在本申请的实施例中,当冗余生成模块接收到第i个数据包和第i+r个数据包之后,在基于第i个数据包和第i+r个数据包确定r个第一编码值时,如上述公式(3)所示,可以将第i个数据包和第i+r个数据包进行异或运算,从而可以获得r个第一编码值,例如分别为XOR(0)、XOR(1),……,XOR(r-1);i为大于等于0小于等于r-1的整数。
需要说明的是,在本申请的实施例中,当接收到第i+2r个数据包之后,冗余生成模块在基于第i+2r个数据包分别对r个第一编码值进行更新处理时,可以将第i+2r个数据包和r个第一编码值分别进行异或运算,从而对r个第一编码值进行更新处理,获得r个第二编码值。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当接收到第16个数据包之后,冗余生成模块可以将第16个数据包和XOR(0)进行异或运算,即对XOR(0)进行更新,获得第二编码值,假设i为1,当接收到第17个数据包时,可以将第17个数据包和XOR(1)进行异或运算,即对XOR(1)进行更新,获得第二编码值,……,直至i为7,当接收到第23个数据包时,可以将第23个数据包和XOR(7)进行异或运算,即对XOR(7)进行更新,获得第二编码值,从而完成对8个第一编码值进行更新处理,获得8个第二编码值。
需要说明的是,在本申请的实施例中,当直到接收第i+[(m/r)-1]×r个数据包之后,即接收到r个数据包组中的最后一个数据包,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N编码值进行更新处理,获得r个第一目标编码值;其中,r个第N编码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1编码值进行更新处理获得的。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当直到接收第120个数据包之后,可以将第120个数据包和第N编码值(XOR(0))进行异或运算,从而可以对XOR(0)进行更新处理,获得第一目标编码值,假设i为1,当直到接收第121个数据包之后,可以将第121个数据包和第N编码值(XOR(1))进行异或运算,从而可以对XOR(1)进行更新处理,获得第一目标编码值,……,假设i为7,直至当直到接收第127个数据包之后,可以将第127个数据包和第N编码值(XOR(7))进行异或运算,从而可以对XOR(7)进行更新处理,获得第一目标编码值,从而可以获得8个第一目标编码值。
进一步地,在本申请的实施例中,冗余生成模块在获得r个第一目标编码值之后,可以基于r个第一目标编码值分别确定对应的r个冗余修复数据包,例如,假设r为8,获得的8个第一目标编码值即为对应的8个冗余修复数据包。
需要说明的是,在本申请的实施例中,冗余修复数据包包括第一头部字段;第一头部字段至少包括第二预设字段、第三预设字段、第四预设字段、第五预设字段、第六预设字段以及第七预设字段;其中,第二预设字段用于接收端设备判断冗余修复数据包对应的身份信息;其中,身份信息包括原始数据包身份或者冗
余修复数据包身份,第三预设字段用于表征目标队列对编号(Queue Pair Number,QPN),第四预设字段用于表征源段起点PSN,第五预设字段用于表征交织间隔的包的个数,第六预设字段用于表征冗余修复数据包的个数,第七预设字段用于表征当前冗余修复数据包的编号,本申请对第一头部字段包括的预设字段数量不做具体限定。
示例性的,在本申请的实施例中,如图4所示,冗余修复数据包包括第一头部字段;第一头部字段可以是Repair Header头部字段,还可以包括Ethernet字段、网际互连协议(Internet Protocol,IP)字段、用户数据报协议(User Datagram Protocol,UDP)字段、冗余负载(Redundancy Payload)字段以及ICRC字段;其中,第一头部字段至少可以包括第二预设字段、第三预设字段、第四预设字段、第五预设字段、第六预设字段以及第七预设字段;第二预设字段可以是RC_RDMA_REPAIR字段、第三预设字段可以是Destination QP字段、第四预设字段可以是Source start PSN字段、第五预设字段可以是Shift size字段、第六预设字段可以是Total repairs number字段以及第七预设字段可以是Repair number字段。
步骤303、发送端设备将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备。
步骤304、接收端设备在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值。
需要说明的是,在本申请的实施例中,接收端设备在基于m个数据包确定r个第一目标解码值时,可以对m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于r-1的整数;进而可以基于r个数据包组确定对应的r个第一目标解码值。
示例性的,在本申请的实施例中,假设m为128,r为8,接收端设备中的识别恢复模块可以接收发送端设备中的冗余生成模块发送的第一组数据,即128个数据包和8个冗余修复数据包,然后可以对128个数据包进行分组,确定8个数据包组,每一个数据包组包括128个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于7的整数;假设i为0,则第一个数据包组包括第0个数据包、第8个数据包、第16个数据包……第0+[(128/8)-1]×8个数据包,假设i为1,则第二个数据包组包括第1个数据包、第9个数据包、第17个数据包……第1+[(128/8)-1]×8个数据包,直至假设i为7,可以确定第八个数据包组,从而可以依次确定8个数据包组,进而可以基于8个数据包组确定对应的8个第一目标解码值。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在基于r个数据包组确定对应的r个第一目标解码值时,当接收到第i个数据包和第i+r个数据包之后,可以基于第i个数据包和第i+r个数据包确定r个第一解码值;当接收到第i+2r个数据包之后,可以基于第i+2r个数据包分别对r个第一解码值进行更新处理,获得r个第二解码值;当直到接收第i+[(m/r)-1]×r个数据包之后,基于第i+[(m/r)-1]×r个数据包分别对r个第N解码值进行更新处理,获得r个第一目标解码值;其中,r个第N解码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1解码值进行更新处理获得的。
需要说明的是,在本申请的实施例中,当接收到第i个数据包和第i+r个数据包之后,接收端设备中的识别恢复模块在基于第i个数据包和第i+r个数据包确定r个第一解码值时,可以基于上述公式(1)获得r个第一解码值,即可以将第i个数据包和第i+r个数据包进行异或运算,从而可以获得r个第一解码值,例如分别为DEC(0)、DEC(1),……,DEC(r-1);i为大于等于0小于等于r-1的整数。
需要说明的是,在本申请的实施例中,当接收到第i+2r个数据包之后,接收端设备中的识别恢复模块在基于第i+2r个数据包分别对r个第一解码值进行更新处理时,可以将第i+2r个数据包和r个第一解码值分别进行异或运算,从而对r个第一解码值进行更新处理,获得r个第二解码值。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当接收到第16个数据包之后,识别恢复模块可以将第16个数据包和DEC(0)进行异或运算,即对DEC(0)进行更新,获得第二解码值,假设i为1,当接收到第17个数据包时,可以将第17个数据包和DEC(1)进行异或运算,即对DEC(1)进行更新,获得第二解码值,……,直至i为7,当接收到第23个数据包时,可以将第23个数据包和DEC(7)进行异或运算,即对DEC(7)进行更新,获得第二解码值,从而完成对8个第一解码值进行更新处理,获得8个第二解码值。
需要说明的是,在本申请的实施例中,当直到接收第i+[(m/r)-1]×r个数据包之后,即接收到r个数据包组中的最后一个数据包,可以基于第i+[(m/r)-1]×r个数据包分别对r个第N解码值进行更新处理,获得r个第一目标解码值;其中,r个第N解码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1解码值进行更新处理获得的。
示例性的,在本申请的实施例中,假设r为8,i为大于等于0小于等于7的整数,假设i为0,当直到接收第120个数据包之后,可以将第120个数据包和第N解码值(DEC(0))进行异或运算,从而可以对DEC(0)进行更新处理,获得第一目标解码值,假设i为1,当直到接收第121个数据包之后,可以将第121个数据包和第N解码值(DEC(1))进行异或运算,从而可以对DEC(1)进行更新处理,获得第一目标解码值,……,假设i为7,直至当直到接收第127个数据包之后,可以将第127个数据包和第N解码值(DEC(7))进行异或运算,从而可以对DEC(7)进行更新处理,获得第一目标解码值,从而可以获得8个第一目标解码值。
步骤305、接收端设备基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包。
需要说明的是,在本申请的实施例中,接收端设备中的识别恢复模块在基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包时,可以基于r个数据包组确定丢失的数据包对应的目标组别;其中,目标组别为r个数据包组中的任意一组;然后可以基于目标组别和r个冗余修复数据包确定丢失的数据包对应的目标冗余修复数据包;进而可以基于目标组别和r个第一目标解码值确定丢失的数据包对应的第二目标解码值;从而可以基于目标冗余修复数据包和第二目标解码值确定丢失的数据包。
示例性的,在本申请的实施例中,假设r为8,假设8个冗余修复数据包为XOR(0)~XOR(7),8个数据包组分别与8个冗余修复数据包一一对应,即第一个数据包组对应的冗余修复数据包为XOR(0),若丢失的数据包为RDMA(48),则识别恢复模块可以基于8个数据包组确定丢失的数据包对应的目标组别为第一个数据包组,然后可以基于目第一个数据包组和8个冗余修复数据包确定丢失的数据包对应的目标冗余修复数据包为第一个冗余修复数据包XOR(0),进而可以基于第一个数据包组和8个第一目标解码值确定丢失的数据包对应的第二目标解码值为DEC(0),从而可以基于目标冗余修复数据包XOR(0)和第二目标解码值DEC(0)确定丢失的数据包,如上述公式(2)所示,丢失的数据包可以通过目标冗余修复数据包XOR(0)和第二目标解码值DEC(0)进行异或运算获得。
需要说明的是,在本申请的实施例中,接收端设备能够在接收数据包的同时进行实时的丢包恢复,减少了需要暂存整个数据包序列的需求,降低了内存资源占用,并在极短时间内可以通过收到的冗余修复数据包对丢失数据包进行恢复,因而具有实时丢包恢复的优点,并且避免了重传对RDMA传输性能造成的负面影响。
综上所述,发送端设备中的冗余生成模块可以对m个数据包进行分组,确定r个数据包组,然后可以基于r个数据包组确定对应的r个冗余修复数据包,进而可以将m个数据包和对应的r个冗余修复数据包一同发送至接收端设备,而无需引入新的QP队列对,因此无需对应用程序做出任何修改,保持了对已有应用程序的兼容性,同时也无需消耗更多RDMA网卡硬件资源,降低了资源利用率;且本申请新增的冗余生成模块和识别恢复模块分别工作在发送端RDMA网卡和接收端RDMA网卡,因此不会增加额外的CPU负担,从而节省了CPU资源,且接收端设备中的识别恢复模块可以同时接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包,在存在丢包的情况下,识别恢复模块可以在极短时间内可以通过收到的冗余修复数据包对丢失数据包进行恢复,因而具有实时丢包恢复的优点。
本申请实施例提供了一种丢包恢复方法,该方法应用于接收端设备和发送端设备,接收端设备接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包;发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
实施例四
基于上述实施例,本申请的再一实施例提供了一种丢包恢复方法,相较于传统RDMA传输中发送端和接收端的RDMA协议栈模块,本申请新增了发送端前向纠错冗余生成模块(冗余生成模块)和接收端丢包识别与恢复模块(识别恢复模块)。图6为本申请实施例提出的基于前向纠错的广域网RDMA实时丢包恢复技术的工作流程示意图,如图6所示,发送端设备包括RDMA协议栈和前向纠错冗余生成模块(冗余生成模块),接收端设备可以包括RDMA协议栈和丢包识别与恢复模块(识别恢复模块),冗余生成模块可以接收RDMA协议栈发送的原始数据包,然后可以生成冗余修复数据包,并将原始数据包和冗余修复数据包通过有损广域网传输至接收端设备,识别恢复模块基于有损的原始数据包和冗余修复数据包确定原始无损数据包。
需要说明的是,在本申请的实施例中,图7为本申请实施例提出的前向纠错冗余生成模块结构示意图,如图7所示,冗余生成模块可以接收RDMA协议栈发送的原始数据包,然后可以基于原始数据包不断更新冗余编码记录表(r个第一目标编码值),从而生成冗余修复数据包,进而可以基于发送选择器将原始数据包和冗余修复数据包发送至接收端设备。
需要说明的是,在本申请的实施例中,图8为本申请实施例提出的接收端的丢包识别与恢复模块的结构示意图,如图8所示,丢包识别与恢复模块(识别恢复模块)可以接收有损的原始数据包和冗余修复数据包,然后可以识别丢包并更新冗余解码及模块状态记录表(r个第一目标解码值),并基于冗余修复数据包和记录表(r个第一目标解码值)进行丢包恢复,获得无损数据包,进而可以将原始有序数据包发送至RDMA协议栈。
需要说明的是,在本申请的实施例中,新增模块的功能如下:(1)发送端的前向纠错冗余生成模块(冗余生成模块)的主要功能为:根据发送端RDMA协议栈发出的原始数据包进行的前向纠错编码,产生冗余修复数据包并随原始数据包一同发送至接收端;(2)接收端的丢包识别与恢复模块(识别恢复模块)的主要功能为:根据接收到的来自有损广域网的RDMA原始数据包头部的PSN字段判断原始数据包是否发送丢失,利用重排序缓冲区暂存因丢包而产生的乱序的原始数据包,并通过随原始数据包一同到达接收端的冗余修复数据包即时地恢复丢失的原始数据包,并将恢复得到的有序的、无损的原始数据包传输至接收端RDMA协议栈模块。
进一步地,在本申请的实施例中,发送端前向纠错冗余生成模块(冗余生成模块)的工作原理如下,发送端对相同RDMA传输数据流进行分组划分。在RDMA协议栈的数据传输过程中,同一数据流内的所有RDMA原始数据包的包序号PSN,在没有发生丢失的情况下,保持连续递增。为了有效地进行冗余修复数据包的生成,采用按分组的冗余计算方式,将数据包根据其PSN分组。在分组时,根据指定的分组大小,选择适当的首个PSN以对齐分组,从而确保能够根据PSN和分组大小准确判定两个数据包是否属于同一分组。这一机制有助于接收端对原始数据包和冗余修复数据包进行有序组织和识别,以维护数据传输的完整性和可靠性;每个分组(Group)包含连续的m个RDMA原始数据包,而每k个原始数据包生成一个相应的冗余数据包。这样,每个分组共生成r个经过冗余计算得到的冗余修复数据包,且m、r、k的关系如下述公式(4)所示。
m=r*k  (4)
需要说明的是,在本申请的实施例中,在传输过程中,这m个原始数据包按照它们的PSN序号经过RDMA协议栈和网卡递增地发送。在前向纠错编码阶段,采用数据包级别的异或运算,对分组内的每个数据包进行操作,以创建冗余修复数据包。这里,我们使用交织编码技术来编码原始数据包,其中包含一个固定的间隔,称为交织间隔,用r表示。在此基础上,相同分组所产生的每一个冗余修复数据包XOR(i),它的值与同一分组内的数据包DATA(i)之间存在以下关系。
XOR(i)=DATE(i)^DATE(i+r)^……^DATE(i+(k-1)*r)  (5)
其中,DATE(i)表示第i个数据包,DATE(i+r)表示第i+r个数据包,……,DATE(i+(k-1)*r)表示第i+(k-1)*r个数据包,k为m/r的整数。
需要说明的是,在本申请的实施例中,此处及之后所述的RDMA原始数据包,即RDMA(i),指由RDMA协议所规定的完整的RDMA传输层数据包,例如,在InfiniBand协议中,即为结构包括BTH头部、可选的AETH头部、可选的RETH头部、RDMA数据负载及ICRC校验码的传输层数据包。
需要说明的是,在本申请的实施例中,由于异或运算的属性,该计算可以以逐步执行异或计算的方式进行,而无需在计算过程中保留参与异或运算的RDMA原始数据包。具体来说,每个RDMA原始数据包都可以根据其PSN确定其在分组内的位置,进而确定与之对应的编码冗余数据包,即第i个RDMA原始数据包DATA(i)对应的冗余修复数据包必然为XOR(i mod r)。因此,要计算每个冗余修复数据包的最终结果,只需要在发送第i个RDMA原始数据包时,让其与XOR(i mod r)执行异或运算进行编码值的更新计算,则当该分组最后一个RDMA原始数据包发送完成时,所得到的异或计算值(第一目标编码值)即所要求的冗余修复数据包。
需要说明的是,在本申请的实施例中,当分组内的最后一个数据包,即第m个数据包,由RDMA协议栈和网卡发送后,将产生的r个冗余修复数据包在发送下一个分组的RDMA原始数据包之前发送到与当前分组对应的接收端。
需要说明的是,在本申请的实施例中,在发送冗余修复数据包的过程中,每个冗余修复数据包的结构被构造为如上图4中所示的数据包结构。其中“Repair Header”头部字段(第一头部字段)包含了冗余数据包的相关控制信息,例如接收端的QPN(第三预设字段)、当前分组的初始PSN序号(第四预设字段)、冗余修复数据包的编号(第七预设字段)等。特别地,在“Repair Header”头部字段中,前8个比特的字段(即RC_RDMA_REPAIR字段)与RDMA协议头部中的操作码处于相同位置,其值被设置为0x1F,该值属于RDMA协议操作码的保留字段。RDMA网卡通过识别操作码字段的值,可以准确地对原始数据包和冗余修复数据包进行识别和区分。
进一步地,在本申请的实施例中,接收端丢包识别与恢复模块的工作原理如下,接收端在接收到来自发送端的任意数据包时,首先根据数据包头部中的RDMA操作码字段判断该数据包的类型,即是原始数据包还是冗余修复数据包。基于数据包类型的判定,接收端将根据其当前所处的状态采取不同的处理操作。
需要说明的是,在本申请的实施例中,图9为本申请实施例提出的三个状态之间的切换条件示意图,如图9所示,接收端(接收端设备)拥有三种状态,分别为:有序(ORDERED)、乱序(REORDERING)、和失效(INVALID)。有序状态表示已经接收到的所有数据包都是有序的,并已经传递至接收端的RDMA协议栈;乱序(无序)状态表明当前正在处理的RDMA数据包分组存在丢失,因此后续接收到的原始数据包被存放在重排序缓冲区中,并由位图(bitmap)来标识它们是否存在;失效(无效)状态表示当前分组存在无法恢复的丢失,且重排序缓冲区中的数据已全部传递至接收端RDMA协议栈。
需要说明的是,在本申请的实施例中,状态转移的条件和状态转移时所需要执行的操作为:(1)当接收端(接收端设备)收到的原始数据包被标记为乱序,表明存在丢失数据包,此时乱序的数据包以及随后接收到的相同分组内的原始数据包将被存入重排序缓冲区;(2)当接收端接收到的原始数据包是新分组内的首个数据包,并且已将重排序缓冲区中的所有可能存在的数据包提交给RDMA协议栈,接收端将切换回有序状态;(3)如果在乱序状态下,接收端收到的乱序的原始数据包表明丢包数量超过了冗余恢复能力的上限(即分组内的丢失数据包数量超过了分组产生的冗余修复数据包的数量r),在已经将重排序缓冲区中的所有可能存在的数据包提交给RDMA协议栈的情况下,接收端不再追踪当前分组;(4)收到的原始数据包是新分组的首个原始数据包,恢复有序;(5)如果在有序状态下,接收端收到的乱序的原始数据包数量超过了冗余恢复能力的上限,接收端将不再追踪当前分组。
需要说明的是,在本申请的实施例中,接收端的解码原理与发送端的编码过程保持一致,都充分利用异或计算的可分步性质,将异或冗余的修复计算分散到每次单独的数据包接收过程中。为实现这一目的,接收端需要预先设置r个存储单元DEC(0)~DEC(r),这些存储单元的大小与冗余修复数据包相同,用于存储接收端异或冗余修复计算过程中的中间结果。每个存储单元DEC(i)的初始值为0。
需要说明的是,在本申请的实施例中,当接收端接收到原始数据包时,它将检查原始数据包的序号,如果该原始数据包在分组内的序号为i、i+r、i+2r、…,那么接收端会利用该原始数据包与DEC(i)进行异或运算,同时更新DEC(i)的值,如下式(6)所示。
DEC(i)=RDMA(i)^RDMA(i+r)^RDMA(i+2r)^……  (6)
其中,RDMA(i)表示分组内第i个数据包,RDMA(i+r)表示分组内第i+r个数据包,RDMA(i+2r)表示分组内第i+2r个数据包。
需要说明的是,在本申请的实施例中,如果在分组内的原始数据包序号为i、i+r、i+2r、…的数据包中出现了丢失,接收端将使用冗余修复数据包XOR(i)与DEC(i)进行异或计算。如上述公式(2)所示,根据异或运算的特性,所得到的结果将是丢失的原始数据包RDMA(i+p*r),这一过程使接收端能够在接收数据的同时进行实时的丢包恢复,减少了需要暂存整个数据包序列的需求,同时降低了内存资源占用。
需要说明的是,在本申请的实施例中,对于相同分组内乱序的原始数据包,需要在重排序缓冲区中对其进行暂存,在分组对应的冗余修复数据包被接收端接收并恢复出丢失数据包后,再由重排序缓冲区向接收端的RDMA协议栈提交修复完成的有序的原始数据包。
需要说明的是,在本申请的实施例中,考虑到重排序缓冲区对内存的较高需求以及丢包并不总是大量发生,本申请设置了q个共享的重排序缓冲区,每个重排序缓冲区的大小等于一个编码分组,即包含m个数据包。每个重排序缓冲区都配备了一个超时定时器,当新的数时据包进入重排序缓冲区,该定时器会被更新。如果该定时器超时,那么重排序缓冲区内的所有数据将会被传递到接收端的RDMA协议栈。
进一步地,在本申请的实施例中,接收端在接收RDMA原始数据包时涉及的处理流程如下,(1)如果接收到的原始数据包不属于接收端当前分组,即PSN指示该数据包的位置在当前分组之外,接收端可以进行以下判断:a,如果该原始数据包的PSN位置大于r,表示它前方已经丢失了超过r个数据包。在这种情况下,冗余机制无法恢复这些丢失的数据包。因此,接收端将直接将该数据包传递到RDMA协议栈,并触发RDMA协议栈的重传机制。接收端同时进入失效状态;b.如果原始数据包的PSN位置小于等于r,但不是分组内的第一个数据包,这表示它前方存在一些丢失的数据包,但数量不超过最大可恢复的数据包数。接收端会在将重排序缓冲区内已有的数据包向RDMA协议栈传递并清空缓冲区后,将该数据包传递到重排序缓冲区,同时更新接收端当前分组的信息。此时,接收端进入乱序状态;c.如果接收到的RDMA数据包的PSN表示它是分组内的第一个数据包,这意味着新的数据包分组开始了。在这种情况下,接收端将直接将该数据包传递到RDMA协议栈,同时更新接收端当前分组的信息,接收端进入有序状态;(2)如果接收到的原始数据包属于接收端当前分组,即PSN指示该数据包的位置在当前分组之内,接收端可以进行以下判断:a.如果接收端处于乱序状态,将该原始数据包添加到重排序缓冲区,并更新相应的位图信息以标记这个数据包已接收;b.如果接收端处于有序状态,且该原始数据包的PSN等于接收端期望的下一个有序数据包的PSN(预设PSN)(记作“EPSN”),则将该数据包传递到接收端RDMA协议栈,并更新EPSN的数值;c.如果接收端处于有序状态,但接收到的原始数据包的PSN与EPSN不匹配,表示发生了丢包。在这种情况下,接收端将进入乱序状态,并将该原始数据包及当前分组内可能接收到的后续原始数据包一同添加到重排序缓冲区;d.如果接收端处于失效状态,将该原始数据包直接传递到接收端RDMA协议栈。
需要说明的是,在本申请的实施例中,与之相对应地,接收端在接收到冗余修复数据包时涉及的处理流程如下:(1)在以下情况下(第二预设条件),冗余修复数据包将被直接抛弃:a.冗余修复数据包的Source Start PSN字段与接收端当前分组的首个原始数据包的PSN字段不匹配;b.接收端处于失效状态;c.接收端处于乱序状态,但已接收到了与冗余修复数据包生成相关的所有k个原始数据包;d.接收端处于有序状态,但接收到的冗余修复数据包不足以恢复丢失的原始数据包;e.接收端处于有序状态,并已接收当前分组内所有的原始数据包;(2)如果修复包未被抛弃,将利用该冗余修复数据包进行丢失数据包的修复:a.如果接收端处于有序状态,将通过前述步骤恢复得到的丢失原始数据包直接传入接收端RDMA协议栈;b.如果接收端处于乱序状态,则将通过前述步骤恢复得到的丢失原始数据包传递到重排序缓冲区,且在每次修复后检查当前分组的所有丢包是否都已修复;c.在b)的基础上,如果当前分组已经通过对原始数据包的接收和对丢失数据包的恢复计算而完全收到分组内所有的原始数据包,则将重排序缓冲区中的所有数据包传入接收端RDMA协议栈,并清空重排序缓冲区。
示例性的,在本申请的实施例中,假设设定的分组大小为m=128,且数据包在进行基于异或的前向纠错编码时的交织间距为r=8。如下表1所示,该分组包含128个RDMA原始数据包,其PSN被设定为从0到127。发送端RDMA协议栈产生该分组的RDMA原始数据包后,该分组的所有原始数据包均进入发送端前向纠错冗余生成模块(冗余生成模块),以生成冗余修复数据包,在执行前向纠错的冗余修复数据包生成时,这些数据包参与异或计算的交织间距被设定为r=8,即原始数据包RDMA(0)、RDMA(8)、…、RDMA(112)、RDMA(120)进行异或计算,并且生成对应的冗余修复数据包XOR(0)。对于冗余修复数据包XOR(1)~XOR(7)的产生,均以此类推。
表1
示例性的,在本申请的实施例中,在生成前向纠错的冗余修复数据包时,由于异或计算的特性,无需缓存参与计算的数据包。以原始数据包RDMA(0)、RDMA(8)、…、RDMA(112)、RDMA(120)产生冗余修复数据包XOR(0)的过程为例,当原始数据包RDMA(0)通过RDMA网卡发送时,它与初始为0的XOR(0)进行一次异或计算,并更新XOR(0)的值如下式(7)所示,接着,对RDMA(8)、…、RDMA(112)、RDMA(120),在它们通过RDMA网卡被生成和发送时,均与XOR(0)进行异或计算并更新XOR(0)的值。在RDMA(120)完成对XOR(0)的更新后,根据异或计算的性质,所得到的最终的XOR(0)(第一目标编码值)即为RDMA(0)、RDMA(8)、…、RDMA(112)、RDMA(120)整体的异或计算结果。因此,RDMA网卡实际上只需保存每个分组对应的冗余修复数据包的中间值结果,而无需保存所有参与前向纠错计算的数据包的原始数据,这有助于节省大量的网卡硬件资源。
XOR(0) = XOR(0) ^ RDMA(0)            (7)
需要说明的是,在本申请的实施例中,当分组内最后一个原始数据包RDMA(127)被发送,并完成了冗余修复数据包XOR(7)的更新后,发送端的RDMA网卡会发送所有的冗余修复数据包XOR(0)~XOR(7)。
需要说明的是,在本申请的实施例中,在发送每个冗余修复数据包时,添加Repair Header头部,并根据该次RDMA传输中使用的QP队列对的上下文和前向纠错机制的设置对头部的各个字段进行相应的填充。Repair Header中的Source Start PSN字段的数值为0,表示本分组从PSN=0的RDMA原始数据包开始;冗余修复数据包XOR(0)~XOR(7)的Repair Number字段分别为0~7,表示冗余修复数据包的编号;Shift Size即表示交织间隔,设置为8;Cluster Size表示组内原始数据包数量,设置为128;Total Repair Number表示总的冗余修复数据包数量,设置为8;随后,这128个RDMA原始数据包和8个冗余修复数据包先后通过有损广域网进行传输,并且在传输过程中产生丢包,使得RDMA(43)~RDMA(49)这连续7个RDMA原始数据包发送丢包,其余数据包则被接收端正确接收。
需要说明的是,在本申请的实施例中,如下表2所示,接收端接收PSN为0~127的RDMA原始数据包RDMA(0)~RDMA(127),并利用接收到地冗余修复数据包XOR(0)~XOR(7)对接受过程中的丢失数据包进行恢复的过程。其中,PSN为0~42、50~127的RDMA原始数据包和所有的冗余修复数据包均被接收端成功接收,而PSN为43~49的RDMA数据包在传输过程中发生丢失。
表2
需要说明的是,在本申请的实施例中,接收端在收到PSN=0的RDMA原始数据包时,由于该PSN值是新分组的第1个数据包,接收端根据原始数据包处理流程中不属于当前分组的数据包处理流程(1)中的步骤c,在这一步骤中,接收端会将该原始数据包直接传递到RDMA协议栈,并且将自身的状态设置为有序状态。同时,接收端会将EPSN(期望下一个有序数据包的PSN)的值设置为1。同样,接收端还会在bitmap中记录已经接收到PSN等于0的原始数据包。与此同时,该RDMA原始数据包参与接收端的冗余计算中间值DEC(0)的更新,如下述公式(8)所示。
DEC (0) = DEC (0) ^ RDMA(0)                     (8)
需要说明的是,在本申请的实施例中,接收端在接收PSN等于1的RDMA数据包时,由于接收端此时已经将当前分组更新为正在接收的分组,因此按照原始数据包处理流程中属于当前分组的数据包的处理流程(2)中的步骤b,进行EPSN和PSN的比较。由于EPSN等于PSN都等于1,接收端会将这个数据包提交给接收端RDMA协议栈,并将EPSN的数值更新为2。同时,接收端会在bitmap中记录已经接收到PSN等于1的原始数据包。这个过程会一直重复,直到接收PSN等于43的数据包完成。同时,每个原始数据包都会参与到相应的DEC(i)值的更新中,以确保正确计算中间值,如下述公式(9)所示。
DEC(i mod r) = DEC(i mod r) ^ RDMA(i)               (9)
需要说明的是,在本申请的实施例中,PSN为43到49的RDMA原始数据包均丢失,因此接收端在接收下一个PSN为50的原始数据包时,根据PSN值确定这个数据包属于当前追踪的分组。因此,接收端遵循原始数据包处理流程中属于当前分组的数据包的处理流程(2)中的步骤c,比较EPSN和PSN。由于EPSN≠PSN,接收端识别这个原始数据包为失序数据包,并在bitmap中记录其接收。接收端使用此数据包来更新对应的DEC(2)值,然后将此数据包放入重排序缓冲区。同时,接收端将其状态更改为乱序(REORDERING)状态。
需要说明的是,在本申请的实施例中,接收端在接收PSN为50到127的后续原始数据包时,因为接收端目前处于乱序(REORDERING)状态,遵循原始数据包处理流程中属于当前分组的数据包的处理流程(2)的步骤a。在bitmap中记录接收到这些数据包,使用它们来更新相应的DEC值DEC(i),然后将它们存放到重排序缓冲区。
需要说明的是,在本申请的实施例中,接收端在收到XOR(0)冗余修复数据包时,不满足冗余修复数据包处理流程中的任何抛弃条件,因此根据冗余修复包处理流程(2),利用其冗余数据进行丢失原始数据包的修复。根据bitmap可知,在参与XOR(0)冗余修复数据包的异或计算生成的0、8、16、…等原始数据包中,接收端未收到PSN=48的原始数据包。将接收端的此时的DEC(0)值与冗余修复数据包XOR(0)进行异或运算,得到的结果即为PSN=48的原始数据包。由于接收端当前状态为乱序(REORDERING),因此将恢复得到的原始数据包放入重排序缓冲区。最后,检查到接收端仍然没有接收到全部丢失的原始数据包,因此不改变接收端状态和重排序缓冲区。对于XOR(1)及XOR(3)~XOR(7),也执行相同流程。
需要说明的是,在本申请的实施例中,特别地,接收端在收到XOR(2)冗余修复数据包时,由于参与XOR(2)生成的的所有原始数据包均已收到,所以接收端根据处理流程(1)直接抛弃该冗余修复数据包。
需要说明的是,在本申请的实施例中,接收端在收到XOR(7)冗余修复数据包时,执行与XOR(0)相同的处理流程。但是,在将修复得到的丢失的原始数据包放入重排序缓冲区后,根据bitmap中记录的已经完成接收的原始数据包信息,接收端已经接收完成所有当前分组内的RDMA原始数据包数据包,因此需要将整个重排序缓冲区中暂存的所有RDMA原始数据包向上送入RDMA协议栈,并清空重排序缓冲区中的内容。
需要说明的是,在本申请的实施例中,接收端RDMA协议栈完整且有序地接收到了PSN为0~127的所有RDMA原始数据包,而未触发RDMA协议栈原有的GBN重传机制。由于恢复丢包所需要的时间远小于在广域网中通过重传进行丢包恢复的时间,因此实现了RDMA丢失数据包的实时恢复。
综上所述,发送端设备中的冗余生成模块可以对m个数据包进行分组,确定r个数据包组,然后可以基于r个数据包组确定对应的r个冗余修复数据包,进而可以将m个数据包和对应的r个冗余修复数据包一同发送至接收端设备,而无需引入新的QP队列对,因此无需对应用程序做出任何修改,保持了对已有应用程序的兼容性,同时也无需消耗更多RDMA网卡硬件资源,降低了资源利用率;且本申请新增的冗余生成模块和识别恢复模块分别工作在发送端RDMA网卡和接收端RDMA网卡,因此不会增加额外的CPU负担,从而节省了CPU资源,且接收端设备中的识别恢复模块可以同时接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包,在存在丢包的情况下,识别恢复模块可以在极短时间内可以通过收到的冗余修复数据包对丢失数据包进行恢复,因而具有实时丢包恢复的优点。
本申请实施例提供了一种丢包恢复方法,该方法应用于接收端设备和发送端设备,接收端设备包括识别恢复模块,发送端设备包括冗余生成模块,接收端设备中的识别恢复模块接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包;发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请中的识别恢复模块可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
实施例五
基于上述实施例,本申请实施例提供了一种接收端设备,图10为接收端设备的组成结构示意图一,如图10所示,接收端设备10包括:识别恢复模块11;
所述识别恢复模块11,用于接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;
所述识别恢复模块11,还用于在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;
所述识别恢复模块11,还用于基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
在本申请的实施例中,进一步地,图11为接收端设备的组成结构示意图二,如图11所示,本申请实施例提出的接收端设备10还可以包括第一处理器12、存储有第一处理器12可执行指令的第一存储器13,进一步地,接收端设备10还可以包括第一通信接口14,和用于连接第一处理器12、第一存储器13以及第一通信接口14的第一总线15。
在本申请的实施例中,上述第一处理器12可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列(Field ProgRAMmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。接收端设备10还可以包括第一存储器13,该第一存储器13可以与第一处理器12连接,其中,第一存储器13用于存储可执行程序代码,该程序代码包括计算机操作指令,第一存储器13可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。
在本申请的实施例中,第一总线15用于连接第一通信接口14、第一处理器12以及第一存储器13以及这些器件之间的相互通信。
在本申请的实施例中,第一存储器13,用于存储指令和数据。
进一步地,在本申请的实施例中,上述第一处理器12,用于接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
在实际应用中,上述第一存储器13可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向第一处理器12提供指令和数据。
本申请实施例提供了一种接收端设备,接收端设备包括识别恢复模块,接收端设备中的识别恢复模块接收发送端设备中的冗余生成模块发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;在基于m个数据包确定存在丢包的情况下,基于m个数据包确定r个第一目标解码值;基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包。由此可见,接收端设备可以同时接收m个数据包和r个冗余修复数据包,若检测到存在丢包情况,则可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,获得丢失的数据包,从而可以进行实时丢包恢复,无需接收端设备在检测到数据包丢失后,请求发送端设备进行丢失数据包的重传,避免了时延问题;且本申请中的识别恢复模块可以基于m个数据包确定r个第一目标解码值;进而可以基于r个冗余修复数据包和r个第一目标解码值进行恢复处理,而无需CPU参与恢复处理,节省了宝贵的CPU资源,同时针对m个数据包和r个冗余修复数据包是接收端设备同时接收的,因此无需引入新的QP队列对,从而可以减少使用RDMA网卡硬件资源,进而提升了资源利用率。
本申请实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的丢包恢复方法。
具体来讲,本实施例中的一种丢包恢复方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种丢包恢复方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;
在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;
基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
在本申请的实施例中,进一步地,图12为发送端设备的组成结构示意图一,如图12所示,发送端设备20包括:冗余生成模块21;
所述冗余生成模块21,用于接收远程直接内存访问RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;
所述冗余生成模块21,还用于基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;
所述冗余生成模块21,还用于将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
在本申请的实施例中,进一步地,图13为发送端设备的组成结构示意图二,如图13所示,本申请实施例提出的发送端设备20还可以包括第二处理器22、存储有第二处理器22可执行指令的第二存储器23,进一步地,发送端设备20还可以包括第二通信接口24,和用于连接第二处理器22、第二存储器23以及第二通信接口24的第二总线25。
在本申请的实施例中,上述第二处理器22可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列(Field ProgRAMmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。发送端设备20还可以包括第二存储器23,该第二存储器23可以与第二处理器22连接,其中,第二存储器23用于存储可执行程序代码,该程序代码包括计算机操作指令,第二存储器23可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。
在本申请的实施例中,第二总线25用于连接第二通信接口24、第二处理器22以及第二存储器23以及这些器件之间的相互通信。
在本申请的实施例中,第二存储器23,用于存储指令和数据。
进一步地,在本申请的实施例中,上述第二处理器22,用于接收RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
在实际应用中,上述第二存储器23可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向第二处理器22提供指令和数据。
本申请实施例提供了一种发送端设备,发送端设备包括冗余生成模块,发送端设备接收RDMA协议栈模块发送的s个原始数据包,并对s个原始数据包进行分组处理,获得q个原始数据包组;其中,q个原始数据包组分别包括m个数据包,s、m以及q均为正整数;基于m个数据包确定对应的r个冗余修复数据包;其中,r为正整数;将m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。由此可见,发送端设备可以基于m个数据包确定对应的r个冗余修复数据包,然后可以将m个数据包和对应的r个冗余修复数据包一同发送至接收端设备,以使接收端设备基于m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包,而无需引入新的QP队列对,因此无需对应用程序做出任何修改,保持了对已有应用程序的兼容性,同时也无需消耗更多RDMA网卡硬件资源,降低了资源利用率。
本申请实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的丢包恢复方法。
具体来讲,本实施例中的一种丢包恢复方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种丢包恢复方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
接收RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;
基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;
将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。

Claims (20)

  1. 一种丢包恢复方法,应用于接收端设备,所述方法包括:
    接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;
    在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;
    基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
  2. 根据权利要求1所述的方法,所述基于所述m个数据包确定r个第一目标解码值,包括:
    对所述m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括所述m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0且小于等于r-1的整数;
    基于所述r个数据包组确定对应的所述r个第一目标解码值。
  3. 根据权利要求2所述的方法,所述基于所述r个数据包组确定对应的所述r个第一目标解码值,包括:
    当接收到第i个数据包和第i+r个数据包之后,基于所述第i个数据包和所述第i+r个数据包确定r个第一解码值;
    当接收到第i+2r个数据包之后,基于所述第i+2r个数据包分别对所述r个第一解码值进行更新处理,获得r个第二解码值;
    当直到接收第i+[(m/r)-1]×r个数据包之后,基于所述第i+[(m/r)-1]×r个数据包分别对r个第N解码值进行更新处理,获得所述r个第一目标解码值;其中,所述r个第N解码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1解码值进行更新处理获得的。
  4. 根据权利要求3所述的方法,所述基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包,包括:
    基于所述r个数据包组确定所述丢失的数据包对应的目标组别;其中,所述目标组别为所述r个数据包组中的任意一组;
    基于所述目标组别和所述r个冗余修复数据包确定所述丢失的数据包对应的目标冗余修复数据包;
    基于所述目标组别和所述r个第一目标解码值确定所述丢失的数据包对应的第二目标解码值;
    基于所述目标冗余修复数据包和所述第二目标解码值确定所述丢失的数据包。
  5. 根据权利要求1-4任一项所述的方法,在所述接收发送端设备发送的m个数据包和r个冗余修复数据包之后,所述方法还包括:
    在所述m个数据包中的第一预设字段值为第一预设值的情况下,确定所述m个数据包对应的身份信息为冗余修复数据包身份;或者,
    在所述m个数据包中的所述第一预设字段值不为所述第一预设值的情况下,确定所述m个数据包对应的身份信息为原始数据包身份;或者,
    在所述r个冗余修复数据包中的第二预设字段值为所述第一预设值的情况下,确定所述r个冗余修复数据包对应的身份信息为冗余修复数据包身份;或者,
    在所述r个冗余修复数据包中的所述第二预设字段值不为所述第一预设值的情况下,确定所述r个冗余修复数据包对应的身份信息为原始数据包身份。
  6. 根据权利要求1-5任一项所述的方法,还包括:
    确定所述m个数据包中的第f个数据包对应的包序列号PSN;其中,f为小于或者等于m的正整数;
    在所述第f个数据包对应的PSN与预设PSN不同的情况下,判定存在丢包行为。
  7. 根据权利要求6所述的方法,还包括:
    在接收到的所述m个数据包中的第一个数据包为当前组的第一个数据包的情况下,确定所述接收端设备的状态为有序状态;
    相应地,所述方法还包括:
    在所述m个数据包中存在丢包行为的情况下,将所述接收端设备的状态更新为无序状态;或者,
    在所述m个数据包中不存在丢包行为的情况下,保持所述接收端设备的状态为有序状态。
  8. 根据权利要求7所述的方法,还包括:
    在所述m个数据包中的丢包数量满足第一预设条件的情况下,将所述接收端设备的当前状态切换为无效状态。
  9. 根据权利要求1-8任一项所述的方法,还包括:
    在所述r个冗余修复数据包满足第二预设条件的情况下,将所述r个冗余修复数据包进行丢弃处理。
  10. 一种丢包恢复方法,应用于发送端设备,所述方法包括:
    接收远程直接内存访问RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;
    基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;
    将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
  11. 根据权利要求10所述的方法,所述基于所述m个数据包确定对应的r个冗余修复数据包,包括:
    基于所述m个数据包确定对应的r个数据包组;
    基于所述r个数据包组确定对应的r个冗余修复数据包。
  12. 根据权利要求11所述的方法,所述基于所述m个数据包确定对应的r个数据包组,包括:
    对所述m个数据包进行分组,确定r个数据包组;其中,每一个数据包组包括所述m个数据包中的第i个数据包、第i+r个数据包、第i+2r个数据包……第i+[(m/r)-1]×r个数据包,i为大于等于0小于等于r-1的整数。
  13. 根据权利要求12所述的方法,所述基于所述r个数据包组确定对应的r个冗余修复数据包,包括:
    当接收到第i个数据包和第i+r个数据包之后,基于所述第i个数据包和所述第i+r个数据包确定r个第一编码值;
    当接收到第i+2r个数据包之后,基于所述第i+2r个数据包分别对所述r个第一编码值进行更新处理,获得r个第二编码值;
    当直到接收第i+[(m/r)-1]×r数据包之后,基于所述第i+[(m/r)-1]×r个数据包分别对r个第N编码值进行更新处理;获得所述r个第一目标编码值;其中,所述r个第N编码值为基于第i+[(m/r)-2]×r个数据包分别对r个第N-1编码值进行更新处理获得的;
    基于所述r个第一目标编码值分别确定对应的r个冗余修复数据包。
  14. 根据权利要求10-13任一项所述的方法,所述冗余修复数据包包括第一头部字段;所述第一头部字段至少包括第二预设字段、第三预设字段、第四预设字段、第五预设字段、第六预设字段以及第七预设字段;其中,所述第二预设字段用于所述接收端设备判断所述冗余修复数据包对应的身份信息;其中,所述身份信息包括原始数据包身份或者冗余修复数据包身份,所述第三预设字段用于表征目标队列对编号QPN,所述第四预设字段用于表征源段起点包序列号PSN,所述第五预设字段用于表征交织间隔的包的个数,所述第六预设字段用于表征冗余修复数据包的个数,所述第七预设字段用于表征当前冗余修复数据包的编号。
  15. 一种接收端设备,包括:识别恢复模块;
    所述识别恢复模块,用于接收发送端设备发送的m个数据包和r个冗余修复数据包;其中,m和r均为正整数;还用于在基于所述m个数据包确定存在丢包的情况下,基于所述m个数据包确定r个第一目标解码值;还用于基于所述r个冗余修复数据包和所述r个第一目标解码值进行恢复处理,获得丢失的数据包。
  16. 一种接收端设备,包括:第一处理器和第一存储器;其中,
    所述第一存储器,用于存储能够在所述处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求1-9中任一所述的方法。
  17. 一种发送端设备,包括:冗余生成模块;
    所述冗余生成模块,用于接收远程直接内存访问RDMA协议栈模块发送的s个原始数据包,并对所述s个原始数据包进行分组处理,获得q个原始数据包组;其中,所述q个原始数据包组分别包括m个数据包,所述s、m以及q均为正整数;还用于基于所述m个数据包确定对应的r个冗余修复数据包;其中,所述r为正整数;还用于将所述m个数据包和对应的r个冗余修复数据包分别发送至接收端设备,以使所述接收端设备基于所述m个数据包和对应的r个冗余修复数据包进行丢包恢复处理,获得丢失的数据包。
  18. 一种发送端设备,包括:第二处理器和第二存储器;其中,
    所述第二存储器,用于存储能够在所述处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求10-14中任一所述的方法。
  19. 一种计算机可读存储介质,所述存储介质上存储有计算机程序代码,当所述计算机程序代码被计算机执行时执行权利要求1-9或者10-14中任一所述的方法。
  20. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-9或者10-14中任一项所述的方法。
PCT/CN2025/085872 2024-03-29 2025-03-28 一种丢包恢复方法、接收端设备、发送端设备及存储介质 Pending WO2025201534A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410382582.8A CN118802069B (zh) 2024-03-29 2024-03-29 一种丢包恢复方法、接收端设备、发送端设备及存储介质
CN202410382582.8 2024-03-29

Publications (1)

Publication Number Publication Date
WO2025201534A1 true WO2025201534A1 (zh) 2025-10-02

Family

ID=93020661

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/085872 Pending WO2025201534A1 (zh) 2024-03-29 2025-03-28 一种丢包恢复方法、接收端设备、发送端设备及存储介质

Country Status (2)

Country Link
CN (1) CN118802069B (zh)
WO (1) WO2025201534A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118802069B (zh) * 2024-03-29 2025-11-07 中国移动通信有限公司研究院 一种丢包恢复方法、接收端设备、发送端设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116616A1 (ja) * 2009-03-30 2010-10-14 日本電気株式会社 ストリーム配信システムにおける中継装置および配信制御方法
CN107196746A (zh) * 2016-03-15 2017-09-22 中兴通讯股份有限公司 实时通信中的抗丢包方法、装置和系统
CN114513418A (zh) * 2022-04-21 2022-05-17 腾讯科技(深圳)有限公司 一种数据处理方法及相关设备
CN118802069A (zh) * 2024-03-29 2024-10-18 中国移动通信有限公司研究院 一种丢包恢复方法、接收端设备、发送端设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662339B (zh) * 2009-09-29 2012-12-19 中兴通讯股份有限公司 一种对前向纠错恢复的数据进行校验的方法及装置
CN103067719A (zh) * 2013-01-31 2013-04-24 南京邮电大学 基于不等差错保护的实时视频通信方法
CN110855402A (zh) * 2016-09-30 2020-02-28 瞬已网络科技(上海)有限公司 一种网络实时视频传输方法及装置
EP4283480B1 (en) * 2020-04-16 2024-10-30 Huawei Technologies Co., Ltd. A device and method for remote direct memory access

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116616A1 (ja) * 2009-03-30 2010-10-14 日本電気株式会社 ストリーム配信システムにおける中継装置および配信制御方法
CN107196746A (zh) * 2016-03-15 2017-09-22 中兴通讯股份有限公司 实时通信中的抗丢包方法、装置和系统
CN114513418A (zh) * 2022-04-21 2022-05-17 腾讯科技(深圳)有限公司 一种数据处理方法及相关设备
CN118802069A (zh) * 2024-03-29 2024-10-18 中国移动通信有限公司研究院 一种丢包恢复方法、接收端设备、发送端设备及存储介质

Also Published As

Publication number Publication date
CN118802069A (zh) 2024-10-18
CN118802069B (zh) 2025-11-07

Similar Documents

Publication Publication Date Title
US12137001B2 (en) Scalable protocol-agnostic reliable transport
CN111740808B (zh) 一种数据传输方法及装置
US11716409B2 (en) Packet transmission method and apparatus
JP4942375B2 (ja) ネットワーク処理装置
US9628382B2 (en) Reliable transport of ethernet packet data with wire-speed and packet data rate match
JP4156568B2 (ja) 通信システムの制御方法、通信制御装置、プログラム
CN111711566B (zh) 多路径路由场景下的接收端乱序重排方法
US20090059928A1 (en) Communication apparatus, communication system, absent packet detecting method and absent packet detecting program
CN102497248B (zh) 基于网络编码的数据重传方法
CN108631947B (zh) 一种基于纠删码的rdma网络数据传输方法
JPH11136220A (ja) 符号伝送方法、送信装置、受信装置および通信システム
WO2025201534A1 (zh) 一种丢包恢复方法、接收端设备、发送端设备及存储介质
SE513327C2 (sv) System och metod för datakommunikation
CN116260553A (zh) 数据重传的方法、装置及系统
CN1509025A (zh) 一种实现报文分片组包的方法
EP3117546B1 (en) Low-delay packet erasure coding
CN113973091A (zh) 一种报文处理方法、网络设备以及相关设备
CN117354370A (zh) 面向分布式应用程序的通用网内同步聚合方法、系统及设备
WO2015085744A1 (en) Method and apparatus for transmitting data packets
CN118764450B (zh) 一种包粒度负载均衡方法及系统
WO2009087774A1 (ja) ネットワークカードおよび情報処理装置
CN1622504A (zh) 一种数据包恢复方法
CN103346862B (zh) 一种分级保护的片上网络数据传输装置及方法
JP4901777B2 (ja) ネットワーク中継装置およびネットワーク中継方法
CN115617566B (zh) 并行化的网络聚合修复方法、系统和设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25776488

Country of ref document: EP

Kind code of ref document: A1