Packet loss processing method, gateway and device

By determining whether packet loss occurs in the packet sequence number PSN between the first gateway and the second gateway, and directly sending NAK to the first host when determining packet loss, the problem of bandwidth waste caused by packet loss in the network is solved. , achieving faster and more efficient packet loss processing.

CN119363675AActive Publication Date: 2025-01-24NEW H3C TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411578306.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-01-24
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

In the network, packet loss causes the receiver to send NAK reply. However, the transmission time of NAK is long, resulting in the sending end sending a large number of unreceived messages before receiving the NAK, resulting in wasting bandwidth, especially in WAN connections. The problem is even more serious in the case.

Method used

Between the first gateway and the second gateway, the packet sequence number PSN of the message is determined to see whether packet loss occurs. If it is determined that the packet is lost, the first gateway directly sends a NAK to the first host to cause it to resend the message; if not, If it is determined that the packet is lost, the PSN is updated and the packet is forwarded.

Benefits of technology

By performing packet loss detection and processing at the first gateway in advance, the number of messages sent after packet loss is reduced, the waste of network bandwidth is reduced, and the speed of packet loss processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363675A_ABST
    Figure CN119363675A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a packet loss processing method, a gateway and a device, relates to the technical field of networks, is applied to a first gateway, the first gateway is located on a transmission path between a first host and a second host, and the method comprises the following steps: receiving a first message sent by the first host; judging whether packet loss occurs or not according to the PSN of the first message; if it is judged that no packet loss occurs, the first receiving PSN is updated to the PSN of the first message, the first message is forwarded to a second gateway, and the second gateway is located on a transmission path between the first gateway and the second host; if it is judged that packet loss occurs, a first NAK is sent to the first host, and a first PSN carried in the first NAK is obtained through calculation based on the current first receiving PSN, so that the first host resends a message with the PSN larger than or equal to the first PSN. By applying the scheme provided by the embodiment of the invention, the wasted bandwidth during processing the packet loss of the message can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a packet loss processing method, gateway and device. Background Art

[0002] When two hosts in the network exchange messages, the sender sends messages to the receiver. Due to network quality issues, packets may be lost. After detecting packet loss, the receiver needs to reply NAK (Non-Acknowledge) to the sender, which carries the PSN (Package Sequence Number) of the lost packet. After receiving NAK, the sender needs to resend the message starting from the lost packet corresponding to the PSN.

[0003] However, since the network quality between the two hosts cannot be guaranteed and the message round-trip cycle is long, it takes a long time for the NAK to be sent from the receiving end to the sending end. When the sending end receives the NAK from the receiving end, it has often sent a large number of messages with a PSN greater than the packet loss message. The receiving end will not receive and process these messages, and a large amount of bandwidth will be wasted in order to transmit these messages that will not be received and processed.

[0004] Especially when two hosts are connected via a wide area network, the network quality between the two hosts cannot be guaranteed, and the message round-trip cycle is longer, resulting in more serious bandwidth waste. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a packet loss processing method, gateway and device to reduce the bandwidth wasted when processing packet loss. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a packet loss processing method, which is applied to a first gateway, where the first gateway is located on a transmission path between a first host and a second host, and the method includes:

[0007] Receiving a first message sent by the first host;

[0008] Determining whether packet loss occurs according to the packet sequence number PSN of the first message;

[0009] If it is determined that no packet loss occurs, updating the first receiving PSN to the PSN of the first message, and forwarding the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host;

[0010] If it is determined that packet loss occurs, a first negative acknowledgement NAK is sent to the first host, and the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

[0011] In a second aspect, an embodiment of the present application provides a packet loss processing method, which is applied to a second gateway, where the second gateway is located on a transmission path between a first host and a second host, and the method includes:

[0012] receiving and buffering a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after the first gateway receives the message from the first host and determines according to a PSN of the message that no packet loss occurs;

[0013] Determine whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host;

[0014] If it is determined that packet loss occurs, the seventh message is discarded, and a fourth negative acknowledgement NAK is sent to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and sends a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message whose PSN is greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN;

[0015] If it is determined that no packet loss occurs, the seventh message is forwarded to the second host, and the sending PSN is updated to the PSN of the seventh message.

[0016] In a third aspect, a gateway is provided, wherein the gateway is located as a first gateway on a transmission path between a first host and a second host, and the gateway includes:

[0017] processor;

[0018] Transceiver;

[0019] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompt the processor to perform the following steps:

[0020] Receiving a first message sent by the first host;

[0021] Determining whether packet loss occurs according to the packet sequence number PSN of the first message;

[0022] If it is determined that no packet loss occurs, updating the first receiving PSN to the PSN of the first message, and forwarding the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host;

[0023] If it is determined that packet loss occurs, a first negative acknowledgement NAK is sent to the first host, and the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

[0024] In a fourth aspect, an embodiment of the present application provides a gateway, where the gateway is located on a transmission path between a first host and a second host as a second gateway, and the gateway includes:

[0025] processor;

[0026] Transceiver;

[0027] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompt the processor to perform the following steps:

[0028] receiving and buffering a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after the first gateway receives the message from the first host and determines according to a PSN of the message that no packet loss occurs;

[0029] Determine whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host;

[0030] If it is determined that packet loss occurs, the seventh message is discarded, and a fourth negative acknowledgement NAK is sent to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and sends a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message whose PSN is greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN;

[0031] If it is determined that no packet loss occurs, the seventh message is forwarded to the second host, and the sending PSN is updated to the PSN of the seventh message.

[0032] In a fifth aspect, an embodiment of the present application provides a packet loss processing device, which is applied to a first gateway, where the first gateway is located on a transmission path between a first host and a second host, and the device includes:

[0033] A first message receiving module, used for receiving a first message sent by the first host;

[0034] A first packet loss judgment module, used to judge whether packet loss occurs according to the packet sequence number PSN of the first message;

[0035] A first message forwarding module, configured to update a first received PSN to a PSN of the first message if the first packet loss determination module determines that no packet loss occurs, and forward the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host;

[0036] The first NAK sending module is used to send a first negative acknowledgment NAK to the first host if the first packet loss judgment module determines that packet loss has occurred. The first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

[0037] In a sixth aspect, an embodiment of the present application provides a packet loss processing device, which is applied to a second gateway, where the second gateway is located on a transmission path between a first host and a second host, and the device includes:

[0038] A third message receiving module is used to receive and cache a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after receiving the message from the first host and determining that no packet loss occurs according to a PSN of the message;

[0039] A second packet loss judgment module, used to judge whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host;

[0040] a third NAK sending module, configured to discard the seventh message if the second packet loss judgment module determines that packet loss occurs, and send a fourth negative acknowledgement NAK to the first gateway, so that the first gateway resends the seventh message to the second gateway when determining that the seventh message exists in the cached messages, and send a fifth NAK to the first host when determining that the seventh message does not exist in the cached messages, so that the first host resends a message having a PSN greater than or equal to a PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN;

[0041] The third message forwarding module is used to forward the seventh message to the second host if the second packet loss judgment module determines that no packet loss occurs, and update the sending PSN to the PSN of the seventh message.

[0042] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of the first aspect or the second aspect are implemented.

[0043] In an eighth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the method steps described in the first or second aspect above.

[0044] Beneficial effects of the embodiments of the present application:

[0045] A packet loss processing method provided in an embodiment of the present application is applied to a first gateway between a first host and a second host. After receiving a first message sent by the first host, the first gateway can determine whether packet loss occurs based on the PSN of the first message. If it is determined that packet loss occurs, the first gateway will directly send a first NAK to the first host, so that the first host resends the message. That is, in an embodiment of the present application, packet loss detection can be performed on the first gateway between the first host and the second host, and the timing of packet loss detection is earlier than the method of performing packet loss detection by the second host in the related art. Therefore, the first host can receive the first NAK in advance, thereby promptly discovering the occurrence of packet loss and resending the message as soon as possible. Thereby reducing the number of messages sent by the first host after packet loss that will not be processed by the second host, and reducing the waste of network bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0047] Figure 1 A schematic diagram of a network structure provided in an embodiment of the present application;

[0048] Figure 2 A flowchart of a first packet loss processing method provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of a second packet loss processing method provided in an embodiment of the present application;

[0050] Figure 4 A schematic diagram of a flow chart of a third packet loss processing method provided in an embodiment of the present application;

[0051] Figure 5 A flowchart of a fourth packet loss processing method provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of a processing flow of receiving a message from a first host provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of a processing flow of a first gateway sending a message to a second gateway provided in an embodiment of the present application;

[0054] Figure 8 A flowchart of a fifth packet loss processing method provided in an embodiment of the present application;

[0055] Fig. 9 A flowchart of a sixth packet loss processing method provided in an embodiment of the present application;

[0056] Fig.10 A schematic diagram of a processing flow of receiving a message from a first gateway provided in an embodiment of the present application;

[0057] Fig.11 A schematic diagram of a processing flow of a second gateway sending a message to a second host provided in an embodiment of the present application;

[0058] Fig.12 A schematic diagram of an ACK processing flow provided in an embodiment of the present application;

[0059] Fig.13 A flowchart of a seventh packet loss processing method provided in an embodiment of the present application;

[0060] Fig.14 A schematic diagram of the structure of the first gateway provided in the embodiment of the present application;

[0061] Fig.15 A schematic diagram of the structure of the second gateway provided in the embodiment of the present application;

[0062] Fig.16 A schematic diagram of the structure of a first packet loss processing device provided in an embodiment of the present application;

[0063] Fig.17 A schematic diagram of the structure of a second packet loss processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0065] In the related art, when two hosts transmit messages, if packet loss occurs, the receiving end of the message will send a NAK to the sending end, so that the sending end can resend the message. However, since the network quality between the two hosts cannot be guaranteed, the message round-trip cycle is long, resulting in a long NAK transmission time. A large number of messages have been sent before the sending end receives the NAK, thereby wasting a lot of network bandwidth.

[0066] In order to reflect the difference between the embodiments of the present application and the related art, the solutions of the related art are first described.

[0067] Related technology 1: Use ECN (Explicit Congestion Notification) or PFC (Priority Flow Control) to avoid packet loss. ECN is a mechanism used to alleviate network congestion. After the receiving end detects network congestion, it will notify the sending end to reduce the message sending rate, thereby reducing the message loss rate. PFC can temporarily prevent the sending end from sending messages after network congestion occurs, thereby reducing the message loss rate.

[0068] Related technology 2: Use congestion management mechanism to avoid packet loss. A common congestion management mechanism is DCQCN (Data Center Quantized Congestion Notification), which combines ECN and rate adjustment at the sender to deal with network congestion and packet loss problems.

[0069] That is, in the related technologies 1 and 2, after network congestion occurs, the sending end is controlled to send messages, thereby reducing the packet loss rate of the messages. However, if packet loss actually occurs, the problems mentioned in the above background technology still exist.

[0070] Related technology 3: Encapsulate the message in TCP (Transmission Control Protocol) or other reliable transmission protocols, so as to use the built-in packet loss processing mechanism of TCP or other reliable transmission protocols to deal with the packet loss problem. However, this processing method is relatively complicated and will increase additional delay, which does not meet the requirement of low delay in message transmission.

[0071] In order to solve the above problems, the embodiments of the present application provide a packet loss processing method, a gateway and a device.

[0072] See also Figure 1 , is a schematic diagram of a network structure provided in an embodiment of the present application, which includes a first host, a second host, a first gateway, and a second gateway. The figure also includes a WAN (Wide Area Network), indicating that the first host and the second host are connected via a WAN. It should be noted that Figure 1 This is just one possible situation, and the embodiment of the present application does not limit the connection between the first host and the second host via a wide area network. The two can also be connected via a local area network.

[0073] It should be noted that the first gateway and the second gateway are only named differently to distinguish different gateways, and their functions are the same. Figure 2 The execution subject of the embodiment is Figure 1 When the second host sends a message to the first host, Figure 2 The execution subject of the embodiment is Figure 1 The second gateway is shown.

[0074] See also Figure 2 , which is a flow chart of the first packet loss processing method provided in an embodiment of the present application, including the following steps S201-S204.

[0075] It should be noted that in order to transmit messages, the first host and the second host will pre-negotiate and establish a QP (Queue pair) connection. Multiple QP connections can be established between the first host and the second host, and packet loss processing is performed for each QP connection through the solution provided in the embodiment of the present application.

[0076] In one embodiment of the present application, the above-mentioned message may be an RDMA (Remote Direct Memory Access) message.

[0077] S201: Receive a first message sent by the first host.

[0078] S202: Determine whether packet loss occurs according to the PSN of the first message.

[0079] Specifically, for each established QP connection, the PSN of the messages transmitted between the first host and the second host through the QP connection will increase in steps of 1 starting from the first message in the order of sending. For each QP connection, the first host and the second host will determine the start PSN in the QP during the negotiation phase of establishing the QP, that is, the PSN of the first message.

[0080] In one embodiment of the present application, whether packet loss occurs can be determined by following steps A to C.

[0081] Step A: Determine whether the first message is the first message received by the first gateway from the first host.

[0082] Step B: If it is the first message, when the PSN of the first message is not the starting PSN, it is determined that packet loss occurs.

[0083] The starting PSN is: the PSN of the first message transmitted and designated by the first host and the second host through control message negotiation.

[0084] Step C: If it is not the first message, determine whether packet loss occurs based on the PSN of the first message and the current first received PSN.

[0085] If the first message is not the first message received by the first gateway from the first host, the PSN of the message sent by the first host will be incremented by 1. Therefore, if the PSN of the first message is equal to the current first received PSN+1, it means that no packet loss has occurred. If the PSN of the first message is not equal to the current first received PSN+1, it means that packet loss has occurred.

[0086] In another embodiment of the present application, the first receiving PSN and the starting PSN sent by the first host may be recorded in the QP table. The QP table may define a tagQPListBody (tag QP table data body) data structure, in which the first receiving PSN recorded may be recorded in the uiRcvPSN1 (receiving PSN1) field, and the starting PSN sent by the first host may be recorded in the uiRemoteStartPSN (remote starting PSN) field.

[0087] Specifically, if the first gateway determines that a packet sent by the first host is lost, it means that the packet loss occurs between the first host and the first gateway.

[0088] If no packet loss occurs, step S203 is executed; if packet loss occurs, step S204 is executed.

[0089] S203: Update the first received PSN to the PSN of the first message, and forward the first message to the second gateway.

[0090] The second gateway is located on a transmission path between the first gateway and the second host.

[0091] In the case where no packet loss occurs, the first gateway normally receives the first message sent by the first host, updates the first received PSN to the PSN of the first message received most recently, and according to the message sending order, the first received PSN should be updated to the original first received PSN+1. In the case where no packet loss occurs, the first message is forwarded to the second gateway normally.

[0092] In one embodiment of the present application, if the network bandwidth is large and the quality is good, then in theory, whenever the first gateway receives a first message, it can directly forward the first message to the second gateway after determining that no packet loss occurs. If the network bandwidth is small and the quality is poor, the speed at which the first gateway forwards messages to the second gateway may be lower than the speed at which the messages are received, and the first gateway will cache some messages that have not yet been forwarded. In this case, the first gateway can forward the messages in order from small to large according to the PSN of the cached messages.

[0093] S204: Send a first NAK to the first host, where the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message having a PSN greater than or equal to the first PSN.

[0094] Specifically, as shown in the above step S203, the first received PSN will be updated when no packet loss occurs in the received message, that is, the first received PSN is equal to the PSN of the message received most recently when no packet loss occurs. If packet loss occurs, it means that the message with a PSN greater than the first received PSN has packet loss, so the first PSN of the message with packet loss is the current first received PSN+1.

[0095] The processing method of the first host after receiving the first NAK is similar to the processing method of receiving the NAK from the second host in the related art, and resends the message with a PSN greater than or equal to the above first PSN.

[0096] In one embodiment of the present application, the first gateway may further include a NAK sending flag, and the NAK sending flag has two different values, namely a first value and a second value. The first value indicates that the first NAK has not been sent, and the second value indicates that the first NAK has been sent. For example, the first value is 0, and the second value is 1. The above is only an example, and the present application does not limit the specific values ​​of the first value and the second value, as long as the two are different. Therefore, the initial value of the NAK sending flag can be the first value, and the value of the NAK sending flag can be adjusted to the second value after the first NAK is sent.

[0097] The NAK sending flag may be recorded in the bNackHasSendFlag (NAK sent flag) field in the tagQPListBody data structure.

[0098] In addition, since the first gateway detects packet loss, the first message received by the first gateway is an abnormally received message, and thus the first message may be discarded.

[0099] As can be seen from the above, a packet loss processing method provided in an embodiment of the present application is applied to a first gateway between a first host and a second host. After receiving the first message sent by the first host, the first gateway can determine whether packet loss occurs according to the PSN of the first message. If it is determined that packet loss occurs, the first gateway will directly send a first NAK to the first host, so that the first host resends the message. That is, in an embodiment of the present application, packet loss detection can be performed on the first gateway between the first host and the second host, and the timing of packet loss detection is earlier than the method of performing packet loss detection by the second host in the related art. Therefore, the first host can receive the first NAK in advance, thereby promptly discovering the occurrence of packet loss and resending the message as soon as possible. Thereby reducing the number of messages sent by the first host after packet loss that will not be processed by the second host, and reducing the waste of network bandwidth.

[0100] The embodiment of the present application adds a first gateway for packet loss processing in the network. Compared with related technologies 1 and 2, the solution provided by the embodiment of the present application can actually process packet loss after packet loss occurs, rather than just reducing the possibility of packet loss. Compared with related technology 3, the embodiment of the present application does not rely on TCP or other reliable transmission protocols, and the processing method is relatively simple, which meets the demand for low latency in message transmission.

[0101] See also Figure 3 , is a flow chart of a second packet loss processing method provided in an embodiment of the present application, which is similar to the aforementioned Figure 2 Compared with the embodiment shown, the first gateway caches the message received from the first host when determining that no packet loss occurs.

[0102] In one embodiment of the present application, the messages received by the first gateway from the first host can be mounted in a preset linked list in ascending order of PSN. The first address of the preset linked list can be recorded in the stPacketListHead (message header) field in the tagQPListBody data structure.

[0103] The above method also includes the following steps S301-S304.

[0104] S301: Receive a second NAK sent by a second gateway.

[0105] The second NAK carries the second PSN of the second message where packet loss occurs.

[0106] S302: Determine whether there is a second message in the cached messages.

[0107] In one embodiment of the present application, the first gateway may record the PSN carried in the NAK received from the second gateway. The PSN carried in the NAK may be recorded in the uiNakRcvPsn (NAK received PSN) field in the tagQPListBody data structure.

[0108] Specifically, the second NAK may be sent by the second gateway to the first gateway after the second gateway detects packet loss. In this case, the packet loss occurs between the first gateway and the second gateway. Alternatively, the second host may send a NAK to the second gateway after detecting packet loss. After receiving the NAK, the second gateway may send a second NAK to the first gateway. In this case, the packet loss occurs between the second gateway and the second host. The specific method of sending the second NAK by the second gateway can be found below. Figure 8 The method of sending the fourth NAK in steps S801 to S803 shown in the figure is only different from Figure 8 In the embodiment shown, the fourth NAK is sent, and in this embodiment, the second gateway sends the second NAK. The second NAK and the fourth NAK are only used to distinguish the two NAKs in name, and the two are actually the same, so they will not be described in detail here.

[0109] If the second message exists, step S303 is executed; if the second message does not exist, step S304 is executed.

[0110] S303: Send the second message to the second gateway.

[0111] Since the second message exists in the first gateway, after the second gateway sends the second NAK to the first gateway, the first gateway can directly resend the second message to the second gateway.

[0112] In one embodiment of the present application, a retransmission quantity mark can be configured for each message cached in the first gateway, indicating the number of times the message is retransmitted. The retransmission quantity mark can be called uiRetryCount (retransmission quantity). Before the second message needs to be sent to the second gateway, the retransmission quantity mark can be set to 0, and the forwarding thread of the first gateway will give priority to forwarding the cached message with the retransmission quantity mark of 0. After retransmitting the second message, the retransmission quantity mark corresponding to the second message is increased by 1, so as to count the number of retransmissions of the second message.

[0113] S304: Send a third NAK to the first host, where the PSN carried by the third NAK is the second PSN, so that the first host resends a third message whose PSN is greater than or equal to the second PSN.

[0114] Since the second message does not exist in the first gateway, the first gateway cannot directly resend the second message to the second gateway. In order to resend the second message to the second gateway to solve the packet loss problem, it is necessary to request the second message from the first host. To this end, the first gateway sends a third NAK to the first host, so that the first host resends a third message whose PSN is greater than or equal to the second PSN. The third message contains the second message whose PSN is equal to the second PSN, and other messages whose PSN is greater than the PSN of the second message. After the first gateway receives the third message resent by the first host, it can execute the above Figure 2 In the illustrated embodiment, packet loss detection is performed on the third message, so as to resend the third message including the second message to the second gateway, thereby completing packet loss processing on the second message.

[0115] As can be seen from the above, in the embodiment of the present application, a message is stored in the first gateway. When the first gateway receives the second NAK, it means that the message sent by the first gateway to the second gateway is lost during the transmission process. In this case, if the first gateway stores the second message indicated by the second NAK, the second message stored in itself can be directly fed back to the second gateway without requesting the first host to resend the second message. In this process, the first host does not perform additional processing, so this process is imperceptible to the first host, has no effect on the first host sending the message, and does not occupy the bandwidth of the first host sending the message to the first gateway. And compared with resending the message through the first host, the first gateway can quickly resend the second message to the second gateway through a shorter transmission path after receiving the second NAK, so as to achieve fast packet loss processing and reduce bandwidth waste. And when the second message is not stored in the first gateway, the first gateway can send a third NAK to the first host, so that the first host can still resend the message normally without affecting the normal packet loss processing process. Moreover, the second NAK in the embodiment of the present application may be generated after the second gateway detects packet loss. In this case, even if the first host resends the message, compared with the second host sending NAK to the first host after detecting packet loss in the related art, the data transmission path between the second gateway and the first host in the present application is still shorter than the data transmission path between the second host and the first host in the related art, and the time required for NAK transmission is shorter. Therefore, even if the second message is not cached in the first gateway, the solution provided by the embodiment of the present application can still improve the speed of packet loss processing and reduce bandwidth waste.

[0116] See also Figure 4 , which is a flow chart of the third packet loss processing method provided in an embodiment of the present application, after the above step S304, it also includes the following steps S305-S309.

[0117] S305: Receive a third message.

[0118] S306: Determine whether the third PSN of the third message is less than or equal to the current first received PSN.

[0119] Since the first host sends messages in the order of PSN from small to large, as mentioned above, the first receiving PSN will be updated only when there is no packet loss. Therefore, when there is no packet loss, theoretically, all messages with PSN less than or equal to the first receiving PSN are normally received by the first gateway, and the first gateway should not receive messages with PSN less than or equal to the first receiving PSN again. The reason why the third PSN is less than or equal to the current first receiving PSN may be that the first gateway normally receives the third message with PSN less than or equal to the first receiving PSN, but the third message is lost after being sent by the first gateway, and the first host resends the third message. Or it may be that the first host resends the third message based on other reasons.

[0120] On this basis, if it is determined that the third PSN is less than or equal to the current first received PSN, step S307 is executed; if it is determined that the third PSN is greater than the current first received PSN, the above method is adopted. Figure 2 The embodiment shown is subsequently processed and will not be described in detail here.

[0121] S307: Determine whether the third message has been cached.

[0122] If the third message has been cached in the first gateway, there is no need to cache the third message again, and step S308 is executed. If it is determined that the third message has not been cached, step S309 is executed.

[0123] S308: discard the received third message, and send the cached third message to the second gateway.

[0124] Specifically, the retransmission quantity flag of the cached third message may be updated to 0 to instruct the forwarding thread to give priority to forwarding the third message.

[0125] S309: Cache and send the received third message to the second gateway.

[0126] After receiving the third message whose third PSN is less than or equal to the current first received PSN, the first received PSN will not be updated.

[0127] As can be seen from the above, in the embodiment of the present application, after receiving the third message whose third PSN is less than or equal to the current first receiving PSN, different processing can be performed according to whether the third message is stored in the first gateway.

[0128] In another embodiment of the present application, in the aforementioned Figure 3 Based on the embodiment shown, the following steps D-E are also included.

[0129] Step D: Receive the first ACK (Acknowledge) sent by the second gateway.

[0130] The first ACK is sent after the second gateway determines that the fourth message is not lost, and carries the fourth PSN of the fourth message.

[0131] Step E: Delete the cached fourth message.

[0132] The first gateway receiving the first ACK indicates that the second gateway determines that the fourth message has not been lost. In this case, the first gateway most likely does not need to resend the fourth message to the second gateway, so the fourth message may no longer be stored, saving storage space of the first gateway.

[0133] The specific manner in which the second gateway feeds back ACK to the first gateway can be referred to step I below. The only difference is that in this embodiment, the second gateway sends the first ACK, while in step I, the second gateway sends the sixth ACK. The two differ only in name and are not described in detail here.

[0134] In another embodiment of the present application, the above method further includes the following steps F1 to F5.

[0135] Step F1: Send a fifth message to the second gateway.

[0136] Step F2: Determine whether the second ACK fed back by the second gateway is received within the first preset time period.

[0137] The second ACK is sent after the second gateway determines that the fifth message is not lost, and carries the PSN of the fifth message.

[0138] Specifically, after sending the fifth message to the second gateway, the first gateway records the sending time of the message. If the second ACK fed back by the second gateway is not received after the difference between the current time and the sending time reaches the first preset time length, it is determined that the second ACK fed back by the second gateway is not received within the first preset time length. Execute step F3, otherwise, the process can be performed according to steps D to E shown above.

[0139] Step F3: If it is determined that the second ACK is not received, determining whether the number of times the fifth message is resent reaches a first preset number;

[0140] In one embodiment of the present application, when the retransmission quantity mark corresponding to the fifth message reaches the first preset number of times, it is determined that the number of times the fifth message is retransmitted reaches the first preset number of times.

[0141] If the number of times the fifth message is resent reaches the first preset number, it means that the fifth message is still not sent normally after being resent for many times. In this case, the network quality may be too poor, or there is an error in the fifth message itself. In this case, if the fifth message is continued to be resent, the possibility of successful resending of the fifth message is low. Therefore, the first gateway can give up resending the fifth message and execute step F5 to avoid the additional waste of message processing resources of the first gateway caused by continuing to resend the fifth message, and save the storage resources of the first gateway. On the contrary, if the number of times the fifth message is resent does not reach the first preset number, you can continue to try to resend the fifth message and execute step F4.

[0142] Step F4: Resend the cached fifth message to the second gateway.

[0143] Since the second gateway will feedback the second ACK for the fifth message to the first gateway if it determines that it has received the fifth message normally, if the second ACK feedback from the second gateway is not received after the first preset time, it can be explained that the second gateway may not have received the fifth message normally after a long time, and packet loss may have occurred. In this case, the first gateway can actively resend the fifth message to the second gateway, thereby dealing with the possible packet loss problem.

[0144] In one embodiment of the present application, the fifth message is resent to the second gateway, and the retransmission quantity flag corresponding to the fifth message is increased by 1. Return to execute step F2.

[0145] Step F5: If it is determined that the first preset number of times is reached, the cached fifth message is deleted.

[0146] In another embodiment of the present application, the above method also includes the following steps G1-G3.

[0147] Step G1: Receive the first ACK sent by the second gateway.

[0148] Step G2: Determine whether there is a sixth message whose PSN is smaller than the fourth PSN and for which no ACK carrying the PSN of the message is received.

[0149] Since the first gateway will theoretically send messages to the second gateway in the order of PSN from small to large, if there is no packet loss, the second gateway will receive the messages in the order of the PSNs carried from small to large, and send ACKs to the first gateway in this order. The first gateway should also receive the ACKs sent by the second gateway in the order of the PSNs carried from small to large.

[0150] Therefore, if the first gateway receives the above-mentioned first ACK, it means that the second gateway determines that the fourth message whose PSN is the fourth PSN has not been lost. In the case of no packet loss, the first gateway will receive ACKs in order from small to large according to the PSNs carried. Then, in the case of receiving the first ACK, the ACKs corresponding to messages whose PSN is less than the fourth PSN should have been received by the first gateway. On the contrary, if there is a sixth message whose PSN is less than the above-mentioned fourth PSN and the ACK of the PSN carrying the message is not received, it means that the sixth message may have been lost. In this case, step G3 can be executed to resend the above-mentioned sixth message. If there is no sixth message, no subsequent processing is performed.

[0151] Step G3: Resend the sixth message.

[0152] After the sixth message is resent, the time of resending may be recorded, and the resending quantity mark corresponding to the sixth message may be increased by 1.

[0153] From the above, it can be seen that in the embodiment of the present application, after receiving the first ACK, the first gateway can determine whether there is a sixth message whose corresponding ACK has not been received. If so, it means that the sixth message may have been lost. In the present application, the first gateway can actively resend the sixth message, thereby promptly handling the problem of packet loss.

[0154] See also Figure 5 , is a flow chart of a fourth packet loss processing method provided in an embodiment of the present application, which is similar to the aforementioned Figure 2 Compared with the embodiment shown, if it is determined that packet loss occurs, the following step S205 is also included after the above step S204.

[0155] S205: Before receiving a message whose PSN is the first PSN, discard the received message whose PSN is greater than the first PSN.

[0156] After packet loss occurs, after the first gateway sends the first NAK carrying the first PSN to the first host, the first host will resend a message with a PSN greater than or equal to the first PSN to the first gateway. However, since it takes a certain amount of time for the first NAK to be sent from the first gateway to the first host, during this period the first gateway will continue to send messages in order of PSN from small to large. Therefore, the first gateway may receive other messages with PSN greater than the first PSN that are continued to be sent by the first host after packet loss occurs. Since such messages are received after packet loss occurs, the first gateway does not process them, but discards the received messages.

[0157] In addition, as described above, the NAK sending flag may be maintained in the first gateway, and the value of the NAK sending flag may be adjusted to a second value after the first gateway sends the first NAK.

[0158] When the value of the NAK sending flag is the second value, the received message with a PSN greater than the first PSN will be discarded before the message with a PSN equal to the first PSN is received.

[0159] As can be seen from the above, in the embodiment of the present application, the first gateway will discard the message received during the packet loss processing, thereby avoiding the occurrence of out-of-order failures in the message transmission process.

[0160] In another embodiment of the present application, if it is determined that no packet loss occurs, the above method further includes the following step H.

[0161] Step H: If all messages belonging to the same message are received normally, a third ACK is sent to the first host.

[0162] The PSN carried in the third ACK is the PSN of the last message in the message.

[0163] Specifically, the messages form a message, and the messages corresponding to some types of messages are composed of one message, and the messages corresponding to other types of messages are composed of multiple messages. When the message sent by the first host is an RDMA message, there are roughly more than 30 types of RDMA messages sent by the first host, and one or more RDMA messages can form a message.

[0164] The first identifier may be carried in multiple messages belonging to the same message, and different values ​​of the first identifier respectively indicate that the message is the first message in the message, the message is the last message in the message, and the message is other messages in the message except the first message and the last message. For example, the value of the first identifier is 0, which indicates that the message is the first message in the message, the value of the first identifier is 1, which indicates that the message is the last message in the message, and the value of the first identifier is 2, which indicates that the message is other messages in the message except the first message and the last message. The first gateway can determine whether the message is the last message in the message according to the value of the first identifier in the message. Since the first host sends messages in the order from front to back in the message, if the first gateway successfully receives the last message in the message, then theoretically all messages in the message should be received normally. Therefore, after receiving the last message in the message, a third ACK can be sent to the first host to notify the first host that all messages in the message are received normally and no packet loss occurs.

[0165] Furthermore, in this case, if the NAK sending flag is maintained in the first gateway, if the current value of the NAK sending flag is the second value, the value of the NAK sending flag is adjusted to the first value after the first gateway sends the third ACK.

[0166] As can be seen from the above, in the embodiment of the present application, after the first gateway normally receives all the messages in the same message, it will send a third ACK to the first host, so that the first host can determine that all the messages in the message are received normally and there is no need to resend the messages in the message.

[0167] Below through Figure 6 The illustrated embodiment uniformly describes the processing flow after the first gateway receives a message sent by the first host.

[0168] See also Figure 6 , is a schematic diagram of a processing flow of receiving a message from a first host provided in an embodiment of the present application. In this embodiment, the first value of the bNackHasSendFlag field is false, and the second value is true.

[0169] The specific process is: receiving a message from the first host.

[0170] Check if the bNackHasSendFlag field is true.

[0171] If the bNackHasSendFlag field is true, check whether the PSN of the message is uiRcvPSN1+1.

[0172] If it is uiRcvPSN1+1, set the bNackHasSendFlag field to false, cache the message, and continue execution. Figure 6 The subsequent steps are shown in the following description.

[0173] If it is not uiRcvPSN1+1, the message is discarded and the process ends.

[0174] If the bNackHasSendFlag field is not true, check the PSN and uiRcvPSN1 of the message to determine whether the packet is lost.

[0175] If the packet is lost, the message is discarded, the bNackHasSendFlag field is configured to true, and a NAK with a PSN of uiRcvPSN1+1 is sent to the first host.

[0176] If there is no packet loss, uiRcvPSN1 is updated and the message is cached. It is determined whether the message is the last message in the message. If not, the process ends. If yes, an ACK with the PSN of the message is sent to the first host.

[0177] pass Figure 7 The illustrated embodiment uniformly describes the processing flow of a first gateway sending a message to a second gateway.

[0178] See also Figure 7 , is a schematic diagram of a processing flow of a first gateway sending a message to a second gateway provided in an embodiment of the present application, and the processing flow is specifically executed by a forwarding thread in the first gateway.

[0179] When the linked list of cached messages is not empty, all cached messages are checked in a round-robin manner.

[0180] Determine whether the uiRetryCount corresponding to the message is 0.

[0181] If it is 0, send the message, record the time of sending the packet, and increase uiRetryCount by 1.

[0182] If it is not 0, it is determined whether the uiRetryCount of the message reaches the first preset number.

[0183] If the first preset number of times is reached, the message is deleted.

[0184] If the first preset number of times is not reached, it is determined whether a second ACK fed back by the second gateway is not received for more than a first preset time period.

[0185] If the second ACK is not received, the message is sent, the packet sending time is recorded, and uiRetryCount+1 is added.

[0186] If the second ACK is received, when the linked list of cached messages is not empty, all cached messages are checked in a poll.

[0187] The above process is a packet loss processing process of the first gateway in the process of the first host sending a message to the second host. The following describes the packet loss processing process of the second gateway in the process of the first host sending a message to the second host.

[0188] See also Figure 8 , which is a flow chart of the fifth packet loss processing method provided in an embodiment of the present application, including the following steps S801-S804.

[0189] S801: Receive and buffer a message sent by a first gateway.

[0190] The first gateway is located on the transmission path between the second gateway and the first host, and the message is sent by the first gateway after receiving it from the first host and determining that no packet loss occurs according to the PSN of the message.

[0191] S802: Determine whether packet loss occurs based on the PSN of the seventh message to be sent and the current sending PSN.

[0192] The sending PSN is the PSN of the message most recently sent to the second host.

[0193] In one embodiment of the present application, when the second gateway processes the seventh message sent by the first gateway, a packet loss detection is performed before forwarding the seventh message to the second host.

[0194] In theory, the first host will send messages in order of PSN from small to large, and the absolute value of the difference between the PSNs of adjacent messages sent is 1. Therefore, if there is no packet loss, the message is forwarded from the first host to the second gateway via the first gateway, and the absolute value of the difference between the PSNs of adjacent messages sent by the first gateway received by the second gateway should also be 1. Then, when the second gateway sends messages to the second host in the order in which the messages are received, the absolute value of the difference between the PSNs of adjacent messages sent should also be 1.

[0195] Therefore, if the PSN of the seventh message to be sent is equal to the current sending PSN+1, it means that no packet loss has occurred. Otherwise, it means that packet loss has occurred. The above packet loss occurs between the second gateway and the first gateway.

[0196] In one embodiment of the present application, the above-mentioned send PSN may be recorded in the uiSendPSN (send PSN) field in the tagQPListBody data structure.

[0197] If it is determined that packet loss occurs, step S803 is executed; if it is determined that packet loss does not occur, step S804 is executed.

[0198] S803: discard the seventh message, and send the fourth NAK to the first gateway, so that when the first gateway determines that the seventh message exists in the cached messages, the first gateway resends the seventh message to the second gateway, and when it determines that the seventh message does not exist in the cached messages, sends the fifth NAK to the first host, so that the first host resends the message whose PSN is greater than or equal to the PSN carried by the fifth NAK.

[0199] The fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN.

[0200] Specifically, the PSN sent is the PSN of the message that was most recently sent to the second host. The PSN of the next message that should be sent to the second host should be the current PSN+1. The PSN of the message that is currently lost is the current PSN+1. Therefore, this message is lost and needs to be resent. Therefore, the PSN carried by the fourth NAK is the current PSN+1 to instruct the first gateway to resend the message. The way the first gateway resends the message can be found above. Figure 3 The embodiments shown will not be described in detail here.

[0201] S804: Forward the seventh message to the second host, and update the sending PSN to the PSN of the seventh message.

[0202] After the seventh message is forwarded to the second host normally, the message forwarded most recently is the seventh message, so the sending PSN needs to be updated to the PSN of the seventh message. In fact, according to the sending order of the messages, the sending PSN is updated to the original sending PSN+1.

[0203] As can be seen from the above, in the solution provided by the embodiment of the present application, in the process of the first host sending a message to the second host, the second gateway will perform packet loss detection after receiving the message sent by the first gateway and before sending the seventh message to the second host. If packet loss occurs, the second gateway will send the fourth NAK to the first gateway to perform packet loss processing. That is, in the embodiment of the present application, before the message is sent to the second host, the second gateway can perform packet loss processing on the message sent by the first host in advance. Since the timing of packet loss processing is advanced, the second gateway can respond in advance after packet loss occurs, reducing the waste of network bandwidth.

[0204] In another embodiment of the present application, the second gateway further performs the following step I after performing step S801.

[0205] Step I: Send a sixth ACK to the first gateway.

[0206] The PSN carried in the sixth ACK is the PSN of the received message.

[0207] That is, whenever the second gateway receives a message sent by the first gateway, it feeds back the sixth ACK corresponding to the message to the first gateway, so as to inform the first gateway that it has successfully received the message.

[0208] See also Fig. 9 , which is a flow chart of the sixth packet loss processing method provided in an embodiment of the present application, including the following steps S901-S904.

[0209] S901: Receive the sixth NAK sent by the second host after determining that packet loss occurs.

[0210] The fifth PSN carried by the sixth NAK is: the PSN of the eighth message with the smallest PSN among the messages that have been lost.

[0211] For example, if the second host receives a message with PSN 1 and then receives a message with PSN 4, it can be determined that messages with PSNs 2 and 3 are lost. In this case, the eighth message is the message with the smallest PSN among the messages that are lost, that is, the message with PSN 2.

[0212] S902: Determine whether the eighth message exists in the cached messages.

[0213] If the second gateway determines that the eighth message exists, step S903 is executed; if the second gateway determines that the eighth message does not exist, step S904 is executed.

[0214] S903: Send a message whose cached PSN is greater than or equal to the fifth PSN to the second host.

[0215] When the eighth message is stored in the second gateway, the second gateway simulates the processing method of the first host after receiving the NAK sent by the second host in the related art, and sends a message whose cached PSN is greater than or equal to the fifth PSN to the second host. For the second host, the resent message finally received is the same as that in the related art, and the second host is unaware of this process.

[0216] In one embodiment of the present application, the second gateway may set the retransmission quantity flag corresponding to the stored messages whose PSN is greater than or equal to the fifth PSN to 0, so that the forwarding thread in the second gateway preferentially forwards the above messages.

[0217] During the retransmission process, the second gateway sequentially sends the cached messages whose PSNs are greater than or equal to the fifth PSN in order from small to large.

[0218] In one possible case, the fifth PSN is 2, and the second gateway stores messages with PSNs of 2-5 respectively. In this case, the second gateway sends messages with PSNs of 2, 3, 4, and 5 to the second host in sequence.

[0219] In another possible case, the fifth PSN is 2, and the second gateway stores the messages with PSNs 2, 4, and 5, respectively. In this case, the second gateway sends the messages with PSNs 2, 4, and 5 to the second host in sequence. The second host first receives the message with PSN=2, determines that the message with packet loss is resent, and then receives the message with PSN 4, determines that the message with PSN 3 is lost, and sends the NAK carrying PSN=3 to the second gateway. The second gateway executes again Fig. 9 In the illustrated embodiment, packet loss processing is performed.

[0220] S904: Send a NAK carrying the fifth PSN to the first gateway.

[0221] If the eighth message is not stored in the second gateway, the second gateway cannot execute step S903 to directly resend the message to the second host, and sends a NAK carrying the fifth PSN to the first gateway, so that the first gateway adopts the same method as in the above text. Figure 3 The illustrated embodiment performs message retransmission in a similar manner.

[0222] In addition, the second gateway does not store the eighth message, but may store other messages whose PSN is greater than or equal to the fifth PSN. In this case, the second gateway may send other messages whose stored PSN is greater than or equal to the fifth PSN to the second host. Specifically, the retransmission quantity flag corresponding to other messages whose stored PSN is greater than or equal to the fifth PSN may be set to 0, so that the forwarding thread in the second gateway gives priority to forwarding the above messages.

[0223] As can be seen from the above, in the solution provided by the embodiment of the present application, the second gateway can resend the message to the second host after the second host detects the packet loss, thereby completing the packet loss processing process. Compared with the solution of the first host resending the message to the second host in the related art, the transmission link length between the second gateway and the second host in the embodiment of the present application is significantly smaller, so the packet loss processing process can be completed quickly between the second gateway and the second host, thereby reducing the waste of network bandwidth. Even if the eighth message is not stored in the second gateway, the second gateway can send NAK to the first gateway, and the first gateway continues to complete the packet loss processing process.

[0224] In another embodiment of the present application, after step S901, the second gateway further performs the following step J.

[0225] Step J: discard the subsequently received messages whose PSN is smaller than the fifth PSN.

[0226] In one embodiment of the present application, after receiving the sixth NAK, the second gateway may further record the fifth PSN in the sixth NAK. The fifth PSN may be recorded in the uiNakRcvPsn field described above.

[0227] After receiving the message subsequently, the second gateway may compare the PSN of the message with the recorded fifth PSN, and if the PSN is smaller than the fifth PSN, the message is discarded.

[0228] Under normal circumstances, the second host will receive messages in the order of PSN increasing by 1 from small to large. If it detects that the PSN is out of order, it will determine that packet loss has occurred, and will then send the fifth NAK to the second gateway, and stop receiving messages before receiving the retransmitted eighth message. Therefore, the second host will not send the fifth NAK when receiving messages in order normally, and will only send the fifth NAK after detecting that the eighth message is lost. Therefore, when the second gateway receives the fifth NAK, it can determine that the second host has successfully received other messages whose PSN is smaller than the fifth PSN and whose sending order is before the eighth message, so it does not send NAK for such messages. Therefore, when the second gateway receives the fifth NAK, it can subsequently discard the messages that have been successfully received and whose PSN is smaller than the fifth PSN, and will no longer cache them.

[0229] In addition, the second gateway may also delete cached messages whose PSN is smaller than the fifth PSN to save storage space.

[0230] In another embodiment of the present application, the above step S801 can be implemented by the following steps K1 to K4.

[0231] Step K1: Receive a message sent by the first gateway.

[0232] Step K2: Determine whether the PSN of the message is less than or equal to the current second receiving PSN.

[0233] The second received PSN is the PSN of the message with the largest PSN received from the first gateway before receiving the message.

[0234] If it is determined that the PSN of the message is less than or equal to the current second received PSN, step K3 is executed; otherwise, step K4 is executed.

[0235] Step K3: Determine whether the message has been cached. If it has been cached, discard the received message. If it has not been cached, cache the message.

[0236] Since messages are normally sent in ascending order of PSN, the PSN of the message received by the second gateway from the first gateway each time should be greater than the PSN of the message with the largest PSN received from the first gateway before receiving the message, that is, the second received PSN. If the PSN of the message received from the first gateway is less than or equal to the second received PSN, it means that the order in which the second gateway receives the messages may be out of order, and the second gateway may have previously received and cached the message from the first gateway.

[0237] Therefore, if the second gateway has cached the message, there is no need to cache it again, and the received message can be discarded. Otherwise, the message is cached.

[0238] Regardless of whether the message has been cached, the second gateway executes the above-mentioned Figure 8 In the embodiment shown, packet loss processing is performed. If the message has been cached, the cached message can be used to replace the received message for packet loss processing. If the message is not cached, the received message is directly subjected to packet loss processing.

[0239] In addition, the PSN of the message is less than or equal to the current second receiving PSN. In this case, the recorded second receiving PSN is not updated after receiving the message.

[0240] In another embodiment of the present application, the second receiving PSN may be recorded in the uiRcvPSN2 (receiving PSN2) field in the tagQPListBody data structure.

[0241] Step K4: Cache the message and update the second received PSN to the PSN of the message.

[0242] If the PSN of the message is greater than the current second received PSN, it means that the PSN of the message is greater than the PSN of the message with the largest PSN received from the first gateway before receiving the message, that is, the second gateway has not received the message before, so the message is directly cached and the second received PSN is updated.

[0243] In another embodiment of the present application, the above method also includes the following steps L1-L2.

[0244] Step L1: Receive the fourth ACK sent by the second host.

[0245] The fourth ACK is sent after the second host normally receives all messages included in the first message, and the PSN carried by the fourth ACK is the PSN of the last message in the first message.

[0246] Step L2: Delete the message included in the cached first message.

[0247] Each time the second host receives a complete message, it will send an ACK to the second gateway. The second gateway receives the fourth ACK, which indicates that the second host has received all the messages in the first message normally, and the PSN of the last message in the first message is the PSN carried by the fourth ACK. In theory, the second gateway does not need to resend all the messages in the first message that it has received normally to the second host, so it can delete them from the cached messages.

[0248] As described above, the PSNs of the messages belonging to the same message are continuous PSNs, and the value of the first identifier of the last message in a message is different from the first identifier values ​​of other messages in the message. Therefore, the second gateway can delete the messages with adjacent PSNs in descending order, starting from the message corresponding to the PSN carried by the cached fourth ACK, until the value of the first identifier of the deleted message indicates that the message is the first message in the message.

[0249] Alternatively, starting from the message corresponding to the PSN carried by the cached fourth ACK, the messages with adjacent PSNs are determined in order from large to small, until the value of the first identifier of the determined message indicates that the message is the first message in the message, and finally all the determined messages are deleted.

[0250] Furthermore, the second gateway may store the messages belonging to the same message together when caching the messages, and may directly delete the messages together when deleting the messages.

[0251] In addition, the second gateway may record the PSN carried in the fourth ACK after receiving the fourth ACK. Specifically, it may be recorded in the uiAckRcvPsn (acknowledgement of receiving PSN) field in the tagQPListBody data structure.

[0252] As can be seen from the above, in the solution provided in the embodiment of the present application, when the second gateway receives the fourth ACK for the first message, it can delete the cached message included in the first message, thereby saving the storage space of the second gateway.

[0253] In another embodiment of the present application, the above method further includes the following steps M1 to M5.

[0254] Step M1: Send a ninth message to the second host.

[0255] Specifically, after sending the ninth message to the second host, the second gateway will record the time when the message is sent.

[0256] Step M2: Determine whether the fifth ACK fed back by the second host is received within a second preset time period.

[0257] The fifth ACK is sent after the second host normally receives all messages in the message containing the ninth message.

[0258] If it is determined that the fifth ACK is not received, step M3 is executed.

[0259] If the fifth ACK fed back by the second host is not received after a second preset time period has passed since the ninth message was sent, the ninth message is resent to the second host, and the retransmission quantity mark corresponding to the ninth message is increased by 1.

[0260] Since the second host will feedback the fifth ACK to the second gateway if it determines that it has received all the messages in the message containing the ninth message normally, if the fifth ACK feedback from the second host is not received within the second preset time, the second host may not have received the ninth message normally after a long time, and packet loss may have occurred. In this case, the second gateway can actively resend the ninth message to the second host, thereby dealing with the possible packet loss problem.

[0261] Step M3: Determine whether the number of times of resending the ninth message reaches a second preset number.

[0262] If the number of times the ninth message is resent reaches the second preset number, it means that the ninth message is still not sent normally after being resent for many times. In this case, it may be that the network quality is too poor, or there is an error in the ninth message itself. In this case, if the ninth message is continued to be resent, the possibility of successful resending of the ninth message is low. Therefore, the second gateway can give up resending the ninth message and execute step M5. If the number of times the ninth message is resent does not reach the second preset number, step M4 is executed.

[0263] Specifically, if the retransmission quantity mark corresponding to the ninth message does not reach the second preset number of times, it is determined that the number of times the ninth message is retransmitted does not reach the second preset number of times. If the retransmission quantity mark corresponding to the ninth message reaches the second preset number of times, it is determined that the number of times the ninth message is retransmitted reaches the second preset number of times.

[0264] If it is determined that the second preset number of times has not been reached, step M4 is executed. If it is determined that the second preset number of times has been reached, step M5 is executed.

[0265] Step M4: resending the cached ninth message to the second host.

[0266] Return to execute the above step M2.

[0267] Step M5: Delete the cached ninth message.

[0268] Deleting the cached ninth message can avoid additional waste of message processing resources of the second gateway caused by continuing to resend the ninth message, and save storage resources of the second gateway.

[0269] It should be noted that, when a message includes multiple messages, for each message in the same message, steps M1 to M5 are executed separately in this application to perform the above processing separately.

[0270] In addition, in combination with the above embodiments, the tagQPListBody data structure in the present application is defined as follows. According to the requirements of different embodiments, the tagQPListBody data structure actually used may include at least one field in the definition:

[0271] typedef struct tagQpListBody{

[0272] uint32_t uiRemoteStartPsn;

[0273] uint32_t uiRcvPSN1;

[0274] uint32_t uiRcvPSN2;

[0275] uint32_t uiSendPSN;

[0276] uint32_t uiAckRcvPsn;

[0277] uint32_t uiNakRcvPsn;

[0278] bool bNackHasSendFlag;

[0279] PACKET_LIST_Head_S stPacketListHead;

[0280] };

[0281] Below through Fig.10 The illustrated embodiment uniformly describes the processing flow after the second gateway receives the message sent by the first gateway.

[0282] See also Fig.10 , is a schematic diagram of a processing flow for receiving a message from a first gateway provided in an embodiment of the present application.

[0283] The specific process is: receiving a message from the first gateway.

[0284] Check whether the PSN of the message is less than uiNakRcvPsn.

[0285] If it is less, the message is discarded and the process ends.

[0286] If not, cache the message and update uiRcvPSN2. Reply to the first gateway with an ACK of the PSN carrying the message.

[0287] pass Fig.11 The illustrated embodiment uniformly describes the processing flow of the second gateway sending a message to the second host.

[0288] See also Fig.11 , is a schematic diagram of a processing flow of a second gateway sending a message to a second host provided in an embodiment of the present application, and the processing flow is specifically executed by a forwarding thread in the second gateway.

[0289] When the linked list of cached messages is not empty, all cached messages are checked in a round-robin manner.

[0290] Check the PSN and uiSendPSN of the message to be sent to determine whether the packet is lost.

[0291] If the packet is lost, a NAK is sent to the first gateway.

[0292] If there is no packet loss, determine whether the uiRetryCount corresponding to the message to be sent is 0.

[0293] If it is 0, update uiSendPSN, send the message, record the time of sending the packet, and increase the uiRetryCount corresponding to the message by 1.

[0294] If it is not 0, it is determined whether the uiRetryCount corresponding to the message reaches the second preset number.

[0295] If the second preset number of times is reached, the cached message is deleted.

[0296] If the second preset number of times is not reached, it is determined whether the fifth ACK fed back by the second host is not received for more than a second preset time period.

[0297] If the fifth ACK is not received, the message is sent, the packet sending time is recorded, and the uiRetryCount corresponding to the message is increased by 1.

[0298] If the fifth ACK is received, when the linked list of cached messages is not empty, all cached messages are checked in a poll.

[0299] The following describes the processing flow when the second gateway receives ACK.

[0300] See also Fig.12 , is a schematic diagram of an ACK processing flow provided in an embodiment of the present application.

[0301] The left side of the dotted line in the figure is the processing flow when the first gateway receives the ACK sent by the second gateway.

[0302] The specific process is as follows: Receive ACK. Search the cache for a message whose PSN is less than or equal to the PSN carried in the ACK. If the PSN of the cached message is equal to the PSN in the ACK, delete the cached message. If the PSN of the cached message is less than the PSN in the ACK, set the uiRetryCount corresponding to the message to 0 and resend the message.

[0303] The right side of the dotted line in the figure is the processing flow when the second gateway receives the ACK sent by the second host.

[0304] The specific process is: receive ACK, search the cache for the message indicated by ACK, update uiAckRcvPsn to the PSN carried by the ACK, and delete the message in the cache.

[0305] The following is a detailed description of the processing flow of the second gateway, the first gateway, and the first host after the second gateway receives the NAK sent by the second host.

[0306] See also Fig.13 , which is a flow chart of the seventh packet loss processing method provided in an embodiment of the present application.

[0307] The dotted line in the figure will Fig.13 It is divided into three areas, and the three areas respectively record the processing flow of the second gateway, the first gateway and the first host.

[0308] The specific processing flow of the second gateway is as follows: Receive NAK. Determine whether there is a message corresponding to the PSN in the NAK in the cache. If so, set the uiRetryCount of the message whose PSN is greater than or equal to the PSN in the NAK to 0 and resend the above message. If not, send NAK to the first gateway. The PSN in the sent NAK is the same as the PSN in the received NAK.

[0309] The specific processing flow of the first gateway is: determine whether there is a message corresponding to the PSN in the NAK in the cache. If so, set the uiRetryCount of the message whose PSN is equal to the PSN in the NAK to 0 and resend the message. If not, send a NAK to the first host. The PSN in the sent NAK is the same as the PSN in the received NAK.

[0310] The specific processing flow of the first host is: starting from the message corresponding to the PSN in the NAK, resending the message whose PSN is greater than or equal to the PSN in the NAK.

[0311] Corresponding to the aforementioned packet loss processing method applied to the first gateway, the embodiment of the present application also provides a gateway.

[0312] See also Fig.14, is a schematic diagram of the structure of the first gateway provided in an embodiment of the present application. The above-mentioned gateway is a first gateway, located on the transmission path between the first host and the second host, and the gateway includes:

[0313] Processor 1401;

[0314] transceiver 1404;

[0315] A machine-readable storage medium 1402, wherein the machine-readable storage medium 1402 stores machine-executable instructions that can be executed by the processor 1401; the machine-executable instructions prompt the processor 1401 to perform the following steps:

[0316] Receiving a first message sent by the first host;

[0317] Determining whether packet loss occurs according to the packet sequence number PSN of the first message;

[0318] If it is determined that no packet loss occurs, updating the first receiving PSN to the PSN of the first message, and forwarding the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host;

[0319] If it is determined that packet loss occurs, a first negative acknowledgement NAK is sent to the first host, and the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

[0320] like Fig.14 As shown, the network device may further include a communication bus 1403. The processor 1401, the machine-readable storage medium 1402, and the transceiver 1404 communicate with each other through the communication bus 1403. The communication bus 1403 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1403 may be divided into an address bus, a data bus, a control bus, and the like.

[0321] The transceiver 1404 may be a wireless communication module. Under the control of the processor 1401 , the transceiver 1404 exchanges data with other devices.

[0322] The machine-readable storage medium 1402 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. In addition, the machine-readable storage medium 1402 may also be at least one storage device located away from the aforementioned processor.

[0323] Processor 1401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0324] As can be seen from the above, a packet loss processing method provided in an embodiment of the present application is applied to a first gateway between a first host and a second host. After receiving the first message sent by the first host, the first gateway can determine whether packet loss occurs according to the PSN of the first message. If it is determined that packet loss occurs, the first gateway will directly send a first NAK to the first host, so that the first host resends the message. That is, in an embodiment of the present application, packet loss detection can be performed on the first gateway between the first host and the second host, and the timing of packet loss detection is earlier than the method of performing packet loss detection by the second host in the related art. Therefore, the first host can receive the first NAK in advance, thereby promptly discovering the occurrence of packet loss and resending the message as soon as possible. Thereby reducing the number of messages sent by the first host after packet loss that will not be processed by the second host, and reducing the waste of network bandwidth.

[0325] In one embodiment of the present application, when it is determined that no packet loss occurs, the message received from the first host is cached, and the machine executable instructions further cause the processor to perform the following steps:

[0326] receiving a second NAK sent by the second gateway, where the second NAK carries a second PSN of a second message in which packet loss occurs;

[0327] Determining whether a second message exists in the cached messages;

[0328] If it is determined that the second message exists, sending the second message to the second gateway;

[0329] If it is determined that the second message does not exist, a third NAK is sent to the first host, and the PSN carried by the third NAK is the second PSN, so that the first host resends a third message whose PSN is greater than or equal to the second PSN.

[0330] As can be seen from the above, in the embodiment of the present application, a message is stored in the first gateway. When the first gateway receives the second NAK, it means that the message sent by the first gateway to the second gateway is lost during the transmission process. In this case, if the first gateway stores the second message indicated by the second NAK, the second message stored in itself can be directly fed back to the second gateway without requesting the first host to resend the second message. In this process, the first host does not perform additional processing, so this process is imperceptible to the first host, has no effect on the first host sending the message, and does not occupy the bandwidth of the first host sending the message to the first gateway. And compared with resending the message through the first host, the first gateway can quickly resend the second message to the second gateway through a shorter transmission path after receiving the second NAK, so as to achieve fast packet loss processing and reduce bandwidth waste. And when the second message is not stored in the first gateway, the first gateway can send a third NAK to the first host, so that the first host can still resend the message normally without affecting the normal packet loss processing process. Moreover, the second NAK in the embodiment of the present application may be generated after the second gateway detects packet loss. In this case, even if the first host resends the message, compared with the second host sending NAK to the first host after detecting packet loss in the related art, the data transmission path between the second gateway and the first host in the present application is still shorter than the data transmission path between the second host and the first host in the related art, and the time required for NAK transmission is shorter. Therefore, even if the second message is not cached in the first gateway, the solution provided by the embodiment of the present application can still improve the speed of packet loss processing and reduce bandwidth waste.

[0331] In one embodiment of the present application, after sending the third NAK to the first host, the machine executable instructions further cause the processor to perform the following steps:

[0332] receiving a third message;

[0333] Determine whether the third PSN of the third message is less than or equal to the current first receiving PSN;

[0334] If it is determined that the third PSN is less than or equal to the current first received PSN, determining whether the third message has been cached;

[0335] If it is determined that the third message has been cached, discarding the received third message, and sending the cached third message to the second gateway;

[0336] If it is determined that the third message is not cached, the received third message is cached and sent to the second gateway.

[0337] As can be seen from the above, in the embodiment of the present application, after receiving the third message whose third PSN is less than or equal to the current first receiving PSN, different processing can be performed according to whether the third message is stored in the first gateway.

[0338] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0339] receiving a first confirmation ACK sent by the second gateway, wherein the first ACK is sent by the second gateway after determining that the fourth message is not lost, and carries a fourth PSN of the fourth message;

[0340] The cached fourth message is deleted.

[0341] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0342] Sending a fifth message to the second gateway;

[0343] Determine whether a second ACK fed back by the second gateway is received within a first preset time period, wherein the second ACK is sent by the second gateway after determining that the fifth message is not lost, and carries the PSN of the fifth message;

[0344] If it is determined that the second ACK is not received, determining whether the number of times the fifth message is resent reaches a first preset number;

[0345] If it is determined that the first preset number of times has not been reached, resending the cached fifth message to the second gateway, and returning to the step of determining whether the second ACK fed back by the second gateway is received within the first preset time length;

[0346] If it is determined that the first preset number of times is reached, the cached fifth message is deleted.

[0347] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0348] receiving a first ACK sent by the second gateway;

[0349] Determine whether there is a sixth message whose PSN is smaller than the fourth PSN and for which no ACK carrying the PSN of the message is received;

[0350] If it is determined that the sixth message exists, the sixth message is resent.

[0351] From the above, it can be seen that in the embodiment of the present application, after receiving the first ACK, the first gateway can determine whether there is a sixth message whose corresponding ACK has not been received. If so, it means that the sixth message may have been lost. In the present application, the first gateway can actively resend the sixth message, thereby promptly handling the problem of packet loss.

[0352] In one embodiment of the present application, if it is determined that packet loss occurs, the machine executable instructions further cause the processor to execute the following steps:

[0353] Before receiving a message whose PSN is the first PSN, discard the received message whose PSN is greater than the first PSN.

[0354] As can be seen from the above, in the embodiment of the present application, the first gateway will discard the message received during the packet loss processing, thereby avoiding the occurrence of out-of-order failures in the message transmission process.

[0355] In one embodiment of the present application, if it is determined that no packet loss occurs, the machine executable instructions further cause the processor to perform the following steps:

[0356] If all messages belonging to the same message are received normally, a third ACK is sent to the first host, wherein the PSN carried in the third ACK is the PSN of the last message in the message.

[0357] As can be seen from the above, in the embodiment of the present application, after the first gateway normally receives all the messages in the same message, it will send a third ACK to the first host, so that the first host can determine that all the messages in the message are received normally and there is no need to resend the messages in the message.

[0358] In one embodiment of the present application, judging whether packet loss occurs according to the PSN of the first message specifically includes:

[0359] Determining whether the first message is the first message received by the first gateway from the first host;

[0360] If it is the first message, when the PSN of the first message is not the starting PSN, it is determined that packet loss occurs, wherein the starting PSN is: the PSN of the first message transmitted and designated by the first host and the second host through control message negotiation;

[0361] If it is not the first message, it is determined whether packet loss occurs based on the PSN of the first message and the current first received PSN.

[0362] Corresponding to the aforementioned packet loss processing method applied to the second gateway, the embodiment of the present application also provides a gateway.

[0363] See also Fig.15 , is a schematic diagram of the structure of the second gateway provided in an embodiment of the present application. The gateway is used as a second gateway and is located on the transmission path between the first host and the second host. The gateway includes:

[0364] Processor 1501;

[0365] Transceiver 1504;

[0366] A machine-readable storage medium 1502, wherein the machine-readable storage medium 1502 stores machine-executable instructions that can be executed by the processor 1501; the machine-executable instructions prompt the processor 1501 to perform the following steps:

[0367] receiving and buffering a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after the first gateway receives the message from the first host and determines according to a PSN of the message that no packet loss occurs;

[0368] Determine whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host;

[0369] If it is determined that packet loss occurs, the seventh message is discarded, and a fourth negative acknowledgement NAK is sent to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and sends a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message whose PSN is greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN;

[0370] If it is determined that no packet loss occurs, the seventh message is forwarded to the second host, and the sending PSN is updated to the PSN of the seventh message.

[0371] like Fig.15As shown, the network device may further include a communication bus 1503. The processor 1501, the machine-readable storage medium 1502, and the transceiver 1504 communicate with each other through the communication bus 1503. The communication bus 1503 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1503 may be divided into an address bus, a data bus, a control bus, and the like.

[0372] The transceiver 1504 may be a wireless communication module, and under the control of the processor 1501 , the transceiver 1504 performs data exchange with other devices.

[0373] The machine-readable storage medium 1502 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. In addition, the machine-readable storage medium 1502 may also be at least one storage device located away from the aforementioned processor.

[0374] Processor 1501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0375] As can be seen from the above, in the solution provided by the embodiment of the present application, in the process of the first host sending a message to the second host, the second gateway will perform packet loss detection after receiving the message sent by the first gateway and before sending the seventh message to the second host. If packet loss occurs, the second gateway will send the fourth NAK to the first gateway to perform packet loss processing. That is, in the embodiment of the present application, before the message is sent to the second host, the second gateway can perform packet loss processing on the message sent by the first host in advance. Since the timing of packet loss processing is advanced, the second gateway can respond in advance after packet loss occurs, reducing the waste of network bandwidth.

[0376] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0377] receiving a sixth NAK sent by the second host after determining that packet loss occurs, wherein a fifth PSN carried by the sixth NAK is: a PSN of an eighth message having the smallest PSN among the messages in which packet loss occurs;

[0378] Determining whether the eighth message exists in the cached messages;

[0379] If it is determined that the eighth message exists, sending a message whose cached PSN is greater than or equal to the fifth PSN to the second host;

[0380] If it is determined that the eighth message does not exist, a NAK carrying the fifth PSN is sent to the first gateway.

[0381] As can be seen from the above, in the solution provided by the embodiment of the present application, the second gateway can resend the message to the second host after the second host detects the packet loss, thereby completing the packet loss processing process. Compared with the solution of the first host resending the message to the second host in the related art, the transmission link length between the second gateway and the second host in the embodiment of the present application is significantly smaller, so the packet loss processing process can be completed quickly between the second gateway and the second host, thereby reducing the waste of network bandwidth. Even if the eighth message is not stored in the second gateway, the second gateway can send NAK to the first gateway, and the first gateway continues to complete the packet loss processing process.

[0382] In one embodiment of the present application, after receiving the sixth NAK sent by the second host after determining that packet loss occurs, the machine executable instructions further cause the processor to perform the following steps:

[0383] The subsequently received messages whose PSN is smaller than the fifth PSN are discarded.

[0384] In one embodiment of the present application, the receiving and caching of the message sent by the first gateway specifically includes:

[0385] Receiving a message sent by the first gateway;

[0386] Determine whether the PSN of the message is less than or equal to the current second received PSN; wherein the second received PSN is the PSN of the message with the largest PSN received from the first gateway before receiving the message;

[0387] If it is determined that the PSN of the message is less than or equal to the current second received PSN, then determining whether the message has been cached, if it has been cached, discarding the received message, if it has not been cached, then caching the message;

[0388] If it is determined that the PSN of the message is greater than the current second received PSN, the message is cached and the second received PSN is updated to the PSN of the message.

[0389] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0390] receiving a fourth acknowledgment ACK sent by the second host, wherein the fourth ACK is sent after the second host normally receives all messages included in the first message, and a PSN carried by the fourth ACK is a PSN of the last message in the first message;

[0391] The message included in the cached first message is deleted.

[0392] As can be seen from the above, in the solution provided in the embodiment of the present application, when the second gateway receives the fourth ACK for the first message, it can delete the cached message included in the first message, thereby saving the storage space of the second gateway.

[0393] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0394] Sending a ninth message to the second host;

[0395] Determine whether a fifth ACK fed back by the second host is received within a second preset time period, wherein the fifth ACK is sent after the second host normally receives all messages in the message containing the ninth message;

[0396] If it is determined that the fifth ACK is not received, determining whether the number of times the ninth message is resent reaches a second preset number;

[0397] If it is determined that the second preset number of times has not been reached, resending the cached ninth message to the second host, and returning to the step of determining whether the fifth ACK fed back by the second host is received within the second preset time length;

[0398] If it is determined that the second preset number of times is reached, the cached ninth message is deleted.

[0399] In one embodiment of the present application, after receiving and caching the message sent by the first gateway, the machine executable instructions further cause the processor to perform the following steps:

[0400] A sixth ACK is sent to the first gateway, where the PSN carried by the sixth ACK is the PSN of the received message.

[0401] Corresponding to the aforementioned packet loss processing method applied to the first gateway, the embodiment of the present application further provides a packet loss processing device applied to the first gateway.

[0402] See also Fig.16 , is a structural diagram of a first packet loss processing device provided in an embodiment of the present application, which is applied to a first gateway, and the first gateway is located on a transmission path between a first host and a second host, and the device includes:

[0403] A first message receiving module 1601 is used to receive a first message sent by the first host;

[0404] A first packet loss determination module 1602, configured to determine whether packet loss occurs according to a packet sequence number PSN of the first message;

[0405] The first message forwarding module 1603 updates the first received PSN to the PSN of the first message if the first packet loss determination module 1602 determines that no packet loss occurs, and forwards the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host;

[0406] The first NAK sending module 1604 is used to send a first negative acknowledgement NAK to the first host if the first packet loss judgment module 1602 determines that packet loss has occurred. The first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

[0407] As can be seen from the above, a packet loss processing method provided in an embodiment of the present application is applied to a first gateway between a first host and a second host. After receiving the first message sent by the first host, the first gateway can determine whether packet loss occurs according to the PSN of the first message. If it is determined that packet loss occurs, the first gateway will directly send a first NAK to the first host, so that the first host resends the message. That is, in an embodiment of the present application, packet loss detection can be performed on the first gateway between the first host and the second host, and the timing of packet loss detection is earlier than the method of performing packet loss detection by the second host in the related art. Therefore, the first host can receive the first NAK in advance, thereby promptly discovering the occurrence of packet loss and resending the message as soon as possible. Thereby reducing the number of messages sent by the first host after packet loss that will not be processed by the second host, and reducing the waste of network bandwidth.

[0408] In one embodiment of the present application, when it is determined that no packet loss occurs, the message received from the first host is cached, and the device further includes:

[0409] A first NAK receiving module, configured to receive a second NAK sent by a second gateway;

[0410] A first message determination module is used to determine whether there is a second message in the cached message, wherein the PSN of the second message is a second PSN carried by the second NAK, and the second PSN is: the PSN of the message where the packet loss occurs;

[0411] A second message forwarding module, configured to send the second message to the second gateway if the first message determination module determines that the second message exists;

[0412] The second NAK sending module is used to send a third NAK to the first host if the first message determination module determines that the second message does not exist, and the PSN carried by the third NAK is the second PSN, so that the first host resends a third message whose PSN is greater than or equal to the second PSN.

[0413] As can be seen from the above, in the embodiment of the present application, a message is stored in the first gateway. When the first gateway receives the second NAK, it means that the message sent by the first gateway to the second gateway is lost during the transmission process. In this case, if the first gateway stores the second message indicated by the second NAK, the second message stored in itself can be directly fed back to the second gateway without requesting the first host to resend the second message. In this process, the first host does not perform additional processing, so this process is imperceptible to the first host, has no effect on the first host sending the message, and does not occupy the bandwidth of the first host sending the message to the first gateway. And compared with resending the message through the first host, the first gateway can quickly resend the second message to the second gateway through a shorter transmission path after receiving the second NAK, so as to achieve fast packet loss processing and reduce bandwidth waste. And when the second message is not stored in the first gateway, the first gateway can send a third NAK to the first host, so that the first host can still resend the message normally without affecting the normal packet loss processing process. Moreover, the second NAK in the embodiment of the present application may be generated after the second gateway detects packet loss. In this case, even if the first host resends the message, compared with the second host sending NAK to the first host after detecting packet loss in the related art, the data transmission path between the second gateway and the first host in the present application is still shorter than the data transmission path between the second host and the first host in the related art, and the time required for NAK transmission is shorter. Therefore, even if the second message is not cached in the first gateway, the solution provided by the embodiment of the present application can still improve the speed of packet loss processing and reduce bandwidth waste.

[0414] In one embodiment of the present application, the device further includes:

[0415] A second message receiving module, used for receiving a third message;

[0416] A first PSN determination module, configured to determine whether the third PSN of the third message is less than or equal to the current first received PSN;

[0417] A second message determination module, configured to determine whether the third message has been cached if the first PSN determination module determines that the third PSN is less than or equal to the current first received PSN;

[0418] a first message sending module, configured to discard the received third message and send the cached third message to the second gateway if the second message determining module determines that the third message has been cached;

[0419] The second message sending module is configured to cache and send the received third message to the second gateway if the second message determining module determines that the third message is not cached.

[0420] As can be seen from the above, in the embodiment of the present application, after receiving the third message whose third PSN is less than or equal to the current first receiving PSN, different processing can be performed according to whether the third message is stored in the first gateway.

[0421] In one embodiment of the present application, the device further includes:

[0422] A first ACK receiving module, configured to receive a first confirmation response ACK sent by the second gateway, wherein the first ACK is sent by the second gateway after determining that the fourth message is not lost, and carries a fourth PSN of the fourth message;

[0423] The first message deleting module is used to delete the cached fourth message.

[0424] In one embodiment of the present application, the device further includes:

[0425] A third message sending module, used for sending a fifth message to the second gateway;

[0426] A first ACK judgment module is used to judge whether a second ACK fed back by the second gateway is received within a first preset time period, wherein the second ACK is sent by the second gateway after determining that the fifth message is not lost, and carries the PSN of the fifth message;

[0427] a first number determination module, configured to determine whether the number of times of resending the fifth message reaches a first preset number if the first ACK determination module determines that the second ACK is not received;

[0428] a fourth message sending module, configured to resend the cached fifth message to the second gateway, and return to trigger execution of the first ACK judgment module;

[0429] The second message deleting module is configured to delete the cached fifth message if the first number determining module determines that the first preset number of times has been reached.

[0430] In one embodiment of the present application, the device further includes:

[0431] A second ACK receiving module, configured to receive a first ACK sent by the second gateway;

[0432] A second PSN determination module is used to determine whether there is a sixth message whose PSN is smaller than the fourth PSN and for which no ACK carrying the PSN of the message is received;

[0433] The fifth message sending module is configured to resend the sixth message if the second PSN determination module determines that the sixth message exists.

[0434] From the above, it can be seen that in the embodiment of the present application, after receiving the first ACK, the first gateway can determine whether there is a sixth message whose corresponding ACK has not been received. If so, it means that the sixth message may have been lost. In the present application, the first gateway can actively resend the sixth message, thereby promptly handling the problem of packet loss.

[0435] In one embodiment of the present application, if it is determined that packet loss occurs, the device further includes:

[0436] The first message discarding module is used to discard the received message whose PSN is greater than the first PSN before receiving the message whose PSN is the first PSN.

[0437] As can be seen from the above, in the embodiment of the present application, the first gateway will discard the message received during the packet loss processing, thereby avoiding the occurrence of out-of-order failures in the message transmission process.

[0438] In one embodiment of the present application, if it is determined that no packet loss occurs, the device further includes:

[0439] The first ACK sending module is used to send a third ACK to the first host if all messages belonging to the same message are received normally, wherein the PSN carried in the third ACK is the PSN of the last message in the message.

[0440] As can be seen from the above, in the embodiment of the present application, after the first gateway normally receives all the messages in the same message, it will send a third ACK to the first host, so that the first host can determine that all the messages in the message are received normally and there is no need to resend the messages in the message.

[0441] In one embodiment of the present application, the first packet loss determination module 1602 is specifically configured to:

[0442] Determining whether the first message is the first message received by the first gateway from the first host;

[0443] If it is the first message, when the PSN of the first message is not the starting PSN, it is determined that packet loss occurs, wherein the starting PSN is: the PSN of the first message transmitted and designated by the first host and the second host through control message negotiation;

[0444] If it is not the first message, it is determined whether packet loss occurs based on the PSN of the first message and the current first received PSN.

[0445] See also Fig.17 , is a schematic diagram of the structure of a second packet loss processing device provided in an embodiment of the present application, the device comprising:

[0446] A third message receiving module 1701 is used to receive and cache a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after receiving the message from the first host and determining that no packet loss occurs according to a PSN of the message;

[0447] The second packet loss judgment module 1702 is used to judge whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host;

[0448] a third NAK sending module 1703, configured to discard the seventh message if the second packet loss judgment module 1702 determines that packet loss occurs, and send a fourth negative acknowledgement NAK to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and send a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message having a PSN greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN;

[0449] The third message forwarding module 1704 is used to forward the seventh message to the second host if the second packet loss determination module 1702 determines that no packet loss occurs, and update the sending PSN to the PSN of the seventh message.

[0450] As can be seen from the above, in the solution provided by the embodiment of the present application, in the process of the first host sending a message to the second host, the second gateway will perform packet loss detection after receiving the message sent by the first gateway and before sending the seventh message to the second host. If packet loss occurs, the second gateway will send the fourth NAK to the first gateway to perform packet loss processing. That is, in the embodiment of the present application, before the message is sent to the second host, the second gateway can perform packet loss processing on the message sent by the first host in advance. Since the timing of packet loss processing is advanced, the second gateway can respond in advance after packet loss occurs, reducing the waste of network bandwidth.

[0451] In one embodiment of the present application, the device further includes:

[0452] A second NAK receiving module is used to receive a sixth NAK sent by the second host after determining that packet loss occurs, wherein the fifth PSN carried by the sixth NAK is: the PSN of the eighth message with the smallest PSN among the messages where packet loss occurs;

[0453] A third message determination module, used to determine whether the eighth message exists in the cached messages;

[0454] a sixth message sending module, configured to send a message whose cached PSN is greater than or equal to the fifth PSN to the second host if the third message determining module determines that the eighth message exists;

[0455] The fourth NAK sending module is configured to send a NAK carrying the fifth PSN to the first gateway if the third message determining module determines that the eighth message does not exist.

[0456] As can be seen from the above, in the solution provided by the embodiment of the present application, the second gateway can resend the message to the second host after the second host detects the packet loss, thereby completing the packet loss processing process. Compared with the solution of the first host resending the message to the second host in the related art, the transmission link length between the second gateway and the second host in the embodiment of the present application is significantly smaller, so the packet loss processing process can be completed quickly between the second gateway and the second host, thereby reducing the waste of network bandwidth. Even if the eighth message is not stored in the second gateway, the second gateway can send NAK to the first gateway, and the first gateway continues to complete the packet loss processing process.

[0457] In one embodiment of the present application, the device further includes:

[0458] The second message discarding module is used to discard the subsequently received message whose PSN is smaller than the fifth PSN.

[0459] In one embodiment of the present application, the third message receiving module 1701 is specifically used to:

[0460] Receiving a message sent by the first gateway;

[0461] A third PSN determination module is used to determine whether the PSN of the message is less than or equal to the current second received PSN; wherein the second received PSN is the PSN of the message with the largest PSN received from the first gateway before receiving the message;

[0462] A message processing module, configured to determine whether the message has been cached if the third PSN determination module determines that the message is less than or equal to the current second received PSN, and if so, discard the received message; if not, cache the message;

[0463] The message buffering module is used to buffer the message and update the second received PSN to the PSN of the message if the third PSN judging module determines that the PSN is greater than the current second received PSN.

[0464] In one embodiment of the present application, the device further includes:

[0465] a third ACK receiving module, configured to receive a fourth confirmation response ACK sent by the second host, wherein the fourth ACK is sent after the second host normally receives all messages included in the first message, and the PSN carried by the fourth ACK is the PSN of the last message in the first message;

[0466] The third message deleting module is used to delete the message included in the cached first message.

[0467] As can be seen from the above, in the solution provided in the embodiment of the present application, when the second gateway receives the fourth ACK for the first message, it can delete the cached message included in the first message, thereby saving the storage space of the second gateway.

[0468] In one embodiment of the present application, the device further includes:

[0469] a seventh message sending module, configured to send a ninth message to the second host;

[0470] A second ACK judgment module is used to judge whether a fifth ACK fed back by the second host is received within a second preset time period, wherein the fifth ACK is sent after the second host normally receives all messages in the message where the ninth message is located;

[0471] a seventh message sending module, configured to resend the cached ninth message to the second host if the second ACK judgment module determines that the fifth ACK is not received, and return to trigger the execution of the second ACK judgment module;

[0472] A second number determination module, used to determine whether the number of times the ninth message is resent reaches a second preset number;

[0473] The fourth message deleting module is used to delete the cached ninth message if the second number judging module determines that the second preset number is reached.

[0474] In one embodiment of the present application, the device further includes:

[0475] The second ACK sending module is used to send a sixth ACK to the first gateway, and the PSN carried by the sixth ACK is the PSN of the received message.

[0476] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned packet loss processing method applied to either the first gateway or the second gateway are implemented.

[0477] In another embodiment provided in the present application, a computer program product including instructions is also provided. When the computer is run on a computer, the computer executes any packet loss processing method applied to the first gateway or the second gateway in the above embodiments.

[0478] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0479] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0480] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the gateway, device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0481] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A packet loss processing method, characterized in that: Applied to a first gateway, the first gateway being located on a transmission path between a first host and a second host, the method comprises: Receiving a first message sent by the first host; Determining whether packet loss occurs according to the packet sequence number PSN of the first message; If it is determined that no packet loss occurs, updating the first receiving PSN to the PSN of the first message, and forwarding the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host; If it is determined that packet loss occurs, a first negative acknowledgement NAK is sent to the first host, and the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

2. The method according to claim 1, characterized in that When it is determined that no packet loss occurs, buffering the message received from the first host, the method further includes: receiving a second NAK sent by the second gateway, where the second NAK carries a second PSN of a second message in which packet loss occurs; Determining whether a second message exists in the cached messages; If it is determined that the second message exists, sending the second message to the second gateway; If it is determined that the second message does not exist, a third NAK is sent to the first host, and the PSN carried by the third NAK is the second PSN, so that the first host resends a third message whose PSN is greater than or equal to the second PSN.

3. The method according to claim 2, characterized in that After sending the third NAK to the first host, the method further includes: receiving a third message; Determine whether the third PSN of the third message is less than or equal to the current first receiving PSN; If it is determined that the third PSN is less than or equal to the current first received PSN, determining whether the third message has been cached; If it is determined that the third message has been cached, discarding the received third message, and sending the cached third message to the second gateway; If it is determined that the third message is not cached, the received third message is cached and sent to the second gateway.

4. The method according to claim 2, characterized in that: The method further comprises: receiving a first confirmation ACK sent by the second gateway, wherein the first ACK is sent by the second gateway after determining that the fourth message is not lost, and carries a fourth PSN of the fourth message; The cached fourth message is deleted.

5. The method according to claim 4, characterized in that The method further comprises: Sending a fifth message to the second gateway; Determine whether a second ACK fed back by the second gateway is received within a first preset time period, wherein the second ACK is sent by the second gateway after determining that the fifth message is not lost, and carries the PSN of the fifth message; If it is determined that the second ACK is not received, determining whether the number of times the fifth message is resent reaches a first preset number; If it is determined that the first preset number of times has not been reached, resending the cached fifth message to the second gateway, and returning to the step of determining whether the second ACK fed back by the second gateway is received within the first preset time length; If it is determined that the first preset number of times is reached, the cached fifth message is deleted.

6. The method according to claim 4, characterized in that The method further comprises: receiving a first ACK sent by the second gateway; Determine whether there is a sixth message whose PSN is smaller than the fourth PSN and for which no ACK carrying the PSN of the message is received; If it is determined that the sixth message exists, the sixth message is resent.

7. The method according to claim 1, characterized in that If it is determined that packet loss occurs, the method further includes: Before receiving a message whose PSN is the first PSN, discard the received message whose PSN is greater than the first PSN.

8. The method according to claim 1, characterized in that If it is determined that no packet loss occurs, the method further includes: If all messages belonging to the same message are received normally, a third ACK is sent to the first host, wherein the PSN carried in the third ACK is the PSN of the last message in the message.

9. The method according to claim 1, characterized in that: The determining, according to the packet sequence number PSN of the first message, whether packet loss occurs includes: Determining whether the first message is the first message received by the first gateway from the first host; If it is the first message, when the PSN of the first message is not the starting PSN, it is determined that packet loss occurs, wherein the starting PSN is: the PSN of the first message transmitted and designated by the first host and the second host through control message negotiation; If it is not the first message, it is determined whether packet loss occurs based on the PSN of the first message and the current first received PSN.

10. A packet loss processing method, characterized in that: Applied to a second gateway, the second gateway being located on a transmission path between a first host and a second host, the method comprising: receiving and buffering a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after the first gateway receives the message from the first host and determines according to a PSN of the message that no packet loss occurs; Determine whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host; If it is determined that packet loss occurs, the seventh message is discarded, and a fourth negative acknowledgement NAK is sent to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and sends a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message whose PSN is greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN; If it is determined that no packet loss occurs, the seventh message is forwarded to the second host, and the sending PSN is updated to the PSN of the seventh message.

11. The method according to claim 10, characterized in that The method further comprises: receiving a sixth NAK sent by the second host after determining that packet loss occurs, wherein a fifth PSN carried by the sixth NAK is: a PSN of an eighth message having the smallest PSN among the messages in which packet loss occurs; Determining whether the eighth message exists in the cached messages; If it is determined that the eighth message exists, sending a message whose cached PSN is greater than or equal to the fifth PSN to the second host; If it is determined that the eighth message does not exist, a NAK carrying the fifth PSN is sent to the first gateway.

12. The method according to claim 11, characterized in that After receiving the sixth NAK sent by the second host after determining that packet loss occurs, the method further includes: The subsequently received messages whose PSN is smaller than the fifth PSN are discarded.

13. The method according to claim 10, characterized in that The receiving and caching the message sent by the first gateway includes: Receiving a message sent by the first gateway; Determine whether the PSN of the message is less than or equal to the current second received PSN; wherein the second received PSN is the PSN of the message with the largest PSN received from the first gateway before receiving the message; If it is determined that the PSN of the message is less than or equal to the current second received PSN, then determining whether the message has been cached, if it has been cached, discarding the received message, if it has not been cached, then caching the message; If it is determined that the PSN of the message is greater than the current second received PSN, the message is cached and the second received PSN is updated to the PSN of the message.

14. The method according to claim 10, characterized in that The method further comprises: receiving a fourth acknowledgment ACK sent by the second host, wherein the fourth ACK is sent after the second host normally receives all messages included in the first message, and a PSN carried by the fourth ACK is a PSN of the last message in the first message; The message included in the cached first message is deleted.

15. The method according to claim 14, characterized in that The method further comprises: Sending a ninth message to the second host; Determine whether a fifth ACK fed back by the second host is received within a second preset time period, wherein the fifth ACK is sent after the second host normally receives all messages in the message containing the ninth message; If it is determined that the fifth ACK is not received, determining whether the number of times the ninth message is resent reaches a second preset number; If it is determined that the second preset number of times has not been reached, resending the cached ninth message to the second host, and returning to the step of determining whether the fifth ACK fed back by the second host is received within the second preset time length; If it is determined that the second preset number of times is reached, the cached ninth message is deleted.

16. The method according to claim 10, characterized in that After receiving and caching the message sent by the first gateway, the method further includes: A sixth ACK is sent to the first gateway, where the PSN carried by the sixth ACK is the PSN of the received message.

17. A gateway, characterized in that: The gateway is a first gateway located on a transmission path between a first host and a second host, and includes: processor; Transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompt the processor to perform the following steps: Receiving a first message sent by the first host; Determining whether packet loss occurs according to the packet sequence number PSN of the first message; If it is determined that no packet loss occurs, updating the first receiving PSN to the PSN of the first message, and forwarding the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host; If it is determined that packet loss occurs, a first negative acknowledgement NAK is sent to the first host, and the first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

18. A gateway, characterized in that: The gateway is used as a second gateway and is located on a transmission path between the first host and the second host. The gateway includes: processor; Transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompt the processor to perform the following steps: receiving and buffering a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after the first gateway receives the message from the first host and determines according to a PSN of the message that no packet loss occurs; Determine whether packet loss occurs according to the packet sequence number PSN of the seventh message to be sent and the current sending PSN, wherein the sending PSN is the PSN of the message most recently sent to the second host; If it is determined that packet loss occurs, the seventh message is discarded, and a fourth negative acknowledgement NAK is sent to the first gateway, so that the first gateway resends the seventh message to the second gateway when it is determined that the seventh message exists in the cached messages, and sends a fifth NAK to the first host when it is determined that the seventh message does not exist in the cached messages, so that the first host resends a message whose PSN is greater than or equal to the PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN; If it is determined that no packet loss occurs, the seventh message is forwarded to the second host, and the sending PSN is updated to the PSN of the seventh message.

19. A packet loss processing device, characterized in that: Applied to a first gateway, the first gateway is located on a transmission path between a first host and a second host, the device comprises: A first message receiving module, used for receiving a first message sent by the first host; A first packet loss judgment module, used to judge whether packet loss occurs according to the packet sequence number PSN of the first message; A first message forwarding module, configured to update a first received PSN to a PSN of the first message if the first packet loss determination module determines that no packet loss occurs, and forward the first message to a second gateway, wherein the second gateway is located on a transmission path between the first gateway and the second host; The first NAK sending module is used to send a first negative acknowledgment NAK to the first host if the first packet loss judgment module determines that packet loss has occurred. The first PSN carried in the first NAK is calculated based on the current first received PSN, so that the first host resends a message with a PSN greater than or equal to the first PSN.

20. A packet loss processing device, characterized in that: Applied to a second gateway, the second gateway is located on a transmission path between a first host and a second host, the device comprises: A third message receiving module is used to receive and cache a message sent by a first gateway, wherein the first gateway is located on a transmission path between the second gateway and the first host, and the message is sent by the first gateway after receiving the message from the first host and determining that no packet loss occurs according to a PSN of the message; a second packet loss judgment module, configured to judge whether packet loss occurs according to a packet sequence number PSN of a seventh message to be sent and a current sending PSN, wherein the sending PSN is a PSN of a message most recently sent to the second host; a third NAK sending module, configured to discard the seventh message if the second packet loss judgment module determines that packet loss occurs, and send a fourth negative acknowledgement NAK to the first gateway, so that the first gateway resends the seventh message to the second gateway when determining that the seventh message exists in the cached messages, and send a fifth NAK to the first host when determining that the seventh message does not exist in the cached messages, so that the first host resends a message having a PSN greater than or equal to a PSN carried by the fifth NAK, wherein the fifth NAK is the same as the PSN carried by the fourth NAK, and the PSN carried by the fourth NAK is calculated based on the sent PSN; The third message forwarding module is used to forward the seventh message to the second host if the second packet loss judgment module determines that no packet loss occurs, and update the sending PSN to the PSN of the seventh message.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-9 or 10-16 are implemented.

Citation Information

Patent Citations

  • A message processing method and device

    CN109040025A

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

    CN115633104A

  • Message retransmission method and device

    CN116114199A

  • Congestion control method and device

    CN117061438A

  • Network message forwarding method and device, switch and storage medium

    CN118487721A