Data transmission method and device, equipment and storage medium

By quickly judging the risk of data packet loss on the switch and generating a retransmission identification signal, it solves the problem of low efficiency of the N-frame rollback scheme in RDMA, achieves fast retransmission response, reduces transmission delay and cache pressure, and improves efficiency. Data transmission efficiency.

CN118540283APending Publication Date: 2024-08-23PENG CHENG LAB +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410749040.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing RDMA data packet transmission, the retransmission mechanism of the Go-Back-N (GBN) scheme is inefficient, resulting in transmission delay and efficiency problems, especially in high-latency environments, which cannot effectively handle sudden errors. or high-frequency errors.

Method used

On the switch, the packet size of the received data packet is compared with the remaining capacity of the traffic queue to generate a pre-loss packet identifier to determine the transmission direction. When the transmission direction is the second transmission direction, a retransmission identification signal is generated to quickly trigger the sending end. The network card retransmits the data packet to avoid making judgments after accumulating a large amount of data at the receiving end.

Benefits of technology

It reduces RDMA transmission delay, improves data transmission efficiency, reduces cache occupation pressure, and enhances the ability to handle burst errors and high-frequency errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540283A
    Figure CN118540283A
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and device, equipment and a storage medium, and relates to the technical field of communication. The method comprises the following steps: receiving a current data message to obtain a pre-packet-loss identifier of the current data message, determining a transmission direction corresponding to the current data message according to the pre-packet-loss identifier, and when the transmission direction is a first transmission direction, transmitting the current data message to a receiving end network card through a first flow queue, and when the transmission direction is a second transmission direction, generating a retransmission identification signal according to the current data message, and transmitting the retransmission identification signal to the sending end network card. According to the method, retransmission response is carried out on the switch between the sending end network card and the receiving end network card, the packet loss risk is rapidly judged, it is not needed to judge whether packet loss exists or not after more data messages are accumulated on the receiving end network card, retransmission response can be rapidly triggered, and RDMA transmission delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, apparatus, device and storage medium. Background Art

[0002] Remote Direct Memory Access (RDMA) is a technology that directly transfers data between servers to each other's memory without the intervention of the operating system, which can significantly reduce latency and improve data throughput. With the rapid development of network technology, RDMA is being used more and more widely as a high-performance data transmission solution.

[0003] In the related art, if a data packet transmission error occurs during RDMA transmission, the data packet is retransmitted by using a Go-Back-N (GBN) scheme. However, in this way, the sending end will retransmit the data packet only after the receiving end detects the loss of the packet and feeds back a retransmission request to the sending end. This packet loss response mechanism is inefficient, thereby affecting the transmission efficiency of RDMA. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a data transmission method, apparatus, device and storage medium to improve the transmission efficiency of RDMA.

[0005] To achieve the above object, a first aspect of an embodiment of the present application proposes a data transmission method, which is applied to a switch, wherein the switch is located between a sending end network card and a receiving end network card, and the method includes:

[0006] receiving a current data message, comparing a message size of the current data message with a remaining capacity of a first traffic queue, and obtaining a pre-packet loss identifier of the current data message according to the comparison result, wherein the first traffic queue is used to cache received messages received before the current data message, and the data message is sent by the sending end network card;

[0007] Determine a transmission direction corresponding to the current data message according to the pre-packet loss identifier, the transmission direction comprising: a first transmission direction and a second transmission direction;

[0008] When the transmission direction is the first transmission direction, the current data packet is transmitted to the receiving-end network card via the first traffic queue; when the transmission direction is the second transmission direction, a retransmission identification signal is generated according to the current data packet, and the retransmission identification signal is transmitted to the sending-end network card, so that the sending-end network card resends the current data packet according to the retransmission identification signal.

[0009] In some embodiments, when the transmission direction is the second transmission direction, generating a retransmission identification signal according to the current data packet includes:

[0010] When the transmission direction is the second transmission direction, mirroring the current data message to obtain a mirrored data message;

[0011] The message header data corresponding to the mirror data message is obtained, and when the message header data meets the header standard format specification, the retransmission identification signal is generated according to the message header data.

[0012] In some embodiments, when the message header data meets the header standard format specification, generating the retransmission identification signal according to the message header data includes:

[0013] Acquire source address information, destination address information and destination queue pair sequence number from the message header data;

[0014] Swapping the source address information and the destination address information to obtain a new source address and a new destination address, obtaining a source queue pair sequence number, and replacing the destination queue pair sequence number with the source queue pair sequence number to obtain a new destination queue pair sequence number;

[0015] The new source address, the new destination address and the new sequence number of the destination queue pair are used as update fields, and the retransmission message header is connected after the update field to obtain the retransmission identification signal.

[0016] In some embodiments, the retransmission message header includes first identification data and second identification data, and the step of connecting the retransmission message header after the update field to obtain the retransmission identification signal includes:

[0017] Generate first identification data, where the first identification data is used to indicate the data message corresponding to the message sequence number retransmitted by the sending end network card;

[0018] Generate second identification data, where the second identification data is used to indicate the number of data packets that the sending end network card retransmits starting from the packet sequence number;

[0019] The retransmission identification signal is obtained according to the update field, the first identification data and the second identification data.

[0020] In some embodiments, obtaining the retransmission identification signal according to the update field, the first identification data and the second identification data includes:

[0021] Obtaining an Ethernet field, an IP field, a UDP field, and a transport layer field from the mirror data message;

[0022] Replacing the original source address in the IP field with the new source address in the update field, replacing the original destination address in the IP field with the new destination address, and replacing the original destination queue pair sequence number in the transport layer field with the new sequence number of the destination queue pair;

[0023] splicing the first identification data and the second identification data after the transmission layer field;

[0024] Performing a cyclic redundancy check calculation on the Ethernet field, the IP field, the UDP field, the transport layer field, the first identification data, and the second identification data to obtain a redundancy check and frame check field;

[0025] A corresponding retransmission identification signal is generated according to the Ethernet field, the IP field, the UDP field, the transport layer field, the first identification data, the second identification data and the redundancy detection and frame check field.

[0026] In some embodiments, transmitting the retransmission identification signal to the sending end network card includes:

[0027] Storing the retransmission identification signal in a second traffic queue, the priority of data in the second traffic queue being higher than the priority of data in the first traffic queue;

[0028] The retransmission identification signal is obtained from the second traffic queue, and based on the new destination address, the new source address and the destination queue, the sending end network card is selected to transmit the retransmission identification signal.

[0029] In some embodiments, obtaining the pre-packet loss identifier of the current data message according to the comparison result includes:

[0030] If the message size is less than or equal to the remaining capacity, the pre-packet loss identifier is a first identifier, and the first identifier is used to indicate that the current data message does not need to be retransmitted;

[0031] If the message size is larger than the remaining capacity, the pre-packet loss identifier is a second identifier, and the second identifier is used to indicate that the current data message needs to be retransmitted.

[0032] In some embodiments, determining the transmission direction corresponding to the current data message according to the pre-packet loss identifier includes:

[0033] If the pre-packet loss identifier is the first identifier, the transmission direction is the first transmission direction; if the pre-packet loss identifier is the second identifier, the transmission direction is the second transmission direction.

[0034] To achieve the above object, a second aspect of an embodiment of the present application provides a data transmission device, which is applied to a switch, and the switch is located between a sending end network card and a receiving end network card, and the device includes:

[0035] Initial processing module: used for receiving a current data message, comparing the message size of the current data message with the remaining capacity of the first traffic queue, and obtaining a pre-packet loss identifier of the current data message according to the comparison result, wherein the first traffic queue is used for caching received messages received before the current data message, and the data message is sent by the sending end network card;

[0036] A transmission direction determination module: used to determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier, the transmission direction including: a first transmission direction and a second transmission direction;

[0037] Transmission module: used for transmitting the current data message to the receiving-end network card via the first traffic queue when the transmission direction is the first transmission direction; and generating a retransmission identification signal according to the current data message when the transmission direction is the second transmission direction, and transmitting the retransmission identification signal to the sending-end network card, so that the sending-end network card retransmits the current data message according to the retransmission identification signal.

[0038] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0039] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0040] The data transmission method, device, equipment and storage medium proposed in the embodiment of the present application receive the current data message, compare the message size of the current data message with the remaining capacity of the first traffic queue, obtain the pre-packet loss identifier of the current data message according to the comparison result, determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier, and when the transmission direction is the first transmission direction, transmit the current data message to the receiving end network card via the first traffic queue, and when the transmission direction is the second transmission direction, generate a retransmission identification signal according to the current data message, and transmit the retransmission identification signal to the sending end network card, so that the sending end network card retransmits the current data message according to the retransmission identification signal. The embodiment of the present application performs a retransmission response on the switch between the sending end network card and the receiving end network card. The switch determines whether the message is likely to be lost according to the message size of the current data message. For data messages with a risk of packet loss, a retransmission identification signal is generated to the sending end network card to retransmit the data message. For normal data messages, it is forwarded to the receiving end network card. The risk of packet loss can be quickly determined on the switch, without the need to wait until the receiving network card accumulates a large number of data packets before determining whether packet loss has occurred. This can quickly trigger a retransmission response and reduce RDMA transmission delays. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of an application scenario of the data transmission method of an embodiment of the present application.

[0042] Figure 2 It is a flowchart of the data transmission method provided in an embodiment of the present application.

[0043] Figure 3 It is a schematic diagram of the implementation principle of the data transmission method provided in the embodiment of the present application.

[0044] Figure 4 It is a structural principle diagram of the switch in the embodiment of the present application.

[0045] Figure 5 This is a flowchart of generating a retransmission identification signal based on message header data provided by an embodiment of the present application.

[0046] Figure 6 This is a flowchart provided by an embodiment of the present application for connecting the retransmission message header after the update field to obtain a retransmission identification signal.

[0047] Figure 7 It is a schematic diagram of a retransmission identification signal provided in an embodiment of the present application.

[0048] Figure 8 It is a flow chart of the data transmission method provided in an embodiment of the present application.

[0049] Fig. 9 This is a structural block diagram of a data transmission device provided by another embodiment of the present application.

[0050] Fig.10 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0054] Remote Direct Memory Access (RDMA) is a technology that directly transfers data between servers to each other's memory without the intervention of the operating system, which can significantly reduce latency and improve data throughput. With the rapid development of network technology, RDMA is being used more and more widely as a high-performance data transmission solution.

[0055] In the related art, if a data packet transmission error occurs during RDMA transmission, the data packet is retransmitted by using a Go-Back-N (GBN) scheme. However, in this way, the sender will retransmit the data packet only after the receiver detects the loss of the message and feeds back a retransmission request to the sender. For example, after the receiver finds that the message is lost, it must wait for a sufficient time to ensure that the message is indeed lost before sending a retransmission request. In a high-latency environment, even in the most ideal case, it must wait for a long time before the sender receives a retransmission request from the receiver. This waiting process causes data transmission to stagnate, and cannot effectively solve the performance degradation problem caused by high latency caused by long-distance RDMA transmission. In addition, due to the delayed arrival of the retransmission request, the sender may not be able to effectively process the subsequent arriving messages during the waiting period. This not only affects the continuous transmission of data, but also causes data accumulation and processing bottlenecks. In the process of waiting for retransmission, since the data cannot be confirmed and cleared in time, these data will occupy a large amount of cache space. In a high-latency scenario, this occupation will cause great pressure on cache resources. It can be seen that the packet loss response mechanism in the related art is inefficient and has poor ability to handle sudden errors or high-frequency errors, which ultimately leads to low RDMA transmission efficiency.

[0056] Based on this, the embodiments of the present application provide a data transmission method, device, equipment and storage medium, which performs a retransmission response on the switch between the sending end network card and the receiving end network card. The switch determines whether the message is likely to be lost based on the message size of the current data message. For data messages with a risk of packet loss, a retransmission identification signal is generated to the sending end network card to retransmit the data message. For normal data messages, they are forwarded to the receiving end network card. The risk of packet loss can be quickly determined on the switch, and there is no need to determine whether the packet is lost until a large number of data messages have accumulated on the receiving end network card. The retransmission response can be quickly triggered to reduce the transmission delay of RDMA.

[0057] The embodiments of the present application provide a data transmission method, apparatus, device and storage medium, which are specifically illustrated by the following embodiments. First, the application scenario of the data transmission method in the embodiments of the present application is described.

[0058] Reference Figure 1 , Figure 1 It is a schematic diagram of an application scenario of the data transmission method of an embodiment of the present application. Figure 1As can be seen in the figure, the switch is located between the sending network card and the receiving network card. During the RDMA transmission process, the data message passes through the sending network card, is routed by the switch, and is sent to the receiving network card. In this process, the switch needs to receive the data message, and then pre-judge the risk of packet loss for the data message, forward the data message without packet loss risk to the receiving network card, and send the retransmission identification signal corresponding to the data message with packet loss risk to the sending network card, so as to achieve timely response to packet loss and improve transmission efficiency.

[0059] In one embodiment, the switch in the embodiment of the present application is a programmable switch.

[0060] The data transmission method in the embodiment of the present application is described below.

[0061] Figure 2 is an optional flowchart of the data transmission method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps 110 to 130. It can also be understood that this embodiment Figure 2 The order of step 110 to step 130 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0062] Step 110: Receive the current data message, compare the message size of the current data message with the remaining capacity of the first traffic queue, and obtain the pre-packet loss identifier of the current data message according to the comparison result.

[0063] In one embodiment, the data message is sent by the sending end network card, and the sending end network card sends the data message to the switch one by one according to the timing. The switch judges the data message corresponding to each moment, and the data message received at the current moment is called the current data message.

[0064] In one embodiment, referring to Figure 3 , Figure 3 The diagram is a schematic diagram of the implementation principle of the data transmission method provided in the embodiment of the present application. After the switch receives the data packets in sequence, it does not send them one by one, but caches the received data packets and then sends them in sequence, thereby controlling the sending rate of the data packets and avoiding network congestion or data loss caused by too fast a sending rate. Figure 3 In the switch traffic manager, two traffic queues are opened, namely the first traffic queue and the second traffic queue, and the data in the traffic queue is stored in the form of queues. Among them, the first traffic queue is used to cache the received messages received before the current data message, and then the data messages are sent from the first traffic queue to the receiving end network card in sequence.

[0065] In one embodiment, after receiving the current data message corresponding to the current moment, the switch needs to determine whether the current data message can be stored in the first traffic queue, so the message size of the current data message is compared with the remaining capacity of the first traffic queue, and the pre-packet loss identifier of the current data message is obtained according to the comparison result. If the comparison result is: the message size is less than or equal to the remaining capacity, then the first traffic queue can store the current data message, that is, the current data message can be sent normally from the first traffic queue to the receiving end network card, and the first identifier is set as the pre-packet loss identifier at this time, and the first identifier is used to indicate that the current data message does not need to be retransmitted. If the comparison result is: the message size is greater than the remaining capacity, it means that the first traffic queue cannot store the current data message, and the data message may be lost, so the second identifier is used as the pre-packet loss identifier, and the second identifier is used to indicate that the current data message needs to be retransmitted.

[0066] Step 120: Determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier.

[0067] The transmission direction includes: a first transmission direction and a second transmission direction. If the pre-packet loss identifier is the first identifier, the transmission direction is the first transmission direction, and the first transmission direction is: from the switch to the receiving end network card. If the pre-packet loss identifier is the second identifier, the transmission direction is the second transmission direction, and the second transmission direction is from the switch to the sending end network card.

[0068] Step 130: When the transmission direction is the first transmission direction, the current data packet is transmitted to the receiving network card via the first traffic queue. When the transmission direction is the second transmission direction, a retransmission identification signal is generated according to the current data packet, and the retransmission identification signal is transmitted to the sending network card, so that the sending network card resends the current data packet according to the retransmission identification signal.

[0069] In one embodiment, referring to Figure 3The switch also includes a retransmission trigger module and a retransmission identification signal construction module. After the sending end network card sends the current data message to the inlet pipe, the retransmission trigger module performs retransmission risk judgment and generates a corresponding pre-packet loss identifier. If the pre-packet loss identifier corresponds to the first transmission direction, the current data message is sent by the retransmission trigger module to the first traffic queue of the traffic manager. If the pre-packet loss identifier corresponds to the second transmission direction, the retransmission identification signal construction module mirrors the current data message in the inlet pipe to obtain a mirrored data message. Since the current data message contains message header data and payload, the message header data is located at the beginning of the current data message and contains transmission information about the data packet. The purpose of the header data is to enable the receiver to correctly parse and process the data message. The payload is the actual data part carried in the current data message, including the actual information sent, such as text, pictures, audio, etc. When mirroring, the payload in the current data message is truncated, and a message is generated according to the message header data to obtain a mirrored data message. After obtaining the mirrored data message, the mirrored data message is sent to the second traffic queue. Among them, the data priority in the second traffic queue is higher than that in the first traffic queue, and the traffic manager sends the data message in the first traffic queue or the second traffic queue to the egress pipe according to the priority. If the egress pipe receives the current data traffic sent by the first traffic queue, it forwards it to the receiving end network card. If the egress pipe receives the mirror data message sent by the second traffic queue, the retransmission identification signal construction module obtains the message header data carried by the mirror data message in the egress pipe, and when the message header data meets the header standard format specification, a retransmission identification signal is generated according to the message header data, and the retransmission identification signal is forwarded to the sending end network card via the egress pipe.

[0070] In one embodiment, before mirroring the current data message to obtain the mirrored data message, it is necessary to check the message header data of the current data message to check whether the message header data conforms to the header standard format specification, and if the message header data conforms to the header standard format specification, then mirror the current data message to obtain the mirrored data message. Otherwise, the current data message is discarded.

[0071] Reference Figure 4 , Figure 4 It is a structural principle diagram of the switch in the embodiment of the present application. Figure 4The switch is a programmable switch, which has an ingress pipeline, a traffic manager and an egress pipeline. The ingress pipeline includes: an ingress parser, an ingress control logic and an ingress deparser, and the egress pipeline includes: an egress parser, an egress control logic and an egress deparser. After the current data message enters the switch from the sending end network card, the ingress parser of the ingress pipeline first interprets the message header data of the current data message and converts the bit stream into meaningful fields and metadata. Next, the retransmission trigger module calls the ingress control logic to generate a pre-packet loss identifier corresponding to the current data message to determine whether to mirror the current data message. If mirroring is required, the retransmission identification signal construction module mirrors the current data message to obtain a mirrored data message. After the control logic processing is completed, the current data message or the mirrored data message will be transmitted to the ingress deparser, and the ingress deparser will re-encode it into a bit stream and transmit it to different traffic queues of the traffic manager. Then the traffic manager schedules the data message according to the priority. Finally, the egress parser re-reads the message header data of the current data message, and the retransmission identification signal construction module calls the control logic and the egress parser to generate a retransmission identification signal in the egress pipeline according to the message header data. The egress parser converts the current data message or the retransmission identification signal into a format that can be transmitted on the physical link, and finally sends it to the sending end network card or the receiving end network card.

[0072] In one embodiment, referring to Figure 5 , Figure 5 This is a flowchart of generating a retransmission identification signal according to message header data provided by an embodiment of the present application, specifically including steps 510 to 530:

[0073] Step 510: Obtain source address information, destination address information, destination queue pair sequence number and source queue pair sequence number from the message header data.

[0074] In one embodiment, the mirror data message corresponds to the message header data. The header standard format specification is used to constrain the message header data to include source address information, destination address information and destination queue pair sequence number. When the message header data meets the header standard format specification, the source address information, destination address information and destination queue pair sequence number are obtained from the message header data.

[0075] Among them, the source address information refers to the source of the current data message, that is, the address of the sending network card. The destination address information is the expected destination of the current data message, that is, the address of the receiving network card. In the RDMA transmission process, since the data is directly transferred from the buffer of the source device to the buffer of the target device without the need for data copying and processing by the CPU, in order to achieve this efficient data transmission method, a queue pair is required to coordinate the sending and receiving of data. Each queue pair includes two parts: a sending queue and a receiving queue. The sending queue is used to store data messages to be sent, and the receiving queue is used to store received data messages. When the sending network card sends data to the receiving network card, the data will be written to the sending queue of the receiving network card. When the receiving network card receives data from the sending network card, the data message will be read from the receiving queue of the sending network card. In the embodiment of the present application, the destination queue pair sequence number refers to the number of the queue pair of the receiving network card, which is used to identify the queue pair of the receiving network card so that the sending network card can correctly read data from the specified buffer.

[0076] Step 520: swap the source address information and the destination address information to obtain a new source address and a new destination address, obtain the source queue pair sequence number, and use the source queue pair sequence number to replace the destination queue pair sequence number to obtain a new destination queue pair sequence number.

[0077] In one embodiment, it is also necessary to obtain the source queue pair sequence number, which corresponds to the destination queue pair sequence number, which refers to the number of the queue pair of the sending end network card and cannot be directly obtained. The embodiment of the present application can be obtained in two ways. The first is to modify the logic of the sending end network card and expand the storage of the source queue pair sequence number in the message header data of the data message. The other is to store the source queue pair sequence number corresponding to the data flow where the data message is located in the switch in advance. This embodiment does not limit this.

[0078] Next, since the retransmission identification signal obtained according to the mirror data message needs to be returned to the sending end network card, the source address information and the destination address information are swapped to obtain a new source address and a new destination address, and the retransmission identification signal is sent to the new destination address based on the new source address. At the same time, the destination queue pair sequence number is replaced with the obtained source queue pair sequence number to obtain a new destination queue pair sequence number, which is used to identify the sending end network card as the receiver of the retransmission identification signal.

[0079] Step 530: Use the new source address, the new destination address and the new sequence number of the destination queue pair as update fields, connect the retransmission message header after the update fields, and obtain a retransmission identification signal.

[0080] In one embodiment, the retransmission message header includes first identification data and second identification data. Figure 6 , Figure 6It is a flowchart of connecting the retransmission message header after the update field to obtain the retransmission identification signal provided by an embodiment of the present application, specifically including steps 610 to 630:

[0081] Step 610: Generate first identification data.

[0082] Among them, the first identification data length can be 8 bits, which is used to indicate the data message corresponding to the message sequence number that the sending network card needs to retransmit. The message sequence number refers to the PSN (Packet Sequence Number) information obtained from the message header data. The PSN information is used to indicate the data packet sequence number corresponding to the current data message.

[0083] Step 620: Generate second identification data.

[0084] The second identification data may be 24 bits long, and is used to indicate the number of consecutive data packets that the sending network card retransmits starting from the packet sequence number. For example, to avoid missing data packets, three consecutive data packets starting from the current data packet may be retransmitted.

[0085] Step 630: Obtain a retransmission identification signal according to the update field, the first identification data and the second identification data.

[0086] In one embodiment, referring to Figure 7 , Figure 7 It is a schematic diagram of a retransmission identification signal provided in an embodiment of the present application. Figure 7 The data frame of the retransmission identification signal includes: Ethernet field, IP field, UDP field, transport layer field, retransmission message header, redundancy detection and frame check field in sequence. Among them, the Ethernet field includes the information required by the data link layer. The IP field is used to indicate the network information of the transmission, such as the network version, etc. The UDP field is used to provide message transmission services, including the source IP address, the destination IP address, etc. The transport layer field contains RDMA header related information, such as the queue number, etc. The retransmission message header includes the first identification data and the second identification data. The redundancy detection and frame check field is located at the end of the data frame, and is used to verify the integrity of the retransmission identification signal based on the checksum. Among them, the frame check field is calculated based on the Ethernet field, IP field, UDP field, transport layer field, and retransmission message header.

[0087] In one embodiment, the retransmission identification signal construction module parses the mirror data message, obtains the Ethernet field, IP field, UDP field and transport layer field from the mirror data message, and then replaces the original source address in the IP field with the new source address in the update field, replaces the original destination address in the IP field with the new destination address, replaces the original destination queue pair sequence number in the transport layer field with the new sequence number of the destination queue pair, etc. Next, the retransmission message header is obtained according to the first identification data and the second identification data, and is spliced ​​after the transport layer field. A cyclic redundancy check calculation is performed on the Ethernet field, the IP field, the UDP field, the transport layer field, and the retransmission message header to obtain a redundant detection and frame check field, and then a corresponding retransmission identification signal is generated according to the Ethernet field, the IP field, the UDP field, the transport layer field, the first identification data, the second identification data and the redundant detection and frame check field.

[0088] In one embodiment, after obtaining the retransmission identification signal, the retransmission identification signal is stored in the second traffic queue, and then the retransmission identification signal is obtained from the second traffic queue according to the priority, and the sending end network card is selected to transmit the retransmission identification signal based on the new destination address, the new source address and the destination queue. After receiving the retransmission identification signal, the sending end network card determines the data message that needs to be retransmitted and the number of consecutive data messages according to the first identification data and the second identification data carried therein.

[0089] Reference Figure 8 , Figure 8 It is a flow chart of the data transmission method provided in an embodiment of the present application.

[0090] After obtaining the current data message, calculate the pre-packet loss identifier of the current data message, and determine whether retransmission is required based on the pre-packet loss identifier. If not, directly forward the data message to the receiving network card. Otherwise, obtain a mirror data message, store the mirror data message in a high-priority second traffic queue, generate a retransmission identification signal based on the mirror data message, and forward it to the sending network card.

[0091] The data transmission method in the embodiment of the present application utilizes the mirroring and truncation functions provided by the programmable switch to copy the data message that needs to be retransmitted, truncate its load, perform structural improvements on the message header data, and generate a retransmission identification signal. And the mirrored data message is placed in the high-priority second traffic queue of the programmable switch for timely processing and forwarding, so that the retransmission identification signal corresponding to the mirrored data message is quickly generated, and it is transmitted to the sending end network card, so that the sending end network card can quickly retransmit the specified data message. The embodiment of the present application is processed on the switch, which can reduce the burden on the host side, reduce the hardware requirements and costs of the host side, and on the other hand, it can perform more efficient traffic management, reduce the bandwidth overhead on the network link, increase the adaptability to the network environment facing burst errors and high-frequency errors, and improve the performance and efficiency of RDMA data transmission.

[0092] The technical solution provided by the embodiment of the present application is to receive the current data message, compare the message size of the current data message with the remaining capacity of the first traffic queue, obtain the pre-packet loss identifier of the current data message according to the comparison result, determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier, and when the transmission direction is the first transmission direction, transmit the current data message to the receiving end network card via the first traffic queue, and when the transmission direction is the second transmission direction, generate a retransmission identification signal according to the current data message, and transmit the retransmission identification signal to the sending end network card, so that the sending end network card retransmits the current data message according to the retransmission identification signal. The embodiment of the present application performs a retransmission response on the switch between the sending end network card and the receiving end network card. The switch determines whether the message may be lost according to the message size of the current data message. For data messages with a risk of packet loss, a retransmission identification signal is generated to the sending end network card to retransmit the data message. For normal data messages, it is forwarded to the receiving end network card. The risk of packet loss can be quickly determined on the switch, without the need to wait until the receiving network card accumulates a large number of data packets before determining whether packet loss has occurred. This can quickly trigger a retransmission response and reduce RDMA transmission delays.

[0093] The present application also provides a data transmission device that can implement the above data transmission method. Fig. 9 , the device comprises:

[0094] Initial processing module 910: used to receive the current data message, compare the message size of the current data message with the remaining capacity of the first traffic queue, and obtain the pre-loss packet identifier of the current data message according to the comparison result. The first traffic queue is used to cache the received message received before the current data message. The data message is sent by the sending end network card;

[0095] The transmission direction determination module 920 is used to determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier, and the transmission direction includes: a first transmission direction and a second transmission direction;

[0096] Transmission module 930: used to transmit the current data message to the receiving end network card via the first traffic queue when the transmission direction is the first transmission direction, and to generate a retransmission identification signal according to the current data message when the transmission direction is the second transmission direction, and transmit the retransmission identification signal to the sending end network card, so that the sending end network card resends the current data message according to the retransmission identification signal.

[0097] The specific implementation of the data transmission device of this embodiment is basically the same as the specific implementation of the above-mentioned data transmission method, and will not be repeated here.

[0098] The present application also provides an electronic device, including:

[0099] at least one memory;

[0100] at least one processor;

[0101] at least one program;

[0102] The program is stored in the memory, and the processor executes the at least one program to implement the data transmission method implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.

[0103] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0104] The processor 1001 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0105] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the data transmission method of the embodiments of this application;

[0106] Input / output interface 1003, used to implement information input and output;

[0107] Communication interface 1004, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and

[0108] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0109] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0110] An embodiment of the present application further provides a storage medium, which is a storage medium storing a computer program, and the computer program implements the above-mentioned data transmission method when executed by a processor.

[0111] As a non-transitory storage medium, the memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0112] The data transmission method, device, equipment and storage medium proposed in the embodiment of the present application receive the current data message, compare the message size of the current data message with the remaining capacity of the first traffic queue, obtain the pre-packet loss identifier of the current data message according to the comparison result, determine the transmission direction corresponding to the current data message according to the pre-packet loss identifier, and when the transmission direction is the first transmission direction, transmit the current data message to the receiving end network card via the first traffic queue, and when the transmission direction is the second transmission direction, generate a retransmission identification signal according to the current data message, and transmit the retransmission identification signal to the sending end network card, so that the sending end network card retransmits the current data message according to the retransmission identification signal. The embodiment of the present application performs a retransmission response on the switch between the sending end network card and the receiving end network card. The switch determines whether the message is likely to be lost according to the message size of the current data message. For data messages with a risk of packet loss, a retransmission identification signal is generated to the sending end network card to retransmit the data message. For normal data messages, it is forwarded to the receiving end network card. The risk of packet loss can be quickly determined on the switch, without the need to wait until the receiving network card accumulates a large number of data packets before determining whether packet loss has occurred. This can quickly trigger a retransmission response and reduce RDMA transmission delays.

[0113] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0114] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0115] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0117] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0118] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0119] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store programs.

[0123] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data transmission method, characterized in that: Applied to a switch, the switch being located between a sending-end network card and a receiving-end network card, the method includes: receiving a current data message, comparing a message size of the current data message with a remaining capacity of a first traffic queue, and obtaining a pre-loss packet identifier of the current data message based on the comparison result, wherein the first traffic queue is used to cache received messages received before the current data message, and the data message is sent by the sending end network card; Determine, according to the pre-packet loss identifier, a transmission direction corresponding to the current data message, the transmission direction including: a first transmission direction and a second transmission direction; When the transmission direction is the first transmission direction, the current data packet is transmitted to the receiving network card via the first traffic queue; when the transmission direction is the second transmission direction, a retransmission identification signal is generated according to the current data packet, and the retransmission identification signal is transmitted to the sending network card, so that the sending network card resends the current data packet according to the retransmission identification signal.

2. The data transmission method according to claim 1, wherein: When the transmission direction is the second transmission direction, generating a retransmission identification signal according to the current data message includes: When the transmission direction is the second transmission direction, mirroring the current data message to obtain a mirrored data message; Acquire message header data corresponding to the mirror data message, and when the message header data conforms to a header standard format specification, generate the retransmission identification signal according to the message header data.

3. The data transmission method according to claim 2, wherein: When the message header data conforms to a header standard format specification, generating the retransmission identification signal according to the message header data includes: Obtaining source address information, destination address information and destination queue pair sequence number from the message header data; Swapping the source address information and the destination address information to obtain a new source address and a new destination address, obtaining a source queue pair sequence number, and replacing the destination queue pair sequence number with the source queue pair sequence number to obtain a new destination queue pair sequence number; The new source address, the new destination address and the new sequence number of the destination queue pair are used as update fields, and a retransmission message header is connected after the update fields to obtain the retransmission identification signal.

4. The data transmission method according to claim 3, wherein: The retransmission message header includes first identification data and second identification data, and the step of connecting the retransmission message header after the update field to obtain the retransmission identification signal includes: Generate first identification data, where the first identification data is used to indicate a data message corresponding to a message sequence number retransmitted by the sending end network card; generating second identification data, where the second identification data is used to indicate the number of data packets that the sending end network card retransmits starting from the packet sequence number; The retransmission identification signal is obtained according to the update field, the first identification data and the second identification data.

5. The data transmission method according to claim 4, characterized in that: The obtaining the retransmission identification signal according to the update field, the first identification data, and the second identification data includes: Obtaining an Ethernet field, an IP field, a UDP field, and a transport layer field from the mirror data message; Replace the original source address in the IP field with the new source address in the update field, replace the original destination address in the IP field with the new destination address, and replace the original destination queue pair sequence number in the transport layer field with the new destination queue pair sequence number; splicing the first identification data and the second identification data after the transport layer field; Performing a cyclic redundancy check calculation on the Ethernet field, the IP field, the UDP field, the transport layer field, the first identification data, and the second identification data to obtain a redundancy check and frame check field; A corresponding retransmission identification signal is generated according to the Ethernet field, the IP field, the UDP field, the transport layer field, the first identification data, the second identification data and the redundancy detection and frame check field.

6. The data transmission method according to claim 3, wherein: The transmitting the retransmission identification signal to the sending end network card includes: storing the retransmission identification signal in a second traffic queue, wherein the priority of data in the second traffic queue is higher than the priority of data in the first traffic queue; The retransmission identification signal is obtained from the second traffic queue, and based on the new destination address, the new source address and the destination queue, the sending end network card is selected to transmit the retransmission identification signal.

7. The data transmission method according to claim 1, wherein: The obtaining, according to the comparison result, a pre-packet loss identifier of the current data message includes: If the message size is less than or equal to the remaining capacity, the pre-packet loss identifier is a first identifier, and the first identifier is used to indicate that the current data message does not need to be retransmitted; If the message size is greater than the remaining capacity, the pre-packet loss identifier is a second identifier, and the second identifier is used to indicate that the current data message needs to be retransmitted.

8. The data transmission method according to claim 7, characterized in that: The determining, according to the pre-packet loss identifier, a transmission direction corresponding to the current data message includes: If the pre-packet loss identifier is the first identifier, the transmission direction is the first transmission direction; if the pre-packet loss identifier is the second identifier, the transmission direction is the second transmission direction.

9. A data transmission device, characterized in that: Applied to a switch, the switch is located between a sending end network card and a receiving end network card, the device includes: An initial processing module is configured to receive a current data message, compare the message size of the current data message with the remaining capacity of a first traffic queue, and obtain a pre-loss packet identifier of the current data message based on the comparison result, wherein the first traffic queue is configured to cache received messages received before the current data message, and the data message is sent by the sending end network card; A transmission direction determining module is configured to determine a transmission direction corresponding to the current data message according to the pre-packet loss identifier, wherein the transmission direction includes a first transmission direction and a second transmission direction; Transmission module: used to transmit the current data message to the receiving-end network card via the first traffic queue when the transmission direction is the first transmission direction; and to generate a retransmission identification signal according to the current data message when the transmission direction is the second transmission direction, and transmit the retransmission identification signal to the sending-end network card, so that the sending-end network card resends the current data message according to the retransmission identification signal.

10. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the data transmission method according to any one of claims 1 to 8 when executing the computer program.

11. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Selective retransmission function test method, device and system for remote direct memory access, medium and product

    CN121441800A

  • Selective repeat function test method, device, system, medium and product for remote direct memory access

    CN121441800B