Message processing method and device and related equipment
By implementing the message processing method in the RDMA gateway, using the timer and NACK message mechanism, the problem of packet loss and out of order in the WAN environment is solved, and the RDMA network card is effectively working in the WAN network, reducing the development and deployment costs.
Patent Information
- Application Number
- CN202510198721.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-03
AI Technical Summary
Existing RDMA network cards are difficult to work effectively in WAN environments because they are designed in low latency and low packet loss environments within data centers, while WANs are characterized by high latency, high packet loss rate, bandwidth limitation, and multi-path disorder.
By implementing the message processing method in the RDMA gateway, using the timer and NACK message mechanism, packet loss and out-of-order problems are detected and processed. The specific steps include receiving messages, judging whether the packet number is continuous, starting the timer to wait for possible lost messages, and sending NACK messages to trigger retransmission if the timeout is not received.
This method enables the RDMA network card to work effectively in a wide area network environment, solves the problems of packet loss and out of order, and does not require modification of the software and hardware configuration of the existing RDMA host, reducing development and deployment costs.
Smart Images

Figure CN120090768A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and particularly to a message processing method, apparatus, and related devices. Background Art
[0002] RDMA (Remote Direct Memory Access) is a network technology that allows a computer to directly access the memory of another computer without the intervention of their respective operating systems. RDMA has advantages and characteristics such as low latency, high throughput, and low CPU overhead, and generally requires the support of network card hardware and software. RDMA is mainly applied within data centers or intelligent computing centers to support services such as HPC, AI, and data storage. Through RDMA network cards and IB (InfiniBand) networks or RoCE (RDMA over Converged Ethernet) networks, high-speed access and transmission of data are achieved. With the development of services such as edge computing, multi-data center interconnection, and east-west data computing, the demand for high-speed access and transmission of data has extended from within data centers to wide area network scenarios, and it is also hoped to extend the advantages of RDMA technology to wide area network environments.
[0003] RDMA supports three communication modes: RC (Reliable Connection), UD (Unreliable Datagram), and UC (Unreliable Connection). The RC mode provides connection-oriented and reliable communication, ensuring that the transmission of data is in order and not lost, and supports retransmission and flow control mechanisms to ensure reliable data transmission. The UD mode is connectionless and unreliable communication, which does not guarantee the order of packet transmission nor the non-loss of packets. The UC mode provides connection-oriented and unreliable communication. Although a connection is established, it does not guarantee the non-loss of packets. Among the three communication modes, the most important and most widely used is the RC mode, which needs to ensure the orderly transmission of data and support packet loss retransmission.
[0004] Traditional RDMA network cards generally use the Go-Back-N method for packet loss retransmission. The sender maintains a sending window, allowing up to N packets to be sent simultaneously without waiting for an acknowledgment. Each packet carries a sequence number, and the receiver relies on this sequence number to detect packet loss and out-of-order packets. If the receiver detects packet loss and out-of-order packets, it notifies the sender to retransmit this packet and subsequent packets.
[0005] At present, whether it is an RDMA network card using Go-Back-N retransmission or an RDMA network card using selective retransmission, it is generally applied inside the data center. The data center network features low latency, low packet loss rate, and large bandwidth, while the wide area network has characteristics such as large latency, high packet loss rate, bandwidth limitation, and multi-path out-of-order. The RDMA network card in the data center cannot be directly applied to the wide area network. To adapt to the characteristics of the wide area network, it is necessary to design and develop new wide area RDMA network card hardware, modify the flow control or congestion control algorithm of the RDMA network card, and introduce technologies such as selective retransmission and out-of-order rearrangement.
[0006] However, redesigning and developing new wide area RDMA network card hardware and software is very difficult and costly, and it is not compatible with the existing RDMA network cards in the data center. Replacing with a new wide area RDMA network card may also require modifying and adapting the original upper-layer application software. Summary of the Invention
[0007] This application provides a message processing method, apparatus, and related devices.
[0008] In a first aspect, this application provides a message processing method, which is applied to a first gateway. The first gateway is located on the transmission path between a second gateway and a receiving end, and the second gateway is located on the transmission path between a sending end and the first gateway; the method includes:
[0009] Receiving a first message forwarded by the second gateway;
[0010] Judging whether packet loss occurs according to the first packet sequence number PSN of the first message;
[0011] If it is determined that packet loss occurs, start a timer, and after the timer times out, judge whether a second message with a PSN of a second PSN is received, where the second message is a message with a receiving sequence before the first message, and the second PSN is less than the first PSN;
[0012] If it is determined that no second message is received, send a NACK message carrying the PSN of the un-received second message to the second gateway, so that the second gateway retransmits the un-received second message.
[0013] Optionally, the first gateway maintains an expected PSN; the step of judging whether packet loss occurs according to the first packet sequence number PSN of the first message includes:
[0014] Judging whether the first PSN is equal to the expected PSN;
[0015] If it is determined that the first PSN is equal to the expected PSN, it is determined that no packet loss occurs;
[0016] If it is determined that the first PSN is greater than the expected PSN, it is determined that a packet loss has occurred.
[0017] Optionally, the method further includes:
[0018] If it is determined that no packet loss has occurred, increment the expected PSN by 1;
[0019] Cache the first message and forward the first message to the receiving end;
[0020] Feedback an ACK message corresponding to the first message to the first gateway.
[0021] Optionally, if the first gateway does not enable the out-of-order message receiving function, the method further includes:
[0022] If it is determined that a packet loss has occurred based on the first packet sequence number PSN of the first message, send a NACK message carrying a second PSN to the second gateway, so that the second gateway retransmits the message with the PSN being the second PSN.
[0023] In a second aspect, the present application provides a message processing method, which is applied to a second gateway, and the second gateway is located on the transmission path between the sending end and the first gateway, and the first gateway is located on the transmission path between the second gateway and the receiving end; the method includes:
[0024] Receive a NACK message carrying a target packet sequence number PSN sent by the first gateway, where, when the first gateway determines that a packet loss has occurred based on the PSN of a received message, and after the started timer times out, a message with the PSN being the target PSN has not been received, the first gateway sends a NACK message carrying the target PSN to the second gateway, the target message is the message whose reception sequence is before this message, and the target PSN is less than the PSN of this message;
[0025] Retransmit the target message to the first gateway.
[0026] Optionally, the method further includes:
[0027] If an ACK message corresponding to a message sent by the first gateway is received, it is determined that the message is successfully sent, and the message cached locally is deleted.
[0028] Optionally, the method further includes:
[0029] After sending a message to the second network, start a retransmission timer;
[0030] After the retransmission timer times out, if it is determined that the ACK / NACK message corresponding to this message has not been received, retransmit this message to the first gateway.
[0031] In a third aspect, the present application provides a message processing device, which is applied to a first gateway. The first gateway is located on a transmission path between a second gateway and a receiving end, and the second gateway is located on a transmission path between a sending end and the first gateway; the device includes:
[0032] A receiving unit, configured to receive a first message forwarded by the second gateway;
[0033] A judging unit, configured to judge whether packet loss occurs according to a first packet sequence number PSN of the first message;
[0034] A starting unit, if the judging unit determines that packet loss occurs, the starting unit is configured to start a timer, and after the timer times out, the judging unit is further configured to judge whether a second message with a PSN of a second PSN is received, where the second message is a message whose reception sequence is before the first message, and the second PSN is less than the first PSN;
[0035] A sending unit, if the judging unit determines that no second message is received, the sending unit is configured to send a NACK message carrying the PSN of the un-received second message to the second gateway, so that the second gateway re-transmits the un-received second message.
[0036] Optionally, the first gateway maintains an expected PSN; when judging whether packet loss occurs according to the first packet sequence number PSN of the first message, the judging unit is specifically configured to:
[0037] Judge whether the first PSN is equal to the expected PSN;
[0038] If it is determined that the first PSN is equal to the expected PSN, it is determined that no packet loss occurs;
[0039] If it is determined that the first PSN is greater than the expected PSN, it is determined that packet loss occurs.
[0040] Optionally, the device further includes:
[0041] An accumulation unit, if it is determined that no packet loss occurs, the accumulation unit is configured to accumulate the expected PSN by 1;
[0042] A caching unit, configured to cache the first message and forward the first message to the receiving end;
[0043] A feedback unit, configured to feedback an ACK message corresponding to the first message to the first gateway.
[0044] Optionally, if the first gateway does not enable the out-of-order message receiving function,
[0045] If the determination unit determines that a packet loss has occurred based on the first packet sequence number (PSN) of the first message, the sending unit is configured to send a NACK message carrying a second PSN to the second gateway, so that the second gateway retransmits the message with the PSN being the second PSN.
[0046] In a fourth aspect, the present application provides a message processing apparatus, which is applied to a second gateway. The second gateway is located on a transmission path between a sending end and a first gateway, and the first gateway is located on a transmission path between the second gateway and a receiving end. The apparatus includes:
[0047] A receiving unit, configured to receive a NACK message carrying a target packet sequence number (PSN) sent by the first gateway. When the first gateway determines that a packet loss has occurred based on the PSN of a received message, and after a started timer times out, if it has not received a message with the PSN being the target PSN, the first gateway sends a NACK message carrying the target PSN to the second gateway. The target message is a message whose reception sequence is before this message, and the target PSN is less than the PSN of this message.
[0048] A retransmission unit, configured to retransmit the target message to the first gateway.
[0049] Optionally, the apparatus further includes:
[0050] A deletion unit. If an ACK message corresponding to a message sent by the first gateway is received, it is determined that the message has been successfully sent. The deletion unit is configured to delete the message cached locally.
[0051] Optionally, the apparatus further includes a start unit, a determination unit, and a retransmission unit:
[0052] The start unit is configured to start a retransmission timer after sending a message to the second network.
[0053] After the retransmission timer times out, if the determination unit determines that an ACK / NACK message corresponding to this message has not been received, the retransmission unit is configured to retransmit this message to the first gateway.
[0054] In a fifth aspect, an embodiment of the present application provides a message processing apparatus, which includes:
[0055] A memory, configured to store program instructions;
[0056] A processor, configured to call the program instructions stored in the memory and execute the steps of the method according to any one of the above first aspects according to the obtained program instructions.
[0057] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the steps of the method according to any one of the first aspects described above.
[0058] In a seventh aspect, an embodiment of the present application provides a message processing device, which includes:
[0059] a memory for storing program instructions;
[0060] a processor for calling the program instructions stored in the memory and executing the steps of the method according to any one of the second aspects described above according to the obtained program instructions.
[0061] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the steps of the method according to any one of the second aspects described above.
[0062] In summary, the message processing method provided by the embodiment of the present application is applied to a first gateway, where the first gateway is located on the transmission path between a second gateway and a receiving end, and the second gateway is located on the transmission path between a sending end and the first gateway; the method includes: receiving a first message forwarded by the second gateway; determining whether packet loss occurs according to a first packet sequence number PSN of the first message; if it is determined that packet loss occurs, starting a timer, and after the timer times out, determining whether a second message with a PSN of a second PSN is received, where the second message is a message whose reception sequence is before the first message, and the second PSN is less than the first PSN; if it is determined that no second message is received, sending a NACK message carrying the PSN of the un-received second message to the second gateway so that the second gateway retransmits the un-received second message.
[0063] By using the message processing method provided by the embodiment of the present application, an RDMA gateway is used to solve the problems of packet loss and out-of-order in a wide area network, enabling traditional RDMA network cards to also perform wide area network RDMA communication, which can greatly save the costs required for developing and deploying wide area RDMA network cards. The RDMA gateway is completely transparent to the sending RDMA host and the receiving RDMA host, without the need to modify the software and hardware configurations of the original RDMA host. At the same time, the original upper-layer application software on the RDMA host does not need to be modified and adapted. By setting a timer, the message processing efficiency during message out-of-order rearrangement and message retransmission in a multi-path scenario between RDMA gateways is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments of the present application or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0065] Figure 1 The detailed flowchart of a message processing method provided by an embodiment of the present application;
[0066] Figure 2 The schematic diagram of message flow provided by an embodiment of the present application;
[0067] Figure 3 The detailed flowchart of another message processing method provided by an embodiment of the present application;
[0068] Figure 4 The structural schematic diagram of a message processing device provided by an embodiment of the present application;
[0069] Figure 5 The structural schematic diagram of another message processing device provided by an embodiment of the present application;
[0070] Figure 6 The hardware architecture schematic diagram of a message processing device provided by an embodiment of the present application;
[0071] Figure 7 The hardware architecture schematic diagram of another message processing device provided by an embodiment of the present application. Detailed implementation manners
[0072] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments and do not limit the present application. The singular forms of "a", "the" and "said" used in the present application and the claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations including one or more of the associated listed items.
[0073] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "when" or "while" or "in response to a determination".
[0074] Exemplarily, refer toFigure 1 As shown in the figure, it is a detailed flowchart of a message processing method provided by an embodiment of the present application. This method is applied to a first gateway, and the first gateway is located on the transmission path between a second gateway and a receiving end. The second gateway is located on the transmission path between a sending end and the first gateway. The method includes the following steps:
[0075] Step 100: Receive a first message forwarded by the second gateway.
[0076] Exemplarily, refer to Figure 2 As shown in the figure, it is a schematic diagram of message flow provided by an embodiment of the present application. The sending end (e.g., the sending host Host1) and the receiving end (e.g., the receiving host Host2) perform DRMA communication, passing through the second gateway (e.g., the RDMA gateway GW1) and the first gateway (e.g., the RDMA gateway GW2) in the middle. Exemplarily, if there are two wide area network paths between the RDMA gateway GW1 and the RDMA gateway GW2, the RDMA data messages sent from Host1 to Host2 may experience packet loss and out-of-order on the wide area network paths.
[0077] Specifically, the sending host Host1 and the receiving host Host2 communicate in the traditional RDMA manner, including establishing an RDMA connection, orderly sending and receiving data packets, and responding to and processing ACK (Acknowledgement) and NACK (Negative Acknowledgement) messages according to the standard RDMA protocol. The sending host Host1 and the receiving host Host2 are not aware of the existence of the RDMA gateways GW1 and GW2. The destination IP of the data messages, ACK, and NACK messages sent by the host is the IP of the peer host, and the destination QPN (Queue Pair Number) is also the QPN of the peer host. The destination IP of the data messages, ACK, and NACK messages received by the host is its own IP, and the destination QPN is also its own QPN.
[0078] In practical applications, the RDMA gateway listens for the RDMA messages of the host Host1 and the host Host2 and automatically establishes an RDMA session table / flow table. The RDMA session table / flow table generally records information such as the source IP, destination IP, source QPN, destination QPN, expected PSN (Packet Sequence Number), message cache, etc.
[0079] Then, in the embodiment of the present application, the RDMA gateway GW1 receives the RDMA data packet sent by the Host1, and checks whether the sequence number of the packet is equal to the expected PSN according to the RDMA session table / flow table. If the sequence number of the RDMA data packet is equal to the expected PSN, the expected PSN is updated (i.e., PSN + 1), the packet is cached (a copy of the packet is copied to the cache of the RDMA session table / flow table), the packet is forwarded, and an ACK packet is sent back to the Host1.
[0080] That is, when the second gateway receives the packet (e.g., the first packet) sent by the sender and the PSN of the packet is equal to the expected PSN, it is determined that no packet loss has occurred. At this time, the second gateway sends the received packet to the receiver (i.e., forwards it to the first gateway).
[0081] It should be noted that if the sequence number of the RDMA data packet is not equal to the expected PSN, it means that packet loss or out-of-order occurs between the Host1 and the GW1. The GW1 discards the packet and sends a NACK packet back to the Host1 to notify the Host1 to retransmit. The ACK and NACK packets sent by the GW1 to the Host1 are in the standard RDMA protocol format. The source IP of the packet is the source IP of the Host2, and the destination QPN is the QPN negotiated between the Host1 and the Host2. Therefore, the Host1 cannot perceive the existence of the GW1 and thinks that the ACK and NACK packets are sent back by the Host2. After receiving the NACK packet, the Host1 retransmits the packet.
[0082] Step 110: Determine whether packet loss occurs according to the first packet sequence number PSN of the first packet.
[0083] In the embodiment of the present application, after receiving the first packet sent by the second gateway, the first gateway determines whether packet loss occurs based on the PSN of the first packet and the expected PSN maintained locally.
[0084] Specifically, the RDMA gateway GW2 receives the RDMA data packet sent by the GW1, and checks whether the sequence number of the packet is equal to the expected PSN according to the RDMA session table / flow table.
[0085] In a preferred implementation manner of the embodiment of the present application: the first gateway maintains an expected PSN; then, when determining whether packet loss occurs according to the first packet sequence number PSN of the first packet, it is determined whether the first PSN is equal to the expected PSN; if it is determined that the first PSN is equal to the expected PSN, it is determined that no packet loss has occurred; if it is determined that the first PSN is greater than the expected PSN, it is determined that packet loss has occurred.
[0086] Step 120: If it is determined that a packet loss has occurred, start a timer, and after the timer times out, determine whether a second packet with a PSN of the second PSN is received.
[0087] Wherein, the second packet is a packet whose reception sequence is before the first packet, and the second PSN is less than the first PSN.
[0088] Step 130: If it is determined that no second packet is received, send a NACK packet carrying the PSN of the unreceived second packet to the second gateway, so that the second gateway retransmits the unreceived second packet.
[0089] If the sequence number of the RDMA data packet is not equal to the expected PSN, it means that packet loss or out-of-order occurs between GW1 and GW2. GW2 first caches the packet (copy a packet to the cache of the RDMA session table / flow table), but does not update the expected PSN and does not continue to forward the packet, and then replies to GW1 with a NACK packet. The NACK packet between GW1 and GW2 can adopt the format of the standard RDMA protocol, specifying only one PSN each time, or a new NACK format can be defined, and the new NACK format can specify multiple PSNs at a time. In the embodiments of the present application, no specific limitation is made here.
[0090] In the embodiments of the present application, the first gateway enables the function of receiving out-of-order packets, that is, GW2 supports receiving out-of-order packets. GW2 needs to wait for all out-of-order packets to arrive. After receiving the first out-of-order packet, GW2 needs to start a timer, and the timeout time of the timer is T1. If all packets with the expected PSNs are not received after the timer times out, then reply to GW1 with a NACK packet. For example, the expected PSN of GW2 is 5, and the PSN of the first received data packet is 8. GW2 starts a timeout timer. If data packets with PSNs of 5, 6, and 7 are received before the timer times out, the timer is stopped. If the timer times out and only a data packet with a PSN of 6 is received, then GW2 replies to GW1 with a NACK packet, notifying GW1 to retransmit the data packets with PSNs of 5 and 7.
[0091] In the embodiments of the present application, the above packet processing method may further include the following steps:
[0092] If it is determined that no packet loss has occurred, increment the expected PSN by 1; cache the first packet, and forward the first packet to the receiving end; feedback an ACK packet corresponding to the first packet to the first gateway.
[0093] In practical applications, if the sequence number of the RDMA data packet is equal to the expected PSN, then update the expected PSN (i.e., PSN + 1), cache the packet (copy a copy of the packet into the cache of the RDMA session table / flow table), forward the packet, and send an ACK packet to GW1. If GW1 receives a NACK packet from GW2, look up the local cache according to the RDMA session table / flow table, and then retransmit the data packet with the specified PSN according to the local cache.
[0094] Further, in the embodiment of the present application, if the first gateway does not enable the out-of-order packet reception function, the above packet processing method may further include the following steps:
[0095] If it is determined that a packet loss has occurred according to the first packet sequence number PSN of the first packet, then send a NACK packet carrying the second PSN to the second gateway, so that the second gateway retransmits the packet with the PSN being the second PSN.
[0096] That is to say, assuming that the first gateway does not enable the out-of-order packet reception function, that is, GW2 does not support receiving out-of-order packets, then GW2 considers that out-of-order packets mean packet loss and immediately sends a NACK packet to GW1. For example, if the expected PSN of GW2 is 5 and the actual PSN of the received data packet is 8, GW2 sends a NACK packet to GW1 to notify GW1 to retransmit the packets with PSNs 5, 6, and 7.
[0097] Exemplarily, refer to Figure 3 As shown, it is a detailed flowchart of a packet processing method provided by an embodiment of the present application. This method is applied to the second gateway, and the second gateway is located on the transmission path between the sending end and the first gateway, and the first gateway is located on the transmission path between the second gateway and the receiving end; this method includes:
[0098] Step 300: Receive a NACK packet carrying the target packet sequence number PSN sent by the first gateway.
[0099] Wherein, when the first gateway determines that a packet loss has occurred according to the PSN of a received packet and does not receive a packet with the PSN being the target PSN after the started timer times out, then send a NACK packet carrying the target PSN to the second gateway, the target packet is the packet with the reception sequence before this packet, and the target PSN is less than the PSN of this packet.
[0100] Step 310: Retransmit the target packet to the first gateway.
[0101] In the embodiment of the present application, if the second gateway receives an ACK packet corresponding to a packet sent by the first gateway, it is determined that the packet is successfully sent, and the packet cached locally is deleted.
[0102] Further, in an embodiment of the present application, after sending a message to the second network, a retransmission timer is started; after the retransmission timer times out, if it is determined that an ACK / NACK message corresponding to the message has not been received, the message is retransmitted to the first gateway.
[0103] Specifically, if the RDMA gateway receives an ACK message, it releases the corresponding cached data message. In order to prevent the loss of ACK or NACK messages, the RDMA gateway also starts a retransmission timer with a timeout period of T2. If the ACK message and NACK message are not received after the retransmission timer times out, the data message must also be actively retransmitted according to the local cache.
[0104] In actual applications, a timer is set on the first gateway (GW2) and the second gateway (GW1) respectively. For example, assuming that the timer of the first gateway is T1 and the timer of the second gateway is T2, in general, the timeout time of T1 is shorter than the timeout time of T2. T1 is used to check whether all out-of-order messages are received within the first specified time. If all out-of-order messages are received before T1 times out, T1 is stopped. If all out-of-order messages have not been received after T1 times out, a NACK is sent to the second gateway. The NACK contains a specified PSN (the PSN of the out-of-order message that has not been received after the timeout). Specifically, one NACK can correspond to one specified PSN, or one NACK can contain multiple specified PSNs, requesting the second gateway to retransmit the message of the specified PSN. T2 is used to check whether an ACK is received within the second specified time. If an ACK is received before T2 times out, T2 is stopped. If an ACK is not received after T2 times out, the message is retransmitted.
[0105] Based on the same inventive concept as the above-mentioned inventive embodiment applied to the first gateway, for example, refer to Figure 4 FIG. 1 is a schematic diagram of the structure of a message processing device provided in an embodiment of the present application. The device is applied to a first gateway, the first gateway is located in the transmission path between the second gateway and the receiving end, and the second gateway is located in the transmission path between the sending end and the first gateway; the device includes:
[0106] A receiving unit 40, configured to receive a first message forwarded by a second gateway;
[0107] A judging unit 41, configured to judge whether packet loss occurs according to a first packet sequence number PSN of the first message;
[0108] The starting unit 42 is used to start a timer if the judging unit determines that packet loss occurs, and after the timer times out, the judging unit 41 is further used to judge whether a second message with a second PSN is received, wherein the second message is a message whose receiving sequence is before the first message, and the second PSN is smaller than the first PSN;
[0109] The sending unit 43 is used for sending a NACK message carrying the PSN of the unreceived second message to the second gateway if the judging unit 41 determines that any second message is not received, so that the second gateway retransmits the unreceived second message.
[0110] Optionally, the first gateway maintains an expected PSN; when judging whether packet loss occurs according to the first packet sequence number PSN of the first message, the judging unit 41 is specifically used to:
[0111] Determining whether the first PSN is equal to the expected PSN;
[0112] If it is determined that the first PSN is equal to the expected PSN, it is determined that no packet loss occurs;
[0113] If it is determined that the first PSN is greater than the expected PSN, it is determined that packet loss occurs.
[0114] Optionally, the device further comprises:
[0115] An accumulation unit, if it is determined that no packet loss occurs, the accumulation unit is used to accumulate the expected PSN by 1;
[0116] A cache unit, configured to cache the first message and forward the first message to the receiving end;
[0117] A feedback unit is used to feed back an ACK message corresponding to the first message to the first gateway.
[0118] Optionally, if the first gateway does not enable the out-of-order message receiving function,
[0119] If the judging unit 41 determines that packet loss occurs according to the first packet sequence number PSN of the first message, the sending unit 43 is used to send a NACK message carrying the second PSN to the second gateway, so that the second gateway retransmits the message whose PSN is the second PSN.
[0120] Based on the same inventive concept as the above-mentioned inventive embodiment applied to the second gateway, for example, refer to Figure 5As shown in the figure, it is a schematic structural diagram of a packet processing device provided by an embodiment of the present application. The device is applied to the second gateway, and the second gateway is located on the transmission path between the sending end and the first gateway, and the first gateway is located on the transmission path between the second gateway and the receiving end; the device includes:
[0121] A receiving unit 50, configured to receive a NACK packet carrying a target packet sequence number (PSN) sent by the first gateway. Wherein, when the first gateway determines that a packet loss has occurred based on the PSN of a received packet and does not receive a packet with the PSN being the target PSN after the started timer times out, it sends a NACK packet carrying the target PSN to the second gateway. The target packet is the packet whose reception sequence is before this packet, and the target PSN is less than the PSN of this packet.
[0122] A retransmission unit 51, configured to retransmit the target packet to the first gateway.
[0123] Optionally, the device further includes:
[0124] A deletion unit, if it receives an ACK packet corresponding to a packet sent by the first gateway, determines that the packet is successfully sent, and the deletion unit is configured to delete the packet cached locally.
[0125] Optionally, the device further includes a start unit, a judgment unit, and a retransmission unit:
[0126] The start unit is configured to start a retransmission timer after sending a packet to the second network;
[0127] After the retransmission timer times out, if the judgment unit determines that the ACK / NACK packet corresponding to this packet has not been received, the retransmission unit is configured to retransmit this packet to the first gateway.
[0128] The above units may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a certain unit above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0129] Furthermore, for the message processing device provided in the embodiments of the present application, from a hardware level, the schematic diagram of the hardware architecture of the message processing device can be seen in Figure 6 as shown, the message processing device may include: a memory 60 and a processor 61,
[0130] The memory 60 is used to store program instructions; the processor 61 calls the program instructions stored in the memory 60 and executes the method embodiments applied to the first gateway according to the obtained program instructions. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0131] Optionally, the present application further provides a first gateway, including at least one processing element (or chip) for executing the method embodiments applied to the first gateway.
[0132] Optionally, the present application further provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions for causing the computer to execute the method embodiments applied to the first gateway.
[0133] Furthermore, for the message processing device provided in the embodiments of the present application, from a hardware level, the schematic diagram of the hardware architecture of the message processing device can be seen in Figure 7 as shown, the message processing device may include: a memory 70 and a processor 71,
[0134] The memory 70 is used to store program instructions; the processor 71 calls the program instructions stored in the memory 70 and executes the method embodiments applied to the second gateway according to the obtained program instructions. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0135] Optionally, the present application further provides a second gateway, including at least one processing element (or chip) for executing the method embodiments applied to the second gateway described above.
[0136] Optionally, the present application further provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions for causing the computer to execute the method embodiments applied to the second gateway described above.
[0137] Here, the machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, and so on. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0138] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, email transceiver device, game console, tablet computer, wearable device, or a combination of any several of these devices.
[0139] For convenience of description, the above devices are described by dividing them into various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in one or more software and / or hardware.
[0140] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, system, or computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate a means for implementing the functions specified in one or more flows and / or one or more blocks. Figure 1 in one or more flows and / or one or more blocks Figure 1 of the functions specified in the block or blocks.
[0142] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction means that implements the functions specified in one or more flows and / or one or more blocks Figure 1 in one or more flows and / or one or more blocks Figure 1 of the functions specified in the block or blocks.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows and / or one or more blocks Figure 1 in one or more flows and / or one or more blocks Figure 1 of the functions specified in the block or blocks.
[0144] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.
Claims
1. A message processing method, characterized in that: Applied to a first gateway, the first gateway is located in the transmission path between a second gateway and a receiving end, and the second gateway is located in the transmission path between a sending end and the first gateway; the method comprises: Receiving a first message forwarded by a second gateway; Determining whether packet loss occurs according to the first packet sequence number PSN of the first message; If it is determined that packet loss occurs, start a timer, and after the timer times out, determine whether a second message with a PSN of a second PSN is received, wherein the second message is a message whose receiving sequence is before the first message, and the second PSN is smaller than the first PSN; If it is determined that any second message is not received, a NACK message carrying the PSN of the second message not received is sent to the second gateway, so that the second gateway retransmits the second message not received.
2. The method according to claim 1, characterized in that The first gateway maintains an expected PSN; and the step of determining whether packet loss occurs according to the first packet sequence number PSN of the first message comprises: Determine whether the first PSN is equal to the expected PSN; If it is determined that the first PSN is equal to the expected PSN, it is determined that no packet loss occurs; If it is determined that the first PSN is greater than the expected PSN, it is determined that packet loss occurs.
3. The method according to claim 2, characterized in that The method further comprises: If it is determined that no packet loss occurs, the expected PSN is accumulated by 1; caching the first message, and forwarding the first message to the receiving end; Feedback an ACK message corresponding to the first message to the first gateway.
4. The method according to claim 1, characterized in that If the first gateway does not enable the out-of-order message receiving function, the method further includes: If packet loss is determined to have occurred according to the first packet sequence number PSN of the first message, a NACK message carrying the second PSN is sent to the second gateway, so that the second gateway retransmits a message whose PSN is the second PSN.
5. A message processing method, characterized in that: Applied to a second gateway, the second gateway is located in a transmission path between a sending end and a first gateway, and the first gateway is located in a transmission path between the second gateway and a receiving end; the method comprises: Receiving a NACK message carrying a target packet sequence number PSN sent by the first gateway, wherein the first gateway determines that packet loss occurs according to the PSN of a received message, and after the started timer times out, if no message with the PSN being the target PSN is received, then the first gateway sends a NACK message carrying the target PSN to the second gateway, the target message being a message with a receiving sequence before the message, and the target PSN being less than the PSN of the message; Retransmit the target message to the first gateway.
6. The method according to claim 5, characterized in that The method further comprises: If an ACK message corresponding to a message sent by the first gateway is received, it is determined that the message is sent successfully, and the message in the local cache is deleted.
7. The method according to claim 5, characterized in that The method further comprises: After sending a message to the second network, starting a retransmission timer; After the retransmission timer times out, if it is determined that the ACK / NACK message corresponding to the message has not been received, the message is retransmitted to the first gateway.
8. A message processing device, characterized in that: Applied to a first gateway, the first gateway is located in the transmission path between a second gateway and a receiving end, and the second gateway is located in the transmission path between a sending end and the first gateway; the device comprises: A receiving unit, configured to receive a first message forwarded by a second gateway; A judging unit, configured to judge whether packet loss occurs according to a first packet sequence number PSN of the first message; A starting unit, if the judging unit determines that packet loss occurs, the starting unit is used to start a timer, and after the timer times out, the judging unit is further used to judge whether a second message with a second PSN is received, wherein the second message is a message whose receiving sequence is before the first message, and the second PSN is smaller than the first PSN; The sending unit is used for sending a NACK message carrying the PSN of the unreceived second message to the second gateway if the judging unit determines that any second message is not received, so that the second gateway retransmits the unreceived second message.
9. A message processing device, characterized in that: Applied to a second gateway, the second gateway is located in a transmission path between a sending end and a first gateway, and the first gateway is located in a transmission path between the second gateway and a receiving end; the device comprises: A receiving unit, configured to receive a NACK message carrying a target packet sequence number PSN sent by a first gateway, wherein the first gateway determines that packet loss occurs according to the PSN of a received message, and after the started timer times out, if no message with the PSN being the target PSN is received, then the first gateway sends a NACK message carrying the target PSN to the second gateway, wherein the target message is a message whose receiving sequence is before the message, and the target PSN is less than the PSN of the message; A retransmission unit is used to retransmit the target message to the first gateway.
10. A message processing device, characterized in that: The message processing device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps of the method according to any one of claims 1 to 4 or claims 5 to 7 according to the obtained program instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method according to any one of claims 1 to 4 or claims 5 to 7.