Method and device for determining tunnel connectivity

By generating BFD messages containing information about the outer and inner tunnels at a single endpoint of the tunnel, the problem of not being able to detect bidirectional tunnel connectivity when only one communication device supports BFD technology is solved, thus enabling reliable detection of bidirectional tunnels.

CN121644409APending Publication Date: 2026-03-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, when only one communication device supports BFD technology, the connectivity of bidirectional tunnels cannot be detected, especially in the case of IP tunnels.

Method used

When BFD technology is supported at a single endpoint of the tunnel, BFD messages containing outer and inner tunnel information are generated and sent. The outer tunnel information guides the forwarding of the message in the first tunnel, and the inner tunnel information guides the forwarding of the message in the second tunnel. The connectivity of the bidirectional tunnel is determined using BFD control information.

Benefits of technology

Even if only a single endpoint supports BFD technology, it can effectively detect the connectivity of bidirectional tunnels, improving the reliability and rapid response capability of link fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644409A_ABST
    Figure CN121644409A_ABST
Patent Text Reader

Abstract

The invention provides a method for determining tunnel connectivity. The method is applied to a first communication device supporting BFD (Bidirectional Forwarding Detection). The method comprises the following steps: generating and sending a first message, wherein the first message is a BFD (Bidirectional Forwarding Detection) message which is initiated by single-end equipment and is used for detecting the connectivity of a bidirectional tunnel; the first message comprises outer-layer tunnel information, inner-layer tunnel information and BFD control information. The outer-layer tunnel information indicates a first tunnel from the first communication device to the second communication device, and the inner-layer tunnel information indicates a second tunnel from the second communication device to the first communication device. The first tunnel and the second tunnel are IP tunnels. If both the first tunnel and the second tunnel have no fault, the first message is finally forwarded to the first communication device based on the outer-layer tunnel information and the inner-layer tunnel information, and correspondingly, the first communication device can determine the connectivity of the two-way tunnel. By using the scheme, even if the IP tunnel only comprises a single endpoint to support the BFD technology, the connectivity of the bidirectional tunnel can be determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular to a method and apparatus for determining tunnel connectivity. Background Technology

[0002] To mitigate the impact of link failures on services, communication devices need to be able to detect link failures with other communication devices as quickly as possible, enabling timely intervention to ensure normal service transmission within the network. Bidirectional forwarding detection (BFD) is a technique for detecting link connectivity. BFD provides short-cycle link connectivity detection; when a link failure occurs, the detection time can be down to the millisecond level, offering high reliability.

[0003] Currently, the connectivity of a bidirectional tunnel between two communication devices can be detected by deploying BFD technology on both devices. If either of the two communication devices does not support BFD technology, the connectivity of the aforementioned bidirectional tunnel cannot be detected.

[0004] Therefore, a solution is urgently needed to address the above problems. Summary of the Invention

[0005] This application provides a method and apparatus for determining tunnel connectivity, which can detect the connectivity of a bidirectional tunnel when BFD technology is supported at a single endpoint of the tunnel.

[0006] Firstly, this application provides a method for determining tunnel connectivity, which can be applied to a first communication device. The first communication device can be one endpoint of a bidirectional tunnel. The first communication device supports BFD (Broadcast Deployment). The bidirectional tunnel mentioned herein includes a first tunnel from the first communication device to a second communication device, and a second tunnel from the second communication device to the first communication device, both of which are Internet Protocol (IP) tunnels. In this application, the first communication device can generate a first message, which is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. The single-end device mentioned herein can be a single endpoint of the bidirectional tunnel. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates the first tunnel, and the inner tunnel information indicates the second tunnel. After obtaining the first message, the first communication device can send the first message. Since the first message includes two layers of tunnel information, both layers of tunnel information can be used to guide the forwarding of the first message in the tunnel. Specifically, the outer tunnel information can guide the forwarding of the first message in the first tunnel, and the inner tunnel information can guide the forwarding of the first message in the second tunnel. Therefore, if both the first and second tunnels are functioning correctly, based on the outer and inner tunnel information, the first message will eventually be forwarded to the first communication device. Correspondingly, the first communication device can determine the connectivity of the aforementioned bidirectional tunnel based on the BFD control information. Thus, it is evident that using the solution provided in this application, even if the IP tunnel only includes a single endpoint (e.g., the first communication device) supporting BFD technology, the connectivity of the bidirectional tunnel can still be determined.

[0007] In one possible implementation, both the first and second tunnels mentioned above are Virtual Extensible Local Area Network (VXLAN) tunnels. Accordingly, the outer tunnel information is the outer VXLAN encapsulation information, and the inner tunnel information is the inner VXLAN encapsulation information. In this case, using this solution, the connectivity of a bidirectional VXLAN tunnel can be determined even when the VXLAN tunnel only includes a single endpoint supporting BFD technology.

[0008] In one possible implementation, both the first and second tunnels mentioned above are generic routing encapsulation (GRE) tunnels. Accordingly, the outer tunnel information is the outer GRE encapsulation information, and the inner tunnel information is the inner GRE encapsulation information. In this case, using this solution, the connectivity of bidirectional GRE tunnels can be determined even when the GRE tunnel only includes a single endpoint supporting BFD technology.

[0009] In one possible implementation, both the first and second tunnels mentioned above are Internet Protocol in Internet Protocol (IP-IP) tunnels, with the outer tunnel information being outer IP encapsulation information and the inner tunnel information being inner IP encapsulation information. In this case, using this solution, the connectivity of bidirectional IP-IP tunnels can be determined even when the IP-IP tunnel only includes a single endpoint supporting BFD technology.

[0010] In one possible implementation, the aforementioned first tunnel and second tunnel can both be Internet Protocol version 4 in Internet Protocol version 6 (IPv4 in IPv6) tunnels or Internet Protocol version 6 in Internet Protocol version 6 (IPv6 in IPv6) tunnels. Accordingly, the outer IP encapsulation information is outer IPv6 encapsulation information, and the inner IP encapsulation information is inner IPv6 encapsulation information. In this case, using this solution, the connectivity of a bidirectional IPv4 in IPv6 tunnel can be determined even when only a single endpoint of the IPv4 in IPv6 tunnel supports BFD technology, and the connectivity of a bidirectional IPv6 in IPv6 tunnel can also be determined even when only a single endpoint of the IPv6 in IPv6 tunnel supports BFD technology.

[0011] In one possible implementation, the aforementioned first tunnel and second tunnel can both be Internet Protocol version 4 (IPv4inIPv4) tunnels or Internet Protocol version 6 (IPv6inIPv4) tunnels. Accordingly, the outer IP encapsulation information is outer IPv4 encapsulation information, and the inner IP encapsulation information is inner IPv4 encapsulation information. In this case, using this solution, the connectivity of a bidirectional IPv4inIPv4 tunnel can be determined even when only a single endpoint of the IPv4inIPv4 tunnel supports BFD technology, and the connectivity of a bidirectional IPv6inIPv4 tunnel can also be determined even when only a single endpoint of the IPv6inIPv4 tunnel supports BFD technology.

[0012] In one possible implementation, the first message includes first indication information, which indicates that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. In a specific example, the first indication information may include a first User Datagram Protocol (UDP) port number, located between the aforementioned inner tunnel information and BFD control information. In another specific example, the first indication information may be located in the inner tunnel information; for example, when the inner tunnel information includes a protocol type field, this protocol type field can be used to carry the first indication information. For example, the protocol type field may be the protocol type field included in the GRE header of the inner GRE encapsulation information.

[0013] In one possible implementation, if the first message is successfully forwarded via the first and second tunnels, the first communication device can also receive a second message, which includes the inner tunnel information and the BFD control information. After receiving the second message, the first communication device can determine that both the first and second tunnels are connected based on the second message. As a specific example, after receiving the second message, the first communication device can, on the one hand, determine that the second message is a BFD message initiated by a single-end device to detect bidirectional tunnel connectivity based on the aforementioned first indication information carried in the second message. On the other hand, since the first communication device is the tail node of the second tunnel indicated by the inner tunnel information, the first communication device can strip the outer tunnel information from the second message to obtain a third message, which includes at least the aforementioned BFD control information. Further, the first communication device can process the third message using a BFD module. For example, the BFD module can extract the first identifier from the BFD control information of the third message and find the locally stored local identifier. If the first identifier and the local identifier are consistent, it can be determined that the third message corresponds to a BFD session initiated by the first communication device itself. Therefore, the first communication device can determine that both the first tunnel and the second tunnel are without faults.

[0014] Secondly, this application provides a method for determining tunnel connectivity, which can be applied to a second communication device. The second communication device can be one endpoint of a bidirectional tunnel. The bidirectional tunnel mentioned herein includes a first tunnel from the first communication device to the second communication device, and a second tunnel from the second communication device to the first communication device. Both the first and second tunnels are IP tunnels, and the first communication device supports BFD (Broadband Detection). The second communication device can receive a first message, which is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates the first tunnel, and the inner tunnel information indicates the second tunnel. After receiving the first message, the second communication device can further send a second message, which includes the inner tunnel information and the BFD control information. The inner tunnel information included in the second message guides its forwarding within the second tunnel. If the second tunnel is fault-free, the second message will ultimately be forwarded to the first communication device based on the inner tunnel information. Correspondingly, the first communication device can determine the connectivity of the aforementioned bidirectional tunnel based on the BFD control information in the second message. Therefore, using the solution provided in this application, even if the IP tunnel only includes a single endpoint (e.g., the first communication device) supporting BFD technology, the connectivity of the bidirectional tunnel can still be determined.

[0015] In one possible implementation, after receiving the first message, the second communication device, being the tail node of the first tunnel indicated by the outer tunnel information, can obtain the second message based on the first message. As a concrete example, the second communication device can strip the outer tunnel information from the first message to obtain the second message, and then further send the second message so that the first communication device can subsequently determine the connectivity of the bidirectional tunnel based on the second message.

[0016] In one possible implementation, the IP tunnel includes a Virtual Extended Local Area Network (VXLAN) tunnel, where the outer tunnel information is outer VXLAN encapsulation information and the inner tunnel information is inner VXLAN encapsulation information; or, the IP tunnel includes a Generic Routing Encapsulation (GRE) tunnel, where the outer tunnel information is outer GRE encapsulation information and the inner tunnel information is inner GRE encapsulation information; or, the IP tunnel includes an Internet Protocol (IP)-in-IP (IP-in-IP) tunnel, where the outer tunnel information is outer IP encapsulation information and the inner tunnel information is inner IP encapsulation information.

[0017] In one possible implementation, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv6 tunnel or an Internet Protocol version 6 (IPv6) to IPv6 tunnel, in which case the outer IP encapsulation information is outer IPv6 encapsulation information and the inner IP encapsulation information is inner IPv6 encapsulation information. Alternatively, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv4 tunnel or an Internet Protocol version 6 (IPv6) to IPv4 tunnel, in which case the outer IP encapsulation information is outer IPv4 encapsulation information and the inner IP encapsulation information is inner IPv4 encapsulation information.

[0018] In one possible implementation, the first message includes a first User Datagram Protocol (UDP) port number, which indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity. The first UDP port number is carried in a field located between the BFD control information and the inner tunnel information.

[0019] In one possible implementation, the inner GRE encapsulation information includes a GRE header, and the protocol type field in the GRE header indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity.

[0020] Thirdly, this application provides a tunnel connectivity determination device applied to a first communication device. The device includes: a processing unit for generating a first message, wherein the first message is a bidirectional forwarding detection (BFD) message initiated by a single-end device for detecting bidirectional tunnel connectivity, the first message including outer tunnel information, inner tunnel information, and BFD control information, wherein the outer tunnel information indicates a first tunnel from the first communication device to the second communication device, the inner tunnel information indicates a second tunnel from the second communication device to the first communication device, both the first tunnel and the second tunnel are Internet Protocol (IP) tunnels, and the BFD control information is used to determine the connectivity of the bidirectional tunnel; and a sending unit for sending the first message.

[0021] In one possible implementation, the IP tunnel includes a Virtual Extended Local Area Network (VXLAN) tunnel, where the outer tunnel information is outer VXLAN encapsulation information and the inner tunnel information is inner VXLAN encapsulation information; or, the IP tunnel includes a Generic Routing Encapsulation (GRE) tunnel, where the outer tunnel information is outer GRE encapsulation information and the inner tunnel information is inner GRE encapsulation information; or, the IP tunnel includes an Internet Protocol (IP)-in-IP (IP-in-IP) tunnel, where the outer tunnel information is outer IP encapsulation information and the inner tunnel information is inner IP encapsulation information.

[0022] In one possible implementation, if the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv6 tunnel or an Internet Protocol version 6 (IPv6) to IPv6 tunnel, then the outer IP encapsulation information is outer IPv6 encapsulation information, and the inner IP encapsulation information is inner IPv6 encapsulation information; or, if the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv4 tunnel or an Internet Protocol version 6 (IPv6) to IPv4 tunnel, then the outer IP encapsulation information is outer IPv4 encapsulation information, and the inner IP encapsulation information is inner IPv4 encapsulation information.

[0023] In one possible implementation, the first message includes a first User Datagram Protocol (UDP) port number, which indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity. The first UDP port number is carried in a field located between the BFD control information and the inner tunnel information.

[0024] In one possible implementation, the inner GRE encapsulation information includes a GRE header, and the protocol type field in the GRE header indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity.

[0025] In one possible implementation, the apparatus further includes: a receiving unit for receiving a second message, the second message including the inner tunnel information and the BFD control information; and a processing unit for determining, based on the second message, that both the first tunnel and the second tunnel are connected.

[0026] Fourthly, this application provides a tunnel connectivity determination device applied to a second communication device. The device includes: a receiving unit for receiving a first message, the first message being a bidirectional forwarding detection (BFD) message initiated by a single-end device for detecting bidirectional tunnel connectivity. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates a first tunnel from the first communication device to the second communication device, and the inner tunnel information indicates a second tunnel from the second communication device to the first communication device. Both the first tunnel and the second tunnel are Internet Protocol (IP) tunnels. The BFD control information is used to determine the connectivity of the bidirectional tunnel. A sending unit for sending a second message to the first communication device, the second message including the inner tunnel information and the BFD control information.

[0027] In one possible implementation, the sending unit is specifically used to: strip the outer tunnel information from the first message to obtain a second message; and send the second message.

[0028] In one possible implementation, the IP tunnel includes a Virtual Extended Local Area Network (VXLAN) tunnel, where the outer tunnel information is outer VXLAN encapsulation information and the inner tunnel information is inner VXLAN encapsulation information; or, the IP tunnel includes a Generic Routing Encapsulation (GRE) tunnel, where the outer tunnel information is outer GRE encapsulation information and the inner tunnel information is inner GRE encapsulation information; or, the IP tunnel includes an Internet Protocol (IP)-in-IP (IP-in-IP) tunnel, where the outer tunnel information is outer IP encapsulation information and the inner tunnel information is inner IP encapsulation information.

[0029] In one possible implementation, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv6 tunnel or an Internet Protocol version 6 (IPv6) to IPv6 tunnel, in which case the outer IP encapsulation information is outer IPv6 encapsulation information and the inner IP encapsulation information is inner IPv6 encapsulation information. Alternatively, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv4 tunnel or an Internet Protocol version 6 (IPv6) to IPv4 tunnel, in which case the outer IP encapsulation information is outer IPv4 encapsulation information and the inner IP encapsulation information is inner IPv4 encapsulation information.

[0030] In one possible implementation, the first message includes a first User Datagram Protocol (UDP) port number, which indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity. The first UDP port number is carried in a field located between the BFD control information and the inner tunnel information.

[0031] In one possible implementation, the inner GRE encapsulation information includes a GRE header, and the protocol type field in the GRE header indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity.

[0032] Fifthly, embodiments of this application provide an apparatus, including: a processor and a memory; the memory being used to store instructions or computer programs; the processor being used to execute the instructions or computer programs to perform the methods described in the first aspect above and any one of the first aspects above; or, the processor being used to execute the instructions or computer programs to perform the methods described in the second aspect above and any one of the second aspects above.

[0033] Sixthly, embodiments of this application provide a computer-readable storage medium, including instructions or a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or, when run on a computer, causes the computer to perform the methods described in the second aspect and any one of the second aspects above.

[0034] In a seventh aspect, embodiments of this application provide a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or, when run on a computer, causes the computer to perform the methods described in the second aspect and any one of the second aspects above.

[0035] Eighthly, this application provides a communication system comprising: a first communication device as described in any one of the third aspects above, and a second communication device as described in any one of the fourth aspects above. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1a A schematic diagram of a possible application scenario is shown;

[0038] Figure 1b This is a schematic diagram illustrating an exemplary application scenario provided in an embodiment of this application;

[0039] Figure 1c This is a schematic diagram illustrating another exemplary application scenario provided in the embodiments of this application;

[0040] Figure 1d This is a schematic diagram illustrating another exemplary application scenario provided in the embodiments of this application;

[0041] Figure 2 A flowchart illustrating a method for determining tunnel connectivity provided in an embodiment of this application;

[0042] Figure 3a This is a schematic diagram of the structure of a first message provided in an embodiment of this application;

[0043] Figure 3b This is a schematic diagram of another first message structure provided in an embodiment of this application;

[0044] Figure 3c This is a schematic diagram of another first message structure provided in an embodiment of this application;

[0045] Figure 3d This is a schematic diagram of the structure of another first message provided in an embodiment of this application;

[0046] Figure 3e This is a schematic diagram of the structure of another first message provided in an embodiment of this application;

[0047] Figure 4 A flowchart illustrating yet another method for determining tunnel connectivity provided in an embodiment of this application;

[0048] Figure 5A schematic diagram of a tunnel connectivity determination device provided in an embodiment of this application;

[0049] Figure 6 A schematic diagram of another tunnel connectivity determination device provided in an embodiment of this application;

[0050] Figure 7 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0051] This application provides a method and apparatus for determining tunnel connectivity, which can detect the connectivity of a bidirectional tunnel when BFD technology is supported at a single endpoint of the tunnel.

[0052] Currently, the connectivity of a bidirectional tunnel between two communication devices can be detected by deploying BFD technology on both devices. (See reference...) Figure 1a To understand, Figure 1a A schematic diagram of a possible application scenario is shown. For example... Figure 1a As shown, BFD technology can be deployed on both communication device A and communication device B to detect the link connectivity between communication device A and communication device B. Communication device A and communication device B can be directly connected, and multiple other communication devices can also be included between communication device A and communication device B.

[0053] Communication device A and communication device B can both establish a BFD session. Further, communication device A sends a BFD control packet along the link (e.g., a tunnel) from communication device A to communication device B. If communication device B does not receive a BFD control packet from communication device A within a predetermined time, it can be assumed that the link from communication device A to communication device B has failed. Similarly, communication device B sends a BFD control packet along the link (e.g., a tunnel) from communication device B to communication device A. If communication device A does not receive a BFD control packet from communication device B within a predetermined time, it can be assumed that the link from communication device B to communication device A has failed. In some scenarios, a "BFD control packet" can also be referred to as a "BFD control message."

[0054] The establishment of the aforementioned BFD session requires a three-way handshake between communication device A and communication device B. The specific handshake process can be controlled by the state machines maintained locally by communication device A and communication device B. The process of establishing a BFD session will not be described in detail here.

[0055] As described above, by deploying BFD technology on both communication devices, the connectivity of a bidirectional link (e.g., a bidirectional tunnel) between them can be detected. If one of the communication devices does not have BFD technology deployed, especially when the tunnel between the two devices is an IP tunnel, the connectivity of the bidirectional tunnel between them cannot be detected. IP tunnels use IP encapsulation to encapsulate data and include VXLAN tunnels, IP-in-IP tunnels, and GRE tunnels. IP-in-IP tunnels include IPv4-in-IPv4 tunnels, IPv6-in-IPv4 tunnels, IPv4-in-IPv6 tunnels, and IPv6-in-IPv6 tunnels.

[0056] In view of this, this application provides a method and apparatus for determining tunnel connectivity. The following will introduce the solution provided by the embodiments of this application.

[0057] First, the possible application scenarios of this application are introduced. See [link / reference] Figure 1b This figure is a schematic diagram of an exemplary application scenario provided by an embodiment of this application.

[0058] Figure 1b This diagram illustrates a network topology that uses replicator nodes to centrally replicate Broadcast Unknown Unicast Multicast (BUM) traffic. Centralized replication means that each Virtual Tunnel End Point (VTEP) encapsulates BUM packets within a VXLAN tunnel between itself and the replicator node, and only sends the BUM packet to the replicator node. The replicator node then forwards the BUM packet to other VTEPs besides the source VTEP. To improve network reliability, replicator nodes are typically deployed in clusters. A VTEP, also known as a VXLAN tunnel endpoint (e.g., the start or end point of a VXLAN tunnel), is responsible for the encapsulation and decapsulation of VXLAN packets.

[0059] like Figure 1bAs shown, VXLAN tunnels can be established between network devices and replicator nodes. Specifically, network devices may include VTEPs. For a given network device, the VTEP on that device establishes VXLAN tunnels with multiple (e.g., individual) replicator nodes, and these multiple VXLAN tunnels provide mutual protection and backup. The VTEP can forward BUM traffic to a replicator node through one of the aforementioned VXLAN tunnels. Correspondingly, the replicator node receiving the BUM traffic will replicate the traffic and forward it to other replicator nodes. Furthermore, although... Figure 1b Although not shown in the diagram, unicast VXLAN tunnels can also be established between network devices to forward unicast traffic.

[0060] In the above scenarios, timely detection of VXLAN tunnel connectivity is particularly important, so that traffic can be switched to other VXLAN tunnels in time when a VXLAN tunnel fails, ensuring reliable traffic forwarding.

[0061] The following example illustrates the tunnels between network device 3 and replicator1 node 1 and replicator2 node respectively.

[0062] The VXLAN tunnel between network device 3 and replicator1 is the primary VXLAN tunnel, while the VXLAN tunnel between network device 3 and replicator2 is the backup VXLAN tunnel. Network device 3 can send traffic from virtual machines (VMs) to replicator1 through the primary VXLAN tunnel. Therefore, if the primary VXLAN tunnel fails and the failure is detected promptly, network device 3 can quickly switch traffic from VMs to the backup VXLAN tunnel for forwarding, thus ensuring reliable traffic forwarding.

[0063] Figure 1b The replicator node shown can be a network device such as a switch or router, or it can be a server.

[0064] See Figure 1c This figure is a schematic diagram of another exemplary application scenario provided by the embodiments of this application.

[0065] Server A is dual-homed to access gateways 1 and 2. Access gateway 1 includes VTEP1, and access gateway 2 includes VTEP2. VTEP1 and VTEP2 have different IP addresses. Network device 1 and network device 2 are connected to server C respectively. Network device 1 includes VTEP3, and network device 2 includes VTEP4. A VXLAN tunnel is established between VTEP1 and VTEP3, and a VXLAN tunnel is also established between VTEP2 and VTEP3. These two VXLAN tunnels can load-sharing each other. Traffic between server A and server C can be transmitted through the VXLAN tunnel between VTEP1 and VTEP3, or through the VXLAN tunnel between VTEP2 and VTEP3. Although Figure 1c Although not shown in the diagram, other network devices may be included between access gateway 1 and network device 1, and other network devices may also be included between access gateway 2 and network device 1.

[0066] Similarly, server B is dual-homed to access gateways 3 and 4. Access gateway 3 includes VTEP5, and access gateway 4 includes VTEP6. VTEP5 and VTEP6 have different IP addresses. A VXLAN tunnel is established between VTEP5 and VTEP4, and also between VTEP6 and VTEP4. These two VXLAN tunnels can load-sharing each other. Traffic between server B and server C can be transmitted through the VXLAN tunnel between VTEP5 and VTEP4, or through the VXLAN tunnel between VTEP6 and VTEP4. Although Figure 1c It is not shown in the diagram, but other network devices may be included between access gateway 3 and network device 2, and other network devices may also be included between access gateway 4 and network device 2.

[0067] exist Figure 1c In the scenario illustrated, timely detection of VXLAN tunnel connectivity is crucial to ensure reliable traffic forwarding by switching traffic to other VXLAN tunnels in the event of a VXLAN tunnel failure. For example, if the VXLAN tunnel between VTEP1 and VTEP3 fails, timely detection allows traffic to be switched to the VXLAN tunnel between VTE2 and VTEP3, thus guaranteeing reliable traffic forwarding.

[0068] See Figure 1d , Figure 1d This is a schematic diagram illustrating yet another exemplary application scenario provided by an embodiment of this application. For example... Figure 1d As shown, traffic from device A can be forwarded to provider edge (PE)1.

[0069] In one example, PE1 can forward the traffic to PE2 via an IPinIP tunnel or a GRE tunnel between PE1 and PE2, and PE2 can then forward the traffic to device B. In another example, PE1 can forward the traffic to PE3 via an IPinIP tunnel or a GRE tunnel between PE1 and PE3, and PE3 can then forward the traffic to device B.

[0070] exist Figure 1d In the scenario illustrated, timely detection of the connectivity of the IPinIP tunnel or GRE tunnel is crucial. This allows for prompt switching of traffic to other tunnels in the event of an IPinIP tunnel or GRE tunnel failure, ensuring reliable traffic forwarding. For example, if the IPinIP tunnel or GRE tunnel between PE1 and PE2 fails, timely detection of the failure allows traffic to be switched to the IPinIP tunnel or GRE tunnel between PE1 and PE3, thus guaranteeing reliable traffic forwarding.

[0071] Next, with reference to the accompanying drawings, the method for determining tunnel connectivity provided in the embodiments of this application will be described.

[0072] Before introducing the method for determining tunnel connectivity provided in the embodiments of this application, it should be noted that the communication device mentioned in the embodiments of this application can be a network device such as a switch or router, or a component of a network device, such as a single board or line card on the network device, or a functional module on the network device, or a chip or central processing unit (CPU) used to implement the method of this application. The embodiments of this application do not impose specific limitations. Communication devices can be directly connected, for example, but not limited to, via Ethernet cables or optical fibers.

[0073] See Figure 2 The figure is a flowchart illustrating a method for determining tunnel connectivity provided in an embodiment of this application. Figure 2 The method shown is applied to a first communication device, which may be a communication device that has deployed BFD technology.

[0074] Figure 2 The method shown can be applied to Figures 1b to 1d The application scenarios shown.

[0075] when Figure 2 The method shown is applied to Figure 1bIn the application scenario shown, the first communication device can correspond to a network device, and the second communication device can correspond to a replicator node that establishes a tunnel with the network device. Of course, the first communication device can also correspond to a replicator node, in which case the second communication device corresponds to the network device.

[0076] when Figure 2 The method shown is applied to Figure 1c In the application scenario shown, the first communication device can correspond to a specific VTEP, and the second communication device can correspond to another VTEP that establishes a tunnel with that VTEP. For example, the first communication device corresponds to VTEP1, and the second communication device corresponds to VTEP3.

[0077] when Figure 2 The method shown is applied to Figure 1d In the application scenario shown, the first communication device corresponds to a certain PE, and the second communication device corresponds to another PE that establishes a tunnel with that PE. For example, the first communication device corresponds to PE1, and the second communication device corresponds to PE2 or PE3.

[0078] Figure 2 The method shown may include the following steps S101-S102.

[0079] S101: The first communication device generates a first message, which is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates a first tunnel from the first communication device to the second communication device, and the inner tunnel information indicates a second tunnel from the second communication device to the first communication device. Both the first tunnel and the second tunnel are IP tunnels. The BFD control information is used to determine the connectivity of the bidirectional tunnel.

[0080] The first communication device can generate a first message to detect the connectivity of the IP tunnel between the first and second communication devices. In this application, the first message includes two layers of tunnel information: an outer tunnel information and an inner tunnel information. Both the outer and inner tunnel information are used to guide the forwarding of the first message. Specifically, when the first message is forwarded in the network, the outer tunnel information is used first to guide the forwarding of the first message, and then the inner tunnel information is used to guide the forwarding of the first message.

[0081] In this application, outer tunnel information is used to indicate a first tunnel from the first communication device to the second communication device, and it guides the forwarding of a first message along the first tunnel. As an example, considering that the source IP address and destination IP address are factors that determine the direction of message forwarding, the outer tunnel information may include a first source IP address and a first destination IP address, where the first source IP address indicates the first communication device and the first destination IP address indicates the second communication device. In this way, the outer tunnel information can guide the first message to be forwarded from the first communication device to the second communication device along the first tunnel. Wherein:

[0082] As an example, the first source IP address is the IP address of the first communication device; as yet another example, the first source IP address is the IP address of the VTEP on the first communication device. The VTEP's IP address can also be referred to as the VTEP IP.

[0083] Similarly, in one example, the first destination IP address is the IP address of the second communication device. In yet another example, the first destination IP address is the VTEP IP address on the second communication device.

[0084] In this application, inner tunnel information is used to indicate a second tunnel from the second communication device to the first communication device, and it guides the forwarding of a first message along the second tunnel. As an example, the inner tunnel information may include a second source IP address and a second destination IP address, where the second source IP address indicates the second communication device and the second destination IP address indicates the first communication device. In this manner, the inner tunnel information can guide the forwarding of the first message from the second communication device to the first communication device along the second tunnel.

[0085] As an example, the second source IP address is the IP address of the second communication device; as yet another example, the second source IP address is the IP address of the VTEP on the second communication device. Similarly, in one example, the second destination IP address is the IP address of the first communication device. In yet another example, the second destination IP address is the IP address of the VTEP on the first communication device.

[0086] In addition, the first message also includes BFD control information, which may include a first identifier (discriminator), which may be a local identifier of the first communication device. Regarding the BFD control information, its content may be consistent with that included in a BFD packet in conventional BFD technology, and will not be described in detail here. Of course, the content included in the BFD control information may also differ from that included in a BFD packet in conventional BFD technology, for example, including only a portion of the information; this application is not limiting.

[0087] In one example, the first message may further include first indication information, which indicates that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. This application does not specifically limit the first indication information. In one example, the first indication information may include a first UDP port number located between the aforementioned inner tunnel information and BFD control information. In yet another example, the first indication information may be located in the inner tunnel information. For example, when the inner tunnel information includes a protocol type field, that protocol type field can be used to carry the first indication information. For example, a new protocol type can be applied to identify a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. As a specific example, the first indication information mentioned herein can be carried through the protocol type field included in the GRE header of the inner GRE encapsulation information mentioned below.

[0088] In one example, the aforementioned first and second tunnels can be VXLAN tunnels, for example, when Figure 2 The method shown is applied to the aforementioned Figure 1b or Figure 1c In the scenario shown, both the first tunnel and the second tunnel are VXLAN tunnels.

[0089] In yet another example, the aforementioned first and second tunnels could be either IP-in-IP tunnels or GRE tunnels. For example, when Figure 2 The method shown is applied to the aforementioned Figure 1d In the scenario shown, both the first tunnel and the second tunnel are either IPinIP tunnels or GRE tunnels.

[0090] In one example, if both the first tunnel and the second tunnel are VXLAN tunnels, then the aforementioned outer tunnel information can be outer VXLAN encapsulation information, and the inner tunnel information can be inner VXLAN encapsulation information. (This is based on the first communication device.) Figure 1c The VTEP1 and the second communication device shown correspond to Figure 1c Taking VTEP3 as an example, combined with Figure 3a The structure of the first message is explained. Figure 3a This is a schematic diagram illustrating the structure of a first message provided in an embodiment of this application. For example... Figure 3a As shown:

[0091] The first message includes: outer VXLAN encapsulation information 301, inner VXLAN encapsulation information 302, Ethernet header 303, IP header 304, UDP port number 305, and BFD control information 306. Among them:

[0092] The outer VXLAN encapsulation information 301 and the inner VXLAN encapsulation information 302 have the same structure, both including an Ethernet header, an IP header, a UDP port number, and a VXLAN header.

[0093] In the outer VXLAN encapsulation information 301: the source IP address in the IP header indicates VTEP1, and the destination IP address in the IP header indicates VTEP3.

[0094] In the inner VXLAN encapsulation information 302: the source IP address in the IP header indicates VTEP3, and the destination IP address in the IP header indicates VTEP1. In the inner VXLAN encapsulation information 302: the destination MAC address in the Ethernet header indicates VTEP3, which can be the network virtual endpoint (NVE) MAC of VTEP3.

[0095] In the outer VXLAN encapsulation information 301 and the inner VXLAN encapsulation information 302, the value of the virtual network identifier (VNI) carried in the VXLAN header is 0. In one example, the VNI value is 0, indicating that the packet is a BFD packet carrying BFD control information.

[0096] Furthermore, the IP header in the VXLAN encapsulation information (such as outer VXLAN encapsulation information 301 and inner VXLAN encapsulation information 302) can be either an IPv4 header or an IPv6 header. For example, the IP headers in both outer VXLAN encapsulation information 301 and inner VXLAN encapsulation information 302 can be IPv4 headers, or both can be IPv6 headers.

[0097] The destination media access control (MAC) address in Ethernet header 303 indicates VTEP1, which can be the NVE MAC of VTEP1.

[0098] The destination IP address in the IP header 304 can be, for example, the device's local loopback address. The IP header 304 can be either an IPv4 header or an IPv6 header. When the IP header 304 is an IPv4 header, the destination IP address in the IP header 304 can be, for example, 127 / 8; when the IP header 304 is an IPv6 header, the destination IP address in the IP header 304 can be, for example, 1.

[0099] UDP port number 305 is used to carry the aforementioned first UDP port number, and is used to indicate that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity.

[0100] In another example, if both the first tunnel and the second tunnel are GRE tunnels, then the outer tunnel information can be outer GRE encapsulation information, and the inner tunnel information can be inner GRE encapsulation information. (This is related to the first communication device.) Figure 1d The PE1 and the second communication device shown correspond to Figure 1d Taking PE3 as an example, combined with Figure 3b and Figure 3c The structure of the first message is explained. Figure 3b and Figure 3c The diagram shows the structure of two other first messages provided in the embodiments of this application. Figure 3b As shown:

[0101] The first message includes: outer GRE encapsulation information 307, inner GRE encapsulation information 308, and BFD control information 309.

[0102] The outer GRE encapsulation information 307 includes the Ethernet header, IP header, and GRE header.

[0103] The inner GRE encapsulation information 308 includes the IP header and the GRE header.

[0104] In the outer GRE encapsulation information 307: the source IP address in the IP header indicates PE1, and the destination IP address in the IP header indicates PE3.

[0105] In the inner GRE encapsulation information 308: the source IP address in the IP header indicates PE3, and the destination IP address in the IP header indicates PE1.

[0106] Additionally, the IP header in the GRE encapsulation information (such as outer GRE encapsulation information 307 and inner GRE encapsulation information 308) can be either an IPv4 header or an IPv6 header. For example, the IP headers in both outer GRE encapsulation information 307 and inner GRE encapsulation information 308 can be IPv4 headers, or both outer GRE encapsulation information 307 and inner GRE encapsulation information 308 can be IPv6 headers.

[0107] The protocol type field in the GRE header of the outer GRE encapsulation information 307 indicates that the protocol type is IP.

[0108] The protocol type field in the GRE header of the inner GRE encapsulation information 308 carries the aforementioned first indication information, used to indicate that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity. For example, in Figure 3bIn the inner GRE encapsulation information 308, the protocol type field in the GRE header indicates that the protocol type is single-ended BFD (SBFD). SBFD indicates that the first message is a BFD message initiated by a single-ended device to detect bidirectional tunnel connectivity.

[0109] like Figure 3c As shown, the first message includes: outer GRE encapsulation information 310, inner GRE encapsulation information 311, IP header 312, UDP port number 313, and BFD control information 314. Among them:

[0110] The outer GRE encapsulation information 310 includes the Ethernet header, IP header, and GRE header.

[0111] The inner GRE encapsulation information 311 includes the IP header and the GRE header.

[0112] In the outer GRE encapsulation information 310: the source IP address in the IP header indicates PE1, and the destination IP address in the IP header indicates PE3.

[0113] In the inner GRE encapsulation information 312: the source IP address in the IP header indicates PE3, and the destination IP address in the IP header indicates PE1.

[0114] The destination IP address in IP header 312 can be, for example, the device's local loopback address. IP header 312 can be either an IPv4 header or an IPv6 header. For example, when IP header 312 is an IPv4 header, the destination IP address in IP header 312 can be, for example, 127 / 8; when IP header 312 is an IPv6 header, the destination IP address in IP header 312 can be, for example, :1.

[0115] UDP port number 313 is used to carry the aforementioned first UDP port number, and is used to indicate that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity.

[0116] In another example, if both the first tunnel and the second tunnel are IP-in-IP tunnels, then the outer tunnel information can be outer IP encapsulation information, and the inner tunnel information can be inner IP encapsulation information.

[0117] As mentioned earlier, IP-in-IP tunnels include IPv4-in-IPv6 tunnels, IPv6-in-IPv6 tunnels, IPv4-in-IPv4 tunnels, and IPv6-in-IPv4 tunnels. In one example, if both the first tunnel and the second tunnel are IPv4-in-IPv4 tunnels, or if both the first tunnel and the second tunnel are IPv6-in-IPv4 tunnels, then the outer IP encapsulation information can be outer IPv4 encapsulation information, and the inner IP encapsulation information can be inner IPv4 encapsulation information. (The first communication device corresponds to...) Figure 1d The PE1 and the second communication device shown correspond to Figure 1d Taking PE3 as an example, combined with Figure 3d The structure of the first message is explained. Figure 3d This is a schematic diagram illustrating the structure of yet another first message provided in an embodiment of this application. For example... Figure 3d As shown:

[0118] The first message includes: outer IPv4 encapsulation information 315, inner IPv4 encapsulation information 316, IP header 317, UDP port number 318, and BFD control information 319. Among them:

[0119] The outer IPv4 encapsulation information 315 includes the Ethernet header and the IPv4 header.

[0120] The inner IPv4 encapsulation information 316 includes the IPv4 header.

[0121] In the outer IPv4 encapsulation information 315: the source IP address in the IPv4 header indicates PE1, and the destination IP address indicates PE3.

[0122] In the inner IPv4 encapsulation information 316: the source IP address in the IPv4 header indicates PE3, and the destination IP address indicates PE1.

[0123] The destination IP address in IP header 317 can be, for example, the device's local loopback address. IP header 317 can be either an IPv4 header or an IPv6 header. For example, when IP header 317 is an IPv4 header, the destination IP address in IP header 317 can be, for example, 127 / 8; when IP header 317 is an IPv6 header, the destination IP address in IP header 317 can be, for example, 1.

[0124] UDP port number 318 is used to carry the aforementioned first UDP port number, and is used to indicate that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity.

[0125] In another example, if both the first tunnel and the second tunnel are IPv4-in-IPv6 tunnels, or if both the first tunnel and the second tunnel are IPv6-in-IPv6 tunnels, then the outer IP encapsulation information can be outer IPv6 encapsulation information, and the inner IP encapsulation information can be inner IPv6 encapsulation information.

[0126] Corresponding to the first communication device Figure 1d The PE1 and the second communication device shown correspond to Figure 1d Taking PE3 as an example, combined with Figure 3e The structure of the first message is explained. Figure 3e This is a schematic diagram illustrating the structure of yet another first message provided in an embodiment of this application. For example... Figure 3e As shown:

[0127] The first message includes: outer IPv6 encapsulation information 320, inner IPv6 encapsulation information 321, IP header 322, UDP port number 323, and BFD control information 324. Among them:

[0128] The outer IPv6 encapsulation information 320 includes the Ethernet header and the IPv6 header.

[0129] The inner IPv6 encapsulation information 321 includes the IPv6 header.

[0130] In the outer IPv6 encapsulation information 320: the source IP address in the IPv6 header indicates PE1, and the destination IP address indicates PE3.

[0131] In the inner IPv6 encapsulation information 321: the source IP address in the IPv6 header indicates PE3, and the destination IP address indicates PE1.

[0132] The destination IP address in IP header 322 can be, for example, the device's local loopback address. IP header 322 can be either an IPv4 header or an IPv6 header. For example, when the first and second tunnels are IPv4-in-IPv6 tunnels, IP header 322 is an IPv4 header, and the destination IP address in IP header 322 can be 127 / 8. Similarly, when the first and second tunnels are IPv6-in-IPv6 tunnels, IP header 322 is an IPv6 header, and the destination IP address in IP header 322 can be ::1.

[0133] UDP port number 323 is used to carry the aforementioned first UDP port number, which is used to indicate that the first message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity.

[0134] about Figures 3a to 3eIt should be noted that this is only shown for ease of understanding of the content of this solution and does not constitute a limitation on the embodiments of this application. The fields included in the first message are not limited to... Figures 3a to 3e The fields shown in any of the accompanying figures.

[0135] S102: The first communication device sends the first message.

[0136] After generating the first message, the first communication device can send it. The first communication device can first forward the first message to the network based on the destination IP address in the outer tunnel information (i.e., the aforementioned first destination IP address). If the first tunnel is functioning correctly, the intermediate transmission device in the first tunnel, upon receiving the first message, can look up the routing table based on the destination IP address in the outer tunnel information and forward the first message to the second communication device, which is the destination node. Conversely, if the first tunnel fails, the first communication device cannot forward the first message to the second communication device.

[0137] If the first tunnel is fault-free, after the first communication device sends the first message, the second communication device can execute... Figure 4 S103-S104 are shown. Figure 4 This is a flowchart illustrating another method for determining tunnel connectivity provided in an embodiment of this application.

[0138] S103: The second communication device receives the first message.

[0139] S104: The second communication device sends a second message to the first communication device, the second message including the inner tunnel information and the BFD control information.

[0140] After receiving the first message, the second communication device, being the tail node of the first tunnel indicated by the outer tunneling information, can obtain the second message based on the first message. As a specific example, the second communication device can strip the outer tunneling information from the first message to obtain the second message. As described above regarding the first message, the second message includes at least the aforementioned inner tunneling information and BFD control information.

[0141] After receiving the second message, the second communication device can forward it based on the inner tunnel information. The second communication device can query the routing table based on the destination IP address (i.e., the aforementioned second destination IP address) in the inner tunnel information and forward the second message to the network. When the first and second tunnels are VXLAN tunnels, the destination MAC address in the aforementioned inner tunnel information indicates to the second communication device. Based on this destination MAC address, the second communication device determines that it needs to further forward messages based on the destination IP address in the inner tunnel information.

[0142] If the second tunnel is functioning correctly, the intermediate transmission device within the second tunnel, upon receiving the second message, can look up the routing table based on the destination IP address in the aforementioned inner tunnel information and forward the second message to the first communication device, which is the destination node. Conversely, if the second tunnel fails, the second communication device will be unable to forward the second message to the first communication device.

[0143] If the second tunnel is functioning correctly, after the second communication device sends the second message, the first communication device can receive the second message. Based on this second message, it can then determine that both the first and second tunnels are connected.

[0144] As a concrete example, after receiving the second message, the first communication device can, on the one hand, determine that the second message is a BFD message initiated by a single-end device for detecting bidirectional tunnel connectivity based on the aforementioned first indication information carried in the second message. On the other hand, since the first communication device is the tail node of the second tunnel indicated by the inner tunnel information, the first communication device can strip the outer tunnel information from the second message to obtain a third message, which includes at least the aforementioned BFD control information. In some scenarios, the third message also includes the first UDP port number.

[0145] Furthermore, the first communication device can process the third message using a BFD module. For example, the BFD module can extract the first identifier from the BFD control information of the third message and find the locally stored local identifier. If the first identifier and the local identifier match, it can be determined that the third message corresponds to a BFD session initiated by the first communication device itself. Therefore, the first communication device can determine that both the first tunnel and the second tunnel are functioning correctly. Correspondingly, if the first communication device does not receive the aforementioned second message within a certain period of time, it can be determined that the bidirectional tunnel between the first and second communication devices is faulty.

[0146] In one example, the destination IP address in the IP header of the third packet is the loopback address. For example, the structure of the first packet is as follows: Figure 3a As shown, the IP header of the third message can correspond to Figure 3a The 304 error in the example. For instance, the structure of the first message is as follows: Figure 3c As shown, the IP header of the third message can correspond to Figure 3c 312 in the example. For instance, the structure of the first message is as follows: Figure 3d As shown, the IP header of the third message can correspond to Figure 3d 317 in the example. For instance, the structure of the first message is as follows: Figure 3e As shown, the IP header of the third message can correspond to Figure 3eIn step 322, the first communication device can query the routing table based on the loopback address, thereby using the BFD module to process the third message.

[0147] In another example, after the first communication device parses the first indication information carried in the second message, it can then use the BFD module to process the third message.

[0148] As described above, since the first message includes two layers of tunnel information, both layers can be used to guide the forwarding of the first message within the tunnel. Specifically, the outer tunnel information guides the forwarding of the first message in the first tunnel, and the inner tunnel information guides its forwarding in the second tunnel. Therefore, if both the first and second tunnels are functioning correctly, based on the outer and inner tunnel information, the first message will ultimately be forwarded to the first communication device. Consequently, the first communication device can determine the connectivity of the aforementioned bidirectional tunnel based on the BFD control information. Thus, using the solution provided in this application, even if the IP tunnel only includes a single endpoint (e.g., the first communication device) supporting BFD technology, the connectivity of the bidirectional tunnel can still be determined.

[0149] Moreover, using this scheme, the first communication device does not need to perform a three-way handshake with the second communication device to establish a BFD session. Correspondingly, the first communication device does not need to maintain the state machine controlling the aforementioned three-way handshake locally, and the process of the first communication device initiating a BFD session is simpler.

[0150] Based on the tunnel connectivity determination method provided in the above embodiments, this application also provides a corresponding device, which will be described below with reference to the accompanying drawings.

[0151] See Figure 5 The figure is a schematic diagram of a tunnel connectivity determination device provided in an embodiment of this application. Figure 5 The device 500 shown can be applied to the first communication device mentioned in the above embodiments to execute the method steps provided by the first communication device in the above method embodiments.

[0152] like Figure 5 As shown, the device 500 includes a processing unit 501 and a sending unit 502.

[0153] The processing unit 501 is used to generate a first message, which is a bidirectional forwarding detection (BFD) message initiated by a single-end device for detecting bidirectional tunnel connectivity. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates a first tunnel from the first communication device to the second communication device, and the inner tunnel information indicates a second tunnel from the second communication device to the first communication device. Both the first tunnel and the second tunnel are Internet Protocol (IP) tunnels. The BFD control information is used to determine the connectivity of the bidirectional tunnel.

[0154] The sending unit 502 is used to send the first message.

[0155] In one possible implementation, the IP tunnel includes a Virtual Extended Local Area Network (VXLAN) tunnel, where the outer tunnel information is outer VXLAN encapsulation information and the inner tunnel information is inner VXLAN encapsulation information; or, the IP tunnel includes a Generic Routing Encapsulation (GRE) tunnel, where the outer tunnel information is outer GRE encapsulation information and the inner tunnel information is inner GRE encapsulation information; or, the IP tunnel includes an Internet Protocol (IP)-in-IP (IP-in-IP) tunnel, where the outer tunnel information is outer IP encapsulation information and the inner tunnel information is inner IP encapsulation information.

[0156] In one possible implementation, if the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv6 tunnel or an Internet Protocol version 6 (IPv6) to IPv6 tunnel, then the outer IP encapsulation information is outer IPv6 encapsulation information, and the inner IP encapsulation information is inner IPv6 encapsulation information; or, if the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv4 tunnel or an Internet Protocol version 6 (IPv6) to IPv4 tunnel, then the outer IP encapsulation information is outer IPv4 encapsulation information, and the inner IP encapsulation information is inner IPv4 encapsulation information.

[0157] In one possible implementation, the first message includes a first User Datagram Protocol (UDP) port number, which indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity. The first UDP port number is carried in a field located between the BFD control information and the inner tunnel information.

[0158] In one possible implementation, the inner GRE encapsulation information includes a GRE header, and the protocol type field in the GRE header indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity.

[0159] In one possible implementation, the apparatus 500 further includes a receiving unit for receiving a second message, the second message including the inner tunnel information and the BFD control information. Correspondingly, the processing unit 501 is further configured to determine, based on the second message, that both the first tunnel and the second tunnel are connected.

[0160] See Figure 6 The figure is a schematic diagram of another tunnel connectivity determination device provided in an embodiment of this application. Figure 6 The device 600 shown can be applied to the second communication device mentioned in the above embodiments to execute the method steps provided by the second communication device in the above method embodiments.

[0161] like Figure 6 As shown, the device 600 includes a receiving unit 601 and a transmitting unit 602.

[0162] The receiving unit 601 is used to receive a first message, which is a bidirectional forwarding detection (BFD) message initiated by a single-end device for detecting bidirectional tunnel connectivity. The first message includes outer tunnel information, inner tunnel information, and BFD control information. The outer tunnel information indicates a first tunnel from the first communication device to the second communication device, and the inner tunnel information indicates a second tunnel from the second communication device to the first communication device. Both the first tunnel and the second tunnel are Internet Protocol (IP) tunnels. The BFD control information is used to determine the connectivity of the bidirectional tunnel.

[0163] The sending unit 602 is used to send a second message to the first communication device, the second message including the inner tunnel information and the BFD control information.

[0164] In one possible implementation, the sending unit 602 is specifically used for:

[0165] The outer tunnel information in the first message is stripped to obtain the second message; the second message is then sent.

[0166] In one example, the step of stripping the outer tunnel information from the first message can be performed by the processing unit of the second communication device. In other words, the device 600 may also include a processing unit. In this scenario, the sending unit 602 can obtain the second message from the processing unit and further send the second message.

[0167] In one possible implementation, the IP tunnel includes a Virtual Extended Local Area Network (VXLAN) tunnel, where the outer tunnel information is outer VXLAN encapsulation information and the inner tunnel information is inner VXLAN encapsulation information; or, the IP tunnel includes a Generic Routing Encapsulation (GRE) tunnel, where the outer tunnel information is outer GRE encapsulation information and the inner tunnel information is inner GRE encapsulation information; or, the IP tunnel includes an Internet Protocol (IP)-in-IP (IP-in-IP) tunnel, where the outer tunnel information is outer IP encapsulation information and the inner tunnel information is inner IP encapsulation information.

[0168] In one possible implementation, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv6 tunnel or an Internet Protocol version 6 (IPv6) to IPv6 tunnel, in which case the outer IP encapsulation information is outer IPv6 encapsulation information and the inner IP encapsulation information is inner IPv6 encapsulation information. Alternatively, the IP-in-IP tunnel includes an Internet Protocol version 4 (IPv4) to IPv4 tunnel or an Internet Protocol version 6 (IPv6) to IPv4 tunnel, in which case the outer IP encapsulation information is outer IPv4 encapsulation information and the inner IP encapsulation information is inner IPv4 encapsulation information.

[0169] In one possible implementation, the first message includes a first User Datagram Protocol (UDP) port number, which indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity. The first UDP port number is carried in a field located between the BFD control information and the inner tunnel information.

[0170] In one possible implementation, the inner GRE encapsulation information includes a GRE header, and the protocol type field in the GRE header indicates that the first message is a BFD message initiated by the single-end device for detecting bidirectional tunnel connectivity.

[0171] For details on the specific implementation of each unit of the devices 500 and 600, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0172] Please see Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of a device provided in an embodiment of this application. The structures of both the first communication device and the second communication device can be as follows... Figure 7 As shown. Figure 7The device 700 shown includes a processor 710, a communication interface 720, and a memory 730. The number of processors 710 in the device 700 can be one or more. Figure 7 Taking a processor as an example. In this embodiment, the processor 710, communication interface 720, and memory 730 can be connected via a bus system or other means, wherein, Figure 7 Taking the connection between China and Israel via the 740 bus system as an example.

[0173] Processor 710 may be a CPU, NP, or a combination of CPU and NP. Processor 710 may further include hardware chips. The aforementioned hardware chips may be ASICs, programmable logic devices (PLDs), or combinations thereof. The aforementioned PLDs may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof.

[0174] The memory 730 may include volatile memory, such as random-access memory (RAM); the memory 730 may also include non-volatile memory, such as flash memory, hard disk drive (HDD), or solid-state drive (SSD); the memory 730 may also include a combination of the above types of memory.

[0175] Optionally, the memory 730 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 710 can read the programs from the memory 730 to implement the methods provided in the embodiments of this application (e.g., the aforementioned methods). Figure 2 and / or Figure 4 (The method shown).

[0176] The bus system 740 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus system 740 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0177] This application provides a computer-readable storage medium, including instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the above-described method embodiments. For example, causing the computer to execute... Figure 2 The method described, for example, causes the computer to execute Figure 4 The method described.

[0178] This application provides a computer program product containing instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the above-described method embodiments. For example, it causes the computer to execute... Figure 2 The method described, for example, causes the computer to execute Figure 4 The method described.

[0179] This application also provides a communication system, which can include the functions described above. Figure 2 The first communication device and the execution thereof shown above Figure 4 The second communication device of the method shown.

[0180] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0181] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0182] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical business division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0184] Furthermore, the various business units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software business unit.

[0185] If the integrated unit is implemented as a software business unit and sold or used as a separate product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0186] Those skilled in the art will recognize that, in one or more of the examples above, the services described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.

[0187] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention.

[0188] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for determining tunnel connectivity, characterized in that, The method comprises: The first communication device generates a first message, the first message being a bidirectional forwarding detection (BFD) message initiated by a single-end device for detecting connectivity of a bidirectional tunnel, the first message comprising outer tunnel information, inner tunnel information and BFD control information, the outer tunnel information indicating a first tunnel from the first communication device to a second communication device, the inner tunnel information indicating a second tunnel from the second communication device to the first communication device, the first tunnel and the second tunnel both being Internet Protocol (IP) tunnels, and the BFD control information being used to determine the connectivity of the bidirectional tunnel; The first communication device sends the first message.

2. The method of claim 1, wherein The IP tunnel comprises a virtual extensible local area network (VXLAN) tunnel, the outer tunnel information comprises outer VXLAN encapsulation information, and the inner tunnel information comprises inner VXLAN encapsulation information. Alternatively, The IP tunnel comprises a generic routing encapsulation (GRE) tunnel, the outer tunnel information comprises outer GRE encapsulation information, and the inner tunnel information comprises inner GRE encapsulation information. Alternatively, The IP tunnel comprises an IP-in-IP tunnel, the outer tunnel information comprises outer IP encapsulation information, and the inner tunnel information comprises inner IP encapsulation information.

3. The method of claim 2, wherein When the IP-in-IP tunnel comprises an IPv4-in-IPv6 tunnel or an IPv6-in-IPv6 tunnel, the outer IP encapsulation information comprises outer IPv6 encapsulation information, and the inner IP encapsulation information comprises inner IPv6 encapsulation information. Alternatively, When the IP-in-IP tunnel comprises an IPv4-in-IPv4 tunnel or an IPv6-in-IPv4 tunnel, the outer IP encapsulation information comprises outer IPv4 encapsulation information, and the inner IP encapsulation information comprises inner IPv4 encapsulation information.

4. The method according to any one of claims 1 to 3, characterized in that, The first message comprises a first user datagram protocol (UDP) port number, the first UDP port number indicating that the first message is the BFD message initiated by the single-end device for detecting the connectivity of the bidirectional tunnel, and the first UDP port number being carried in a field between the BFD control information and the inner tunnel information.

5. The method of claim 2, wherein, The inner GRE encapsulation information comprises a GRE header, and a protocol type field in the GRE header indicating that the first message is the BFD message initiated by the single-end device for detecting the connectivity of the bidirectional tunnel.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: The first communication device receives a second message, the second message comprising the inner tunnel information and the BFD control information; The first communication device determines, according to the second message, that the first tunnel and the second tunnel are both connected.

7. A method of determining tunnel reachability, the method comprising: The method comprises: The second communication device receives a first packet, the first packet being a bidirectional forwarding detection (BFD) packet initiated by a single-end device for detecting connectivity of a bidirectional tunnel, the first packet comprising outer tunnel information, inner tunnel information and BFD control information, the outer tunnel information indicating a first tunnel from the first communication device to the second communication device, the inner tunnel information indicating a second tunnel from the second communication device to the first communication device, the first tunnel and the second tunnel being Internet Protocol (IP) tunnels, and the BFD control information being used to determine the connectivity of the bidirectional tunnel; The second communication device sends a second packet to the first communication device, the second packet comprising the inner tunnel information and the BFD control information.

8. The method of claim 7, wherein, The second communication device sends a second packet to the first communication device, comprising: The second communication device strips the outer tunnel information in the first packet to obtain the second packet; The second communication device sends the second packet.

9. The method of claim 7 or 8, wherein The IP tunnel comprises a virtual extensible local area network (VXLAN) tunnel, the outer tunnel information is outer VXLAN encapsulation information, and the inner tunnel information is inner VXLAN encapsulation information. Alternatively, The IP tunnel comprises a generic routing encapsulation (GRE) tunnel, the outer tunnel information is outer GRE encapsulation information, and the inner tunnel information is inner GRE encapsulation information. Alternatively, The IP tunnel comprises an IP-in-IP tunnel, the outer tunnel information is outer IP encapsulation information, and the inner tunnel information is inner IP encapsulation information.

10. The method of claim 9, wherein When the IP-in-IP tunnel comprises an IPv4-in-IPv6 tunnel or an IPv6-in-IPv6 tunnel, the outer IP encapsulation information is outer IPv6 encapsulation information, and the inner IP encapsulation information is inner IPv6 encapsulation information, or When the IP-in-IP tunnel comprises an IPv4-in-IPv4 tunnel or an IPv6-in-IPv4 tunnel, the outer IP encapsulation information is outer IPv4 encapsulation information, and the inner IP encapsulation information is inner IPv4 encapsulation information.

11. The method according to any one of claims 7-10, characterized in that, The first packet comprises a first user datagram protocol (UDP) port number, the first UDP port number indicating that the first packet is the BFD packet initiated by the single-end device for detecting the connectivity of the bidirectional tunnel, and the first UDP port number being carried through a field between the BFD control information and the inner tunnel information.

12. The method of claim 9, wherein, The inner GRE encapsulation information comprises a GRE header, and a protocol type field in the GRE header indicating that the first packet is the BFD packet initiated by the single-end device for detecting the connectivity of the bidirectional tunnel.

13. A device for determining tunnel reachability, the device comprising: The application is applied to a first communication device, and the device comprises: a processing unit configured to generate a first packet, the first packet being a bidirectional forwarding detection (BFD) packet initiated by a single-end device for detecting connectivity of a bidirectional tunnel, the first packet comprising outer tunnel information, inner tunnel information and BFD control information, the outer tunnel information indicating a first tunnel from the first communication device to a second communication device, the inner tunnel information indicating a second tunnel from the second communication device to the first communication device, the first tunnel and the second tunnel being Internet Protocol (IP) tunnels, and the BFD control information being used to determine the connectivity of the bidirectional tunnel; a sending unit configured to send the first packet.

14. A device for determining tunnel reachability, the device comprising: The application is applied to a second communication device, and the device comprises: a receiving unit configured to receive a first packet, the first packet being a bidirectional forwarding detection (BFD) packet initiated by a single-end device for detecting connectivity of a bidirectional tunnel, the first packet comprising outer tunnel information, inner tunnel information and BFD control information, the outer tunnel information indicating a first tunnel from the first communication device to a second communication device, the inner tunnel information indicating a second tunnel from the second communication device to the first communication device, the first tunnel and the second tunnel being Internet Protocol (IP) tunnels, and the BFD control information being used to determine the connectivity of the bidirectional tunnel; a sending unit configured to send a second packet to the first communication device, the second packet comprising the inner tunnel information and the BFD control information.

15. A communication system, characterized by The communication system comprises the first communication device and / or the second communication device, wherein: the first communication device is configured to perform the method of any one of the preceding claims 1-6, and the second communication device is configured to perform the method of any one of the preceding claims 7-12. 16.A communication device comprising a processor and a memory, the memory being configured to store program code, and the processor being configured to invoke the program code in the memory to cause the communication device to perform the method of any one of claims 1-12. 17.A computer-readable storage medium storing instructions, which when executed on a computer, cause the computer to perform the method of any one of claims 1-12.