Communication method and system, computer equipment, computer readable storage medium and computer program product

By setting and decomposing the communication status in the RDMA network in response to RNR NAK messages and retransmission instructions messages, the communication inefficiency caused by timer timeout is solved, and a more efficient retransmission process is achieved.

CN119520422AActive Publication Date: 2025-02-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411728312.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-25
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In the RDMA network, the sender needs to start the timer after receiving the RNR NAK message and retransmit it after the timeout, resulting in low communication efficiency.

Method used

When the first message returned by the second end is received, the communication state with the second end is set to the first state, and when the second message sent by the second end is received, the first state is cancelled and the retransmission is performed, so as to avoid waiting for the timer to timeout.

Benefits of technology

It realizes retransmission immediately without waiting for the timer to timeout, improves communication efficiency, and avoids retransmission failure and waste of communication resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520422A_ABST
    Figure CN119520422A_ABST
Patent Text Reader

Abstract

The invention relates to a communication method and system, computer equipment, a computer readable storage medium and a computer program product, and relates to the technical field of communication. The method is applied to a first end and comprises the steps of transmitting a communication message to a second end; the second end is used for returning a first message corresponding to the communication message to the first end under the condition that the working queue element corresponding to the communication message does not exist in the receiving queue; under the condition that a first message returned by the second end is received, setting a communication state with the second end as a first state; the first state is used for indicating the first end to suspend transmission of the communication message to the second end; and when a second message corresponding to the communication message sent by the second end is received, releasing the first state of the first end, and retransmitting the communication message to the second end, the second message is used for indicating the first end to perform retransmission, and the second message is obtained according to the reserved field in the expanded transmission message header of the confirmation message. By adopting the method, the communication efficiency can be improved.
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 communication method, system, computer device, computer-readable storage medium and computer program product. Background Art

[0002] In an RDMA (Remote Direct Memory Access) network, communication between the sender and the receiver is achieved through a sender-receiver queue pair (QP). During the communication process, when there is no work queue element (WQE) in the receive queue (RQ) of the receiver, the receiver will reply with an RNR (Recv Not Ready) NAK (Negative Acknowledgment) message to the sender. In response to the RNR NAK message, the sender will start the RNR timer and retransmit after the RNR timer times out.

[0003] Because in the related art, the sending end needs to retransmit after the RNR timer times out, which results in low communication efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a communication method, system, computer device, computer-readable storage medium and computer program product that can improve communication efficiency in order to address the above-mentioned technical problem of low communication efficiency.

[0005] In a first aspect, the present application provides a communication method, applied to a first end, comprising:

[0006] transmitting a communication message to a second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end;

[0007] When receiving a first message returned by the second end, setting the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end;

[0008] When a second message corresponding to the communication message is received from the second end, the first state of the first end is released and the communication message is retransmitted to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received.

[0009] In one of the embodiments, after setting the communication state with the second end to the first state, the method further includes:

[0010] Starting a timer corresponding to the first state;

[0011] When the time corresponding to the timer is reached and the second message is not received, the communication message is retransmitted to the second end.

[0012] In one embodiment, upon receiving a second message corresponding to the communication message sent by the second end, releasing the first state of the first end includes:

[0013] When the time corresponding to the timer has not arrived and the second message is received, the first state of the timer and the first end is released, and the communication message is retransmitted to the second end.

[0014] In a second aspect, the present application further provides a communication method, applied to a second end, comprising:

[0015] In a case where there is no work queue element corresponding to a communication message transmitted by the first end to the second end in a receiving queue of a transceiver queue pair between a first end and the second end, returning a first message corresponding to the communication message to the first end, so that the first end sets the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end;

[0016] Based on the reserved field in the extended transmission message header of the confirmation message, a second message corresponding to the communication message is obtained; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit;

[0017] The second message is sent to the first end, so that the first end releases the first state of the first end and retransmits the communication message to the second end.

[0018] In one of the embodiments, before returning the first message corresponding to the communication message to the first end, the method further includes:

[0019] Setting the communication state with the first end to a second state; the second state is used to indicate that the second end is not ready to receive the first end;

[0020] The sending the second message to the first end also includes:

[0021] When the communication state with the first end is the second state, the second state of the second end is released, and the second message is sent to the first end.

[0022] In one embodiment, after sending the second message to the first end so that the first end releases the first state of the first end and retransmitting the communication message to the second end, the method further includes:

[0023] receiving the communication message retransmitted by the first end;

[0024] The confirmation message corresponding to the communication message is returned to the first end.

[0025] In a third aspect, the present application further provides a communication system, the system comprising a first end and a second end;

[0026] The first end is used to transmit communication messages to the second end;

[0027] The second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message sent by the first end in the receiving queue of the transceiver queue pair between the first end and the second end;

[0028] The first end is further configured to set the communication state between the first end and the second end to a first state when the first message is received; the first state is configured to instruct the first end to suspend transmission of the communication message to the second end;

[0029] The second end is further used to obtain a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message, and send the second message to the first end; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit;

[0030] The first end is further configured to release the first state of the first end and retransmit the communication message to the second end when the second message is received.

[0031] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] transmitting a communication message to a second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end;

[0033] When receiving a first message returned by the second end, setting the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end;

[0034] When a second message corresponding to the communication message is received from the second end, the first state of the first end is released and the communication message is retransmitted to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received.

[0035] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0036] transmitting a communication message to a second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end;

[0037] When receiving a first message returned by the second end, setting the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end;

[0038] When a second message corresponding to the communication message is received from the second end, the first state of the first end is released and the communication message is retransmitted to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received.

[0039] In a sixth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0040] transmitting a communication message to a second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end;

[0041] When receiving a first message returned by the second end, setting the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end;

[0042] When a second message corresponding to the communication message is received from the second end, the first state of the first end is released and the communication message is retransmitted to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received.

[0043] The above-mentioned communication method, system, computer device, computer-readable storage medium and computer program product, first, the first end transmits a communication message to the second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no working queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end; then, when the first end receives the first message returned by the second end, the first end sets the communication state between the first end and the second end to the first state; the first state is used to instruct the first end to suspend the transmission of the communication message to the second end; then, when the first end receives the second message corresponding to the communication message sent by the second end, the first end releases the first state of the first end and retransmits the communication message to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received. Based on the communication method of the above process, the first end sets the communication state between the first end and the second end to the first state when receiving the first message returned by the second end, and releases the first state and retransmits when receiving the second message sent by the second end to indicate retransmission. Retransmission can be performed immediately without waiting for the timer to time out, thereby improving communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0045] FIG1 is an application environment diagram of a communication method in one embodiment;

[0046] FIG2 is a schematic diagram of a flow chart of a communication method applied to a first end in one embodiment;

[0047] FIG3 is a flow chart of a communication method applied to a first end in another embodiment;

[0048] FIG4 is a schematic diagram of a flow chart of a communication method applied to a second end in one embodiment;

[0049] FIG5 is a flow chart of a communication method applied to a second end in another embodiment;

[0050] FIG6 is a schematic flow chart of a communication method in one embodiment;

[0051] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] 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.

[0053] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0054] The communication method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. The application environment is a communication system, which includes a first end and a second end, wherein the first end is a transmitting end in the communication process, and the second end is a receiving end in the communication process.

[0055] Specifically, the first end and the second end are both servers or terminals, and can also be systems including servers and terminals, and are implemented through the interaction between servers and terminals. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services; the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.

[0056] Specifically, referring to Figure 1, both the first end and the second end include a service side, a driver side, and a network card. The service side and the driver side are located in the CPU (Central Processing Unit), the service side refers to the part running in the user space, and the driver side refers to the part running in the kernel space; the network card refers to an RDMA network card.

[0057] Specifically, referring to Figure 1, the first end transmits a communication message to the second end; the second end, when there is no working queue element corresponding to the communication message sent by the first end in the receiving queue of the transceiver queue pair between the first end and the second end, returns a first message corresponding to the communication message to the first end; the first end, when receiving the first message, sets the communication state between the first end and the second end to the first state; the first state is used to instruct the first end to suspend transmitting the communication message to the second end; the second end, based on the reserved field in the extended transmission message header of the confirmation message, obtains the second message corresponding to the communication message, and sends the second message to the first end; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit; the first end, when receiving the second message, releases the first state of the first end and retransmits the communication message to the second end.

[0058] In an exemplary embodiment, as shown in FIG. 2 , a communication method is provided, which is described by taking the method applied to the first end in the communication system shown in FIG. 1 as an example, and includes the following steps:

[0059] Step S202: transmitting a communication message to the second end.

[0060] The first end is the sending end in the communication process; the second end is the receiving end in the communication process. In the RDMA network, the communication between the sending and receiving parties is realized through the sending and receiving queue pair QP; specifically, QP includes the sending queue (SQ, Send Queue) of the sending end and the receiving queue RQ of the receiving end.

[0061] The second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end.

[0062] In a specific application, the first message is an RNR NAK message.

[0063] Specifically, referring to Figure 1, during the communication process, the first end transmits a communication message to the second end based on the QP between the first end and the second end, and sends a transmission request SEND to the second end; the second end receives SEND, and prepares to obtain the WQE corresponding to the communication message from RQ; if the second end finds that the WQE corresponding to the communication message does not exist in RQ, it returns a first message RNR NAK message corresponding to the notification message to the first end to notify the first end that the WQE does not exist.

[0064] In a specific application, referring to FIG. 1 , in the process of transmitting a communication message from the first end to the second end, the service side of the first end sends a work request (WR) of the communication message to the driver side of the first end, and the driver side of the first end converts the WR into a corresponding WQE and fills it into the SQ, and sends a doorbell (in the communication field, doorbell refers to a mechanism or signal that reminds or notifies the receiver that there is data or event to be processed) to the RDMA network card of the first end through the notification module doorbell in the RDMA network card of the first end, so as to notify the RDMA network card of the first end to send the packet.

[0065] Next, the RDMA network card at the first end obtains the WQE from the SQ, parses the WQE, assembles the communication message and writes it into the RQ, and then sends a SEND to the RDMA network card at the second end.

[0066] The RDMA network card at the second end receives SEND and prepares to obtain the corresponding WQE from RQ. When the second end detects that the PI (Producer Index) and CI (Customer Index) of RQ are equal, it means that there is no WQE corresponding to the communication message in RQ, and then returns the first message RNR NAK message corresponding to the notification message to the RDMA network card at the first end.

[0067] Step S204: When receiving the first message returned by the second end, the communication state with the second end is set to the first state.

[0068] The first state is used to instruct the first end to suspend transmission of communication messages to the second end. In a specific application, the first state is the RNR state.

[0069] Specifically, referring to FIG. 1 , the first end receives a first message RNR NAK message returned by the second end, and sets the communication state of the communication resources with the second end to a first state RNR state to suspend retransmission of communication messages to the second end.

[0070] In a specific application, referring to FIG. 1 , the RDMA network card at the first end receives the first message RNR NAK message returned by the second end, and sets the communication resources with the second end to the first state RNR state.

[0071] Step S206: upon receiving a second message corresponding to the communication message sent by the second end, releasing the first state of the first end and retransmitting the communication message to the second end.

[0072] The second message is used to indicate that the second end is ready to receive the communication message, and further used to instruct the first end to retransmit.

[0073] The second message is obtained according to the reserved field in the extended transmission message header of the confirmation message. In a specific application, the second message is an RTR (Ready To Recv) message.

[0074] Among them, the confirmation message is used to indicate that the receiving party in the communication process has successfully received the communication message sent by the sender. In this application, the confirmation message is the message returned to the first end by the second end when the communication message is successfully received. In specific applications, the confirmation message is an ACK (Acknowledgment) message; the extended transport message header of the confirmation message is AETH (ACK Extended Transport Header); in the field of communications, a field that is not currently used in a data protocol, data structure or message format but is reserved for future expansion or functions is called a reserved field.

[0075] Specifically, referring to Figure 1, after returning the first message RNR NAK message, the second end will further send a second message RTR message corresponding to the communication message to the first end; then, the first end responds to the second message RTR message, releases its own first state RNR state, and retransmits the communication message to the second end.

[0076] In a specific application, referring to FIG1 , after the second end returns the first message RNR NAK message, the service side of the second end sends a WR of the second message RTR message corresponding to the communication message to the driver side of the second end, and the driver side of the second end converts the WR into the corresponding WQE and fills it into the RQ, and sends the doorbell to the RDMA network card of the second end through the notification module doorbell in the RDMA network card of the second end to notify the RDMA network card of the second end that it can receive the packet.

[0077] Then, the RDMA network card at the second end sends a second message RTR message to the first end; the RDMA network card at the first end responds to the second message RTR message, releases the first state RNR state of the first end, and immediately retransmits the communication message to the second end after releasing.

[0078] In the communication process of the related technology, when there is no WQE in the RQ, the receiving end will reply RNR NAK to the sending end; the sending end will start the RNR timer in response to the RNR NAK message, and retransmit after the RNR timer times out, resulting in low communication efficiency. In the above communication method, first, the first end transmits a communication message to the second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end; then, when the first end receives the first message returned by the second end, the communication state between the first end and the second end is set to the first state; the first state is used to indicate that the first end suspends the transmission of the communication message to the second end; then, when the first end receives the second message corresponding to the communication message sent by the second end, the first end releases the first state of the first end and retransmits the communication message to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received. Based on the communication method of the above process, the first end sets the communication state between the first end and the second end to the first state when receiving the first message returned by the second end, and releases the first state and retransmits when receiving the second message sent by the second end to indicate retransmission. Retransmission can be performed immediately without waiting for the timer to time out, thereby improving communication efficiency.

[0079] In addition, it should be noted that in the related art, the first end cannot ensure whether the second end is ready to receive the communication message when retransmitting. Therefore, when the first end retransmits after the timer times out, the retransmission may fail because the second end cannot receive the communication message, thereby wasting communication resources. In the above communication method, the first end retransmits when the second end sends the second message RTR message, and the RTR message indicates that the second end is ready to receive the communication message. Therefore, the above process also avoids the failure of retransmission again or even multiple failures, thereby ensuring the success of retransmission and avoiding the waste of communication resources.

[0080] In an exemplary embodiment, in the above step S204, after the communication state with the second end is set to the first state, the following contents are specifically included: starting a timer corresponding to the first state; when the time corresponding to the timer is reached and the second message is not received, retransmitting the communication message to the second end.

[0081] Specifically, referring to Figure 1, after the RDMA network card at the first end sets the communication state with the second end to the first state RNR state, it will also start the RNR timer corresponding to the first state RNR state; when the RNR timer times out, if the RDMA network card at the first end has not received the second message RTR message sent by the second end, it will retransmit the communication message to the second end.

[0082] In this embodiment, when the timer times out and the first end has not received the second message, the first end directly retransmits the communication message to the second end again.

[0083] In an exemplary embodiment, the above step S206, when a second message corresponding to the communication message sent by the second end is received, the first state of the first end is released, which specifically includes the following contents: when the time corresponding to the timer has not been reached and the second message is received, the timer and the first state of the first end are released, and the communication message is retransmitted to the second end.

[0084] Specifically, referring to Figure 1, after the RNR timer is started, if the RDMA network card at the first end receives the second message RTR message before the RNR timer expires, the RDMA network card at the first end responds to the second message RTR message, releases the first state RNR state of the first end, and immediately retransmits the communication message to the second end.

[0085] In this embodiment, the first end releases the first state and immediately retransmits the message upon receiving the second message, so that the retransmission can be performed without waiting for the timer to time out, thereby improving communication efficiency.

[0086] In an exemplary embodiment, as shown in FIG3 , the communication method provided by the present application and applied to the first end further includes the following steps:

[0087] Step S302: Transmit the communication message to the second end.

[0088] Step S304: when receiving the first message returned by the second end, setting the communication state with the second end to the first state, and starting a timer corresponding to the first state.

[0089] Step S306, when the time corresponding to the timer has not arrived and a second message corresponding to the communication message sent by the second end is received, the first state of the timer and the first end is released, and the communication message is retransmitted to the second end.

[0090] Step S308: When the time corresponding to the timer is reached and the second message corresponding to the communication message sent by the second end is not received, retransmit the communication message to the second end.

[0091] Based on the same inventive concept, an embodiment of the present application further provides a communication method applied to a second end in the communication system as shown in FIG1. ​​The implementation scheme for solving the problem provided by the method is similar to the implementation scheme recorded in the communication method applied to the first end, so the specific limitations in one or more embodiments of the communication method applied to the second end provided below can refer to the limitations of the communication method applied to the first end above, and will not be repeated here.

[0092] In an exemplary embodiment, as shown in FIG. 4 , a communication method is provided, which is described by taking the method applied to the second end in the communication system shown in FIG. 1 as an example, and includes the following steps:

[0093] Step S402, when there is no working queue element corresponding to the communication message transmitted from the first end to the second end in the receiving queue of the transceiver queue pair between the first end and the second end, a first message corresponding to the communication message is returned to the first end, so that the first end sets the communication state with the second end to the first state.

[0094] In a specific application, the first message is an RNR NAK message.

[0095] The first state is used to instruct the first end to suspend transmission of communication messages to the second end; in a specific application, the first state is the RNR state.

[0096] Specifically, referring to Figure 1, during the communication process, the first end transmits a communication message to the second end based on the QP between the first end and the second end, and sends a transmission request SEND to the second end; the second end receives SEND, and prepares to obtain the WQE corresponding to the communication message from the RQ; if the second end finds that the WQE corresponding to the communication message does not exist in the RQ, it returns an RNR NAK message to the first end to notify the first end that the WQE does not exist; in response to the first message RNR NAK message, the first end sets the communication state of the communication resources between the first end and the second end to the first state RNR state to suspend retransmission of the communication message to the second end.

[0097] Step S404: obtaining a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message.

[0098] Among them, the confirmation message is used to indicate that the receiving party in the communication process has successfully received the communication message sent by the sender. In this application, the confirmation message is a message returned to the first end by the second end when the communication message is successfully received. In a specific application, the confirmation message is an ACK message; the extended transmission message header of the confirmation message is AETH; in the field of communication, a field that is not currently used in a data protocol, data structure or message format but is reserved for future expansion or function is called a reserved field.

[0099] The second message is used to indicate that the second end is ready to receive the communication message, and further used to instruct the first end to retransmit. In a specific application, the second message is an RTR message.

[0100] Specifically, referring to FIG. 1 , after returning the first message RNR NAK message, the second end fills the reserved field in the extended transmission message header AETH in the confirmation message ACK message to obtain the second message RTR message corresponding to the communication message.

[0101] In a specific application, referring to FIG1, after the second end returns the first message RNR NAK message, the service side of the second end sends a WR of the second message RTR message corresponding to the communication message to the driver side of the second end, and the driver side of the second end converts the WR into the corresponding WQE and fills it into RQ, and sends a doorbell to the RDMA network card of the second end through the notification module doorbell in the RDMA network card of the second end, so as to notify the RDMA network card of the second end that the packet can be received. Then, the RDMA network card of the second end sends the second message RTR message to the first end.

[0102] In practical applications, the format of AETH is shown in Table 1:

[0103] Table 1 AETH format

[0104]

[0105] The Syndrome field indicates the corresponding message type, for example, an ACK message or a NAK message.

[0106] The MSN (Message Sequence Number) field indicates the sequence number of the corresponding message.

[0107] Furthermore, the format of the Syndrome field is shown in Table 2:

[0108] Table 2 Syndrome field format

[0109]

[0110] Among them, reserved is the reserved field.

[0111] Table 3 shows the format of the second message RTR message. The second end fills the reserved field with 01000000 to obtain the second message RTR message:

[0112] Table 3 Format of the second message RTR message

[0113]

[0114] S406: Send a second message to the first end, so that the first end releases the first state of the first end and retransmits the communication message to the second end.

[0115] Specifically, referring to FIG. 1 , the second end sends a second message RTR message corresponding to the communication message to the first end; the first end releases its first state RNR state in response to the second message RTR message, and retransmits the communication message to the second end.

[0116] In a specific application, referring to FIG. 1 , the RDMA network card at the first end releases the first state RNR state of the first end in response to the second message RTR message, and immediately retransmits the communication message to the second end after the release.

[0117] In this embodiment, the second end can promptly inform the first end of the information that it is ready to receive through the second message, and then promptly instruct the first end to retransmit, so that the first end can immediately retransmit the communication message without waiting for the timer to expire before retransmitting, thereby improving communication efficiency.

[0118] In addition, it can also avoid the failure of retransmission again or even multiple failures, thereby ensuring the success of retransmission and avoiding the waste of communication resources.

[0119] In an exemplary embodiment, in the above step S402, before returning the first message corresponding to the communication message to the first end, the following contents are specifically included: setting the communication state with the first end to the second state.

[0120] The second state is used to indicate that the second end is not ready to receive the first end.

[0121] Specifically, referring to Figure 1, before returning the first message RNR NAK message, the second end also needs to set the communication state of the communication resources between the first end to the second state RNR state to indicate that the second end is not ready to receive the first end, so as to avoid the first end transmitting the communication message again.

[0122] In a specific application, referring to FIG. 1 , when there is no WQE in the RQ, the RDMA network card at the second end sets the communication resources with the first end to the second state RNR state, and returns a first message RNR NAK message to the RDMA network card at the first end.

[0123] In this embodiment, the above step S406, sending the second message to the first end, specifically also includes the following content: when the communication state between the second end and the first end is the second state, releasing the second state of the second end and sending the second message to the first end.

[0124] In a specific application, the second state is the RNR state.

[0125] Specifically, referring to Figure 1, before sending the second message RTR message, the second end must first detect whether the communication status between the first end and the first end is the second state RNR state. If it is the second state RNR state, the second state RNR state of the second end is the basis, and the second message RTR message is sent to the first end.

[0126] In a specific application, referring to FIG. 1 , the RDMA network card at the second end detects whether the communication resource between the second end and the first end is in the second state RNR state. If so, the second state RNR state of the second end is released, and a second message RTR message is sent to the RDMA network card at the first end.

[0127] In this embodiment, the second end can avoid the first end from transmitting the communication message again and smoothly receive the communication message transmitted again by the first end by setting the second state and releasing the second state.

[0128] In an exemplary embodiment, in the above step S406, a second message is sent to the first end to release the first end from the first state of the first end, and after the communication message is retransmitted to the second end, the following contents are specifically included: receiving the communication message retransmitted by the first end; and returning a confirmation message corresponding to the communication message to the first end.

[0129] Specifically, after the first end retransmits the communication message to the second end, the second end successfully receives the communication message and returns an acknowledgment message ACK message corresponding to the communication message to the first end to notify the first end that it has successfully received the communication message, thereby completing the communication regarding the communication message between the first end and the second end.

[0130] In a specific application, referring to FIG1 , when the RDMA network card at the first end retransmits the communication message to the second end, it will also send a transmission request SEND to the second end again; the RDMA network card at the second end receives SEND, obtains the WQE corresponding to the communication message from RQ to complete the reception, and returns a confirmation message ACK message to the RDMA network card at the first end.

[0131] In this embodiment, the second end can notify the first end that it has successfully received the communication message by returning a confirmation message when successfully receiving the communication message retransmitted by the first end, thereby completing the communication regarding the communication message between the first end and the second end.

[0132] In an exemplary embodiment, as shown in FIG5 , the communication method provided by the present application and applied to the second end further includes the following steps:

[0133] Step S502, when there is no working queue element corresponding to the communication message transmitted from the first end to the second end in the receiving queue of the transceiver queue pair between the first end and the second end, the communication state with the first end is set to the second state, and the first message corresponding to the communication message is returned to the first end.

[0134] Step S504: obtaining a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message.

[0135] Step S506: when the communication state with the first end is the second state, release the second state of the second end and send a second message to the first end.

[0136] Step S508: receiving the communication message retransmitted by the first end, and returning a confirmation message corresponding to the communication message to the first end.

[0137] In an exemplary embodiment, as shown in FIG6 , another communication method is provided, which is described by taking the method applied to the communication system shown in FIG1 as an example, and includes the following steps:

[0138] Step S602: the first end transmits a communication message to the second end.

[0139] Step S604: When there is no working queue element corresponding to the communication message transmitted from the first end to the second end in the receiving queue of the transceiver queue pair between the first end and the second end, the second end sets the communication state with the first end to the second state and returns the first message corresponding to the communication message to the first end.

[0140] Step S606: When the first end receives the first message returned by the second end, the first end sets the communication state with the second end to the first state, and starts a timer corresponding to the first state.

[0141] Step S608: The second end obtains a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message.

[0142] Step S610: When the communication state between the second end and the first end is the second state, the second end releases the second state and sends a second message to the first end.

[0143] Step S612: When the time corresponding to the timer has not arrived and the first end receives a second message corresponding to the communication message sent by the second end, the first end releases the first state of the timer and the first end, and retransmits the communication message to the second end.

[0144] Step S614: the second end receives the communication message retransmitted by the first end, and returns a confirmation message corresponding to the communication message to the first end.

[0145] In this embodiment, the second end promptly informs the first end of the information that it is ready to receive through the second message. Firstly, it can promptly instruct the first end to retransmit, so that the first end immediately retransmits the communication message without waiting for the timer to time out before retransmitting, thereby improving communication efficiency; secondly, it can avoid the failure of retransmission again or even multiple failures, thereby ensuring the success of retransmission and avoiding the waste of communication resources.

[0146] In order to more clearly illustrate the communication method provided by the embodiment of the present application, the communication method is specifically described below with a specific embodiment, but it should be understood that the embodiment of the present application is not limited to this. In one of the exemplary embodiments, the present application also provides a method for accelerating RDMA data transmission in the RNR state, which specifically includes the following contents:

[0147] The method is applied to a communication system as shown in FIG1 , which includes a first end as a transmitting end and a second end as a receiving end; the first end and the second end both include a service side, a driver side and an RDMA network card.

[0148] Among them, the RDMA network card at the second end supports sending RNR NAK messages and sets the communication resources to the RNR state.

[0149] The RDMA network card at the first end supports processing the RNR NAK message, starts the RNR timeout timer, and sets the communication resource to the RNR state.

[0150] Among them, the driver side of the second end supports sending doorbell during post recv (the operation in which the receiving end "issues" a receive request before receiving data, indicating that it is ready to receive data and allocates a buffer for the upcoming data) to notify the RDMA network card of the second end that the RQ is filled with WQE.

[0151] Among them, the RDMA network card at the second end also supports receiving and processing the doorbell sent by the driver side during post recv.

[0152] Among them, the RDMA network card at the second end also supports the expansion of the RDMA AETH header to generate RTR messages.

[0153] Among them, the RDMA network card at the second end also supports detecting whether the communication resource belongs to the RNR state when processing the doorbell. If it is not in the RNR state, the processing is terminated; if it is in the RNR state, an RTR message is sent to the first end to inform the first end that retransmission can be performed.

[0154] The RDMA network card at the first end also supports canceling the RNR state and the RNR timeout timer upon receiving the RTR message, and immediately retransmitting.

[0155] Referring to Figure 1, this method specifically includes the following steps:

[0156] 1. The first end and the second end complete initialization.

[0157] 2. The business side of the first end sends WR to the driver side of the first end through post send (the sender "publishes" a send request before sending data, indicating that the sender has filled in the send data and specified the data content and target operation).

[0158] 3. The driver side of the first end converts the WR into the corresponding WQE and fills it into the SQ, and sends the doorbell to the RDMA network card of the first end through the notification module doorbell in the RDMA network card of the first end to notify the RDMA network card of the first end to send the packet.

[0159] 4. The RDMA network card at the first end obtains WQE from SQ, parses WQE, assembles the communication message and writes it into RQ, and then sends SEND to the RDMA network card at the second end.

[0160] 5. The RDMA network card at the second end receives SEND.

[0161] 6. The second end prepares to obtain the corresponding WQE from the RQ and finds that the PI and CI of the RQ are equal, indicating that there is no WQE in the RQ.

[0162] 7. The second end replies with an RNR NAK message and sets the communication resources to the RNR state.

[0163] 8. The RDMA network card at the first end receives the RNR NAK message, starts the RNR timeout timer, and sets the communication resource to the RNR state.

[0164] 9. The service side of the second end sends WR to the driver side of the second end through post recv.

[0165] 10. The driver side at the second end converts the WR into the corresponding WQE and fills it into the RQ, and sends the doorbell to the RDMA network card at the second end through the notification module doorbell in the RDMA network card at the second end to notify the RDMA network card at the second end that it can receive the packet.

[0166] 11. The RDMA network card at the second end releases the RNR state and sends an RTR message.

[0167] 12. The RDMA network card at the first end receives the RTR message, releases the RNR state and RNR timeout timer, and retransmits immediately.

[0168] 13. The second end receives the retransmitted SEND, processes the message, and replies with an ACK message.

[0169] 14. The first end and the second end complete message transmission.

[0170] In this embodiment, firstly, by extending the AETH header of RDMA to support RTR messages, RTR messages are sent in the RNR state to inform the first end that the packet can be sent immediately without waiting for the timeout timer to expire or frequently triggering retransmission. Secondly, by not having to wait for the timeout timer to expire, the transmission rate of RDMA in the RNR state is accelerated, thereby improving data transmission performance.

[0171] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0172] Based on the same inventive concept, the embodiment of the present application also provides a communication system for implementing the above-mentioned communication methods. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above-mentioned methods, so the specific limitations in one or more communication system embodiments provided below can refer to the limitations of each communication method above, and will not be repeated here.

[0173] In an exemplary embodiment, as shown in FIG1 , a communication system is provided, including: a first end and a second end, wherein:

[0174] The first end is used to transmit communication messages to the second end.

[0175] The second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message sent by the first end in the receiving queue of the transceiver queue pair between the first end and the second end.

[0176] The first end is also used to set the communication state between the first end and the second end to the first state when receiving the first message; the first state is used to instruct the first end to suspend transmitting the communication message to the second end.

[0177] The second end is also used to obtain a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message, and send the second message to the first end; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit.

[0178] The first end is also used to release the first state of the first end and retransmit the communication message to the second end when receiving the second message.

[0179] In an exemplary embodiment, the first end is further configured to start a timer corresponding to the first state; when the time corresponding to the timer is reached and the second message is not received, the communication message is retransmitted to the second end.

[0180] In an exemplary embodiment, the first end is further configured to release the first state of the timer and the first end and retransmit the communication message to the second end when the time corresponding to the timer has not arrived and the second message has been received.

[0181] In an exemplary embodiment, the second end is also used to set the communication state with the first end to a second state; the second state is used to characterize that the second end is not ready to receive the first end; when the communication state with the first end is the second state, the second state of the second end is released and a second message is sent to the first end.

[0182] In an exemplary embodiment, the second end is further configured to receive the communication message retransmitted by the first end; and return a confirmation message corresponding to the communication message to the first end.

[0183] Each module in the above communication system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0184] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a communication method is implemented.

[0185] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0186] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0187] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0188] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0189] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A communication method, characterized in that: Applied to the first end, the method comprises: transmitting a communication message to a second end; the second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message in the receiving queue of the transceiver queue pair between the first end and the second end; When receiving a first message returned by the second end, setting the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end; When a second message corresponding to the communication message is received from the second end, the first state of the first end is released and the communication message is retransmitted to the second end; the second message is used to instruct the first end to retransmit, and the second message is obtained according to the reserved field in the extended transmission message header of the confirmation message, and the confirmation message is the message returned to the first end by the second end when the communication message is successfully received.

2. The method according to claim 1, characterized in that After setting the communication state with the second end to the first state, the method further includes: Starting a timer corresponding to the first state; When the time corresponding to the timer is reached and the second message is not received, the communication message is retransmitted to the second end.

3. The method according to claim 2, characterized in that The step of releasing the first state of the first end upon receiving a second message corresponding to the communication message sent by the second end includes: When the time corresponding to the timer has not arrived and the second message is received, the first state of the timer and the first end is released, and the communication message is retransmitted to the second end.

4. A communication method, characterized in that: Applied to the second end, the method comprises: In a case where there is no work queue element corresponding to a communication message transmitted by the first end to the second end in a receiving queue of a transceiver queue pair between a first end and the second end, returning a first message corresponding to the communication message to the first end, so that the first end sets the communication state with the second end to a first state; the first state is used to instruct the first end to suspend transmission of the communication message to the second end; Based on the reserved field in the extended transmission message header of the confirmation message, a second message corresponding to the communication message is obtained; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit; The second message is sent to the first end, so that the first end releases the first state of the first end and retransmits the communication message to the second end.

5. The method according to claim 4, characterized in that Before returning a first message corresponding to the communication message to the first end, the method further includes: Setting the communication state with the first end to a second state; the second state is used to indicate that the second end is not ready to receive the first end; The sending the second message to the first end also includes: When the communication state with the first end is the second state, the second state of the second end is released, and the second message is sent to the first end.

6. The method according to claim 4, characterized in that After sending the second message to the first end so that the first end releases the first state of the first end and retransmitting the communication message to the second end, the method further includes: receiving the communication message retransmitted by the first end; The confirmation message corresponding to the communication message is returned to the first end.

7. A communication system, characterized in that: The system includes a first end and a second end; The first end is used to transmit communication messages to the second end; The second end is used to return a first message corresponding to the communication message to the first end when there is no work queue element corresponding to the communication message sent by the first end in the receiving queue of the transceiver queue pair between the first end and the second end; The first end is further configured to set the communication state between the first end and the second end to a first state when the first message is received; the first state is configured to instruct the first end to suspend transmission of the communication message to the second end; The second end is further used to obtain a second message corresponding to the communication message based on the reserved field in the extended transmission message header of the confirmation message, and send the second message to the first end; the confirmation message is a message returned to the first end by the second end when the communication message is successfully received; the second message is used to instruct the first end to retransmit; The first end is further configured to release the first state of the first end and retransmit the communication message to the second end when the second message is received.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data sending method, data receiving method, data sending device, data receiving device and data transceiving system

    CN115633104A

  • Data transmission method, device, equipment, system and storage medium

    CN118118424A

  • Message transmission method based on DPU network card, DPU network card, network equipment and computer storage medium

    CN118555249A

  • Multi-path RDMA transmission

    WO2019118255A1

  • Network interface card, controller, storage device, and packet transmission method

    WO2022089258A1