Message retransmission method and device, network equipment and storage medium
By carrying the receiver's write address and sequence number for each fragment in RoCE technology, the receiver confirms lost fragments and only retransmits the missing fragments and their write addresses, solving the problems of excessive redundant data transmission and high latency under the go-back-N mechanism, and achieving a more efficient retransmission process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-27
AI Technical Summary
In HPC networks using RoCE technology, packet loss retransmission based on the go-back-N mechanism suffers from problems such as excessive redundant data transmission, high network overhead, and long transmission latency.
The data to be written is divided into multiple fragments, and each fragment carries the write address and sequence number of the receiving end. The receiving end identifies the lost fragment based on the sequence number and only retransmits the missing fragment and its write address, thereby reducing redundant data transmission.
By reducing redundant data transmission, network overhead is reduced and transmission latency is shortened, thus improving retransmission efficiency.
Smart Images

Figure CN121750170A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a message retransmission method, apparatus, network device, and storage medium. Background Technology
[0002] RoCE (RDMA over converged ethernet) is a technology that combines RDMA (remote direct memory access) with converged Ethernet technology, which has been widely used in HPC (High performance computing) networks.
[0003] In HPC networks using RoCE technology, the sender can request the receiver to write data. Packet loss may occur during this process. To address this, a go-back-N (N-frames-back) mechanism is typically used for packet retransmission. Specifically, the sender divides the data to be written into multiple fragments and sends packets carrying these fragments to the receiver in the order they appear in the data. If the sender determines that a fragment has not been sent to the receiver, it must not only retransmit that fragment but also retransmit all subsequent fragments in sequence.
[0004] It is evident that when retransmitting packets based on the go-back-N mechanism, a large amount of redundant data is transmitted, resulting in high network overhead and increased transmission latency, leading to untimely retransmission. Summary of the Invention
[0005] The purpose of this invention is to provide a message retransmission method, apparatus, network device, and storage medium to reduce redundant data during retransmission. The specific technical solution is as follows:
[0006] This invention first provides a message retransmission method, which is applied at the sending end and includes:
[0007] The data to be written is divided into multiple fragments, and a first request message carrying the fragments is sent to the receiving end in the order of the fragments in the data to be written; wherein each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0008] The receiver receives a response message carrying fragment reception information sent by the receiving end; wherein the fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end;
[0009] If the intervals carried by two adjacent response messages are not contiguous, the fragment corresponding to the missing sequence number between the two intervals is determined to be a lost fragment.
[0010] Send a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
[0011] Optionally, the method further includes:
[0012] If a lost fragment is determined, the management information of the lost fragment is recorded; wherein, the management information includes: a management sequence number and multiple bits; each bit indicates whether multiple consecutive fragments starting from the first lost fragment need to be retransmitted; the management sequence number includes: the sequence number of the fragment represented by the first bit in the management information, and the sequence number of the first fragment among the lost fragments;
[0013] If a response message is received from the receiving end for any of the lost fragments, the corresponding bit in the management information for that fragment is modified to a value indicating that retransmission is not required.
[0014] Optionally, the management information further includes: a preset maximum number of retransmissions; after sending a second request message carrying the lost fragment and the write address of the lost fragment to the receiving end, the method further includes:
[0015] If the preset interval is reached and not all bits in the management information indicate that retransmission is not required, the process of repeatedly sending the fragments that need to be retransmitted to the receiving end and decrementing the maximum number of retransmissions by one continues until the maximum number of retransmissions is 0. If not all bits in the management information indicate that retransmission is not required, a retransmission error is determined.
[0016] Optionally, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0017] Optionally, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is set after the acknowledgment extension transmission header of the response message.
[0018] This invention also provides a message retransmission method, which is applied at a receiving end and includes:
[0019] The receiver continuously sends first request messages carrying fragments; wherein each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiver, and a sequence number indicating the order of the fragment in the data to be written.
[0020] The received fragments are written to the storage area of the receiving end according to the write address carried in the first request message;
[0021] A response message carrying fragment reception information is sent to the sending end, so that the sending end can retransmit the message to the receiving end if it determines that there are lost fragments based on the fragment reception information; wherein, the fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end;
[0022] Receive a second request message sent by the sending end; wherein the second request message carries the lost fragment and the write address of the lost fragment;
[0023] The received fragments are written to the storage area of the receiving end according to the write address carried in the second request message.
[0024] Optionally, a response message carrying fragmented reception information is sent to the sending end, including:
[0025] When the preset response conditions are met, a response message carrying fragmented reception information is sent to the sending end.
[0026] The preset response conditions include: the cumulative number of first request messages with consecutive sequence numbers received reaches a preset threshold; or, the sequence number carried by the currently received first request message is not consecutive with the previously received sequence number; or, the currently received first request message carries the last fragment of the data to be written.
[0027] Each transmitted fragment reception information represents the range of sequence numbers of the fragments received by the receiving end after the previous preset transmission conditions were met.
[0028] Optionally, the second request message also carries a fragment sequence number; the method further includes:
[0029] Upon receiving the fragment carried in the second request message, a response message carrying the sequence number of the fragment is sent to the sending end so that the sending end can determine that the fragment retransmission was successful.
[0030] Optionally, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0031] Optionally, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is set after the acknowledgment extension transmission header of the response message.
[0032] This invention also provides a message retransmission device, which is applied at the sending end and includes:
[0033] The first request module is used to divide the data to be written into multiple fragments and send a first request message carrying the fragments to the receiving end in the order of the fragments in the data to be written; wherein, each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0034] The first response receiving module is used to receive a response message carrying fragmented reception information sent by the receiving end; wherein, the fragmented reception information represents the range of sequence numbers of the fragments received by the receiving end;
[0035] The loss determination module is used to determine the fragment corresponding to the missing sequence number between two adjacent response messages as the lost fragment if the intervals carried by the two adjacent response messages are not contiguous.
[0036] The second request module is used to send a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
[0037] This invention also provides a message retransmission device, which is applied at a receiving end and includes:
[0038] The first request receiving module is used to receive first request messages carrying fragments continuously sent by the sending end; wherein each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0039] The first write module is used to write the received fragments into the storage area of the receiving end according to the write address carried in the first request message.
[0040] The first response module is used to send a response message carrying fragment reception information to the sending end, so that the sending end can retransmit the message to the receiving end if it determines that there are lost fragments based on the fragment reception information; wherein, the fragment reception information represents the range of sequence numbers of the fragments received by the receiving end.
[0041] The second request receiving module is used to receive a second request message sent by the sending end; wherein the second request message carries the lost fragment and the write address of the lost fragment;
[0042] The second write module is used to write the received fragments into the storage area of the receiving end according to the write address carried in the second request message.
[0043] This invention also provides a network device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0044] Memory, used to store computer programs;
[0045] A programmable logic device, used to execute a program stored in a memory, to implement any of the message retransmission methods described above.
[0046] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a programmable logic device, implements any of the above-described message retransmission methods.
[0047] This invention also provides a computer program product containing instructions that, when run on a computer, causes the computer to execute any of the message retransmission methods described above.
[0048] Beneficial effects of the embodiments of the present invention:
[0049] The message retransmission method provided in this embodiment of the invention divides the data to be written into multiple fragments and sends a first request message carrying the fragments to the receiving end according to the order of the fragments in the data to be written. Each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written. In this way, the receiving end can write the received fragment according to the write address and send a response message carrying fragment reception information to the sending end according to the received sequence number. The fragment reception information includes the range of sequence numbers of the fragments received by the receiving end. Therefore, the sending end can determine the lost fragments according to the fragment reception information. Thus, the sending end does not need to retransmit all fragments after the lost fragment, but only needs to send the lost fragment and its corresponding write address to the receiving end, so that the receiving end can write the lost fragment to the storage area according to the corresponding write address. Therefore, this solution can reduce redundant data retransmission, thereby reducing network overhead and shortening transmission latency.
[0050] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0052] Figure 1 This is a schematic diagram of the first type of interaction between the sending end and the receiving end in an embodiment of the present invention;
[0053] Figure 2 A schematic diagram illustrating the format of write request messages and read request messages;
[0054] Figure 3 This is a schematic diagram of the response message format in an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram illustrating the second type of interaction between the sending end and the receiving end in an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram illustrating a third type of interaction between the sending end and the receiving end in an embodiment of the present invention;
[0057] Figure 6 This is a schematic diagram of the structure of management information in an embodiment of the present invention;
[0058] Figure 7 This is a schematic diagram of the fourth type of interaction between the sending end and the receiving end in an embodiment of the present invention;
[0059] Figure 8 This is a flowchart illustrating the message retransmission method applied to the sending end in an embodiment of the present invention;
[0060] Figure 9 This is a flowchart illustrating the message retransmission method applied to the receiving end in an embodiment of the present invention.
[0061] Figure 10 This is a schematic diagram of the message retransmission device applied to the sending end in an embodiment of the present invention;
[0062] Figure 11 This is a schematic diagram of the message retransmission device applied to the receiving end in an embodiment of the present invention;
[0063] Figure 12 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on the present invention are within the scope of protection of the present invention.
[0065] In the RDMA technology field, for a write task, when the length of the data to be written exceeds the path MTU (Maximum Transmission Unit), the sender divides the data into multiple fragments and sends fragment-carrying packets to the receiver in the order of the fragments in the data to be written. After receiving each fragment, the receiver checks whether the sequence number of the fragment is out of order, that is, whether the sequence number of the fragment is consecutive to the previously received sequence number. If it is not consecutive, the receiver discards the fragment and sends a NACK (Negative Acknowledgment Packet) packet back to the sender. In this process, only the packet carrying the fragments contains the write address of the first fragment. After receiving the first fragment, the receiver writes the fragment to the corresponding write address. Subsequent fragments are written after the previously written fragment. If a packet is lost in the middle, the receiver cannot determine the write address of the subsequent fragments. Therefore, the sender needs to retransmit all subsequent fragments starting from the lost fragment. This would transmit a large amount of redundant data, resulting in high network overhead and increased transmission latency, leading to untimely retransmission.
[0066] To address the aforementioned problems, embodiments of the present invention provide a message retransmission method, apparatus, network device, and storage medium. For ease of understanding, the following description pertains to the interaction process between the sending end and the receiving end in the message retransmission method provided by this embodiment. In this embodiment, the sending end and the receiving end can be electronic devices with data transmission and processing capabilities, such as computers, servers, or other network devices.
[0067] like Figure 1 As shown, the interaction process between the sender and receiver includes the following steps:
[0068] S101, the sending end divides the data to be written into multiple fragments and sends a first request message carrying the fragments to the receiving end according to the order of the fragments in the data to be written; wherein, each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0069] Typical RDMA operations include RDMA write and RDMA read. The response message for an RDMA write operation is an ACK (Acknowledgment Packet), and the response message for an RDMA read operation is a read response. A write operation writes data from the sending end to the receiving end's memory; the memory address of the data to be written is encapsulated in the RETH (RDMA Extended Transport Header) field of the write request header. A read operation reads data from the receiving end's memory back to the sending end; the memory address of the data to be read is encapsulated in the RETH field of the read request header. The format of the RETH field is shown in Table 1.
[0070] Table 1
[0071]
[0072] like Figure 2 As shown, in related technologies, a write request message includes a 14-byte ETH (Ethernet Header), a 20-byte IP (Internet Protocol) header, an 8-byte UDP (User Datagram Protocol) header, a 12-byte BTH (Base Transport Header), a PAYLOAD (payload), and a 4-byte ICRC (Invariant Cyclic Redundancy Check) field. A read request message includes ETH, IP header, BTH, UDP header, a RETH field, and an ICRC field.
[0073] In related technologies, only the "write only" (write-only packet, i.e., a packet carrying only the data to be written) and "write first" (write-first packet, i.e., a packet carrying the first fragment of data to be written) messages in the write request message carry the 16-byte RETH field. The "write middle" (write-middle packet, i.e., a packet between the first and last packets) and "write last" (write-last packet, i.e., a packet carrying the last fragment of data to be written) messages do not carry the RETH field. Therefore, if a packet is lost in the middle, the receiving end cannot determine the write address of subsequent fragments, and the sending end needs to retransmit all subsequent fragments starting from the lost fragment.
[0074] In this embodiment, the first request message can be the write request message described above. Each write request message in this embodiment (including the write header packet, write intermediate packet, and write tail packet) carries a RETH field. The RETH field contains the write address of the fragment at the receiving end, that is, the memory address where the data needs to be written at the receiving end. In this way, even if a message is lost in the middle, the receiving end can determine where to write after receiving subsequent fragments. Specifically, for each fragment to be written, the address offset can be determined according to the length of the previous fragment, and then the sum of the write address corresponding to the previous fragment and the address offset is used as the write address of the current fragment to be written.
[0075] S102, the receiving end receives the first request message and writes the received fragment into the storage area of the receiving end according to the write address carried in the first request message.
[0076] The storage area at the receiving end can specifically be the storage area in the memory of the receiving end.
[0077] S103, the receiving end sends a response message carrying fragment reception information to the sending end; wherein, the fragment reception information represents the range of sequence numbers of the fragments received by the receiving end;
[0078] In one implementation, the receiving end can send a response message to the sending end after receiving the first request message each time. In this case, the response message can carry the sequence number of the currently received fragment.
[0079] In another implementation, the receiving end can send a response message carrying fragmented reception information to the sending end when a preset response condition is met.
[0080] Fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end; in this way, the receiving end can use the range to represent the fragments with consecutive sequence numbers received, without having to send the sequence numbers of each received fragment to the sending end, thereby further saving the bandwidth occupied by the response message.
[0081] The preset response conditions include: the cumulative number of first request messages with consecutive sequence numbers received reaches a preset threshold; or, the sequence number carried by the currently received first request message is not consecutive with the sequence number received previously; or, the currently received first request message carries the last fragment of data to be written.
[0082] Each transmitted fragment reception message represents the range of sequence numbers of the fragments received by the receiver since the last time the preset transmission conditions were met. In other words, each transmitted fragment reception message only records the range of sequence numbers of the fragments received by the receiver during the time period from the last time the preset transmission conditions were met to the current time the preset transmission conditions are met.
[0083] In this way, the receiving end does not need to send a response message to the sending end every time it receives a fragment, thus saving the bandwidth occupied by the response message.
[0084] Specifically, the left boundary of the interval can be represented by the sequence number field (i.e., the PSN field) in the BTH of the response message. After the AETH (ACK Extended Transport Header) of the response message, a new field can be added to represent the right boundary of the interval; this field can be denoted as MPSN. The length of this field can be set according to the length of the sequence number, such as 4 bytes. Correspondingly, the format of the response message can be as follows: Figure 3 As shown, the data includes a 14-byte ETH header, a 20-byte IP header, an 8-byte UDP header, a 12-byte BTH header, a 4-byte AETH header, a 4-byte field indicating the right boundary of the interval, and a 4-byte ICRC field. Since the PSN field in the BTH is universally used in the RoCE field, it can be used to represent the left boundary of the interval, while the MPSN field can be added to represent the right boundary, resulting in minimal changes to the original message standard. Alternatively, the PSN field in the BTH can represent the right boundary, and the added MPSN field can represent the left boundary. Or, the BTH can omit any boundaries, with both the left and right boundaries carried in the added MPSN field, which is also acceptable.
[0085] Since the BTH also contains some reserved fields, in this embodiment, a retransmission flag can be set at a specified position in the reserved field of the BTH of the response message. When the retransmission flag is a first value, it indicates that the response message was generated for a retransmitted fragment; when the retransmission flag is a second value, it indicates that the response message was generated for a non-retransmitted fragment. For example, the retransmission flag can be in the 0th bit of the Reserve 7 field. When the sending end receives a message from the receiving end, if it recognizes that the 0th bit of Reserve 7 in the BTH of the message is 0, it determines that the response message was generated for a non-retransmitted fragment; if it recognizes that the 0th bit of Reserve 7 in the BTH of the message is 1, it determines that the response message was generated for a retransmitted fragment. In this way, it is easier for the sending end to distinguish between different response messages.
[0086] S104, the sending end receives a response message. If the intervals carried by two adjacent response messages are not continuous, the sending end determines that the fragment corresponding to the missing sequence number between the two intervals is a lost fragment, and sends a second request message carrying the lost fragment and the write address of the lost fragment to the receiving end.
[0087] Because the response message sent by the receiving end to the sending end carries a range of sequence numbers representing the fragments received by the receiving end, the sending end can determine which fragments the receiving end has received, and thus also determine which fragments the receiving end has not received. That is, the sending end can determine whether the ranges carried by two consecutively received response messages are consecutive; if they are not consecutive, it determines that the fragment corresponding to the missing sequence number between the two ranges is a lost fragment, and thus resends a second request message carrying that fragment to the receiving end. Correspondingly, a flag can also be set at a specified position in the reserved field of the second request message BTH to identify this message as a request message for retransmitting fragments.
[0088] For example, such as Figure 4 As shown, the first request message received by the receiving end carries sequence numbers 0, 1, 2, 3, 5, 6, and 7. The receiving end can first send a response message carrying the interval [0, 3] to indicate that fragments with sequence numbers 0 to 3 have been received, and then send another response message carrying the interval [5, 7] to indicate that fragments with sequence numbers 5 to 7 have been received. In this way, the sending end can determine that sequence number 4 is missing between the intervals [0, 3] and [5, 7], and therefore can determine that fragment with sequence number 4 is lost. It can then send a second request message carrying the fragment with sequence number 4 to the receiving end. After receiving this message, the receiving end can send a response message carrying sequence number 4 to the sending end to notify the sending end that the fragment has been received.
[0089] S105, the receiving end receives the second request message and writes the received fragment into the storage area of the receiving end according to the write address carried in the second request message.
[0090] The message retransmission method provided in this invention divides the data to be written into multiple fragments and sends a first request message carrying the fragments to the receiving end according to the order of the fragments in the data to be written. Each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written. In this way, the receiving end can write the received fragment according to the write address and send a response message carrying fragment reception information to the sending end according to the received sequence number. The fragment reception information includes the range of sequence numbers of the fragments received by the receiving end. Therefore, the sending end can determine the lost fragments according to the fragment reception information. Thus, the sending end does not need to retransmit all fragments after the lost fragment, but only needs to send the lost fragment and its corresponding write address to the receiving end, so that the receiving end can write the lost fragment to the storage area according to the corresponding write address. Therefore, this solution can reduce redundant data retransmission, thereby reducing network overhead and shortening transmission latency.
[0091] In one embodiment of the present invention, after the sending end receives the response message, as follows: Figure 5 As shown, the interaction process between the sender and receiver may include the following steps:
[0092] S501, if the sending end determines that there is a lost fragment based on the fragment reception information, it records the status information indicating that the lost fragment failed to be sent, and sends a second request message to the receiving end carrying the lost fragment, the sequence number of the lost fragment, and the write address of the lost fragment.
[0093] S502, when the receiving end receives the fragment carried in the second request message, it sends a response message carrying the sequence number of the fragment to the sending end.
[0094] That is, the receiving end can send a response message for the received retransmitted fragments, so that the sending end can determine which lost fragments were successfully retransmitted.
[0095] If there are multiple second request messages, the receiving end can send a response message for each second request message one by one. Correspondingly, a flag can also be set at a specified position in the reserved field of the second request message BTH to indicate that the message is used to respond to retransmitted fragments.
[0096] S503: If the sending end receives a response message from the receiving end regarding the lost fragment, it modifies the status information of the lost fragment to indicate that the retransmission was successful.
[0097] Furthermore, the sending end can check the status information of the lost fragment at preset intervals. If the status information still indicates a transmission failure, the fragment can be retransmitted until the status information of the lost fragment indicates a successful retransmission. In this embodiment, the sending end records the status information of the lost fragments and, upon receiving a response message for the lost fragment, modifies the status information of the lost fragment to indicate a successful retransmission. This allows the sending end to determine which fragments need to be retransmitted to the receiving end.
[0098] Specifically, it can be used as follows Figure 6 The management information shown records the status information of each fragment. The management information includes: management sequence number and multiple bits; each bit indicates whether multiple consecutive fragments starting from the first lost fragment need to be retransmitted; the management sequence number includes: the sequence number of the fragment represented by the first bit in the management information, and the sequence number of the first fragment among the lost fragments.
[0099] A management message can contain a maximum of a preset number of bits, for example, 16. A value of 0 indicates a transmission failure, meaning the receiver did not receive a response message for that fragment and retransmission is required; a value of 1 indicates a successful retransmission, meaning the receiver received a response message for that fragment and retransmission is not required. Since the management message also records the sequence number of the first fragment in a series of fragments, the first bit of the management message indicates whether the first fragment needs to be retransmitted, and each subsequent bit indicates whether each fragment in a series of fragments needs to be retransmitted.
[0100] Taking 16 consecutively lost packets as an example, the bit width of a single sequence number is 24 bits. Using a single sequence number as the smallest recording unit, at least 24 × 16 = 384 bits are required. However, if recorded using the starting sequence number and a 16-bit bitmap, only 24 + 16 = 40 bits are needed. Therefore, with this implementation, the sender only needs to record the sequence number of the first fragment in multiple consecutive fragments, along with a few bits, to represent the status information of multiple fragments, without needing to record each sequence number of each consecutive fragment separately. This allows for the integrated recording of multiple lost packet fragments, reducing the storage space required for management information.
[0101] Understandably, when the sequence numbers of the lost fragments are not all consecutive, or when the number of lost fragments with consecutive sequence numbers is greater than a preset number, the sending end can record multiple management information entries to record the status of the lost fragments, i.e. whether retransmission is required. Each bit in each management information entry records the status information of a preset number of fragments with consecutive sequence numbers.
[0102] Each time a lost fragment is identified, the sending end can generate a retransmission task. Correspondingly, the management information can include an identifier for this retransmission task, which can be the sequence number of the first fragment among the currently identified lost fragments. The information recorded in the management information does not cross tasks; that is, a single management information entry is used only to record information about the fragments to be retransmitted by a single retransmission task, and not information about other retransmission tasks.
[0103] Correspondingly, if the sending end receives a response message from the receiving end for any of the lost fragments, it modifies the corresponding bit in the management information to a value indicating that retransmission is not required. If retransmission is not required, the retransmission is considered successful. The sending end can also delete the management information if the status information for all fragments in the management information indicates that retransmission is not required, thus releasing the storage address occupied by the management information.
[0104] Furthermore, the management information may also include: a preset maximum number of retransmissions; the maximum number of retransmissions can be set based on experience and needs. For example, the maximum number of retransmissions can occupy 3 bits, meaning the maximum number of retransmissions can be set to a maximum of 8. Correspondingly, after the sender sends a second request message carrying the lost fragments and the write address of the lost fragments to the receiver, if a preset interval is reached and all bits in the management information still do not indicate that retransmission is not required, the sender will repeatedly execute the steps of sending the fragments that need to be retransmitted to the receiver and decrementing the maximum number of retransmissions by one, until the maximum number of retransmissions reaches 0. If all bits in the management information still do not indicate that retransmission is not required, a retransmission error is determined.
[0105] If a retransmission error is detected, the sending end can record the task identifier and error type corresponding to the current message, carry this information in the completion information for reporting, and at the same time release the storage address occupied by this management information.
[0106] Specifically, the process can be as follows: Figure 7 As shown:
[0107] S701, the sending end sends a request message, namely the first request message;
[0108] S702, the receiving end replies with a response message;
[0109] S703, the sending end receives the response message and detects packet loss. If there is packet loss, it records the retransmission information, sends a retransmission message, and starts the retransmission timer. The timing duration of the retransmission timer can be the preset interval duration mentioned above.
[0110] S704, the sending end sends a retransmission message, i.e., the second request message;
[0111] S705, the receiving end replies with a retransmission response message, which is a response message generated for the retransmitted fragments;
[0112] S706: When the sending end receives the retransmission response message, it sets the corresponding bit in the management information to 1. If the retransmission timer times out, it triggers another retransmission.
[0113] S707, the sending end retransmits the retransmission message;
[0114] S708, the receiving end replies with a retransmission response message.
[0115] In this embodiment, redundant data retransmitted can be reduced, thereby reducing network overhead and shortening transmission latency. Furthermore, the sending end can periodically check whether all bits of the management information indicate that retransmission is not required, and then retransmit the fragments that do need to be retransmitted, which can further prevent the retransmitted fragments from being lost again.
[0116] This invention provides a message retransmission method, which is applied at the sending end, such as... Figure 8 As shown, the method includes:
[0117] S801, divide the data to be written into multiple fragments, and send a first request message carrying the fragments to the receiving end in the order of the fragments in the data to be written;
[0118] Each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0119] S802, Receive the response message carrying fragmented reception information sent by the receiving end;
[0120] Among them, the fragment reception information represents the range of sequence numbers of the fragments received by the receiving end;
[0121] S803, if the intervals carried by two adjacent response messages are not continuous, then the fragment corresponding to the missing sequence number between the two intervals is determined to be a lost fragment.
[0122] S804 sends a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
[0123] In one embodiment of the present invention, the above method further includes:
[0124] If a lost fragment is determined based on the fragment reception information, the management information of the lost fragment is recorded. The management information includes a management sequence number and multiple bits. Each bit indicates whether multiple consecutive fragments starting from the first lost fragment need to be retransmitted. The management sequence number includes the sequence number of the fragment represented by the first bit in the management information, and the sequence number of the first fragment among the lost fragments.
[0125] If a response message is received from the receiver for any of the lost fragments, the corresponding bit in the management information for that fragment will be modified to a value indicating that retransmission is not required.
[0126] In one embodiment of the present invention, the management information further includes: a preset maximum number of retransmissions; after sending a second request message carrying the lost fragments and the write address of the lost fragments to the receiving end, the above method further includes:
[0127] If the preset interval is reached and not all bits in the management information indicate that retransmission is not required, the process of sending the fragments that need to be retransmitted to the receiving end and decrementing the maximum number of retransmissions by one is repeated until the maximum number of retransmissions is 0. If not all bits in the management information indicate that retransmission is not required, a retransmission error is determined.
[0128] In one embodiment of the present invention, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0129] In one embodiment of the present invention, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is provided after the acknowledgment extension transmission header of the response message.
[0130] This invention provides a message retransmission method, which is applied at the receiving end, such as... Figure 9 As shown, the method includes:
[0131] S901, Receive the first request message carrying fragments continuously sent by the sending end;
[0132] Each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0133] S902, the received fragments are written to the storage area of the receiving end according to the write address carried in the first request message;
[0134] S903, send a response message carrying fragment reception information to the sender so that the sender can retransmit the message to the receiver if it is determined that there are lost fragments based on the fragment reception information.
[0135] The fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end;
[0136] S904, Receive the second request message sent by the sending end;
[0137] The second request message carries the lost fragment and the write address of the lost fragment;
[0138] S905, write the received fragments into the storage area of the receiving end according to the write address carried in the second request message.
[0139] In one embodiment of the present invention, sending a response message carrying fragmented reception information to the sending end includes:
[0140] When the preset response conditions are met, a response message carrying fragmented reception information is sent to the sending end.
[0141] The preset response conditions include: the cumulative number of first request messages with consecutive sequence numbers received reaches a preset threshold; or, the sequence number carried by the currently received first request message is not consecutive with the sequence number received previously; or, the currently received first request message carries the last fragment of data to be written.
[0142] Each transmitted fragment reception information represents the range of sequence numbers of the fragments received by the receiver after the previous transmission conditions were met.
[0143] In one embodiment of the present invention, the second request message further carries a fragment sequence number; the above method further includes:
[0144] Upon receiving a fragment carried in the second request message, a response message carrying the sequence number of the fragment is sent to the sender so that the sender can confirm that the fragment retransmission was successful.
[0145] In one embodiment of the present invention, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0146] In one embodiment of the present invention, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is provided after the acknowledgment extension transmission header of the response message.
[0147] Based on the same inventive concept, embodiments of the present invention also provide a message retransmission device, which is applied at the sending end, such as... Figure 10 As shown, the device includes:
[0148] The first request module 1001 is used to divide the data to be written into multiple fragments and send a first request message carrying the fragments to the receiving end in the order of the fragments in the data to be written; wherein each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0149] The first response receiving module 1002 is used to receive a response message carrying fragmented reception information sent by the receiving end; wherein, the fragmented reception information represents the range of sequence numbers of the fragments received by the receiving end;
[0150] The loss determination module 1003 is used to determine the fragment corresponding to the missing sequence number between two adjacent response messages as the lost fragment if the intervals carried by the two adjacent response messages are not continuous.
[0151] The second request module 1004 is used to send a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
[0152] In one embodiment of the present invention, the device further includes:
[0153] An information recording module is used to record management information of lost fragments when it is determined that there are lost fragments; wherein, the management information includes: a management sequence number and multiple bits; each bit indicates whether multiple consecutive fragments starting from the first lost fragment need to be retransmitted; the management sequence number includes: the sequence number of the fragment represented by the first bit in the management information, and the sequence number of the first fragment among the lost fragments;
[0154] The information modification module is used to modify the corresponding bit in the management information to a value indicating that retransmission is not required if a response message is received from the receiving end for any of the lost fragments.
[0155] In one embodiment of the present invention, the management information further includes: a preset maximum number of retransmissions;
[0156] The device further includes a retransmission management module, which, after the second request module 1004 sends a second request message carrying the lost fragment and the write address of the lost fragment to the receiving end, if a preset interval is reached and all bits in the management information still do not indicate that retransmission is not required, then repeatedly executes the steps of sending fragments that need to be retransmitted to the receiving end and decrementing the maximum retransmission count by one, until the maximum retransmission count is 0 and all bits in the management information still do not indicate that retransmission is not required, thus determining that a retransmission error has occurred.
[0157] In one embodiment of the present invention, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0158] In one embodiment of the present invention, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is provided after the acknowledgment extension transmission header of the response message.
[0159] This invention also provides a message retransmission device, applied at the receiving end, such as... Figure 11 As shown, the device includes:
[0160] The first request receiving module 1101 is used to receive first request messages carrying fragments continuously sent by the sending end; wherein each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written.
[0161] The first writing module 1102 is used to write the received fragments into the storage area of the receiving end according to the writing address carried in the first request message.
[0162] The first response module 1103 is used to send a response message carrying fragment reception information to the sending end, so that the sending end can retransmit the message to the receiving end if it determines that there are lost fragments based on the fragment reception information; wherein, the fragment reception information represents the sequence number of the fragment received by the receiving end.
[0163] The second request receiving module 1104 is used to receive a second request message sent by the sending end; wherein the second request message carries the lost fragment and the write address of the lost fragment;
[0164] The second writing module 1105 is used to write the received fragments into the storage area of the receiving end according to the write address carried in the second request message.
[0165] In one embodiment of the present invention, the first response module 1103 is specifically used for:
[0166] When the preset response conditions are met, a response message carrying fragmented reception information is sent to the sending end.
[0167] The preset response conditions include: the cumulative number of first request messages with consecutive sequence numbers received reaches a preset threshold; or, the sequence number carried by the currently received first request message is not consecutive with the previously received sequence number; or, the currently received first request message carries the last fragment of the data to be written.
[0168] Each transmitted fragment reception information represents the sequence number of the fragment received by the receiving end after the previous preset transmission conditions were met.
[0169] In one embodiment of the present invention, the second request message further carries a fragment sequence number; the apparatus further includes:
[0170] The second response module is used to send a response message carrying the sequence number of the fragment to the sending end when the fragment carried in the second request message is received, so that the sending end can determine that the fragment retransmission was successful.
[0171] In one embodiment of the present invention, the response message includes: a retransmission flag; when the retransmission flag is a first value, it indicates that the response message is generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message is generated for non-retransmission fragments.
[0172] In one embodiment of the present invention, the sequence number field in the basic transmission header of the response message represents the left boundary of the interval, and a field representing the right boundary of the interval is provided after the acknowledgment extension transmission header of the response message.
[0173] This invention also provides a network device, such as... Figure 12 As shown, it includes a programmable logic device 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. The programmable logic device 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204.
[0174] Memory 1203 is used to store computer programs;
[0175] The programmable logic device 1201 is used to implement any of the above-mentioned message retransmission methods when executing the program stored in the memory 1203.
[0176] The communication bus mentioned in the above network devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0177] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0178] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0179] The aforementioned programmable logic devices can be field-programmable gate arrays (FPGAs) or other programmable logic devices.
[0180] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described message retransmission methods.
[0181] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the message retransmission methods described above.
[0182] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0183] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0184] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for apparatus, network devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0185] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A message retransmission method, characterized in that, The method is applied at the sending end, and the method includes: The data to be written is divided into multiple fragments, and a first request message carrying the fragments is sent to the receiving end in the order of the fragments in the data to be written; wherein each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written. The receiver receives a response message carrying fragment reception information sent by the receiving end; wherein the fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end; If the intervals carried by two adjacent response messages are not contiguous, the fragment corresponding to the missing sequence number between the two intervals is determined to be a lost fragment. Send a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
2. The method according to claim 1, characterized in that, The method further includes: If a lost fragment is determined, the management information of the lost fragment is recorded; wherein, the management information includes: a management sequence number and multiple bits; each bit indicates whether multiple consecutive fragments starting from the first lost fragment need to be retransmitted; the management sequence number includes: the sequence number of the fragment represented by the first bit in the management information, and the sequence number of the first fragment among the lost fragments; If a response message is received from the receiving end for any of the lost fragments, the corresponding bit in the management information for that fragment is modified to a value indicating that retransmission is not required.
3. The method according to claim 2, characterized in that, The management information further includes: a preset maximum number of retransmissions; after sending a second request message carrying the lost fragment and the write address of the lost fragment to the receiving end, the method further includes: If the preset interval is reached and not all bits in the management information indicate that retransmission is not required, the process of repeatedly sending the fragments that need to be retransmitted to the receiving end and decrementing the maximum number of retransmissions by one continues until the maximum number of retransmissions is 0. If not all bits in the management information indicate that retransmission is not required, a retransmission error is determined.
4. The method according to claim 2, characterized in that, The response message includes a retransmission flag; when the retransmission flag is a first value, it indicates that the response message was generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message was generated for non-retransmission fragments.
5. The method according to claim 1, characterized in that, The sequence number field in the basic transport header of the response message indicates the left boundary of the interval, and a field indicating the right boundary of the interval is set after the acknowledgment extended transport header of the response message.
6. A message retransmission method, characterized in that, The method is applied at the receiving end, and the method includes: The receiver continuously sends first request messages carrying fragments; wherein each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiver, and a sequence number indicating the order of the fragment in the data to be written. The received fragments are written to the storage area of the receiving end according to the write address carried in the first request message; A response message carrying fragment reception information is sent to the sending end, so that the sending end can retransmit the message to the receiving end if it determines that there are lost fragments based on the fragment reception information; wherein, the fragment reception information includes: the range of sequence numbers of the fragments received by the receiving end; Receive a second request message sent by the sending end; wherein the second request message carries the lost fragment and the write address of the lost fragment; The received fragments are written to the storage area of the receiving end according to the write address carried in the second request message.
7. The method according to claim 6, characterized in that, Sending a response message carrying fragmented reception information to the sending end, including: When the preset response conditions are met, a response message carrying fragmented reception information is sent to the sending end. The preset response conditions include: the cumulative number of first request messages with consecutive sequence numbers received reaches a preset threshold; or, the sequence number carried by the currently received first request message is not consecutive with the previously received sequence number; or, the currently received first request message carries the last fragment of the data to be written. Each transmitted fragment reception information represents the range of sequence numbers of the fragments received by the receiving end after the previous preset transmission conditions were met.
8. The method according to claim 6, characterized in that, The second request message also carries a fragment sequence number; the method further includes: Upon receiving the fragment carried in the second request message, a response message carrying the sequence number of the fragment is sent to the sending end so that the sending end can determine that the fragment retransmission was successful.
9. The method according to claim 8, characterized in that, The response message includes a retransmission flag; when the retransmission flag is a first value, it indicates that the response message was generated for retransmission fragments; when the retransmission flag is a second value, it indicates that the response message was generated for non-retransmission fragments.
10. The method according to claim 6, characterized in that, The sequence number field in the basic transport header of the response message indicates the left boundary of the interval, and a field indicating the right boundary of the interval is set after the acknowledgment extended transport header of the response message.
11. A message retransmission device, characterized in that, The device is used at the transmitting end, and the device includes: The first request module is used to divide the data to be written into multiple fragments and send a first request message carrying the fragments to the receiving end in the order of the fragments in the data to be written; wherein, each first request message carries a fragment, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written. The first response receiving module is used to receive a response message carrying fragmented reception information sent by the receiving end; wherein, the fragmented reception information represents the range of sequence numbers of the fragments received by the receiving end; The loss determination module is used to determine the fragment corresponding to the missing sequence number between two adjacent response messages as the lost fragment if the intervals carried by the two adjacent response messages are not contiguous. The second request module is used to send a second request message to the receiving end, carrying the lost fragment and the write address of the lost fragment.
12. A message retransmission device, characterized in that, The device is used at a receiving end, and the device includes: The first request receiving module is used to receive first request messages carrying fragments continuously sent by the sending end; wherein each first request message carries a fragment divided from the data to be written, the write address of the fragment at the receiving end, and a sequence number indicating the order of the fragment in the data to be written. The first write module is used to write the received fragments into the storage area of the receiving end according to the write address carried in the first request message. The first response module is used to send a response message carrying fragment reception information to the sending end, so that the sending end can retransmit the message to the receiving end if it determines that there are lost fragments based on the fragment reception information; wherein, the fragment reception information represents the range of sequence numbers of the fragments received by the receiving end. The second request receiving module is used to receive a second request message sent by the sending end; wherein the second request message carries the lost fragment and the write address of the lost fragment; The second write module is used to write the received fragments into the storage area of the receiving end according to the write address carried in the second request message.
13. A network device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. The programmable logic device, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; A programmable logic device, used to execute a program stored in a memory, to implement the steps of the method described in any one of claims 1-5 or 6-10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a programmable logic device, implements the steps of the method described in any one of claims 1-5 or 6-10.