Connection status detection method and related device
A connection status detection method used for detecting connectivity of a segment routing (SR) path between nodes is disclosed. After receiving a path detection packet, a first node responds to the path detection packet based on connectivity of an SR path between the first node and a third node, and the path detection packet is used to indicate to detect the connectivity of the segment routing (SR) path between the nodes.
1 . A method for detecting connection status, comprising:
receiving, by a first node, a path detection packet from a second node, wherein connectivity of a segment routing (SR) path between the second node and the first node is detected using the path detection packet; and
sending, by the first node, a response to the second node in response to the path detection packet based on connectivity of an SR path between the first node and a third node, the response notifying the second node about connectivity of an SR path between the second node and the third node,
wherein sending, by the first node, the response to the second node in response to the path detection packet based on connectivity of the SR path between the first node and the third node comprises:
in response to a connected state of the SR path between the first node and the third node, notifying, by the first node, the second node that the SR path between the second node and the third node is in a connected state; and
in response to a non-connected state of the SR path between the first node and the third node, notifying, by the first node, the second node that the SR path between the second node and the third node is in a non-connected state,
wherein the first node is a reflector device that generates the response using the connectivity of the SR path between the first node and the third node to indicate the connectivity of the SR path between the second node and the third node, and
wherein the path detection packet is received by the first node based on a segment routing traffic engineering (SR-TE) policy tunnel from the second node to the third node.
2 . The method according to claim 1 , wherein a target receiving endpoint of the path detection packet is the first node or the third node.
3 . The method according to claim 1 , further comprising:
determining, by the first node, the SR path between the first node and the third node based on an identifier of the path detection packet.
4 . The method according to claim 1 , wherein:
the notifying the second node that the SR path between the second node and the third node is in the non-connected state comprises skipping sending a response packet for the path detection packet to the second node; and
the notifying the second node that the SR path between the second node and the third node is in the non-connected state comprises sending a response packet for the path detection packet to the second node.
5 . The method according to claim 1 , wherein the path detection packet is a seamless bidirectional forwarding detection (SBFD) packet.
6 . The method according to claim 1 , wherein the first node is a reflector device, the second node is a transmitter device, and the third node is an internet service provider (ISP).
7 . The method according to claim 1 , wherein the first node determines that the connectivity of the SR path between the first node and the third node is in a non-connected state when one of the following conditions is met:
a border gateway protocol (BGP) egress peer engineering (EPE) label configured by the first node for the third node is invalid;
the first node detects that a bidirectional forwarding detection (BFD) session is in a down state;
a static BFD session on an interface of the first node is in a down state; or
an interface that is on the first node and configured to be connected to the third node is in a down state.
8 . A detection apparatus used as a first node, comprising:
a non-transitory memory storing instructions; and
at least one processor coupled to the non-transitory memory, wherein the instructions, when executed by the at least one processor, cause the detection apparatus to be configured to:
receive a path detection packet from a second node, wherein connectivity of a segment routing (SR) path between the second node and the first node is detected using the path detection packet; and
send a response to the second node in response to the path detection packet based on connectivity of an SR path between the first node and a third node, the response notifying the second node about connectivity of an SR path between the second node and the third node,
wherein sending of the response to the second node in response to the path detection packet based on connectivity of the SR path between the first node and the third node comprises:
in response to a connected state of the SR path between the first node and the third node, notifying the second node that the SR path between the second node and the third node is in a connected state; and
in response to a non-connected state of the SR path between the first node and the third node, notifying the second node that the SR path between the second node and the third node is in a non-connected state,
wherein the first node is a reflector device that generates the response using the connectivity of the SR path between the first node and the third node to indicate the connectivity of the SR path between the second node and the third node, and
wherein the path detection packet is received by the first node based on a segment routing traffic engineering (SR-TE) policy tunnel from the second node to the third node.
9 . The detection apparatus according to claim 8 , wherein a target receiving endpoint of the path detection packet is the first node or the third node.
10 . The detection apparatus according to claim 8 , wherein the instructions, when executed by the at least one processor, further cause the detection apparatus to be configured to:
determine the SR path between the first node and the third node based on an identifier of the path detection packet.
11 . The detection apparatus according to claim 8 , wherein the notifying the second node that the SR path between the second node and the third node is in the non-connected state comprises skipping sending a response packet for the path detection packet to the second node; and
the notifying the second node that the SR path between the second node and the third node is in the non-connected state comprises sending a response packet for the path detection packet to the second node.
12 . The detection apparatus according to claim 8 , wherein the path detection packet is a seamless bidirectional forwarding detection (SBFD) packet.
13 . A detection apparatus used as a second node, comprising:
a non-transitory memory storing instructions; and
at least one processor coupled to the non-transitory memory; wherein the instructions, when executed by the at least one processor, cause the detection apparatus to be configured to:
send a path detection packet to a first node, wherein connectivity of a segment routing (SR) path between the first node and the second node is detected using the path detection packet;
receive a response to the path detection packet from the first node, the response notifying the second node about connectivity of an SR path between the second node and a third node, wherein the response notifies the second node that the SR path between the second node and the third node is in a connected state based on that a SR path between the first node and the third node is in a connected state, and the response notifies the second node that the SR path between the second node and the third node is in a non-connected state based on that the SR path between the first node and the third node is in a non-connected state; and
determine connectivity of a segment routing (SR) path between the second node and the third node based on the response,
wherein the first node is a reflector device that generates the response using the connectivity of the SR path between the first node and the third node to indicate the connectivity of the SR path between the second node and the third node, and
wherein the path detection packet is received by the first node based on a segment routing traffic engineering (SR-TE) policy tunnel from the second node to the third node.
14 . The detection apparatus according to claim 13 , wherein a target receiving endpoint of the path detection packet is the first node or the third node.
15 . The detection apparatus according to claim 13 , wherein the path detection packet is a seamless bidirectional forwarding detection (SBFD) packet.