CN109586959B - Fault detection method and device - Google Patents

Fault detection method and device Download PDF

Info

Publication number
CN109586959B
CN109586959B CN201811419429.9A CN201811419429A CN109586959B CN 109586959 B CN109586959 B CN 109586959B CN 201811419429 A CN201811419429 A CN 201811419429A CN 109586959 B CN109586959 B CN 109586959B
Authority
CN
China
Prior art keywords
address
bfd
header
message
network device
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.)
Active
Application number
CN201811419429.9A
Other languages
Chinese (zh)
Other versions
CN109586959A (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
Original Assignee
New H3C Technologies Co Ltd
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 filed Critical New H3C Technologies Co Ltd
Priority to CN201811419429.9A priority Critical patent/CN109586959B/en
Publication of CN109586959A publication Critical patent/CN109586959A/en
Application granted granted Critical
Publication of CN109586959B publication Critical patent/CN109586959B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a fault detection method and a fault detection device, which relate to the technical field of communication, wherein the method is applied to first network equipment and comprises the following steps: receiving a first BFD message sent by second network equipment, determining the receiving time interval of the first BFD message and the second BFD message according to the receiving time of the second BFD message received last time and the receiving time of the first BFD message, deleting a first message header encapsulated by the second network equipment in the first BFD message if the receiving time interval is greater than a preset time interval threshold, judging whether a destination Internet Protocol (IP) address of the first BFD message is the same as a local IP address, and outputting state monitoring information if the destination IP address is the same as the local IP address, wherein the state monitoring information comprises a current message header of the first BFD message, and the current message header is a message header missing the first message header. By the aid of the method and the device, fault positioning efficiency can be improved.

Description

Fault detection method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for fault detection.
Background
Bidirectional Forwarding Detection (BFD) is a general, standardized, media independent and protocol independent fast failure Detection mechanism. The method is mainly used for detecting whether a communication link between network devices has a link failure.
In the prior art, two network devices (such as a first network device and a second network device) may periodically send BFD messages to detect whether a communication link fails. At least one intermediate device may be disposed between the first network device and the second network device. If the first network device receives the BFD message sent by the second network device over a preset time (such as a multiple of the BFD sending interval time), determining that a link fault occurs in a communication link between the first network device and the second network device, and outputting state monitoring information.
Based on the prior art, when a plurality of intermediate network devices exist between a first network device and a second network device, if a communication link between the first network device and the second network device has a link failure, a technician needs to check the intermediate network devices one by one to determine the failed network device, which results in low efficiency of fault location.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for fault detection, so as to improve efficiency of fault location. The specific technical scheme is as follows:
in a first aspect, a method for fault detection is provided, where the method is applied to a first network device, and the method includes:
receiving a first Bidirectional Forwarding Detection (BFD) message sent by second network equipment, wherein the first BFD message comprises at least one layer of message header;
determining a receiving time interval between a first BFD message and a second BFD message according to the receiving time of the last received second BFD message and the receiving time of the first BFD message, wherein the second BFD message and the first BFD message are BFD messages aiming at the same communication link;
if the receiving time interval is larger than a preset time interval threshold, deleting a first message header in the first BFD message, wherein the first message header is a message header packaged by the second network equipment;
judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address;
and if the destination IP address is the same as the local IP address, outputting state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message, and the current message header is the message header missing the first message header.
Optionally, the method further includes:
and if the receiving time interval is not larger than a preset time interval threshold, executing the step of judging whether the destination IP address is the same as the local IP address.
Optionally, the method further includes:
and if the destination IP address is different from the local IP address, overlapping and packaging a second message header for the first BFD message, and forwarding the first BFD message to a third network device according to the destination IP address of the first BFD message.
Optionally, the second packet header is an ethernet protocol header, where a source MAC address in the second packet header is an MAC address of an outgoing interface of the first network device, and a destination MAC address is an MAC address of an incoming interface of the third network device.
Optionally, the second packet header is an IP protocol header, a source IP address in the second packet header is an IP address of an output interface of the first network device, and a destination IP address is a destination IP address of the first BFD packet.
In a second aspect, an apparatus for fault detection is provided, where the apparatus is applied to a first network device, and the apparatus includes:
a receiving module, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by a second network device, where the first BFD packet includes at least one layer of packet header;
a determining module, configured to determine a receiving time interval between a first BFD packet and a second BFD packet according to a receiving time of a second BFD packet received last time and a receiving time of the first BFD packet, where the second BFD packet and the first BFD packet are BFD packets for a same communication link;
a deleting module, configured to delete a first packet header in the first BFD packet if the receiving time interval is greater than a preset time interval threshold, where the first packet header is a packet header encapsulated by the second network device;
the first judgment module is used for judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address;
and a first output module, configured to output status monitoring information if the destination IP address is the same as the local IP address, where the status monitoring information includes a current header of the first BFD packet, and the current header is a header missing the first header.
Optionally, the apparatus further comprises:
and the second judging module is used for triggering the first judging module to execute the step of judging whether the destination IP address is the same as the local IP address or not if the receiving time interval is not larger than a preset time interval threshold value.
Optionally, the apparatus further comprises:
and the adding module is used for superposing and packaging a second message header on the first BFD message if the destination IP address is different from the local IP address, and forwarding the first BFD message to third network equipment according to the destination IP address of the first BFD message.
Optionally, the second packet header is an ethernet protocol header, where a source MAC address in the second packet header is an MAC address of an outgoing interface of the first network device, and a destination MAC address is an MAC address of an incoming interface of the third network device.
Optionally, the second packet header is an IP protocol header, a source IP address in the second packet header is an IP address of an output interface of the first network device, and a destination IP address is a destination IP address of the first BFD packet.
In a third aspect, a network device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, carries out the method steps of the second aspect.
In a fifth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above described fault detection methods.
The method and the device for fault detection provided by the embodiment of the application receive a first Bidirectional Forwarding Detection (BFD) message sent by a second network device. The first BFD message comprises at least one message header. And then, determining the receiving time interval between the first BFD message and the second BFD message according to the receiving time of the second BFD message received last time and the receiving time of the first BFD message, wherein the second BFD message and the first BFD message are the BFD messages aiming at the same communication link. And then, judging that the receiving time interval is greater than a preset time interval threshold value. And if the receiving time interval is larger than a preset time interval threshold, deleting the first message header in the first BFD message. Wherein the first header is a header encapsulated by the second network device. And finally, judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address. And if the destination IP address is the same as the local IP address, outputting state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message, and the current message header is the message header missing the first message header. Therefore, technicians can determine the network equipment with the fault according to the missing message header in the current message header, and the fault positioning efficiency is improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a system architecture diagram of a communication network provided by an embodiment of the present application;
fig. 2 is a flowchart of a method for fault detection according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a fault detection apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a fault detection apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a fault detection apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a network device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a fault detection method which can be applied to network equipment in a communication network. Fig. 1 is a system architecture diagram of a communication network provided in an embodiment of the present application, as shown in fig. 1, the communication network includes a first network device, a second network device, a third network device, a fourth network device, a fifth network device, a sixth network device, and a seventh network device. The connection relationship and interface information of each network device in the communication network are as follows: a first interface (IP address is 1.1.1.1, MAC address is 1-1-1-1-1) of the first network equipment is connected with a third interface (IP address is 1.1.1.2, MAC address is 1-1-1-1-2) of the second network equipment; the second interface (IP address is 2.1.1.1, MAC address is 2-1-1-1-1-1) of the first network equipment is connected with the fifth interface (IP address is 2.1.1.2, MAC address is 2-1-1-1-2) of the third network equipment; a fourth interface (IP address is 3.1.1.1, MAC address is 3-1-1-1-1) of the second network equipment is connected with an eighth interface (IP address is 3.1.1.2, MAC address is 3-1-1-1-2) of the fourth network equipment; a sixth interface (IP address is 4.1.1.1, MAC address is 4-1-1-1-1-1) of the third network equipment is connected with a ninth interface (IP address is 4.1.1.2, MAC address is 4-1-1-1-2) of the fourth network equipment; the seventh interface (IP address is 5.1.1.1, MAC address is 5-1-1-1-1-1) of the third network equipment is connected with the eleventh interface (IP address is 5.1.1.2, MAC address is 5-1-1-1-2) of the fifth network equipment; a tenth interface (IP address is 6.1.1.1, MAC address is 6-1-1-1-1-1) of the fourth network equipment is connected with a fourteenth interface (IP address is 6.1.1.2, MAC address is 6-1-1-1-2) of the sixth network equipment; the twelfth interface (IP address is 7.1.1.1, MAC address is 7-1-1-1-1) of the fifth network equipment is connected with the fifteenth interface (IP address is 7.1.1.2, MAC address is 7-1-1-1-2) of the sixth network equipment; the thirteenth interface (IP address is 8.1.1.1, MAC address is 8-1-1-1-1) of the fifth network equipment is connected with the seventeenth interface (IP address is 8.1.1.2, MAC address is 8-1-1-1-2) of the seventh network equipment; the sixteenth interface (IP address 9.1.1.1, MAC address 9-1-1-1-1) of the sixth network device is connected with the eighteenth interface (IP address 9.1.1.2, MAC address 9-1-1-1-2) of the seventh network device.
The following describes a method for fault detection provided in the embodiments of the present application in detail with reference to specific embodiments. It should be noted that, in this embodiment of the application, the first network device may be any one of the network devices in the communication system shown in fig. 1, and the second network device may be a network device that is directly connected to the first network device and forwards the BFD packet to the first network device. As shown in fig. 2, the specific steps are as follows:
step 201, receiving a first BFD packet sent by a second network device.
Wherein, the first BFD message comprises at least one layer of message header.
In implementation, when the first network device receives the first BFD packet sent by the second network device, the first network device may record a receiving time (hereinafter, referred to as a first receiving time) of the first BFD packet. The first BFD packet includes at least one layer of packet header, where the packet header may be an ethernet protocol header, an IP protocol header, or a multi-protocol Label Switching (MPLS) protocol header, and the embodiment of the present invention is not limited.
Step 202, determining the receiving time interval between the first BFD packet and the second BFD packet according to the receiving time of the second BFD packet and the receiving time of the first BFD packet received last time.
The second BFD message and the first BFD message are the BFD messages aiming at the same communication link.
In an implementation, the first network device may store a reception time (hereinafter, referred to as a second reception time) of the second BFD packet received last time in advance. After determining the first receiving time of the first BFD packet, the first network device may calculate a difference between the first receiving time and the second receiving time, that is, a receiving time interval between the first BFD packet and the second BFD packet. Then, the first network device may further determine whether the receiving time interval is greater than a preset time interval threshold.
In an implementation manner, if the first network device stores the receiving time of the BFD messages of the plurality of communication links, the first network device may further record the source IP address and the destination IP address of each BFD message, and further query the BFD message (i.e., the second BFD message) having the same source IP address and destination IP address as those carried in the first BFD message. Then, the first network device may determine, in the second BFD packet, a receiving time of the second BFD packet closest to the current time.
In another implementation, the first network device may start a timer after receiving each BFD packet. Subsequently, after the first network device receives the BFD packet having the same source IP address and destination IP address as the BFD packet, the receiving time interval may be determined according to the current time recorded by the timer.
Step 203, if the receiving time interval is greater than the preset time interval threshold, deleting the first header in the first BFD message.
Wherein the first header is a header encapsulated by the second network device.
In an implementation, after the first network device determines the receiving time interval, it may determine whether the receiving time interval is greater than a preset time interval threshold. If the receiving time interval is greater than the preset time interval threshold, it indicates that the communication link between the first network device and the second network device has a fault, and the first network device may determine, in the first BFD message, a header encapsulated by the second network device. The first network device may delete the first header.
Alternatively, the time interval threshold may be set by a skilled person, for example, the time interval threshold may be a multiple of the packet sending time interval, for example, the packet sending time interval is 10ms, and the time interval threshold may be set to be 3 times of the packet sending time interval, that is, 30 ms. Alternatively, the time interval threshold may also be a sum of a packet sending time interval and a time delay, and accordingly, the time delay in the link may be determined first. For example, the time delay may be determined by some network measurement tool, and the time delay in the link may be determined in real time according to the network measurement tool, so as to calculate the time interval threshold. The network measurement tool may adopt a link performance measurement tool, and the like, and the embodiment of the present application is not limited. Or, a maximum BFD packet transmission interval value when the BFD packet transmission is busy but no BFD oscillation occurs in a certain longer period may be determined, and this value is used as the time interval threshold.
And step 204, judging whether the destination IP address of the first BFD message is the same as the local IP address.
In implementation, after deleting the first packet header in the first BFD packet, the first network device may further determine whether the destination IP address of the first BFD packet is the same as the local IP address. The local IP address may be an IP address of an interface on the first network device, or an IP address of a loopback interface (loopback) set on the first network device.
In step 205, if the destination IP address is the same as the local IP address, the status monitoring information is output.
The state monitoring information comprises a current message header of the first BFD message, and the current message header is the message header missing the first message header.
In implementation, if the destination IP address is the same as the local IP address, it indicates that the first network device does not need to forward the first BFD packet (that is, the first network device is the last-hop network device or the tail node), and the first network device may output the state monitoring information to the specified device. The designated device may be a certain management terminal or a preset server, the first network device may send the state monitoring information to the designated device, and the designated device may store the state monitoring information; alternatively, the designated device may be a first network device, and the first network device may store the status monitoring information locally. The state monitoring information comprises a current message header of the first BFD message, and the current message header is the message header missing the first message header.
In this way, a technician can know the current packet header of the first BFD packet by looking up the state monitoring information, and then determine the missing packet header in the first BFD packet, that is, the first packet header added to the second network device, according to the communication link corresponding to the first BFD packet, thereby determining that the link between the second network device and the first network device is faulty, and improving the efficiency of fault location.
In this embodiment of the application, the first BFD packet is a BFD packet sent by the second network device to the first network device, and the BFD packet may be a BFD packet sent by another network device to the second network device. At this time, the technician can know all the message headers missing in the first BFD message by checking the status monitoring information, thereby determining all the network devices having faults in the communication link.
Optionally, if the receiving time interval is not greater than the preset time interval threshold, directly determining whether the destination IP address is the same as the local IP address. And if the destination IP address is the same as the local IP address, outputting the state monitoring information. The state monitoring information comprises the current message header of the first BFD message.
In implementation, if the receiving time interval is less than or equal to the preset time interval threshold, it indicates that the communication link between the first network device and the second network device has not failed, and the first network device does not need to delete the first packet header in the first BFD packet. Then, the first network device may directly determine whether the destination IP address of the first BFD packet is the same as the local IP address. If the destination IP address is the same as the local IP address, it indicates that the first network device does not need to forward the first BFD packet (i.e., the first network device is the last-hop network device or the tail node), and the first network device may output the state monitoring information. The state monitoring information comprises the current message header of the first BFD message. In this way, a technician can determine the faulty network device according to the message header that does not exist in the current message header of the first BFD message included in the state monitoring information, thereby improving the efficiency of fault location.
Optionally, if the destination IP address is different from the local IP address, the second packet header is encapsulated in the first BFD packet in a superimposing manner, and the first BFD packet is forwarded to the third network device according to the destination IP address of the first BFD packet.
In implementation, if the destination IP address is different from the local IP address, it indicates that the first network device needs to forward the first BFD packet (that is, the first network device is an intermediate network device or an intermediate node), and the first network device may encapsulate the second packet header in the first BFD packet in an overlapping manner. Then, the first network device may query, according to the destination IP address of the first BFD packet, an egress interface corresponding to the destination IP address in a pre-stored routing forwarding table, and forward the first BFD packet to a third network device (i.e., a next-hop network device) through the egress interface.
Optionally, for a case that the packet header is an ethernet protocol header, the source MAC address in the second packet header is an MAC address of an outgoing interface of the first network device, and the destination MAC address is an MAC address of an incoming interface of the third network device.
Correspondingly, the first network device may encapsulate, in the first BFD packet, a second packet header whose source MAC address is an MAC address of an outgoing interface of the first network device and whose destination MAC address is an MAC address of an incoming interface of the third network device.
The first network device may further set the type field in the second packet header to the ethernet type, so that after the third network device receives the first BFD packet, the second packet header may be determined to be a packet header of the newly added ethernet type according to the type field in the second packet header.
Optionally, for a case that the packet header is an IP protocol header, the source IP address in the second packet header is an IP address of an output interface of the first network device, and the destination IP address is a destination IP address of the first BFD packet.
Correspondingly, the first network device may encapsulate, in the first BFD packet, a second packet header whose source IP address is an IP address of an egress interface of the first network device and whose destination IP address is a destination IP address of the first BFD packet.
Optionally, the first network device may further set the type field in the second packet header as an IP type, so that after the third network device receives the first BFD packet, the second packet header may be determined to be a newly added packet header of the IP type according to the type field in the second packet header.
The embodiment of the application also provides an example of a fault detection method. Referring to fig. 1, in an example first, a first BFD packet sent by a first network device reaches a fifth network device via a third network device, a fourth network device, and a sixth network device. The message header is an ethernet protocol header, a communication link between the fourth network device and the sixth network device fails, and communication links between other network devices are normal. The method comprises the following specific steps:
step one, the first network equipment encapsulates a first message header to the first BFD message and sends the first BFD message to the third network equipment.
The current message header in the first BFD message is shown in the table I, the source MAC address in the first message header is the MAC address 2-1-1-1 of the second interface, the destination MAC address is the MAC address 2-1-1-1-2 of the fifth interface, and the type field is IP.
Watch 1
Serial number Source MAC address Destination MAC address Type field
1 2-1-1-1-1-1 2-1-1-1-1-2 IP
And step two, after receiving the first BFD message, the third network equipment superposes and encapsulates a second message header on the first BFD message, and forwards the first BFD message to the fourth network equipment.
The current message header in the first BFD message is shown in the table two, the source MAC address in the second message header is the MAC address 4-1-1-1 of the sixth interface, the destination MAC address is the MAC address 4-1-1-1-1-2 of the ninth interface, and the type field is Ethernet.
Watch two
Serial number Source MAC address Destination MAC address Type field
2 4-1-1-1-1-1 4-1-1-1-1-2 Ethernet network
1 2-1-1-1-1-1 2-1-1-1-1-2 IP
And step three, after receiving the first BFD message, the fourth network equipment superposes and encapsulates a third message header on the first BFD message, and forwards the first BFD message to the sixth network equipment.
The current message header in the first BFD message is as shown in table three, the source MAC address in the third message header is the MAC address 6-1-1-1 of the tenth interface, the destination MAC address is the MAC address 6-1-1-1-1-2 of the fourteenth interface, and the type field is ethernet.
Watch III
Serial number Source MAC address Destination MAC address Type field
3 6-1-1-1-1-1 6-1-1-1-1-2 Ethernet network
2 4-1-1-1-1-1 4-1-1-1-1-2 Ethernet network
1 2-1-1-1-1-1 2-1-1-1-1-2 IP
And step four, after receiving the first BFD message, the sixth network equipment deletes the third message header encapsulated by the fourth network equipment, encapsulates the fourth message header in a superposition manner on the first BFD message, and forwards the first BFD message to the fifth network equipment.
The current message header in the first BFD message is as shown in table four, the source MAC address in the fourth message header is the MAC address 7-1-1-1-1-2 of the fifteenth interface, the destination MAC address is the MAC address 7-1-1-1-1-1 of the twelfth interface, and the type field is ethernet.
Watch four
Serial number Source MAC address Destination MAC address Type field
3 7-1-1-1-1-2 7-1-1-1-1-1 Ethernet network
2 4-1-1-1-1-1 4-1-1-1-1-2 Ethernet network
1 2-1-1-1-1-1 2-1-1-1-1-2 IP
And step five, after receiving the first BFD message, the fifth network equipment outputs state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message.
Wherein, the current header in the first BFD packet is as shown in table five.
Watch five
Figure GDA0003265925800000111
Figure GDA0003265925800000121
In this way, a technician may determine that the third packet header added by the fourth network device is missing in the current packet header of the first BFD packet included in the state monitoring information, thereby determining that a link between the fourth network device and the sixth network device has a fault, and improving the efficiency of fault location.
The embodiment of the application also provides another method example for detecting the fault. Referring to fig. 1, in an example two, the first BFD packet sent by the first network device reaches the fifth network device via the third network device, the fourth network device, and the sixth network device. The message header is an IP protocol header, a communication link between the fourth network device and the sixth network device fails, and communication links between other network devices are normal. The method comprises the following specific steps:
step one, the first network equipment encapsulates a first message header to the first BFD message and sends the first BFD message to the third network equipment.
The current header in the first BFD message is as shown in table six, the source IP address in the first header is the IP address 2.1.1.1 of the second interface, the destination IP address is the IP address 7.1.1.1 of the twelfth interface, and the type field is TCP/UDP.
Watch six
Serial number Source IP address Destination IP address Type field
1 2.1.1.1 7.1.1.1 IP
And step two, after receiving the first BFD message, the third network equipment superposes and encapsulates a second message header on the first BFD message, and forwards the first BFD message to the fourth network equipment.
The current header in the first BFD packet is as shown in table seven, the source IP address in the second header is IP address 4.1.1.1 of the sixth interface, the destination IP address is IP address 7.1.1.1 of the twelfth interface, and the type field is ethernet.
Watch seven
Figure GDA0003265925800000122
Figure GDA0003265925800000131
And step three, after receiving the first BFD message, the fourth network equipment superposes and encapsulates a third message header on the first BFD message, and forwards the first BFD message to the sixth network equipment.
The current header in the first BFD packet is shown in table eight, the source IP address in the third header is the IP address 6.1.1.1 of the tenth interface, the destination IP address is the IP address 7.1.1.1 of the twelfth interface, and the type field is ethernet.
Table eight
Serial number Source IP address Destination IP address Type field
3 6.1.1.1 7.1.1.1 IP
2 4.1.1.1 7.1.1.1 IP
1 2.1.1.1 7.1.1.1 IP
And step four, after receiving the first BFD message, the sixth network equipment deletes the third message header added in the first BFD message by the fourth network equipment, packages the fourth message header by overlapping the first BFD message, and forwards the first BFD message to the fifth network equipment.
The current header in the first BFD packet is shown in table nine, the source IP address in the fourth header is the IP address 7.1.1.2 of the fifteenth interface, the destination IP address is the IP address 7.1.1.1 of the twelfth interface, and the type field is ethernet.
Watch nine
Serial number Source IP address Destination IP address Type field
3 7.1.1.2 7.1.1.1 IP
2 4.1.1.1 7.1.1.1 IP
1 2.1.1.1 7.1.1.1 IP
And step five, after receiving the first BFD message, the fifth network equipment outputs state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message.
The current header in the first BFD packet is shown in table ten.
Watch ten
Serial number Source IP address Destination IP address Type field
3 7.1.1.2 7.1.1.1 IP
2 4.1.1.1 7.1.1.1 IP
1 2.1.1.1 7.1.1.1 IP
In this way, a technician can determine that the source IP address of the fourth network device is missing according to the source IP address contained in the current packet header, thereby determining that the link between the fourth network device and the sixth network device fails, and improving the efficiency of fault location.
The method for fault detection provided by the embodiment of the application receives a first Bidirectional Forwarding Detection (BFD) message sent by a second network device. The first BFD message carries at least one message header. And then, determining the receiving time interval between the first BFD message and the second BFD message according to the receiving time of the second BFD message received last time and the receiving time of the first BFD message. And then, judging that the receiving time interval is greater than a preset time interval threshold value. And if the receiving time interval is larger than a preset time interval threshold, deleting the first message header in the first BFD message. Wherein the first header is a header added by the second network device. And finally, judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address. And if the destination IP address is the same as the local IP address, outputting state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message, and the current message header is the message header missing the first message header. Therefore, technicians can determine the fault network equipment according to the missing message header in the current message header, and the fault positioning efficiency is improved.
Based on the same technical concept, as shown in fig. 3, an embodiment of the present application further provides an apparatus for fault detection, where the apparatus is applied to a first network device, and the apparatus includes:
a receiving module 310, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by a second network device, where the first BFD packet includes at least one layer of packet header;
a determining module 320, configured to determine, according to a receiving time of a second BFD packet received last time and a receiving time of the first BFD packet, a receiving time interval between the first BFD packet and the second BFD packet, where the second BFD packet and the first BFD packet are BFD packets for a same communication link;
a deleting module 330, configured to delete a first packet header in the first BFD packet if the receiving time interval is greater than a preset time interval threshold, where the first packet header is a packet header encapsulated by the second network device;
a first determining module 340, configured to determine whether a destination internet protocol IP address of the first BFD packet is the same as a local IP address;
a first output module 350, configured to output status monitoring information if the destination IP address is the same as the local IP address, where the status monitoring information includes a current packet header of the first BFD packet, and the current packet header is a packet header missing the first packet header.
Optionally, as shown in fig. 4, the apparatus further includes:
a second determining module 360, configured to trigger the first determining module to perform the step of determining whether the destination IP address is the same as the local IP address if the receiving time interval is not greater than a preset time interval threshold.
Optionally, as shown in fig. 5, the apparatus further includes:
an adding module 370, configured to, if the destination IP address is different from the local IP address, overlay and encapsulate a second packet header to the first BFD packet, and forward the first BFD packet to a third network device according to the destination IP address of the first BFD packet.
Optionally, the second packet header is an ethernet protocol header, the source MAC address in the second packet header is an MAC address of an outgoing interface of the first network device, and the destination MAC address is an MAC address of an incoming interface of the third network device.
Optionally, the second packet header is an IP protocol header, a source IP address in the second packet header is an IP address of an output interface of the first network device, and a destination IP address is a destination IP address of the first BFD packet.
The failure detection apparatus provided in the embodiment of the present application receives a first bidirectional forwarding detection BFD packet sent by a second network device. The first BFD message carries at least one message header. And then, determining the receiving time interval between the first BFD message and the second BFD message according to the receiving time of the second BFD message received last time and the receiving time of the first BFD message. And then, judging that the receiving time interval is greater than a preset time interval threshold value. And if the receiving time interval is larger than a preset time interval threshold, deleting the first message header in the first BFD message. Wherein the first header is a header added by the second network device. And finally, judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address. And if the destination IP address is the same as the local IP address, outputting state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message, and the current message header is the message header missing the first message header. Therefore, technicians can determine the fault network equipment according to the missing message header in the current message header, and the fault positioning efficiency is improved.
The embodiment of the present application further provides a network device, as shown in fig. 6, which includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the method steps of the fault detection when executing the program stored in the memory 603.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, which, when being executed by a processor, implements the steps of any of the above-mentioned fault detection methods.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of any of the above embodiments of fault detection.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A method of fault detection, the method being applied to a first network device, the method comprising:
receiving a first Bidirectional Forwarding Detection (BFD) message sent by second network equipment, wherein the first BFD message comprises at least one layer of message header;
determining a receiving time interval between a first BFD message and a second BFD message according to the receiving time of the last received second BFD message and the receiving time of the first BFD message, wherein the second BFD message and the first BFD message are BFD messages aiming at the same communication link;
if the receiving time interval is larger than a preset time interval threshold, deleting a first message header in the first BFD message, wherein the first message header is a message header packaged by the second network equipment;
judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address;
and if the destination IP address is the same as the local IP address, outputting state monitoring information, wherein the state monitoring information comprises the current message header of the first BFD message, and the current message header is the message header missing the first message header.
2. The method of claim 1, further comprising:
and if the receiving time interval is not larger than a preset time interval threshold, executing the step of judging whether the destination IP address is the same as the local IP address.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and if the destination IP address is different from the local IP address, overlapping and packaging a second message header for the first BFD message, and forwarding the first BFD message to a third network device according to the destination IP address of the first BFD message.
4. The method according to claim 3, wherein the second header is an Ethernet protocol header, the source MAC address in the second header is the MAC address of the outbound interface of the first network device, and the destination MAC address is the MAC address of the inbound interface of the third network device.
5. The method according to claim 3, wherein the second header is an IP protocol header, a source IP address in the second header is an IP address of an egress interface of the first network device, and a destination IP address is a destination IP address of the first BFD packet.
6. An apparatus for fault detection, the apparatus being applied to a first network device, the apparatus comprising:
a receiving module, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by a second network device, where the first BFD packet includes at least one layer of packet header;
a determining module, configured to determine a receiving time interval between a first BFD packet and a second BFD packet according to a receiving time of a second BFD packet received last time and a receiving time of the first BFD packet, where the second BFD packet and the first BFD packet are BFD packets for a same communication link;
a deleting module, configured to delete a first packet header in the first BFD packet if the receiving time interval is greater than a preset time interval threshold, where the first packet header is a packet header encapsulated by the second network device;
the first judgment module is used for judging whether the target internet protocol IP address of the first BFD message is the same as the local IP address;
and a first output module, configured to output status monitoring information if the destination IP address is the same as the local IP address, where the status monitoring information includes a current header of the first BFD packet, and the current header is a header missing the first header.
7. The apparatus of claim 6, further comprising:
and the second judging module is used for triggering the first judging module to execute the step of judging whether the destination IP address is the same as the local IP address or not if the receiving time interval is not larger than a preset time interval threshold value.
8. The apparatus of claim 6 or 7, further comprising:
and the adding module is used for superposing and packaging a second message header on the first BFD message if the destination IP address is different from the local IP address, and forwarding the first BFD message to third network equipment according to the destination IP address of the first BFD message.
9. The apparatus according to claim 8, wherein the second header is an ethernet protocol header, the source MAC address in the second header is a MAC address of an outgoing interface of the first network device, and the destination MAC address is a MAC address of an incoming interface of the third network device.
10. The apparatus according to claim 8, wherein the second header is an IP protocol header, a source IP address in the second header is an IP address of an egress interface of the first network device, and a destination IP address is a destination IP address of the first BFD packet.
11. The network equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201811419429.9A 2018-11-26 2018-11-26 Fault detection method and device Active CN109586959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811419429.9A CN109586959B (en) 2018-11-26 2018-11-26 Fault detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811419429.9A CN109586959B (en) 2018-11-26 2018-11-26 Fault detection method and device

Publications (2)

Publication Number Publication Date
CN109586959A CN109586959A (en) 2019-04-05
CN109586959B true CN109586959B (en) 2021-11-26

Family

ID=65924040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811419429.9A Active CN109586959B (en) 2018-11-26 2018-11-26 Fault detection method and device

Country Status (1)

Country Link
CN (1) CN109586959B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073987A (en) * 2019-06-11 2020-12-11 阿里巴巴集团控股有限公司 State monitoring method, device, equipment and storage medium
CN110535720B (en) * 2019-08-20 2022-01-25 新华三技术有限公司合肥分公司 BFD multi-hop detection method and device
CN110971459B (en) * 2019-11-29 2020-07-14 新华三半导体技术有限公司 Session fault detection method and device, terminal equipment and readable storage medium
CN113055224B (en) * 2021-02-05 2022-05-27 新华三信息安全技术有限公司 Equipment message forwarding fault detection and device
CN114363222A (en) * 2021-12-17 2022-04-15 中电信数智科技有限公司 Network equipment inspection method and system based on Netconf protocol
CN116760765A (en) * 2023-08-10 2023-09-15 新华三技术有限公司 Network state detection method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103916275A (en) * 2014-03-31 2014-07-09 杭州华三通信技术有限公司 BFD detection device and method
CN106817264A (en) * 2015-11-27 2017-06-09 华为软件技术有限公司 A kind of methods, devices and systems of link failure detection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102624584B (en) * 2012-03-01 2018-02-23 中兴通讯股份有限公司 Chain circuit detecting method and device
US9258234B1 (en) * 2012-12-28 2016-02-09 Juniper Networks, Inc. Dynamically adjusting liveliness detection intervals for periodic network communications

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103916275A (en) * 2014-03-31 2014-07-09 杭州华三通信技术有限公司 BFD detection device and method
CN106817264A (en) * 2015-11-27 2017-06-09 华为软件技术有限公司 A kind of methods, devices and systems of link failure detection

Also Published As

Publication number Publication date
CN109586959A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109586959B (en) Fault detection method and device
CN110061914B (en) Message forwarding method and device
US10659359B2 (en) Method and device for checking forwarding tables of network routers
CN102571492B (en) Method and device for detecting failure of routing equipment
CN112751733B (en) Link detection method, device, equipment, system and switch
US11606288B2 (en) Network communication method and apparatus
WO2015184771A1 (en) Method and node device for operation, administration, and maintenance of service function chaining
CN101808021A (en) Fault detection method, device and system, message statistical method and node equipment
CN109951371B (en) Data forwarding method and device
CN101605063A (en) Network fault positioning system and method
CN109787878A (en) A kind of tunnel links detection method and relevant device
JP2017121056A (en) Method, device, and system for implementing packet loss detection
US11456943B2 (en) Packet transmission method and apparatus
US20150089047A1 (en) Cut-through packet management
CN110855566A (en) Method and device for dragging upstream flow
CN113347084B (en) Message forwarding method and device
WO2018077124A1 (en) Method, device, and system for service alarm processing
CN112637053B (en) Method and device for determining backup forwarding path of route
CN114978600A (en) Abnormal flow processing method, system, equipment and storage medium
CN115914087A (en) Message forwarding method, device, equipment, system and storage medium
CN115883452A (en) Communication method and communication device
CN110971477B (en) Communication method, device, system and storage medium
WO2015120581A1 (en) Traffic loop detection in a communication network
CN111654474A (en) Safety detection method and device
CN113472647B (en) Message forwarding method and device

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