A method and apparatus for link detection
By negotiating the BFD session timeout in the application layer session and interrupting the application layer session before the timer ends, the data loss problem caused by asynchronous establishment of the BFD session is solved, and the reliability of fast link detection and data transmission is achieved.
Patent Information
- Application Number
- CN201910691227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-29
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2039-07-29
AI Technical Summary
In the BGP protocol, the establishment of a BFD session is asynchronous with the BGP session, which causes link jitter to fail to detect quickly, resulting in data loss.
Negotiate the timeout of the BFD session during the application layer session establishment process, and interrupt the application layer session when the BFD session establishment is not completed before the timer ends, and quickly detect the link using the BFD session.
By interrupting the application layer session early, long-term data loss is avoided, and the fastness of link detection and the reliability of data transmission is improved.
Smart Images

Figure CN112311613B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technologies, and particularly to a method and apparatus for link detection in a network. Background Art
[0002] The Border Gateway Protocol (BGP) is a dynamic routing protocol used between autonomous systems (AS). It realizes the reachability between AS by maintaining an IP routing table or a 'prefix' table. When two AS need to exchange routing information, each AS must specify a node running BGP to represent the AS to exchange routing information with other AS. This node can be a host, but usually a router executes BGP. The routers in two AS that use BGP to exchange information are also called Border Gateways or Border Routers. The BGP nodes that exchange messages with each other are called Peers.
[0003] BGP uses the Transmission Control Protocol (TCP) as its transport layer protocol. First, a TCP connection is established between BGP peers. After the TCP connection is established, the connection relationship (i.e., the BGP session) between BGP peers is established through Open messages (start messages). Thereafter, the BGP node periodically sends Keepalive messages (keep messages) to the peer to keep the connection valid. That is to say, BGP can implement a neighbor detection mechanism by periodically sending Keepalive messages. However, usually, the sending period of Keepalive messages is more than 1 second. Therefore, the detection period of this detection mechanism is relatively long. When the data rate reaches the Gbit / s level, the detection time of this mechanism will cause a large amount of data loss.
[0004] Currently, to accelerate BGP convergence, the BGP protocol introduces a function of linking Bidirectional Forwarding Detection (BFD) with BGP. By using the fast detection mechanism of BFD, it can quickly detect the failures of the links between BGP peers and report them to the BGP protocol, so as to achieve the fast convergence of BGP routes. Among them, BFD is a general and standardized fast fault detection mechanism independent of media and protocol. BFD establishes sessions on two network devices to detect the bidirectional forwarding paths between network devices and serves upper-layer applications. BFD itself does not have a neighbor discovery mechanism, but relies on the upper-layer applications it serves to notify its neighbor information to establish sessions. After the session is established, BFD packets will be quickly sent periodically. If no BFD packets are received within the detection time, it is considered that the bidirectional forwarding path has failed, and the upper-layer applications it serves will be notified to perform corresponding processing. When implementing the linkage between BFD and BGP, after a BGP node establishes a BGP session with a peer, the BGP node establishes a BFD session with the peer according to the peer information and uses BFD to detect link failures. When a link failure is detected, the BFD session between the BGP node and the peer is interrupted, and at the same time, the BGP session between the BGP node and the peer is interrupted. Since BFD can achieve millisecond-level detection, through linkage, BGP can achieve the purpose of fast convergence.
[0005] However, the problem with using the BFD detection mechanism in BGP is that the establishment of the BFD session is asynchronous with the establishment of the BGP session, that is, the BFD session starts to be established after the BGP session is established. If link flapping occurs after the BGP session is established and before the BFD session is established, then BGP can only rely on Keeplive to detect the status of the peer, which may still result in data loss for a long period of time. Summary of the Invention
[0006] The present invention provides a method and device for dividing an Interior Gateway Protocol (IGP) domain in a network to solve the problem of high maintenance overhead in the prior art when the network is expanded or adjusted.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] In a first aspect, an embodiment of the present invention provides a link detection method, which is applied to a linkage scenario where an upper layer application is applied to BFD. The method includes: when a first network device and a second network device establish an application layer session, they negotiate and establish a timeout for a Bidirectional Forwarding Detection (BFD) session. The first network device sets and starts a timer according to the negotiated timeout, and establishes a Bidirectional Forwarding Detection (BFD) session with the second network device. If the establishment of the BFD session is not completed before the timer expires, the first network device interrupts the application layer session with the second network device. By implementing the solution of the embodiment of the present invention, if the BFD session is not established for a long time, the application layer session will be interrupted, the path between the two network devices will be converged, and data will not be sent to this path, thereby reducing data loss.
[0009] If the establishment of the BFD session is completed before the timer expires, the first network device performs link detection through the BFD session. In the case where the establishment of the BFD session is successful, the embodiment of the present invention can use BFD to quickly detect the link, thereby accelerating the convergence speed.
[0010] In some possible implementation manners, the first network device and the second network device may carry the timeout defined for the BFD session by each of them in the negotiation message for establishing the application layer session. Then, one of the timeout times defined by the first network device and the second network device is selected as the timeout for the BFD session. By using the negotiation message of the application layer session to negotiate the timeout of the BFD session, the modification to the device can be reduced, and the solution can be more easily implemented.
[0011] In some possible implementation manners, the solution of the embodiment of the present invention can be applied to the linkage between BGP and BFD. In this case, the first network device and the second network device may be Border Gateway Protocol (BGP) nodes. The first network device and the second network device respectively carry the timeout defined for the BFD session by each of them in the negotiation message for establishing the application layer session, including: after the first network device establishes a connection with the second network device, it sends a first OPEN message to the second network device and receives a second OPEN message sent by the second network device. The first OPEN message and the second OPEN message respectively carry the timeout defined for the BFD session by the first network device and the second network device. In the scenario of the linkage between BGP and BFD, the embodiment of the present invention directly uses the OPEN message to implement the negotiation of the timeout, which not only improves the ease of implementation but also achieves good compatibility.
[0012] In some possible implementation manners, the first OPEN message and the second OPEN message carry the timeout time defined for the BFD session through a BFD enable TLV (BFD enable Type-Length-Value); the BFD enable TLV includes a type, a length, and a value, and the timeout time defined for the BFD session is carried in the value of the BFD enable TLV.
[0013] In some possible implementation manners, the first network device and the second network device may select the maximum time value from the timeout times defined by the first network device and the second network device as the timeout time of the BFD session.
[0014] In a second aspect, the present invention provides a network device. The network device is configured to execute the method in the first aspect or any possible implementation manner of the first aspect. Specifically, the network device includes a module configured to execute the method in the first aspect or any possible implementation manner of the first aspect. For example, a negotiation unit configured to execute a function related to negotiation in an application layer session, a BFD unit configured to execute a function related to establishing a BFD session, and an interruption unit configured to execute a determination of whether the establishment of the BFD session times out and an interruption process after timeout.
[0015] In a third aspect, the present invention provides a network device, which includes: a communication interface, a processor, a memory, and a bus. The processor is coupled to the communication interface and the memory through the bus respectively. When the network device needs to be run, it is started by a basic input / output system solidified in the memory or a bootloader in an embedded system to guide the network device into a normal running state. After the network device enters the normal running state, an application program and an operating system in the memory are run, so that the processor executes the method in the first aspect or any possible implementation manner of the first aspect.
[0016] In a fourth aspect, the present invention provides a computer-readable medium for storing a computer program, and the computer program includes instructions for executing the method in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1It is a network diagram showing the linkage between an upper-layer application and BFD provided by an embodiment of the present invention;
[0019] Figure 2 It is an interaction diagram of the link detection method provided by an embodiment of the present invention;
[0020] Figure 3 It is a structural diagram of a network applying BGP provided by an embodiment of the present invention;
[0021] Figure 4 It is a flowchart of the link detection method provided by an embodiment of the present invention;
[0022] Figure 5 It is a format diagram of a BFD enable TLV provided by an embodiment of the present invention;
[0023] Figure 6 It is a structural diagram of a network device provided by an embodiment of the present invention;
[0024] Figure 7 It is a structural diagram of a network device provided by an embodiment of the present application. Detailed implementation manners
[0025] Next, the technical solutions in this embodiment will be clearly and completely described in conjunction with the accompanying drawings in this embodiment.
[0026] Currently, in order to perform rapid detection, the linkage function with BFD has been introduced in many upper-layer applications. The linkage function means that the upper-layer application utilizes the rapid detection mechanism of BFD to quickly detect link failures and report them to the upper-layer application, thereby enabling the upper-layer application to converge quickly. However, during the linkage with BFD, the establishment of the application-layer session (i.e., the session of the upper-layer application) and the establishment of the BFD session are asynchronous, which results in the inability to quickly detect link failures during the period when the application-layer session of the upper-layer application is established but the BFD session is not established, and thus data loss may occur for a relatively long period.
[0027] To address this problem, in the embodiment of the present invention, during the process of establishing a session between upper-layer applications of two network devices, the timeout for establishing the BFD session is negotiated, and a timer is set and started according to the negotiated timeout. When establishing the BFD session, if the establishment of the BFD session is not completed when the timer expires, the established application-layer session is interrupted. In this way, if the BFD session is not established for a long time, the application-layer session will be interrupted, the path between the two network devices will be converged, and data will not be sent to this path, thereby reducing data loss.
[0028] The solution of the embodiment of the present invention can be applied to the scenario of the linkage between an upper-layer application and BFD. As Figure 1 shown, Figure 1A networking schematic diagram of the linkage between an upper-layer application and BFD provided by an embodiment of the present invention. The networking includes network devices 101-104. Among them, the network device can be a host, a router, a switch, etc. The network devices can be located in the same network or in different networks. Network device 101 establishes application-layer sessions with network device 103 and network device 104 respectively, and after the establishment of the application-layer session is completed, a BFD session is established. Assume that the routing egress interface from network device 101 to network device 102 is interface 1, and it reaches network device 102 through network device 103. When a link failure occurs between network device 101 and network device 103, BFD first senses it and notifies the upper-layer application of network device 103. Network device 103 processes the Down event (i.e., interrupts the application-layer session), recalculates the route, and the new routing egress interface is interface 2, and it reaches network device 102 through network device 104. The above is the linkage process between the upper-layer application and BFD. And the embodiment of the present invention further supplements the above process. In the embodiment of the present invention, when network device 101 and network device 103 establish an application-layer session, they further negotiate the timeout duration for establishing the BFD session. During the establishment of the BFD session, if it times out, network device 101 also processes the Down event, converges the link between network device 101 and network device 103, and the new routing egress interface is interface 2, and it reaches network device 102 through network device 104. That is to say, in the embodiment of the present invention, the application-layer session is interrupted in both cases of link failure and BFD session establishment timeout, avoiding long-term data loss.
[0029] When the above solution is specifically implemented, it mainly involves two network devices (for example, network device 101 and network device 103) that link the upper-layer application and BFD. In the embodiment of the present invention, these two network devices are referred to as the first network device and the second network device, and the first network device and the second network device can be mutually referred to as peer network devices. Usually, when the first network device and the second network device establish an application-layer session, they will conduct application-layer session negotiation. The embodiment of the present invention can add the negotiation of the timeout time for establishing the BFD session to the negotiation message of the application-layer session. The specific implementation process is as Figure 2 shown Figure 2 An interaction diagram of the link detection method provided by an embodiment of the present invention. The method includes an application-layer session establishment process and a BFD session establishment process.
[0030] Among them, the application-layer session establishment process includes:
[0031] Steps S201 - S202: The first network device sends a negotiation message for establishing an application layer session to the second network device and receives a negotiation message for establishing an application layer session sent by the second network device. Among them, the first network device and the second network device carry the timeout values defined for the BFD session respectively in the sent negotiation message.
[0032] The negotiation message can be a message with negotiation function during the session establishment process. For example, it can be a session creation message or an initial message, etc.
[0033] The BFD session establishment process includes:
[0034] Steps S203 - S204, the first network device and the second network device select one of the timeout values defined between the first network device and the second network device as the timeout value for the BFD session, and the first network device and the second network device set and start a timer according to the negotiated timeout value.
[0035] When selecting, the first network device and the second network device can select according to a unified rule. For example, they can select the maximum value among the timeout values as the timeout value for the BFD session. The timeout value selected according to the unified rule is the negotiated timeout value for the BFD session.
[0036] Step S205, the first network device and the second network device start to establish a BFD session.
[0037] Step S206, determine whether the establishment of the BFD session is completed before the timer expires.
[0038] If the establishment of the BFD session is not completed before the timer expires, the first network device interrupts the application layer session with the second network device. If the establishment of the BFD session is completed before the timer expires, the first network device detects the link between it and the second network device through the BFD session.
[0039] By the above method, the situation where link detection cannot be performed for a long time is avoided, and data loss can be effectively reduced.
[0040] The solution of the embodiment of the present invention can be applied to various scenarios of the linkage between upper-layer applications and BFD. For example, BFD is linked with Open Shortest Path First (OSPF), BFD is linked with Intermediate System to Intermediate System (IS-IS), BFD is linked with BGP, BFD is linked with Virtual Router Redundancy Protocol (VRRP), and so on. In different linkage scenarios, the upper-layer application protocols enabled on the first network device and the second network device are different. For example, in the scenario where BFD is linked with OSPF, the first network device and the second network device can be devices enabled with the OSPF function; in the scenario where BFD is linked with IS-IS, the first network device and the second network device can be devices enabled with the IS-IS function; in the scenario where BFD is linked with BGP, the first network device and the second network device can be devices enabled with the BGP function. For the convenience of understanding, the embodiment of the present invention is described by taking the linkage between BFD and BGP as an example.
[0041] To facilitate the understanding of the embodiments of the present application, several concepts that may occur in the scenario of the linkage between BFD and BGP are introduced first. It should be understood that the following concept explanations may be limited due to the specific situation of the present application, but it does not mean that the present application can only be limited to this specific situation, and there may also be differences in the explanations of the following concepts along with the specific situations of different embodiments.
[0042] In the BGP message interaction, there are two roles: Speaker and Peer.
[0043] Speaker (sender): The device that sends BGP messages is called a BGP Speaker. It receives or generates new message information and advertises it to other BGP Speakers. The BGP Speaker is a network device enabled with BGP. For the convenience of description, in the embodiment of the present invention, the BGP Speaker is referred to as a BGP node.
[0044] Peer (peer): The Speakers that exchange messages with each other are called peers, and they can also be called neighbors.
[0045] BGP is usually applied between ASs, as Figure 3 shown, Figure 3It is a schematic structural diagram of a network applying BGP provided by an embodiment of the present invention. This network includes two autonomous systems, AS1 and AS2. AS1 includes BGP nodes 101, 102, and 103. AS2 includes BGP nodes 104 and 105. A BGP node is a network device enabled with the BGP function, and this network device can be a host, a router, a switch, etc. Among them, the BGP nodes at both ends indicated by the dotted arrows are peers to each other. For example, BGP node 101 is a peer of BGP node 102, and BGP node 102 is also a peer of BGP node 101. Information is exchanged between AS1 and AS2 through BGP node 102 and BGP node 104. It should be noted that not any two BGP nodes can interact with each other. Two BGP nodes must form a pair (i.e., a BGP peer) to interact. Two BGP nodes form a peer by establishing a BGP session. If the two BGP nodes forming a peer are enabled with the BFD capability, then these two BGP nodes can further establish a BFD session to achieve fast detection through the linkage between BGP and BFD. When two BGP nodes implement the linkage between BGP and BFD, they can implement Figure 2 the solution of the illustrated embodiment to reduce data loss.
[0046] The following combines Figure 4 to elaborate in detail on the realization of fast detection in BGP. Figure 4 It is a flowchart of a link detection method provided by an embodiment of the present invention. This method includes:
[0047] S401, the first BGP node establishes a TCP connection with the second BGP node.
[0048] BGP uses TCP as its transport layer protocol. Before establishing a BGP session, a TCP connection can be established first. The process of establishing a TCP connection can adopt existing technologies and will not be elaborated here.
[0049] S402, the first BGP node sends a BGP start message (i.e., a BGPOPEN message) for establishing a BGP session to the second BGP node, and carries the timeout for establishing a BFD session defined by the first BGP node in the BGP OPEN message.
[0050] The Open message (start message) is the first message sent after the TCP connection is established and is used to establish the connection relationship (i.e., the BGP session) between BGP peers. This message can negotiate various capabilities during the initial establishment of the BGP session, such as address family capabilities, Refresh capabilities, GR (Graceful Restart) capabilities, etc. In the embodiment of the present invention, this message can be used to negotiate the BFD capability, and the negotiated BFD capability can include the timeout for establishing a BFD session.
[0051] Specifically, a BFD enable field (BFD enable TLV) can be added to the OPEN message to negotiate BFD capabilities. Type-Length-Value (TLV) is a message format. The BFD enable TLV is used to inform the local BFD capabilities (i.e., whether BFD is supported) and negotiate the timeout for establishing a BFD session. The BFD enable TLV can refer to Figure 5 , Figure 5 which is a schematic diagram of a format of the BFD enable TLV provided by an embodiment of the present invention. Among them, the meanings of the parameters in this message format are as follows:
[0052] Type: The type of TLV (indicating whether BFD is enabled)
[0053] Length: The length (2 bytes)
[0054] Value: Timer (indicating the timer time, and this parameter can be used to define the timeout for establishing a BFD session)
[0055] The configurable range of the Timer is 1 - 65534, and the maximum value 65535 indicates that the timer is not enabled.
[0056] When the first BGP node sends a BGP OPEN message to the second BGP node, the BFD enable TLV can be carried to indicate that the first BGP node enables BFD capabilities. Among them, the Value in the BFD enable TLV can be set to 10, indicating that the timer is set to 10S, that is, the timeout for establishing a BFD session defined by the first BGP node is 10S.
[0057] S403. The second BGP node sends a BGP OPEN message to the first BGP node and carries the timeout for establishing a BFD session defined by the second BGP node in the BGP OPEN message.
[0058] Similarly, when the second BGP node sends a BGP OPEN message to the first BGP node, the BFD enable TLV can also be carried to indicate that the second BGP node enables BFD capabilities. Among them, the Value in the BFD enable TLV can be set to 20, indicating that the timer is set to 20S, that is, the timeout for establishing a BFD session defined by the second BGP node is 20S.
[0059] S404 - S405. After receiving the BGP OPEN message sent by the peer, the first BGP node and the second BGP node send Keepalive messages to the peer for confirmation and maintain the connection.
[0060] After receiving the Keepalive message replied by the peer, the BGP session is successfully established.
[0061] S406 - S408. After the BGP session is established, the first BGP node and the second BGP node respectively set and start timers according to the received BGP OPEN message, and establish a BFD session.
[0062] The first BGP node and the second BGP node negotiate the timer value (i.e., the timeout period for establishing the BFD session) according to the BFD enable TLV carried in the BGP OPEN message. Specifically, the larger value of the timer values defined by both parties (such as 20s) can be taken as the timer value, the timer is set, and the timer is started.
[0063] It should be noted that if the received BGP OPEN message does not carry the BFD enable TLV, it means that the other party does not support the BFD enable TLV or does not have the BFD capability. In this case, the timer is not started. This embodiment is described by taking the case where the BFD enable TLV is carried as an example.
[0064] Establishing the BFD session can be implemented by using existing technologies, which will not be elaborated here.
[0065] S409. Before the timer expires, if the establishment of the BFD session is not completed, the first network device and the second network device send BGP Notification messages to each other to interrupt the BGP session with each other.
[0066] The BGP Notification message is a message for notifying the detected errors. After the first network device and the second network device send the BGP Notification message, the peer will be set to down at the local end (i.e., the BGP session with the peer is interrupted).
[0067] This embodiment is described by taking the case where the establishment of the BFD session is not completed before the timer expires. If the establishment of the BFD session is completed before the timer expires, the first network device and the second network device perform link detection through the established BFD session.
[0068] The process of performing link detection by the BFD session can be implemented by referring to existing technologies, which will not be elaborated here.
[0069] The above embodiment realizes the control of whether the establishment of the BFD session times out by extending the OPEN message in BGP, and greatly shortens the service impairment time. Moreover, the method of extending the existing message results in small modifications to the existing devices and good compatibility.
[0070] The above is described by taking the interaction between BFD and BGP as an example. In other scenarios where upper-layer applications interact with BFD, similar implementations to the interaction between BFD and BGP can be referred to, and will not be elaborated here one by one.
[0071] Figure 6 The network device 600 provided by an embodiment of the present invention is schematically shown. The network device 600 includes a negotiation unit 601, a BFD unit 602, and an interruption unit 603.
[0072] Among them, the negotiation unit 601 is used to negotiate the timeout of establishing a Bidirectional Forwarding Detection (BFD) session with the peer network device during the process of establishing an application-layer session. For example, when the network device to which the negotiation unit 601 belongs is the first network device or the first BGP node in the above method embodiment, the peer network device is the second network device or the second BGP node in the above method embodiment. For the specific implementation of the negotiation unit 601, reference can be made to Figure 2 and Figure 4 the function of the first network device or the first BGP node negotiating the timeout of establishing a BFD session with the second network device or the second BGP node in the method embodiments shown.
[0073] The BFD unit 602 is used to set and start a timer according to the timeout negotiated by the negotiation unit 601, and establish a Bidirectional Forwarding Detection (BFD) session with the peer network device. For the specific implementation of the BFD unit 602, reference can be made to Figure 2 and Figure 4 the part of the first network device or the first BGP node setting the timer and establishing a BFD session in the method embodiments shown.
[0074] The interruption unit 603 is used to interrupt the application-layer session with the peer network device in the case that the BFD unit 602 fails to complete the establishment of the BFD session before the timer expires. For the specific implementation of the interruption unit 603, reference can be made to Figure 2 and Figure 4 the part of the first network device or the first BGP node interrupting the application-layer session with the second network device or the second BGP node in the method embodiments shown.
[0075] The BFD unit 602 can also perform link detection through the established BFD session in the case that the BFD session has been established before the timer expires.
[0076] When the above network device is applied in different scenarios, different upper-layer application functions can be enabled. For example, when applied in the scenario of the interaction between BFD and BGP, the network device can enable the BGP function and execute Figure 4 the functions of the first BGP node or the second BGP node in the method embodiments shown.
[0077] It should be understood that the network device 600 here is embodied in the form of functional units. In an alternative example, those skilled in the art can understand that the network device 600 may correspond to the network device, the first network device, the second network device, the first BGP node, and the second BGP node in the above embodiments, and can be used to execute each process and / or step corresponding to the related devices in the above method embodiments. To avoid repetition, it will not be elaborated here.
[0078] Generally, the network devices (such as the first network device, the second network device, the first BGP node, and the second BGP node) implementing the embodiments of the present invention may be hosts, routers, switches, etc. The following introduces the hardware structure of the network device in the embodiments of the present invention. Figure 7 It is a schematic structural diagram of the network device provided in the embodiments of the present invention. As Figure 7 shown, the network device 700 includes: a communication interface 701, a processor 702, and a memory 703. Optionally, the network device 700 may further include a bus 704. Among them, the communication interface 701, the processor 702, and the memory 703 may be interconnected through the bus 704.
[0079] Among them, the processor may be composed of one or more general-purpose processors, such as a central processing unit (CPU). The processor can be used to run the program code for the processing function. That is, the processor executing the program code can implement Figure 6 the functions of the negotiation unit, the BFD unit, and the interrupt unit in the embodiments shown, or implement the functions of the first network device as in Figure 2 , Figure 4 the functions of the first BGP node in
[0080] The communication interface 701 may be a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface), and is used to communicate with other modules or devices. For example, the communication interface 7011 in the first network device in the embodiments of the present application may be specifically used to receive messages sent by the second network device, or send messages to the second network device, etc.
[0081] The memory 703 may include volatile memory, such as random access memory (RAM); the memory may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); the memory 703 may further include a combination of the above types of memories. The memory can be used to store a set of program codes, so that the processor can call the program codes stored in the memory to implement the functions of the communication module and / or the processing module involved in the embodiments of the present application, and the embodiments of the present application do not make any limitations.
[0082] The features, functions, and / or methods described in the embodiments of the present application (such as, Figure 2 or Figure 4 the method shown) can be implemented in the network device 700. For example, the features, functions, or methods in the embodiments of the present application can be implemented by hardware, firmware, and / or software running on the hardware. The network device 700 can be any device that transmits data through a network, system, and / or domain (such as, switch, router, bridge, server, client, etc.). In addition, network node, network component, network device, network element, and / or similar terms can be used interchangeably to generally describe the network device; and unless otherwise specifically specified and / or stated in the present application, these terms do not have specific or special meanings. In an exemplary embodiment, the network device 700 can be a device for implementing the linkage between the upper-layer application and BFD to detect the link. It should be noted that Figure 7 This is only a possible implementation manner of the embodiments of the present application. In practical applications, the network device may further include more or fewer components, which are not limited here. For the content not shown or described in the embodiments of the present application, reference can be made to the relevant descriptions in the foregoing Figure 2 or Figure 4 described embodiments, which will not be elaborated here.
[0083] In other possible embodiments, the network device may also be a virtual network device implemented based on a general physical server and network function virtualization (NFV) technology, and the virtual network device may be a virtual router. The virtual network device may be a virtual machine running a link detection device for providing upper-layer applications and BFD linkage, and the virtual machine is deployed on a hardware device (e.g., a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. This virtual network device performs all functions and operations of the network device 600 or the network device 700.
[0084] The embodiment of the present invention further provides a computer non-transient storage medium, wherein the computer non-transient storage medium stores instructions, and when the instructions are executed on a processor, Figure 2 or Figure 4 Any of the method processes described in is implemented.
[0085] An embodiment of the present invention further provides a computer program product. When the computer program product is run on a processor, Figure 2 or Figure 4 Any of the method processes described in is implemented.
[0086] The steps of the method or algorithm described in conjunction with the disclosed content of the embodiments of the present invention can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist in a computing device as discrete components.
[0087] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The said program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above various methods. The foregoing storage medium includes: various media such as ROM, RAM, magnetic disks, or optical discs that can store program codes.
Claims
1. A link detection method, characterized in that, Including: During the process of establishing an application layer session between a first network device and a second network device, negotiate the timeout of establishing a Bidirectional Forwarding Detection (BFD) session, where the first network device and the second network device are Border Gateway Protocol (BGP) nodes; The first network device sets and starts a timer according to the negotiated timeout, and establishes a Bidirectional Forwarding Detection (BFD) session with the second network device; If the establishment of the BFD session is not completed before the end of the timer, the first network device interrupts the application layer session with the second network device; If the establishment of the BFD session is completed before the end of the timer, the first network device performs link detection through the BFD session; During the process of establishing an application layer session between a first network device and a second network device, negotiating the timeout of establishing a Bidirectional Forwarding Detection (BFD) session includes: After establishing a connection with the second network device, the first network device sends a first OPEN message to the second network device and receives a second OPEN message sent by the second network device. The first OPEN message and the second OPEN message respectively carry the timeout defined by the first network device and the second network device for the BFD session; Select one of the timeouts defined by the first network device and the second network device as the timeout of the BFD session.
2. The method according to claim 1, characterized in that, The first OPEN message and the second OPEN message carry the timeout defined for the BFD session through a BFD enable type-length-value (BFD enable TLV); The BFD enable TLV includes type, length, and value, and the timeout defined for the BFD session is carried in the value of the BFD enable TLV.
3. The method according to any one of claims 1-2, characterized in that, The step of selecting one of the timeouts defined by the first network device and the second network device as the timeout of the BFD session includes: selecting the maximum time value as the timeout of the BFD session from the timeouts defined by the first network device and the second network device.
4. A network device, characterized in that, Including: A negotiation unit, configured to negotiate the timeout of establishing a Bidirectional Forwarding Detection (BFD) session with a peer network device during the process of establishing an application layer session, where the network device and the peer network device are Border Gateway Protocol (BGP) nodes; A BFD unit, configured to set and start a timer according to the timeout negotiated by the negotiation unit, and establish a Bidirectional Forwarding Detection (BFD) session with the peer network device; An interruption unit, configured to interrupt the application layer session with the peer network device when the BFD unit fails to complete the establishment of the BFD session before the end of the timer; If the establishment of the BFD session is completed before the end of the timer, the BFD unit is further configured to perform link detection through the BFD session; Specifically, after establishing a connection with the peer network device, the negotiation unit is configured to send a first OPEN message to the peer network device and receive a second OPEN message sent by the peer network device. The first OPEN message and the second OPEN message respectively carry the timeout values defined by the network device and the peer network device for the BFD session. Select one of the timeout values defined by the local device and the peer network device as the timeout value for the BFD session.
5. The network device according to claim 4, characterized in that, The first OPEN message and the second OPEN message carry the timeout values defined for the BFD session through a BFD enable type-length-value (TLV). The BFD enable TLV includes a type, a length, and a value. The timeout value defined for the BFD session is carried in the value of the BFD enable TLV.
6. The network device according to any one of claims 4-5, characterized in that, The negotiation unit is configured to select one of the timeout values defined by the local device and the peer network device as the timeout value for the BFD session, including: the negotiation unit is configured to select the maximum value of the timeout values defined by the local device and the peer network device as the timeout value for the BFD session.
7. A network device is applied to a link detection system. The link detection system includes a first network device and a second network device. The network device is the first network device, and is characterized in that, The network device includes a processor and a memory. The memory is configured to store instructions. The processor is configured to call the instructions in the memory and execute the method according to any one of claims 1-3 above.
8. A computer non-transitory storage medium storing a computer program, characterized in that, When the computer program is executed by a computing device, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Method for sending BGP (border gateway protocol) keep-alive information by the aid of BFD (bidirectional forwarding detection) messages and routing devices
CN102769573A