Method and device for detecting connection status between network nodes

By automatically establishing BFD connections based on BGP neighbor relationships, the problem of low BFD connection efficiency in the existing technology is solved, and network automation operation and maintenance capabilities are improved. It is suitable for function expansion and rapid VNF distribution in cloud environments.

CN113141278BActive Publication Date: 2024-12-03HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010066047.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-20
Publication Date
2024-12-03
Estimated Expiration
2040-01-20

AI Technical Summary

Technical Problem

In the prior art, the efficiency of establishing BFD connections is low, especially when a large number of BFD connections are needed, the configuration complexity of manual methods is high, which affects the network automation operation and maintenance capabilities in the data center, function expansion in the cloud environment and VNF. Quick distribution.

Method used

By receiving the BGP neighbor establishment request sent by the second network node, the BGP neighbor relationship is used to automatically establish a two-way forward detection BFD connection, and the efficiency of establishing the BFD connection is improved without manual means.

Benefits of technology

It realizes automatic establishment of BFD connections, reduces configuration complexity, improves network automation operation and maintenance capabilities, and is suitable for function expansion in cloud environments and the rapid distribution of VNFs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113141278B_ABST
    Figure CN113141278B_ABST
Patent Text Reader

Abstract

The present application discloses a method for detecting the connection status between network nodes, and belongs to the field of communication technology. The method is applied to a first network node, and the method includes the following steps: the first network node receives a Border Gateway Protocol (BGP) neighbor establishment request sent by a second network node, the BGP neighbor establishment request carries the identification information of the second network node, and the BGP neighbor establishment request is used to indicate that the first network node establishes a BGP neighbor relationship with the second network node; the first network node establishes a bidirectional forwarding detection (BFD) connection with the second network node based on the identification information of the second network node and the BGP neighbor relationship established with the second network node, so as to use the BFD connection to detect the connection status between the first network node and the second network node. The present application improves the efficiency of establishing a BFD connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and device for detecting the connection status between network nodes. Background Art

[0002] The border gateway protocol (BGP) is a distance vector routing protocol that enables reachable routes between autonomous systems (AS) and selects the best route. BGP neighbor relationships can be established between every two network devices in different autonomous systems, and two network devices with BGP neighbor relationships use BGP to communicate.

[0003] In order to ensure the communication quality between two network devices that have established a BGP neighbor relationship, the connection status between the two communication devices is usually detected, and when the connection status between the two is abnormal, the connection communication between the two network devices is no longer used. In the related art, a bidirectional forwarding detection (BFD) connection can be established between two network devices, and the BFD connection can be used to detect the connection status between the two network devices.

[0004] However, the BFD connection is usually established manually. When a large number of BFD connections need to be established, the efficiency of establishing the BFD connection is low. Summary of the invention

[0005] The present application provides a method and device for detecting the connection status between network nodes, which can solve the problem of low efficiency in establishing a BFD connection.

[0006] In a first aspect, the present application provides a method for detecting the connection status between network nodes, the method being applied to a first network node, the method comprising: the first network node receiving a Border Gateway Protocol (BGP) neighbor establishment request sent by a second network node, the BGP neighbor establishment request carrying identification information of the second network node, the BGP neighbor establishment request being used to indicate that the first network node establishes a BGP neighbor relationship with the second network node; the first network node establishes a bidirectional forwarding detection (BFD) connection with the second network node based on the identification information of the second network node and the BGP neighbor relationship established with the second network node, so as to use the BFD connection to detect the connection status between the first network node and the second network node.

[0007] The first network node establishes a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node. Compared with the related art, the first network node can automatically establish the BFD connection between the first network node and the second network node without manually establishing the BFD connection, which can improve the efficiency of establishing the BFD connection.

[0008] Optionally, the identification information of the second network node includes: an Internet Protocol IP address of the second network node.

[0009] In one implementable manner, the implementation process of a first network node establishing a bidirectional forwarding detection BFD connection with a second network node based on the identification information of the second network node and the BGP neighbor relationship established with the second network node includes: the first network node switches its own BFD state to a falling state, and sends a BFD message carrying the falling state to the second network node; after receiving the BFD message carrying the falling state sent by the second network node, the first network node switches the BFD state of the first network node to an initialization state, and sends a BFD message carrying the initialization state to the second network node; after receiving the BFD message carrying the initialization state sent by the second network node, the first network node switches the BFD state of the first network node to an rising state.

[0010] Optionally, the method also includes: the first network node establishes a Transmission Control Protocol TCP connection between the first network node and the second network node according to a BGP neighbor establishment request; the first network node receives a first open message sent by the second network node based on the TCP connection, the first open message being used to negotiate with the first network node the parameters used to establish a BGP neighbor relationship; the first network node sends a second open message to the second network node based on the first open message, the second open message being used to negotiate with the second network node the parameters used to establish a BGP neighbor relationship; the first network node receives a first keep-alive message sent by the second network node based on the first open message and the second open message, the first keep-alive message being used to indicate that the BGP neighbor relationship is established; the first network node sends a second keep-alive message to the second network node based on the first open message and the second open message to indicate that the BGP neighbor relationship is established.

[0011] Optionally, after the first network node establishes a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship with the second network node according to the identification information of the second network node, the method further includes: the first network node uses a BFD echo message to detect the connection status between the first network node and the second network node. The implementation process may include:

[0012] The first network node determines, based on the BGP neighbor relationship, a target network port in the network port of the second network node that is bound to the BGP neighbor relationship; the first network node sends a BFD echo message to the target network port based on the BFD connection, and the destination address of the BFD echo message is the network address of the first network node; when the first network node fails to receive the BFD echo message forwarded by the target network port for a specified number of times in a row, it is determined that the connection between the first network node and the second network node is unavailable, and the connection between the first network node and the second network node is marked as unavailable.

[0013] In one possible implementation, the first network node may be a switch, and the second network node may be a VNF. In this way, when establishing a BFD connection between the switch and the VNF, there is no need to manually establish the BFD connection, which can improve the efficiency of establishing the BFD connection, reduce the configuration complexity of the switch, and enhance the network automation operation and maintenance capabilities in the data center, which is conducive to the function expansion and rapid release of VNFs in the cloud environment.

[0014] In the second aspect, the present application provides a device for detecting the connection status between network nodes, and the device for detecting the connection status between network nodes includes: a receiving module, used to receive a Border Gateway Protocol BGP neighbor establishment request sent by a second network node, the BGP neighbor establishment request carries identification information of the second network node, and the BGP neighbor establishment request is used to instruct the device to establish a BGP neighbor relationship with the second network node; an establishing module, used to establish a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, so as to use the BFD connection to detect the connection status between the device and the second network node.

[0015] Optionally, a module is established, specifically used to: switch its own BFD state to a falling state, and send a BFD message carrying the falling state to the second network node; after receiving the BFD message carrying the falling state sent by the second network node, switch the BFD state of the device to an initialization state, and send a BFD message carrying the initialization state to the second network node; after receiving the BFD message carrying the initialization state sent by the second network node, switch the BFD state of the device to an rising state.

[0016] Optionally, the establishment module is also used to: establish a Transmission Control Protocol TCP connection between the device and the second network node according to a BGP neighbor establishment request; receive a first open message sent by the second network node based on the TCP connection, the first open message being used to negotiate with the device for parameters used to establish a BGP neighbor relationship; based on the first open message, send a second open message to the second network node, the second open message being used to negotiate with the second network node for parameters used to establish a BGP neighbor relationship; receive a first keep-alive message sent by the second network node based on the first open message and the second open message, the first keep-alive message being used to indicate that the BGP neighbor relationship is established; based on the first open message and the second open message, send a second keep-alive message to the second network node to indicate that the BGP neighbor relationship is established.

[0017] Optionally, the detection device for the connection status between network nodes also includes a detection module, which is used to: determine, based on the BGP neighbor relationship, a target network port in the network port of the second network node that is bound to the BGP neighbor relationship; based on the BFD connection, send a BFD echo message to the target network port, and the destination address of the BFD echo message is the network address of the device; when the device fails to receive the BFD echo message forwarded by the target network port for a specified number of consecutive times, determine that the connection between the device and the second network node is unavailable, and mark the connection between the device and the second network node as unavailable.

[0018] In a third aspect, the present application provides a computer device, which includes a processor and a memory; a computer program is stored in the memory; when the processor executes the computer program, the computer device implements the method for detecting the connection status between network nodes provided in the first aspect.

[0019] In a fourth aspect, the present application provides a storage medium, which, when instructions in the storage medium are executed by a processor, implements the method for detecting the connection status between network nodes provided in the first aspect.

[0020] In a fifth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer is caused to execute the method for detecting the connection status between network nodes provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of an implementation system involved in a method for detecting a connection status between network nodes provided in an embodiment of the present application;

[0022] Figure 2 It is a schematic diagram of an implementation system involved in another method for detecting the connection status between network nodes provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of an implementation system involved in another method for detecting a connection status between network nodes provided in an embodiment of the present application;

[0024] Figure 4 It is a flow chart of a method for detecting the connection status between network nodes provided in an embodiment of the present application;

[0025] Figure 5 It is a structural schematic diagram of a device for detecting the connection status between network nodes provided in an embodiment of the present application;

[0026] Figure 6 It is a structural schematic diagram of another device for detecting the connection status between network nodes provided in an embodiment of the present application;

[0027] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0029] To facilitate understanding, the terms involved in the embodiments of the present application are explained below.

[0030] Border Gateway Protocol: A routing protocol for autonomous systems (AS) that runs on top of the transmission control protocol (TCP). It is a distance vector routing protocol used to achieve reachable routes between autonomous systems and select the best route.

[0031] Autonomous system: In the Internet, an autonomous system is a small network unit that has the right to independently decide which routing protocol should be used in the system. The network unit can be a simple network or a group of networks controlled by one or more ordinary network administrators. An autonomous system is sometimes also called a routing domain. An autonomous system is assigned a globally unique 16-bit number called an autonomous system number (ASN).

[0032] BGP is divided into exterior border gateway protocol (EBGP) and interior border gateway protocol (IBGP) according to its operation mode.

[0033] BGP running between different ASs is called EBGP. EBGP can prevent loops between ASs. When a BGP device receives routes sent by an EBGP peer, it will discard the routes with the local AS number. Among the two network devices that establish an EBGP neighbor relationship, one is called a BGP device and the other is called an EBGP peer.

[0034] BGP running in the same AS is called IBGP. IBGP can prevent loops in the AS. BGP devices do not advertise routes learned from IBGP peers to other IBGP peers and establish full connectivity with all IBGP peers. Among the two network devices that establish an IBGP neighbor relationship, one is a BGP device and the other is an IBGP peer.

[0035] Bidirectional forwarding detection: A network protocol used to detect whether there is a fault between two forwarding points. BFD can provide millisecond-level detection and can quickly detect the connection status between two forwarding points. BFD can be bound to the BGP neighbor relationship between the two forwarding points, which can achieve rapid convergence of routes between the two forwarding points and ensure business continuity. In addition, BFD can use BFD packets to detect the connection status when the other end does not have BFD protocol support capability, so that BFD can be used for detection regardless of whether the other end has BFD protocol support capability, ensuring that the use of BFD for detection has a wide range of applications.

[0036] Network functions virtualization (NFV): By using general hardware such as general servers, switches and storage devices and virtualization technology, the software processing of the functions of dedicated devices in the communication network is virtualized, and the dedicated devices in the communication network are replaced by software implementation after software processing. NFV can solve the problems of vendor lock-in and reduce the cost of purchasing dedicated hardware with the help of virtualization and other technologies, and can realize the rapid development and deployment of new services and elastic scaling.

[0037] Virtualized network function (VNF): In the NFV architecture, traditional network nodes are mapped to a virtual network element VNF. The resources required by VNF need to be decomposed into virtual computing resources, storage resources, and switching resources. These resources can be carried by the network functions virtualization infrastructure (NFVI).

[0038] The embodiment of the present application provides a method for detecting the connection status between network nodes, which can improve the efficiency of establishing a bidirectional forwarding detection connection. Figure 1 A schematic diagram of an implementation system for a method for detecting a connection status between network nodes provided in an embodiment of the present application. Figure 1 As shown, the system includes: a first network node 01 and a second network node 02. A BGP neighbor relationship is established between the first network node 01 and the second network node 02, so that the first network node 01 and the second network node 02 can communicate with each other through BGP. In addition, based on the BGP neighbor relationship between the first network node 01 and the second network node 02, a BFD connection is also established between the first network node and the second network node, so that the BFD connection can be used to detect the connection status between the first network node and the second network node.

[0039] Wherein, the first network node 01 and the second network node 02 are both devices for network transmission in a communication network. For example, the first network node 01 and the second network node 02 can both be Internet protocol (IP) devices such as switches, routers or firewalls. In addition, the first network node 01 and the second network node 02 can be deployed in different autonomous systems, respectively, or the first network node 01 and the second network node 02 can be deployed in the same autonomous system. Figure 1 It is a schematic diagram that a first network node 01 is located in a first autonomous system AS1, and a second network node 02 is located in a second autonomous system AS2.

[0040] Furthermore, the embodiments of the present application do not limit the deployment method of the first network node 01 and the second network node 02. For example, the first network node 01 and the second network node 02 may both be network nodes deployed using virtualization technology, or both may be network nodes deployed using physical servers, or one of the first network node 01 and the second network node 02 is a network node deployed using virtualization technology, and the other is a network node deployed using a physical server. Furthermore, when a physical server is used to deploy any of the first network node 01 and the second network node 02, one or more network nodes may be deployed in the same physical server, and the first network node and the second network node may be deployed in the same physical server at the same time.

[0041] Optionally, when the first network node 01 establishes a BGP neighbor relationship with multiple second network nodes 02, the multiple second network nodes 02 that establish a BGP neighbor relationship with the first network node 01 may be different network nodes deployed in the same network node, or may be different network nodes deployed in different network nodes. Figure 2As shown, the first network node 01 establishes a BGP neighbor relationship with two second network nodes 02, and the two second network nodes 02 are deployed in the same physical server S. Figure 3 As shown, a first network node 01 establishes a BGP neighbor relationship with two second network nodes 02, and the two second network nodes 02 are respectively deployed in different physical servers. Figure 3 It is a schematic diagram that the two second network nodes 02 are respectively deployed in the physical server S1 and the physical server S2.

[0042] In one possible implementation, as the data traffic in the cloud computing data center increases, the demand for network nodes also increases, and as the NFV technology matures, the deployment of network nodes using VNF becomes a new trend, so the first network node 01 can be a switch, and the second network node 02 can be a VNF network node. The VNF network node and the switch need to exchange routing information, so a BGP neighbor relationship can be established between the VNF network node and the switch, so that the VNF network node and the switch can communicate using BGP.

[0043] It should be noted that the embodiments of the present application do not specifically limit the type of application scenario. When a BGP neighbor relationship needs to be established in the application scenario and communication is performed through the BGP neighbor relationship, it falls within the protection scope of the present application. For example, the application scenario may be an application scenario that requires the establishment of EBGP or IBGP.

[0044] In an embodiment of the present application, the first network node 01 can receive a BGP neighbor establishment request sent by the second network node 02, the BGP neighbor establishment request is used to indicate that the first network node 01 establishes a BGP neighbor relationship with the second network node 02, and the BGP neighbor establishment request carries the identification information of the second network node 02, so that the first network node 01 can establish a bidirectional forwarding detection BFD connection with the second network node 02 based on the BGP neighbor relationship established with the second network node 02 according to the identification information of the second network node 02, so as to use the BFD connection to detect the connection status between the first network node 01 and the second network node 02. In this way, the first network node 01 and the second network node 02 can automatically establish a BFD connection between the first network node 01 and the second network node 02 after the BGP neighbor relationship is established, without the need to manually establish the BFD connection, which can improve the efficiency of establishing the BFD connection.

[0045] Optionally, the functions of the first network node 01 and / or the second network node 02 may be implemented by multiple functional units. For example, when the functions of the first network node 01 and the second network node 02 are both implemented by multiple functional units, the first network node 01 may include: a first BGP unit and a first BFD unit, and the second network node 02 may include: a second BGP unit and a second BFD unit. The first BGP unit and the second BGP unit are used to establish a BGP neighbor relationship between the first network node 01 and the second network node 02. The first BFD unit and the second BFD unit are used to establish a BFD connection between the first network node 01 and the second network node 02 after determining that the BGP neighbor relationship between the first network node 01 and the second network node 02 is established. Among them, after completing the establishment of the BGP neighbor relationship between the first network node 01 and the second network node 02, the first BGP unit may send an establishment completion notification to the first BFD unit. The first BFD unit may determine, based on the establishment completion notification, that the BGP neighbor relationship between the first network node 01 and the second network node 02 is established, and establish, with the second BFD unit, a BFD connection between the first network node 01 and the second network node 02. Similarly, the second BGP unit has functions similar to those of the first BGP unit, and the second BFD unit has functions similar to those of the first BFD unit.

[0046] The following is an explanation of the implementation process of the method for detecting the connection status between network nodes provided in the embodiment of the present application. The method for detecting the connection status between network nodes can be applied to a first network node, and the first network node has the BFD protocol support capability. Figure 4 As shown, the method for detecting the connection status between network nodes may include the following steps:

[0047] Step 401: A first network node receives a BGP neighbor establishment request sent by a second network node.

[0048] After the first network node and the second network node are deployed, a BGP neighbor relationship between the first network node and the second network node can be established, so that the first network node and the second network node communicate based on the BGP neighbor relationship. In addition, the BGP neighbor establishment request can be sent by the second network node. The BGP neighbor establishment request is used to indicate the establishment of a BGP neighbor relationship between the first network node and the second network node. The BGP neighbor establishment request may carry the identification information of the second network node, so that the first network node establishes the BGP neighbor relationship between the first network node and the second network node according to the identification information. Among them, the identification information of the second network node may include: the IP address of the second network node. Optionally, the identification information of the second network node may also include: information such as the autonomous system number of the autonomous system to which the second network node belongs.

[0049] For example, when the first network node is a switch and the second network node is a VNF, after the VNF is created, the VNF can send a BGP neighbor establishment request carrying the identification information of the VNF to the switch to instruct the switch and the VNF to establish a BGP neighbor relationship. The identification information includes the IP address of the VNF and the autonomous system number of the autonomous system to which the VNF belongs.

[0050] Step 402: The first network node establishes a BGP neighbor relationship with the second network node based on a BGP neighbor establishment request.

[0051] After the first network node receives the BGP neighbor establishment request, the first network node can identify the second network node according to the identification information in the BGP neighbor establishment request, and establish a BGP neighbor relationship between the first network node and the second network node with the second network node. Among them, the implementation process of establishing the BGP neighbor relationship between the first network node and the second network node requires the first network node and the second network node to interact and implement. The following takes the first network node as a switch and the second network node as a VNF as an example to illustrate its implementation process, and its implementation process may include the following steps:

[0052] Step 4021: The first network node establishes a TCP connection between the first network node and the second network node according to the BGP neighbor establishment request.

[0053] Step 4022: After a TCP connection is established between the first network node and the second network node, the second network node sends a first open message (open message) to the first network node.

[0054] The first open message is used to request to establish a BGP neighbor relationship between the first network node and the second network node, and the first open message carries relevant parameters for establishing the BGP neighbor relationship. That is, the relevant parameters carried in the first open message are used for the second network node to negotiate with the first network node to establish the BGP neighbor relationship.

[0055] Step 4023: After receiving the first open message sent by the second network node, the first network node sends a second open message to the second network node based on the first open message.

[0056] The second open message carries relevant parameters for establishing a BGP neighbor relationship, that is, the relevant parameters carried in the second open message are used by the first network node and the second network node to negotiate and establish a BGP neighbor relationship.

[0057] Step 4024: After completing parameter negotiation based on the first open message and the second open message, the second network node sends a first keepalive message to the first network node to indicate that the BGP neighbor relationship is established.

[0058] The essence of parameter negotiation performed by the second network node is to select appropriate parameters from the parameters carried in the first open message and the second open message.

[0059] Step 4025: After completing parameter negotiation based on the first open message and the second open message, the first network node sends a second keep-alive message to the second network node to indicate that establishment of the BGP neighbor relationship is complete.

[0060] It should be noted that step 4021 to step 4025 is a feasible way to establish a BGP neighbor relationship between the first network node and the second network node. In actual applications, other methods can also be used to establish a BGP neighbor relationship between the first network node and the second network node. The embodiment of the present application does not specifically limit it.

[0061] Step 403: After the first network node determines that the BGP neighbor relationship is established, it obtains configuration parameters for establishing a BFD connection between the first network node and the second network node.

[0062] The first network node may obtain the relationship state of the BGP neighbor relationship, and when the relationship state of the BGP neighbor relationship is the establishment completion state, the first network node may determine that the BGP neighbor relationship is established. , a configuration parameter for establishing a BFD connection between the first network node and the second network node may be obtained, so as to establish the BFD connection between the first network node and the second network node according to the configuration parameter.

[0063] Optionally, when the function of the first network node is implemented by multiple functional units, and the first network node includes: a BGP unit and a BFD unit, after the BGP unit determines that the establishment of the BGP neighbor relationship is completed, the BGP unit can send a setup completion notification to the BFD unit to indicate that the establishment of the BGP neighbor relationship is completed. Correspondingly, after receiving the setup completion notification, the BFD unit can determine that the relationship state of the BGP neighbor relationship is the establishment completion state, that is, determine that the establishment of the BGP neighbor relationship is completed. At this time, the BFD unit can obtain configuration parameters so as to establish a BFD connection according to the configuration parameters.

[0064] Among them, the configuration parameters may be parameters required for establishing a BFD connection. For example, the configuration parameters at least include: identification information of a network node for indicating the establishment of a BFD connection with the first network node. When a BFD connection is established between the first network node and the second network node, the configuration parameters at least include identification information of the second network node. Optionally, the configuration parameter of the second network node may be an IP address of the second network node. Further, the configuration parameters may also include: information of a network port used by the first network node to connect to the first network node, etc.

[0065] Since the BGP neighbor establishment request is sent by the second network node to the first network node, the BGP neighbor establishment request may carry the configuration information. Therefore, the first network node may obtain the configuration parameter from the BGP neighbor establishment request. For example, the message header of the BGP neighbor establishment request may carry the IP address of the second network node, so the first network node may obtain the IP address of the second network node from the message header of the BGP neighbor establishment request.

[0066] It should be noted that when establishing the BFD connection between the first network node and the second network node, some other parameters for indicating the working mode of the BFD connection are also required. The other parameters are usually parameters that will not change according to the object of the BFD connection. For example, the other parameters can be parameters such as the IP address, BFD detection period, and local discriminator of the first network. Since the other parameters will not change according to the object of the BFD connection, the other parameters are usually default parameters. Before establishing the BFD connection, the first network node can obtain the other parameters to facilitate establishing the BFD connection according to the other parameters. In addition, since the other parameters are default parameters, even if the other parameters need to be manually configured, after one manual configuration, the other parameters can be continuously used in the process of establishing multiple BFD connections. Therefore, even if the number of BFD connections to be established is large, the configuration process of the other parameters will not affect the efficiency of establishing the BFD connection.

[0067] Step 404: The first network node establishes a BFD connection between the first network node and the second network node based on the configuration parameters.

[0068] The implementation process of establishing the BFD connection between the first network node and the second network node requires the first network node and the second network node to interact with each other. The implementation process may include:

[0069] Step 4041: The first network node and the second network node switch their respective BFD states to a down state, and send a BFD message carrying the down state to each other.

[0070] Step 4042: After receiving the BFD message carrying the down state sent by the second network node, the first network node switches the BFD state of the first network node to the initialization (init) state, and sends a BFD message carrying the initialization state to the second network node.

[0071] When the local BFD state of the first network node is switched to initialization, if a BFD message carrying a falling state is received again, the first network node does not process the BFD message carrying the falling state received again.

[0072] Step 4043: After receiving the BFD message carrying the falling state sent by the first network node, the second network node switches the BFD state of the second network node to the initialization state, and sends a BFD message carrying the initialization state to the first network node.

[0073] When the local BFD state of the second network node is switched to initialization, if a BFD message carrying a falling state is received again, the second network node does not process the BFD message carrying the falling state received again.

[0074] Step 4044: After receiving the BFD message carrying the initialization state sent by the second network node, the first network node switches the BFD state of the first network node to an up state.

[0075] It should be noted that after the BFD state of the first network node is switched from the falling state to the initialization state, the first network node will start a timeout timer. If the first network node does not receive a BFD message carrying the initialization state within the time specified by the timeout timer, the first network node will switch the BFD state of the first network node back to the falling state, and end the process of establishing the BFD connection.

[0076] Step 4045: After receiving the BFD message carrying the initialization state sent by the first network node, the second network node switches the BFD state of the second network node to the rising state.

[0077] It should be noted that after the BFD state of the second network node is switched from the falling state to the initialization state, the second network node will start a timeout timer. If the second network node does not receive a BFD message carrying the initialization state within the time specified by the timeout timer, the second network node will switch the BFD state of the second network node back to the falling state, and end the process of establishing the BFD connection.

[0078] Moreover, after the BFD states of the first network node and the second network node are both switched to the rising state, the process of establishing the BFD connection between the first network node and the second network node is completed. At this time, it can be determined that the BFD connection between the first network node and the second network node is successfully established.

[0079] It should be noted that step 4041 to step 4045 is a feasible way to establish a BFD connection between the first network node and the second network node. In actual applications, other methods can also be used to establish a BFD connection between the first network node and the second network node. The embodiment of the present application does not specifically limit it.

[0080] Step 405: The first network node detects a connection status between the first network node and the second network node using a BFD connection.

[0081] The first network node can periodically send a BFD echo message (BFDecho message) to the second network node through a BFD connection. When there is no abnormality in the connection state between the first network node and the second network node, after the second network node receives the BFD echo message, it does not process the BFD echo message and resends the BFD echo message to the first network node. When the connection state between the first network node and the second network node is abnormal, the BFD echo message may be lost during the sending process, resulting in the first network node being unable to receive the BFD echo message returned by the second network node. Therefore, when the first network node does not receive the BFD echo message returned by the second network node for a specified number of times in a row, it can be determined that the connection state between the first network node and the second network node is abnormal. Among them, the BFD echo message is encapsulated using the user datagram protocol (UDP), and the destination address of the BFD echo message is the network address of the first network node, for example, the IP address of the first network node, and the source IP address of the BFD echo message is generated by the configuration.

[0082] Among them, when the second network node is deployed in the same network node or the same physical server where multiple network nodes are deployed, when the first network node sends a BFD echo message to the second network node, it should be sent to the network port configured for the second network node to ensure that the BFD echo message can be sent to the second network node. In addition, since when the second network node establishes a BGP connection with the first network node, the first network node and the second network node need to perform message interaction, and during the message interaction process, the second network node performs message interaction with the first network node through the network interface domain configured for the second network node, therefore, the network port configured for the second network node is recorded in the relevant information of the BGP neighbor relationship between the second network node and the first network node, and accordingly, the network port configured for the second network node can be determined based on the relevant information of the BGP neighbor relationship.

[0083] At this time, the process of the first network node sending a BFD echo message to the second network node may include: the first network node determines, based on the BGP neighbor relationship, a target network port in the network port of the second network node that is bound to the BGP neighbor relationship, and then the first network node uses the BFD connection between the first network node and the second network node to send a BFD echo message to the target network port.

[0084] Step 406: When it is determined according to the BFD connection that the connection state between the first network node and the second network node is abnormal, the first network node determines that the connection between the first network node and the second network node is unavailable, and marks the connection between the first network node and the second network node as unavailable.

[0085] Optionally, when detecting the connection status between the first network node and the second network node according to the BFD connection, when the first network node fails to receive the BFD echo message forwarded by the target network port for a cumulative specified number of times, it can be determined that the connection between the first network node and the second network node is unavailable. Alternatively, when the first network node fails to receive the BFD echo message forwarded by the target network port for a consecutive specified number of times, it can be determined that the connection between the first network node and the second network node is unavailable, which is not specifically limited in the embodiments of the present application.

[0086] When it is determined based on the BFD connection that the connection state between the first network node and the second network node is abnormal, if the connection between the first network node and the second network node is used to transmit data, the transmission will fail. At this time, the route between the first network node and the second network node can be marked as unavailable, so that other routes can be used for communication to avoid communication abnormalities caused by the abnormal connection between the first network node and the second network node. Among them, marking the route between the first network node and the second network node as unavailable can include: deleting the route information between the first network node and the second network node from the routing table.

[0087] It should be noted that BGP also has its own connection status detection strategy, but it has the problem of long detection cycle, which leads to the inability to detect abnormal connections in time, and the traffic will be interrupted for a long time, thus affecting the normal operation of the business. For example, the connection status detection strategy of BGP is: send a detection message every 60 seconds, and if no response to the detection message is received within 180 seconds after the detection message is sent, it is considered that the connection is abnormal, that is, the abnormal situation can only be detected 180 seconds after the connection is abnormal. In the embodiment of the present application, when the BFD connection is used to detect the connection, since the process of constructing the BFD echo message is relatively simple, and the second network node directly returns the BFD echo message, there is no need to process the BFD echo message, so that the interval of sending the BFD echo message can be smaller, therefore, when the connection is abnormal, the time to detect the fault can be shorter (for example, the detection speed can reach milliseconds), and the route can be quickly updated according to the detection result to reduce the flow interruption time caused by the connection failure or the failure of the second network node.

[0088] Furthermore, when using BGP's own connection status detection mechanism to detect the connection status, if the first network node is connected to multiple second network nodes, the first network node needs to send a large number of detection messages, which will cause excessive pressure on the first network node and affect the normal operation of the first network node. By using BFD to detect the connection status, the pressure on the first network node caused by detecting the connection status can be reduced, ensuring that the first network node can work normally.

[0089] Furthermore, in the related art, when establishing a BFD connection, it is necessary to manually configure the IP address of the second network node in the first network node and bind the BFD connection to the BGP neighbor relationship, resulting in a high complexity in establishing the BFD connection, and when a large number of BFD connections need to be established, the efficiency of establishing the BFD connection is low. Moreover, when the second network node and the first network node are both network nodes in a cloud environment, due to the large traffic in the cloud computing data center, the implementation method of manually establishing the BFD connection is not conducive to the function expansion in the cloud environment. At the same time, when the second network node is a VNF in a cloud environment, it is not conducive to the rapid release of the VNF.

[0090] In summary, in the detection method of the connection status between network nodes provided in the embodiment of the present application, the BGP neighbor establishment request sent by the second network node is received by the first network node. Since the BGP neighbor establishment request is used to indicate that the first network node establishes a BGP neighbor relationship with the second network node, and the BGP neighbor establishment request carries the identification information of the second network node, the first network node can establish a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, so that the BFD connection can be used to detect the connection status between the first network node and the second network node. Compared with the related art, the first network node can automatically establish a BFD connection between the first network node and the second network node without manually establishing the BFD connection, which can improve the efficiency of establishing the BFD connection and reduce the workload of manual configuration. In addition, the configuration complexity of the switch is reduced, the network automation operation and maintenance capabilities in the data center are improved, and it is conducive to the function expansion and rapid release of VNF in the cloud environment.

[0091] It should be noted that the sequence of steps of the method for detecting the connection status between network nodes can be adjusted appropriately, and the steps can be increased or decreased accordingly according to the situation. Any technician familiar with the technical field can easily think of a change within the technical scope disclosed in this application, and it should be included in the protection scope of this application, so it will not be repeated.

[0092] The present application also provides a device for detecting the connection status between network nodes. Optionally, the device for detecting the connection status between network nodes can be deployed in the first network node. Figure 5 As shown, the detection device 50 for the connection status between network nodes includes:

[0093] The receiving module 501 is used to receive a Border Gateway Protocol (BGP) neighbor establishment request sent by a second network node. The BGP neighbor establishment request carries identification information of the second network node. The BGP neighbor establishment request is used to instruct the device to establish a BGP neighbor relationship with the second network node.

[0094] Establishing module 502 is used to establish a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, so as to use the BFD connection detection device and the connection status between the second network node.

[0095] Optionally, a module 502 is established, specifically for:

[0096] Switch its own BFD state to a falling state, and send a BFD message carrying the falling state to the second network node;

[0097] After receiving the BFD message carrying the down state sent by the second network node, switching the BFD state of the device to the initialization state, and sending the BFD message carrying the initialization state to the second network node;

[0098] After receiving the BFD message carrying the initialization state sent by the second network node, the BFD state of the device is switched to an ascending state.

[0099] Optionally, the establishing module 502 is further used for:

[0100] establishing a Transmission Control Protocol (TCP) connection between the device and the second network node according to the BGP neighbor establishment request;

[0101] Receiving a first open message sent by the second network node based on the TCP connection, where the first open message is used to negotiate with the device about parameters used to establish a BGP neighbor relationship;

[0102] Based on the first open message, sending a second open message to the second network node, where the second open message is used to negotiate with the second network node about parameters used to establish a BGP neighbor relationship;

[0103] receiving a first keep-alive message sent by the second network node based on the first open message and the second open message, where the first keep-alive message is used to indicate that establishment of the BGP neighbor relationship is complete;

[0104] Based on the first open message and the second open message, a second keep-alive message is sent to the second network node to indicate that the establishment of the BGP neighbor relationship is complete.

[0105] Alternatively, if Figure 6As shown, the device for detecting the connection status between network nodes further includes a detection module 503, and the detection module 503 is used to:

[0106] Based on the BGP neighbor relationship, determine a target network port among the network ports of the second network node that is bound to the BGP neighbor relationship;

[0107] Based on the BFD connection, a BFD echo message is sent to the target network port, and the destination address of the BFD echo message is the network address of the device;

[0108] When the device fails to receive the BFD echo message forwarded by the target network port for a specified number of consecutive times, it is determined that the connection between the device and the second network node is unavailable, and the connection between the device and the second network node is marked as unavailable.

[0109] In summary, in the detection device for the connection status between network nodes provided in the embodiment of the present application, the BGP neighbor establishment request sent by the second network node is received by the receiving module. Since the BGP neighbor establishment request is used to indicate that the detection device for the connection status between network nodes establishes a BGP neighbor relationship with the second network node, and the BGP neighbor establishment request carries the identification information of the second network node, the detection device for the connection status between network nodes can establish a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, so that the connection status between the detection device for the connection status between network nodes and the second network node can be detected by using the BFD connection. Compared with the related art, the detection device for the connection status between network nodes can automatically establish a BFD connection between the detection device for the connection status between network nodes and the second network node, without the need to manually establish the BFD connection, which can improve the efficiency of establishing the BFD connection and reduce the workload of manual configuration. In addition, the configuration complexity of the switch is reduced, the network automation operation and maintenance capabilities in the data center are improved, and it is conducive to the function expansion and rapid release of VNF in the cloud environment.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0111] The embodiment of the present application also provides a computer device. Figure 7 A possible architecture diagram of a computer device is provided as an example. Figure 7 As shown, the computer device may include a processor 701, a memory 702, a communication interface 703 and a bus 704. In the computer device, the number of the processor 701 may be one or more. Figure 7Only one of the processors 701 is shown. Optionally, the processor 701 may be a central processing unit (CPU). If the computer device has multiple processors 701, the types of the multiple processors 701 may be different or the same. Optionally, the multiple processors of the computer device may also be integrated into a multi-core processor.

[0112] The memory 702 stores computer instructions and data. The memory 702 can store computer instructions and data required to implement the method for detecting the connection status between network nodes provided in this application. The memory 702 can be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (ROM), solid state disk (SSD), hard disk (HDD), optical disk, etc.), volatile memory.

[0113] The communication interface 703 may be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a wireless network card, or other devices with a network access function.

[0114] The communication interface 703 is used for the computer device to perform data communication with other nodes or other computer devices.

[0115] Figure 7 A bus 704 is also exemplarily drawn. The bus 704 can connect the processor 701 with the memory 702 and the communication interface 703. Thus, through the bus 704, the processor 701 can access the memory 702, and can also use the communication interface 703 to exchange data with other nodes or other computer devices.

[0116] In the present application, the computer device executes the computer instructions in the memory 702 to implement the detection method of the connection status between network nodes provided in the present application. For example, the computer device executes the computer instructions in the memory 702 to perform the following steps: the first network node receives the Border Gateway Protocol BGP neighbor establishment request sent by the second network node, the BGP neighbor establishment request carries the identification information of the second network node, and the BGP neighbor establishment request is used to indicate that the first network node and the second network node establish a BGP neighbor relationship; the first network node establishes a bidirectional forwarding detection BFD connection with the second network node based on the identification information of the second network node and the BGP neighbor relationship established with the second network node, so as to use the BFD connection to detect the connection status between the first network node and the second network node. In addition, the computer device executes the computer instructions in the memory 702, and the implementation process of executing this step can refer to the corresponding description in the above method embodiment.

[0117] The embodiment of the present application also provides a storage medium, which is a non-volatile computer-readable storage medium. When the instructions in the storage medium are executed by the processor, the method for detecting the connection status between network nodes in the embodiment of the present application is implemented.

[0118] The embodiment of the present application also provides a computer program product including instructions. When the computer program product is executed on a computer, the computer executes the method for detecting the connection status between network nodes in the embodiment of the present application.

[0119] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0120] In the embodiments of the present application, the terms "first", "second" and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "plurality" means two or more, unless otherwise expressly defined.

[0121] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for detecting the connection status between network nodes, It is characterized in that The method comprises: The first network node receives a Border Gateway Protocol (BGP) neighbor establishment request sent by the second network node, where the BGP neighbor establishment request carries identification information of the second network node, and the BGP neighbor establishment request is used to instruct the first network node to establish a BGP neighbor relationship with the second network node; The first network node identifies the second network node based on the identification information of the second network node in the BGP neighbor establishment request, and establishes the BGP neighbor relationship between the first network node and the second network node with the second network node; After the first network node determines that the BGP neighbor relationship is established, obtains configuration parameters for establishing a bidirectional forwarding detection BFD connection between the first network node and the second network node from the BGP neighbor establishment request, the configuration parameters including: identification information of the second network node; The first network node automatically establishes a bidirectional forwarding detection BFD connection with the second network node based on the identification information of the second network node and the BGP neighbor relationship established with the second network node, so as to use the BFD connection to detect the connection status between the first network node and the second network node.

2. The method according to claim 1, It is characterized in that The first network node automatically establishes a bidirectional forwarding detection (BFD) connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, including: The first network node switches its own BFD state to a falling state, and sends a BFD message carrying the falling state to the second network node; After receiving the BFD message carrying the falling state sent by the second network node, the first network node switches the BFD state of the first network node to the initialization state, and sends the BFD message carrying the initialization state to the second network node; After receiving the BFD message carrying the initialization state sent by the second network node, the first network node switches the BFD state of the first network node to an ascending state.

3. The method according to claim 1, It is characterized in that The first network node identifies the second network node based on the identification information of the second network node in the BGP neighbor establishment request, and establishes the BGP neighbor relationship between the first network node and the second network node with the second network node, including: The first network node establishes a Transmission Control Protocol TCP connection between the first network node and the second network node according to the BGP neighbor establishment request; The first network node receives a first open message sent by the second network node based on the TCP connection, where the first open message is used to negotiate with the first network node parameters used to establish the BGP neighbor relationship; The first network node sends a second open message to the second network node based on the first open message, where the second open message is used to negotiate with the second network node about parameters used to establish the BGP neighbor relationship; The first network node receives a first keep-alive message sent by the second network node based on the first open message and the second open message, where the first keep-alive message is used to indicate that establishment of the BGP neighbor relationship is complete; The first network node sends a second keep-alive message to the second network node based on the first open message and the second open message to indicate that establishment of the BGP neighbor relationship is complete.

4. The method according to any one of claims 1 to 3, It is characterized in that After the first network node automatically establishes a bidirectional forwarding detection (BFD) connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, the method further includes: The first network node determines, based on the BGP neighbor relationship, a target network port among the network ports of the second network node that is bound to the BGP neighbor relationship; The first network node sends a BFD echo message to the target network port based on the BFD connection, where the destination address of the BFD echo message is the network address of the first network node; When the first network node fails to receive the BFD echo message forwarded by the target network port for a specified number of consecutive times, it is determined that the connection between the first network node and the second network node is unavailable, and the connection between the first network node and the second network node is marked as unavailable.

5. A device for detecting the connection status between network nodes, It is characterized in that The device is deployed in a first network node, and the device includes: A receiving module, configured to receive a Border Gateway Protocol (BGP) neighbor establishment request sent by a second network node, wherein the BGP neighbor establishment request carries identification information of the second network node, and the BGP neighbor establishment request is used to instruct the device to establish a BGP neighbor relationship with the second network node; an establishing module, configured to identify the second network node based on the identification information of the second network node in the BGP neighbor establishment request, and establish the BGP neighbor relationship between the first network node and the second network node with the second network node; The establishment module is further configured to obtain, from the BGP neighbor establishment request, configuration parameters for establishing a bidirectional forwarding detection (BFD) connection between the first network node and the second network node after determining that the BGP neighbor relationship is established, wherein the configuration parameters include: identification information of the second network node; The establishment module is also used to automatically establish a bidirectional forwarding detection BFD connection with the second network node based on the BGP neighbor relationship established with the second network node according to the identification information of the second network node, so as to use the BFD connection to detect the connection status between the device and the second network node.

6. The device according to claim 5, It is characterized in that The establishment module is specifically used for: Switching its own BFD state to a falling state, and sending a BFD message carrying the falling state to the second network node; After receiving the BFD message carrying the down state sent by the second network node, switching the BFD state of the device to the initialization state, and sending a BFD message carrying the initialization state to the second network node; After receiving the BFD message carrying the initialization state sent by the second network node, the BFD state of the device is switched to an ascending state.

7. The device according to claim 5, It is characterized in that The establishment module is specifically used for: Establishing a Transmission Control Protocol (TCP) connection between the device and the second network node according to the BGP neighbor establishment request; receiving a first open message sent by the second network node based on the TCP connection, where the first open message is used to negotiate with the device about parameters used to establish the BGP neighbor relationship; Based on the first open message, sending a second open message to the second network node, where the second open message is used to negotiate with the second network node the parameters used to establish the BGP neighbor relationship; receiving a first keep-alive message sent by the second network node based on the first open message and the second open message, wherein the first keep-alive message is used to indicate that establishment of the BGP neighbor relationship is complete; Based on the first open message and the second open message, a second keep-alive message is sent to the second network node to indicate that establishment of the BGP neighbor relationship is complete.

8. The device according to any one of claims 5 to 7, It is characterized in that The device further comprises a detection module, wherein the detection module is configured to: Based on the BGP neighbor relationship, determine a target network port among the network ports of the second network node that is bound to the BGP neighbor relationship; Based on the BFD connection, sending a BFD echo message to the target network port, the destination address of the BFD echo message being the network address of the device; When the device fails to receive the BFD echo message forwarded by the target network port for a specified number of consecutive times, it is determined that the connection between the device and the second network node is unavailable, and the connection between the device and the second network node is marked as unavailable.

9. A computer device, It is characterized in that The computer device comprises: a processor and a memory, wherein a computer program is stored in the memory, and when the processor executes the computer program, the computer device implements the method for detecting the connection status between network nodes according to any one of claims 1 to 4.

10. A storage medium, when instructions in the storage medium are executed by a processor, implements the method for detecting the connection status between network nodes as claimed in any one of claims 1 to 4.

Citation Information

Patent Citations

  • BFD session establishing method, BFD session establishing device and routing device

    CN101163060A

  • BGP routing neighbor establishment and maintenance method and device

    CN110061919A