Connectivity detection method and device
By obtaining and carrying the corresponding path information in the SRv6 TE Policy, the problem of inconsistency between the outbound and return paths is resolved, and accurate connectivity detection of the SRv6 TE Policy is achieved.
Patent Information
- Application Number
- CN202310173242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-02-10
AI Technical Summary
In existing technologies, when detecting forwarding paths, IPv6-based Segment Routing (SRv6) technology fails to detect the inbound and return paths, making it impossible to truly detect the connectivity of SRv6 TE Policies and prone to misjudgment in unrelated link situations.
After receiving the first message at the first node, the corresponding second path information is obtained according to the first path information, and the second path information is carried in the second message, so that the second message is forwarded on the second path, ensuring that the outbound path and the return path are consistent.
This enables true detection of SRv6 TE Policy connectivity, avoids misjudgments in unrelated link situations, and ensures the accuracy of detection results.
Smart Images

Figure CN116389310B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a connectivity detection method and device. Background Art
[0002] Currently, Segment Routing (SR) is a relatively active technology, widely used in many solutions and centralized procurement test networks. Segment Routing IPv6 (SRv6) is a protocol designed based on source routing to forward IPv6 packets on the network.
[0003] SRv6, based on the success of IPv6, inserts a routing extension header, the Segment Routing Header (SRH), into IPv6 packets. SRv6 defines some IPv6 addresses as instantiated segment identifiers (SIDs). Each SID has its own unique role and function. Endpoint nodes continuously update the destination address and address stack to achieve hop-by-hop forwarding, simplifying VPNs and enabling flexible path planning.
[0004] Segment Routing Traffic Engineering Policy (SRv6 TE Policy) provides a flexible forwarding path selection method to meet diverse user forwarding requirements. When multiple paths exist between the source and destination nodes in an SR network, using SRv6 TE Policy to select a forwarding path not only facilitates network management and planning but also effectively reduces forwarding pressure on network devices.
[0005] To ensure the reliability of an SRv6 TE Policy, you can use SRv6 TE Policy traceroute (Tracert) to test the reachability of each node within the SRv6 TE Policy. This not only verifies the reachability of each node within the SRv6 TE Policy, but also helps locate faulty nodes in the network.
[0006] like Figure 1 As shown, Figure 1 This is a schematic diagram of an SRv6 network. Figure 1In the example, SRv6 TE Policy A is configured on PE1, with the specified path being PE1-PE2(End.X)-PE3(End.X)-PE4(End.X), as shown by the solid curve in the figure. A traceroute is performed on PE1 for SRv6 TE Policy A. PE1 generates a UDP packet and directs it to SRv6 TE Policy A. The UDP packet is then forwarded to each node within SRv6 TE Policy A along the specified path. After receiving the UDP packet, each node checks the Hop Limit field in the IPv6 header and the SL field in the SRH, depending on its role, and either forwards the UDP packet or sends an ICMPv6 Time Exceeded message to PE1.
[0007] When the UDP message reaches PE4, PE4 sends an ICMPv6 message to PE1, and calculates the return path based on the cost value of the link. Figure 1 In the example, PE4 calculates the return path as PE4-PE2-PE1. PE4 sends an ICMPv6 time exceeded message to PE1 based on the calculated return path. This mismatch between the outbound and return paths leads to the following issues: 1) After the ICMPv6 time exceeded message reaches PE1, because it may carry the IP address of PE4's loopback interface, PE1 can determine that the sent UDP packet reached PE4. However, PE1 cannot determine which PE4 interface the UDP packet arrived on. This means that the traceroute SRv6 TE Policy can reach the device level but not the interface level. 2) The return path is not the SRv6 TE Policy A path. Congestion on an unrelated link (for example, PE4-PE2) can cause packet loss, but the actual SRv6 TE Policy A path is normal. This results in a different detection result than expected, and the true status of the SRv6 TE Policy A path is not detected.
[0008] To overcome this problem, PE4 can be forced to set the source IP address of the ICMPv6 timeout message to the incoming interface of the traceroute. This allows PE1 to determine the specific interface on PE4 where the UDP packet arrived after receiving the ICMPv6 timeout message. However, this still remains unresolved for problem 2. Summary of the Invention
[0009] In view of this, the present application provides a connectivity detection method and apparatus to ensure that the outbound path and return path of the traceroute SRv6 TE Policy are consistent, thereby ensuring the true connectivity detection of the SRv6 TE Policy.
[0010] In a first aspect, the present application provides a connectivity detection method, the method being applied to a first node, the first node including a first interface, the method comprising:
[0011] Receiving a first message through the first interface, where the first message includes a first SRH, the first SRH includes first path information, and the first path information is used to indicate a first path from the second node to the first node;
[0012] acquiring, locally, second path information corresponding to the first path information based on the first path information, the second path information being used to indicate a second path from the first node to the second node, the first path and the second path passing through the same node;
[0013] A second message is sent to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
[0014] In a second aspect, the present application provides a connectivity detection device, the device being applied to a first node, the first node including a first interface, the device including:
[0015] a receiving unit, configured to receive a first message through the first interface, where the first message includes a first SRH, the first SRH includes first path information, and the first path information is used to indicate a first path from the second node to the first node;
[0016] an acquiring unit, configured to locally acquire, based on the first path information, second path information corresponding to the first path information, the second path information being used to indicate a second path from the first node to the second node, the first path and the second path passing through the same node;
[0017] A sending unit is configured to send a second message to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
[0018] In a third aspect, the present application provides a network device comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0019] Therefore, using the connectivity detection method and device provided in the present application, the first node receives a first message through a first interface, where the first message includes a first SRH, and the first SRH includes first path information, where the first path information is used to indicate the first path for the second node to reach the first node; based on the first path information, the first node obtains second path information corresponding to the first path information locally, where the second path information is used to indicate the second path for the first node to reach the second node, and the first path and the second path pass through the same node; through the first interface, the first node sends a second message to the second node, where the second message includes a second SRH, and the second SRH includes second path information, so that the second message is forwarded on the second path and reaches the second node.
[0020] In this way, the first node uses the first path information to obtain the corresponding second path information and sends the second path information to the first node in a second message. This ensures that the traceroute SRv6 TE Policy's outbound and return paths are consistent. This ensures that the SRv6 TE Policy's connectivity is truly detected, preventing misjudgments caused by irrelevant link conditions. This solves the existing problem of being unable to truly detect SRv6 TE Policy connectivity. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of an existing SRv6 network;
[0022] Figure 2 A flowchart of a connectivity detection method provided in an embodiment of the present application;
[0023] Figure 3 Schematic diagram of SRv6 networking provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the mapping relationship between paths provided in an embodiment of the present application;
[0025] Figure 5 Schematic diagram of the SRH structure of the message provided in the embodiment of the present application;
[0026] Figure 6 A structural diagram of a connectivity detection device provided in an embodiment of the present application;
[0027] Figure 7 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION
[0028] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0029] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the corresponding listed items.
[0030] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0031] The following is a detailed description of a connectivity detection method provided in an embodiment of the present application. Figure 2 , Figure 2 Flowchart of a connectivity detection method provided in an embodiment of the present application. The method is applied to a first node, and the connectivity detection method provided in an embodiment of the present application may include the following steps.
[0032] Step 210: Receive a first message through the first interface, where the first message includes a first SRH, and the first SRH includes first path information, where the first path information is used to indicate a first path from the second node to the first node.
[0033] Specifically, multiple paths have been established between the first node and the second node, for example, a first path and a second path. The source node of the first path is the second node, and the destination node is the first node; the source node of the second path is the first node, and the destination node is the second node. Furthermore, the first path and the second path pass through the same node, and the first path and the second path are forward and reverse paths to each other. In the embodiment of the present application, the second path can be a forward path, and the first path can be a reverse path.
[0034] An SRv6 TE Policy has been configured in the second node (referred to herein as the second SRv6 TE Policy to distinguish it from the first SRv6 TE Policy configured in the first node). To verify the connectivity of the second SRv6 TE Policy, the second node generates a UDP packet. The second node obtains the first path information and encapsulates the first SRH in the outer layer of the UDP packet. The first SRH includes the first path information, which is used to indicate the first path from the second node to the first node. The second node encapsulates the first IPv6 basic header in the outer layer of the first SRH. The first IPv6 basic header includes a source address and a destination address. The source address is the IP address of the second node, and the destination address is the SID indexed in the first SRH corresponding to the SL value.
[0035] It should be noted that the encapsulation process is broken down into multiple steps to explain the encapsulation process in detail. In actual applications, the second node encapsulates an IPv6 header in the UDP outer layer. The IPv6 header includes an SRH, that is, the first IPv6 basic header and the first SRH are collectively referred to as an IPv6 header.
[0036] It is understood that the second SRv6 TE Policy includes a BSID, a color, and an endpoint. The BSID indicates the ingress node's SID; the color indicates the color attribute of the forwarding path, particularly for distinguishing multiple SRv6 TE Policies between the same source and destination nodes; and the endpoint indicates the IPv6 address of the SRv6 TE Policy's destination node.
[0037] An SRv6 TE Policy consists of multiple candidate paths with different priorities. Each candidate path includes one or more forwarding paths identified by a SID list.
[0038] Optionally, in this embodiment of the present application, the second node obtains its own SID, the IP address of the first node, and the SID of the endpoint node along the first path from the second SRv6 TE Policy. The second node indexes the IP addresses or SIDs of the nodes stored in the first SRH in descending order.
[0039] Optionally, the first IPv6 basic header further includes a Hop Limit field (the value of the Hop Limit field may be a first value), and the first SRH further includes an SL field (the value of the SL field may be a second value). The Hop Limit field and the SL field are configured in accordance with existing protocol specifications and are not repeated here. The values of the first value and the second value may be determined based on the actual networking situation.
[0040] After generating the first message, the second node sends the first message to the first node on the first path. The first node receives the first message through the first interface.
[0041] It should be noted that the second node can verify the connectivity of the entire first path or a portion of the first path indicated by the second SRv6 TE Policy. For example, if the first path includes four nodes, the second node, as the source node, can verify the connectivity of the sub-path formed between itself and the second node, and the sub-path formed between itself and the second and third nodes. Alternatively, the second node can verify the connectivity of the entire path formed between itself and the second, third, and fourth nodes.
[0042] Step 220: Based on the first path information, obtain second path information corresponding to the first path information from a local device, where the second path information indicates a second path from the first node to the second node, and the first path and the second path pass through the same node.
[0043] Specifically, as described in step 210, after receiving the first message, the first node first identifies the Hop Limit field and the SL field. If the Hop Limit field and the SL field are both 0, the first node searches the local SID table and identifies whether the destination address is its own SID.
[0044] If the destination address is the first node's SID, the first node passes verification. At this point, the first node generates an ICMPv6 Time Exceeded message and obtains the first path information from the first message. Based on the first path information, the first node locally obtains second path information corresponding to the first path information. The second path information indicates the second path from the first node to the second node.
[0045] Optionally, in one implementation, the first node locally configures the first SRv6 TE Policy through user input or configuration instructions issued by the controller. In another implementation, the first node calculates the second path to the second node using its own configured IGP module.
[0046] Optionally, in an embodiment of the present application, the first node obtains its own SID, the IP address of the second node, and obtains the SID of the node whose node role is an end node (Endpoint) and through which the second path passes from the first SRv6 TE Policy or the calculated second path.
[0047] It should be noted that, as described in step 210, the second node can perform connectivity verification on the entire first path or a portion of the first path indicated by the second SRv6 TE Policy. Therefore, in this embodiment of the present application, the second path information obtained by the first node must correspond one-to-one with the first path information. That is, the number of nodes included in the second path information must correspond one-to-one with the number of nodes included in the first path information.
[0048] For example, a first path includes four nodes, with the second node being the source node and the first node being the destination node. A second path includes a fourth node, with the first node being the source node and the second node being the destination node. If the first path information indicates a subpath formed by the second node on the first path and the second node (i.e., the first node), then the second path information indicates a subpath formed by the second node (i.e., the first node) and the second node on the second path.
[0049] For example, the first path information indicates the sub-path formed by the second node, the second node, and the third node (that is, the first node) on the first path, and the second path information indicates the sub-path formed by the third node (that is, the first node) and the second node, and the second node on the second path.
[0050] For example, the first path information indicates the full path formed by the second node on the first path and the second node, the third node, and the fourth node (that is, the first node), and the second path information indicates the full path formed by the fourth node on the second path (that is, the first node) and the third node, the second node, and the second node.
[0051] Step 230: Send a second message to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
[0052] Specifically, as described in step 220, after obtaining the second path information, the first node encapsulates a second SRH, which includes the second path information, in the outer layer of the ICMPv6 message. The first node encapsulates a second IPv6 basic header in the outer layer of the second SRH. The second IPv6 basic header includes a source address and a destination address. The source address is the IP address of the first interface, and the destination address is the SID indexed in the second SRH corresponding to the SL value.
[0053] Optionally, the second IPv6 basic header further includes a Hop Limit field (the value of the Hop Limit field may be a first value), and the second SRH further includes an SL field (the value of the SL field may be a second value). The Hop Limit field and the SL field are configured in accordance with existing protocol provisions and are not repeated here. In the embodiment of the present application, since the second path and the first path are forward and reverse paths, the value of the Hop Limit field and the value of the SL field included in the second IPv6 basic header are the same as the value of the Hop Limit field and the value of the SL field included in the first IPv6 basic header.
[0054] After generating the second message, the first node sends the second message to the second node via the first interface and on the second path, so that the second message is forwarded on the second path and reaches the second node.
[0055] The second node determines whether it receives the second message within a preset time. If it receives the second message within the preset time, the second node determines that some or all nodes in the first SRv6 TE Policy are reachable and there are no faulty nodes. If it does not receive the second message within the preset time, the second node determines that there are unreachable nodes in the second SRv6 TE Policy. The second node can also locate the faulty node based on the second message.
[0056] Therefore, using the connectivity detection method provided in the present application, the first node receives a first message through a first interface, where the first message includes a first SRH, where the first SRH includes first path information, where the first path information is used to indicate a first path for the second node to reach the first node; based on the first path information, the first node obtains second path information corresponding to the first path information locally, where the second path information is used to indicate a second path for the first node to reach the second node, where the first path and the second path pass through the same node; through the first interface, the first node sends a second message to the second node, where the second message includes a second SRH, where the second SRH includes second path information, so that the second message is forwarded on the second path and reaches the second node.
[0057] In this way, the first node uses the first path information to obtain the corresponding second path information and sends the second path information to the first node in a second message. This ensures that the traceroute SRv6 TE Policy's outbound and return paths are consistent. This ensures that the SRv6 TE Policy's connectivity is truly detected, preventing misjudgments caused by irrelevant link conditions. This solves the existing problem of being unable to truly detect SRv6 TE Policy connectivity.
[0058] Optionally, in the embodiment of the present application, the process of the first node configuring the SRv6 TE Policy locally is also included.
[0059] Specifically, in one implementation, a user can enter a configuration instruction to the first node through a command line. The configuration instruction includes the second SRv6 TE Policy and a traffic diversion identifier. The SRv6 TE Policy includes the second path information. The first node receives the configuration instruction and obtains the second SRv6 TE Policy and traffic diversion identifier from it.
[0060] The first node locally configures the second SRv6 TE Policy.
[0061] In the embodiment of the present application, the traffic diversion identifier is used to enable the first node to divert the second message to the second SRv6 TE Policy and forward it on the second path when the first node sends the second message to the second node.
[0062] To ensure that the forward and reverse paths pass through the same node, you can directly configure the SRv6 TE Policy representing the reverse path on the first node and specify in the configuration command that ICMPv6 Time Exceeded messages be directed to the SRv6 TE Policy.
[0063] In another implementation, the controller may issue a configuration instruction to the first node, the configuration instruction including the second SRv6 TE Policy and the traffic diversion identifier, the SRv6 TE Policy including the second path information. The first node receives the configuration instruction and obtains the second SRv6 TE Policy and the traffic diversion identifier from the instruction.
[0064] The first node locally configures the second SRv6 TE Policy.
[0065] In the embodiment of the present application, the traffic diversion identifier is used to enable the first node to divert the second message to the second SRv6 TE Policy and forward it on the second path when the first node sends the second message to the second node.
[0066] It should be noted that the controller manages all network devices within the network, thus achieving visual and simplified network management. The controller uses BGP-LS messages to collect topological attributes of the IGP domain, including neighbor link information and the SID information of each node.
[0067] To ensure that the forward and reverse paths pass through the same node, the controller can directly configure the SRv6 TE Policy representing the reverse path on the first node and, in the configuration command, specify that ICMPv6 Time Exceeded messages be directed to the SRv6 TE Policy. The controller can also automatically control the configuration and deletion of SRv6 TE Policies.
[0068] Optionally, in an embodiment of the present application, after receiving the first message, the first node further performs a process of locally calculating the second path.
[0069] Specifically, using the IGP protocol, the first node obtains neighbor information for each neighbor node in the network. This neighbor information includes neighbor link information and the node's SID information. Using the first path information and the neighbor information, the first node calculates a second path to the second node and obtains second path information from the second path. The first node establishes a mapping relationship between the second path information and the first path information and stores the mapping relationship locally.
[0070] It is understood that the IGP module within the first node can complete the process of calculating the second path. After the IGP module calculates the second path, the first node can encapsulate the ICMPv6 message based on the obtained second path information to obtain the second message, and forward the second message along the second path through the first interface.
[0071] The following is a detailed description of a connectivity detection method provided in an embodiment of the present application. Figure 3 , Figure 3 This is a schematic diagram of the SRv6 network provided in the embodiment of this application. Figure 3 In Figure 1, the SRv6 network includes four nodes: PE1, PE2, PE3, and PE4. PE1 establishes connections with PE2 and PE3, respectively; PE4 establishes connections with PE2 and PE3, respectively; and PE2 establishes a connection with PE3.
[0072] SRv6 TE Policy A has been configured on PE1. To verify the connectivity of SRv6 TE Policy A, PE1 initiates a tracert request to PE4 and constructs a UDP packet. The destination UDP port number of this UDP packet is a port number that cannot be used by any application on the destination end.
[0073] In this embodiment of the present application, PE1 verifies the full path indicated by SRv6 TE Policy A as an example. It is understood that the process of PE1 verifying a partial path indicated by SRv6 TE Policy A is the same as the process of verifying the full path, and is not repeated here.
[0074] Based on SRv6 TE Policy A, PE1 determines the forward forwarding path planned by SRv6 TE Policy A as PE1-PE2-PE3-PE4. PE1 obtains its own SID (for example, 2022:c6:0:9:971::), PE4's IP address (for example, 100::6), PE2's SID (for example, 2022:c6:0:7:781::), and PE3's SID (for example, 2022:c6:0:8:861::).
[0075] PE1 encapsulates the first SRH on the outer layer of the UDP message and the first IPv6 basic header on the outer layer of the first SRH. The first IPv6 basic header includes the source address, destination address, and Hop Limit fields. The source address is PE1's IP address, the destination address is PE2's SID, and the Hop Limit field value is 3. The first SRH includes a SID list and an SL field. The SID list stores PE4's IP address, PE3's SID, PE2's SID, and PE1's SID in descending order on the forward forwarding path. The first SRH also includes an SL field, and the SL field value is 2.
[0076] After generating the first IP packet, PE1 forwards the first IP packet to PE2. At the same time, PE1 starts a timer locally and determines whether it has received the IP packet fed back by PE4 within the preset time of the timer.
[0077] After receiving the first IP packet, PE2 identifies the value of the Hop Limit field, which is now 2. PE2 then identifies the destination address and determines it is its own SID. PE2 also identifies the value of the SL field, which is 2. PE2 updates the SL field to 1 and, based on the SID list, updates the destination address to PE3's SID. PE2 generates a second IP packet and forwards it to PE3.
[0078] After receiving the second IP packet, PE3 identifies the value of the Hop Limit field. Since the Hop Limit field is now set to 1, PE3 identifies the destination address and determines it is its own SID. PE3 also identifies the value of the SL field, which is set to 1. PE3 updates the SL field to 0 and, based on the SID list, updates the destination address to PE4's IP address. PE3 generates a third IP packet and forwards it to PE4.
[0079] After receiving the third IP packet, PE4 identifies the value of the Hop Limit field. Since the Hop Limit field is now 0, PE4 then identifies the SL field as 0. PE4 then identifies the destination address and determines it is its own IP address. PE4 constructs an ICMPv6 Time Exceeded message. Simultaneously, PE4 obtains the SID list from the first SRH. Based on the SID list, PE4 determines the forward forwarding path for the third IP packet and obtains the forward forwarding path information.
[0080] Based on the forward forward path information and neighbor information of each neighbor node in the network, which includes neighbor link information and node SID information, PE4 calculates the reverse forward path to PE1: PE4-PE3-PE2-PE1. PE4 obtains its own SID (for example, 2022:c6:0:6:681::), PE1's IP address (for example, 100::9), PE2's SID (for example, 2022:c6:0:7:791::), and PE3's SID (for example, 2022:c6:0:8:871::).
[0081] Optionally, in an embodiment of the present application, PE4 obtains information about the reverse forwarding path by calculating the reverse forwarding path. In actual applications, if SRv6 TE Policy B has been configured (user input or control and delivery) in PE4, PE4 can obtain information about the reverse forwarding path through SRv6 TE Policy B, and subsequently direct the generated fourth IP packet to SRv6 TE Policy B.
[0082] It is understandable that after obtaining the information of the reverse forwarding path, PE4 may locally establish a mapping relationship between the information of the forward forwarding path and the information of the reverse forwarding path, and store the mapping relationship locally.
[0083] In the embodiment of the present application, the mapping relationship between the forward forwarding path and the reverse forwarding path can be as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of the mapping relationship between paths provided in the embodiment of this application. Figure 4 In the forward and reverse paths, the specific correspondence of SIDs that are consistent is: A-->B(END.X) in the forward forward path, and B-->A(END.X) in the corresponding reverse forward forward path; A-->B(END) in the forward forward path, and B-->A(END) in the corresponding reverse forward forward path; except for index 0 that marks the end point, the order of the remaining path indices is reversed.
[0084] PE4 encapsulates a second SRH on the outer layer of the ICMPv6 timeout message and a second IPv6 basic header on the outer layer of the second SRH. The second IPv6 basic header includes a source address, a destination address, and a Hop Limit field. The source address is the IP address of the interface on PE4 that receives the third IP packet (for example, 10:6:8:6::), the destination address is PE3's SID, and the value of the Hop Limit field is 3. The second SRH includes a SID list and an SL field. The SID list stores PE1's IP address, PE2's SID, PE3's SID, and PE4's SID in descending order on the reverse forwarding path. The second SRH also includes an SL field, and the value of the SL field is 2.
[0085] After PE4 generates the fourth IP packet, it forwards it to PE3. After receiving the fourth IP packet, PE3 identifies the value of the HopLimit field. The HopLimit field is now updated to 2. PE3 then identifies the destination address and determines it is its own SID. PE3 recognizes the value of the SL field as 2, updates the SL field to 1, and, based on the SID list, updates the destination address to PE2's SID. PE3 generates the fifth IP packet and forwards it to PE2.
[0086] After receiving the fifth IP packet, PE2 identifies the value of the Hop Limit field. Since the Hop Limit field is now set to 1, PE2 identifies the destination address and determines it is its own SID. PE2 also identifies the value of the SL field, which is set to 1. PE2 updates the SL field to 0 and, based on the SID list, updates the destination address to PE1's SID. PE2 generates the sixth IP packet and forwards it to PE1.
[0087] After receiving the sixth IP packet, PE1 identifies the value of the Hop Limit field. Since the Hop Limit field is now 0, PE1 identifies the SL field as 0. PE4 identifies the destination address and determines it is its own SID. PE1 removes the second IPv6 basic header and second SRH from the outer layer and obtains the inner ICMPv6 Time Exceeded message.
[0088] PE1 determines whether it receives the sixth IP packet within the preset time. If so, PE1 determines that all nodes in SRv6 TE Policy A are reachable and there are no faulty nodes. If PE1 does not receive the sixth IP packet within the preset time, PE1 determines that an unreachable node exists in SRv6 TE Policy A. Furthermore, if PE1 receives ICMPv6 Time Exceeded messages from PE2 and PE3, PE1 locates the faulty node as PE4.
[0089] like Figure 5 As shown, Figure 5 This is a schematic diagram of the SRH structure of the message provided in the embodiment of the present application. Figure 5 In the SRH, the destination address and SL value are updated every time the message passes through a node. The index in the SRH starts from 0 and stores the SID or IP address of each node on the path in order from far to near.
[0090] For a certain node, the sum of its forward SL and reverse SL is equal to first segment–1, where first segment is a specific field in the message, referring to the index of the first SID.
[0091] It should be noted that if a node on the path does not support SRv6, the node forwards the IP packet according to the destination address table lookup forwarding method.
[0092] Based on the same inventive concept, the embodiment of the present application also provides a connectivity detection device corresponding to the connectivity detection method. Figure 6 , Figure 6 A connectivity detection device provided in an embodiment of the present application is applied to a first node, the first node includes a first interface, and the device includes:
[0093] The receiving unit 610 is configured to receive a first message through the first interface, where the first message includes a first SRH, the first SRH includes first path information, and the first path information is used to indicate a first path from the second node to the first node;
[0094] an acquiring unit 620 configured to locally acquire, based on the first path information, second path information corresponding to the first path information, the second path information being used to indicate a second path from the first node to the second node, the first path and the second path passing through the same node;
[0095] The sending unit 630 is configured to send a second message to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
[0096] Optionally, the first path information includes the IP address of the first node, the SID of the second node, and the SID of an endpoint node passed through in the first path;
[0097] The second path information includes the IP address of the second node, the SID of the first node, and the SID of the node whose node role is Endpoint and which is passed through in the second path.
[0098] Optionally, the receiving unit 610 is further configured to receive a configuration instruction input by a user or sent by a controller, where the configuration instruction includes an SRv6 TE Policy and a traffic diversion identifier, and the SRv6 TE Policy includes the second path information.
[0099] The apparatus further includes: a configuration unit (not shown in the figure), configured to locally configure the SRv6 TE Policy;
[0100] The traffic diversion identifier is used to divert the second message to the SRv6 TE Policy when sending the second message to the second node, and forward the second message along the second path indicated by the second path information.
[0101] Optionally, the device further comprises:
[0102] An acquisition unit (not shown in the figure) is used to obtain neighbor information of each neighbor node in the network;
[0103] a calculation unit (not shown in the figure), configured to calculate a second path to the second node using the first path information and the neighbor information, and obtain the second path information;
[0104] an establishing unit (not shown in the figure), configured to establish a mapping relationship between the second path information and the first path information;
[0105] The storage unit (not shown in the figure) is used to store the mapping relationship locally.
[0106] Optionally, the first message includes a first IPv6 basic header, the first IPv6 basic header includes a Hop Limit field with a first value; the first SRH includes an SL field with a second value;
[0107] The second message includes a second IPv6 basic header, the second IPv6 basic header includes a source address, the source address is the IP address of the first interface, the second IPv6 basic header includes a Hop Limit field with the first value; the second SRH includes an SL field with the second value.
[0108] Therefore, using the connectivity detection device provided in the present application, the first node receives a first message through the first interface, where the first message includes a first SRH, and the first SRH includes first path information, where the first path information is used to indicate the first path for the second node to reach the first node; based on the first path information, the first node obtains second path information corresponding to the first path information locally, where the second path information is used to indicate the second path for the first node to reach the second node, and the first path and the second path pass through the same node; through the first interface, the first node sends a second message to the second node, where the second message includes a second SRH, and the second SRH includes second path information, so that the second message is forwarded on the second path and reaches the second node.
[0109] In this way, the first node uses the first path information to obtain the corresponding second path information and sends the second path information to the first node in a second message. This ensures that the traceroute SRv6 TE Policy's outbound and return paths are consistent. This ensures that the SRv6 TE Policy's connectivity is truly detected, preventing misjudgments caused by irrelevant link conditions. This solves the existing problem of being unable to truly detect SRv6 TE Policy connectivity.
[0110] Based on the same inventive concept, the embodiment of the present application further provides a network device, such as Figure 7 As shown, it includes a processor 710, a transceiver 720 and a machine-readable storage medium 730. The machine-readable storage medium 730 stores machine-executable instructions that can be executed by the processor 710. The processor 710 is prompted by the machine-executable instructions to execute the connectivity detection method provided in the embodiment of the present application. Figure 6 The connectivity detection device shown can be used as Figure 7 The network device hardware structure shown is implemented.
[0111] The computer-readable storage medium 730 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the computer-readable storage medium 730 may be at least one storage device located remotely from the processor 710.
[0112] The processor 710 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0113] In the embodiment of the present application, the processor 710 reads the machine-executable instructions stored in the machine-readable storage medium 730, and the machine-executable instructions enable the processor 710 itself and call the transceiver 720 to execute the connectivity detection method described in the aforementioned embodiment of the present application.
[0114] In addition, an embodiment of the present application provides a machine-readable storage medium 730, which stores machine-executable instructions. When called and executed by the processor 710, the machine-executable instructions prompt the processor 710 itself and the calling transceiver 720 to execute the connectivity detection method described in the aforementioned embodiment of the present application.
[0115] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0116] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0117] As for the embodiments of the connectivity detection device and the machine-readable storage medium, since the method contents involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0118] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A connectivity detection method, characterized in that: The method is applied to a first node, the first node includes a first interface, and the method includes: Receiving a first message through the first interface, where the first message includes a first SRH, the first SRH includes first path information, and the first path information is used to indicate a first path from the second node to the first node; acquiring, locally, second path information corresponding to the first path information based on the first path information, the second path information being used to indicate a second path from the first node to the second node, the first path and the second path passing through the same node; A second message is sent to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
2. The method according to claim 1, characterized in that The first path information includes the IP address of the first node, the SID of the second node, and the SID of the node whose node role is Endpoint that the first path passes through; The second path information includes the IP address of the second node, the SID of the first node, and the SID of the node whose node role is Endpoint and which is passed through in the second path.
3. The method according to claim 1, characterized in that Before receiving the first message through the first interface, the method further includes: Receive a configuration instruction input by a user or sent by a controller, where the configuration instruction includes an SRv6 TE Policy and a traffic diversion identifier, and the SRv6 TE Policy includes second path information; Configure the SRv6 TE Policy locally. The traffic diversion identifier is used to divert the second message to the SRv6 TE Policy when sending the second message to the second node, and forward the second message along the second path indicated by the second path information.
4. The method according to claim 1, wherein After receiving the first message through the first interface, the method further includes: Obtain neighbor information of each neighbor node in the network; Calculate a second path to the second node using the first path information and the neighbor information, and obtain the second path information; Establishing a mapping relationship between the second path information and the first path information; The mapping relationship is stored locally.
5. The method according to claim 1, wherein The first message includes a first IPv6 basic header, the first IPv6 basic header includes a Hop Limit field with a first value; the first SRH includes an SL field with a second value; The second message includes a second IPv6 basic header, the second IPv6 basic header includes a source address, the source address is the IP address of the first interface, the second IPv6 basic header includes a Hop Limit field with the first value; the second SRH includes an SL field with the second value.
6. A connectivity detection device, characterized in that: The device is applied to a first node, the first node includes a first interface, and the device includes: a receiving unit, configured to receive a first message through the first interface, where the first message includes a first SRH, the first SRH includes first path information, and the first path information is used to indicate a first path from the second node to the first node; an acquiring unit, configured to locally acquire, based on the first path information, second path information corresponding to the first path information, the second path information being used to indicate a second path from the first node to the second node, the first path and the second path passing through the same node; A sending unit is configured to send a second message to the second node through the first interface, where the second message includes a second SRH, and the second SRH includes the second path information, so that the second message is forwarded on the second path and reaches the second node.
7. The device according to claim 6, characterized in that The first path information includes the IP address of the first node, the SID of the second node, and the SID of the node whose node role is Endpoint that the first path passes through; The second path information includes the IP address of the second node, the SID of the first node, and the SID of the node whose node role is Endpoint and which is passed through in the second path.
8. The device according to claim 6, characterized in that The receiving unit is further configured to receive a configuration instruction input by a user or sent by a controller, where the configuration instruction includes an SRv6 TE Policy and a traffic diversion identifier, and the SRv6 TE Policy includes second path information; The apparatus further includes: a configuration unit, configured to locally configure the SRv6 TE Policy; The traffic diversion identifier is used to divert the second message to the SRv6 TE Policy when sending the second message to the second node, and forward the second message along the second path indicated by the second path information.
9. The device according to claim 6, characterized in that The device further comprises: An acquisition unit, configured to acquire neighbor information of each neighbor node in the network; a calculating unit, configured to calculate a second path to the second node by using the first path information and the neighbor information, and obtain the second path information; an establishing unit, configured to establish a mapping relationship between the second path information and the first path information; A storage unit is used to store the mapping relationship locally.
10. The device according to claim 6, characterized in that The first message includes a first IPv6 basic header, the first IPv6 basic header includes a Hop Limit field with a first value; the first SRH includes an SL field with a second value; The second message includes a second IPv6 basic header, the second IPv6 basic header includes a source address, the source address is the IP address of the first interface, the second IPv6 basic header includes a Hop Limit field with the first value; the second SRH includes an SL field with the second value.
Citation Information
Patent Citations
SID list processing method and device
CN113794637A
Seamless bidirectional forwarding detection method and system, node and storage medium
CN115604159A