Communication method, communication apparatus, and communication device
By using the serial number and confirmation number of TCP or RDMA protocol in the forwarding device to detect service flow messages, the problem that BFD cannot detect data flow failures is solved, and efficient and flexible fault perception and positioning is achieved, which is suitable for network applications with low latency requirements.
Patent Information
- Application Number
- PCT/CN2025/070717
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-02
- Filing Date
- 2025-01-06
- Publication Date
- 2025-08-07
AI Technical Summary
The existing two-way forwarding detection (BFD) protocol can only detect the integrity of the link and cannot perceive the failure of the data flow, resulting in gray failures that cannot be detected and processed in time in the network, especially in application scenarios with low latency requirements that cannot be met.
By detecting the message sequence number information of the target service flow in the forwarding device, using the sequence number and confirmation number in the TCP or RDMA protocol, we can determine whether the service flow has failed, and realize orderly transmission and fault perception of the data flow without modifying the original message format.
It realizes efficient detection of service flow failures, can timely sense and locate faults, reduces detection time, is suitable for application scenarios with low latency requirements, and improves network reliability and flexibility.
Smart Images

Figure CN2025070717_07082025_PF_FP_ABST
Abstract
Description
Communication method, communication device and communication equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 2, 2024, with application number 202410165492.3 and application name “Communication Method, Communication Device and Communication Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a communication method, a communication device, and a communication equipment. Background Art
[0003] Bidirectional Forwarding Detection (BFD) is a network protocol that rapidly detects and monitors the forwarding connectivity of links or Internet Protocol (IP) routes within a network. BFD can improve network performance by rapidly detecting communication failures and enabling network devices to more quickly establish alternate channels and restore communication.
[0004] BFD packets are periodically transmitted between network devices on the connected link. If a network device does not receive a BFD packet within a preset time, it can determine that the link connected to the other network device has failed.
[0005] BFD can only detect link integrity (i.e., whether a link is faulty) but cannot detect data flow failures. Therefore, a data flow-oriented fault detection solution is urgently needed. Summary of the Invention
[0006] The present application provides a communication method, a communication apparatus, and a communication device for detecting service flow failures.
[0007] In a first aspect, the present application provides a communication method. After a message in a target service flow is sent from a source device, it is forwarded by a forwarding device and reaches a destination device. Each message in the target service flow includes sequence number information corresponding to the message. In embodiments of the present application, the message sequence number information is used to implement important functions such as orderly message transmission, packet retransmission, and error recovery, thereby ensuring reliable transmission of the service flow within the network.
[0008] In an embodiment of the present application, a forwarding device receives a first message in a target service flow, the first message including first sequence number information corresponding to the first message. The forwarding device can obtain second sequence number information of a second message, wherein both the first message and the second message are from the target service flow, that is, the first message and the second message are different messages in the same service flow.
[0009] In an embodiment of the present application, the forwarding device can determine that a target service flow has failed based on the first sequence number information and the second sequence number information. In actual applications, the target service flow includes multiple messages, and these messages will continuously pass through the forwarding device. The forwarding device can then execute the communication method in the embodiment of the present application based on these messages, thereby determining whether the target service flow has failed and promptly perceiving the failure of the target service flow. On the other hand, the communication method in the embodiment of the present application does not require modification or expansion of the original message format, and thus has low implementation complexity and high efficiency in fault detection.
[0010] Based on the first aspect, in an optional implementation, the sequence number information of the message may be a sequence number (Sequence Number) in a TCP header, where the sequence number of the message is used to indicate the position of the data content of the message in the complete data content of the target service flow; or, it may be an acknowledgment number (Acknowledgment Number) in a TCP header, where the acknowledgment number of the message is used to indicate the position of the message successfully received by the destination device in the target service flow; or, it may be both the sequence number and acknowledgment number in a TCP header; or, it may be a packet sequence number (PSN) in a Remote Direct Memory Access (RDMA) message, where the PSN of the RDMA message is used to indicate the order of RDMA messages sent or received through an RDMA queue pair (QP).
[0011] Based on the first aspect, in an optional implementation, in a Transmission Control Protocol (TCP) scenario, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, and the destination port of the first message is the same as the source port of the second message. The first sequence number information of the first message includes at least the sequence number (Sequence Number) in the TCP header of the first message, and the second sequence number information of the second message includes at least the acknowledgment number (Acknowledgment Number) in the TCP header of the second message. Optionally, in actual applications, the transport layer protocol of the first message and the second message is the same.
[0012] Optionally, the first message and the second message are the latest messages obtained by the forwarding device in two opposite transmission directions, respectively. Assume that the target service flow includes messages in two opposite transmission directions. If the first message is the latest message obtained by the forwarding device in one transmission direction, the second message is the latest message obtained by the forwarding device (or other device that establishes a peer link with the forwarding device) in the other transmission direction.
[0013] The forwarding device obtains the first sequence number information (i.e., the sequence number of the first message) and the second sequence number information (i.e., the confirmation number of the second message). If the sequence number in the TCP header of the first message is greater than the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, the forwarding device determines that a fault has occurred in the target service flow. The current time is the time when the forwarding device performs fault determination on the target service flow. In actual applications, the frequency, cycle, time, and size of the preset threshold for the forwarding device to perform fault determination can be adaptively configured according to business requirements and network environment to improve the flexibility of the solution. Specifically, for the two opposite transmission directions of the target service flow, the sequence number of the message in one direction corresponds to the confirmation number of the message in the other direction. If the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the message of the target service flow has not been received for a long time in the transmission direction of the second message of the forwarding device. If the sequence number in the TCP header of the first packet is greater than the acknowledgment number in the TCP header of the second packet, this indicates that the target service flow is continuously being transmitted in the direction of the first packet. This means that the forwarding device cannot detect a pause in the target service flow, which is causing the long delay in receiving packets from the target service flow in the direction of the second packet. Therefore, the forwarding device can determine that a failure has occurred in the target service flow.
[0014] Based on the first aspect, in an optional implementation, in a TCP scenario, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the source port of the first message is the same as the source port of the second message, and the destination port of the first message is the same as the destination port of the second message. The first sequence number information of the first message includes the sequence number and acknowledgment number in the TCP header of the first message, and the second sequence number information of the second message includes the sequence number and acknowledgment number in the TCP header of the second message. Optionally, in actual applications, the transport layer protocol of the first message and the second message is the same.
[0015] The first message is the latest message currently obtained by the forwarding device, and the second message is the previous message of the first message in the same transmission direction. That is, the forwarding device first receives the second message, and then receives the first message. After the first message arrives at the forwarding device, the forwarding device uses the time when the first message arrives at the forwarding device as the current time to determine whether the target business flow is faulty. If the sequence number in the TCP header of the first message is less than or equal to the sequence number in the TCP header of the second message, and the confirmation number in the TCP header of the first message is less than or equal to the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the first message received by the forwarding device is a retransmitted message, and the forwarding device can determine that the target business flow has failed. Among them, the current time is the time when the first message arrives at the forwarding device.
[0016] Based on the first aspect, in an optional implementation, in a TCP scenario, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, and the destination port of the first message is the same as the source port of the second message. The first sequence number information of the first message includes a sequence number (Sequence Number) and an acknowledgment number (Acknowledgment Number) in the TCP header of the first message, and the second sequence number information of the second message includes at least a sequence number (Sequence Number) and an acknowledgment number (Acknowledgment Number) in the TCP header of the second message.
[0017] In one possible implementation, the first message and the second message are the latest messages received by the forwarding device in two opposite transmission directions. For example, if the first message is an uplink message and the second message is a downlink message, the first message is the latest uplink message received by the forwarding device in the uplink direction, and the second message is the latest downlink message received by the forwarding device (or another device that establishes a peer link with the forwarding device) in the downlink direction.
[0018] The forwarding device obtains the first sequence number information (i.e., the sequence number and confirmation number of the first message) and the second sequence number information (i.e., the sequence number and confirmation number of the second message). If the confirmation number in the TCP header of the first message is smaller than the sequence number in the TCP header of the second message, and the difference between the current time and the second arrival time of the first message is greater than the preset threshold, it means that the forwarding device can receive the target service flow in the direction of the second message, but the forwarding device has not received the target service flow in the same direction as the first message for a long time (exceeding the preset time length), thus causing the confirmation number of the first message to stop increasing. Therefore, the forwarding device determines that the target service flow has failed, and the upstream path of the second message is normal and no failure has occurred, wherein the upstream path of the second message refers to the path that the second message passes through during the process of being transmitted from the sending end to the forwarding device. Therefore, while the forwarding device perceives the target service flow, it can also further determine the normal path that the target service flow passes through, facilitating subsequent fault location.
[0019] Based on the first aspect, in an optional implementation, the forwarding device can further determine that the upstream path of the second message is normal and has not experienced a fault. In this case, the cause of the fault is unrelated to the device on the upstream path of the second message (i.e., the upstream device of the second message). Therefore, the forwarding device can send a fault notification to the upstream device of the second message, indicating that the upstream path of the second message is normal, thereby preventing the upstream device of the second message from performing an invalid path switch.
[0020] Based on the first aspect, in an optional implementation, the first message and the second message are messages in the RDMA protocol, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the queue pairs (QPs) of the first message and the second message are different, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message. Specifically, the first message and the second message are messages in different transmission directions in the same RDMA stream. In other words, the first message and the second message have the same queue pair context (QPC) and queue pair key (QKey), but the destination QP (Destination QP) of the first message and the destination QP of the second message are different. Optionally, the first message can be a request message in the RDMA service flow, and the second message is a response message in the RDMA service flow; or, the second message can be a response message in the RDMA service flow, and the second message is a request message in the RDMA service flow. If the PSN of the first message is greater than the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it is determined that a failure has occurred in the target service flow. Specifically, the RDMA protocol provides a response mechanism, which is used to ensure that RMDA messages can be reliably received. In an RDMA scenario with a response mechanism enabled, after the destination device of the target service flow receives a request message from the source device, it will determine the PSN of the response message to the request message based on the PSN of the request message. The PSN of the response message indicates the position of the data content of the response message in the complete data content of the target service flow, and also indicates the position of the request message that the destination device has successfully received in the target service flow. After receiving the response message, the source device continues to determine the PSN of the new request message based on the PSN in the response message so as to continue to send the new request message. Therefore, in the RDMA scenario, for the two opposite transmission directions of the target service flow, the PSN of the message in one direction corresponds to the PSN of the message in the other direction. If the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it indicates that no messages from the target service flow have been received in the direction of the second message for an extended period. If the PSN of the first message is greater than the PSN of the second message, it indicates that the target service flow is continuously transmitted in the direction of the first message. This means that the forwarding device can rule out the possibility that the target service flow has been interrupted, causing the forwarding device to not receive messages from the target service flow in the direction of the second message. Therefore, the forwarding device can determine that a failure has occurred in the target service flow.
[0021] Based on the first aspect, in an optional implementation, the first message and the second message are messages of the same type in the RDMA protocol, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the queue pair (Queue Pair, QP) of the first message and the second message is the same, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message.
[0022] The first message is the latest RDMA message currently obtained by the forwarding device, and the second message is the previous RDMA message of the first message in the same transmission direction. That is, the forwarding device first receives the second message, and then receives the first message. After the first message arrives at the forwarding device, the forwarding device uses the time when the first message arrives at the forwarding device as the current time to determine whether the target business flow has failed. In the RDMA protocol, the PSN of the RDMA message indicates the position of the data content of the RDMA message in the complete data content of the target business flow. Therefore, if the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the first message received by the forwarding device is a retransmitted message, and the forwarding device can determine that the target business flow has failed. Among them, the current time is the time when the first message arrives at the forwarding device.
[0023] Based on the first aspect, in an optional implementation, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message. Specifically, the first message and the second message are messages of different transmission directions in the same RDMA stream. In other words, the first message and the second message have the same Queue Pair Context (QPC) and Queue Pair Key (QKey), but the destination QP (Destination QP) of the first message is different from the destination QP of the second message. Optionally, the first message can be a request message in the RDMA service flow, and the second message is a response message in the RDMA service flow; or, the second message can be a response message in the RDMA service flow, and the second message is a request message in the RDMA service flow. As can be seen from the above, in an RDMA scenario with a response mechanism enabled, the PSN of an RDMA message indicates the position of the data content of the RDMA message within the complete data content of the target service flow, and also indicates the position of the message successfully received by the destination device within the target service flow. That is, for the two opposite transmission directions of the target service flow, the PSN of the message in one direction corresponds to the PSN of the message in the other direction. If the PSN of the first message is less than the PSN of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, it means that the forwarding device can receive the target service flow in the direction of the second message, but the forwarding device has not received the target service flow in the same direction as the first message for a long time (exceeding the preset time), resulting in the PSN of the first message stopping to increase. Therefore, the forwarding device determines that the target service flow has failed, and the upstream path of the second message is normal and has not failed, wherein the upstream path of the second message refers to the path that the second message passes through during its transmission to the forwarding device.
[0024] Based on the first aspect, in an optional implementation, a second message in the target service flow is transmitted to a forwarding device, and the second message includes second sequence number information. After receiving the second message, the forwarding device can obtain the second sequence number information of the second message. Furthermore, the forwarding device records the time when the second message arrives at the forwarding device, thereby obtaining the first arrival time of the second message. In other words, the first arrival time of the second message is the time when the second message arrives at the forwarding device.
[0025] Based on the first aspect, in an optional implementation, the forwarding device establishes a peer link with several other forwarding devices. The second message in the target business flow is not delivered to the forwarding device, but is delivered to other forwarding devices that establish a peer link with the forwarding device. Then the forwarding device can synchronously receive the second sequence number information of the second message through the peer link. Thus, the forwarding device can make a fault judgment of the target business flow based on the messages in the target business flow received by other forwarding devices, so that the communication method of the embodiment of the present application is still applicable to the scenario where the transmission paths of the first message and the second message are inconsistent, thereby improving the flexibility of the solution and increasing the applicable scenarios of the solution. The first arrival time of the second message can be the time when the second message is delivered to the peer link of the forwarding device, or it can be the time when the forwarding device receives the second sequence number information, which is not limited here.
[0026] Based on the first aspect, in an optional implementation, after the forwarding device determines that a fault occurs in the target service flow, it generates fault information for the target service flow, where the fault information indicates that a fault occurs in the target service flow.
[0027] Optionally, the fault information includes, but is not limited to, the time when the fault of the target service flow is determined to have occurred, the first sequence number information of the first packet, the second sequence number information of the second packet, and a quintuple (or triplet) of the target service flow. For example, the quintuple may be the source IP address, destination IP address, source port, destination port, and transport layer protocol of the target service flow in a TCP scenario; the triplet may be the source IP address, destination IP address, and QP of the target service flow in an RDMA scenario.
[0028] Optionally, the target service flow's fault information can be made available to administrators for real-time query. Alternatively, the forwarding device can further send fault information about the target service flow to the controller, indicating that a fault has occurred in the target service flow. Upon receiving the fault information about the target service flow, the controller can analyze the fault.
[0029] In a second aspect, the present application provides a communication device, the communication device comprising:
[0030] a transceiver unit, configured to receive a first message, where the first message includes first sequence number information;
[0031] The transceiver unit is further configured to obtain second sequence number information of the second message, wherein the first message and the second message correspond to the target service flow;
[0032] The processing unit is used to determine that a target service flow has a fault according to the first sequence number information and the second sequence number information.
[0033] Based on the second aspect, in an optional implementation, a source Internet Protocol (IP) address of the first message is the same as a destination IP address of the second message, the destination IP address of the first message is the same as a source IP address of the second message, a source port of the first message is the same as a destination port of the second message, the destination port of the first message is the same as a source port of the second message, the first sequence number information includes a sequence number in a Transmission Control Protocol (TCP) header of the first message, and the second sequence number information includes an acknowledgment number in a TCP header of the second message;
[0034] The processing unit is specifically used to: determine that a target service flow has failed when the sequence number in the TCP header of the first message is greater than the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0035] Based on the second aspect, in an optional implementation, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the source port of the first message is the same as the source port of the second message, the destination port of the first message is the same as the destination port of the second message, the first sequence number information includes a sequence number and an acknowledgment number in a TCP header of the first message, and the second sequence number information includes a sequence number and an acknowledgment number in a TCP header of the second message;
[0036] The processing unit is specifically used to: determine that a target service flow has failed when the sequence number in the TCP header of the first message is less than or equal to the sequence number in the TCP header of the second message, and the confirmation number in the TCP header of the first message is less than or equal to the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0037] Based on the second aspect, in an optional implementation, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, the destination port of the first message is the same as the source port of the second message, the first sequence number information includes a sequence number and an acknowledgment number in a TCP header of the first message, and the second sequence number information includes a sequence number and an acknowledgment number in a TCP header of the second message;
[0038] The processing unit is specifically used to: when the confirmation number in the TCP header of the first message is less than the sequence number in the TCP header of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, determine that the upstream path of the second message is normal.
[0039] Based on the second aspect, in an optional implementation, the transceiver unit is further configured to send a fault notification to an upstream device of the second message, where the fault notification is used to indicate that an upstream path of the second message is normal.
[0040] Based on the second aspect, in an optional implementation, the first message and the second message are messages in a remote direct memory access (RDMA) protocol, a source IP address of the first message is the same as a source IP address of the second message, a destination IP address of the first message is the same as a destination IP address of the second message, a queue pair (QP) of the first message is the same as a QP of the second message, the first sequence number information includes a packet sequence number (PSN) of the first message, and the second sequence number information includes a PSN of the second message;
[0041] The processing unit is specifically used to: determine that a target service flow fails when the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0042] Based on the second aspect, in an optional implementation, the first message and the second message are messages in a remote direct memory access (RDMA) protocol, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes a PSN of the first message, and the second sequence number information includes a PSN of the second message;
[0043] The processing unit is specifically configured to determine that a target service flow fails when the PSN of the first message is greater than the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0044] Based on the second aspect, in an optional implementation, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes a PSN of the first message, and the second sequence number information includes a PSN of the second message;
[0045] The processing unit is specifically configured to: determine that the upstream path of the second message is normal when the PSN of the first message is smaller than the PSN of the second message and the difference between the current time and the second arrival time of the first message is greater than a preset threshold.
[0046] Based on the second aspect, in an optional implementation, the transceiver unit is specifically configured to receive a second message, where the second message includes second sequence number information.
[0047] Based on the second aspect, in an optional implementation manner, the second sequence number information is received through a peer link.
[0048] Based on the second aspect, in an optional implementation, the transceiver unit is further configured to send fault information for the target service flow to the controller, where the fault information is used to indicate that a fault has occurred in the target service flow.
[0049] The information interaction and execution process and other contents of the embodiment shown in this aspect are based on the same concept as the embodiment shown in the first aspect. Therefore, for the description of the beneficial effects shown in this aspect, please refer to the above-mentioned first aspect, and the details will not be repeated here.
[0050] In a third aspect, the present application provides a communication device comprising: a processor coupled to a memory, the memory being used to store instructions, which, when executed by the processor, enables the computing device to implement the method of the above-mentioned first aspect or any possible implementation of the first aspect.
[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having instructions stored thereon, which, when executed, enables a computer to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0053] In a sixth aspect, an embodiment of the present application provides a chip, comprising: a processor, the processor being coupled to a memory, the memory being used to store instructions, and when the instructions are executed by the processor, the chip implements the method in the above-mentioned first aspect, or any possible implementation of the first aspect.
[0054] Among them, the technical effects brought about by any implementation method of the third to sixth aspects can refer to the technical effects brought about by the implementation method of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0056] Figure 1 is a schematic diagram of a BFD scenario;
[0057] FIG2 is a schematic diagram of a possible, non-limiting network architecture of the communication method in an embodiment of the present application;
[0058] FIG3 is a flow chart of a communication method according to an embodiment of the present application;
[0059] FIG4 is a diagram illustrating a possible scenario in which a forwarding device obtains second sequence number information in an embodiment of the present application;
[0060] FIG5 is a schematic diagram of a possible scenario of a communication method according to an embodiment of the present application;
[0061] FIG6 is a schematic diagram of another possible scenario of the communication method in an embodiment of the present application;
[0062] FIG7 is a schematic diagram of another possible scenario of the communication method in an embodiment of the present application;
[0063] FIG8 is a schematic diagram of an embodiment of the present application of a communication method applied to an RDMA scenario;
[0064] FIG9 is a schematic diagram of a possible scenario of a communication method according to an embodiment of the present application;
[0065] FIG10 is a schematic structural diagram of a communication device provided in an embodiment of the present application;
[0066] FIG11 is a schematic diagram of a logical structure of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] Embodiments of the present application provide a communication method, a communication apparatus, and a communication device for detecting service flow failures.
[0068] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the embodiments of the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0069] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0070] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and in the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatus.
[0071] The following is an explanation of some nouns or terms used in the embodiments of the present application, which are also considered part of the content of the invention.
[0072] Transmission Control Protocol (TCP): TCP is a key transport layer protocol for the Internet. It provides connection-oriented, reliable, ordered, byte-stream transmission services. Before an application can use TCP, it must first establish a TCP connection. TCP achieves reliable transmission through mechanisms such as checksums, sequence numbers, acknowledgments, retransmission control, connection management, and window control.
[0073] Remote Direct Memory Access (RDMA): RDMA is a high-performance network communication technology with the advantages of high bandwidth, low latency, no central processing unit (CPU) overhead, and zero copy. RDMA transfers data directly to a computer's storage area over the network, rapidly moving data from one system to a remote system's memory without affecting the operating system and requiring minimal computer processing power. RDMA eliminates the overhead of external memory copies and context switches, freeing up memory bandwidth and CPU cycles for improved application system performance.
[0074] The sequence number field in the TCP header is a 32-bit unsigned integer and plays a critical role in TCP data transmission. The sequence number uniquely identifies the position of each byte in the data stream sent from the sender to the receiver. Each time data is sent, the sequence number of the TCP packet is incremented so that the receiver can reassemble the received data in the correct order. The sequence number in the TCP header is necessary because network transmission may disrupt the order of data. By using the sequence number, the receiver can determine the correct position of each packet in the data stream and reassemble them to recover the original data.
[0075] The Acknowledgment Number field in the TCP header is also a 32-bit unsigned integer. In TCP communication, the acknowledgment number indicates the position of a successfully received message in the data stream. After the receiver correctly receives the data, it sends a TCP message with the acknowledgment number as a confirmation of the received data. This allows the sender to know which data has been correctly received and to continue sending subsequent data.
[0076] Gray Failures: Gray failures are those that are difficult to detect or locate. These failures typically do not immediately cause a complete system crash or service outage, but they can potentially negatively impact system performance, stability, and availability, and may lead to data inconsistencies or reduced service quality. Examples include performance degradation, random packet loss, memory jitter, and non-fatal exceptions.
[0077] Next, possible application scenarios involved in the embodiments of the present application are introduced.
[0078] In real-world network environments, gray failures often exist, including silent failures, misconfigurations, routing black holes, hardware failures, or physical port failures. Currently, there are multiple definitions of gray failures. One definition states: "When at least one application observes the system as unhealthy, while system fault detection tools observe the system as healthy, the system is defined as experiencing a gray failure." Another definition states: "A gray failure is a hardware failure that causes non-instantaneous packet loss in traffic forwarded on a forwarding device (switch). Congestion does not qualify as a gray failure." Both definitions have in common that they exclude link failures (such as port failures or link disconnections) from the gray failure category.
[0079] In real-world network environments, gray failures are a major type of network failure, manifesting in various ways, such as performance degradation, random packet loss, and memory jitter. Currently, there is no effective detection solution for these gray failures.
[0080] Bidirectional Forwarding Detection (BFD) is a network protocol that rapidly detects and monitors the forwarding connectivity of links or Internet Protocol (IP) routes within a network. BFD can improve network performance by rapidly detecting communication failures and enabling network devices to more quickly establish alternate channels and restore communication.
[0081] BFD packets are periodically transmitted between network devices at both ends on the connected link. If a network device does not receive a BFD packet within a preset time period, the network device can determine that the link connected to the opposite network device has failed. Please refer to Figure 1, which is a schematic diagram of a BFD scenario. As shown in Figure 1, there are two reachable links (link 1 and link 2) between network device A and network device B, and network device A periodically sends BFD packets to network device B through link 1 and link 2 respectively. If network device A does not receive a BFD packet from network device B through link 1 within a preset time period, network device A determines that link 1 connecting it to network device B has failed; if network device A receives a BFD packet from network device B through link 2, network device A determines that link 2 connecting it to network device B is normal.
[0082] BFD can only detect link integrity (i.e., whether a link is faulty). However, gray failures occur primarily due to misconfiguration of routing tables on network devices, resulting in inconsistencies between the actual forwarding path and the expected forwarding path. Therefore, gray failures are unrelated to link integrity. Therefore, BFD cannot detect failures in data flows.
[0083] On the other hand, BFD fault detection requires network devices to periodically generate BFD packets, which consumes considerable resources. Furthermore, in practical applications, BFD fault detection and convergence typically take around 200 milliseconds. BFD solutions cannot meet the latency requirements of applications with low latency requirements (e.g., latency under 10 milliseconds), such as gaming, autonomous driving, and live news broadcasts.
[0084] In view of this, an embodiment of the present application provides a communication method, a communication device and a communication equipment for detecting business flow failures. For ease of understanding, first, a possible, non-restrictive network architecture of the communication method in the embodiment of the present application is introduced. Please refer to Figure 2, which is a schematic diagram of a possible, non-restrictive network architecture of the communication method in the embodiment of the present application. In the scenario illustrated in Figure 2, the network architecture includes server 1, server 2, switch 1, switch 2, switch 3, switch 4, a controller and a network. Among them, server 1 and server 2 communicate through several forwarding devices (switch 1, switch 2, switch 3 and switch 4 as shown in Figure 2). As shown in Figure 2, the message sent by server 1 is transmitted through switch 1 and switch 3 to reach server 2; the message sent by server 2 is transmitted through switch 4 and switch 2 to reach server 1. The controller, as an analyzer, is used to receive fault information of the business flow from each forwarding device in order to analyze the business flow that has failed.
[0085] It should be understood that the network architecture shown in Figure 2 above is only an exemplary description. In actual applications, failures may occur on any forwarding path in any network structure. The communication method in the embodiment of the present application is applicable to at least one forwarding device on the transmission path of the business flow (message), so as to detect business flow failures. Among them, the forwarding device is a communication entity for sending signals, or receiving signals, or sending and receiving signals. Optionally, the communication entity can be a router, a switch, a virtual switch, a virtual router or an intelligent network card, etc., which are not specifically limited here. Next, the communication method in the embodiment of the present application is introduced. Please refer to Figure 3, which is a flow chart of the communication method in the embodiment of the present application. The communication method in the embodiment of the present application takes the forwarding device as the execution subject as an example to illustrate the method, but the present application does not limit the execution subject of the interactive illustration, nor does it limit the specific hardware form or software form of the forwarding device. For example, the forwarding device in Figure 3 can be a chip, chip system, or processor used to support the forwarding device in implementing the method; or, the forwarding device can also be a logical node, logical module, or software used to implement all or part of the forwarding device functions; the forwarding device can also be a collective term for multiple logical nodes, multiple logical modules, or multiple software used to implement the communication method. As shown in Figure 3, the communication method in the embodiment of the present application includes but is not limited to steps 101 to 103.
[0086] 101. The forwarding device receives the first message.
[0087] A forwarding device is a transit device on the path from the source device to the destination device of a target service flow. After the packets in the target service flow are sent from the source device, they are forwarded by the forwarding device before reaching the destination device. Each packet in the target service flow includes its corresponding sequence number information. In the embodiments of the present application, this message sequence information is used to implement important functions such as orderly message transmission, packet retransmission, and error recovery, thereby ensuring the reliable transmission of service flows within the network. In one possible implementation, the sequence number information of a message may be a sequence number (Sequence Number) in a TCP header, which indicates the position of the data content of the message in the complete data content of the target service flow; or, it may be an acknowledgment number (Acknowledgment Number) in a TCP header, which indicates the position of the message successfully received by the destination device in the target service flow; or, it may be both the sequence number and acknowledgment number in a TCP header; or, it may be a packet sequence number (PSN) in a Remote Direct Memory Access (RDMA) message, which indicates the order of RDMA messages sent or received through an RDMA queue pair (QP).
[0088] In the embodiment of the present application, the first message in the target service flow is transmitted to the forwarding device, and the first message includes the first sequence number information corresponding to the first message. After receiving the first message, the forwarding device sends the first message to the next-hop device.
[0089] 102. The forwarding device obtains the second sequence number information of the second message.
[0090] The forwarding device obtains the second sequence number information of the second message, wherein the first message and the second message both come from the target service flow, that is, the first message and the second message are different messages in the same service flow. The first message and the second message can be transmitted in the same direction, that is, the source IP address of the first message and the source IP address of the second message are the same, and the destination IP address of the first message and the destination IP address of the second message are the same; or the first message and the second message can be transmitted in different directions, that is, the source IP address of the first message and the destination IP address of the second message are the same, and the destination IP address of the first message and the source IP address of the second message are the same.
[0091] In the embodiment of the present application, the execution order of step 101 and step 102 is not limited. For example, step 101 may be executed first, and then step 102; or step 102 may be executed first, and then step 101; or step 101 and step 102 may be executed simultaneously. The specific execution order is not limited here.
[0092] In one possible implementation, the second message in the target service flow is transmitted to the forwarding device, and the second message includes the second sequence number information. After receiving the second message, the forwarding device can obtain the second sequence number information of the second message. Furthermore, the forwarding device records the time when the second message arrives at the forwarding device, thereby obtaining the first arrival time of the second message. In other words, the first arrival time of the second message is the time when the second message arrives at the forwarding device.
[0093] In one possible implementation, the forwarding device establishes a peer link with several other forwarding devices. The second message in the target business flow is not delivered to the forwarding device, but is delivered to other forwarding devices that establish a peer link with the forwarding device. Then the forwarding device can synchronously receive the second sequence number information of the second message through the peer link. Thus, the forwarding device can make a fault determination of the target business flow based on the messages in the target business flow received by other forwarding devices, so that the communication method of the embodiment of the present application is still applicable to the scenario where the transmission paths of the first message and the second message are inconsistent, thereby improving the flexibility of the solution and increasing the applicable scenarios of the solution. The first arrival time of the second message can be the time when the second message is delivered to the peer link of the forwarding device, or it can be the time when the forwarding device receives the second sequence number information, which is not limited here.
[0094] For ease of understanding, please refer to Figure 4, which is an example diagram of a possible scenario in which a forwarding device obtains the second sequence number information in an embodiment of the present application. As shown in Figure 4, forwarding device A establishes a peer link with forwarding device B. The first message is transmitted to forwarding device A, and the second message is transmitted to forwarding device B. Forwarding device B can synchronize the second sequence number information of the second message to forwarding device A through the peer link, so that forwarding device A obtains the second sequence number information of the second message; alternatively, forwarding device A can synchronize the first sequence number information of the first message to forwarding device B through the peer link, so that forwarding device B obtains the first sequence number information of the first message.
[0095] 103. The forwarding device determines that a failure occurs in the target service flow based on the first sequence number information and the second sequence number information.
[0096] In an embodiment of the present application, the forwarding device can determine that a target service flow has failed based on the first sequence number information and the second sequence number information. In actual applications, the target service flow includes multiple messages, and these messages will continuously pass through the forwarding device. The forwarding device can then execute the communication method in the embodiment of the present application based on these messages, thereby determining whether the target service flow has failed and promptly perceiving the failure of the target service flow. On the other hand, the communication method in the embodiment of the present application does not require modification or expansion of the original message format, and thus has low implementation complexity and high efficiency in fault detection.
[0097] In one possible implementation, after the forwarding device determines that a target business flow has failed, it generates fault information for the target business flow, and the fault information indicates that a target business flow has failed. Specifically, the fault information may include but is not limited to the time when the target business flow is determined to have failed, the first sequence number information of the first message, the second sequence number information of the second message, and the quintuple (or triplet) of the target business flow. Exemplarily, the quintuple may be the source IP address, destination IP address, source port, destination port, and transport layer protocol of the target business flow in a TCP scenario; the triplet may be the source IP address, destination IP address, and QP of the target business flow in an RDMA scenario. Optionally, the fault information of the target business flow can be queried in real time by the management personnel, or the forwarding device may further send the fault information for the target business flow to the controller, and the fault information is used to indicate that a target business flow has failed. After the controller receives the fault information for the target business flow, it can analyze the current failure of the target business flow.
[0098] In the embodiment of the present application, the forwarding device obtains the first sequence number information and the second sequence number information, and can determine whether a target service flow has a fault through various determination logics. The various determination logics in the embodiment of the present application are introduced below.
[0099] The first judgment logic: The forwarding device judges the fault of the target service flow based on two messages in different transmission directions in the target service flow.
[0100] In a TCP scenario, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, and the destination port of the first message is the same as the source port of the second message. The first sequence number information of the first message includes at least the sequence number (Sequence Number) in the TCP header of the first message, and the second sequence number information of the second message includes at least the acknowledgment number (Acknowledgment Number) in the TCP header of the second message. Optionally, in actual applications, the transport layer protocol of the first message and the second message is the same.
[0101] In one possible implementation, the first message and the second message are the latest messages received by the forwarding device in two opposite transmission directions. Assuming that the target service flow includes messages in two opposite transmission directions, if the first message is the latest message received by the forwarding device in one transmission direction, the second message is the latest message received by the forwarding device (or another device that has established a peer link with the forwarding device) in the other transmission direction.
[0102] The forwarding device obtains the first sequence number information (i.e., the sequence number of the first message) and the second sequence number information (i.e., the confirmation number of the second message). If the sequence number in the TCP header of the first message is greater than the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, the forwarding device determines that a fault has occurred in the target service flow. The current time is the time when the forwarding device performs fault determination on the target service flow. In actual applications, the frequency, cycle, time, and size of the preset threshold for the forwarding device to perform fault determination can be adaptively configured according to business requirements and network environment to improve the flexibility of the solution. Specifically, for the two opposite transmission directions of the target service flow, the sequence number of the message in one direction corresponds to the confirmation number of the message in the other direction. If the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the message of the target service flow has not been received for a long time in the transmission direction of the second message of the forwarding device. If the sequence number in the TCP header of the first packet is greater than the acknowledgment number in the TCP header of the second packet, this indicates that the target service flow is continuously being transmitted in the direction of the first packet. This means that the forwarding device cannot detect a pause in the target service flow, which is causing the long delay in receiving packets from the target service flow in the direction of the second packet. Therefore, the forwarding device can determine that a failure has occurred in the target service flow.
[0103] In the RMDA scenario, the first judgment logic mentioned above is also applicable. Specifically, the first message and the second message are messages in the RDMA protocol, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, and the queue pairs (QP) of the first message and the second message are different. Specifically, the first message and the second message are messages of different transmission directions in the same RDMA stream. In other words, the first message and the second message have the same queue pair context (QPC) and queue pair key (QKey), but the destination QP (Destination QP) of the first message is different from the destination QP of the second message. Optionally, the first message can be a request message in the RDMA business flow, and the second message is a response message in the RDMA business flow; or, the second message can be a response message in the RDMA business flow, and the second message is a request message in the RDMA business flow. The first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message. If the PSN of the first message is greater than the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it is determined that a failure has occurred in the target service flow. Specifically, the RDMA protocol provides a response mechanism, which is used to ensure that the RMDA message can be reliably received. In an RDMA scenario with a response mechanism enabled, after the destination device of the target service flow receives a request message from the source device, it will determine the PSN of the response message to the request message based on the PSN of the request message. The PSN of the response message indicates the position of the data content of the response message in the complete data content of the target service flow, and also indicates the position of the request message that the destination device has successfully received in the target service flow. After receiving the response message, the source device continues to determine the PSN of the new request message based on the PSN in the response message so as to continue to send the new request message. Therefore, in the RDMA scenario, for the two opposite transmission directions of the target business flow, the PSN of the message in one direction corresponds to the PSN of the message in the other direction. If the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the message of the target business flow has not been received for a long time in the transmission direction of the second message. If the PSN of the first message is greater than the PSN of the second message, it means that the target business flow is continuously transmitted in the transmission direction of the first message, that is, at this time, it can be ruled out that the target business flow has stopped flowing, resulting in the forwarding device not receiving the message of the target business flow for a long time in the transmission direction of the second message. Therefore, the forwarding device can determine that the target business flow has failed.
[0104] In actual applications, the forwarding device can establish a business flow table for the business flows arriving at the forwarding device. The business flow table records the sequence number information and arrival time of the messages from each business flow, so that the forwarding device can perform fault judgment based on the first message and the second message of each business flow.
[0105] Please refer to Figure 5, which is a schematic diagram of a possible scenario of the communication method in an embodiment of the present application. As shown in Figure 5, both forwarding device A and forwarding device B can establish a business flow table for the business flow arriving at the forwarding device. The business flow table is used to record the sequence number information and arrival time of the message from each business flow. Assume that the uplink message and the downlink message are messages in two opposite directions of the target business flow. The uplink message and the downlink message are relative. In the example of Figure 5, the message from forwarding device A to forwarding device B is regarded as the uplink message, and the message from forwarding device B to forwarding device A is regarded as the downlink message. The KEY field in each entry of the service flow table is used to record the identifier of the service flow received by the forwarding device, such as a quintuple or triplet of the service flow; the Additional Data (AD) field in the entry corresponding to the service flow is used to record the sequence number of the uplink message (l2r seq in the table), the acknowledgment number of the downlink message (r2l ack seq in the table), and the arrival time of the downlink message (r2l timestamp in the table).
[0106] In the scenario shown in Figure 5, the uplink message and the downlink message of the target business flow share the same table entry in the business flow table. Among them, the forwarding device can build the table according to the quintuple or triple of the uplink message, or it can also build the table according to the quintuple or triple of the downlink message. Next, the forwarding device A and the forwarding device B are both built according to the quintuple of the uplink message as an example for introduction. When the first message of the target business flow (regardless of whether it is an uplink message or a downlink message) arrives at the forwarding device, the forwarding device can identify whether the message belongs to an uplink message or a downlink message, and then establish an entry for the target business flow in the business flow table according to the quintuple of the message. Assuming that the message is an uplink message, the serial number of the uplink message is recorded. When the subsequent forwarding device receives a new uplink message in the target business flow, the serial number of the uplink message in the table entry of the target business flow is updated. If the subsequent forwarding device receives a downlink message in the target business flow, it swaps the source IP address, destination IP address, source port and destination port of the downlink message to obtain a five-tuple that matches the table entry of the target business flow, and then updates the sequence number and arrival time of the downlink message in the table entry. Next, the forwarding device periodically queries the table entries of each business flow in the business flow table, and uses the time when a certain business flow is queried as the current time (curTS), triggering the forwarding device to execute the first judgment logic provided in the embodiment of the present application. Specifically, when l2r seq>r2l ack seq, and curTS-r2l timestamp>preset threshold (Threshold) are satisfied at the same time, it is determined that the business flow corresponding to the currently queried table entry has failed. After the forwarding device determines that a business flow has failed, it generates fault information for the business flow, which indicates that the business flow has failed. Specifically, the fault information may include, but is not limited to, the current time (curTS), the sequence number of the first message (l2r seq), the acknowledgment number of the second message (r2l ack seq), and a quintuple (or triplet) of the service flow. Optionally, the fault information of the target service flow can be queried in real time by management personnel. Alternatively, the forwarding device can further send fault information specific to the service flow to the controller, indicating that a service flow fault has occurred. After receiving the fault information specific to the service flow, the controller can analyze the service flow fault.
[0107] Please refer to Figure 6, which is a schematic diagram of another possible scenario of the communication method in an embodiment of the present application. As shown in Figure 6, both forwarding device A and forwarding device B can establish a service flow table for the service flow arriving at the forwarding device. Assume that the uplink message and the downlink message are messages in two opposite directions of the target service flow. The uplink message and the downlink message are relative. In the example of Figure 6, the message from forwarding device A to forwarding device B is regarded as the uplink message, and the message from forwarding device B to forwarding device A is regarded as the downlink message. Among them, the uplink message and the downlink message of the service flow each occupy a table entry in the service flow table. Among them, each table entry records the sequence number (l2r seq in the table), the confirmation number (r2l ack seq in the table) and the arrival time (l2r timestamp in the table) of the uplink message or the downlink message.
[0108] When the first packet of the target service flow (whether uplink or downlink) arrives at the forwarding device, the forwarding device can identify whether the packet is an uplink packet or a downlink packet. Then, based on the quintuple of the packet, the forwarding device creates an entry for the target service flow in the service flow table. Assuming that the packet is an uplink packet, the entry corresponding to the uplink packet records the sequence number (L2R seq in the table), the acknowledgment number (R2L ack seq in the table), and the arrival time at the forwarding device (L2R timestamp in the table). When a subsequent forwarding device receives a new uplink message in the target service flow, it updates the sequence number (L2R seq in the table), acknowledgment number (R2L ack seq in the table), and arrival time at the forwarding device (L2R timestamp in the table) in the table entry for the uplink message. If the message is a downlink message, it records the sequence number (L2R seq in the table), acknowledgment number (R2L ack seq in the table), and arrival time at the forwarding device (L2R timestamp in the table) of the downlink message in the table entry corresponding to the downlink message. When a subsequent forwarding device receives a new downlink message in the target service flow, it updates the sequence number (L2R seq in the table), acknowledgment number (R2L ack seq in the table), and arrival time at the forwarding device (L2R timestamp in the table) in the table entry for the downlink message.
[0109] Next, the forwarding device periodically queries the service flow table for each service flow entry. The time when a particular entry is found is used as the current time (curTS). The key of the entry is swapped (the source and destination IP addresses are swapped, and the source and destination ports are swapped) to obtain a service flow entry belonging to the same service but with the opposite transmission direction. When seq1 > seq4, and curTS - ts2 > the preset threshold (Threshold), the service flow corresponding to the currently queried entry is determined to have a fault.
[0110] The second judgment logic: The forwarding device judges the fault of the target service flow based on two messages in the same transmission direction in the target service flow.
[0111] In a TCP scenario, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the source port of the first message is the same as the source port of the second message, and the destination port of the first message is the same as the destination port of the second message. The first sequence number information of the first message includes the sequence number and acknowledgment number in the TCP header of the first message, and the second sequence number information of the second message includes the sequence number and acknowledgment number in the TCP header of the second message. Optionally, in actual applications, the transport layer protocol of the first message and the second message is the same.
[0112] The first message is the latest message currently obtained by the forwarding device, and the second message is the previous message of the first message in the same transmission direction. That is, the forwarding device first receives the second message, and then receives the first message. After the first message arrives at the forwarding device, the forwarding device uses the time when the first message arrives at the forwarding device as the current time to determine whether the target business flow is faulty. If the sequence number in the TCP header of the first message is less than or equal to the sequence number in the TCP header of the second message, and the confirmation number in the TCP header of the first message is less than or equal to the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the first message received by the forwarding device is a retransmitted message, and the forwarding device can determine that the target business flow has failed. Among them, the current time is the time when the first message arrives at the forwarding device.
[0113] In the RMDA scenario, the second determination logic described above also applies. Specifically, the first message and the second message are of the same type in the RDMA protocol, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the queue pair (QP) of the first message and the second message is the same, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message.
[0114] The first message is the latest RDMA message currently obtained by the forwarding device, and the second message is the previous RDMA message of the first message in the same transmission direction. That is, the forwarding device first receives the second message, and then receives the first message. After the first message arrives at the forwarding device, the forwarding device uses the time when the first message arrives at the forwarding device as the current time to determine whether the target business flow has failed. In the RDMA protocol, the PSN of the RDMA message indicates the position of the data content of the RDMA message in the complete data content of the target business flow. Therefore, if the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than the preset threshold, it means that the first message received by the forwarding device is a retransmitted message, and the forwarding device can determine that the target business flow has failed. Among them, the current time is the time when the first message arrives at the forwarding device.
[0115] In actual applications, the forwarding device can establish a business flow table for the messages in a single transmission direction in the business flow. The business flow table records the sequence number information and arrival time of the messages in a single transmission direction from each business flow, so that the forwarding device can perform fault judgment based on the first message and the second message of each business flow.
[0116] Please refer to Figure 7, which is a schematic diagram of another possible scenario of the communication method in the embodiment of the present application. As shown in Figure 7, both forwarding device A and forwarding device B can establish a business flow table for the business flow arriving at the forwarding device. The business flow table is used to record the sequence number information and arrival time of the message in a single transmission direction from each business flow. In the scenario illustrated in Figure 7, the forwarding device only establishes a business flow table for the uplink message of the business flow. Take the example of forwarding device A and forwarding device B both building a table according to the five-tuple of the uplink message for introduction. Uplink messages and downlink messages are relative. In the example of Figure 7, the message from forwarding device A to forwarding device B is regarded as the uplink message, and the message from forwarding device B to forwarding device A is regarded as the downlink message. The KEY field in each entry in the service flow table records the identifier of the service flow received by the forwarding device, such as a quintuple or triplet of the service flow. The AD field in the entry corresponding to the service flow records the sequence number of the uplink message (l2r seq in the table), the acknowledgment number of the uplink message (l2r ack seq in the table), and the arrival time of the uplink message (l2r timestamp in the table). In actual applications, the forwarding device can create a table based on the quintuple or triplet of the uplink message and perform fault determination based on the two uplink messages. Alternatively, the table can be created based on the quintuple or triplet of the downlink message and the forwarding device can perform fault determination based on the two downlink messages.
[0117] When the first uplink message of the target service flow arrives at the forwarding device, the forwarding device can identify that the message belongs to an uplink message, and then establish a table entry for the target service flow in the service flow table according to the quintuple of the uplink message. The table entry includes the sequence number of the uplink message (l2r seq in the table), the confirmation number of the uplink message (l2r ack seq in the table), and the arrival time of the uplink message (l2r timestamp in the table). When the forwarding device subsequently receives a new uplink message from the target service flow, it triggers the forwarding device to execute the second judgment logic provided in the embodiment of the present application. Among them, the forwarding device uses the time when the new uplink message arrives at the forwarding device as the current time (curTS), the message recorded in the service flow table as the second message, and the newly received message as the first message. The sequence number of the message recorded in the business flow table is the second sequence number of the second message (l2r seq in the table), the confirmation number of the message recorded in the business flow table is the second confirmation number of the second message (l2r ack seq in the table), the arrival time of the message recorded in the business flow table is the first timestamp of the second message (l2r timestamp in the table), the sequence number of the newly received message is the first sequence number (seq) of the first message, and the confirmation number of the newly received message is the first confirmation number (ack seq) of the first message.
[0118] Specifically, when seq <= l2r seq, and ack seq <= l2r ack seq, and curTS-l2r timestamp > a preset threshold (Threshold), it is determined that the service flow corresponding to the currently queried entry has failed. If the above conditions are not met, it is determined that the current target service flow has not failed, and the newly received message is used as the second message. The sequence number, acknowledgment number, and arrival time of the newly received message are used to update the sequence number, acknowledgment number, and arrival time of the entry for the target service flow in the service flow table.
[0119] After the forwarding device determines that a service flow has failed, it generates fault information for the service flow, which indicates that a fault has occurred in the service flow. Specifically, the fault information may include, but is not limited to, the current time (curTS), the sequence number (seq) of the first message, the confirmation number (ack seq) of the first message, the sequence number (l2r seq) of the second message, the confirmation number (l2r ack seq) of the second message, and a quintuple (or triplet) of the service flow. Optionally, the fault information of the target service flow can be queried by the management personnel in real time, or the forwarding device can further send the fault information for the service flow to the controller, and the fault information is used to indicate that a fault has occurred in the service flow. After receiving the fault information for the service flow, the controller can analyze the fault of the service flow.
[0120] In the RMDA scenario, the second judgment logic mentioned above is also applicable. Specifically, the first message and the second message are messages of the same type in the RDMA protocol, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the queue pair (QP) of the first message and the second message is the same, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message. If the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the arrival time is greater than the preset threshold, it is determined that the target service flow has failed. Specifically, RDMA messages include but are not limited to multiple message types such as send (SEND) messages, receive (RECEIVE) messages, read (READ) messages and write (WRITE) messages, and the PSNs of different types of RDMA messages are independent of each other. In the communication method of the embodiment of the present application, fault judgment is performed based on two messages of the same type (first message and second message) in the RDMA protocol.
[0121] Please refer to Figure 8, which is a schematic diagram of the application of the communication method in the embodiment of the present application to the RDMA scenario. As shown in Figure 8, both forwarding device A and forwarding device B can establish a business flow table for the business flow arriving at the forwarding device. The business flow table is used to record the sequence number information and arrival time of the message in a single transmission direction from each business flow. In the scenario illustrated in Figure 8, the forwarding device only establishes a business flow table for the uplink message of the business flow. Uplink messages and downlink messages are relative. In the example of Figure 8, the message from forwarding device A to forwarding device B is regarded as the uplink message, and the message from forwarding device B to forwarding device A is regarded as the downlink message. Take the example of forwarding device A and forwarding device B both building a table according to the triple of uplink messages of a certain RDMA type for introduction. The KEY field in each entry of the service flow table is used to record the identifier of the service flow received by the forwarding device, such as the RDMA flow triplet (source IP address, destination IP address, and QP). The Additional Data (AD) field in the entry corresponding to the RDMA flow is used to record the PSN of the uplink message (the l2r PSN shown in the table) and the arrival time of the uplink message (the l2r timestamp in the table).
[0122] In actual applications, the forwarding device can build a table according to the triplet of the uplink message, and the forwarding device makes a fault judgment based on the two messages in the uplink direction; or, it can build a table according to the triplet of the downlink message, and the forwarding device makes a fault judgment based on the two messages in the downlink direction.
[0123] When the first uplink message of the target service flow arrives at the forwarding device, the forwarding device can identify that the message belongs to the uplink message, and then establish a table entry for the target service flow in the service flow table based on the quintuple of the uplink message. The table entry includes the PSN of the uplink message (the l2r PSN shown in the table) and the arrival time of the uplink message (the l2r timestamp in the table). When the forwarding device subsequently receives a new uplink message from the target service flow, it triggers the forwarding device to execute the second judgment logic provided in the embodiment of the present application. Among them, the forwarding device uses the time when the new uplink message arrives at the forwarding device as the current time (curTS), the message recorded in the service flow table as the second message, and the newly received message as the first message. The PSN of the message recorded in the service flow table is the second PSN of the second message (l2rPSN shown in the table), the arrival time of the message recorded in the service flow table is the first timestamp of the second message (l2r timestamp in the table), and the PSN of the newly received message is the first PSN (PSN) of the first message.
[0124] Specifically, when PSN <= l2r PSN, and curTS-l2r timestamp > a preset threshold (Threshold), it is determined that the service flow corresponding to the currently queried entry has failed. If the above conditions are not met, it is determined that the current target service flow has not failed, and the newly received message is used as the second message. The sequence number, confirmation number, and arrival time of the newly received message are used to update the sequence number, confirmation number, and arrival time of the entry for the target service flow in the service flow table.
[0125] The third judgment logic: The forwarding device judges the fault of the target service flow based on two messages in different transmission directions in the target service flow.
[0126] In a TCP scenario, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, and the destination port of the first message is the same as the source port of the second message. The first sequence number information of the first message includes the sequence number and acknowledgment number in the TCP header of the first message, and the second sequence number information of the second message includes at least the sequence number and acknowledgment number in the TCP header of the second message.
[0127] In one possible implementation, the first message and the second message are the latest messages received by the forwarding device in two opposite transmission directions. For example, if the first message is an uplink message and the second message is a downlink message, the first message is the latest uplink message received by the forwarding device in the uplink direction, and the second message is the latest downlink message received by the forwarding device (or another device that establishes a peer link with the forwarding device) in the downlink direction.
[0128] The forwarding device obtains the first sequence number information (i.e., the sequence number and confirmation number of the first message) and the second sequence number information (i.e., the sequence number and confirmation number of the second message). If the confirmation number in the TCP header of the first message is smaller than the sequence number in the TCP header of the second message, and the difference between the current time and the second arrival time of the first message is greater than the preset threshold, it means that the forwarding device can receive the target service flow in the direction of the second message, but the forwarding device has not received the target service flow in the same direction as the first message for a long time (exceeding the preset time length), thus causing the confirmation number of the first message to stop increasing. Therefore, the forwarding device determines that the target service flow has failed, and the upstream path of the second message is normal and no failure has occurred, wherein the upstream path of the second message refers to the path that the second message passes through during the process of being transmitted to the forwarding device. Therefore, while the forwarding device perceives the target service flow, it can also further determine the normal path that the target service flow passes through, facilitating subsequent fault location.
[0129] In the RMDA scenario, the third judgment logic mentioned above is also applicable. Specifically, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, and the QP of the first message is different from the QP of the second message. Specifically, the first message and the second message are messages of different transmission directions in the same RDMA stream. In other words, the first message and the second message have the same queue pair context (QPC) and queue pair key (QKey), but the destination QP (Destination QP) of the first message is different from the destination QP of the second message. Optionally, the first message can be a request message in the RDMA business flow, and the second message is a response message in the RDMA business flow; or, the second message can be a response message in the RDMA business flow, and the second message is a request message in the RDMA business flow. The first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message. As can be seen from the above, in an RDMA scenario with a response mechanism enabled, the PSN of an RDMA message indicates the position of the data content of the RDMA message within the complete data content of the target service flow, and also indicates the position of the message successfully received by the destination device within the target service flow. That is, for the two opposite transmission directions of the target service flow, the PSN of the message in one direction corresponds to the PSN of the message in the other direction. If the PSN of the first message is less than the PSN of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, it means that the forwarding device can receive the target service flow in the direction of the second message, but the forwarding device has not received the target service flow in the same direction as the first message for a long time (exceeding the preset time), resulting in the PSN of the first message stopping to increase. Therefore, the forwarding device determines that the target service flow has failed, and the upstream path of the second message is normal and has not failed, wherein the upstream path of the second message refers to the path that the second message passes through during its transmission to the forwarding device.
[0130] Please refer to Figure 9, which is a schematic diagram of a possible scenario of the communication method in an embodiment of the present application. As shown in Figure 9, both forwarding device A and forwarding device B can establish a service flow table for the service flow arriving at the forwarding device. The service flow table is used to record the sequence number information and arrival time of the message from each service flow. Assume that the uplink message and the downlink message are messages in two opposite directions of the target service flow. The uplink message and the downlink message are relative. In the example of Figure 7, the message from forwarding device B to forwarding device A is regarded as the uplink message, and the message from forwarding device A to forwarding device B is regarded as the downlink message. The KEY field in each entry in the service flow table is used to record the identifier of the service flow received by the forwarding device, such as a quintuple or triplet of the service flow; the additional data (AD) field in the entry corresponding to the service flow is used to record the acknowledgment number of the uplink message (l2r ack seq in the table), the sequence number of the downlink message (r2l seq in the table), and the arrival time of the downlink message (r2l timestamp in the table). Taking forwarding device B shown in Figure 9 as an example, if seq7>seq6, and the current time (curTS)-the second arrival time (ts3)>the preset threshold (Threshold), forwarding device B determines that the target service flow has failed, and the upstream path of the second message is normal and has not failed. The specific table creation process is similar to the description of the embodiments shown in Figures 5 to 8 above, and will not be repeated here.
[0131] In one possible implementation, the transmission path of the target service flow includes multiple forwarding devices, wherein each forwarding device can apply the communication method provided in the embodiment of the present application to determine the failure of the target service flow. Among them, each forwarding device can arbitrarily configure one or more determination logics provided in the embodiment of the present application. If the first message and the second message received by the forwarding device meet any one of the determination logics of the embodiment of the present application, the forwarding device can determine that the target service flow has failed.
[0132] Furthermore, as shown in FIG9 , in the third judgment logic in the embodiment of the present application, the forwarding device can also determine that the upstream path of the second message is normal and no fault has occurred. In this case, the cause of the fault is unrelated to the device on the upstream path of the second message (i.e., the upstream device of the second message). Therefore, the forwarding device can send a fault notification to the upstream device of the second message. The fault notification is used to indicate that the upstream path of the second message is normal, thereby allowing the upstream device of the second message to avoid invalid path switching. Exemplarily, the fault notification includes but is not limited to a quintuple or triplet of the target service flow.
[0133] Accordingly, the embodiment of the present application also provides related devices for implementing the above-mentioned scheme. Specifically, please refer to Figure 10, which is a structural diagram of a communication device provided in an embodiment of the present application. The communication device in Figure 10 can be a chip, a chip system, or a processor for supporting a forwarding device to implement the method; or, the communication device can also be a logical node, a logical module or software for implementing all or part of the functions of the communication device; the communication device can also be a general term for multiple logical nodes, multiple logical modules or multiple software for implementing the communication method. As shown in Figure 10, the communication device includes:
[0134] The transceiver unit 201 is configured to receive a first message, where the first message includes first sequence number information;
[0135] The transceiver unit 201 is further configured to obtain second sequence number information of a second message, wherein the first message and the second message correspond to a target service flow;
[0136] The processing unit 202 is configured to determine, based on the first sequence number information and the second sequence number information, whether a target service flow has a fault.
[0137] In one possible implementation, a source Internet Protocol (IP) address of the first message is the same as a destination IP address of the second message, the destination IP address of the first message is the same as a source IP address of the second message, a source port of the first message is the same as a destination port of the second message, the destination port of the first message is the same as a source port of the second message, the first sequence number information includes a sequence number in a Transmission Control Protocol (TCP) header of the first message, and the second sequence number information includes an acknowledgment number in a TCP header of the second message;
[0138] The processing unit 202 is specifically used to: determine that a target service flow fails when the sequence number in the TCP header of the first message is greater than the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0139] In one possible implementation, the source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the source port of the first message is the same as the source port of the second message, the destination port of the first message is the same as the destination port of the second message, the first sequence number information includes a sequence number and an acknowledgment number in a TCP header of the first message, and the second sequence number information includes a sequence number and an acknowledgment number in a TCP header of the second message;
[0140] The processing unit 202 is specifically used to: determine that a failure has occurred in the target service flow when the sequence number in the TCP header of the first message is less than or equal to the sequence number in the TCP header of the second message, and the confirmation number in the TCP header of the first message is less than or equal to the confirmation number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0141] In one possible implementation, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, the destination port of the first message is the same as the source port of the second message, the first sequence number information includes a sequence number and an acknowledgment number in a TCP header of the first message, and the second sequence number information includes a sequence number and an acknowledgment number in a TCP header of the second message;
[0142] The processing unit 202 is specifically used to: when the confirmation number in the TCP header of the first message is less than the sequence number in the TCP header of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, determine that the upstream path of the second message is normal.
[0143] In a possible implementation, the transceiver unit 201 is further configured to send a fault notification to an upstream device of the second message, where the fault notification is used to indicate that the upstream path of the second message is normal.
[0144] In a possible implementation, the first message and the second message are messages in a remote direct memory access (RDMA) protocol, a source IP address of the first message is the same as a source IP address of the second message, a destination IP address of the first message is the same as a destination IP address of the second message, a queue pair (QP) of the first message is the same as a QP of the second message, the first sequence number information includes a packet sequence number (PSN) of the first message, and the second sequence number information includes a PSN of the second message;
[0145] The processing unit 202 is specifically configured to determine that a target service flow fails when the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0146] In a possible implementation, the first message and the second message are messages in a remote direct memory access (RDMA) protocol, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes a PSN of the first message, and the second sequence number information includes a PSN of the second message.
[0147] The processing unit 202 is specifically configured to determine that a target service flow fails when the PSN of the first message is greater than the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold.
[0148] In one possible implementation, the source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message;
[0149] The processing unit 202 is specifically configured to determine that the upstream path of the second message is normal when the PSN of the first message is smaller than the PSN of the second message and the difference between the current time and the second arrival time of the first message is greater than a preset threshold.
[0150] In a possible implementation, the transceiver unit 201 is specifically configured to receive a second message, where the second message includes second sequence number information.
[0151] In a possible implementation, the second sequence number information is received through a peer link.
[0152] In a possible implementation, the transceiver unit 201 is further configured to send fault information for the target service flow to the controller, where the fault information is used to indicate that a fault occurs in the target service flow.
[0153] It should be noted that the information interaction, execution process, etc. between the modules / units in the communication device are based on the same concept as the method embodiment corresponding to Figure 3 in this application. For specific contents, please refer to the description in the method embodiment shown above in this application, and will not be repeated here.
[0154] Please refer to Figure 11, which is a schematic diagram of the logical structure of a communication device 30 provided in an embodiment of the present application. The communication device 30 in Figure 11 can be a chip, a chip system, or a processor for supporting a forwarding device to implement the method; or, the communication device 30 can also be a logical node, a logical module or software for implementing all or part of the functions of the communication device 30; the communication device 30 can also be a general term for multiple logical nodes, multiple logical modules or multiple software for implementing the communication method. The communication device 30 can be deployed with the communication device described in the embodiment corresponding to Figure 10 to implement the functions implemented by the forwarding device in the embodiment corresponding to Figure 3. The communication device 30 includes: a memory 301, a processor 302, a communication interface 303 and a bus 304. Among them, the memory 301, the processor 302, and the communication interface 303 are connected to each other through the bus 304.
[0155] The memory 301 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 301 may store programs. When the program stored in the memory 301 is executed by the processor 302, the processor 302 and the communication interface 303 are used to perform steps 101-103 of the above-described embodiment of the communication method.
[0156] The processor 302 can be a central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component or any combination thereof, for executing relevant programs to implement one or more steps 101-103 of the communication method embodiment in this application. The steps of the data processing method disclosed in the embodiment of the present application can be executed by a compiler and an executor, wherein the compiler and the executor can be executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 301, and the processor 302 reads the information in the memory 301 and executes one or more steps 101-103 of the communication method embodiment in this application in combination with its hardware.
[0157] The communication interface 303 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the communication device 30 and other devices or a communication network.
[0158] Bus 304 provides a pathway for transmitting information between the various components of computer device 30 (e.g., memory 301, processor 302, and communication interface 303). Bus 304 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, control buses, and so on. For ease of illustration, FIG11 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.
[0159] It should be noted that the information interaction, execution process, etc. between the modules / units in the communication device are based on the same concept as the method embodiment corresponding to Figure 3 in this application. For specific contents, please refer to the description in the method embodiment shown above in this application, and will not be repeated here.
[0160] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, the computer program product causes the at least one computing device to perform the method described in the embodiment shown in FIG. 3 .
[0161] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can 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). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for executing the embodiment described in Figure 3.
[0162] The communication device provided in the embodiment of the present application can specifically be a chip, which includes: a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin, or a circuit. The processing unit can execute computer-executable instructions stored in the storage unit to enable the chip to perform the method described in the embodiment shown in Figure 3 above. Optionally, the storage unit is a storage unit within the chip, such as a register, a cache, etc. The storage unit can also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM), etc.
[0163] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided in the embodiments of the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0164] Through the description of the above embodiments, it is clear to those skilled in the art that the embodiments of the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be various, such as analog circuits, digital circuits, or application-specific circuits, etc. However, for the embodiments of the present application, software program implementation is a better implementation method in most cases. Based on such an understanding, the technical solutions of the embodiments of the present application are essentially or partly contributed to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.
[0165] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0166] 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from a website, a computer, a training device 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, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can 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 (SSD)).
Claims
1. A communication method, characterized in that: include: receiving a first message, wherein the first message includes first sequence number information; Obtaining second sequence number information of a second message, wherein the first message and the second message correspond to a target service flow; It is determined that a failure occurs in the target service flow based on the first sequence number information and the second sequence number information.
2. The method according to claim 1, characterized in that The source Internet Protocol (IP) address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, the destination port of the first message is the same as the source port of the second message, the first sequence number information includes a sequence number in a Transmission Control Protocol (TCP) header of the first message, and the second sequence number information includes an acknowledgment number in a TCP header of the second message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the sequence number in the TCP header of the first message is greater than the acknowledgment number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it is determined that the target service flow has failed.
3. The method according to claim 1, characterized in that The source IP address of the first message is the same as the source IP address of the second message, the destination IP address of the first message is the same as the destination IP address of the second message, the source port of the first message is the same as the source port of the second message, the destination port of the first message is the same as the destination port of the second message, the first sequence number information includes a sequence number and an acknowledgment number in a TCP header of the first message, and the second sequence number information includes a sequence number and an acknowledgment number in a TCP header of the second message, and the method further includes: receiving the second message; After receiving the second message, receiving the first message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the sequence number in the TCP header of the first message is less than or equal to the sequence number in the TCP header of the second message, and the acknowledgment number in the TCP header of the first message is less than or equal to the acknowledgment number in the TCP header of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, then it is determined that a failure has occurred in the target service flow, and the current time is the time when the first message is received.
4. The method according to claim 1, wherein The source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the source port of the first message is the same as the destination port of the second message, the destination port of the first message is the same as the source port of the second message, the first sequence number information includes the sequence number and acknowledgment number in the TCP header of the first message, and the second sequence number information includes the sequence number and acknowledgment number in the TCP header of the second message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the confirmation number in the TCP header of the first message is smaller than the sequence number in the TCP header of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, it is determined that the upstream path of the second message is normal.
5. The method according to claim 4, characterized in that The method further comprises: A fault notification is sent to an upstream device of the second message, where the fault notification is used to indicate that an upstream path of the second message is normal.
6. The method according to claim 1, characterized in that The first message and the second message are messages in a Remote Direct Memory Access (RDMA) protocol, a source IP address of the first message is the same as a destination IP address of the second message, the destination IP address of the first message is the same as a source IP address of the second message, a QP of the first message is different from a QP of the second message, the first sequence number information includes a PSN of the first message, and the second sequence number information includes a PSN of the second message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the PSN of the first message is greater than the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it is determined that a failure occurs in the target service flow.
7. The method according to claim 1, characterized in that The first message and the second message are messages of the same type in a remote direct memory access (RDMA) protocol, a source IP address of the first message is the same as a source IP address of the second message, a destination IP address of the first message is the same as a destination IP address of the second message, a queue pair (QP) of the first message is the same as a QP of the second message, the first sequence number information includes a packet sequence number (PSN) of the first message, and the second sequence number information includes a PSN of the second message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the PSN of the first message is less than or equal to the PSN of the second message, and the difference between the current time and the first arrival time of the second message is greater than a preset threshold, it is determined that a failure occurs in the target service flow.
8. The method according to claim 1, characterized in that The source IP address of the first message is the same as the destination IP address of the second message, the destination IP address of the first message is the same as the source IP address of the second message, the QP of the first message is different from the QP of the second message, the first sequence number information includes the PSN of the first message, and the second sequence number information includes the PSN of the second message; Determining, according to the first sequence number information and the second sequence number information, that a failure occurs in the target service flow includes: If the PSN of the first message is smaller than the PSN of the second message, and the difference between the current time and the second arrival time of the first message is greater than a preset threshold, it is determined that the upstream path of the second message is normal.
9. The method according to any one of claims 2 to 8, characterized in that The method further comprises: A second message is received, where the second message includes second sequence number information.
10. The method according to any one of claims 2 to 8, characterized in that The second sequence number information is received through a peer link.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: Fault information for the target service flow is sent to a controller, where the fault information is used to indicate that a fault occurs in the target service flow.
12. A communication device, characterized in that: include: a transceiver unit, configured to receive a first message, wherein the first message includes first sequence number information; The transceiver unit is further configured to obtain second sequence number information of a second message, wherein the first message and the second message are from a target service flow; A processing unit is used to determine whether a failure occurs in the target service flow based on the first sequence number information and the second sequence number information.
13. A communication device, characterized in that: comprising a processor coupled to a memory; The memory is used to store instructions; The processor is configured to execute instructions in the memory, so that the communication device performs the method according to any one of claims 1 to 11.
14. 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 according to any one of claims 1 to 11 is implemented.
15. A computer program product, characterized in that The computer program product stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
16. A chip, characterized in that: The chip includes a processor coupled to a memory; The memory is used to store instructions; The processor is configured to execute instructions in the memory, so that the chip executes the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Communication method, communication device and communication equipment
CN120434153A
Method and device for determining reasons of data transmission fault
CN107645409A
Detection method and equipment of video service message
CN109672929A
Packet loss retransmission method for realizing flow control
CN110225419A
Packet loss detection method and device for realizing RDMA network based on PSN
CN112637015A