| CPC H04L 45/18 (2013.01) [H04L 45/22 (2013.01); H04L 45/34 (2013.01); H04L 45/50 (2013.01); H04L 45/741 (2013.01)] | 12 Claims |

|
1. A loop detection method, comprising:
receiving, by a first node, a packet from a second node through a first interface, wherein a node segment identifier (SID) is encapsulated at an outer layer of the packet, and the node SID identifies a destination node;
determining, by the first node based on the node SID, that an outbound interface for forwarding the packet is the first interface;
determining, by the first node based on a node SID carried in an incoming label encapsulated at the outer layer in the packet, that a node SID carried in an outgoing label is the same as the node SID carried in the incoming label, wherein the outgoing label carried when the first node forwards the packet is a sum of a starting address of a segment routing global block (SRGB) and the node SID of the destination node;
determining, by the first node, that a loop exists in a forwarding path of the packet based on the outbound interface for forwarding the packet being the first interface; and
avoiding, by the first node, forwarding the packet to the second node through the first interface by:
forwarding, by the first node, the packet to the destination node through a second interface, wherein a path from the first node to the destination node through the second interface is a backup path for forwarding the packet, or
discarding, by the first node, the packet.
|