CN112714060A - Link detection method and device - Google Patents

Link detection method and device Download PDF

Info

Publication number
CN112714060A
CN112714060A CN202011527586.9A CN202011527586A CN112714060A CN 112714060 A CN112714060 A CN 112714060A CN 202011527586 A CN202011527586 A CN 202011527586A CN 112714060 A CN112714060 A CN 112714060A
Authority
CN
China
Prior art keywords
bfd
control message
bgp
received
bgp peer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011527586.9A
Other languages
Chinese (zh)
Other versions
CN112714060B (en
Inventor
魏大旺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN202011527586.9A priority Critical patent/CN112714060B/en
Publication of CN112714060A publication Critical patent/CN112714060A/en
Application granted granted Critical
Publication of CN112714060B publication Critical patent/CN112714060B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results

Abstract

The application provides a link detection method and equipment. The method comprises the following steps: establishing a Bidirectional Forwarding Detection (BFD) session with a Border Gateway Protocol (BGP) peer, and determining that a BFD control message from the BGP peer is not received in a BFD detection period; checking the transceiving logic of the BFD session and whether a BFD control message of a BGP peer is received in a link switching period; and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to the links connected with other BGP peers.

Description

Link detection method and device
Technical Field
The present application relates to communications technologies, and in particular, to a link detection method and device.
Background
BFD (Bi-direction Forwarding Detection) is a general, standardized, media-independent and protocol-independent rapid fault Detection mechanism, and is used for detecting the communication status of links in an IP network and ensuring that communication faults can be rapidly detected between devices so as to take measures in time and ensure continuous operation of services.
The communication device is linked with the BFD through a Border Gateway Protocol (BGP) service, and notifies a Protocol layer link failure in a BFD session millisecond level, so that the BGP Protocol layer can quickly disconnect BGP Protocol connection and switch a link for forwarding flow.
However, when the CPU schedules an abnormality, the device may cause BFD message packet reception of the device to be abnormally detected by a BFD error. But the customer's BGP is still running. This results in an abnormal jitter of the BFD protocol, and thus of the BGP protocol throughout the network. The fast jitter reconvergence of BGP may result in traffic loss. Network maintenance personnel spend a great deal of time locating BFD and BGP jitter reasons, and BFD misdetection damages the running stability of the routing protocol.
Disclosure of Invention
The present application aims to provide a link detection method and device, which improve the accuracy of bidirectional forwarding detection.
To achieve the above object, the present application provides a link detection method, including: establishing a Bidirectional Forwarding Detection (BFD) session with a Border Gateway Protocol (BGP) peer, and determining that a BFD control message from the BGP peer is not received in a BFD detection period; checking the transceiving logic of the BFD session and whether a BFD control message of a BGP peer is received in a link switching period; and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to the links connected with other BGP peers.
A link detection device, the device comprising a processor and a memory; the memory is used for storing processor executable instructions; wherein the processor is configured to perform the following by executing the processor-executable instructions in the memory: establishing a Bidirectional Forwarding Detection (BFD) session with a Border Gateway Protocol (BGP) peer, and determining that a BFD control message from the BGP peer is not received in a BFD detection period; checking the transceiving logic of the BFD session and whether a BFD control message of a BGP peer is received in a link switching period; and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to the links connected with other BGP peers.
The method and the device have the advantages of reducing BFD false detection and improving the accuracy of BFD detection.
Drawings
Fig. 1 is a flowchart illustrating a link detection method according to an embodiment of the present disclosure;
fig. 2 is a flow chart of another embodiment of a link detection method provided in the present application;
fig. 3 is a flowchart illustrating an embodiment of a link detection apparatus provided in the present application.
Detailed Description
A detailed description will be given of a number of examples shown in a number of figures. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the present application. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the examples.
The term "including" as that term is used is meant to include, but is not limited to; the term "comprising" means including but not limited to; the terms "above," "within," and "below" include the instant numbers; the terms "greater than" and "less than" mean that the number is not included. The term "based on" means based on at least a portion thereof.
Fig. 1 is a flowchart illustrating an embodiment of a link detection method provided in the present application, where the method includes:
step 101, establishing a Bidirectional Forwarding Detection (BFD) session with a Border Gateway Protocol (BGP) peer.
And 102, determining that the BFD control message from the BGP peer is not received in the BFD detection period.
Step 103, checking the transceiving logic of the BFD session and whether the BFD control message of the BGP peer is received in the link switching period.
And step 104, determining that the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, and disconnecting the communication with the BGP peer to switch to the link connected with the BGP peer.
The method and the device have the advantages of reducing BFD false detection and improving the accuracy of BFD detection.
Fig. 2 is a flowchart illustrating a link detection method according to an embodiment of the present application;
step 201, establishing a BFD session linked with a BGP protocol with a BGP peer.
And configuring BFD on equipment serving as a BGP peer and establishing a BFD session in an active mode asynchronous mode.
Step 202, the BFD control message of the BGP peer is cached.
After the device and the opposite terminal establish the BFD session linked with the BGP protocol, the devices at both terminals need to cache a source packet of the BFD packet sent from the opposite terminal device in the cache memory according to the session index, and the source packet includes an IP (internet protocol) header.
And step 203, periodically sending the BFD control message.
Step 204, determine whether a BFD control message is received in the detection period? If yes, go to step 205; if not, return to step 203.
The peer sets up a timer for the established BGP-linked BFD session, such as 1.5 times the receive time of the BFD session. The equipment judges whether BFD control messages from the opposite terminal are received before the timer arrives. If the BFD control message from the opposite terminal is not received when the timer arrives, the possible problem of the BFD session is temporarily judged, and whether the transceiving logic of the BFD session has a fault or not needs to be confirmed.
And step 205, generating a loopback BFD control message according to the cached BFD control message.
The equipment generates a loopback BFD control message according to the cached BFD control message of the opposite terminal, and is used for detecting the transceiving logic state of the BFD control message of the real BFD conversation of the equipment. However, in order to distinguish from the real BFD control packet from the opposite terminal, the device generates a setting of the reserved bit of M bit of the 16 th bit of the loopback BFD control packet from "0" to "1" for identifying the loopback BFD control packet so as to avoid interfering with the transceiving judgment of the BFD control packet of the normal BFD session.
Step 206, sending a loopback BFD control message.
The equipment sends a loopback BFD control message to the exchange chip through the CPU port. The exchange chip processes the loopback BFD control message according to the sending logic, determines that the target IP address of the loopback BFD control message is the IP address of the equipment by searching the forwarding table, executes the packet receiving logic of the loopback BFD control message, and sends the loopback BFD control message to the CPU of the equipment. Thus, the loopback BFD control message executes a complete sending logic and receiving logic on the exchange chip. And the CPU of the equipment judges the link condition according to the receiving and transmitting logic processing condition of the loopback BFD control message and the message receiving of the BFD session in the next detection period of 1.5s of the current BFD session.
In step 207, is a loopback BFD control message received? If yes, go to step 208; if not, go to step 211.
When the CPU of the device can normally receive and process the loopback BFD control message, the sending and receiving logics of the BFD message of the device are normal.
If the CPU of the device cannot receive and process the looped BFD detection message, the BFD control message receiving and sending logic of the device is considered to have problems, and then the normal BFD control message detection result is continuously monitored.
In step 208, is a BFD control message received during the link switching period? If yes, go to step 209, otherwise, go to step 212.
Because the device has received the loopback BFD control message, the device cannot receive the BFD message sent by the opposite device in the link switching period, for example, 3 BFD message sending periods, so that the failure of the link or the opposite device results in the failure to receive the BFD control message in 3 BFD sending periods.
When the device can normally receive the BFD control message sent by at least one opposite terminal device in 3 BFD message sending periods, the link connected with the opposite terminal device is considered to be normal, and the protocol communication is continuously maintained.
At step 209, the BGP communication is disconnected.
The device interrupts the BGP protocol and cuts off traffic.
Is BGP communication resumed, step 210? If yes, go back to step 203; if not, return to step 210.
In step 211, is a BFD control message received during the link switching period? If yes, go to step 212; if not, go to step 212.
Step 212, maintaining BGP communication and returning to step 203.
Because the loopback BFD control message is not received, the device receives the BFD message sent by the opposite terminal device in the link switching period, such as 3 BFD message sending periods, and then the normal BFD control message detection result is continuously monitored if the receiving and sending logic of the BFD message of the device is considered to have problems.
If the CPU of the device cannot normally receive and process the loopback detection BFD packet and does not receive the BFD packet sent from the opposite terminal within 3 BFD packet sending periods, the two results are more likely to cause a problem in the BFD packet receiving logic of the device itself when they are superimposed, because the BGP session is normal but the possibility of simultaneous failure of the loopback BFD control packet and the BFD control packet is very low. The device may print or display an alert to notify the client device that there is an anomaly in the packet reception logic of the BFD without temporarily disconnecting the BGP protocol.
Fig. 3 is a schematic diagram of a link detection apparatus 300 provided herein. The device 30 includes a processor and a memory; the memory is used for storing processor executable instructions; wherein the processor is configured to perform the following by executing the processor-executable instructions in the memory: establishing a Bidirectional Forwarding Detection (BFD) session with a Border Gateway Protocol (BGP) peer, and determining that a BFD control message from the BGP peer is not received in a BFD detection period; checking the transceiving logic of the BFD session and whether a BFD control message of a BGP peer is received in a link switching period; and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to the links connected with other BGP peers.
The processor, by executing the processor-executable instructions in the memory, further performs the following: and detecting when the receiving and sending logic of the BFD conversation is normal and the BFD control message of the BGP peer is received in the link switching period, and keeping BGP communication with the BGP peer.
The processor, by executing the processor-executable instructions in the memory, further performs the following: and when the transceiving logic of the BFD conversation fails and the BFD control message of the BGP peer is received in the link switching period, keeping normal BGP communication with the BGP peer.
The processor, by executing the processor-executable instructions in the memory, further performs the following: and when the transceiving logic of the BFD conversation fails and the BFD control message of the BGP peer is not received in the link switching period, keeping normal BGP communication with the BGP peer.
The processor executing the transceiving logic to check for BFD sessions by executing the processor-executable instructions in the memory comprises the operations of: generating a loopback BFD control message; the source end information of the loopback BFD control message is the source end information of the BFD control message from the BGP peer of the cached BFD conversation; sending a loopback BFD control message through a loopback interface; determining that the transceiving logic of the BFD session is normal according to the received loopback BFD control message; or, the loopback BFD control message is not received in the loopback detection period to determine the transceiving logic fault of the BFD session.
The present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed.

Claims (10)

1. A method of link detection, the method comprising:
a Bidirectional Forwarding Detection (BFD) session is established with a Border Gateway Protocol (BGP) peer,
determining that the BFD control message from the BGP peer is not received in the BFD detection period;
checking the transceiving logic of the BFD session and whether a BFD control message of the BGP peer is received in a link switching period;
and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to other links connected with the BGP peer.
2. The method of claim 1, further comprising:
and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is received in the link switching period, maintaining BGP communication with the BGP peer.
3. The method of claim 1, further comprising:
and when the transceiving logic of the BFD session fails and the BFD control message of the BGP peer is received in the link switching period, keeping normal BGP communication with the BGP peer.
4. The method of claim 1, further comprising:
and when the transceiving logic of the BFD conversation fails and the BFD control message of the BGP peer is not received in the link switching period, keeping normal BGP communication with the BGP peer.
5. The method of claim 1, wherein checking transceiving logic of the BFD session comprises:
generating a loopback BFD control message; the source end information of the loopback BFD control message is the cached source end information of the BFD session from the BFD control message of the BGP peer;
sending the loopback BFD control message through a loopback interface;
determining that the transceiving logic of the BFD session is normal according to the received loopback BFD control message; or, the loopback BFD control message is not received in the loopback detection period to determine the failure of the transceiving logic of the BFD session.
6. A link detection device, comprising a processor and a memory; the memory is to store processor-executable instructions; wherein the processor, by executing the processor-executable instructions in the memory, is to perform operations comprising:
a Bidirectional Forwarding Detection (BFD) session is established with a Border Gateway Protocol (BGP) peer,
determining that the BFD control message from the BGP peer is not received in the BFD detection period; checking the transceiving logic of the BFD session and whether a BFD control message of the BGP peer is received in a link switching period;
and when the transceiving logic of the BFD conversation is normal and the BFD control message of the BGP peer is not received in the link switching period, the communication with the BGP peer is disconnected to switch to other links connected with the BGP peer.
7. The device of claim 6, wherein the processor, by executing the processor-executable instructions in the memory, further performs the following:
and when the receiving and sending logic of the BFD conversation is normal and the BFD control message of the BGP peer is received in the link switching period, the detection keeps BGP communication with the BGP peer.
8. The device of claim 6, wherein the processor, by executing the processor-executable instructions in the memory, further performs the following:
and when the transceiving logic of the BFD conversation fails and the BFD control message of the BGP peer is received in the link switching period, keeping normal BGP communication with the BGP peer.
9. The device of claim 6, wherein the processor, by executing the processor-executable instructions in the memory, further performs the following:
and when the transceiving logic of the BFD conversation fails and the BFD control message of the BGP peer is not received in the link switching period, keeping normal BGP communication with the BGP peer.
10. The device of claim 6, wherein the processor executing transceiving logic to check the BFD session by executing processor-executable instructions in the memory comprises:
generating a loopback BFD control message; the source end information of the loopback BFD control message is the cached source end information of the BFD session from the BFD control message of the BGP peer;
sending the loopback BFD control message through a loopback interface;
determining that the transceiving logic of the BFD session is normal according to the received loopback BFD control message;
or, the loopback BFD control message is not received in the loopback detection period to determine the failure of the transceiving logic of the BFD session.
CN202011527586.9A 2020-12-22 2020-12-22 Link detection method and device Active CN112714060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011527586.9A CN112714060B (en) 2020-12-22 2020-12-22 Link detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011527586.9A CN112714060B (en) 2020-12-22 2020-12-22 Link detection method and device

Publications (2)

Publication Number Publication Date
CN112714060A true CN112714060A (en) 2021-04-27
CN112714060B CN112714060B (en) 2022-05-27

Family

ID=75545083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011527586.9A Active CN112714060B (en) 2020-12-22 2020-12-22 Link detection method and device

Country Status (1)

Country Link
CN (1) CN112714060B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726780A (en) * 2022-03-23 2022-07-08 阿里云计算有限公司 Communication method, device and storage medium from cloud to cloud

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163060A (en) * 2007-11-30 2008-04-16 杭州华三通信技术有限公司 BFD session establishing method, BFD session establishing device and routing device
CN101909006A (en) * 2010-07-23 2010-12-08 北京星网锐捷网络技术有限公司 BFD (Bidirectional Forwarding Detection) message sending and receiving methods as well as device and communication system thereof
CN102780593A (en) * 2012-07-25 2012-11-14 中兴通讯股份有限公司 BFD (Bidirectional Forwarding Detection) protocol-based link detection method and apparatus and network processor
US20130028099A1 (en) * 2011-07-25 2013-01-31 Girish Birajdar Bootstrapping fault detection sessions over a p2mp tunnel
WO2017054547A1 (en) * 2015-09-28 2017-04-06 中兴通讯股份有限公司 Bidirectional forwarding detection method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163060A (en) * 2007-11-30 2008-04-16 杭州华三通信技术有限公司 BFD session establishing method, BFD session establishing device and routing device
CN101909006A (en) * 2010-07-23 2010-12-08 北京星网锐捷网络技术有限公司 BFD (Bidirectional Forwarding Detection) message sending and receiving methods as well as device and communication system thereof
US20130028099A1 (en) * 2011-07-25 2013-01-31 Girish Birajdar Bootstrapping fault detection sessions over a p2mp tunnel
CN102780593A (en) * 2012-07-25 2012-11-14 中兴通讯股份有限公司 BFD (Bidirectional Forwarding Detection) protocol-based link detection method and apparatus and network processor
WO2017054547A1 (en) * 2015-09-28 2017-04-06 中兴通讯股份有限公司 Bidirectional forwarding detection method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726780A (en) * 2022-03-23 2022-07-08 阿里云计算有限公司 Communication method, device and storage medium from cloud to cloud
CN114726780B (en) * 2022-03-23 2024-04-02 阿里云计算有限公司 Communication method, device and storage medium from top to bottom of cloud

Also Published As

Publication number Publication date
CN112714060B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN101132320B (en) Method for detecting interface trouble and network node equipment
CN102577332B (en) For system, the method and computer program of multidirectional Path selection
US8117337B2 (en) Method and device for implementing link pass through in point-to-multipoint network
US8593944B2 (en) Method, apparatus and communication system for protecting signaling transmission
US20110255410A1 (en) Congestion control method and devices
US20090003241A1 (en) A Method and System For Obtaining Path Maximum Transfer Unit in Network
CN101710896B (en) Method and device for detecting link quality
EP3029883B1 (en) Network protection method and apparatus, next-ring node, and system
US8477655B2 (en) Method, device, and system for establishing label switching path in fast rerouting switching
WO2012088910A1 (en) Method and system for detecting connectivity fault
CN112714060B (en) Link detection method and device
CN114172798B (en) BIER network fault detection method, device, equipment and readable storage medium
CN113645312B (en) Sub-ring network link protection method and device based on ERPS protocol
US20070115838A1 (en) Method and system for loop-back and continue in packet-based network
CN107846470B (en) Method and system for guiding flow
CN108270593A (en) A kind of two-node cluster hot backup method and system
CN112073270B (en) Link fault detection method and device
CN106301835B (en) BFD link establishing method and device and router
CN113037622B (en) System and method for preventing BFD from vibrating
CN102299830B (en) Dial-up link detection method and equipment
CN112312497B (en) Method and device for rapidly switching services
CN115102897B (en) Stacking splitting protection method based on link aggregation
CN109039728A (en) Flow congestion detection method and system based on BFD
CN114513433B (en) Message processing method and device
CN117676767A (en) Data communication method, device, electronic equipment and nonvolatile storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant