WO2023030202A1 - Path fault detection method, apparatus and system, network device and storage medium - Google Patents

Path fault detection method, apparatus and system, network device and storage medium Download PDF

Info

Publication number
WO2023030202A1
WO2023030202A1 PCT/CN2022/115287 CN2022115287W WO2023030202A1 WO 2023030202 A1 WO2023030202 A1 WO 2023030202A1 CN 2022115287 W CN2022115287 W CN 2022115287W WO 2023030202 A1 WO2023030202 A1 WO 2023030202A1
Authority
WO
WIPO (PCT)
Prior art keywords
detection
detection message
period
period value
value
Prior art date
Application number
PCT/CN2022/115287
Other languages
French (fr)
Chinese (zh)
Inventor
郑晓亮
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023030202A1 publication Critical patent/WO2023030202A1/en

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/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control

Definitions

  • the present application relates to the communication field, and in particular to a path fault detection method, device, system, network equipment and storage medium.
  • detection packets are usually used to detect whether a path fails. In some business scenarios, it is hoped that the fault from occurrence to detection and completion of switching can be faster, that is, the detection period for fault detection is expected to be shorter.
  • the network congestion usually caused by various bursts in the network, there is a large delay and jitter in the forwarding of the detection message. At this time, false detection may occur when the detection cycle is short.
  • BFD bidirectional forwarding detection
  • Embodiments of the present application provide a path fault detection method, device, system, network device, and storage medium, so as to shorten a fault detection cycle and improve fault detection accuracy. Described technical scheme is as follows:
  • a path fault detection method is provided, the method is applied to a network device on a path to be detected, and the method includes: obtaining a first detection message, the first detection message including a first period value , the first period value indicates the period for the network device to send the first detection message, and the first period value corresponds to the target transmission period to which the first detection message belongs in multiple transmission periods A period value; the first detection message is sent through the path to be detected, and the first detection message is used for fault detection of the path to be detected.
  • a deterministic forwarding mechanism is introduced, that is, the detection message sent by the network device includes a cycle value that can indicate the cycle of the network device sending the detection message, so that the downstream device that receives the detection message can Determine the cycle of sending the detection message by itself according to the cycle of the network device sending the detection message, so that the detection message can be controlled to reach the destination device within a certain period of time, so that the forwarding of the detection message will not be affected by network congestion.
  • the detection cycle can be further shortened, the time from occurrence to detection of network faults is greatly shortened, and the time for service damage is reduced.
  • multiple sending periods are preset.
  • the number of sending cycles set in each network device on the path to be detected may be the same, and the duration of each sending cycle may also be the same.
  • the numbers of sending cycles set in some network devices on the path to be detected are the same, and the numbers of sending cycles set in some network devices are different.
  • the number of sending cycles set in the devices at both ends of a link on the path to be detected is the same, and the numbers of sending cycles set in the devices at both ends of different links may be different.
  • the number of multiple sending cycles is set based on the port of the network device, and the number of multiple sending cycles set on different ports may be the same or different.
  • the target sending period to which the first detection packet belongs in the multiple sending periods is determined according to a time when the network device expects to send the first detection packet. That is, when the network device is the first device on the path to be detected, the first device determines the target sending period of the expected sending time according to the time when the first detection packet is expected to be sent by itself, and then the target sending period period value as the first period value.
  • the process of determining the period value corresponding to the target transmission period to which the first detection message belongs in the multiple transmission periods may also be: receiving a second detection message, and the second detection message Including a second period value, the second period value indicates the period for sending the second detection message by the last hop device of the network device on the path to be detected; according to the second period value and the Multiple sending cycles, determining the first cycle value; the acquiring the first detection message includes: obtaining the first detection message according to the second detection message and the first cycle value.
  • the network device when the network device is an intermediate device or tail device on the path to be detected, the network device receives the second detection message sent by the previous hop, wherein the second detection message contains information for indicating the last Skip the second period value of the period for sending the second detection packet. Based on this, the network device can obtain the first period value according to the second period value, and send the first detection message containing the first period value to the next hop within the sending period indicated by the first period value, so that it can The detection packet is controlled to reach the destination device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
  • the implementation process of determining the first period value may be: determining the distance between the network device and the previous hop device for sending the detection message
  • a cycle difference value obtaining the first cycle value according to the cycle difference value, the second cycle value and the multiple sending cycles.
  • each network device can learn the cycle difference corresponding to the incoming interface receiving the cycle difference learning message according to the cycle difference learning message sent by its own previous hop device in advance, and then use the learned cycle difference The difference is stored corresponding to the corresponding incoming interface. On this basis, when the network device obtains the second period value from the second detection message, it can obtain the first period value according to the second period value and the period difference value.
  • each network device when each network device learns the period difference according to the period difference learning message, it may consider that for the message received by the inbound interface that receives the period difference learning message, through The time required for each outgoing interface of itself to forward the packet to the next hop is used to determine the cycle difference. Since the time required for different outgoing interfaces to forward packets received by the incoming interface is different, the cycle difference values learned for different outgoing interfaces may be different. On this basis, the network device can learn the mapping relationship between the incoming interface, the outgoing interface and the corresponding period difference.
  • the first period value is carried in the first detection message based on the 6th generation Internet protocol (internet protocol version 6, IPv6) header or IPv6 extension header or multi-protocol label switching (multi-protocol label switching, MPLS) header or MPLS extension header.
  • 6th generation Internet protocol internet protocol version 6, IPv6
  • IPv6 extension header or IPv6 extension header
  • MPLS multi-protocol label switching
  • the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet.
  • the IPv6 extension header is a segment routing header (segment routing header, SRH), and the first period value is carried in the type length value TLV field or segment routing identifier (segment routing header) of the SRH of the first detection message identifier, SID); or, the IPv6 extension header is a hop-by-hop option header, and the first period value is carried in the hop-by-hop option header.
  • the first period value may also be carried in an MPLS label included in the MPLS header.
  • the first detection message is a BFD message, or, the first detection message is an operation administration and maintenance (OAM) message.
  • OAM operation administration and maintenance
  • the first detection message when the first detection message is a BFD message, the first detection message may be a bidirectional BFD message, a single-arm BFD message, or a seamless bidirectional forwarding detection (seamless bidirectional forwarding detection, SBFD) message.
  • the first detection message when the first detection message is an OAM message, the first detection message may be an Ethernet (ethernet, ETH) OAM message or an MPLS OAM message.
  • the MPLS OAM message may be a multi-protocol label switching transport profile (MPLS-TP) OAM message.
  • a path fault detection device in a second aspect, includes an acquisition module and a sending module, wherein the acquisition module is used to acquire a first detection message, and the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period value is the period corresponding to the target transmission period to which the first detection message belongs among the multiple transmission periods value; a sending module, configured to send the first detection message through the path to be detected, where the first detection message is used for fault detection of the path to be detected.
  • the multiple sending periods are preset.
  • the target sending period to which the first detection packet belongs in the plurality of sending periods is determined according to a time when the network device expects to send the first detection packet.
  • the device further includes: a receiving module and a determining module; wherein the receiving module is configured to receive a second detection message, the second detection message includes a second period value, and the second period The value indicates the cycle at which the last hop device of the network device on the path to be detected sends the second detection message; the determining module is configured to use the second cycle value and the plurality of sending cycles , determining the first period value; the obtaining module, configured to obtain the first detection message according to the second detection message and the first period value.
  • the determination module is mainly used to: determine the period difference between the network device and the previous hop device for sending detection packets; according to the period difference, the second period value and the Multiple sending cycles, to obtain the first cycle value.
  • the first period value is carried in a packet header or IPv6 extension header or MPLS header or MPLS extension header based on the 6th generation Internet protocol of the first detection message.
  • the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet.
  • the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or the segment routing identifier SID of the first detection message; or, the IPv6
  • the extension header is a hop-by-hop option header, and the first period value is carried in the hop-by-hop option header.
  • the first period value is carried in an MPLS label included in the MPLS header.
  • the first detection message is a bidirectional forwarding detection BFD message, or the first detection message is an OAM message.
  • a third aspect provides a network device, the structure of the network device includes a processor and a memory, and the memory is used to store at least one program instruction that supports the network device to execute the path fault detection method provided in the first aspect above or codes, and store data involved in implementing the path fault detection method provided in the first aspect above.
  • the processor is configured to execute program instructions or codes stored in the memory.
  • a path fault detection system in a fourth aspect, includes a first network device and a second network device; wherein the first network device is configured to send a first detection message through a path to be detected, and the The first detection packet includes a first period value, the first period value indicates the period for the first network device to send the first detection packet, and the first period value is when the first detection packet is A cycle value corresponding to the first target sending cycle in multiple sending cycles, the first detection message is used for fault detection of the path to be detected; the second network device is used to receive the first network device The first detection message sent, obtaining a second period value according to the first period value, obtaining a second detection message according to the first detection message and the second period value, and sending the first period value Two detection messages, the second detection message includes the second period value, the second period value indicates the period for the second network device to send the second detection message, and the second period value is a cycle value corresponding to the second target sending cycle to which the second detection message belongs in the multiple sending cycles.
  • each network device can refer to the operation of the first network device or the second network device to send a detection message to its own next hop.
  • a computer-readable storage medium where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is made to execute the path fault detection method described in the first aspect above.
  • a sixth aspect provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the path fault detection method described in the first aspect above.
  • FIG. 1 is a schematic diagram of an application scenario of a path fault detection method provided by an embodiment of the present application
  • FIG. 2 is a network system architecture diagram involved in a path fault detection method provided by an embodiment of the present application
  • FIG. 3 is a flow chart of a path fault detection method provided in an embodiment of the present application.
  • Fig. 4 is a flow chart of a path fault detection method applied to the first device provided by the embodiment of the present application.
  • FIG. 5 is a flow chart of a path fault detection method applied to an intermediate device provided in an embodiment of the present application
  • FIG. 6 is a flow chart of a path fault detection method applied to tail equipment provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a detection message sent by each network device on a path to be detected provided by an embodiment of the present application
  • FIG. 8 is a flow chart of interaction between various network devices to implement path fault detection provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another detection message sent by each network device on the path to be detected provided by the embodiment of the present application.
  • FIG. 10 is another flow chart of network device interaction to implement path fault detection provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a path fault detection device provided in an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • a path used for service data transmission in the network For example, in a service network such as a layer 2 virtual private network (layer2 virtual private network, L2VPN), a layer 3 virtual private network (layer3 virtual private network, L3VPN) or an IP network, for a certain service, you can configure two forwarding paths, as shown in Figure 1, wherein one forwarding path is composed of network devices A, B, and D, and this forwarding path is used as the main path, and the other forwarding path is composed of network devices A, C, and D, and this forwarding path is composed of network devices A, C, and D.
  • the forwarding path acts as a backup path.
  • the path failure detection method provided by the embodiment of the present application can be used to detect the failure of the main path, so that when the failure of the main path is detected, it can quickly switch to the backup path for forwarding business data, thereby reducing the The degree of damage to the business.
  • the path fault detection method provided by the embodiment of the present application can also be used to detect the faults of the forwarding paths of different services, so that when detecting In case of path failure, corresponding measures can be taken quickly.
  • Fig. 2 is a schematic diagram of a network system architecture involved in a path fault detection method exemplarily given in an embodiment of the present application.
  • the network system includes a plurality of network devices that form the forwarding path, and according to the positions of the multiple network devices on the forwarding path, the multiple network devices can be divided into the first device 201, the intermediate devices 202 to 204 and tail device 205 .
  • the head device 201 is configured to receive a service message from a source device on a user side or a server side, and send the service message to a next-hop intermediate device 202 .
  • the intermediate device 202 forwards the service packet to the next hop (that is, the intermediate device 203 ), and so on.
  • the tail device 205 sends the service packet to the destination device on the user side or the server side.
  • the first device 201 may also trigger fault detection on the forwarding path.
  • the head device 201 sends a detection message to the next hop (that is, the intermediate device 202), and the detection message includes a time value that can indicate the sending time of the detection message.
  • the intermediate device 202 determines a new time value according to the time value in the detection message, and sends it to the next hop (ie, the intermediate device 203) according to the sending time indicated by the new time value
  • the new detection message includes the new time value.
  • the tail device 205 receives the detection packet sent by the intermediate device 204, the detection packet is used as a basis for judging whether the path is faulty.
  • the tail device 205 obtains a new time value according to the time value included in the detection message, and generates a new detection message according to the new time value and the detection message, and then sends the generated new detection message to the intermediate device 204. message. Subsequently, the intermediate devices 204 to 202 transmit a new detection message to the first device 201 referring to the above method, so that after receiving the detection message, the first device 201 subsequently determines whether the forwarding path is faulty based on the detection message.
  • each network device on the forwarding path carries a time value that can indicate the time when the detection message is sent by itself in the detection message sent by itself, so that the time value of receiving the detection message
  • the next-hop device can determine the time to send the detection message according to the time value of the detection message. In this way, it can control the detection message to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by network congestion. Influence, improve the accuracy of path fault detection.
  • each of the foregoing network devices may be a router, a switch, and other devices with routing and forwarding functions.
  • the above is only an example of including three intermediate devices on the forwarding path. Those skilled in the art should understand that there may be fewer or more intermediate devices on the forwarding path. Examples are not limited to this.
  • FIG. 3 is a flow chart of a path fault detection method provided by an embodiment of the present application.
  • the method may be executed by a network device on the path to be detected, for example, by a network device on the forwarding path shown in FIG. 2 .
  • the method includes the following steps:
  • Step 301 Obtain the first detection message, the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period value The period value corresponding to the target sending period belonging to one sending period.
  • the outgoing interfaces of each network device on the path to be detected correspond to a plurality of preset sending periods.
  • the first detection packet carries a first period value capable of indicating the sending period when the network device sends the first detection packet.
  • the target sending cycle of the first detection message in the multiple sending cycles is based on the time when the network device is expected to send the first detection message definite. Moreover, after determining the target sending period to which the first detection message belongs, the network device generates the first detection message including a period value corresponding to the target sending period.
  • the target sending cycle to which the first detection message belongs may be the cycle value included in the detection message sent by the previous hop received by the network device acquired. Moreover, after determining the target sending period to which the first detection message belongs, the network device obtains the first detection message according to the received detection message sent by the previous hop and the period value corresponding to the target sending period.
  • Step 302 Send a first detection packet through the path to be detected, where the first detection packet is used for fault detection of the path to be detected.
  • each network device on the path to be detected carries a cycle value that can indicate the cycle of sending the detection message by itself in the detection message sent by itself, so that the next hop that receives the detection message
  • the device can determine the cycle of sending the detection message according to the cycle value of the detection message. In this way, the detection message can be controlled to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by the network congestion and improves improve the accuracy of path fault detection.
  • the network device in the embodiment shown in FIG. 3 is the first device on the path to be detected, for example, when the network device is the first device in the system architecture shown in FIG. 2 , then the network device shown in FIG. 3
  • the illustrated embodiment can be specifically implemented as the process shown in FIG. 4 . As shown in Figure 4, the process includes the following steps:
  • Step 401 Generate a first detection packet, the first detection packet includes a first period value, the first period value indicates the period for the first device to send the first detection packet, and the first period value is the first period value of the first detection packet
  • the first device obtains the first period value according to the expected time to send the first detection message, and then generates the first detection message according to the first period value and the load of the detection message.
  • each outgoing interface of each network device on the path to be detected corresponds to a plurality of sending periods.
  • each outgoing interface of a network device corresponds to 16 sending cycles, and the duration of each sending cycle is 10 microseconds.
  • the first device starts path fault detection, it determines the expected time to send the first detection message, that is, the waiting time to send the first detection message. Afterwards, according to the time to be sent, determine the target sending cycle to which the first detection message belongs among the multiple sending cycles, that is, the sending cycle where the first detection message is expected to be sent. Obtain the period value of the target sending period as the first period value.
  • the first period value may be a period label value of the target sending period.
  • the first period value obtained according to the time to be sent will be a certain value in 0-15.
  • the first cycle value can also be used to indicate the target sending cycle to which the first detection message belongs is the number of sending cycles in the multiple sending cycles, for example, when the first cycle value is 5, then Indicates that the target sending period to which the first detection message belongs is the fifth sending period among the multiple sending periods.
  • the first device After obtaining the first period value, the first device generates a first detection message for fault detection of the path to be detected according to the first period value and the load of the detection message, and the first detection message includes the first period value and the Detect packet payload.
  • the loads of the detection packets are different, and correspondingly, the types of the first detection packets are also different.
  • the detection packet payload is a BFD packet payload
  • the first detection packet is a BFD packet.
  • the first detection message may be a two-way BFD message, an SBFD message or a one-arm BFD message.
  • the detection packet load is the OAM packet load.
  • the first detection packet is an OAM packet.
  • the first detection packet can be an ETH OAM packet or an MPLS OAM packet.
  • the MPLS OAM message may be an MPLS TP OAM message.
  • the first detection message may also be another type of detection message that can be used to detect a fault on the path to be detected, and this embodiment of the present application does not limit the message type of the detection message.
  • the first detection packet includes an IPv6 packet header or an IPv6 extension header or an MPLS header or an MPLS extension header.
  • the first period value may be carried in the IPv6 packet header or IPv6 extension header or MPLS header or MPLS extension header of the first detection packet.
  • the first detection message may also carry a deterministic forwarding enable flag to indicate the first period value.
  • the path to be detected is a path configured based on the SRv6 traffic-engineering extensions policy (SRv6 traffic-engineering extensions policy, SRv6-TE policy) in the L3VPN
  • SRv6 traffic-engineering extensions policy SRv6 traffic-engineering extensions policy, SRv6-TE policy
  • the first device in the detection report The outer layer of the packet payload, encapsulating the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header sequentially from the inside to the outside, and carrying the second packet in the IPv6 packet header or IPv6 extension header A period value, so as to obtain the first detection message.
  • the IPv6 packet header includes a destination address field, and the destination address field is used to carry the link between the next hop of the first device and the next hop of the next hop of the first device. Based on this, the SID in the destination address field in the IPv6 packet header of the first detection packet can be used to carry the first period value.
  • the SID includes a 64-bit location identifier (locator), a 48-bit function (function) and a 12-bit parameter (arguments, Args).
  • Args in the SID may carry the first period value.
  • the SID of the link between the next hop of the first device and the next hop of the next hop of the first device is 2002::5000, where 2002 is the locator and 000 is Args.
  • the primary device converts the first period value 10 into a hexadecimal number A, then modifies the SID to 2002::500A, and then uses the modified SID as the destination in the IPv6 packet header. SID in the address field.
  • the deterministic forwarding enable flag may also be carried in the SID to indicate that the SID The first period value carried in .
  • the deterministic forwarding enable flag is 1.
  • the first device can change the SID to 2002::501A, where 1 in 501A is the deterministic enable flag, and A is the first cycle The hexadecimal number of the value. Afterwards, use the modified SID as the SID in the destination address field in the IPv6 packet header.
  • the above-mentioned IPv6 extension header of the first detection message includes a segment routing header (segment routing header, SRH), wherein the SRH includes a TLV field and a SID table. Based on this, the first period value may be carried through the TLV field or the SID table in the SRH.
  • segment routing header SRH
  • the first period value may be carried through the TLV field or the SID table in the SRH.
  • the SID table in the SRH of the first detection message includes the SID of the link between the network devices that the detection message passes through after the first device on the path to be detected.
  • the first device can modify the SID of the link between the next hop of the first device and the next hop of the next hop of the first device according to the first period value, and add the modified SID to the first In the SID table of the SRH of the detection message.
  • the first device may also refer to the manner described above to carry the deterministic forwarding enablement identifier in the SID, which will not be repeated in this embodiment of the present application.
  • the above-mentioned IPv6 extension header of the first detection message may also include a hop-by-hop option header.
  • the hop-by-hop option header of the first detection message may also be used to Carry the first period value.
  • the primary device can encapsulate the UDP packet header, IPv4 packet A text header, an MPLS header and a Layer 2 packet header, and the first period value is carried in the MPLS header, so as to obtain the first detection packet.
  • the MPLS header includes an MPLS SID table that includes multiple layers of MPLS labels.
  • the multi-layer MPLS label is the MPLS label of each network device that the detection message will pass through after the first device on the path to be detected. Based on this, the first device can carry the first period value in the MPLS label of the next hop of the first device in the MPLS SID table.
  • the head device can modify the MPLS label of the next hop to 110, and then use the modified MPLS label as the outermost label in the MPLS SID table.
  • the head device can also convert the first period value into a hexadecimal number, thereby modifying the MPLS label of the next hop to 10A, and then use the modified MPLS label as the outermost label in the MPLS SID table.
  • the head device may not only carry the first period value through the MPLS label of the next hop, but may also carry the deterministic forwarding enablement identifier.
  • the deterministic forwarding enable flag is 1, the first device can change the MPLS label of the next hop to 11A, where the last bit A is the first period value 10, and the middle bit "1" is The deterministic forwarding enable flag uses the modified MPLS label as the outermost label in the MPLS SID table.
  • the head device may also encapsulate the MPLS extension header between the above MPLS header and the IPv4 packet header.
  • the MPLS extension header may carry the first period value.
  • the foregoing are only exemplary implementations of carrying the first period value in the first detection message given by the embodiment of the present application, but this does not constitute a limitation to the embodiment of the present application.
  • the first period value may also be carried by a field in a packet corresponding to a corresponding network protocol.
  • the above detection packet payload includes the packet header of the detection protocol corresponding to the detection packet payload.
  • the detection packet payload includes the BFD packet head.
  • Step 402 Send the first detection packet through the path to be detected.
  • the first device After obtaining the first detection message, the first device adds the first detection message to the sending queue corresponding to the target sending cycle according to the target sending period to which the first detecting message belongs, and when the expected sending time is reached Afterwards, a first detection message is sent to the next hop of the first device on the path to be detected.
  • the first detection message sent by the first device to detect whether the path to be detected contains a first cycle value
  • the first cycle value can indicate the sending cycle of the first detection message, so that , after receiving the first detection message, the next hop of the first device can know the sending cycle of the first detection message, and determine the cycle of sending the detection message according to the sending cycle, and then according to the determined sending cycle
  • the detection message can be controlled to reach the destination device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
  • the network device in the embodiment shown in FIG. 3 is an intermediate device on the path to be detected
  • the network device is any of the intermediate devices 202-204 in the system architecture shown in FIG. 2
  • the embodiment shown in FIG. 3 can be specifically implemented as the process shown in FIG. 5 , and the following description will be made by taking the intermediate device as the next hop of the head device as an example.
  • the method includes the following steps:
  • Step 501 Receive a second detection packet, the second detection packet includes a second period value, and the second period value is used to indicate the period for sending the second detection packet by the previous hop of the intermediate device on the path to be detected.
  • the intermediate device receives the second detection packet sent by the first device.
  • the second detection packet includes a second period value capable of indicating a period for the first device to send the second detection packet, and the second detection packet includes a detection packet load for detecting whether the path to be detected is faulty.
  • the method for obtaining the second period value in the second detection message sent by the first device may refer to the method for the first device to obtain the first period value in the embodiment shown in FIG.
  • Step 502 Determine a first period value according to the second period value and multiple sending periods.
  • the intermediate device After the intermediate device receives the second detection message, it determines the cycle difference between itself and the previous hop device for sending the detection message, and calculates the difference from the IPv6 header or IPv6 extension header or MPLS header or MPLS extension of the second detection message.
  • the second period value is acquired in the header, and then the first period value is determined according to the second period value, the acquired period difference and multiple sending periods.
  • the first device regularly sends a periodic difference learning message to the intermediate device, and the periodic difference learning message carries information indicating the sending period of the periodic difference learning message. cycle value.
  • the intermediate device receives the cycle difference learning message through an incoming interface. Afterwards, according to the time of receiving the period difference learning message, the period value carried in the period difference learning message and the time required for forwarding the message by itself, estimate the time required for sending the period difference learning message by itself.
  • the corresponding sending period and then according to the period value corresponding to the estimated sending period and the period value carried in the period difference learning message, calculate a period difference value, and compare the period difference value with the period difference learning report received.
  • the interface identifier of the incoming interface of the document is correspondingly stored, and at this time, the cycle difference is the cycle difference corresponding to the incoming interface.
  • the intermediate device can learn the mapping relationship between its own incoming interfaces and the corresponding period difference values. For each network device on the path to be detected, each device can learn the mapping relationship between its own incoming interfaces and the corresponding cycle difference value through the cycle difference learning message sent by its own previous hop.
  • the period value carried in the period difference learning message is the period value corresponding to the sending period to which the period difference learning message belongs.
  • the cycle difference values corresponding to the incoming interfaces on the same device may be the same or different, and the cycle difference values corresponding to the incoming interfaces on different devices may also be the same or different.
  • the intermediate device after receiving the second detection message, the intermediate device as the next hop of the first device, based on the incoming interface of the second detection message, from each incoming interface stored by itself and the corresponding cycle difference In the mapping relationship, the period difference corresponding to the incoming interface of the second detection message is acquired. Afterwards, the intermediate device adds the second cycle value to the obtained cycle difference value, if the second cycle value is added to the obtained time difference value, the obtained cycle value exceeds the preset multiple If the period value range of the period is sent, the intermediate device processes the added period value to obtain the first period value. If the period value obtained by the addition does not exceed the period value range of multiple sending periods, the period value obtained by the addition is used as the first period value.
  • the outgoing interface of the intermediate device has 16 sending cycles
  • the cycle value ranges from 0 to 15
  • the second cycle value is 5 and the obtained cycle difference is 4
  • the calculated cycle value is 9
  • the first period value is 9.
  • the second period value is 14 and the obtained period difference is 4
  • the calculated period value is 18. Since the period value ranges from 0 to 15, divide the calculated period value by the number of sending periods The remainder obtained by counting is used as the first period value, and at this time, the first period value is 2.
  • Step 503 Obtain a first detection message according to the second detection message and the first period value, where the first detection message includes the first period value.
  • the intermediate device can forward the second detection message according to the message type of the second detection message, and modify the second detection message according to the first period value, thereby obtaining The first detection packet.
  • the second cycle value in the second detection message sent by the first device may be carried in the IPv6 packet header or IPv6 extension header or MPLS header or MPLS extension of the second detection message. in the head.
  • the intermediate device can modify the second period value carried in the IPv6 header or IPv6 extension header or MPLS header or MPLS extension header of the second detection message according to the first period value, thereby obtaining the first detection message arts.
  • the intermediate device first sets the first Second, the SID included in the destination address field in the IPv6 header of the detection message is changed to the SID of the link between the next hop of the intermediate device and the next hop of the next hop of the intermediate device.
  • the intermediate device may also modify the SID included in the destination address field in the IPv6 packet header of the second detection message to the SID of the tail device.
  • the intermediate device modifies the modified SID in the destination address field according to the first cycle value, thereby obtaining the first detection message, wherein, the modification method refers to the first device introduced in the foregoing embodiments based on the first cycle value
  • the modification method refers to the first device introduced in the foregoing embodiments based on the first cycle value
  • the SID carried in the destination address field of the IPv6 packet header of the second detection message is 2002::500A, where A is the second periodic value, and the next hop of the intermediate device is the same as the next hop of the intermediate device.
  • the SID of the link between the next hop of the hop is 2004::0000.
  • the intermediate device first modifies the SID included in the destination address field in the IPv6 packet header of the second detection packet to 2004::0000.
  • the intermediate device modifies the SID: 2004::0000 included in the destination address field to 2004::0004 based on the first period value 4, thereby obtaining the first detection packet.
  • the intermediate device first sends the second The destination address field in the IPv6 packet header in the detection message is updated to the SID between the next hop and the next hop of the next hop or the SID of the tail device, and then add the first period value in the SRH, Thus, the first detection packet is obtained.
  • the intermediate device refers to the method of modifying the SID according to the first period value introduced in the foregoing embodiments, and modifies the SID in the SID table according to the first period value.
  • the included SID of the link between the next hop of the intermediate device and the next hop of the next hop of the intermediate device is modified, so as to obtain the first detection message.
  • the SID of the intermediate device and the next hop in the SID table in the SRH of the second detection message carries a second period value of 10
  • the SID is 2002:: 500A
  • the SID of the original configuration is 2002::5000
  • the SID of the link between the next hop of the intermediate device and the next hop of the next hop is 2004::0000
  • the intermediate The device modifies 2004::0000 to 2004::0004 to obtain the first detection packet.
  • the intermediate device will The second period value included in the hop-by-hop option header of the second detection message is replaced with the first period value, and other forwarding processing is performed on the second detection message, for example, the destination address field in the IPv6 message header is modified, thereby Obtain the first detection packet.
  • the intermediate device first uses the Popping the outermost MPLS label, that is, deleting the MPLS label of the intermediate device that carries the second cycle value contained in the MPLS header, and then, according to the first cycle value, the current outermost MPLS label contained in the MPLS header.
  • the label is modified, that is, the MPLS label of the next hop of the intermediate device included in the MPLS header is modified according to the first period value, so as to obtain the first detection message.
  • the intermediate The device deletes the MPLS label to expose the label of the next layer, that is, the MPLS label of the next hop of the intermediate device.
  • the MPLS label of the next hop of the intermediate device is the outermost MPLS label.
  • the intermediate device modifies the current outermost MPLS label 200 to 204, thereby obtaining the first detection message.
  • the intermediate device can use the MPLS extension header of the second detection packet to carry the The second period value is replaced with the first period value, and other forwarding processing is performed on the second detection packet, for example, the outermost MPLS label in the MPLS header is popped, so as to obtain the first detection packet.
  • the intermediate device can refer to the methods described in the foregoing embodiments, and add the deterministic forwarding enable flag while adding the first period value to the second detection message, so as to obtain the first detection message.
  • Step 504 Send the first detection packet through the path to be detected.
  • the intermediate device After obtaining the first detection message, the intermediate device adds the first detection message to the sending queue corresponding to the target sending period indicated by the first period value, and after reaching the sending time corresponding to the target sending period , sending a first detection packet to the next hop of the intermediate device on the path to be detected.
  • the next hop receives the first detection message, if the next hop is still an intermediate device, you can refer to the operation of the intermediate device described in the above embodiment and continue to send the detection message to the next hop, This embodiment of the present application will not describe it in detail.
  • the second detection message received by each intermediate device includes a second period value used to indicate the period for the previous hop to send the second detection message, so that each intermediate device can The period value obtains the first period value, and sends the first detection message containing the first period value to the next hop within the sending period indicated by the first period value, so that the detection message can be controlled to reach the destination within a certain period of time equipment, so that the detection duration of path faults is not affected by network congestion, and the accuracy of path fault detection is improved.
  • Fig. 6 is a flowchart of another path fault detection method provided by the embodiment of the present application, the method is executed by the tail device on the path to be detected, for example, the tail device in the system architecture shown in Fig. 2, as shown in Fig. 6 , the method includes the following steps:
  • Step 601 Receive a third detection packet transmitted to the tail device along the first direction on the path to be detected.
  • the transmission direction from the first device to the last device on the path to be detected is called the first direction
  • the transmission direction from the last device to the first device is called the second direction.
  • the tail device receives the third detection message transmitted to itself along the first direction, that is, receives the third detection message sent by the previous hop of the tail device in the first direction
  • the third detection message includes A third period value capable of indicating the period for sending the third detection packet by the last hop of the tail device and the load of the detection packet used to detect whether the path to be detected is faulty.
  • the implementation manner of sending the third detection packet by the last hop of the tail device may refer to the implementation manner of the intermediate device sending the first detection packet introduced in the embodiment shown in FIG.
  • Step 602 Obtain a first detection packet according to the third detection packet, where the first detection packet includes a first period value, and the first period value is used to indicate a period for the tail device to send the first detection packet.
  • the tail device After the tail device receives the third detection message, in a possible implementation, if the head device and the tail device are configured to use bidirectional BFD technology or OAM technology to detect the path to be detected, that is, the first The third detection message is a bidirectional BFD message or an OAM message, and the tail device may directly use the third detection message as a basis for its subsequent determination of whether the path to be detected is faulty. In addition, the tail device may also refer to the embodiment shown in FIG. 4 to generate a first detection message as a basis for the subsequent head device to detect whether the path to be detected is faulty.
  • the third detection message is a bidirectional BFD message or an OAM message.
  • the tail device pops off the MPLS encapsulation of the third detection message, and obtains the detection message load contained in the third detection message, so that the subsequent The information carried in the payload is used to judge whether the path to be detected is faulty or not.
  • the tail device may also construct the first detection message in the way that the head device generates the detection message introduced in the embodiment shown in FIG. 4 above.
  • the head device and the tail device are configured to use SBFD or single-arm BFD technology for path fault detection.
  • the SBFD or single-arm BFD technology may be used to detect whether the path is faulty.
  • the third detection message is an SBFD message or a single-arm BFD message.
  • the tail device acquires the third period value carried in the IPv6 header or IPv6 extension header or MPLS header or MPLS extension header of the third detection message. Afterwards, the first period value is determined according to the third period value, and then the first detection message is obtained according to the first period value and the third detection message.
  • the implementation method of the tail device obtaining the first period value according to the third period value refers to the implementation method of obtaining the first period value according to the second period value introduced in step 502 in the previous embodiment, and the embodiment of the present application will not go into details here. .
  • the tail device After obtaining the first period value, if the third detection message is an SBFD message, the tail device bounces off the outer SRv6 encapsulation or MPLS encapsulation of the third detection message, and obtains the detection message included in the third detection message load. Afterwards, the tail device obtains the payload of the reverse detection packet according to the payload of the detection packet, and then generates the first detection packet according to the payload of the reverse detection packet and the first period value.
  • a BFD reflection table is stored in the tail device, and the BFD reflection table includes the discriminator of the tail device and the corresponding reverse detection packet payload template.
  • the peer discriminator (your discriminator, YD) in the message payload is compared with the discriminator of the tail device saved by itself. If the two match, the tail device obtains the saved reverse detection message load template, and according to the The reverse detection packet payload template generates the reverse detection packet payload.
  • the tail device After obtaining the payload of the reverse detection packet, the tail device generates a first detection packet based on the payload of the reverse detection packet and the first cycle value, and sends a first detection packet to the next hop of the tail device on the path to be detected. Detect packets.
  • the tail device can refer to the way in step 401 in the foregoing embodiment that the first device generates the first detection message based on the detection message load and the first period value, and based on the reverse detection message load, the first period value and the detection message Each network device passing along the second direction when transmitting to the first device generates the first detection message, which will not be described again in this embodiment of the present application.
  • the SID table or MPLSSID table in the one-arm BFD message not only contains The SID or MPLS label of the passed link or device also includes the SID or MPLS label of the passed link or device when the detection message is transmitted along the second direction on the path to be detected.
  • the first device is A
  • the intermediate device is B
  • the tail device is C
  • the third detection message contains an MPLS SID table
  • the MPLS SID table of the third detection message is from the outer layer to the inner layer of the MPLS label
  • the MPLS label of device B, the MPLS label of device C, the MPLS label of device B, and the MPLS label of device A will be in sequence.
  • the tail device after the tail device receives the third detection message, it can refer to the operation of the intermediate device in the embodiment shown in Figure 4 above, and modify the third detection message based on the first cycle value, so that Obtain the first detection packet.
  • Step 603 Send the first detection packet along the second direction on the path to be detected.
  • each network device after the tail device on the path to be detected can refer to the method described above to transmit the detection packet until the detection packet is transmitted to the first device, and the first device can use the received detection packet as a Subsequent basis for determining whether the path to be detected is faulty.
  • the tail device after receiving the third detection packet sent by the previous hop in the first direction of the path to be detected, can indicate the third detection packet based on the information contained in the third detection packet.
  • the third period value of the sending period of the message obtains the first period value, and sends a message containing the first period value to its own next hop along the opposite direction of the first direction within the sending period indicated by the first period value Detect packets.
  • the next hop of the tail device can determine the cycle for sending the detection message based on the first period value in the detection message, and send the detection message according to the determined sending cycle
  • the detection message can be controlled to arrive at the first device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
  • the path to be detected is the path A-B-C shown in FIG. 7
  • the path to be detected is a path configured based on the SRv6-TE policy
  • the SBFD technology is used to perform fault detection on the path to be detected.
  • the SID allocated to the link between devices B and C is 2002::5000
  • the SID allocated to device C is 2004::0000.
  • the reverse path C-B-A of the path to be detected the SID allocated to the link between device B and device A is 2002::4000
  • the SID allocated to device A is 2001::0000.
  • the path fault detection method includes the following steps:
  • Step 801 Device A sends a detection packet 1, where the detection packet 1 includes a BFD packet payload and a first period value.
  • device A determines that the period value corresponding to the sending period of the expected sending time is 10, assuming that the period value range is 0 -15, device A uses the calculated period value as the first period value. Afterwards, device A generates the BFD packet payload, and encapsulates the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header in sequence on the outer layer of the BFD packet payload.
  • the destination address field of the IPv6 packet header carries the SID of the link between device B and device C, that is, 2002::5000.
  • the IPv6 extension header includes SRH, and a SID table is encapsulated in the SRH. In the SID table, the SIDs are 2004::0000 and 2002::5000 from the front to the back.
  • Device A converts the first period value into a hexadecimal number to obtain A, and modifies the SID in the destination address field of the IPv6 packet header to 2002::501A to obtain detection packet 1.
  • detection packet 1 The destination address field of the IPv6 message header in and the SID list in the SRH are shown in Figure 7. Wherein, 1 in 01A is a deterministic forwarding enable flag, which is used to indicate that the detection message carries a period value, and A is the first period value.
  • the device A adds the detection message 1 to the sending queue corresponding to the sending period indicated by the first period value, and sends the detection message 1 to the device B after the sending time is reached.
  • Step 802 Device B obtains the second period value according to the first period value in the detection message 1.
  • device B After receiving the detection message 1, device B obtains the cycle difference corresponding to the incoming interface of the detection message 1 from the pre-stored mapping relationship between the incoming interface and the cycle difference according to the incoming interface of the detection message 1, for example, The obtained period difference is 4.
  • Device B calculates the second period value to be 14 according to the first period value of 10 and the period difference value of 4.
  • Step 803 Device B sends a detection packet 2, where the detection packet 2 includes a BFD packet payload and a second period value.
  • device B After obtaining the second period value, device B converts the second period value into a hexadecimal number to obtain E. Then modify the SID in the destination address field of the IPv6 packet header of the detection message 1 to the SID of device C, that is, to 2004::0000. Afterwards, according to the second cycle value, the SID is modified to 2004::001E again, thereby obtaining the detection message 2.
  • the destination address field of the IPv6 message header in the detection message 2 and the SID list in the SRH are as follows: shown in Figure 7. Wherein, 1 in 01E is a deterministic forwarding enabling flag, and E is a second cycle value.
  • device B After obtaining the detection message 2, device B adds the detection message 2 to the sending queue corresponding to the sending period indicated by the second period value, and when the sending time corresponding to the sending period indicated by the second period value is reached, After that, the detection message 2 is sent.
  • Step 804 Device C obtains the third period value according to the second period value in the detection message 2, and obtains the reverse BFD packet payload according to the BFD packet payload.
  • device C After receiving the detection message 2 sent by device B, device C obtains the second cycle value from the IPv6 packet header of the detection message 2, and obtains the corresponding cycle difference according to the incoming interface of the detection message 2, for example, The period difference is 4.
  • Device C calculates a period value of 18 based on the second period value 14 and the period difference value 4. Since the period value has exceeded the period value range, it divides the period value by the number of sending periods 16 to obtain the remainder 2. Use the remainder as the third period value.
  • device C After obtaining the third cycle value, device C removes the SRv6 encapsulation of detection packet 2 to obtain the BFD packet payload, and obtains the reverse BFD packet according to the information carried in the BFD packet payload and the BFD reflection table stored by itself. text payload.
  • Step 805 Device C sends a detection packet 3, where the detection packet 3 includes a third period value and a reverse BFD packet payload.
  • device C After obtaining the third cycle value and the reverse BFD packet payload, device C encapsulates the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header.
  • the destination address field of the IPv6 message header carries the SID of the link between device B and device A, that is, 2002::4000.
  • the IPv6 extension header includes SRH, and a SID table is encapsulated in the SRH. In the SID table, the SIDs are 2001::1000 and 2002::4000 from the front to the back.
  • device C modifies the SID in the destination address field of the IPv6 packet header to 2002::4012 according to the third cycle value, thereby obtaining the detection packet 3.
  • the purpose of the IPv6 packet header in the detection packet 3 is The address fields and the list of SIDs in the SRH are shown in Figure 7.
  • the detection message 3 is added to the sending queue corresponding to the sending cycle indicated by the third cycle value, and the detection message 3 is sent to the device B when the sending time is reached.
  • Step 806 Device B obtains the fourth period value according to the third period value in the detection packet 3.
  • Step 807 Device B sends a detection packet 4, where the detection packet 4 includes a reverse BFD packet payload and a fourth period value.
  • Step 808 Device A determines whether the path to be detected is faulty based on the detection message 4.
  • device A After receiving the detection packet 4, device A removes the outer encapsulation of the detection packet 4 to obtain the payload of the reverse BFD packet, and then uses the information included in the payload of the reverse BFD packet as the subsequent determination of the path to be detected basis for failure.
  • the path to be detected is the path A-B-C shown in FIG. 9
  • the path to be detected is a path configured based on SRv6-MPLS
  • the bidirectional BFD technology is used to perform fault detection on the path to be detected.
  • the MPLS label allocated to device B is 100
  • the MPLS label allocated to device C is 200.
  • the path fault detection method includes the following steps:
  • Step 1001 Device A sends a detection message 1, where the detection message 1 includes a BFD message payload and a first period value.
  • device A Assume that device A expects to send detection message 1 at 09:10:12.120100, and device A obtains a period value of 10 based on the expected transmission time. Assuming that the period value ranges from 1 to 10, device A will obtain the period value as first cycle value. Afterwards, device A generates the BFD packet payload, and encapsulates the UDP packet header, IPv4 packet header, MPLS header, and Layer 2 packet header in sequence on the outer layer of the BFD packet payload.
  • the MPLS SID table of the MPLS header includes multi-layer MPLS labels, and the multi-layer MPLS labels are 200 and 100 from the inside to the outside.
  • Device A modifies the outermost MPLS label, that is, the MPLS label of device B, to 110, thereby obtaining detection packet 1.
  • the MPLS SID table of detection message 1 is shown in Figure 9.
  • the device A adds the detection message 1 to the sending queue corresponding to the sending period indicated by the first period value, and sends the detection message 1 to the device B after the sending time is reached.
  • Step 1002 Device B obtains the second period value according to the first period value in the detection message 1.
  • step 802 For an implementation manner of this step, refer to step 802 in the foregoing embodiments.
  • Step 1003 Device B sends a detection packet 2, where the detection packet 2 includes a BFD packet payload and a second period value.
  • device B After obtaining the second period value, device B removes the outermost MPLS label in the MPLS SID table of the detection message 1, exposing the inner MPLS label 200. Assuming that the second period value is 7, device B modifies the MPLS label 200 to 207, thereby obtaining detection packet 2. At this time, the MPLS SID table of the detection message 2 is shown in Figure 9.
  • the device B After obtaining the detection message 2, the device B adds the detection message 2 to the sending queue corresponding to the sending period indicated by the second period value, and after reaching the sending time corresponding to the sending period indicated by the second period value, The detection message 2 is sent.
  • Step 1004 Device C determines whether the path to be detected is faulty based on the detection message 2.
  • the device C After receiving the detection packet 2, the device C removes the outer encapsulation of the detection packet 2 to obtain the BFD packet payload, and then uses the BFD packet payload as a basis for subsequently judging whether the path to be detected is faulty.
  • the detection message sent by each network device on the path to be detected includes a period value that can indicate the cycle of the network device sending the detection message, so that the device that receives the detection message It can determine the cycle of sending detection messages by itself according to the cycle of sending detection messages from the previous hop. In this way, it can control the detection messages to reach the destination device within a certain period of time, so that the detection time of path faults will not be affected by network congestion. , which improves the accuracy of path fault detection.
  • the embodiment of the present application can control the time at which each network device on the path to be detected sends a detection message by carrying a period value.
  • the embodiment of the present application can control the time at which the detection message is transmitted on the path to be detected.
  • the duration of the set path fault detection cycle can also be shortened correspondingly, so that the time required for the fault to be detected will also be shortened.
  • the time delay jitter when the detection message is transmitted on the path to be detected is controlled within 100 microseconds.
  • the detection cycle of SBFD can be shortened to 300 microseconds. In this way, when the detection end When the BFD message is not received within 900 microseconds for three consecutive detection periods, it can be determined that a fault is detected, which greatly shortens the time required for the fault to be detected.
  • the period value carried in each detection message in the foregoing embodiments may also be an absolute time, for example, the sending time of the corresponding detection message.
  • the above method can also be referred to to realize the forwarding of the detection message, so as to control the detection message to reach the destination device within a certain period of time.
  • an embodiment of the present application provides a path fault detection device 1100 , and the device 1100 includes an acquiring module 1101 and a sending module 1102 .
  • the obtaining module 1101 is configured to execute step 301 in the above embodiment; in some examples, the obtaining module 1101 is configured to execute step 401 or steps 501 to 503 or steps 601 to 602 in the above embodiment.
  • the sending module 1102 is configured to execute step 302 in the above embodiment. In some examples, the sending module 1102 is configured to execute step 402 or 504 or 603 in the foregoing embodiments.
  • the apparatus 1100 further includes a determination module (not shown in the figure), which is configured to determine the time the first detection message belongs to in multiple sending cycles according to the time when the network device expects to send the first detection message. target sending periods, wherein the multiple sending periods are preset.
  • the apparatus 1100 further includes: a receiving module and a determining module; wherein the receiving module is configured to receive a second detection message, the second detection message includes a second cycle value, and the second cycle value indicates The last hop device of the upper network device sends the cycle of the second detection message; the determination module is used to determine the first cycle value according to the second cycle value and multiple sending cycles; the acquisition module is used to determine the first cycle value according to the second detection message and the first period value to obtain the first detection packet.
  • the receiving module is configured to receive a second detection message, the second detection message includes a second cycle value, and the second cycle value indicates The last hop device of the upper network device sends the cycle of the second detection message
  • the determination module is used to determine the first cycle value according to the second cycle value and multiple sending cycles
  • the acquisition module is used to determine the first cycle value according to the second detection message and the first period value to obtain the first detection packet.
  • the determination module is mainly used to: determine the period difference between the network device and the previous hop device for sending detection packets; obtain the first period value according to the period difference, the second period value and multiple sending periods.
  • the first period value is carried in the IPv6-based packet header or IPv6 extension header or Multi-Protocol Label Switching MPLS header or MPLS extension header of the first detection message.
  • the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet.
  • the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or the segment routing identifier SID of the first detection message; or, the IPv6 extension header is a hop-by-hop option header,
  • the first period value is carried in the hop-by-hop option header.
  • the first period value is carried in the MPLS label included in the MPLS header.
  • the first detection packet is a bidirectional forwarding detection BFD packet, or the first detection packet is an OAM packet.
  • the detection message sent by each network device on the path to be detected includes a period value that can indicate the cycle of the network device sending the detection message, so that the The device can determine the cycle of sending the detection message according to the cycle of sending the detection message by the previous hop.
  • the detection message can be controlled to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by the network congestion. Influence, improve the accuracy of path fault detection.
  • the embodiment of the present application can control the time at which each network device on the path to be detected sends a detection message by carrying a period value, the embodiment of the present application can control the time at which the detection message is transmitted on the path to be detected. In this way, the duration of the set path fault detection cycle can also be shortened correspondingly, so that the time required for the fault to be detected will also be shortened.
  • each functional module in each embodiment of the present application can be integrated into one In the processor, it may exist separately physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the integrated module is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage
  • the medium includes several instructions for enabling a network device (which may be a router or a switch) or a processor (processor) to execute all or part of the steps of the method in various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • the path fault detection device provided in the above-mentioned embodiments performs path fault detection
  • the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as required. Completion means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the path fault detection device and the path fault detection method embodiments provided in the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
  • FIG. 12 shows a schematic structural diagram of a network device 1200 provided by an exemplary embodiment of the present application.
  • the network device 1200 shown in FIG. 12 is configured to perform the operations involved in the path failure detection method shown in FIG. 3 or FIG. 4 or FIG. 5 or FIG. 6 or FIG. 8 or FIG. 10 .
  • the network device 1200 is, for example, a switch, a router, etc., and the network device 1200 may be implemented by a general bus architecture.
  • a network device 1200 includes at least one processor 1201 , a memory 1203 and at least one communication interface 1204 .
  • the processor 1201 is, for example, a general-purpose central processing unit (central processing unit, CPU), a digital signal processor (digital signal processor, DSP), a network processor (network processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), A neural network processor (neural-network processing units, NPU), a data processing unit (Data Processing Unit, DPU), a microprocessor, or one or more integrated circuits for implementing the solution of this application.
  • the processor 1201 includes an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
  • the PLD is, for example, a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof. It can realize or execute various logical blocks, modules and circuits described in conjunction with the disclosure of the embodiments of the present invention.
  • the processor may also be a combination that implements computing functions, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the network device 1200 further includes a bus.
  • the bus is used to transfer information between the various components of the network device 1200 .
  • the bus may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 12 , but it does not mean that there is only one bus or one type of bus.
  • the memory 1203 is, for example, a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (random access memory, RAM) or a memory that can store information and instructions.
  • Other types of dynamic storage devices such as electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc Storage (including Compact Disc, Laser Disc, Optical Disc, Digital Versatile Disc, Blu-ray Disc, etc.), magnetic disk storage medium, or other magnetic storage device, or is capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other medium accessed by a computer, but not limited to.
  • the memory 1203 exists independently, for example, and is connected to the processor 1201 through a bus.
  • the memory 1203 can also be integrated with the processor 1201.
  • the communication interface 1204 uses any device such as a transceiver for communicating with other devices or a communication network.
  • the communication network can be Ethernet, radio access network (RAN) or wireless local area networks (wireless local area networks, WLAN).
  • the communication interface 1204 may include a wired communication interface, and may also include a wireless communication interface.
  • the communication interface 1204 can be an Ethernet (Ethernet) interface, a Fast Ethernet (Fast Ethernet, FE) interface, a Gigabit Ethernet (Gigabit Ethernet, GE) interface, an asynchronous transfer mode (Asynchronous Transfer Mode, ATM) interface, a wireless local area network ( wireless local area networks, WLAN) interface, cellular network communication interface or a combination thereof.
  • the Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In this embodiment of the application, the communication interface 1204 may be used for the network device 1200 to communicate with other devices.
  • the processor 1201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 12 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the network device 1200 may include multiple processors, such as the processor 1201 and the processor 1205 shown in FIG. 12 .
  • processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data such as computer program instructions.
  • the network device 1200 may further include an output device and an input device.
  • Output devices are in communication with processor 1201 and can display information in a variety of ways.
  • the output device may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector).
  • the input device communicates with the processor 1201 and can receive user input in various ways.
  • the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
  • the memory 1203 is used to store the program code 1206 for implementing the solution of the present application, and the processor 1201 can execute the program code 1206 stored in the memory 1203 . That is, the network device 1200 may implement the path fault detection method provided by the method embodiment through the processor 1201 and the program code 1206 in the memory 1203 . One or more software modules may be included in the program code 1206 .
  • the processor 1201 itself may also store program codes or instructions for executing the solutions of the present application.
  • the network device 1200 in the embodiment of the present application may correspond to any network device on the path to be detected in the above method embodiment, and the processor 1201 in the network device 1200 reads the instructions in the memory 1203,
  • the network device 1200 shown in FIG. 12 is enabled to perform all or part of the operations performed by the network devices on the path to be detected.
  • the processor 1201 is configured to obtain a first detection packet, the first detection packet includes a first period value, the first period value indicates the period for the network device to send the first detection packet, and the first period value is the first detection period value.
  • the network device 1200 may also correspond to the path fault detection device shown in FIG. 11 above, and each functional module in the path fault detection device is implemented by software of the network device 1200 .
  • the functional modules included in the path fault detection apparatus are generated after the processor 1201 of the network device 1200 reads the program code 1206 stored in the memory 1203 .
  • each step of the path fault detection method shown in FIGS. 3-10 is completed by an integrated logic circuit of hardware in the processor of the network device 1200 or instructions in the form of software.
  • the steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.
  • the embodiment of the present application also provides a chip, including a processor, the processor is used to call from the memory and execute the instructions stored in the memory, so that the network device installed with the chip executes any one of the path failures provided in the embodiment of the present application Detection method.
  • the embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory , when the code is executed, the processor is configured to execute any one of the path fault detection methods described above.
  • processor may be a CPU, or other general-purpose processors, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.
  • a general purpose processor may be a microprocessor or any conventional processor or the like. It should be noted that the processor may be a processor supporting the ARM architecture.
  • processors there are one or more processors and one or more memories.
  • the memory may be integrated with the processor, or the memory may be separated from the processor.
  • the above-mentioned memory may include read-only memory and random-access memory, and provides instructions and data to the processor.
  • Memory may also include non-volatile random access memory.
  • the memory may also store reference blocks and target blocks.
  • the memory can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
  • the non-volatile memory may be ROM, PROM, EPROM, EEPROM or flash memory.
  • Volatile memory can be RAM, which acts as external cache memory.
  • many forms of RAM are available. For example, SRAM, DRAM, SDRAM, DDR SDRAM, ESDRAM, SLDRAM, and DR RAM.
  • all or part may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it 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 the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (for example: solid state disk (solid state disk, SSD) )wait.
  • a magnetic medium for example: floppy disk, hard disk, magnetic tape
  • an optical medium for example: digital versatile disc (digital versatile disc, DVD)
  • a semiconductor medium for example: solid state disk (solid state disk, SSD) )wait.
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present application relates to the technical field of communications, and provides a path fault detection method, apparatus and system, a network device and a storage medium. In the embodiments of the present application, a deterministic forwarding mechanism is introduced, that is, a detection packet sent by the network device comprises a period value capable of indicating a period during which the network device sends the detection packet. In this way, a downstream device receiving the detection packet can determine the period of sending the detection packet according to the period of sending the detection packet by the network device. That is, the detection packet can be controlled to reach a destination device within a determined duration, such that the forwarding of the detection packet is not affected by the network congestion, the detection period can be further shortened, the duration from the occurrence of a network fault to the detection is greatly shortened, and a service loss duration is reduced.

Description

路径故障检测方法、装置、***、网络设备及存储介质Path fault detection method, device, system, network equipment and storage medium
本申请实施例要求于2021年9月1日提交的申请号为202111020744.6、发明名称为“一种OAM检测提升精度的技术”的中国专利申请的优先权以及于2021年11月3日提交的申请号为202111294236.7、发明名称为“路径故障检测方法、装置、***、网络设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中。The embodiment of this application claims the priority of the Chinese patent application with the application number 202111020744.6 and the title of the invention "A technology for improving the accuracy of OAM detection" submitted on September 1, 2021, and the application submitted on November 3, 2021 The priority of the Chinese patent application No. 202111294236.7 and the title of the invention is "path fault detection method, device, system, network equipment and storage medium", the entire content of which is incorporated by reference in the embodiment of this application.
技术领域technical field
本申请涉及通信领域,特别涉及一种路径故障检测方法、装置、***、网络设备及存储介质。The present application relates to the communication field, and in particular to a path fault detection method, device, system, network equipment and storage medium.
背景技术Background technique
当前,为了提高通信的可靠性,通常采用检测报文来检测路径是否发生故障。在某些业务场景下,希望故障从发生到被检测到并完成切换能更快一些,即希望进行故障检测的检测周期更短。然而,由于网络中通常会存在各种突发所导致的网络拥塞,导致检测报文的转发存在较大的时延抖动,此时,在检测周期较短的情况下可能会发生误检测。例如,在采用双向转发检测(bidirectional forwarding detection,BFD)报文检测路径故障时,如果连续三个检测周期的BFD报文丢失,则认为路径发生了故障。在这种情况下,当抖动时长大于3个检测周期的总时长时,BFD检测结果将认为路径发生了故障,即会导致误检测。因此,BFD检测的检测周期难以进一步缩短。Currently, in order to improve communication reliability, detection packets are usually used to detect whether a path fails. In some business scenarios, it is hoped that the fault from occurrence to detection and completion of switching can be faster, that is, the detection period for fault detection is expected to be shorter. However, due to the network congestion usually caused by various bursts in the network, there is a large delay and jitter in the forwarding of the detection message. At this time, false detection may occur when the detection cycle is short. For example, when bidirectional forwarding detection (BFD) packets are used to detect path failures, if BFD packets for three consecutive detection cycles are lost, the path is considered to be faulty. In this case, when the jitter duration is longer than the total duration of three detection cycles, the BFD detection result will consider that the path is faulty, which will lead to false detection. Therefore, it is difficult to further shorten the detection period of the BFD detection.
发明内容Contents of the invention
本申请实施例提供了一种路径故障检测方法、装置、***、网络设备及存储介质,以缩短故障检测周期,提高故障检测准确性。所述技术方案如下:Embodiments of the present application provide a path fault detection method, device, system, network device, and storage medium, so as to shorten a fault detection cycle and improve fault detection accuracy. Described technical scheme is as follows:
第一方面,提供了一种路径故障检测方法,该方法应用于待检测路径上的网络设备中,所述方法包括:获取第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示所述网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的目标发送周期对应的周期值;通过待检测路径发送所述第一检测报文,所述第一检测报文用于所述待检测路径的故障检测。In a first aspect, a path fault detection method is provided, the method is applied to a network device on a path to be detected, and the method includes: obtaining a first detection message, the first detection message including a first period value , the first period value indicates the period for the network device to send the first detection message, and the first period value corresponds to the target transmission period to which the first detection message belongs in multiple transmission periods A period value; the first detection message is sent through the path to be detected, and the first detection message is used for fault detection of the path to be detected.
在本申请实施例中,引入确定性转发机制,即网络设备发送的检测报文包括能够指示该网络设备发送该检测报文的周期的周期值,这样,接收到该检测报文的下游设备能够根据该网络设备发送检测报文的周期确定自身发送检测报文的周期,如此,即能够控制检测报文在确定的时长内到达目的设备,从而使得检测报文的转发不受网络拥塞的影响,进而使得检测周期能够进一步缩短,网络故障从发生到被检测到的时长大大缩短,降低业务受损时长。In the embodiment of the present application, a deterministic forwarding mechanism is introduced, that is, the detection message sent by the network device includes a cycle value that can indicate the cycle of the network device sending the detection message, so that the downstream device that receives the detection message can Determine the cycle of sending the detection message by itself according to the cycle of the network device sending the detection message, so that the detection message can be controlled to reach the destination device within a certain period of time, so that the forwarding of the detection message will not be affected by network congestion. In turn, the detection cycle can be further shortened, the time from occurrence to detection of network faults is greatly shortened, and the time for service damage is reduced.
在一些示例中,多个发送周期是预先设置的。其中,在一种可能的情况中,待检测路径上的各个网络设备中设置的发送周期的数量可以相同,且每个发送周期的时长也可以相同。或者,在另一种可能的情况中,待检测路径上部分网络设备中设置的发送周期的数量相同, 部分网络设备中设置的发送周期的数量不同。例如,在该待检测路径上一段链路的两端设备中设置的发送周期的数量相同,不同段链路的两端设备中设置的发送周期的数量可以不同。换句话说,多个发送周期的数量是基于网络设备的端口设置的,不同的端口上设置的多个发送周期的数量可以相同也可以不同。In some examples, multiple sending periods are preset. Wherein, in a possible situation, the number of sending cycles set in each network device on the path to be detected may be the same, and the duration of each sending cycle may also be the same. Or, in another possible situation, the numbers of sending cycles set in some network devices on the path to be detected are the same, and the numbers of sending cycles set in some network devices are different. For example, the number of sending cycles set in the devices at both ends of a link on the path to be detected is the same, and the numbers of sending cycles set in the devices at both ends of different links may be different. In other words, the number of multiple sending cycles is set based on the port of the network device, and the number of multiple sending cycles set on different ports may be the same or different.
在一种可能的实现方式中,第一检测报文在所述多个发送周期中所属的目标发送周期是根据所述网络设备预期发送所述第一检测报文的时间确定的。也即,当网络设备为待检测路径上的首设备时,则首设备根据自身预期发送第一检测报文的时间来确定该预期发送时间所处的目标发送周期,进而将该目标发送周期的周期值作为第一周期值。In a possible implementation manner, the target sending period to which the first detection packet belongs in the multiple sending periods is determined according to a time when the network device expects to send the first detection packet. That is, when the network device is the first device on the path to be detected, the first device determines the target sending period of the expected sending time according to the time when the first detection packet is expected to be sent by itself, and then the target sending period period value as the first period value.
在一种可能的实现方式中,第一检测报文在多个发送周期中所属的目标发送周期对应的周期值的确定过程也可以是:接收第二检测报文,所述第二检测报文包括第二周期值,所述第二周期值指示在所述待检测路径上所述网络设备的上一跳设备发送所述第二检测报文的周期;根据所述第二周期值和所述多个发送周期,确定所述第一周期值;所述获取第一检测报文包括:根据所述第二检测报文和所述第一周期值,获得所述第一检测报文。In a possible implementation manner, the process of determining the period value corresponding to the target transmission period to which the first detection message belongs in the multiple transmission periods may also be: receiving a second detection message, and the second detection message Including a second period value, the second period value indicates the period for sending the second detection message by the last hop device of the network device on the path to be detected; according to the second period value and the Multiple sending cycles, determining the first cycle value; the acquiring the first detection message includes: obtaining the first detection message according to the second detection message and the first cycle value.
在本申请中,当网络设备为待检测路径上的中间设备或尾设备时,该网络设备接收上一跳发送的第二检测报文,其中,第二检测报文中包含有用于指示上一跳发送该第二检测报文的周期的第二周期值。基于此,该网络设备能够根据该第二周期值获得第一周期值,并在第一周期值指示的发送周期内向下一跳发送包含了第一周期值的第一检测报文,如此,能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。In this application, when the network device is an intermediate device or tail device on the path to be detected, the network device receives the second detection message sent by the previous hop, wherein the second detection message contains information for indicating the last Skip the second period value of the period for sending the second detection packet. Based on this, the network device can obtain the first period value according to the second period value, and send the first detection message containing the first period value to the next hop within the sending period indicated by the first period value, so that it can The detection packet is controlled to reach the destination device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
在一些示例中,根据所述第二周期值和所述多个发送周期,确定所述第一周期值的实现过程可以为:确定所述网络设备与所述上一跳设备发送检测报文的周期差值;根据所述周期差值、所述第二周期值和所述多个发送周期,获得所述第一周期值。In some examples, according to the second period value and the plurality of sending periods, the implementation process of determining the first period value may be: determining the distance between the network device and the previous hop device for sending the detection message A cycle difference value: obtaining the first cycle value according to the cycle difference value, the second cycle value and the multiple sending cycles.
在本申请中,各个网络设备可以提前根据自身的上一跳设备发送的周期差值学习报文,学习接收该周期差值学习报文的入接口对应的周期差值,进而将学习到的周期差值和对应的入接口对应存储。在此基础上,网络设备在从第二检测报文中获得第二周期值时,可以根据该第二周期值和周期差值来获得第一周期值。In this application, each network device can learn the cycle difference corresponding to the incoming interface receiving the cycle difference learning message according to the cycle difference learning message sent by its own previous hop device in advance, and then use the learned cycle difference The difference is stored corresponding to the corresponding incoming interface. On this basis, when the network device obtains the second period value from the second detection message, it can obtain the first period value according to the second period value and the period difference value.
需要说明的是,在一些可能的情况中,各个网络设备在根据周期差值学习报文学习周期差值时,可以考虑对于接收该周期差值学习报文的入接口接收到的报文,通过自身的各个出接口向下一跳转发该报文时所需的时间,以此来确定周期差值。由于不同的出接口转发该入接口接收到的报文所需的时间不同,所以,针对不同的出接口学习到的周期差值可能不同。在此基础上,网络设备可以学习到入接口、出接口和对应的周期差值之间的映射关系。It should be noted that, in some possible situations, when each network device learns the period difference according to the period difference learning message, it may consider that for the message received by the inbound interface that receives the period difference learning message, through The time required for each outgoing interface of itself to forward the packet to the next hop is used to determine the cycle difference. Since the time required for different outgoing interfaces to forward packets received by the incoming interface is different, the cycle difference values learned for different outgoing interfaces may be different. On this basis, the network device can learn the mapping relationship between the incoming interface, the outgoing interface and the corresponding period difference.
在一种可能的实现方式,所述第一周期值携带在所述第一检测报文的基于第6代互联网协议(internet protocol version 6,IPv6)报文头或IPv6扩展头或多协议标签交换(multi-protocol label switching,MPLS)头或MPLS扩展头中。In a possible implementation, the first period value is carried in the first detection message based on the 6th generation Internet protocol (internet protocol version 6, IPv6) header or IPv6 extension header or multi-protocol label switching (multi-protocol label switching, MPLS) header or MPLS extension header.
其中,所述第一周期值携带在所述第一检测报文的IPv6报文头的目的地址字段中。或者,所述IPv6扩展头为分段路由头(segment routing header,SRH),所述第一周期值携带在所述第一检测报文的SRH的类型长度值TLV字段或分段路由标识(segment identifier,SID)中;或者,所述IPv6扩展头为逐跳选项头,所述第一周期值携带在逐跳选项头中。Wherein, the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet. Or, the IPv6 extension header is a segment routing header (segment routing header, SRH), and the first period value is carried in the type length value TLV field or segment routing identifier (segment routing header) of the SRH of the first detection message identifier, SID); or, the IPv6 extension header is a hop-by-hop option header, and the first period value is carried in the hop-by-hop option header.
可选地,所述第一周期值也可以携带在所述MPLS头包括的MPLS标签中。Optionally, the first period value may also be carried in an MPLS label included in the MPLS header.
在一些示例中,所述第一检测报文为BFD报文,或者,所述第一检测报文为操作维护管理(operation administration and maintenance,OAM)报文。In some examples, the first detection message is a BFD message, or, the first detection message is an operation administration and maintenance (OAM) message.
其中,当第一检测报文为BFD报文时,该第一检测报文可以为双向BFD报文、单臂BFD报文,无缝双向转发检测(seamless bidirectional forwarding detection,SBFD)报文。当该第一检测报文为OAM报文时,该第一检测报文可以为以太网(ethernet,ETH)OAM报文或MPLS OAM报文。其中,MPLS OAM报文可以为多协议标签交换传送应用(multi-protocol label switching transport profile,MPLS-TP)OAM报文。Wherein, when the first detection message is a BFD message, the first detection message may be a bidirectional BFD message, a single-arm BFD message, or a seamless bidirectional forwarding detection (seamless bidirectional forwarding detection, SBFD) message. When the first detection message is an OAM message, the first detection message may be an Ethernet (ethernet, ETH) OAM message or an MPLS OAM message. Wherein, the MPLS OAM message may be a multi-protocol label switching transport profile (MPLS-TP) OAM message.
第二方面,提供了一种路径故障检测装置,所述路径故障装置包括获取模块和发送模块,其中,获取模块,用于获取第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的目标发送周期对应的周期值;发送模块,用于通过待检测路径发送所述第一检测报文,所述第一检测报文用于所述待检测路径的故障检测。In a second aspect, a path fault detection device is provided. The path fault device includes an acquisition module and a sending module, wherein the acquisition module is used to acquire a first detection message, and the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period value is the period corresponding to the target transmission period to which the first detection message belongs among the multiple transmission periods value; a sending module, configured to send the first detection message through the path to be detected, where the first detection message is used for fault detection of the path to be detected.
可选地,所述多个发送周期是预先设置的。Optionally, the multiple sending periods are preset.
可选地,所述第一检测报文在所述多个发送周期中所属的目标发送周期是根据所述网络设备预期发送所述第一检测报文的时间确定的。Optionally, the target sending period to which the first detection packet belongs in the plurality of sending periods is determined according to a time when the network device expects to send the first detection packet.
可选地,所述装置还包括:接收模块和确定模块;其中,所述接收模块,用于接收第二检测报文,所述第二检测报文包括第二周期值,所述第二周期值指示在所述待检测路径上所述网络设备的上一跳设备发送所述第二检测报文的周期;所述确定模块,用于根据所述第二周期值和所述多个发送周期,确定所述第一周期值;所述获取模块,用于根据所述第二检测报文和所述第一周期值,获得所述第一检测报文。Optionally, the device further includes: a receiving module and a determining module; wherein the receiving module is configured to receive a second detection message, the second detection message includes a second period value, and the second period The value indicates the cycle at which the last hop device of the network device on the path to be detected sends the second detection message; the determining module is configured to use the second cycle value and the plurality of sending cycles , determining the first period value; the obtaining module, configured to obtain the first detection message according to the second detection message and the first period value.
在一些示例中,所述确定模块主要用于:确定所述网络设备与所述上一跳设备发送检测报文的周期差值;根据所述周期差值、所述第二周期值和所述多个发送周期,获得所述第一周期值。In some examples, the determination module is mainly used to: determine the period difference between the network device and the previous hop device for sending detection packets; according to the period difference, the second period value and the Multiple sending cycles, to obtain the first cycle value.
可选地,所述第一周期值携带在所述第一检测报文的基于第6代互联网协议IPv6报文头或IPv6扩展头或多协议标签交换MPLS头或MPLS扩展头中。其中,所述第一周期值携带在所述第一检测报文的IPv6报文头的目的地址字段中。或者,所述IPv6扩展头为分段路由头SRH,所述第一周期值携带在所述第一检测报文的SRH的类型长度值TLV字段或分段路由标识SID中;或者,所述IPv6扩展头为逐跳选项头,所述第一周期值携带在所述逐跳选项头中。或者,所述第一周期值携带在所述MPLS头包括的MPLS标签中。Optionally, the first period value is carried in a packet header or IPv6 extension header or MPLS header or MPLS extension header based on the 6th generation Internet protocol of the first detection message. Wherein, the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet. Or, the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or the segment routing identifier SID of the first detection message; or, the IPv6 The extension header is a hop-by-hop option header, and the first period value is carried in the hop-by-hop option header. Alternatively, the first period value is carried in an MPLS label included in the MPLS header.
可选地,所述第一检测报文为双向转发检测BFD报文,或者,所述第一检测报文为操作维护管理OAM报文。Optionally, the first detection message is a bidirectional forwarding detection BFD message, or the first detection message is an OAM message.
第三方面,提供了一种网络设备,所述网络设备的结构中包括处理器和存储器,所述存储器用于存储支持网络设备执行上述第一方面所提供的路径故障检测方法的至少一条程序指令或代码,以及存储用于实现上述第一方面所提供的路径故障检测方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序指令或代码。A third aspect provides a network device, the structure of the network device includes a processor and a memory, and the memory is used to store at least one program instruction that supports the network device to execute the path fault detection method provided in the first aspect above or codes, and store data involved in implementing the path fault detection method provided in the first aspect above. The processor is configured to execute program instructions or codes stored in the memory.
第四方面,提供了一种路径故障检测***,所述***包括第一网络设备和第二网络设备; 其中,所述第一网络设备用于通过待检测路径发送第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示所述第一网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的第一目标发送周期对应的周期值,所述第一检测报文用于所述待检测路径的故障检测;所述第二网络设备用于接收所述第一网络设备发送的所述第一检测报文,根据所述第一周期值获得第二周期值,根据所述第一检测报文和所述第二周期值获得第二检测报文,并发送所述第二检测报文,所述第二检测报文包括所述第二周期值,所述第二周期值指示所述第二网络设备发送所述第二检测报文的周期,所述第二周期值为所述第二检测报文在多个发送周期中所属的第二目标发送周期对应的周期值。In a fourth aspect, a path fault detection system is provided, and the system includes a first network device and a second network device; wherein the first network device is configured to send a first detection message through a path to be detected, and the The first detection packet includes a first period value, the first period value indicates the period for the first network device to send the first detection packet, and the first period value is when the first detection packet is A cycle value corresponding to the first target sending cycle in multiple sending cycles, the first detection message is used for fault detection of the path to be detected; the second network device is used to receive the first network device The first detection message sent, obtaining a second period value according to the first period value, obtaining a second detection message according to the first detection message and the second period value, and sending the first period value Two detection messages, the second detection message includes the second period value, the second period value indicates the period for the second network device to send the second detection message, and the second period value is a cycle value corresponding to the second target sending cycle to which the second detection message belongs in the multiple sending cycles.
需要说明的是,该待检测路径上还包括其他网络设备,各个网络设备可以参考第一网络设备或第二网络设备的操作来向自身的下一跳发送检测报文。It should be noted that other network devices are included on the path to be detected, and each network device can refer to the operation of the first network device or the second network device to send a detection message to its own next hop.
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的路径故障检测方法。In a fifth aspect, a computer-readable storage medium is provided, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is made to execute the path fault detection method described in the first aspect above.
第六方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的路径故障检测方法。A sixth aspect provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the path fault detection method described in the first aspect above.
上述第二方面、第三方面、第四方面、第五方面和第六方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above second, third, fourth, fifth and sixth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here.
附图说明Description of drawings
图1是本申请实施例提供的一种路径故障检测方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a path fault detection method provided by an embodiment of the present application;
图2是本申请实施例提供的一种路径故障检测方法所涉及的网络***架构图;FIG. 2 is a network system architecture diagram involved in a path fault detection method provided by an embodiment of the present application;
图3是本申请实施例提供的一种路径故障检测方法的流程图;FIG. 3 is a flow chart of a path fault detection method provided in an embodiment of the present application;
图4是本申请实施例提供的一种应用于首设备的路径故障检测方法的流程图;Fig. 4 is a flow chart of a path fault detection method applied to the first device provided by the embodiment of the present application;
图5是本申请实施例提供的一种应用于中间设备的路径故障检测方法的流程图;FIG. 5 is a flow chart of a path fault detection method applied to an intermediate device provided in an embodiment of the present application;
图6是本申请实施例提供的一种应用于尾设备的路径故障检测方法的流程图;FIG. 6 is a flow chart of a path fault detection method applied to tail equipment provided by an embodiment of the present application;
图7是本申请实施例提供的一种待检测路径上各个网络设备发送的检测报文的示意图;FIG. 7 is a schematic diagram of a detection message sent by each network device on a path to be detected provided by an embodiment of the present application;
图8是本申请实施例提供的一种各个网络设备交互以实现路径故障检测的流程图;FIG. 8 is a flow chart of interaction between various network devices to implement path fault detection provided by an embodiment of the present application;
图9是本申请实施例提供的另一种待检测路径上各个网络设备发送的检测报文的示意图;9 is a schematic diagram of another detection message sent by each network device on the path to be detected provided by the embodiment of the present application;
图10是本申请实施例提供的另一种各个网络设备交互以实现路径故障检测的流程图;FIG. 10 is another flow chart of network device interaction to implement path fault detection provided by an embodiment of the present application;
图11是本申请实施例提供的一种路径故障检测装置的结构示意图;FIG. 11 is a schematic structural diagram of a path fault detection device provided in an embodiment of the present application;
图12是本申请实施例提供的一种网络设备的结构示意图。FIG. 12 is a schematic structural diagram of a network device provided by an embodiment of the present application.
具体实施方式Detailed ways
在对本申请实施例进行详细的解释说明之前,先对本申请实施例的应用场景进行介绍。Before explaining the embodiment of the present application in detail, the application scenario of the embodiment of the present application is first introduced.
当前,为了提高网络通信的可靠性,通常可以对网络中用于进行业务数据传输的路径进行故障检测。例如,在二层虚拟专用网络(layer2 vrtual private network,L2VPN)、三层虚拟专用网络(layer3 vrtual private network,L3VPN)或IP网络等业务网络中,对于某个业务, 可以为其配置两条转发路径,如图1中所示,其中,一条转发路径由网络设备A、B、D组成,将该条转发路径作为主路径,另一条转发路径由网络设备A、C、D组成,将该条转发路径作为备份路径。在这种情况下,即能够使用本申请实施例提供的路径故障检测方法对主路径进行故障检测,以便在检测到主路径故障的情况下快速切换至备份路径进行业务数据的转发,从而减小业务受损程度。当然,在上述业务网络中,也可能为各个业务配置一条转发路径,在这种情况下,同样能够采用本申请实施例提供的路径故障检测方法对不同业务的转发路径进行故障检测,以便在检测到路径故障的情况下能够快速采取相应地措施。At present, in order to improve the reliability of network communication, it is generally possible to perform fault detection on a path used for service data transmission in the network. For example, in a service network such as a layer 2 virtual private network (layer2 virtual private network, L2VPN), a layer 3 virtual private network (layer3 virtual private network, L3VPN) or an IP network, for a certain service, you can configure two forwarding paths, as shown in Figure 1, wherein one forwarding path is composed of network devices A, B, and D, and this forwarding path is used as the main path, and the other forwarding path is composed of network devices A, C, and D, and this forwarding path is composed of network devices A, C, and D. The forwarding path acts as a backup path. In this case, the path failure detection method provided by the embodiment of the present application can be used to detect the failure of the main path, so that when the failure of the main path is detected, it can quickly switch to the backup path for forwarding business data, thereby reducing the The degree of damage to the business. Of course, in the above-mentioned service network, it is also possible to configure a forwarding path for each service. In this case, the path fault detection method provided by the embodiment of the present application can also be used to detect the faults of the forwarding paths of different services, so that when detecting In case of path failure, corresponding measures can be taken quickly.
图2是本申请实施例示例性的给出的一种路径故障检测方法所涉及的网络***架构图。如图2所示,该网络***中包括组成转发路径的多个网络设备,根据该多个网络设备在转发路径上所处的位置的不同,可以将该多个网络设备分为首设备201、中间设备202至204和尾设备205。Fig. 2 is a schematic diagram of a network system architecture involved in a path fault detection method exemplarily given in an embodiment of the present application. As shown in Figure 2, the network system includes a plurality of network devices that form the forwarding path, and according to the positions of the multiple network devices on the forwarding path, the multiple network devices can be divided into the first device 201, the intermediate devices 202 to 204 and tail device 205 .
其中,首设备201用于接收来自用户侧或服务器侧的源设备的业务报文,并向下一跳的中间设备202发送该业务报文。中间设备202在接收到上一跳发送的业务报文之后,将该业务报文转发至下一跳(即中间设备203),依次类推。尾设备205在接收到上一跳发送的业务报文之后,将该业务报文发送至用户侧或服务器侧的目的设备。Wherein, the head device 201 is configured to receive a service message from a source device on a user side or a server side, and send the service message to a next-hop intermediate device 202 . After receiving the service packet sent by the previous hop, the intermediate device 202 forwards the service packet to the next hop (that is, the intermediate device 203 ), and so on. After receiving the service packet sent by the previous hop, the tail device 205 sends the service packet to the destination device on the user side or the server side.
在本申请实施例中,首设备201还可以触发对该条转发路径的故障检测。示例性地,首设备201向下一跳(即中间设备202)发送检测报文,该检测报文中包括能够指示该检测报文的发送时间的时间值。中间设备202在接收到该检测报文之后,根据该检测报文中的时间值确定一个新的时间值,并根据该新的时间值指示的发送时间向下一跳(即中间设备203)发送新的检测报文,该新的检测报文中包括该新的时间值。依次类推,当尾设备205接收到中间设备204发送的检测报文之后,将该检测报文作为判断路径是否故障的依据。或者,尾设备205根据该检测报文包括的时间值获得新的时间值,并根据新的时间值和该检测报文生成新的检测报文,之后,向中间设备204发送生成的新的检测报文。后续,中间设备204至202参考上述方式向首设备201传输新的检测报文,以便首设备201在接收到检测报文之后,后续基于该检测报文判定该转发路径是否故障。In this embodiment of the present application, the first device 201 may also trigger fault detection on the forwarding path. Exemplarily, the head device 201 sends a detection message to the next hop (that is, the intermediate device 202), and the detection message includes a time value that can indicate the sending time of the detection message. After receiving the detection message, the intermediate device 202 determines a new time value according to the time value in the detection message, and sends it to the next hop (ie, the intermediate device 203) according to the sending time indicated by the new time value A new detection message, the new detection message includes the new time value. By analogy, when the tail device 205 receives the detection packet sent by the intermediate device 204, the detection packet is used as a basis for judging whether the path is faulty. Alternatively, the tail device 205 obtains a new time value according to the time value included in the detection message, and generates a new detection message according to the new time value and the detection message, and then sends the generated new detection message to the intermediate device 204. message. Subsequently, the intermediate devices 204 to 202 transmit a new detection message to the first device 201 referring to the above method, so that after receiving the detection message, the first device 201 subsequently determines whether the forwarding path is faulty based on the detection message.
由此可见,在本申请实施例中,转发路径上的各个网络设备通过在自身发送的检测报文中携带能够指示自身发送该检测报文的时间的时间值,使得接收到该检测报文的下一跳设备能够根据检测报文的时间值确定自身发送检测报文的时间,如此,即能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。It can be seen that, in the embodiment of the present application, each network device on the forwarding path carries a time value that can indicate the time when the detection message is sent by itself in the detection message sent by itself, so that the time value of receiving the detection message The next-hop device can determine the time to send the detection message according to the time value of the detection message. In this way, it can control the detection message to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by network congestion. Influence, improve the accuracy of path fault detection.
需要说明的是,上述的各个网络设备可以为路由器、交换机等具有路由转发功能的设备。另外,值得注意的是,上述仅是以转发路径上包括三个中间设备为例进行示例性说明,本领域技术人员应当理解,转发路径上可能包括更少或更多的中间设备,本申请实施例对此不做限定。It should be noted that each of the foregoing network devices may be a router, a switch, and other devices with routing and forwarding functions. In addition, it is worth noting that the above is only an example of including three intermediate devices on the forwarding path. Those skilled in the art should understand that there may be fewer or more intermediate devices on the forwarding path. Examples are not limited to this.
图3是本申请实施例提供的一种路径故障检测方法的流程图,该方法可以由待检测路径上的网络设备来执行,例如,由图2所示的转发路径上的网络设备来执行。如图3所示,该方法包括以下步骤:FIG. 3 is a flow chart of a path fault detection method provided by an embodiment of the present application. The method may be executed by a network device on the path to be detected, for example, by a network device on the forwarding path shown in FIG. 2 . As shown in Figure 3, the method includes the following steps:
步骤301:获取第一检测报文,该第一检测报文包括第一周期值,第一周期值指示网络设备发送第一检测报文的周期,第一周期值为第一检测报文在多个发送周期中所属的目标发送周期对应的周期值。Step 301: Obtain the first detection message, the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period value The period value corresponding to the target sending period belonging to one sending period.
在本申请实施例中,待检测路径上的各个网络设备的出接口均对应有预先设置的多个发送周期。在此基础上,第一检测报文中携带有能够指示网络设备发送该第一检测报文时所处的发送周期的第一周期值。In the embodiment of the present application, the outgoing interfaces of each network device on the path to be detected correspond to a plurality of preset sending periods. On this basis, the first detection packet carries a first period value capable of indicating the sending period when the network device sends the first detection packet.
需要说明的是,当该网络设备为待检测路径上的首设备时,第一检测报文在多个发送周期中所属的目标发送周期是根据该网络设备预期发送该第一检测报文的时间确定的。并且,该网络设备在确定该第一检测报文所属的目标发送周期之后,生成包括该目标发送周期对应的周期值的第一检测报文。It should be noted that, when the network device is the first device on the path to be detected, the target sending cycle of the first detection message in the multiple sending cycles is based on the time when the network device is expected to send the first detection message definite. Moreover, after determining the target sending period to which the first detection message belongs, the network device generates the first detection message including a period value corresponding to the target sending period.
当该网络设备为待检测路径上的中间设备或尾设备时,该第一检测报文所属的目标发送周期可以是根据该网络设备接收到的上一跳发送的检测报文中包括的周期值获得的。并且,该网络设备在确定该第一检测报文所属的目标发送周期后,根据接收到的上一跳发送的检测报文和该目标发送周期对应的周期值获得第一检测报文。When the network device is an intermediate device or tail device on the path to be detected, the target sending cycle to which the first detection message belongs may be the cycle value included in the detection message sent by the previous hop received by the network device acquired. Moreover, after determining the target sending period to which the first detection message belongs, the network device obtains the first detection message according to the received detection message sent by the previous hop and the period value corresponding to the target sending period.
步骤302:通过待检测路径发送第一检测报文,该第一检测报文用于待检测路径的故障检测。Step 302: Send a first detection packet through the path to be detected, where the first detection packet is used for fault detection of the path to be detected.
在本申请实施例中,待检测路径上的各个网络设备通过在自身发送的检测报文中携带能够指示自身发送该检测报文的周期的周期值,使得接收到该检测报文的下一跳设备能够根据检测报文的周期值确定自身发送检测报文的周期,如此,即能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。In this embodiment of the present application, each network device on the path to be detected carries a cycle value that can indicate the cycle of sending the detection message by itself in the detection message sent by itself, so that the next hop that receives the detection message The device can determine the cycle of sending the detection message according to the cycle value of the detection message. In this way, the detection message can be controlled to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by the network congestion and improves improve the accuracy of path fault detection.
在一种示例中,当上述图3所示实施例中的网络设备为待检测路径上的首设备上,例如,该网络设备为图2所示的***架构中的首设备时,则图3所示实施例可以具体实现为图4所示的流程。如图4所示,该过程包括如下步骤:In an example, when the network device in the embodiment shown in FIG. 3 is the first device on the path to be detected, for example, when the network device is the first device in the system architecture shown in FIG. 2 , then the network device shown in FIG. 3 The illustrated embodiment can be specifically implemented as the process shown in FIG. 4 . As shown in Figure 4, the process includes the following steps:
步骤401:生成第一检测报文,该第一检测报文包括第一周期值,该第一周期值指示首设备发送第一检测报文的周期,且该第一周期值为第一检测报文在多个发送周期中所属的目标发送周期对应的周期值,该第一检测报文用于待检测路径的故障检测。Step 401: Generate a first detection packet, the first detection packet includes a first period value, the first period value indicates the period for the first device to send the first detection packet, and the first period value is the first period value of the first detection packet The cycle value corresponding to the target sending cycle to which the message belongs in the multiple sending cycles, and the first detection message is used for fault detection of the path to be detected.
在本申请实施例中,首设备根据预期发送第一检测报文的时间,获得第一周期值,进而根据第一周期值和检测报文载荷生成第一检测报文。In the embodiment of the present application, the first device obtains the first period value according to the expected time to send the first detection message, and then generates the first detection message according to the first period value and the load of the detection message.
示例性地,待检测路径上的各个网络设备的出接口均对应有多个发送周期。例如,每个网络设备的出接口对应有16个发送周期,每个发送周期的时长均为10微秒。在此基础上,当首设备开始路径故障检测时,确定预期发送第一检测报文的时间,也即,该第一检测报文的待发送时间。之后,根据该待发送时间,确定该第一检测报文在多个发送周期中所属的目标发送周期,也即,预期发送该第一检测报文时所处的发送周期。获取该目标发送周期的周期值作为第一周期值。Exemplarily, each outgoing interface of each network device on the path to be detected corresponds to a plurality of sending periods. For example, each outgoing interface of a network device corresponds to 16 sending cycles, and the duration of each sending cycle is 10 microseconds. On this basis, when the first device starts path fault detection, it determines the expected time to send the first detection message, that is, the waiting time to send the first detection message. Afterwards, according to the time to be sent, determine the target sending cycle to which the first detection message belongs among the multiple sending cycles, that is, the sending cycle where the first detection message is expected to be sent. Obtain the period value of the target sending period as the first period value.
其中,该第一周期值可以是目标发送周期的周期标签值。例如,当出接口对应16个发送周期时,根据待发送时间获得的第一周期值将为0-15中的某个数值。可选地,该第一周期值还能够用于指示第一检测报文所属的目标发送周期为该多个发送周期中的第几个发送周期, 例如,当第一周期值为5时,则指示第一检测报文所属的目标发送周期为多个发送周期中的第5个发送周期。Wherein, the first period value may be a period label value of the target sending period. For example, when the outbound interface corresponds to 16 sending periods, the first period value obtained according to the time to be sent will be a certain value in 0-15. Optionally, the first cycle value can also be used to indicate the target sending cycle to which the first detection message belongs is the number of sending cycles in the multiple sending cycles, for example, when the first cycle value is 5, then Indicates that the target sending period to which the first detection message belongs is the fifth sending period among the multiple sending periods.
在获得第一周期值之后,首设备根据第一周期值和检测报文载荷生成用于待检测路径的故障检测的第一检测报文,该第一检测报文包括该第一周期值和该检测报文载荷。其中,根据所采用的故障检测技术的不同,检测报文载荷不同,相应地,第一检测报文的类型也不同。例如,当采用BFD检测技术时,检测报文载荷为BFD报文载荷,相应地,第一检测报文为BFD报文。其中,该第一检测报文可以为双向BFD报文、SBFD报文或者是单臂BFD报文。当采用OAM检测技术时,检测报文载荷即为OAM报文载荷,相应地,第一检测报文为OAM报文,此时,该第一检测报文可以为ETH OAM报文或MPLS OAM报文。其中,MPLS OAM报文可以为MPLS TP OAM报文。当然,第一检测报文也可以为其他类型的能够用于检测待检测路径故障的检测报文,本申请实施例不对检测报文的报文类型进行限定。After obtaining the first period value, the first device generates a first detection message for fault detection of the path to be detected according to the first period value and the load of the detection message, and the first detection message includes the first period value and the Detect packet payload. Wherein, according to different fault detection technologies adopted, the loads of the detection packets are different, and correspondingly, the types of the first detection packets are also different. For example, when the BFD detection technology is adopted, the detection packet payload is a BFD packet payload, and correspondingly, the first detection packet is a BFD packet. Wherein, the first detection message may be a two-way BFD message, an SBFD message or a one-arm BFD message. When the OAM detection technology is adopted, the detection packet load is the OAM packet load. Correspondingly, the first detection packet is an OAM packet. At this time, the first detection packet can be an ETH OAM packet or an MPLS OAM packet. arts. Wherein, the MPLS OAM message may be an MPLS TP OAM message. Of course, the first detection message may also be another type of detection message that can be used to detect a fault on the path to be detected, and this embodiment of the present application does not limit the message type of the detection message.
需要说明的是,第一检测报文包括IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头。相应地,第一周期值可以携带在第一检测报文的IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头中。除此之外,第一检测报文中还可以携带有确定性转发使能标识,以指示第一周期值。It should be noted that the first detection packet includes an IPv6 packet header or an IPv6 extension header or an MPLS header or an MPLS extension header. Correspondingly, the first period value may be carried in the IPv6 packet header or IPv6 extension header or MPLS header or MPLS extension header of the first detection packet. In addition, the first detection message may also carry a deterministic forwarding enable flag to indicate the first period value.
示例性地,在第一种可能的情况中,如果该待检测路径为L3VPN中基于SRv6流量工程扩展策略(SRv6 traffic-engineering extensions policy,SRv6-TE policy)配置的路径,则首设备在检测报文载荷的外层,从里到外依次封装UDP报文头、IPv4报文头、IPv6扩展头、IPv6报文头和二层报文头,并在IPv6报文头或IPv6扩展头中携带第一周期值,从而得到第一检测报文。Exemplarily, in the first possible situation, if the path to be detected is a path configured based on the SRv6 traffic-engineering extensions policy (SRv6 traffic-engineering extensions policy, SRv6-TE policy) in the L3VPN, the first device in the detection report The outer layer of the packet payload, encapsulating the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header sequentially from the inside to the outside, and carrying the second packet in the IPv6 packet header or IPv6 extension header A period value, so as to obtain the first detection message.
其中,在一种可能的实现方式中,IPv6报文头中包括有目的地址字段,该目的地址字段用于携带首设备的下一跳与首设备的下一跳的下一跳之间的链路的SID,基于此,可以通过第一检测报文的IPv6报文头中的目的地址字段中的SID来携带第一周期值。Wherein, in a possible implementation manner, the IPv6 packet header includes a destination address field, and the destination address field is used to carry the link between the next hop of the first device and the next hop of the next hop of the first device. Based on this, the SID in the destination address field in the IPv6 packet header of the first detection packet can be used to carry the first period value.
需要说明的是,SID包括64位的位置标识(locator)、48位的功能(function)和12位的参数(arguments,Args)。本申请实施例可以通过SID中的Args来携带第一周期值。It should be noted that the SID includes a 64-bit location identifier (locator), a 48-bit function (function) and a 12-bit parameter (arguments, Args). In this embodiment of the present application, Args in the SID may carry the first period value.
例如,首设备的下一跳与首设备的下一跳的下一跳之间的链路的SID为2002::5000,其中,2002为locator,000为Args。当第一周期值为10时,首设备将第一周期值10转换成16进制数字A,然后将SID修改为2002::500A,之后,将修改后的SID作为IPv6报文头中的目的地址字段中的SID。For example, the SID of the link between the next hop of the first device and the next hop of the next hop of the first device is 2002::5000, where 2002 is the locator and 000 is Args. When the first period value is 10, the primary device converts the first period value 10 into a hexadecimal number A, then modifies the SID to 2002::500A, and then uses the modified SID as the destination in the IPv6 packet header. SID in the address field.
可选地,在本申请实施例中,在通过IPv6报文头的目的地址字段中的SID来携带第一周期值时,还可以在该SID中携带确定性转发使能标识,以指示该SID中携带的第一周期值。例如,该确定性转发使能标识为1,仍以上述示例为例,首设备可以将SID修改为2002::501A,其中,501A中的1即为确定性使能标识,A为第一周期值的16进制数字。之后,将修改后的SID作为IPv6报文头中的目的地址字段中的SID。Optionally, in this embodiment of the application, when the SID in the destination address field of the IPv6 packet header is used to carry the first period value, the deterministic forwarding enable flag may also be carried in the SID to indicate that the SID The first period value carried in . For example, the deterministic forwarding enable flag is 1. Still taking the above example as an example, the first device can change the SID to 2002::501A, where 1 in 501A is the deterministic enable flag, and A is the first cycle The hexadecimal number of the value. Afterwards, use the modified SID as the SID in the destination address field in the IPv6 packet header.
在另一种可能的实现方式中,上述的第一检测报文的IPv6扩展头包括分段路由头(segment routing header,SRH),其中,SRH中包括有TLV字段和SID表。基于此,可以通过SRH中的TLV字段或者SID表来携带第一周期值。In another possible implementation manner, the above-mentioned IPv6 extension header of the first detection message includes a segment routing header (segment routing header, SRH), wherein the SRH includes a TLV field and a SID table. Based on this, the first period value may be carried through the TLV field or the SID table in the SRH.
需要说明的是,第一检测报文的SRH中的SID表中包括待检测路径上首设备之后检测报文所要途经的网络设备之间的链路的SID。首设备可以参考上述方式,根据第一周期值对首 设备的下一跳与首设备的下一跳的下一跳之间的链路的SID进行修改,将修改后的SID添加至该第一检测报文的SRH的SID表中。It should be noted that the SID table in the SRH of the first detection message includes the SID of the link between the network devices that the detection message passes through after the first device on the path to be detected. Referring to the above method, the first device can modify the SID of the link between the next hop of the first device and the next hop of the next hop of the first device according to the first period value, and add the modified SID to the first In the SID table of the SRH of the detection message.
另外,在该种实现方式中,首设备同样可以参考上述介绍的方式在SID中携带确定性转发使能标识,本申请实施例在此不再赘述。In addition, in this implementation manner, the first device may also refer to the manner described above to carry the deterministic forwarding enablement identifier in the SID, which will not be repeated in this embodiment of the present application.
可选地,上述的第一检测报文的IPv6扩展头还可能包括逐跳(hop-by-hop)选项头,在这种情况下,也可以通过第一检测报文的逐跳选项头来携带第一周期值。Optionally, the above-mentioned IPv6 extension header of the first detection message may also include a hop-by-hop option header. In this case, the hop-by-hop option header of the first detection message may also be used to Carry the first period value.
在第二种可能的情况中,如果待检测路径为L3VPN中基于SR-MPLS配置的路径,则首设备可以在检测报文载荷的外层,由里到外依次封装UDP报文头、IPv4报文头、MPLS头和二层报文头,并在MPLS头中携带第一周期值,从而得到第一检测报文。In the second possible situation, if the path to be detected is an SR-MPLS-based path in the L3VPN, the primary device can encapsulate the UDP packet header, IPv4 packet A text header, an MPLS header and a Layer 2 packet header, and the first period value is carried in the MPLS header, so as to obtain the first detection packet.
在该种情况中,MPLS头中包括MPLS SID表,该MPLS SID表中包括多层MPLS标签。该多层MPLS标签从外层到内层依次为该待检测路径上首设备之后检测报文所要途经的各个网络设备的MPLS标签。基于此,首设备可以在MPLS SID表中首设备的下一跳的MPLS标签中携带第一周期值。In this case, the MPLS header includes an MPLS SID table that includes multiple layers of MPLS labels. From the outer layer to the inner layer, the multi-layer MPLS label is the MPLS label of each network device that the detection message will pass through after the first device on the path to be detected. Based on this, the first device can carry the first period value in the MPLS label of the next hop of the first device in the MPLS SID table.
例如,假设该待检测路径上首设备之后的各个网络设备的MPLS标签依次为100、200、300,也即首设备的下一跳的MPLS标签为100。当第一周期值为第一周期值10时,首设备可以将下一跳的MPLS标签修改为110,之后,将修改后的MPLS标签作为MPLS SID表中的最外层标签。或者,首设备也可以将第一周期值转换为16进制数字,从而将下一跳的MPLS标签修改为10A,之后,将修改后的MPLS标签作为MPLS SID表中的最外层标签。For example, assume that the MPLS labels of each network device after the first device on the path to be detected are 100, 200, and 300 in sequence, that is, the MPLS label of the next hop of the first device is 100. When the first period value is 10, the head device can modify the MPLS label of the next hop to 110, and then use the modified MPLS label as the outermost label in the MPLS SID table. Alternatively, the head device can also convert the first period value into a hexadecimal number, thereby modifying the MPLS label of the next hop to 10A, and then use the modified MPLS label as the outermost label in the MPLS SID table.
可选地,在该种实现方式中,首设备不仅可以通过下一跳的MPLS标签携带第一周期值,还可以携带确定性转发使能标识。例如,继续上述举例,确定性转发使能标识为1,则首设备可以将下一跳的MPLS标签修改为11A,其中,最后一位A为第一周期值10,中间一位“1”为确定性转发使能标识,将修改后的MPLS标签作为MPLS SID表中的最外层标签。Optionally, in this implementation manner, the head device may not only carry the first period value through the MPLS label of the next hop, but may also carry the deterministic forwarding enablement identifier. For example, continuing the above example, if the deterministic forwarding enable flag is 1, the first device can change the MPLS label of the next hop to 11A, where the last bit A is the first period value 10, and the middle bit "1" is The deterministic forwarding enable flag uses the modified MPLS label as the outermost label in the MPLS SID table.
可选地,在一些可能情况中,首设备在上述的MPLS头和IPv4报文头之间还可以封装MPLS扩展头,在这种情况下,可以通过MPLS扩展头来携带第一周期值。Optionally, in some possible cases, the head device may also encapsulate the MPLS extension header between the above MPLS header and the IPv4 packet header. In this case, the MPLS extension header may carry the first period value.
需要说明的是,上述仅是本申请实施例示例性的给出的几种通过第一检测报文承载第一周期值的实现方式,但是这并不构成对本申请实施例的限定。当待检测路径为基于其他网络协议配置的路径时,也可以通过相应网络协议对应的报文中的字段来承载第一周期值。It should be noted that, the foregoing are only exemplary implementations of carrying the first period value in the first detection message given by the embodiment of the present application, but this does not constitute a limitation to the embodiment of the present application. When the path to be detected is a path configured based on other network protocols, the first period value may also be carried by a field in a packet corresponding to a corresponding network protocol.
另外,值得注意的是,上述的检测报文载荷包括该检测报文载荷对应的检测协议的报文头,例如,当采用的检测技术为BFD技术时,该检测报文载荷中包括BFD报文头。In addition, it is worth noting that the above detection packet payload includes the packet header of the detection protocol corresponding to the detection packet payload. For example, when the detection technology used is BFD technology, the detection packet payload includes the BFD packet head.
步骤402:通过待检测路径发送第一检测报文。Step 402: Send the first detection packet through the path to be detected.
在获得第一检测报文之后,首设备根据该第一检测报文所属的目标发送周期,将该第一检测报文添加至该目标发送周期所对应的发送队列中,并在到达预期发送时间之后,向该待检测路径上该首设备的下一跳发送第一检测报文。After obtaining the first detection message, the first device adds the first detection message to the sending queue corresponding to the target sending cycle according to the target sending period to which the first detecting message belongs, and when the expected sending time is reached Afterwards, a first detection message is sent to the next hop of the first device on the path to be detected.
在本申请实施例中,首设备发送的用于检测待检测路径是否故障的第一检测报文中包含有第一周期值,该第一周期值能够指示第一检测报文的发送周期,这样,首设备的下一跳在接收到第一检测报文之后,即能够获知该第一检测报文的发送周期,并根据该发送周期确定自身发送检测报文的周期,进而按照确定的发送周期发送检测报文,这样,即能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。In this embodiment of the present application, the first detection message sent by the first device to detect whether the path to be detected contains a first cycle value, and the first cycle value can indicate the sending cycle of the first detection message, so that , after receiving the first detection message, the next hop of the first device can know the sending cycle of the first detection message, and determine the cycle of sending the detection message according to the sending cycle, and then according to the determined sending cycle In this way, the detection message can be controlled to reach the destination device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
在另一种示例中,当上述图3所示实施例中的网络设备为待检测路径上的中间设备时,例如,该网络设备为图2所示的***架构中的中间设备202-204任一个,则图3所示实施例可以具体实现为图5所示的流程,下文中以中间设备为首设备的下一跳为例来进行说明。如图5所示,该方法包括以下步骤:In another example, when the network device in the embodiment shown in FIG. 3 is an intermediate device on the path to be detected, for example, the network device is any of the intermediate devices 202-204 in the system architecture shown in FIG. 2 One, the embodiment shown in FIG. 3 can be specifically implemented as the process shown in FIG. 5 , and the following description will be made by taking the intermediate device as the next hop of the head device as an example. As shown in Figure 5, the method includes the following steps:
步骤501:接收第二检测报文,第二检测报文包括第二周期值,第二周期值用于指示在待检测路径上该中间设备的上一跳发送第二检测报文的周期。Step 501: Receive a second detection packet, the second detection packet includes a second period value, and the second period value is used to indicate the period for sending the second detection packet by the previous hop of the intermediate device on the path to be detected.
在本申请实施例中,中间设备接收首设备发送的第二检测报文。该第二检测报文包括能够指示首设备发送该第二检测报文的周期的第二周期值,并且,该第二检测报文包括用于检测待检测路径是否故障的检测报文载荷。其中,首设备发送的第二检测报文中的第二周期值的获取方法可以参考图4所示的实施例中首设备获取第一周期值的方法,本申请实施例在此不再赘述。In this embodiment of the present application, the intermediate device receives the second detection packet sent by the first device. The second detection packet includes a second period value capable of indicating a period for the first device to send the second detection packet, and the second detection packet includes a detection packet load for detecting whether the path to be detected is faulty. Wherein, the method for obtaining the second period value in the second detection message sent by the first device may refer to the method for the first device to obtain the first period value in the embodiment shown in FIG.
步骤502:根据第二周期值和多个发送周期,确定第一周期值。Step 502: Determine a first period value according to the second period value and multiple sending periods.
中间设备在接收到第二检测报文之后,确定自身与上一跳设备发送检测报文的周期差值,并从第二检测报文的IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头中获取第二周期值,进而根据第二周期值、获取的周期差值和多个发送周期,确定第一周期值。After the intermediate device receives the second detection message, it determines the cycle difference between itself and the previous hop device for sending the detection message, and calculates the difference from the IPv6 header or IPv6 extension header or MPLS header or MPLS extension of the second detection message. The second period value is acquired in the header, and then the first period value is determined according to the second period value, the acquired period difference and multiple sending periods.
需要说明的是,在本申请实施例中,首设备定时向该中间设备发送是周期差值学习报文,该周期差值学习报文中携带有用于指示该周期差值学习报文的发送周期的周期值。该中间设备通过某个入接口接收周期差值学习报文。之后,根据接收该周期差值学习报文的时间、该周期差值学习报文中携带的周期值以及自身转发报文所需的时间,预估自身发出该周期差值学习报文的时间所对应的发送周期,进而根据预估的发送周期对应的周期值和该周期差值学习报文中携带的周期值,计算得到一个周期差值,将该周期差值与接收该周期差值学习报文的入接口的接口标识对应存储,此时,该周期差值即为该入接口对应的周期差值。通过上述方法,该中间设备能够学习得到自身的各个入接口与对应的周期差值之间的映射关系。对于待检测路径上的各个网络设备,每个设备均可以通过自身上一跳发送的周期差值学习报文学习到自身的各个入接口与对应的周期差值之间的映射关系。It should be noted that, in the embodiment of the present application, the first device regularly sends a periodic difference learning message to the intermediate device, and the periodic difference learning message carries information indicating the sending period of the periodic difference learning message. cycle value. The intermediate device receives the cycle difference learning message through an incoming interface. Afterwards, according to the time of receiving the period difference learning message, the period value carried in the period difference learning message and the time required for forwarding the message by itself, estimate the time required for sending the period difference learning message by itself. The corresponding sending period, and then according to the period value corresponding to the estimated sending period and the period value carried in the period difference learning message, calculate a period difference value, and compare the period difference value with the period difference learning report received. The interface identifier of the incoming interface of the document is correspondingly stored, and at this time, the cycle difference is the cycle difference corresponding to the incoming interface. Through the above method, the intermediate device can learn the mapping relationship between its own incoming interfaces and the corresponding period difference values. For each network device on the path to be detected, each device can learn the mapping relationship between its own incoming interfaces and the corresponding cycle difference value through the cycle difference learning message sent by its own previous hop.
值得注意的是,周期差值学习报文中携带的周期值是该周期差值学习报文所属的发送周期对应的周期值。其中,同一设备上各个入接口对应的周期差值可能相同也可能不同,并且,不同设备上的入接口对应的周期差值也可能相同或不相同。It should be noted that the period value carried in the period difference learning message is the period value corresponding to the sending period to which the period difference learning message belongs. The cycle difference values corresponding to the incoming interfaces on the same device may be the same or different, and the cycle difference values corresponding to the incoming interfaces on different devices may also be the same or different.
在此基础上,作为首设备的下一跳的中间设备在接收到第二检测报文之后,基于该第二检测报文的入接口,从自身存储的各个入接口与对应的周期差值的映射关系中,获取第二检测报文的入接口对应的周期差值。之后,该中间设备将第二周期值和获取到的周期差值相加,如果第二周期值和获取到的时间差值相加之后,得到的周期值超出了中间设备上预先设置的多个发送周期的周期值范围,则该中间设备对相加得到的周期值进行处理,从而得到第一周期值。如果相加得到的周期值未超出多个发送周期的周期值范围,则将相加得到的周期值作为第一周期值。On this basis, after receiving the second detection message, the intermediate device as the next hop of the first device, based on the incoming interface of the second detection message, from each incoming interface stored by itself and the corresponding cycle difference In the mapping relationship, the period difference corresponding to the incoming interface of the second detection message is acquired. Afterwards, the intermediate device adds the second cycle value to the obtained cycle difference value, if the second cycle value is added to the obtained time difference value, the obtained cycle value exceeds the preset multiple If the period value range of the period is sent, the intermediate device processes the added period value to obtain the first period value. If the period value obtained by the addition does not exceed the period value range of multiple sending periods, the period value obtained by the addition is used as the first period value.
例如,假设该中间设备的出接口对应有16个发送周期,周期值范围为0至15,当第二周期值为5,获取到的周期差值为4时,则计算得到的周期值为9,此时,第一周期值即为9。当第二周期值为14,获取到的周期差值为4时,则计算得到的周期值为18,由于周期值范围 为0至15,所以,将计算得到的周期值除以发送周期的个数得到的余数作为第一周期值,此时,第一周期值为2。For example, assuming that the outgoing interface of the intermediate device has 16 sending cycles, and the cycle value ranges from 0 to 15, when the second cycle value is 5 and the obtained cycle difference is 4, the calculated cycle value is 9 , at this time, the first period value is 9. When the second period value is 14 and the obtained period difference is 4, the calculated period value is 18. Since the period value ranges from 0 to 15, divide the calculated period value by the number of sending periods The remainder obtained by counting is used as the first period value, and at this time, the first period value is 2.
步骤503:根据第二检测报文和第一周期值,获得第一检测报文,该第一检测报文包括第一周期值。Step 503: Obtain a first detection message according to the second detection message and the first period value, where the first detection message includes the first period value.
在获得第一周期值之后,该中间设备可以根据第二检测报文的报文类型对该第二检测报文做转发处理,并根据第一周期值对第二检测报文进行修改,从而得到第一检测报文。After obtaining the first period value, the intermediate device can forward the second detection message according to the message type of the second detection message, and modify the second detection message according to the first period value, thereby obtaining The first detection packet.
由图4所示的实施例介绍可知,首设备发送的第二检测报文中的第二周期值可能被携带在第二检测报文的IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头中。基于此,该中间设备可以根据第一周期值对第二检测报文的IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头中携带的第二周期值进行修改,从而得到第一检测报文。From the introduction of the embodiment shown in Figure 4, it can be seen that the second cycle value in the second detection message sent by the first device may be carried in the IPv6 packet header or IPv6 extension header or MPLS header or MPLS extension of the second detection message. in the head. Based on this, the intermediate device can modify the second period value carried in the IPv6 header or IPv6 extension header or MPLS header or MPLS extension header of the second detection message according to the first period value, thereby obtaining the first detection message arts.
示例性地,如果该待检测路径为L3VPN中基于SRv6-TE policy配置的路径,且第二周期值携带在第二检测报文的IPv6报文头的目的地址字段中,则中间设备首先将第二检测报文的IPv6报文头中的目的地址字段包括的SID修改为该中间设备的下一跳与该中间设备的下一跳的下一跳之间的链路的SID。可选地,如果该中间设备的下一跳即为尾设备,则该中间设备也可以将该第二检测报文的IPv6报文头中的目的地址字段包括的SID修改为尾设备的SID。之后,该中间设备根据第一周期值对修改后的该目的地址字段中的SID进行修改,从而得到第一检测报文,其中,修改方式参考前述实施例中介绍的首设备基于第一周期值对SID进行修改的过程,本申请实施例在此不再赘述。Exemplarily, if the path to be detected is a path configured based on SRv6-TE policy in L3VPN, and the second cycle value is carried in the destination address field of the IPv6 packet header of the second detection message, the intermediate device first sets the first Second, the SID included in the destination address field in the IPv6 header of the detection message is changed to the SID of the link between the next hop of the intermediate device and the next hop of the next hop of the intermediate device. Optionally, if the next hop of the intermediate device is the tail device, the intermediate device may also modify the SID included in the destination address field in the IPv6 packet header of the second detection message to the SID of the tail device. Afterwards, the intermediate device modifies the modified SID in the destination address field according to the first cycle value, thereby obtaining the first detection message, wherein, the modification method refers to the first device introduced in the foregoing embodiments based on the first cycle value The process of modifying the SID will not be repeated in this embodiment of the present application.
例如,假设第二检测报文的IPv6报文头的目的地址字段中携带的SID为2002::500A,其中,A为第二周期值,该中间设备的下一跳与该中间设备的下一跳的下一跳之间的链路的SID为2004::0000。当第一周期值为4时,该中间设备首先将第二检测报文的IPv6报文头中的目的地址字段包括的SID修改为2004::0000。之后,该中间设备基于第一周期值4将目的地址字段包括的SID:2004::0000修改为2004::0004,从而得到第一检测报文。For example, suppose that the SID carried in the destination address field of the IPv6 packet header of the second detection message is 2002::500A, where A is the second periodic value, and the next hop of the intermediate device is the same as the next hop of the intermediate device. The SID of the link between the next hop of the hop is 2004::0000. When the first period value is 4, the intermediate device first modifies the SID included in the destination address field in the IPv6 packet header of the second detection packet to 2004::0000. Afterwards, the intermediate device modifies the SID: 2004::0000 included in the destination address field to 2004::0004 based on the first period value 4, thereby obtaining the first detection packet.
可选地,如果该待检测路径为L3VPN中基于SRv6-TE policy配置的路径,且第二周期值携带在第二检测报文的IPv6扩展头包括的SRH中,则该中间设备首先将第二检测报文中的IPv6报文头中的目的地址字段更新为下一跳与下一跳的下一跳之间的SID或者是尾设备的SID,之后,在该SRH中添加第一周期值,从而得到第一检测报文。Optionally, if the path to be detected is a path configured based on the SRv6-TE policy in the L3VPN, and the second cycle value is carried in the SRH included in the IPv6 extension header of the second detection message, the intermediate device first sends the second The destination address field in the IPv6 packet header in the detection message is updated to the SID between the next hop and the next hop of the next hop or the SID of the tail device, and then add the first period value in the SRH, Thus, the first detection packet is obtained.
需要说明的是,如果第二周期值携带在SRH的SID表中,则该中间设备参考前述实施例中介绍的根据第一周期值对SID进行修改的方式,根据第一周期值对SID表中包含的该中间设备的下一跳与该中间设备的下一跳的下一跳之间的链路SID进行修改,从而得到第一检测报文。It should be noted that if the second period value is carried in the SID table of the SRH, the intermediate device refers to the method of modifying the SID according to the first period value introduced in the foregoing embodiments, and modifies the SID in the SID table according to the first period value. The included SID of the link between the next hop of the intermediate device and the next hop of the next hop of the intermediate device is modified, so as to obtain the first detection message.
例如,假设各个检测报文中的周期值为周期值,第二检测报文的SRH中的SID表中该中间设备与下一跳的SID携带有第二周期值10,该SID为2002::500A,原始配置的SID为2002::5000,该中间设备的下一跳与下一跳的下一跳之间的链路SID为2004::0000,当第一周期值为4时,该中间设备将2004::0000修改为2004::0004,从而得到第一检测报文。For example, assuming that the period value in each detection message is a period value, the SID of the intermediate device and the next hop in the SID table in the SRH of the second detection message carries a second period value of 10, and the SID is 2002:: 500A, the SID of the original configuration is 2002::5000, the SID of the link between the next hop of the intermediate device and the next hop of the next hop is 2004::0000, when the first period value is 4, the intermediate The device modifies 2004::0000 to 2004::0004 to obtain the first detection packet.
可选地,如果该待检测路径为L3VPN中基于SRv6-TE policy配置的路径,且第二周期值携带在第二检测报文的IPv6扩展头包括的逐跳选项头中,则中间设备将第二检测报文的逐跳选项头中包括的第二周期值替换为第一周期值,并对该第二检测报文进行其他转发处理,例如,修改IPv6报文头中的目的地址字段,从而得到第一检测报文。Optionally, if the path to be detected is a path configured based on SRv6-TE policy in L3VPN, and the second period value is carried in the hop-by-hop option header included in the IPv6 extension header of the second detection message, the intermediate device will The second period value included in the hop-by-hop option header of the second detection message is replaced with the first period value, and other forwarding processing is performed on the second detection message, for example, the destination address field in the IPv6 message header is modified, thereby Obtain the first detection packet.
如果待检测路径为L3VPN中基于SR-MPLS配置的路径,且第二周期值携带在第二检测报文的MPLS头包括的该中间设备的MPLS标签中,则该中间设备首先将MPLS头中的最外层MPLS标签弹出,也即,将MPLS头中包含的携带有第二周期值的该中间设备的MPLS标签删除,之后,根据第一周期值对该MPLS头包含的当前的最外层MPLS标签进行修改,也即,根据第一周期值对MPLS头包含的该中间设备的下一跳的MPLS标签进行修改,从而得到第一检测报文。其中,根据第一周期值对MPLS标签进行修改的方式可以参考前述实施例中介绍的相关实现方式,本申请实施例在此不再赘述。If the path to be detected is a path based on SR-MPLS configuration in L3VPN, and the second cycle value is carried in the MPLS label of the intermediate device included in the MPLS header of the second detection message, the intermediate device first uses the Popping the outermost MPLS label, that is, deleting the MPLS label of the intermediate device that carries the second cycle value contained in the MPLS header, and then, according to the first cycle value, the current outermost MPLS label contained in the MPLS header. The label is modified, that is, the MPLS label of the next hop of the intermediate device included in the MPLS header is modified according to the first period value, so as to obtain the first detection message. Wherein, for the manner of modifying the MPLS label according to the first period value, reference may be made to the relevant implementation manners introduced in the foregoing embodiments, and the embodiments of the present application will not repeat them here.
例如,假设第二检测报文的MPLS头中的最外层标签为110,也即,携带有第二周期值的该中间设备的MPLS标签为110,其中,10为第二周期值,则中间设备将该MPLS标签删除,露出下一层标签,也即该中间设备的下一跳的MPLS标签,此时,该中间设备的下一跳的MPLS标签即为最外层MPLS标签。假设该中间设备的下一跳的MPLS标签为200,且第一周期值为4,则该中间设备将当前的最外层MPLS标签200修改为204,从而得到第一检测报文。For example, assuming that the outermost label in the MPLS header of the second detection message is 110, that is, the MPLS label of the intermediate device carrying the second period value is 110, where 10 is the second period value, then the intermediate The device deletes the MPLS label to expose the label of the next layer, that is, the MPLS label of the next hop of the intermediate device. At this time, the MPLS label of the next hop of the intermediate device is the outermost MPLS label. Assuming that the MPLS label of the next hop of the intermediate device is 200, and the first period value is 4, the intermediate device modifies the current outermost MPLS label 200 to 204, thereby obtaining the first detection message.
如果待检测路径为L3VPN中基于SR-MPLS配置的路径,且第二周期值携带在第二检测报文的MPLS扩展头中,则该中间设备可以将第二检测报文的MPLS扩展头携带的第二周期值替换为第一周期值,并对该第二检测报文进行其他的转发处理,例如,弹出MPLS头中的最外层MPLS标签,从而得到第一检测报文。If the path to be detected is a path based on SR-MPLS configuration in L3VPN, and the second period value is carried in the MPLS extension header of the second detection packet, the intermediate device can use the MPLS extension header of the second detection packet to carry the The second period value is replaced with the first period value, and other forwarding processing is performed on the second detection packet, for example, the outermost MPLS label in the MPLS header is popped, so as to obtain the first detection packet.
需要说明的是,在上述介绍的各种基于第一周期值对第二检测报文进行修改以得到第一检测报文的实现方式中,如果第二检测报文中还携带有确定性转发使能标识,则该中间设备可以参考前述实施例介绍的方式,在向第二检测报文添加第一周期值的同时,添加该确定性转发使能标识,以得到第一检测报文。It should be noted that, in the above-mentioned various implementations of modifying the second detection message based on the first period value to obtain the first detection message, if the second detection message also carries a deterministic forwarding can be identified, then the intermediate device can refer to the methods described in the foregoing embodiments, and add the deterministic forwarding enable flag while adding the first period value to the second detection message, so as to obtain the first detection message.
步骤504:通过待检测路径发送第一检测报文。Step 504: Send the first detection packet through the path to be detected.
在获得第一检测报文之后,该中间设备将该第一检测报文添加至第一周期值所指示的目标发送周期对应的发送队列中,并在到达该目标发送周期所对应的发送时间后,向该待检测路径上该中间设备的下一跳发送第一检测报文。相应地,下一跳在接收到该第一检测报文之后,如果下一跳仍为中间设备,则可以参考上述实施例中介绍的中间设备的操作再继续向下一跳发送检测报文,本申请实施例对此不再赘述。After obtaining the first detection message, the intermediate device adds the first detection message to the sending queue corresponding to the target sending period indicated by the first period value, and after reaching the sending time corresponding to the target sending period , sending a first detection packet to the next hop of the intermediate device on the path to be detected. Correspondingly, after the next hop receives the first detection message, if the next hop is still an intermediate device, you can refer to the operation of the intermediate device described in the above embodiment and continue to send the detection message to the next hop, This embodiment of the present application will not describe it in detail.
在本申请实施例中,各个中间设备接收到的第二检测报文中包含有用于指示上一跳发送该第二检测报文的周期的第二周期值,这样各个中间设备能够根据该第二周期值获得第一周期值,并在第一周期值指示的发送周期内向下一跳发送包含了第一周期值的第一检测报文,如此,能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。In this embodiment of the present application, the second detection message received by each intermediate device includes a second period value used to indicate the period for the previous hop to send the second detection message, so that each intermediate device can The period value obtains the first period value, and sends the first detection message containing the first period value to the next hop within the sending period indicated by the first period value, so that the detection message can be controlled to reach the destination within a certain period of time equipment, so that the detection duration of path faults is not affected by network congestion, and the accuracy of path fault detection is improved.
在另一种示例中,当上述图3所示实施例中的网络设备为待检测路径上的尾设备时,例如,该网络设备为图2所示的***架构中的设备205时,则图3所示实施例在图3所示的步骤的基础上还可以继续包括图6所示的流程。图6是本申请实施例提供的又一种路径故障检测方法的流程图,该方法由待检测路径上的尾设备执行,例如,图2所示的***架构中的尾设备,如图6所示,该方法包括以下步骤:In another example, when the network device in the embodiment shown in FIG. 3 is the tail device on the path to be detected, for example, when the network device is device 205 in the system architecture shown in FIG. 2 , then the The embodiment shown in FIG. 3 may further include the process shown in FIG. 6 on the basis of the steps shown in FIG. 3 . Fig. 6 is a flowchart of another path fault detection method provided by the embodiment of the present application, the method is executed by the tail device on the path to be detected, for example, the tail device in the system architecture shown in Fig. 2, as shown in Fig. 6 , the method includes the following steps:
步骤601:接收在待检测路径上沿着第一方向传输至尾设备的第三检测报文。Step 601: Receive a third detection packet transmitted to the tail device along the first direction on the path to be detected.
在本申请实施例中,为了方便说明,将待检测路径上从首设备到尾设备的传输方向称为第一方向,将从尾设备到首设备的传输方向称为第二方向。基于此,尾设备接收沿着第一方向传输到自身的第三检测报文,也即接收第一方向上该尾设备的上一跳发送的第三检测报文,该第三检测报文包括能够指示该尾设备的上一跳发送第三检测报文的周期的第三周期值以及用于检测待检测路径是否故障的检测报文载荷。其中,尾设备的上一跳发送第三检测报文的实现方式可以参考图5所示实施例中介绍的中间设备发送第一检测报文的实现方式,本申请实施例在此不再赘述。In this embodiment of the present application, for convenience of description, the transmission direction from the first device to the last device on the path to be detected is called the first direction, and the transmission direction from the last device to the first device is called the second direction. Based on this, the tail device receives the third detection message transmitted to itself along the first direction, that is, receives the third detection message sent by the previous hop of the tail device in the first direction, and the third detection message includes A third period value capable of indicating the period for sending the third detection packet by the last hop of the tail device and the load of the detection packet used to detect whether the path to be detected is faulty. Wherein, the implementation manner of sending the third detection packet by the last hop of the tail device may refer to the implementation manner of the intermediate device sending the first detection packet introduced in the embodiment shown in FIG.
步骤602:根据第三检测报文获取第一检测报文,该第一检测报文包括第一周期值,该第一周期值用于指示尾设备发送第一检测报文的周期。Step 602: Obtain a first detection packet according to the third detection packet, where the first detection packet includes a first period value, and the first period value is used to indicate a period for the tail device to send the first detection packet.
尾设备在接收到第三检测报文之后,在一种可能的实现方式中,如果首设备和尾设备上配置的是采用双向BFD技术或OAM技术对该待检测路径进行检测,也即,第三检测报文为双向BFD报文或OAM报文,则尾设备可以直接将该第三检测报文作为自身后续判断待检测路径是否故障的依据。除此之外,该尾设备还可以参考前述图4所示的实施例,生成第一检测报文,以作为后续首设备检测待检测路径是否故障的依据。After the tail device receives the third detection message, in a possible implementation, if the head device and the tail device are configured to use bidirectional BFD technology or OAM technology to detect the path to be detected, that is, the first The third detection message is a bidirectional BFD message or an OAM message, and the tail device may directly use the third detection message as a basis for its subsequent determination of whether the path to be detected is faulty. In addition, the tail device may also refer to the embodiment shown in FIG. 4 to generate a first detection message as a basis for the subsequent head device to detect whether the path to be detected is faulty.
示例性地,当首设备与尾设备之间的路径为基于SR-MPLS配置的路径时,可以采用双向BFD技术或者是OAM技术进行路径故障检测。此时,第三检测报文将为双向BFD报文或OAM报文。在这种情况下,尾设备在接收到第三检测报文之后,将第三检测报文的MPLS封装弹掉,获取第三检测报文中包含的检测报文载荷,以便后续基于该检测报文载荷中携带的信息来判断从待检测路径是否故障。之后,尾设备也可以采用前述图4所示实施例介绍的首设备生成检测报文的方式,构造第一检测报文。Exemplarily, when the path between the head device and the tail device is a path configured based on SR-MPLS, a bidirectional BFD technology or an OAM technology may be used for path fault detection. At this time, the third detection message is a bidirectional BFD message or an OAM message. In this case, after receiving the third detection message, the tail device pops off the MPLS encapsulation of the third detection message, and obtains the detection message load contained in the third detection message, so that the subsequent The information carried in the payload is used to judge whether the path to be detected is faulty or not. Afterwards, the tail device may also construct the first detection message in the way that the head device generates the detection message introduced in the embodiment shown in FIG. 4 above.
在另一种可能的实现方式中,首设备和尾设备上被配置为采用SBFD或单臂BFD技术进行路径故障检测,例如,当首设备和尾设备之间的路径为基于SR-TE policy配置的路径,则可以采用SBFD或单臂BFD技术来检测路径是否故障,此时,该第三检测报文为SBFD报文或单臂BFD报文。在这种情况下,尾设备在接收到第三检测报文之后,获取第三检测报文的IPv6报文头或IPv6扩展头或MPLS头或MPLS扩展头中携带的第三周期值。之后,根据第三周期值确定第一周期值,进而根据第一周期值和第三检测报文获取第一检测报文。In another possible implementation, the head device and the tail device are configured to use SBFD or single-arm BFD technology for path fault detection. For example, when the path between the head device and the tail device is configured based on SR-TE policy path, the SBFD or single-arm BFD technology may be used to detect whether the path is faulty. At this time, the third detection message is an SBFD message or a single-arm BFD message. In this case, after receiving the third detection message, the tail device acquires the third period value carried in the IPv6 header or IPv6 extension header or MPLS header or MPLS extension header of the third detection message. Afterwards, the first period value is determined according to the third period value, and then the first detection message is obtained according to the first period value and the third detection message.
其中,尾设备根据第三周期值获取第一周期值的实现方式参考前述实施例中步骤502所介绍的根据第二周期值获取第一周期值的实现方式,本申请实施例在此不再赘述。Wherein, the implementation method of the tail device obtaining the first period value according to the third period value refers to the implementation method of obtaining the first period value according to the second period value introduced in step 502 in the previous embodiment, and the embodiment of the present application will not go into details here. .
在获得第一周期值之后,如果第三检测报文为SBFD报文,则尾设备弹掉第三检测报文的外层的SRv6封装或MPLS封装,获得第三检测报文包括的检测报文载荷。之后,尾设备根据获得该检测报文载荷获得反向检测报文载荷,进而根据该反向检测报文载荷和第一周期值,生成第一检测报文。After obtaining the first period value, if the third detection message is an SBFD message, the tail device bounces off the outer SRv6 encapsulation or MPLS encapsulation of the third detection message, and obtains the detection message included in the third detection message load. Afterwards, the tail device obtains the payload of the reverse detection packet according to the payload of the detection packet, and then generates the first detection packet according to the payload of the reverse detection packet and the first period value.
需要说明的是,尾设备中存储有BFD反射表,该BFD反射表中包含有尾设备的鉴别符以及对应的反向检测报文载荷模板,尾设备可以将第三检测报文中包含的检测报文载荷中的对端鉴别符(your discriminator,YD)与自身保存的该尾设备的鉴别符进行比较,如果二者匹配,则尾设备获取保存的反向检测报文载荷模板,并根据该反向检测报文载荷模板生成反向检测报文载荷。It should be noted that a BFD reflection table is stored in the tail device, and the BFD reflection table includes the discriminator of the tail device and the corresponding reverse detection packet payload template. The peer discriminator (your discriminator, YD) in the message payload is compared with the discriminator of the tail device saved by itself. If the two match, the tail device obtains the saved reverse detection message load template, and according to the The reverse detection packet payload template generates the reverse detection packet payload.
在获得反向检测报文载荷之后,尾设备基于该反向检测报文载荷和第一周期值,生成第一检测报文,并向该待检测路径上该尾设备的下一跳发送第一检测报文。After obtaining the payload of the reverse detection packet, the tail device generates a first detection packet based on the payload of the reverse detection packet and the first cycle value, and sends a first detection packet to the next hop of the tail device on the path to be detected. Detect packets.
其中,尾设备可以参考前述实施例中步骤401首设备基于检测报文载荷和第一周期值生成第一检测报文的方式,基于该反向检测报文载荷、第一周期值和检测报文沿着第二方向向首设备传输时所途经的各个网络设备生成第一检测报文,本申请实施例在此不再赘述。Wherein, the tail device can refer to the way in step 401 in the foregoing embodiment that the first device generates the first detection message based on the detection message load and the first period value, and based on the reverse detection message load, the first period value and the detection message Each network device passing along the second direction when transmitting to the first device generates the first detection message, which will not be described again in this embodiment of the present application.
可选地,如果第三检测报文为单臂BFD报文,则该单臂BFD报文中的SID表或MPLSSID表中不仅包含有在待检测路径上沿着第一方向传输检测报文时所途经的链路或设备的SID或MPLS标签,还包含有在该待检测路径上沿着第二方向传输检测报文时所途经的链路或设备的SID或MPLS标签。例如,首设备为A,中间设备为B,尾设备为C,且第三检测报文中包含有MPLS SID表,则该第三检测报文的MPLS SID表从外层到内层的MPLS标签将依次为设备B的MPLS标签,设备C的MPLS标签,设备B的MPLS标签,设备A的MPLS标签。在这种情况下,尾设备在接收到第三检测报文之后,可以参考前述图4所示的实施例中中间设备的操作,基于第一周期值对该第三检测报文进行修改,从而得到第一检测报文。Optionally, if the third detection message is a one-arm BFD message, the SID table or MPLSSID table in the one-arm BFD message not only contains The SID or MPLS label of the passed link or device also includes the SID or MPLS label of the passed link or device when the detection message is transmitted along the second direction on the path to be detected. For example, the first device is A, the intermediate device is B, and the tail device is C, and the third detection message contains an MPLS SID table, then the MPLS SID table of the third detection message is from the outer layer to the inner layer of the MPLS label The MPLS label of device B, the MPLS label of device C, the MPLS label of device B, and the MPLS label of device A will be in sequence. In this case, after the tail device receives the third detection message, it can refer to the operation of the intermediate device in the embodiment shown in Figure 4 above, and modify the third detection message based on the first cycle value, so that Obtain the first detection packet.
步骤603:在待检测路径上沿着第二方向发送第一检测报文。Step 603: Send the first detection packet along the second direction on the path to be detected.
在获得第一检测报文之后,尾设备将该第一检测报文添加至第一周期值所指示的目标发送周期所对应的发送队列中,并在到达该该目标发送周期对应的发送时间后向待检测路径上沿着第二方向上该尾设备的下一跳发送该第一检测报文。后续,待检测路径上该尾设备之后的各个网络设备即可以参考前述介绍的方式进行检测报文传输,直至将检测报文传输至首设备为止,该首设备可以将接收到的检测报文作为后续判定该待检测路径是否故障的依据。After obtaining the first detection message, the tail device adds the first detection message to the sending queue corresponding to the target sending period indicated by the first period value, and after reaching the sending time corresponding to the target sending period Sending the first detection packet to the next hop of the tail device along the second direction on the path to be detected. Subsequently, each network device after the tail device on the path to be detected can refer to the method described above to transmit the detection packet until the detection packet is transmitted to the first device, and the first device can use the received detection packet as a Subsequent basis for determining whether the path to be detected is faulty.
在本申请实施例中,尾设备接收到在待检测路径的第一方向上的上一跳发送的第三检测报文之后,能够基于第三检测报文中包含的用于指示该第三检测报文的发送周期的第三周期值获得第一周期值,并在第一周期值所指示的发送周期内沿着第一方向的反方向向自身的下一跳发送包含有第一周期值的检测报文。这样,该尾设备的下一跳在接收到该检测报文之后,即能够基于该检测报文中的第一周期值确定自身发送检测报文的周期,并按照确定的发送周期发送检测报文,这样,即能够控制该检测报文在确定的时长内到达首设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。In this embodiment of the application, after receiving the third detection packet sent by the previous hop in the first direction of the path to be detected, the tail device can indicate the third detection packet based on the information contained in the third detection packet. The third period value of the sending period of the message obtains the first period value, and sends a message containing the first period value to its own next hop along the opposite direction of the first direction within the sending period indicated by the first period value Detect packets. In this way, after receiving the detection message, the next hop of the tail device can determine the cycle for sending the detection message based on the first period value in the detection message, and send the detection message according to the determined sending cycle In this way, the detection message can be controlled to arrive at the first device within a certain period of time, so that the detection period of the path fault is not affected by network congestion, and the accuracy of path fault detection is improved.
接下来以本申请实施例提供的路径故障检测方法应用于两种不同场景下为例,对该路径故障检测方法进行示例性说明。Next, taking the path fault detection method provided by the embodiment of the present application applied to two different scenarios as an example, the path fault detection method will be exemplarily described.
示例性地,待检测路径为图7所示的路径A-B-C,该待检测路径为基于SRv6-TE policy配置的路径,且采用SBFD技术对该待检测路径进行故障检测。其中,在路径A-B-C中,为设备B和C之间的链路分配的SID为2002::5000,为设备C分配的SID为2004::0000。在待检测路径的反向路径C-B-A中,为设备B和设备A之间的链路分配的SID为2002::4000,为设备A分配的SID为2001::0000。参见图8,该路径故障检测方法包括以下步骤:Exemplarily, the path to be detected is the path A-B-C shown in FIG. 7 , the path to be detected is a path configured based on the SRv6-TE policy, and the SBFD technology is used to perform fault detection on the path to be detected. Wherein, in path A-B-C, the SID allocated to the link between devices B and C is 2002::5000, and the SID allocated to device C is 2004::0000. In the reverse path C-B-A of the path to be detected, the SID allocated to the link between device B and device A is 2002::4000, and the SID allocated to device A is 2001::0000. Referring to Figure 8, the path fault detection method includes the following steps:
步骤801:设备A发送检测报文1,该检测报文1包括BFD报文载荷和第一周期值。Step 801: Device A sends a detection packet 1, where the detection packet 1 includes a BFD packet payload and a first period value.
假设设备A预期发送检测报文1的时间为09:10:12.120100,设备A根据该预期发送时间,确定出该预期发送时间所处的发送周期对应的周期值为10,假设周期值范围为0-15,则设备A将计算得到的周期值作为第一周期值。之后,设备A生成BFD报文载荷,并在BFD报文载荷的外层依次封装UDP报文头、IPv4报文头、IPv6扩展头、IPv6报文头和二层报文头。其中,在IPv6报文头的目的地址字段携带有设备B和设备C之间的链路的SID,也即 2002::5000。IPv6扩展头包括SRH,在SRH中封装有SID表,在该SID表中,从前往后,SID分别为2004::0000,2002::5000。Assume that device A expects to send the detection message 1 at 09:10:12.120100. According to the expected sending time, device A determines that the period value corresponding to the sending period of the expected sending time is 10, assuming that the period value range is 0 -15, device A uses the calculated period value as the first period value. Afterwards, device A generates the BFD packet payload, and encapsulates the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header in sequence on the outer layer of the BFD packet payload. Wherein, the destination address field of the IPv6 packet header carries the SID of the link between device B and device C, that is, 2002::5000. The IPv6 extension header includes SRH, and a SID table is encapsulated in the SRH. In the SID table, the SIDs are 2004::0000 and 2002::5000 from the front to the back.
设备A将第一周期值转换为16进制数字,得到A,将IPv6报文头的目的地址字段中的SID修改为2002::501A,从而得到检测报文1,此时,检测报文1中的IPv6报文头的目的地址字段以及SRH中的SID列表如图7中所示。其中,01A中的1为确定性转发使能标识,用于指示该检测报文携带有周期值,A即为第一周期值。Device A converts the first period value into a hexadecimal number to obtain A, and modifies the SID in the destination address field of the IPv6 packet header to 2002::501A to obtain detection packet 1. At this time, detection packet 1 The destination address field of the IPv6 message header in and the SID list in the SRH are shown in Figure 7. Wherein, 1 in 01A is a deterministic forwarding enable flag, which is used to indicate that the detection message carries a period value, and A is the first period value.
之后,设备A将检测报文1添加至第一周期值所指示的发送周期对应的发送队列,并在到达发送时间之后,向设备B发送该检测报文1。Afterwards, the device A adds the detection message 1 to the sending queue corresponding to the sending period indicated by the first period value, and sends the detection message 1 to the device B after the sending time is reached.
步骤802:设备B根据检测报文1中的第一周期值获得第二周期值。Step 802: Device B obtains the second period value according to the first period value in the detection message 1.
设备B在接收到检测报文1之后,根据检测报文1的入接口,从预先存储的入接口与周期差值的映射关系中获取检测报文1的入接口对应的周期差值,例如,获得的周期差值为4。设备B根据第一周期值10和周期差值4,计算得到第二周期值为14。After receiving the detection message 1, device B obtains the cycle difference corresponding to the incoming interface of the detection message 1 from the pre-stored mapping relationship between the incoming interface and the cycle difference according to the incoming interface of the detection message 1, for example, The obtained period difference is 4. Device B calculates the second period value to be 14 according to the first period value of 10 and the period difference value of 4.
步骤803:设备B发送检测报文2,该检测报文2包括BFD报文载荷和第二周期值。Step 803: Device B sends a detection packet 2, where the detection packet 2 includes a BFD packet payload and a second period value.
在获得第二周期值之后,设备B将该第二周期值转换为16进制数字,得到E。然后将检测报文1的IPv6报文头的目的地址字段中的SID修改为设备C的SID,也即修改为2004::0000。之后,根据第二周期值,将该SID再修改为2004::001E,从而得到检测报文2,此时,检测报文2中的IPv6报文头的目的地址字段以及SRH中的SID列表如图7中所示。其中,01E中的1为确定性转发使能标识,E为第二周期值。After obtaining the second period value, device B converts the second period value into a hexadecimal number to obtain E. Then modify the SID in the destination address field of the IPv6 packet header of the detection message 1 to the SID of device C, that is, to 2004::0000. Afterwards, according to the second cycle value, the SID is modified to 2004::001E again, thereby obtaining the detection message 2. At this time, the destination address field of the IPv6 message header in the detection message 2 and the SID list in the SRH are as follows: shown in Figure 7. Wherein, 1 in 01E is a deterministic forwarding enabling flag, and E is a second cycle value.
在获得检测报文2之后,设备B将该检测报文2添加至第二周期值所指示的发送周期对应的发送队列中,并在到达第二周期值所指示的发送周期所对应的发送时间后,发送该检测报文2。After obtaining the detection message 2, device B adds the detection message 2 to the sending queue corresponding to the sending period indicated by the second period value, and when the sending time corresponding to the sending period indicated by the second period value is reached, After that, the detection message 2 is sent.
步骤804:设备C根据检测报文2中的第二周期值获得第三周期值,根据BFD报文载荷获得反向BFD报文载荷。Step 804: Device C obtains the third period value according to the second period value in the detection message 2, and obtains the reverse BFD packet payload according to the BFD packet payload.
设备C在接收到设备B发送的检测报文2之后,从检测报文2的IPv6报文头中获取第二周期值,并根据检测报文2的入接口获取对应的周期差值,例如,该周期差值为4。设备C根据第二周期值14和该周期差值4,计算得到的周期值为18,由于该周期值已经超出周期值范围,所以,将该周期值除以发送周期的个数16,得到余数2,将该余数作为第三周期值。After receiving the detection message 2 sent by device B, device C obtains the second cycle value from the IPv6 packet header of the detection message 2, and obtains the corresponding cycle difference according to the incoming interface of the detection message 2, for example, The period difference is 4. Device C calculates a period value of 18 based on the second period value 14 and the period difference value 4. Since the period value has exceeded the period value range, it divides the period value by the number of sending periods 16 to obtain the remainder 2. Use the remainder as the third period value.
在获得第三周期值之后,设备C将检测报文2的SRv6封装去掉,从而得到BFD报文载荷,根据该BFD报文载荷中携带的信息和自身存储的BFD反射表,获得反向BFD报文载荷。After obtaining the third cycle value, device C removes the SRv6 encapsulation of detection packet 2 to obtain the BFD packet payload, and obtains the reverse BFD packet according to the information carried in the BFD packet payload and the BFD reflection table stored by itself. text payload.
步骤805:设备C发送检测报文3,该检测报文3包括第三周期值和反向BFD报文载荷。Step 805: Device C sends a detection packet 3, where the detection packet 3 includes a third period value and a reverse BFD packet payload.
在获得第三周期值和反向BFD报文载荷之后,设备C在反向BFD报文载荷的外层依次封装UDP报文头、IPv4报文头、IPv6扩展头、IPv6报文头和二层报文头。其中,在IPv6报文头的目的地址字段携带有设备B和设备A之间的链路的SID,也即2002::4000。IPv6扩展头包括SRH,在SRH中封装有SID表,在该SID表中,从前往后,SID分别为2001::1000,2002::4000。After obtaining the third cycle value and the reverse BFD packet payload, device C encapsulates the UDP packet header, IPv4 packet header, IPv6 extension header, IPv6 packet header, and Layer 2 packet header. Wherein, the destination address field of the IPv6 message header carries the SID of the link between device B and device A, that is, 2002::4000. The IPv6 extension header includes SRH, and a SID table is encapsulated in the SRH. In the SID table, the SIDs are 2001::1000 and 2002::4000 from the front to the back.
之后,设备C根据第三周期值将IPv6报文头的目的地址字段中的SID修改为2002::4012,从而得到检测报文3,此时,检测报文3中的IPv6报文头的目的地址字段以及SRH中的SID列表如图7中所示。将该检测报文3添加至第三周期值所指示的发送周期对应的发送队列, 并在到达发送时间时向设备B发送该检测报文3。Afterwards, device C modifies the SID in the destination address field of the IPv6 packet header to 2002::4012 according to the third cycle value, thereby obtaining the detection packet 3. At this time, the purpose of the IPv6 packet header in the detection packet 3 is The address fields and the list of SIDs in the SRH are shown in Figure 7. The detection message 3 is added to the sending queue corresponding to the sending cycle indicated by the third cycle value, and the detection message 3 is sent to the device B when the sending time is reached.
步骤806:设备B根据检测报文3中的第三周期值获得第四周期值。Step 806: Device B obtains the fourth period value according to the third period value in the detection packet 3.
本步骤的实现方式参考步骤702。For the implementation of this step, refer to step 702.
步骤807:设备B发送检测报文4,该检测报文4包括反向BFD报文载荷和第四周期值。Step 807: Device B sends a detection packet 4, where the detection packet 4 includes a reverse BFD packet payload and a fourth period value.
本步骤的实现方式参考步骤703。For the implementation of this step, refer to step 703.
步骤808:设备A基于检测报文4判断待检测路径是否故障。Step 808: Device A determines whether the path to be detected is faulty based on the detection message 4.
设备A在接收到检测报文4之后,将检测报文4的外层封装去掉,获得反向BFD报文载荷,之后,将该反向BFD报文载荷中包括的信息作为后续判断待检测路径是否故障的依据。After receiving the detection packet 4, device A removes the outer encapsulation of the detection packet 4 to obtain the payload of the reverse BFD packet, and then uses the information included in the payload of the reverse BFD packet as the subsequent determination of the path to be detected basis for failure.
示例性地,待检测路径为图9所示的路径A-B-C,该待检测路径为基于SRv6-MPLS配置的路径,且采用双向BFD技术对该待检测路径进行故障检测。其中,在路径A-B-C中,为设备B分配的MPLS标签为100,为设备C分配的MPLS标签为200。参见图10,该路径故障检测方法包括以下步骤:Exemplarily, the path to be detected is the path A-B-C shown in FIG. 9 , the path to be detected is a path configured based on SRv6-MPLS, and the bidirectional BFD technology is used to perform fault detection on the path to be detected. Wherein, in path A-B-C, the MPLS label allocated to device B is 100, and the MPLS label allocated to device C is 200. Referring to Figure 10, the path fault detection method includes the following steps:
步骤1001:设备A发送检测报文1,该检测报文1包括BFD报文载荷和第一周期值。Step 1001: Device A sends a detection message 1, where the detection message 1 includes a BFD message payload and a first period value.
假设设备A预期发送检测报文1的时间为09:10:12.120100,设备A根据该预期发送时间,获得周期值为10,假设周期值范围为1-10,则设备A将获得的周期值作为第一周期值。之后,设备A生成BFD报文载荷,并在BFD报文载荷的外层依次封装UDP报文头、IPv4报文头、MPLS头和二层报文头。其中,MPLS头的MPLS SID表中包括多层MPLS标签,该多层MPLS标签从里到外依次为200、100。设备A将最外层MPLS标签,也即设备B的MPLS标签修改为110,从而得到检测报文1。此时,检测报文1的MPLS SID表如图9所示。之后,设备A将检测报文1添加至第一周期值所指示的发送周期对应的发送队列,并在到达发送时间之后,向设备B发送该检测报文1。Assume that device A expects to send detection message 1 at 09:10:12.120100, and device A obtains a period value of 10 based on the expected transmission time. Assuming that the period value ranges from 1 to 10, device A will obtain the period value as first cycle value. Afterwards, device A generates the BFD packet payload, and encapsulates the UDP packet header, IPv4 packet header, MPLS header, and Layer 2 packet header in sequence on the outer layer of the BFD packet payload. Wherein, the MPLS SID table of the MPLS header includes multi-layer MPLS labels, and the multi-layer MPLS labels are 200 and 100 from the inside to the outside. Device A modifies the outermost MPLS label, that is, the MPLS label of device B, to 110, thereby obtaining detection packet 1. At this time, the MPLS SID table of detection message 1 is shown in Figure 9. Afterwards, the device A adds the detection message 1 to the sending queue corresponding to the sending period indicated by the first period value, and sends the detection message 1 to the device B after the sending time is reached.
步骤1002:设备B根据检测报文1中的第一周期值获得第二周期值。Step 1002: Device B obtains the second period value according to the first period value in the detection message 1.
本步骤的实现方式参考前述实施例中的步骤802。For an implementation manner of this step, refer to step 802 in the foregoing embodiments.
步骤1003:设备B发送检测报文2,该检测报文2包括BFD报文载荷和第二周期值。Step 1003: Device B sends a detection packet 2, where the detection packet 2 includes a BFD packet payload and a second period value.
设备B在获得第二周期值之后,将检测报文1的MPLS SID表中的最外层MPLS标签去掉,露出内层MPLS标签200。假设第二周期值为7,则设备B将该MPLS标签200修改为207,从而得到检测报文2。此时,检测报文2的MPLS SID表如图9所示。After obtaining the second period value, device B removes the outermost MPLS label in the MPLS SID table of the detection message 1, exposing the inner MPLS label 200. Assuming that the second period value is 7, device B modifies the MPLS label 200 to 207, thereby obtaining detection packet 2. At this time, the MPLS SID table of the detection message 2 is shown in Figure 9.
在获得检测报文2之后,设备B将该检测报文2添加至第二周期值所指示的发送周期对应的发送队列中,并在到达第二周期值所指示发送周期对应的发送时间后,发送该检测报文2。After obtaining the detection message 2, the device B adds the detection message 2 to the sending queue corresponding to the sending period indicated by the second period value, and after reaching the sending time corresponding to the sending period indicated by the second period value, The detection message 2 is sent.
步骤1004:设备C基于检测报文2判断待检测路径是否故障。Step 1004: Device C determines whether the path to be detected is faulty based on the detection message 2.
设备C在接收到检测报文2之后,将检测报文2的外层封装去掉,获得BFD报文载荷,之后,将该BFD报文载荷作为后续判断待检测路径是否故障的依据。After receiving the detection packet 2, the device C removes the outer encapsulation of the detection packet 2 to obtain the BFD packet payload, and then uses the BFD packet payload as a basis for subsequently judging whether the path to be detected is faulty.
综上可见,在本申请实施例中,待检测路径上的各个网络设备发送的检测报文包括能够指示网络设备发送该检测报文的周期的周期值,这样,接收到该检测报文的设备能够根据上一跳发送检测报文的周期确定自身发送检测报文的周期,如此,即能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。并且,由于本申请实施例可以通过携带周期值来控制待检测路径上的各个 网络设备发送检测报文的时间,所以,本申请实施例能够控制缩小检测报文在待检测路径上传输时的时延抖动,这样,设置的路径故障检测周期的时长也可以相应地缩短,从而使得故障被检测到所需的时长也会缩短。例如,通过本申请实施例将检测报文在待检测路径上传输时的时延抖动控制在100微秒内,此时,则可以将SBFD的检测周期缩短为300微秒,这样,当检测端连续三个检测周期也即900微秒内未能收到BFD报文时,即能够确定检测到故障,大大缩短了故障被检测到所需的时长。To sum up, in the embodiment of the present application, the detection message sent by each network device on the path to be detected includes a period value that can indicate the cycle of the network device sending the detection message, so that the device that receives the detection message It can determine the cycle of sending detection messages by itself according to the cycle of sending detection messages from the previous hop. In this way, it can control the detection messages to reach the destination device within a certain period of time, so that the detection time of path faults will not be affected by network congestion. , which improves the accuracy of path fault detection. Moreover, since the embodiment of the present application can control the time at which each network device on the path to be detected sends a detection message by carrying a period value, the embodiment of the present application can control the time at which the detection message is transmitted on the path to be detected. In this way, the duration of the set path fault detection cycle can also be shortened correspondingly, so that the time required for the fault to be detected will also be shortened. For example, through the embodiment of the present application, the time delay jitter when the detection message is transmitted on the path to be detected is controlled within 100 microseconds. At this time, the detection cycle of SBFD can be shortened to 300 microseconds. In this way, when the detection end When the BFD message is not received within 900 microseconds for three consecutive detection periods, it can be determined that a fault is detected, which greatly shortens the time required for the fault to be detected.
需要说明的是,上述各个实施例中各个检测报文中携带的周期值还可以为一个绝对时间,例如,为相应地检测报文的发送时间。在这种情况下,同样可以参考上述方式来实现检测报文的转发,以控制检测报文在确定的时长内到达目的设备。It should be noted that the period value carried in each detection message in the foregoing embodiments may also be an absolute time, for example, the sending time of the corresponding detection message. In this case, the above method can also be referred to to realize the forwarding of the detection message, so as to control the detection message to reach the destination device within a certain period of time.
参见图11,本申请实施例提供了一种路径故障检测装置1100,该装置1100包括获取模块1101和发送模块1102。Referring to FIG. 11 , an embodiment of the present application provides a path fault detection device 1100 , and the device 1100 includes an acquiring module 1101 and a sending module 1102 .
其中,获取模块1101用于执行上述实施例中的步骤301;在一些示例中,获取模块1101用于执行上述实施例中的步骤401或步骤501至503或步骤601至602。Wherein, the obtaining module 1101 is configured to execute step 301 in the above embodiment; in some examples, the obtaining module 1101 is configured to execute step 401 or steps 501 to 503 or steps 601 to 602 in the above embodiment.
发送模块1102用于执行上述实施例中的步骤302。在一些示例中,该发送模块1102用于执行上述实施例中的步骤402或504或603。The sending module 1102 is configured to execute step 302 in the above embodiment. In some examples, the sending module 1102 is configured to execute step 402 or 504 or 603 in the foregoing embodiments.
可选地,该装置1100还包括确定模块(图中未示出),该确定模块用于根据网络设备预期发送第一检测报文的时间确定该第一检测报文在多个发送周期中所属的目标发送周期,其中,该多个发送周期为预先设置的。Optionally, the apparatus 1100 further includes a determination module (not shown in the figure), which is configured to determine the time the first detection message belongs to in multiple sending cycles according to the time when the network device expects to send the first detection message. target sending periods, wherein the multiple sending periods are preset.
可选地,该装置1100还包括:接收模块和确定模块;其中,接收模块,用于接收第二检测报文,第二检测报文包括第二周期值,第二周期值指示在待检测路径上网络设备的上一跳设备发送第二检测报文的周期;确定模块,用于根据第二周期值和多个发送周期,确定第一周期值;获取模块,用于根据第二检测报文和第一周期值,获得第一检测报文。Optionally, the apparatus 1100 further includes: a receiving module and a determining module; wherein the receiving module is configured to receive a second detection message, the second detection message includes a second cycle value, and the second cycle value indicates The last hop device of the upper network device sends the cycle of the second detection message; the determination module is used to determine the first cycle value according to the second cycle value and multiple sending cycles; the acquisition module is used to determine the first cycle value according to the second detection message and the first period value to obtain the first detection packet.
在一些示例中,确定模块主要用于:确定网络设备与上一跳设备发送检测报文的周期差值;根据周期差值、第二周期值和多个发送周期,获得第一周期值。In some examples, the determination module is mainly used to: determine the period difference between the network device and the previous hop device for sending detection packets; obtain the first period value according to the period difference, the second period value and multiple sending periods.
可选地,第一周期值携带在第一检测报文的基于第6代互联网协议IPv6报文头或IPv6扩展头或多协议标签交换MPLS头或MPLS扩展头中。其中,第一周期值携带在第一检测报文的IPv6报文头的目的地址字段中。或者,IPv6扩展头为分段路由头SRH,第一周期值携带在第一检测报文的SRH的类型长度值TLV字段或分段路由标识SID中;或者,IPv6扩展头为逐跳选项头,第一周期值携带在逐跳选项头中。或者,第一周期值携带在MPLS头包括的MPLS标签中。Optionally, the first period value is carried in the IPv6-based packet header or IPv6 extension header or Multi-Protocol Label Switching MPLS header or MPLS extension header of the first detection message. Wherein, the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet. Or, the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or the segment routing identifier SID of the first detection message; or, the IPv6 extension header is a hop-by-hop option header, The first period value is carried in the hop-by-hop option header. Alternatively, the first period value is carried in the MPLS label included in the MPLS header.
可选地,第一检测报文为双向转发检测BFD报文,或者,第一检测报文为操作维护管理OAM报文。Optionally, the first detection packet is a bidirectional forwarding detection BFD packet, or the first detection packet is an OAM packet.
综上所述,在本申请实施例中,待检测路径上的各个网络设备发送的检测报文包括能够指示网络设备发送该检测报文的周期的周期值,这样,接收到该检测报文的设备能够根据上一跳发送检测报文的周期确定自身发送检测报文的周期,如此,即能够控制检测报文在确定的时长内到达目的设备,从而使得路径故障的检测时长不受网络拥塞的影响,提高了路径故障检测的准确率。并且,由于本申请实施例可以通过携带周期值来控制待检测路径上的各个网络设备发送检测报文的时间,所以,本申请实施例能够控制缩小检测报文在待检测路径上 传输时的时延抖动,这样,设置的路径故障检测周期的时长也可以相应地缩短,从而使得故障被检测到所需的时长也会缩短。To sum up, in the embodiment of the present application, the detection message sent by each network device on the path to be detected includes a period value that can indicate the cycle of the network device sending the detection message, so that the The device can determine the cycle of sending the detection message according to the cycle of sending the detection message by the previous hop. In this way, the detection message can be controlled to reach the destination device within a certain period of time, so that the detection time of the path fault is not affected by the network congestion. Influence, improve the accuracy of path fault detection. Moreover, since the embodiment of the present application can control the time at which each network device on the path to be detected sends a detection message by carrying a period value, the embodiment of the present application can control the time at which the detection message is transmitted on the path to be detected. In this way, the duration of the set path fault detection cycle can also be shortened correspondingly, so that the time required for the fault to be detected will also be shortened.
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时也可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成为一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of the modules in the embodiment of the present application is schematic, and it is only a logical function division. In actual implementation, there may be other division methods. In addition, each functional module in each embodiment of the present application can be integrated into one In the processor, it may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台网络设备(可以是路由器或者交换机等)或处理器(processor)执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage The medium includes several instructions for enabling a network device (which may be a router or a switch) or a processor (processor) to execute all or part of the steps of the method in various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
需要说明的是:上述实施例提供的路径故障检测装置在进行路径故障检测时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的路径故障检测装置与路径故障检测方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the path fault detection device provided in the above-mentioned embodiments performs path fault detection, the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as required. Completion means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the path fault detection device and the path fault detection method embodiments provided in the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
参见图12,图12示出了本申请一个示例性实施例提供的网络设备1200的结构示意图。图12所示的网络设备1200用于执行上述图3或图4或图5或图6或图8或图10所示的路径故障检测方法所涉及的操作。该网络设备1200例如是交换机、路由器等,该网络设备1200可以由一般性的总线体系结构来实现。Referring to FIG. 12 , FIG. 12 shows a schematic structural diagram of a network device 1200 provided by an exemplary embodiment of the present application. The network device 1200 shown in FIG. 12 is configured to perform the operations involved in the path failure detection method shown in FIG. 3 or FIG. 4 or FIG. 5 or FIG. 6 or FIG. 8 or FIG. 10 . The network device 1200 is, for example, a switch, a router, etc., and the network device 1200 may be implemented by a general bus architecture.
如图12所示,网络设备1200包括至少一个处理器1201、存储器1203以及至少一个通信接口1204。As shown in FIG. 12 , a network device 1200 includes at least one processor 1201 , a memory 1203 and at least one communication interface 1204 .
处理器1201例如是通用中央处理器(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、网络处理器(network processer,NP)、图形处理器(Graphics Processing Unit,GPU)、神经网络处理器(neural-network processing units,NPU)、数据处理单元(Data Processing Unit,DPU)、微处理器或者一个或多个用于实现本申请方案的集成电路。例如,处理器1201包括专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。PLD例如是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。其可以实现或执行结合本发明实施例公开内容所描述的各种逻辑方框、模块和电路。所述处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合,DSP和微处理器的组合等等。The processor 1201 is, for example, a general-purpose central processing unit (central processing unit, CPU), a digital signal processor (digital signal processor, DSP), a network processor (network processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), A neural network processor (neural-network processing units, NPU), a data processing unit (Data Processing Unit, DPU), a microprocessor, or one or more integrated circuits for implementing the solution of this application. For example, the processor 1201 includes an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The PLD is, for example, a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof. It can realize or execute various logical blocks, modules and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor may also be a combination that implements computing functions, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
可选的,网络设备1200还包括总线。总线用于在网络设备1200的各组件之间传送信息。总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总 线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Optionally, the network device 1200 further includes a bus. The bus is used to transfer information between the various components of the network device 1200 . The bus may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 12 , but it does not mean that there is only one bus or one type of bus.
存储器1203例如是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,又如是随机存取存储器(random access memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,又如是电可擦可编程只读存储器(electrically erasable programmable read-only Memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器1203例如是独立存在,并通过总线与处理器1201相连接。存储器1203也可以和处理器1201集成在一起。The memory 1203 is, for example, a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (random access memory, RAM) or a memory that can store information and instructions. Other types of dynamic storage devices, such as electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc Storage (including Compact Disc, Laser Disc, Optical Disc, Digital Versatile Disc, Blu-ray Disc, etc.), magnetic disk storage medium, or other magnetic storage device, or is capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other medium accessed by a computer, but not limited to. The memory 1203 exists independently, for example, and is connected to the processor 1201 through a bus. The memory 1203 can also be integrated with the processor 1201.
通信接口1204使用任何收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(RAN)或无线局域网(wireless local area networks,WLAN)等。通信接口1204可以包括有线通信接口,还可以包括无线通信接口。具体的,通信接口1204可以为以太(Ethernet)接口、快速以太(Fast Ethernet,FE)接口、千兆以太(Gigabit Ethernet,GE)接口,异步传输模式(Asynchronous Transfer Mode,ATM)接口,无线局域网(wireless local area networks,WLAN)接口,蜂窝网络通信接口或其组合。以太网接口可以是光接口,电接口或其组合。在本申请实施例中,通信接口1204可以用于网络设备1200与其他设备进行通信。The communication interface 1204 uses any device such as a transceiver for communicating with other devices or a communication network. The communication network can be Ethernet, radio access network (RAN) or wireless local area networks (wireless local area networks, WLAN). The communication interface 1204 may include a wired communication interface, and may also include a wireless communication interface. Specifically, the communication interface 1204 can be an Ethernet (Ethernet) interface, a Fast Ethernet (Fast Ethernet, FE) interface, a Gigabit Ethernet (Gigabit Ethernet, GE) interface, an asynchronous transfer mode (Asynchronous Transfer Mode, ATM) interface, a wireless local area network ( wireless local area networks, WLAN) interface, cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In this embodiment of the application, the communication interface 1204 may be used for the network device 1200 to communicate with other devices.
在具体实现中,作为一种实施例,处理器1201可以包括一个或多个CPU,如图12中所示的CPU0和CPU1。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the processor 1201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 12 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,网络设备1200可以包括多个处理器,如图12中所示的处理器1201和处理器1205。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the network device 1200 may include multiple processors, such as the processor 1201 and the processor 1205 shown in FIG. 12 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data such as computer program instructions.
在具体实现中,作为一种实施例,网络设备1200还可以包括输出设备和输入设备。输出设备和处理器1201通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(liquid crystal display,LCD)、发光二极管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备和处理器1201通信,可以以多种方式接收用户的输入。例如,输入设备可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an example, the network device 1200 may further include an output device and an input device. Output devices are in communication with processor 1201 and can display information in a variety of ways. For example, the output device may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector). The input device communicates with the processor 1201 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
在一些实施例中,存储器1203用于存储执行本申请方案的程序代码1206,处理器1201可以执行存储器1203中存储的程序代码1206。也即是,网络设备1200可以通过处理器1201以及存储器1203中的程序代码1206来实现方法实施例提供的路径故障检测方法。程序代码1206中可以包括一个或多个软件模块。可选地,处理器1201自身也可以存储执行本申请方案的程序代码或指令。In some embodiments, the memory 1203 is used to store the program code 1206 for implementing the solution of the present application, and the processor 1201 can execute the program code 1206 stored in the memory 1203 . That is, the network device 1200 may implement the path fault detection method provided by the method embodiment through the processor 1201 and the program code 1206 in the memory 1203 . One or more software modules may be included in the program code 1206 . Optionally, the processor 1201 itself may also store program codes or instructions for executing the solutions of the present application.
在具体实施例中,本申请实施例的网络设备1200可对应于上述方法实施例中的待检测路 径上的各个任一网络设备,网络设备1200中的处理器1201读取存储器1203中的指令,使图12所示的网络设备1200能够执行待检测路径上的网络设备所执行的全部或部分操作。In a specific embodiment, the network device 1200 in the embodiment of the present application may correspond to any network device on the path to be detected in the above method embodiment, and the processor 1201 in the network device 1200 reads the instructions in the memory 1203, The network device 1200 shown in FIG. 12 is enabled to perform all or part of the operations performed by the network devices on the path to be detected.
具体的,处理器1201用于获取第一检测报文,第一检测报文包括第一周期值,第一周期值指示网络设备发送第一检测报文的周期,第一周期值为第一检测报文在多个发送周期中所属的目标发送周期对应的周期值;控制通信接口1204通过待检测路径发送第一检测报文,第一检测报文用于所述待检测路径的故障检测。Specifically, the processor 1201 is configured to obtain a first detection packet, the first detection packet includes a first period value, the first period value indicates the period for the network device to send the first detection packet, and the first period value is the first detection period value. The cycle value corresponding to the target sending cycle to which the message belongs in the multiple sending cycles; the control communication interface 1204 sends the first detection message through the path to be detected, and the first detection message is used for fault detection of the path to be detected.
其他可选的实施方式,为了简洁,在此不再赘述。For other optional implementation manners, for the sake of brevity, details are not repeated here.
网络设备1200还可以对应于上述图11所示的路径故障检测装置,该路径故障检测装置中的每个功能模块采用网络设备1200的软件实现。换句话说,该路径故障检测装置包括的功能模块为网络设备1200的处理器1201读取存储器1203中存储的程序代码1206后生成的。The network device 1200 may also correspond to the path fault detection device shown in FIG. 11 above, and each functional module in the path fault detection device is implemented by software of the network device 1200 . In other words, the functional modules included in the path fault detection apparatus are generated after the processor 1201 of the network device 1200 reads the program code 1206 stored in the memory 1203 .
其中,图3-10所示的路径故障检测方法的各步骤通过网络设备1200的处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤,为避免重复,这里不再详细描述。Wherein, each step of the path fault detection method shown in FIGS. 3-10 is completed by an integrated logic circuit of hardware in the processor of the network device 1200 or instructions in the form of software. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.
本申请实施例还提供了一种芯片,包括处理器,处理器用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的网络设备执行本申请实施例提供的任一种的路径故障检测方法。The embodiment of the present application also provides a chip, including a processor, the processor is used to call from the memory and execute the instructions stored in the memory, so that the network device installed with the chip executes any one of the path failures provided in the embodiment of the present application Detection method.
本申请实施例还提供了一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行上述任一种的路径故障检测方法。The embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory , when the code is executed, the processor is configured to execute any one of the path fault detection methods described above.
应理解的是,上述处理器可以是CPU,还可以是其他通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持ARM架构的处理器。It should be understood that the above-mentioned processor may be a CPU, or other general-purpose processors, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or any conventional processor or the like. It should be noted that the processor may be a processor supporting the ARM architecture.
进一步地,在一种可选的实施例中,上述处理器为一个或多个,存储器为一个或多个。可选地,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。上述存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器还可以包括非易失性随机存取存储器。例如,存储器还可以存储参考块和目标块。Further, in an optional embodiment, there are one or more processors and one or more memories. Optionally, the memory may be integrated with the processor, or the memory may be separated from the processor. The above-mentioned memory may include read-only memory and random-access memory, and provides instructions and data to the processor. Memory may also include non-volatile random access memory. For example, the memory may also store reference blocks and target blocks.
该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是ROM、PROM、EPROM、EEPROM或闪存。易失性存储器可以是RAM,其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用。例如,SRAM、DRAM、SDRAM、DDR SDRAM、ESDRAM、SLDRAM和DR RAM。The memory can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Wherein, the non-volatile memory may be ROM, PROM, EPROM, EEPROM or flash memory. Volatile memory can be RAM, which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available. For example, SRAM, DRAM, SDRAM, DDR SDRAM, ESDRAM, SLDRAM, and DR RAM.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个 计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(digital subscriber line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如:固态硬盘(solid state disk,SSD))等。In the above embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it 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 the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (for example: solid state disk (solid state disk, SSD) )wait.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述并不用以限制本申请实施例,凡在本申请实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。The above description is not intended to limit the embodiments of the present application, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included within the scope of protection of the embodiments of the present application.

Claims (23)

  1. 一种路径故障检测方法,其特征在于,应用于网络设备,所述方法包括:A path fault detection method, characterized in that it is applied to a network device, the method comprising:
    获取第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示所述网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的目标发送周期对应的周期值;Acquire a first detection message, the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period value is the The cycle value corresponding to the target sending cycle to which the first detection message belongs in the multiple sending cycles;
    通过待检测路径发送所述第一检测报文,所述第一检测报文用于所述待检测路径的故障检测。The first detection message is sent through the path to be detected, and the first detection message is used for fault detection of the path to be detected.
  2. 根据权利要求1所述的方法,其特征在于,所述多个发送周期是预先设置的。The method according to claim 1, characterized in that the multiple sending periods are preset.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一检测报文在所述多个发送周期中所属的目标发送周期是根据所述网络设备预期发送所述第一检测报文的时间确定的。The method according to claim 1 or 2, wherein the target sending cycle to which the first detection message belongs in the multiple sending cycles is based on the expected sending of the first detection message by the network device The time is fixed.
  4. 根据权利要求1或2所述的方法,其特征在于,所述第一检测报文在多个发送周期中所属的目标发送周期对应的周期值是通过如下步骤确定的:The method according to claim 1 or 2, wherein the cycle value corresponding to the target sending cycle to which the first detection message belongs among the multiple sending cycles is determined by the following steps:
    接收第二检测报文,所述第二检测报文包括第二周期值,所述第二周期值指示在所述待检测路径上所述网络设备的上一跳设备发送所述第二检测报文的周期;receiving a second detection message, the second detection message includes a second period value, and the second period value indicates that the last hop device of the network device on the path to be detected sends the second detection message The cycle of the text;
    根据所述第二周期值和所述多个发送周期,确定所述第一周期值;determining the first period value according to the second period value and the plurality of sending periods;
    所述获取第一检测报文包括:The acquisition of the first detection message includes:
    根据所述第二检测报文和所述第一周期值,获得所述第一检测报文。Obtain the first detection message according to the second detection message and the first period value.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述第二周期值和所述多个发送周期,确定所述第一周期值,包括:The method according to claim 4, wherein the determining the first period value according to the second period value and the plurality of sending periods comprises:
    确定所述网络设备与所述上一跳设备发送检测报文的周期差值;determining the period difference between the network device and the previous hop device sending the detection message;
    根据所述周期差值、所述第二周期值和所述多个发送周期,获得所述第一周期值。Obtain the first period value according to the period difference value, the second period value and the multiple sending periods.
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述第一周期值携带在所述第一检测报文的基于第6代互联网协议IPv6报文头或IPv6扩展头或多协议标签交换MPLS头或MPLS扩展头中。The method according to any one of claims 1-5, wherein the first period value is carried in the first detection message based on the 6th generation Internet protocol IPv6 header or IPv6 extension header or multi-protocol Label Switching MPLS Header or MPLS Extension Header.
  7. 根据权利要求6所述的方法,其特征在于,所述第一周期值携带在所述第一检测报文的IPv6报文头的目的地址字段中。The method according to claim 6, wherein the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet.
  8. 根据权利要求6所述的方法,其特征在于,所述IPv6扩展头为分段路由头SRH,所述第一周期值携带在所述第一检测报文的SRH的类型长度值TLV字段或分段路由标识SID中;或者,所述IPv6扩展头为逐跳选项头。The method according to claim 6, wherein the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or subsection of the first detection message. segment routing identifier SID; or, the IPv6 extension header is a hop-by-hop option header.
  9. 根据权利要求6所述的方法,其特征在于,所述第一周期值携带在所述MPLS头包括的MPLS标签中。The method according to claim 6, wherein the first period value is carried in an MPLS label included in the MPLS header.
  10. 根据权利要求1-9任一所述的方法,其特征在于,所述第一检测报文为双向转发检测BFD报文,或者,所述第一检测报文为操作维护管理OAM报文。The method according to any one of claims 1-9, wherein the first detection message is a bidirectional forwarding detection BFD message, or the first detection message is an OAM message.
  11. 一种网络设备,其特征在于,所述网络设备包括:处理器,所述处理器与存储器耦合,所述存储器中存储有至少一条程序指令或代码,所述至少一条程序指令或代码由所述处理器加载并执行,以使所述网络设备实现权利要求1-10中任一所述的报文处理方法。A network device, characterized in that the network device includes: a processor, the processor is coupled to a memory, at least one program instruction or code is stored in the memory, and the at least one program instruction or code is controlled by the The processor is loaded and executed, so that the network device implements the message processing method described in any one of claims 1-10.
  12. 一种路径故障检测***,其特征在于,所述***包括第一网络设备和第二网络设备;A path fault detection system, characterized in that the system includes a first network device and a second network device;
    所述第一网络设备用于通过待检测路径发送第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示所述第一网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的第一目标发送周期对应的周期值,所述第一检测报文用于所述待检测路径的故障检测;The first network device is configured to send a first detection packet through a path to be detected, the first detection packet includes a first period value, and the first period value instructs the first network device to send the first The period of the detection message, the first period value is the period value corresponding to the first target transmission period to which the first detection message belongs in the multiple transmission periods, and the first detection message is used for the waiting Detection of faults in the path;
    所述第二网络设备用于接收所述第一网络设备发送的所述第一检测报文,根据所述第一周期值获得第二周期值,根据所述第一检测报文和所述第二周期值获得第二检测报文,并发送所述第二检测报文,所述第二检测报文包括所述第二周期值,所述第二周期值指示所述第二网络设备发送所述第二检测报文的周期,所述第二周期值为所述第二检测报文在多个发送周期中所属的第二目标发送周期对应的周期值。The second network device is configured to receive the first detection message sent by the first network device, obtain a second period value according to the first period value, and obtain a second period value according to the first detection message and the first period value. Obtain a second detection message with a second cycle value, and send the second detection message, the second detection message includes the second cycle value, and the second cycle value instructs the second network device to send the second detection message The period of the second detection message, the second period value is a period value corresponding to the second target transmission period to which the second detection message belongs in the multiple transmission periods.
  13. 一种路径故障检测装置,其特征在于,所述装置包括:A path fault detection device, characterized in that the device comprises:
    获取模块,用于获取第一检测报文,所述第一检测报文包括第一周期值,所述第一周期值指示网络设备发送所述第一检测报文的周期,所述第一周期值为所述第一检测报文在多个发送周期中所属的目标发送周期对应的周期值;An acquisition module, configured to acquire a first detection message, the first detection message includes a first period value, the first period value indicates the period for the network device to send the first detection message, and the first period The value is a cycle value corresponding to the target sending cycle to which the first detection message belongs in the multiple sending cycles;
    发送模块,用于通过待检测路径发送所述第一检测报文,所述第一检测报文用于所述待检测路径的故障检测。A sending module, configured to send the first detection message through the path to be detected, where the first detection message is used for fault detection of the path to be detected.
  14. 根据权利要求13所述的装置,其特征在于,所述多个发送周期是预先设置的。The device according to claim 13, wherein the multiple sending periods are preset.
  15. 根据权利要求13或14所述的装置,其特征在于,所述第一检测报文在所述多个发送周期中所属的目标发送周期是根据所述网络设备预期发送所述第一检测报文的时间确定的。The device according to claim 13 or 14, wherein the target sending cycle to which the first detection message belongs in the multiple sending cycles is based on the expected sending of the first detection message by the network device The time is fixed.
  16. 根据权利要求13或14所述的装置,其特征在于,所述装置还包括:接收模块和确定模块;The device according to claim 13 or 14, further comprising: a receiving module and a determining module;
    所述接收模块,用于接收第二检测报文,所述第二检测报文包括第二周期值,所述第二周期值指示在所述待检测路径上所述网络设备的上一跳设备发送所述第二检测报文的周期;The receiving module is configured to receive a second detection message, the second detection message includes a second cycle value, and the second cycle value indicates the last hop device of the network device on the path to be detected a period for sending the second detection message;
    所述确定模块,用于根据所述第二周期值和所述多个发送周期,确定所述第一周期值;The determination module is configured to determine the first period value according to the second period value and the multiple sending periods;
    所述获取模块,用于根据所述第二检测报文和所述第一周期值,获得所述第一检测报文。The obtaining module is configured to obtain the first detection message according to the second detection message and the first cycle value.
  17. 根据权利要求16所述的装置,其特征在于,所述确定模块主要用于:The device according to claim 16, wherein the determination module is mainly used for:
    确定所述网络设备与所述上一跳设备发送检测报文的周期差值;determining the period difference between the network device and the previous hop device sending the detection message;
    根据所述周期差值、所述第二周期值和所述多个发送周期,获得所述第一周期值。Obtain the first period value according to the period difference value, the second period value and the multiple sending periods.
  18. 根据权利要求13-17任一所述的装置,其特征在于,所述第一周期值携带在所述第一检测报文的基于第6代互联网协议IPv6报文头或IPv6扩展头或多协议标签交换MPLS头或MPLS扩展头中。The device according to any one of claims 13-17, wherein the first period value is carried in the first detection message based on the 6th generation Internet protocol IPv6 header or IPv6 extension header or multi-protocol Label Switching MPLS Header or MPLS Extension Header.
  19. 根据权利要求18所述的装置,其特征在于,所述第一周期值携带在所述第一检测报文的IPv6报文头的目的地址字段中。The device according to claim 18, wherein the first period value is carried in the destination address field of the IPv6 packet header of the first detection packet.
  20. 根据权利要求18所述的装置,其特征在于,所述IPv6扩展头为分段路由头SRH,所述第一周期值携带在所述第一检测报文的SRH的类型长度值TLV字段或分段路由标识SID中;或者,所述IPv6扩展头为逐跳选项头。The device according to claim 18, wherein the IPv6 extension header is a segment routing header SRH, and the first period value is carried in the SRH type length value TLV field or subsection of the first detection message. segment routing identifier SID; or, the IPv6 extension header is a hop-by-hop option header.
  21. 根据权利要求18所述的装置,其特征在于,所述第一周期值携带在所述MPLS头包括的MPLS标签中。The device according to claim 18, wherein the first period value is carried in an MPLS label included in the MPLS header.
  22. 根据权利要求13-21任一所述的装置,其特征在于,所述第一检测报文为双向转发检测BFD报文,或者,所述第一检测报文为操作维护管理OAM报文。The device according to any one of claims 13-21, wherein the first detection message is a bidirectional forwarding detection BFD message, or the first detection message is an OAM message.
  23. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机可读存储介质中的计算机指令被计算机设备执行时,使得所述计算机设备执行所述权利要求1至10任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer-readable storage medium is executed by a computer device, the computer device executes the The method according to any one of claims 1 to 10.
PCT/CN2022/115287 2021-09-01 2022-08-26 Path fault detection method, apparatus and system, network device and storage medium WO2023030202A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111020744.6 2021-09-01
CN202111020744 2021-09-01
CN202111294236.7 2021-11-03
CN202111294236.7A CN115733767A (en) 2021-09-01 2021-11-03 Path fault detection method, device, system, network equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023030202A1 true WO2023030202A1 (en) 2023-03-09

Family

ID=85292447

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/115287 WO2023030202A1 (en) 2021-09-01 2022-08-26 Path fault detection method, apparatus and system, network device and storage medium

Country Status (2)

Country Link
CN (1) CN115733767A (en)
WO (1) WO2023030202A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577413A (en) * 2014-10-17 2016-05-11 中兴通讯股份有限公司 OAM (Operation, Administration and Management) message processing method and device
CN109495352A (en) * 2018-12-27 2019-03-19 新华三技术有限公司 A kind of determination method and apparatus of transmission path
US20200287824A1 (en) * 2018-06-14 2020-09-10 Nokia Solutions And Networks Oy Flexible label value encoding in label switched packet networks
CN112714034A (en) * 2019-10-26 2021-04-27 华为技术有限公司 Method and device for processing multicast message
CN112825510A (en) * 2019-11-21 2021-05-21 华为技术有限公司 Method and device for updating mapping relation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577413A (en) * 2014-10-17 2016-05-11 中兴通讯股份有限公司 OAM (Operation, Administration and Management) message processing method and device
US20200287824A1 (en) * 2018-06-14 2020-09-10 Nokia Solutions And Networks Oy Flexible label value encoding in label switched packet networks
CN109495352A (en) * 2018-12-27 2019-03-19 新华三技术有限公司 A kind of determination method and apparatus of transmission path
CN112714034A (en) * 2019-10-26 2021-04-27 华为技术有限公司 Method and device for processing multicast message
CN112825510A (en) * 2019-11-21 2021-05-21 华为技术有限公司 Method and device for updating mapping relation

Also Published As

Publication number Publication date
CN115733767A (en) 2023-03-03

Similar Documents

Publication Publication Date Title
CN111682952B (en) On-demand probing for quality of experience metrics
US11902139B2 (en) Diagnosing and resolving issues in a network using probe packets
EP3154227B1 (en) Packet transmission method, node, path management server and storage medium
WO2019001488A1 (en) Method and apparatus for path detection
WO2018113425A1 (en) Method, apparatus and system for detecting time delay
WO2021004156A1 (en) Packet forwarding method, device, and computer-readable storage medium
WO2022042503A1 (en) Message transmission method, apparatus, and system
WO2022062931A1 (en) Network anomaly determination method and apparatus
WO2021104491A1 (en) Data transmission method, device, and system
JP7124206B2 (en) Packet processing methods and gateway devices
US20230102193A1 (en) Network Performance Measurement Method, Apparatus, Device, and System, and Storage Medium
WO2016197950A1 (en) Route detection method, router device and system
WO2022068744A1 (en) Method for obtaining message header information and generating message, device, and storage medium
JP5672836B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM
WO2023030202A1 (en) Path fault detection method, apparatus and system, network device and storage medium
WO2023197644A1 (en) Cross-segmented network fault detection method, and communication system and related apparatus
CN108282404B (en) Route generation method, device and system
CN115914087A (en) Message forwarding method, device, equipment, system and storage medium
WO2021078171A1 (en) Message transmission method and device, and digital processing chip
WO2020249033A1 (en) Bit error notification method and related device
WO2020150878A1 (en) Data message transmission method and node
WO2023279990A1 (en) Packet transmission method, apparatus and system, network device, and storage medium
US11646969B2 (en) Application-based data labeling
WO2024000139A1 (en) Packet forwarding
WO2022222884A1 (en) Failure sensing method, apparatus and system for forwarding path

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863339

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE