A loop detection method and device
By detecting the consistency of interfaces for receiving and forwarding messages, loop problems caused by node performance differences in segment routing are resolved, achieving stability and reliability in service transmission.
Patent Information
- Application Number
- CN202111130398.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-09-26
AI Technical Summary
In segment routing technology, performance differences between network nodes lead to inconsistent routing convergence among network nodes during link failure or failure recovery, forming short loops, affecting service transmission, and causing port congestion and packet loss.
By determining whether the interface when receiving a message is consistent with the outgoing interface when forwarding the message, it is determined whether there is a loop between nodes. If a loop exists, the message forwarding operation is adjusted to avoid port congestion and service packet loss.
It effectively avoids port congestion and service packet loss caused by loops, ensuring the stability and reliability of service transmission.
Smart Images

Figure CN115883446B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and more particularly, to a loop detection method and device. Background Art
[0002] Segment routing (SR) is a technology used to forward packets. SR divides a network into one or more segments and arranges the segments and network nodes in an orderly manner to obtain a forwarding path. Its essence is similar to source routing.
[0003] SR is divided into segment routing-traffic engineering (SR-TE) and segment routing-best effort (SR-BE). In SR-BE technology, the interior gateway protocol (IGP) uses the shortest path first (SPF) algorithm to calculate the optimal label switched path (LSP), also known as the primary path. At the same time, the IGP can also calculate and generate a topology-independent loop-free alternate path (TI-LFA), also known as the backup path, that can provide link and node protection for SR-BE. When a link or node fails, traffic will quickly switch to the backup path, and packets will be forwarded along the backup path. Under normal circumstances, packets are forwarded along the primary path.
[0004] When a link fails or recovers, it triggers convergence on all network nodes, causing each node to recalculate the LSP. Due to performance differences among network nodes, the time it takes for generated LSPs to be delivered to the forwarding plane may be inconsistent, leading to transient loops. Loops can affect service transmission, such as causing packet loss and port congestion, which can impact other services of the same priority.
[0005] Therefore, it is crucial to determine whether there are loops between network nodes. Summary of the Invention
[0006] The present application provides a loop detection method and device, which aims to determine whether there is a loop between nodes by judging whether the interface when receiving a message is consistent with the output interface when forwarding the message, so as to adjust the forwarding operation of the message in time when a loop exists, thereby avoiding port congestion, service packet loss and other problems.
[0007] In a first aspect, the present application provides a loop detection method, which can be executed by a first node, or can also be executed by a component configured in the first node (such as a chip, a chip system, etc.), and the present application does not limit this.
[0008] Exemplarily, the method includes: a first node receives a message from a second node through a first interface, the message outer layer encapsulating a node segment identifier (SID), and the node SID is used to identify the destination node; the first node determines that the outgoing interface used to forward the message is the first interface based on the node SID; the first node determines that there is a loop in the forwarding path of the message.
[0009] Based on the above technical solution, the first node determines whether there is a loop between the first node and the previous hop node by judging whether the interface when receiving the message is consistent with the output interface when forwarding the message. If the two are consistent, it is determined that a loop exists, and the forwarding operation of the message can be adjusted in time to avoid problems such as port congestion and service packet loss.
[0010] In conjunction with the first aspect, in a possible implementation of the first aspect, the first node may forward the message based on SR-BE or SR (SRv6) BE of the sixth generation (version 6) Internet Protocol (IP) (IPv6). In the two cases, the node SID encapsulated in the outer layer of the message is different.
[0011] The node SID encapsulated in the outer layer of the above message has the following two possibilities:
[0012] One possible scenario is that the first node forwards the message based on traditional SR-BE, and the node SID corresponds to a multiprotocol label switching (MPLS) label.
[0013] Specifically, the node SID encapsulated in the outer layer of a message is a label corresponding to the node SID, determined based on the sum of the node SID and the starting address of the segment routing global block (SRGB). For example, when the first node forwards a message, the outgoing label carried is the sum of the starting address of the next-hop node's SRGB and the node SID of the destination node.
[0014] Another possible scenario is that the first node forwards the message based on SRv6 BE, and the node SID corresponds to the SRv6 SID. Specifically, the node SID encapsulated in the outer layer of the message refers to the SRv6 SID encapsulated based on the destination address.
[0015] In combination with the first aspect, in a possible implementation of the first aspect, the method further includes: the first node determines, based on the node SID carried by the incoming label encapsulated in the message, that the node SID carried by the outgoing label is the same as the node SID carried by the incoming label; and the first node determines that there is a loop in the forwarding path of the message.
[0016] The first node determines that a loop exists between the first and second nodes by ensuring that the interface used to receive the message is consistent with the outbound interface used to forward the message, and that the node SID carried in the outbound label is the same as the node SID carried in the incoming label. This effectively avoids misjudging the existence of a loop in the message forwarding path in the SR-TE scenario. It can be understood that if SR-BE is fully deployed in the network, whether a loop exists between the first node and the previous hop node can be determined by determining whether the interface when receiving the message is consistent with the outgoing interface when forwarding the message. If SRv6 BE is fully deployed in the network, in other words, the outer layer of the message only encapsulates the node SID of the destination address, whether a loop exists between the first node and the previous hop node can be determined by determining whether the interface when receiving the message is consistent with the outgoing interface when forwarding the message. If SR-TE tunnels are deployed in the network, and the label stack type in the SR-TE tunnel is a hybrid label stack consisting of a node SID and an adjacent SID, in other words, the outer layer of the message encapsulates a label stack of a node SID and an adjacent SID, the first node also needs to determine whether the node SID carried in the outgoing label is the same as the node SID carried in the incoming label based on the node SID carried in the incoming label. This avoids misjudging the existence of a loop on the path when SR-TE forwards the message based on the hybrid label stack consisting of a node SID and an adjacent SID.
[0017] In combination with the first aspect, in a possible implementation of the first aspect, the method further includes: the first node adjusting a forwarding operation of the message to avoid forwarding the message to the second node through the first interface.
[0018] One possible design is that the first node directly discards the message when a loop exists in the message forwarding path. By directly discarding the message when a loop exists in the message forwarding path, port congestion can be avoided, which affects other services of the same priority.
[0019] Another possible design is for the first node to forward the message via a backup path. Specifically, the first node forwards the message to the next-hop node via the second interface. The path through the second interface to the destination node is the backup path for forwarding the message. Forwarding the message via the backup path by the first node can avoid problems such as packet loss and port congestion.
[0020] In a second aspect, the present application provides a loop detection apparatus, which can implement the method in the first aspect and any possible implementation manner of the first aspect. The apparatus comprises corresponding units for implementing the method. The units of the apparatus can be implemented by software and / or hardware.
[0021] In a third aspect, the present application provides a loop detection apparatus, which comprises a processor. The processor is coupled with a memory and can be used to execute a computer program in the memory to implement the loop detection method in the first aspect and any possible implementation manner of the first aspect.
[0022] Optionally, the apparatus further comprises a memory.
[0023] Optionally, the apparatus further comprises a communication interface, and the processor is coupled with the communication interface.
[0024] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program or instructions, when the computer program or instructions are executed, to implement the loop detection method in the first aspect and any possible implementation manner of the first aspect.
[0025] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, when the computer program is executed, to implement the loop detection method in the first aspect and any possible implementation manner of the first aspect.
[0026] In a sixth aspect, the present application provides a chip system, which comprises a processor and can further comprise a memory, to implement the loop detection method in the first aspect and any possible implementation manner of the first aspect. The chip system can be composed of a chip or can comprise a chip and other discrete devices.
[0027] It should be understood that the second aspect to the sixth aspect of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding possible implementation manner are similar, which will not be repeated. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 is a schematic diagram of two types of SIDs provided by an embodiment of the present application;
[0029] Figure 2 is a schematic diagram of an SR-BE forwarding process provided by an embodiment of the present application;
[0030] Figure 3 is a schematic diagram of an application scenario suitable for the method provided by an embodiment of the present application;
[0031] Figure 4is another application scenario suitable for the method provided by the embodiments of the present application;
[0032] Figure 5 is still another application scenario suitable for the method provided by the embodiments of the present application;
[0033] Figure 6 is a flowchart of the loop detection method provided by the embodiments of the present application;
[0034] Figure 7 is a schematic diagram of determining an interface by the first node based on a node SID provided by the embodiments of the present application;
[0035] Figure 8 is a schematic diagram of forwarding a packet by the first node provided by the embodiments of the present application;
[0036] Figure 9 is still another schematic diagram of forwarding a packet by the first node provided by the embodiments of the present application;
[0037] Figure 10 is a schematic block diagram of the loop detection apparatus provided by the embodiments of the present application;
[0038] Figure 11 is another schematic block diagram of the loop detection apparatus provided by the embodiments of the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the present application will be described below with reference to the drawings.
[0040] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role. For example, the first node and the second node are used to distinguish different network nodes, and do not limit the order. Those skilled in the art can understand that the terms "first", "second", etc. do not limit the number and execution order, and the terms "first", "second", etc. also do not necessarily mean different.
[0041] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0042] In order to better understand the loop detection method provided by the embodiments of the present application, the terms involved in the present application will be briefly described first.
[0043] 1. SR: A technology used to forward packets. SR divides a network into one or more segments, assigns identifiers (SIDs) to these segments and network nodes, and arranges the SIDs in an orderly fashion. In other words, by arranging the segments and nodes in an orderly fashion, a forwarding path is obtained. SR is essentially similar to source routing. SR is divided into two types: SR-TE and SR-BE. The methods provided in the embodiments of this application can be applied to both traditional SR-BE technology and SRv6 BE technology.
[0044] 2. SID: Equivalent to the MPLS label in traditional MPLS technology, in SR-BE technology, the SID can be mapped to the MPLS label at the forwarding layer. SIDs are divided into two types: node SID (Node SID) and adjacency SID (Adjacency SID). Figure 1 A schematic diagram showing two types of SIDs.
[0045] Figure 1 The figure a) is an example of a Node SID. A Node SID is a special prefix SID used to identify a specific network node. If the IP address is configured as a prefix on the node's loopback interface, the node's Node SID is also called a prefix SID. For example, node A is assigned Node SID 101, node B is assigned Node SID 102, and node C is assigned Node SID 103. In other words, 101 identifies node A, 102 identifies node B, and 103 identifies node C.
[0046] Figure 1 b) is an example of an Adjacency SID. An Adjacency SID is used to identify an adjacency of a network node in a network and has a certain directionality. For example, the Adjacency SID from node A to node B is 1001, and the Adjacency SID from node B to node C is 1002. In the embodiment of the present application, a Node SID is used to identify a destination node.
[0047] 3. Segment Routing Global Block (SRGB): A user-specified range of MPLS labels reserved for SR. For example, the SRGB for a network node is [16000, 23999], where 16000 is the starting address of the SRGB.
[0048] 4. SR-BE: IGP uses SPF to calculate the optimal LSP. This is a tunneling technology. In SR-BE, the Node SID of the destination node is propagated to each node through the IGP protocol. Each node calculates the label value based on the local SRGB and uses the intermediate system to intermediate system (IS-IS) routing protocol or the open shortest path first (OSPF) routing protocol to calculate the label forwarding path, find the next hop node, and guide the packet forwarding to the destination node.
[0049] In SR-BE technology, IGP can also calculate and generate a TI-LFA path, also known as a backup path, to provide link and node protection for the SR-BE tunnel. If a link or node fails, traffic is quickly switched to the backup path, and packets are forwarded along the backup path.
[0050] Figure 2 This is an example of the SR-BE forwarding process provided in the embodiment of the present application. Figure 2 As shown, a message needs to be forwarded from node A to node D. Node A inputs the message. The IGP protocol propagates the destination node's (node D's) Node SID (100) to all network nodes. Node A's SRGB is [16000, 23999], and the action is push. Node A encapsulates label 26100 on the outer layer of the message. Label 26100 is the sum of the next-hop node's SRGB start address and the Node SID. Node A sends the message to the next-hop node (node B). Node B's SRGB is [26000, 65535], and the action is swap. Node B receives the message, and the outer layer of the message now has label 26100.
[0051] In an embodiment of the present application, in order to facilitate the distinction between the label encapsulated when the message enters the B node and the label encapsulated when it outputs the B node, the label encapsulated when the message enters the B node is recorded as the incoming label, that is, the incoming label is 26100, and the label encapsulated when the message is output from the B node is recorded as the outgoing label.
[0052] After receiving the message, Node B determines the label to be encapsulated when sending the message to the next-hop node based on the label swap table. This is the outgoing label. The message carries this outgoing label upon entering the next-hop node, which is equivalent to the incoming label of the message upon entering the next-hop node. Node B swaps the outer label of the message, replacing incoming label 26100 with outgoing label 36100. This label is the sum of the next-hop node's SRGB start address and the Node SID.
[0053] As you can understand, the forwarding process at node C is similar to that at node B and will not be detailed here. When the packet reaches the destination node (i.e., node D), the packet is popped, label 16100 is removed from the packet's outer encapsulation, and forwarding continues according to the IP address.
[0054] 5. SRv6: SRv6 is the application of SR technology to the IPv6 network plane. SRv6 adds a new segment routing header (SRH) to IPv6 packets, which stores a list of SRv6 SIDs in the format of 128-bit IPv6 addresses. SRv6 SIDs define path information, services, and functions for specific nodes. In SRv6 BE technology, the SRv6 SID list contains only one SID, and the destination address in the IPv6 packet header can be set to this SID without inserting an SRH. In other words, in SRv6 BE technology, the outer SID of the packet encapsulates the IP address of the destination node.
[0055] The following briefly describes the application scenarios of the loop detection method provided in the embodiments of the present application.
[0056] One possible scenario is that SR-BE is fully deployed along the packet forwarding path. In this case, the MPLS label encapsulated in the packet's outer layer triggers routing convergence at network nodes when a link fails or recovers. Each network node recalculates the LSP. Due to differences in control plane performance across network nodes, the timing of delivering the LSP to the forwarding plane is inconsistent, leading to loops between some network nodes. The following briefly describes the loop scenarios that occur when a link fails and when a link recovers using SR-BE technology.
[0057] The following combination Figure 3 This section describes the scenario in which a loop occurs when an SR-BE link fails.
[0058] like Figure 3 As shown in the figure, a message is forwarded from node A to node D. Each network element deploys the IS-IS protocol and enables SR. The optimal SR-BE LSP (i.e., primary path) from node A to node D is A→D, and the backup path from node A to node D is A→B→C→D. A message is input from node A. When the A→D link is fault-free, the message is forwarded along the primary path A→D. If the A→D link fails, the service traffic at node A quickly switches to the backup path A→B→C→D, preventing a loop. The routes of each node then converge, but the route convergence of node A is faster than that of node B. That is, when the route converges on node A, the route convergence of node B may not have yet.
[0059] For example, node A's route converges, and the path sent to the forwarding plane after convergence is A→B→C→D. Node A's next-hop node is updated to node B, but node B's route may not have converged yet. In other words, node B's forwarding plane has not received the newly calculated LSP. Assuming the SR-BE LSP from node B to node D was originally B→A→D, it can be seen that traffic is flowing in the opposite direction at node B, forming a loop between nodes A and B. When node B's route converges, the converged SR-BE LSP becomes B→C→D, and the loop disappears.
[0060] The following combination Figure 4 This section describes the scenario in which a loop occurs when an SR-BE link recovers from a fault.
[0061] like Figure 4 As shown in the figure, before the link failure between A and D is restored, the SR-BE LSP from node A to node D is A→B→C→D, and the SR-BE LSP from node B to node D is B→C→D. When the link failure between A and D is restored, the routes of each network node converge, and the route convergence speed of node B may be faster than that of node A.
[0062] For example, the route of node B has completed convergence. After convergence, the path sent to the forwarding plane is B→A→D. The next hop node of node B is updated to node A. However, node A may not have completed convergence yet. The path from node A to node D is still A→B→C→D, thus forming a loop between nodes A and B. When the route of node A has completed convergence, the primary path after convergence is A→D, and the backup path is A→B→C→D. Packets from node A to node D are forwarded along the primary path A→D, and the loop disappears.
[0063] It should be understood that Figure 3 and Figure 4 The described scenario is only an example. In other embodiments, there may be a greater or lesser number of network nodes or other label switching paths on the forwarding path of the message, and the embodiments of the present application are not limited to this.
[0064] Another possible scenario is that SR-TE is deployed in the packet forwarding path, and the packet is encapsulated with a mixed label stack consisting of NodeSID and adjacent SID. In other words, the packet is forwarded based on Node SID in part and adjacent SID in part in the entire forwarding path. There are two types of SR-TE LSP forwarding label stacks: one is a label stack consisting of adjacent SIDs, and the other is a mixed label stack consisting of Node SID and adjacent SID. Figure 5As shown in the figure, a packet is forwarded from node A to node F. The packet is encapsulated with a mixed label stack consisting of the Node SID and the Adjacency SID. When a link fails, the packet is forwarded along the backup path. Subsequently, the routes of each node converge. Taking node B as an example, the label switching path for the packet from node A to node B is calculated based on the Node SID. After the route convergence of node A is completed, the path sent to the forwarding plane is A→B→C→D→E→F. That is, the next hop node is node B. However, the route convergence of node B has not yet completed. Therefore, the packet is forwarded along the original path B→A→F, forming a loop between nodes A and B.
[0065] Understandably, when a link fails or recovers in SR-BE technology, performance differences between devices on different network nodes or a busy control plane on a particular network node can lead to inconsistent convergence speeds. In other words, newly calculated LSPs are delivered to the forwarding plane at inconsistent times, leading to transient loops. These loops can affect service transmission, causing packet loss, port congestion, and other services of the same priority. Therefore, determining whether loops exist between nodes is crucial.
[0066] Based on this, the present application provides a loop detection method, which determines whether there is a loop between the first node and the previous hop node based on whether the interface when the first node receives the message is consistent with the output interface when forwarding the message. For example, if the two are consistent, it is determined that a loop exists, and the forwarding operation of the message can be adjusted in time to avoid problems such as port congestion and service packet loss.
[0067] Figure 6 6 is a flow chart of a loop detection method 600 provided in an embodiment of the present application. Figure 6 The method 600 shown may include S610 to S640 , and each step in the method 600 will be described in detail below.
[0068] It should be understood that Figure 6 The method shown is described with the first node as the execution subject. The first node can be an intermediate node. For an LSP channel, both ends of the first node can use Ethernet interfaces to connect to adjacent network nodes. In the embodiment of the present application, the previous hop node of the first node is recorded as the second node. The second node may be an intermediate node or an edge node, which is not limited in the embodiment of the present application. Among them, one end of the edge node uses an Ethernet interface to connect to the adjacent network node, and the other end uses a user interface to connect to the user equipment.
[0069] S610: A first node receives a message from a second node through a first interface.
[0070] The outer layer of the message encapsulates a Node SID, which is used to identify the destination node. The second node is the previous hop node of the first node, and the first interface is the interface through which the first node connects to the second node.
[0071] It should be understood that the destination node is the tail node of the SR-BE tunnel in the message forwarding path. For example, when the SR-BE tunnel is fully deployed on the message forwarding path, the destination node can be the tail node of the SR-BE tunnel, or it can also be called the destination node of the message. When the SR-TE tunnel with a mixed label stack composed of Node SID and Adjacency SID is deployed on the message forwarding path, in other words, the message is forwarded partially based on Node SID and partially based on Adjacency SID, then the destination node is the tail node of the path for forwarding messages based on Node SID and cannot be called the destination node of the message.
[0072] Optionally, the first node may forward the message based on traditional SR-BE, or may forward the message based on SRv6 BE.
[0073] When the first node forwards the message based on traditional SR-BE, the Node SID corresponds to the MPLS label, and the outer label of the message encapsulates the Node SID label. Specifically, the Node SID encapsulated in the outer layer of the message refers to the label corresponding to the Node SID determined based on the sum of the Node SID and the starting address of the SRGB (such as the inbound label and outbound label described above). For example, the outbound label carried by the first node when forwarding the message is the sum of the starting address of the SRGB of the next hop node and the Node SID of the destination node.
[0074] When the first node forwards the message based on SRv6 BE, the Node SID corresponds to the SRv6 SID. As mentioned above, in SRv6 BE technology, the destination address of the IPv6 header can be set as the SID. The Node SID encapsulated in the outer layer of the message refers to the SRv6 SID encapsulated based on the destination address.
[0075] It should be noted that there are two situations in which the second node sends the message to the first node:
[0076] One possible scenario is that the second node perceives that the main path used to forward the message has failed. For example, the second node perceives that the interface connecting the second node to the next-hop node on the main path used to forward the message is down. The second node determines that the link of the main path has failed, and the second node forwards the message along the backup path. The next-hop node on the backup path is the first node, that is, the second node sends the message to the first node. Accordingly, the first node receives the message from the second node from the first interface.
[0077] Another possible scenario is that the second node detects that the primary path link failure used to forward the message has recovered. For example, the second node can determine whether the link failure has recovered by determining whether the interface has recovered. At the time of the link failure, the second node's next hop node was the first node. When the link failure recovers and the second node's forwarding plane has not received a new LSP, the second node continues to forward the message along the path planned at the time of the link failure. That is, the second node sends the message to the first node, and the first node correspondingly receives the message from the second node via the first interface.
[0078] It should be understood that the first node can only sense the link failure of the adjacent node, such as Figure 3 When the link from node A to node D fails, the second node (such as node A) can sense the link failure and then switch to the backup path to forward the message, but the first node (such as node B) cannot sense the link failure from node A to node D. Therefore, node B cannot automatically switch to the backup path to forward the message like node A.
[0079] In the above two cases, the second node sends a message to the first node. Correspondingly, the first node receives the message from the second node through the first interface, where the first interface is the interface connecting the first node to the second node.
[0080] S620: The first node determines whether the outgoing interface for forwarding the message is the first interface based on the Node SID.
[0081] After receiving the message, the first node can record the interface for receiving the message, i.e., the first interface, and further determine the outbound interface for forwarding the message, wherein the outbound interface refers to the interface when the first node outputs the message. It can be understood that the first node determines that the outbound interface for forwarding the message is the first interface, which means that the first node determines that the interface for receiving the message and the interface for sending the message are the same interface, i.e., the next hop node of the first node is the second node. If the first node determines that the outbound interface for forwarding the message is not the first interface, in other words, the first node determines that the interface for receiving the message and the interface for sending the message are not the same interface, then there is no loop between the first node and the previous hop node, and there is no need to execute S630 and S640.
[0082] After receiving the message, the first node determines the outbound interface for forwarding the message based on the Node SID encapsulated in the message. As mentioned above, there are two possible scenarios for the Node SID encapsulated in the message: the Node SID corresponds to the MPLS label and the Node SID corresponds to the SRv6 SID. Figure 7 This is a schematic diagram of the first node determining the outbound interface for forwarding the message. Figure 7The process of the first node determining the outbound interface for forwarding the message based on the Node SID when the Node SID corresponds to the MPLS label is described in detail.
[0083] One possible implementation is that the first node determines the outgoing interface as the first interface. Figure 7 As shown, a first node receives a message from a first interface. The message is encapsulated with an incoming label that carries the Node SID of the destination node. The first node queries the label switching table based on the incoming label, determines the index of the next-hop forwarding table based on the label switching table, and then queries the next-hop forwarding table based on the index. The next-hop forwarding table contains relevant information about the next-hop nodes on the primary path and backup path, such as the outgoing label, the SRGB of the next-hop node, and the outgoing interface. The first node can then determine from the next-hop forwarding table that the outgoing interface of the primary path used to forward the message is the first interface.
[0084] As an optional step, the first node determines, based on the Node SID carried in the incoming label encapsulated in the packet, that the Node SID carried in the outgoing label is the same as the Node SID carried in the incoming label.
[0085] It should be understood that the Node SID corresponds to the MPLS label. That is, the outer layer of the message is encapsulated with a label determined by the first node based on the sum of the Node SID and the starting address of the SRGB. As can be seen from the above, there are two possible scenarios: one is to fully deploy SR-BE tunnels in the network, and the other is to deploy SR-TE tunnels based on a hybrid label stack composed of Node SID and Adjacency SID. Therefore, when an SR-TE tunnel based on a hybrid label stack composed of Node SID and Adjacency SID is deployed in the network, the Node SID and Adjacency SID are encapsulated in the outer layer of the message. The first node also needs to determine, based on the Node SID carried in the incoming label, that the Node SID carried in the outgoing label is the same as the Node SID carried in the incoming label. This avoids misjudging the existence of a loop in the path when SR-TE forwards based on the adjacency label.
[0086] Another possible implementation is that the first node determines that the Node SID carried in the outgoing label is the same as the Node SID carried in the incoming label, and the outgoing interface is the first interface. Figure 7As shown, the first node receives a message from the first interface. The outer layer of the message is encapsulated with an incoming label, and the incoming label carries the Node SID of the destination node. The first node calculates the Node SID based on the incoming label in the message header, that is, the difference between the incoming label and the local SRGB is the Node SID carried by the incoming label. Furthermore, the first node queries the label switching table based on the incoming label to obtain the next-hop forwarding table index. Based on the next-hop forwarding table index, the first node queries the next-hop forwarding table and determines the Node SID carried by the outgoing label based on the outgoing label on the primary path in the next-hop forwarding table, that is, the difference between the outgoing label and the SRGB. The first node can conclude that the Node SID carried by the outgoing label is the same as the Node SID carried by the incoming label, and that the outgoing interface is the first interface.
[0087] It should be noted that, in some embodiments, the information of the next hop forwarding table may be carried in the pending label switching table. In other words, the label switching table does not need to store the index of the next hop forwarding table, but directly stores the relevant information of the next hop node.
[0088] It should also be understood that in the above embodiment, the next hop forwarding table stores information related to the primary path and the backup path. In some embodiments, the next hop forwarding table only stores information related to the primary path, that is, no information related to the backup path can be found.
[0089] The following describes a process in which the first node determines an outbound interface for forwarding a message based on the Node SID when the Node SID corresponds to an SRv6 SID.
[0090] It should be noted that in SRv6 BE technology, SIDs can be collectively referred to as virtual private network (VPN) SIDs. Specifically, in IPv4 VPN scenarios, SIDs can be referred to as "END.DT4 SIDs," and in IPv6 VPN scenarios, SIDs can be referred to as "END.DT6 SIDs." In the embodiments of the present application, the Node SID corresponding to the SRv6 SID can be understood as the VPN SID encapsulated in the outer layer of the message based on the destination address. To facilitate a clear description of the embodiments of the present application, the SID in SRv6 BE technology will be referred to as the VPN SID below. It should be understood that the SRv6 SID described above can be understood as the SID in SRv6 BE technology, which has the same meaning as the VPN SID described herein.
[0091] The first node receives a message from a first interface. The Node SID encapsulated in the outer layer of the message is a VPN SID encapsulated based on the destination address. In other words, the outer layer of the message is the IP address of the destination node. The first node first determines whether the VPN SID is encapsulated in the outer layer of the message, and then determines whether the interface on which the message was received is consistent with the outgoing interface used to forward the message. Specifically, the first node queries the routing table based on the destination address, determines the index of the next-hop forwarding table based on the routing table, queries the next-hop forwarding table based on the index, and determines from the next-hop forwarding table that the outgoing interface of the primary path used to forward the message is the first interface.
[0092] S630: The first node determines that a loop exists in the forwarding path of the message.
[0093] In S620, the first node determines whether the outgoing interface used to forward the message is the first interface. If the outgoing interface used to forward the message is the first interface, S630 and S640 are executed; if the outgoing interface used to forward the message is not the first interface, there is no loop in the forwarding path of the message, and forwarding can continue along the original path.
[0094] The first node determines that there is a loop in the packet forwarding path. There are two possible designs:
[0095] One possible design is that after the first node determines that the outgoing interface for forwarding the message is the first interface based on the Node SID, it determines that a loop exists in the forwarding path of the message, that is, a loop exists between the first node and the second node.
[0096] Another possible design is that the first node determines, based on the Node SID, that the outgoing interface used to forward the message is the first interface and that the Node SID carried in the incoming label of the message encapsulation is the same as the Node SID carried in the outgoing label. Then, it determines that there is a loop in the forwarding path of the message, that is, a loop exists between the first node and the second node.
[0097] S640: The first node adjusts the forwarding operation of the message.
[0098] After the first node determines that a loop exists in the forwarding path of the message, it can adjust the forwarding operation of the message in the following two ways to prevent the first node from forwarding the message from the first interface to the second node.
[0099] One possible implementation is that the first node directly discards the message to avoid port congestion, thereby affecting services of other priorities, until the forwarding plane of the first node receives a new LSP and forwards the message along the new path.
[0100] In another possible implementation, the first node forwards the packet through a backup path. After the first node determines that there is a loop in the forwarding path of the packet, the first node forwards the packet based on a backup path stored in the next-hop forwarding table for forwarding the packet. The first node determines a second interface connected to a next-hop node according to the backup path for forwarding the packet, and forwards the packet from the second interface to the destination node. The path from the first node to the destination node through the second interface is the backup path for forwarding the packet, that is, when the backup path can be queried from the next-hop forwarding table, the first node forwards the packet through the backup path. Until the forwarding plane of the first node receives a new LSP, the packet is forwarded along the new path.
[0101] It can be understood that the above two implementations are only two examples of adjusting the forwarding operation of the packet. In some embodiments, the first node can determine whether there is a backup path based on the next-hop forwarding table, and further select how to process the packet. For example, after the first node determines that there is a loop in the forwarding path of the packet, the first node further determines whether a backup path for forwarding the packet can be queried from the next-hop forwarding table. If the first node queries the backup path for forwarding the packet, the packet is forwarded according to the backup path; if the backup path for forwarding the packet is not queried, the packet is discarded, avoiding port congestion and affecting other priority services.
[0102] Figure 8 is an example of forwarding the packet by the first node. It should be noted that, Figure 8 is a detailed process of forwarding the packet by the first node based on the SR-BE when the link between the A node and the D node fails.
[0103] As Figure 8 shown, the A node is taken as the second node, and the B node is taken as the first node for example. The range of the SRGB of the A node is [1000, 4000], the range of the SRGB of the B node is [2000, 5000], and the destination node is the D node, that is, the tail node of the SR-BE tunnel is the D node. The A node senses the link failure between the A node and the D node, and switches to the backup path A→B→C→D to forward the packet. Subsequently, the routing of each node converges, and the convergence speed of the A node is faster than that of the B node, that is, the A node has already issued the new LSP calculated to the forwarding plane, that is, A→B→C→D. For the B node, the main path before convergence is B→A→D, and the backup path is B→C→D. The B node has not issued the new SR-BE LSP to the forwarding plane.
[0104] Node B receives a packet from node A through interface 3 (the first interface). Based on the incoming label 2100 encapsulated in the packet, it queries the label switching table. The next-hop forwarding table index is 10. Node B searches the next-hop forwarding table based on index 10 and finds that, when forwarding the packet along the primary path, the outgoing label is 2100, the SRGB is 2000, and the outgoing interface is interface 3. The outgoing label carries the Node SID 2100-2000=100, while the incoming label carries the Node SID 2100-2000=100. Interface 3 is the first interface, indicating a loop between nodes A and B.
[0105] As can be seen from the next-hop forwarding table in the figure, the next-hop forwarding table stores information about the backup path. Node B can forward the message from interface 4 (i.e., the second interface), with the next-hop node being node C. For node B, the message is forwarded along the backup path until node B completes convergence and the new SR-BE LSP is delivered to the forwarding plane. It should be understood that node B swaps the incoming label 2100 encapsulated in the message with the outgoing label 3100. When node B forwards the message from interface 4, the outgoing label encapsulated is 3100.
[0106] After convergence is complete, for node B, the new SR-BE LSP is delivered to the forwarding plane. The new SR-BE LSP is B→C→D, and packets are forwarded along B→C→D.
[0107] It should be understood that for node C, whether a loop exists between node C and node B can also be determined using the above method. For the sake of brevity, this will not be described in detail here.
[0108] Figure 9 This is another example of the first node forwarding a message. Figure 9 This is the detailed process of forwarding messages by the first node when the link from node A to node D recovers based on SR-BE message forwarding.
[0109] like Figure 9As shown in the figure, node A is the second node and node B is the first node. Node A's local SRGB range is [1000, 4000], and node B's local SRGB range is [2000, 5000]. The destination node is node D. Node A detects that the link failure from node A to node D has recovered and the routes of each network node have converged. It makes the following assumption: node A's convergence speed is slower than node B's. In other words, node B has already sent the calculated new SR-BE LSP to the forwarding plane. That is, the primary path is B→A→D, and the backup path is B→C→D. Before convergence, the path from node B to node D is B→C→D. For node A, the pre-convergence SR-BE LSP is A→B→C→D. Since node A has not yet completed convergence and has not sent the new SR-BE LSP to the forwarding plane, node A continues to send packets to node B.
[0110] Node B has completed convergence, and its forwarding plane has received a new SR-BE LSP. Node B receives a packet from Node A through interface 3 (the first interface). Node B queries the label switching table based on the incoming label 2100 encapsulated in the packet's outer layer. The next-hop forwarding table index is 10. Node B queries the next-hop forwarding table based on index 10. When forwarding the packet along the primary path, the outgoing label is 2100, the SRGB is 2000, and the outgoing interface is interface 3. The outgoing label carries the Node SID 2100-2000=100, while the incoming label carries the Node SID 2100-2000=100. Interface 3 is the first interface, indicating a loop between Nodes A and B.
[0111] As shown in the figure, the next-hop forwarding table stores information about the backup path. Node B can forward the packet from interface 4 (i.e., the second interface), with the next-hop node being node C. For node A, when its forwarding plane receives the new SR-BE LSP, the packet is forwarded along the new SR-BE LSP. It should be understood that node B swaps the incoming label 2100 encapsulated in the packet with the outgoing label 3100. When node B forwards the packet from interface 4, the outgoing label encapsulated is 3100.
[0112] Based on the above technical solution, by determining whether the interface when the first node receives the message is consistent with the output interface when forwarding the message, it is determined whether there is a loop in the forwarding path of the message. If there is a loop in the forwarding path of the message, the forwarding path of the message is further adjusted, such as forwarding the message along the backup path, discarding the message, etc., thereby timely destroying the loop in the message forwarding path and avoiding port congestion, service packet loss and other problems.
[0113] The following will be combined Figure 10 and Figure 11The loop detection device provided in the embodiment of the present application is described in detail.
[0114] Figure 10 FIG is a schematic block diagram of a loop detection device 1000 provided in an embodiment of the present application. Figure 10 As shown, the device 1000 may include: a transceiver unit 1010 and a processing unit 1020. Each unit in the device 1000 may be used to implement Figure 6 The corresponding process executed by the first node in the method 600 is shown.
[0115] When the apparatus 1000 is used to execute the steps performed by the first node in the above-described method embodiment, the transceiver unit 1010 may be configured to receive a message from the second node via the first interface, the message encapsulated with a Node SID that identifies the destination node; the processing unit 1020 may be configured to determine, based on the Node SID, that the outgoing interface for forwarding the message is the first interface; and the processing unit 1020 may also be configured to determine whether a loop exists in the forwarding path of the message. For details, please refer to the detailed description in the method embodiment and are not further described here.
[0116] It should be understood that the specific process of each unit executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.
[0117] It should also be understood that the division of units in the embodiments of the present application is illustrative and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processor, or may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0118] Figure 11 1 is another schematic block diagram of a loop detection device 1100 provided in an embodiment of the present application. Device 1100 may be a system-on-a-chip, or may be a device configured with a system-on-a-chip for implementing the loop detection functionality described in the method embodiments described above. In the embodiments of the present application, the system-on-a-chip may consist of a chip or may include a chip and other discrete components.
[0119] like Figure 11 As shown, the apparatus 1100 may include a processor 1110 and a communication interface 1120. The communication interface 1120 may be used to communicate with other devices via a transmission medium, so that the apparatus in the apparatus 1100 may communicate with other devices. The communication interface 1120 may be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing transceiver functions. The processor 1110 may use the communication interface 1120 to input and output data, and to implement Figure 6 The loop detection method described in the corresponding embodiment. Specifically, the device 1100 can be used to implement the function of the first node in the above method embodiment.
[0120] For example, if the apparatus 1100 is used to implement the functions of the first node in the method provided in an embodiment of the present application, the processor 1110 may be used to control the communication interface 1120 to receive a message from the second node, where the message is encapsulated with a NodeSID, which is used to identify the destination node. The processor 1110 may also be used to determine, based on the Node SID, that the outgoing interface for forwarding the message is the first interface. The processor 1110 may also be used to determine whether a loop exists in the forwarding path of the message. For details, please refer to the detailed description in the method embodiment and will not be repeated here.
[0121] Optionally, the device 1100 further includes at least one memory 1130 for storing program instructions and / or data. The memory 1130 is coupled to the processor 1110. Coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units, or modules, which can be electrical, mechanical, or other forms, and is used for information exchange between devices, units, or modules. The processor 1110 may operate in conjunction with the memory 1130. The processor 1110 may execute program instructions stored in the memory 1130. At least one of the at least one memory may be included in the processor.
[0122] The specific connection medium between the processor 1110, the communication interface 1120 and the memory 1130 is not limited in the embodiment of the present application. Figure 11 The processor 1110, the communication interface 1120 and the memory 1130 are connected via a bus 1140. The bus 1140 is connected to the processor 1110, the communication interface 1120 and the memory 1130. Figure 11 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0123] The present application also provides a computer program product, which includes: a computer program (also referred to as code or instruction), which, when executed, causes a computer to execute Figure 6 The method of the embodiment shown.
[0124] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes Figure 6 The method of the embodiment shown.
[0125] It should be understood that the processor in the embodiments of the present application can be an integrated circuit chip with processing capability. In the implementation process, each step of the method embodiments described above can be completed by the integrated logic circuit or the instruction in the form of software in the processor. The processor described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or can be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.
[0126] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0127] The terms "unit," "module," and the like used in this specification may be used to refer to a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
[0128] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, and can be electrical, mechanical, or other forms.
[0129] The units described as discrete components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0131] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can 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 (programs). When the computer program instructions (program) are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0132] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0133] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A loop detection method, characterized in that: include: The first node receives a message from the second node through the first interface, wherein the message is encapsulated with a node segment identifier (SID), where the node SID is used to identify a destination node, and the node SID corresponds to a Multi-Protocol Label Switching (MPLS) label, or a Segment Routing (SRv6) SID based on the sixth version of the Internet Protocol (IPv6); The first node determines, based on the node SID, that an outbound interface for forwarding the message is the first interface; The first node determines that a loop exists in a forwarding path of the message.
2. The method according to claim 1, wherein If the node SID corresponds to an MPLS label, before the first node determines that a loop exists in the forwarding path of the message, the method further includes: The first node determines, based on the node SID carried in the incoming label encapsulated in the message, that the node SID carried in the outgoing label is the same as the node SID carried in the incoming label.
3. The method according to claim 1 or 2, wherein: The first node forwards the message based on best effort segment routing (SR-BE).
4. The method according to claim 1, wherein If the node SID corresponds to an IPv6 segment routing SRv6 SID, the method further includes: The first node forwards the message based on best effort segment routing SRv6 BE of IPv6.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The first node avoids forwarding the message to the second node through the first interface.
6. The method according to claim 5, wherein The first node avoiding forwarding the message to the second node through the first interface includes: The first node forwards the message to the destination node through the second interface, and the path from the first node to the destination node through the second interface is a backup path for forwarding the message.
7. The method according to claim 5, wherein The first node avoiding forwarding the message to the second node through the first interface includes: The first node discards the message.
8. A loop detection device, characterized in that: include: a transceiver unit, configured to receive a message from the second node through the first interface, wherein the message is encapsulated with a node segment identifier (SID), wherein the node SID is used to identify a destination node, and the node SID corresponds to a Multi-Protocol Label Switching (MPLS) label, or a Segment Routing (SRv6) SID based on the sixth version of the Internet Protocol (IPv6); a processing unit, configured to determine, based on the node SID, that an outbound interface for forwarding the message is the first interface; The processing unit is further configured to determine whether a loop exists in the forwarding path of the message.
9. The device according to claim 8, wherein If the node SID corresponds to an MPLS label, before the first node determines that a loop exists in the forwarding path of the message, the processing unit is further configured to: Based on the node SID carried in the incoming label encapsulated in the message, it is determined that the node SID carried in the outgoing label is the same as the node SID carried in the incoming label.
10. The device according to claim 8 or 9, characterized in that The processing unit is specifically configured to forward the message based on best effort segment routing (SR-BE).
11. The device according to claim 8, wherein If the node SID corresponds to an IPv6 segment routing SRv6 SID, the processing unit is specifically configured to forward the message based on IPv6 best effort segment routing SRv6 BE.
12. The device according to any one of claims 8 to 11, characterized in that The processing unit is further configured to: Avoid forwarding the message to the second node through the first interface.
13. The device according to claim 12, wherein The processing unit is specifically configured to: The message is forwarded to the destination node through the second interface, wherein the path to the destination node through the second interface is a backup path for forwarding the message.
14. The device according to claim 12, wherein The processing unit is specifically configured to discard the message.
15. A loop detection device, characterized in that: include: a memory storing instructions; The processor, when the instructions are executed by the processor, causes the detection device to perform the method according to any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that The invention comprises a computer program which, when run on a processor, performs the method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, performs the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Communication method, communication device and communication system
CN113055295A