Tunnel identification method and device, equipment, storage medium and program product

By automatically identifying VPN tunnel types and utilizing the tunnel policy configuration and routing table information of the source endpoint, the problem of poor user experience caused by users manually specifying tunnel types is solved. This achieves high accuracy and efficiency in tunnel identification and path reconstruction, and supports the accurate construction of network digital maps.

CN121056271APending Publication Date: 2025-12-02HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410708812.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

In existing technologies, VPN tunnel identification relies on users manually specifying the tunnel type, resulting in a poor user experience and the inability to update in a timely manner, especially when the tunnel is dynamically changing and cannot be accurately detected.

Method used

By obtaining VPN tunnel information, the tunnel type can be automatically identified using the tunnel policy configuration or routing table of the source endpoint. Combining destination address information and sink endpoint information, multiple information combination methods can be used to improve the accuracy and flexibility of identification.

Benefits of technology

It achieves high accuracy and efficiency in automatic tunnel type identification, reduces identification overhead, supports accurate reconstruction of tunnel paths, and enhances the ability to build network digital maps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056271A_ABST
    Figure CN121056271A_ABST
Patent Text Reader

Abstract

The invention discloses a tunnel identification method and device, equipment, a storage medium and a program product, and relates to the technical field of communication. The method comprises the following steps: acquiring information of a VPN tunnel, wherein the information of the VPN tunnel comprises information of a source endpoint; a tunnel type of the VPN tunnel is identified based on a tunnel policy configuration of the source endpoint or a routing table of the source endpoint. According to the method, for the VPN tunnel corresponding to the source endpoint, the tunnel type of the VPN tunnel can be automatically recognized through the tunnel strategy configuration of the source endpoint or the routing table of the source endpoint, automatic recognition of the tunnel type is achieved, and the accuracy of the recognized tunnel type is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to tunnel identification methods, apparatus, devices, storage media, and program products. Background Technology

[0002] With the deepening of the industry's digitalization concept, network digital maps have developed rapidly. Network digital maps construct a detailed, multi-dimensional replica of the physical network throughout its entire lifecycle using digital twins, providing network operations and maintenance with a realistic digital network experience. Among these features, tunnel identification in virtual private networks (VPNs) is a crucial characteristic of network digital maps. Summary of the Invention

[0003] This application provides a tunnel identification method, apparatus, device, storage medium, and program product for automatically identifying tunnels.

[0004] Firstly, a tunnel identification method is provided, which includes: obtaining VPN tunnel information, the VPN tunnel information including source endpoint information; and identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

[0005] This method targets VPN tunnels corresponding to source endpoints and can automatically identify the tunnel type of the VPN tunnel through the tunnel policy configuration or routing table of the source endpoint. It achieves automatic tunnel type identification with high accuracy.

[0006] In one possible implementation, the method of identifying the tunnel type of a VPN tunnel based on the tunnel policy configuration of the source endpoint may include determining the tunnel type of the VPN tunnel based on at least one piece of first information and the tunnel policy configuration, wherein the tunnel policy configuration includes a tunnel policy bound to at least one piece of first information, and the tunnel policy includes the tunnel type. The VPN tunnel information further includes destination address information and destination endpoint information of the packets transmitted through the VPN tunnel. The multiple pieces of first information include: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information. The destination address information can be the destination address in the packets transmitted through the VPN tunnel, or it can be the destination network segment to which the destination address in the packets belongs.

[0007] Optionally, the tunnel type of the VPN tunnel is determined based on the address family to which the destination address information belongs and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the address family to which the destination address information belongs, and the tunnel policy includes the tunnel type. Alternatively, the tunnel type of the VPN tunnel is determined based on the target route prefix matched by the destination address information and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the target route prefix matched by the destination address information, and the tunnel policy includes the tunnel type. Or, the tunnel type of the VPN tunnel is determined based on the address family to which the destination address information belongs, the target route prefix matched by the destination address information, and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the address family to which the destination address information belongs and the target route prefix matched by the destination address information, and the tunnel policy includes the tunnel type. Other possible cases for at least one piece of first information are similar to the examples above and will not be described in detail.

[0008] In this approach, since the tunnel policy configuration includes a tunnel policy bound to at least one piece of first information, the tunnel type can be accurately identified through this first piece of first information. Furthermore, because the at least one piece of first information can be any combination of multiple pieces of first information, the method of identifying the tunnel type is more flexible, improving the success rate of tunnel type identification. In addition, because the amount of data in the tunnel policy configuration is small, the overhead required to obtain the tunnel policy configuration of the source endpoint is low.

[0009] In one possible implementation, the target route prefix or target route attribute is determined through a routing message, which is a message received by the source endpoint to advertise routing information. This routing information includes at least one of the target route prefix or target route attribute. This ensures high accuracy in determining the target route prefix or target route attribute.

[0010] Wherein, if at least one of the first information includes at least one of the target route prefix matching the destination address information or the target route attribute matching the destination address information, identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint may include: identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint and the route message.

[0011] In one possible implementation, the VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel, and any routing table entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry, and the target routing table entry is the routing table entry in the routing table whose destination network segment matches the destination address information.

[0012] In this approach, since the routing table includes routing entries that match the destination address information, the tunnel type can be accurately identified through the tunnel type included in the target routing table entry. Furthermore, because identifying the tunnel type based on the routing table has a higher success rate, it can be used to identify the tunnel type even when the tunnel type cannot be identified based on the tunnel policy configuration.

[0013] In one possible implementation, before identifying the VPN tunnel type based on the source endpoint's routing table, a collection command is sent to the source endpoint. This collection command is used to collect routing table entries that include the tunnel type value. The routing table entries containing the tunnel type value sent by the source endpoint based on the collection command are received, and the routing table is obtained based on the received routing table entries. In other words, when collecting the routing table from the source endpoint, routing table entries that include the tunnel type value can be collected. Compared to collecting all routing table entries from the source endpoint, this reduces the overhead required for collecting the routing table and improves the efficiency of collecting the routing table.

[0014] In one possible implementation, the VPN tunnel information also includes destination endpoint information. After identifying the VPN tunnel type based on the source endpoint's tunnel policy configuration or routing table, the tunnel path between the source and destination endpoints is reconstructed according to the tunnel type. Here, the tunnel path refers to the public network forwarding path connecting the source and destination endpoints of the VPN tunnel; the public network forwarding path is also the actual forwarding path between physical devices. This allows for the automatic reconstruction of the VPN tunnel's tunnel path, in addition to automatically identifying the tunnel type, thus restoring the true forwarding path of packets in the VPN network and providing a foundation for building a digital network map.

[0015] In one possible implementation, the tunnel type is best effort (BE). Reconstructing the tunnel path from the source endpoint to the destination endpoint according to the BE type can include reconstructing the tunnel path based on the interior gateway protocol (IGP) link-state information and IGP routing prefix information within the autonomous system (AS) domain where the source endpoint resides, using a shortest path first (SFP) strategy. Therefore, for a BE-type VPN tunnel, the tunnel path can be accurately reconstructed using the corresponding shortest path first (SFP) routing strategy.

[0016] In one possible implementation, the tunnel type is traffic engineering (TE), which can also be translated as traffic policy. Reconstructing the tunnel path from the source endpoint to the destination endpoint according to the TE type may include restoring the tunnel path from the source endpoint to the destination endpoint based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint. The TE tunnel path configured for the source endpoint includes a TE tunnel path bound to at least one of the second information. The VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel. The various second information includes: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, and the target route prefix or target route attribute matching the destination address information.

[0017] Optionally, based on the node address of the destination endpoint and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the TE tunnel path bound to the node address of the destination endpoint; or, based on the target routing prefix matched by the destination address information and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the TE tunnel path bound to the target routing prefix matched by the destination address information; or, based on the tunnel interface bound to the destination endpoint, the target routing prefix matched by the destination address information, and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the tunnel interface bound to the destination endpoint and the TE tunnel path bound to the target routing prefix matched by the destination address information. Other possible cases for at least one type of second information are similar to the examples above and will not be described in detail.

[0018] Therefore, for TE-type VPN tunnels, the source endpoint is configured with multiple TE tunnel paths. Since the TE tunnel paths configured at the source endpoint include TE tunnel paths bound to at least one type of second information, the tunnel path of the TE-type VPN tunnel can be accurately reconstructed using this at least one type of second information. Furthermore, since the at least one type of second information can be any combination of multiple types of second information, the method of reconstructing the tunnel path according to the TE type is more flexible, improving the success rate of tunnel path reconstruction.

[0019] In one possible implementation, the tunnel type is a multi-layer tunnel type. Reconstructing the tunnel path from the source endpoint to the destination endpoint according to the multi-layer tunnel type may include: determining a first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information; the first tunnel path includes at least one sub-tunnel; for any sub-tunnel in the first tunnel path, determining the sub-tunnel type of any sub-tunnel in the tunnel policy configuration of the sub-source endpoint of any sub-tunnel or the routing table of the sub-source endpoint of any sub-tunnel; reconstructing the sub-tunnel path from the sub-source endpoint of any sub-tunnel to the sub-destination endpoint of any sub-tunnel according to the sub-tunnel type; and reconstructing the tunnel path from the source endpoint to the destination endpoint based on the first tunnel path and the corresponding sub-tunnel path of any sub-tunnel. Therefore, for a multi-layer tunnel type VPN tunnel, the tunnel path of the VPN tunnel can be accurately reconstructed through iterative reconstruction.

[0020] Secondly, a tunnel identification device is provided for performing the method in the first aspect or any possible implementation thereof. Specifically, the tunnel identification device includes modules for performing the method in the first aspect or any possible implementation thereof. In one possible implementation, the tunnel identification device includes: an acquisition module for acquiring information about a VPN tunnel, the VPN tunnel information including information about a source endpoint; and an identification module for identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

[0021] In one possible implementation, the identification module is used to determine the tunnel type of the VPN tunnel based on at least one of a plurality of first information and a tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to at least one of the first information, and the tunnel policy includes a tunnel type. The VPN tunnel information also includes destination address information and destination endpoint information of the packets transmitted through the VPN tunnel. The plurality of first information includes: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

[0022] In one possible implementation, the target route prefix or target route attribute is determined by a route message, which is a message received by the source endpoint to advertise route information, including at least one of the target route prefix or target route attribute.

[0023] In one possible implementation, the VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel, and any routing table entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry, and the target routing table entry is the routing table entry in the routing table whose destination network segment matches the destination address information.

[0024] In one possible implementation, the apparatus further includes: a sending module for sending a collection command to a source endpoint, the collection command being used to collect routing table entries including tunnel type values; and a receiving module for receiving routing table entries including tunnel type values ​​sent by the source endpoint based on the collection command, and obtaining a routing table based on the received routing table entries.

[0025] In one possible implementation, the VPN tunnel information also includes information about the destination endpoint, and the apparatus further includes a restoration module for restoring the tunnel path between the source endpoint and the destination endpoint according to the tunnel type.

[0026] In one possible implementation, the tunnel type is BE type; the restoration module is used to restore the tunnel path according to the shortest path first strategy based on the IGP link state information and IGP routing prefix information in the AS domain where the source endpoint is located.

[0027] In one possible implementation, the tunnel type is TE type; the restoration module is used to restore the tunnel path between the source endpoint and the destination endpoint based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint, wherein the TE tunnel path configured for the source endpoint includes a TE tunnel path bound to at least one of the second information; the VPN tunnel information also includes destination address information of the packets transmitted through the VPN tunnel, wherein the variety of second information includes: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix matching the destination address information, or the target route attribute matching the destination address information.

[0028] In one possible implementation, the tunnel type is a multi-layer tunnel type; the restoration module is used to determine a first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information, the first tunnel path including at least one sub-tunnel; for any sub-tunnel in the first tunnel path, the sub-tunnel type of any sub-tunnel is determined in the tunnel policy configuration of the sub-source endpoint of any sub-tunnel or the routing table of the sub-source endpoint of any sub-tunnel; the sub-tunnel path between the sub-source endpoint of any sub-tunnel and the sub-destination endpoint of any sub-tunnel is restored according to the sub-tunnel type; based on the first tunnel path and the sub-tunnel path corresponding to any sub-tunnel, the tunnel path between the source endpoint and the destination endpoint is restored.

[0029] Thirdly, a tunnel identification device is provided, comprising: a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the tunnel identification device to implement the tunnel identification method in any of the possible embodiments described in the first aspect above.

[0030] Optionally, the processor may be one or more, and the memory may be one or more.

[0031] Optionally, the memory may be integrated with the processor, or the memory may be separated from the processor.

[0032] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.

[0033] Fourthly, a communication device is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory stores instructions, and the processor executes the instructions stored in the memory to control the transceiver to receive and transmit signals. When the processor executes the instructions stored in the memory, the communication device performs the tunnel identification method of the first aspect or any possible implementation thereof.

[0034] Fifthly, a computer-readable storage medium is provided, the storage medium storing at least one instruction, the instruction being loaded and executed by a processor to enable a computer to implement the tunnel identification method of the first aspect or any possible implementation thereof.

[0035] In a sixth aspect, a computer program (product) is provided, the computer program (product) comprising: computer program code, which, when executed by a computer, causes the computer to perform the tunnel identification method of the first aspect or any possible implementation thereof.

[0036] In a seventh aspect, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is mounted to perform the tunnel identification method of the first aspect or any possible implementation thereof.

[0037] Eighthly, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is used to execute code in the memory, wherein when the code is executed, the processor is used to execute the tunnel identification method of the first aspect or any possible implementation thereof.

[0038] It should be understood that the beneficial effects of the technical solutions of the second to eighth aspects of this application and the corresponding possible implementations can be referred to the above-described technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0039] Figure 1 A network topology diagram provided for an embodiment of this application;

[0040] Figure 2 A flowchart illustrating a tunnel identification method provided in this application embodiment;

[0041] Figure 3 This application provides a schematic diagram of a process for identifying tunnel types in an embodiment of the present application.

[0042] Figure 4 Another network topology diagram provided for an embodiment of this application;

[0043] Figure 5 This application provides a schematic diagram of a process for identifying a tunnel path.

[0044] Figure 6 Another network topology diagram provided for an embodiment of this application;

[0045] Figure 7 A schematic diagram of a network digital map provided in an embodiment of this application;

[0046] Figure 8 This is a schematic diagram of the structure of a tunnel identification device provided in an embodiment of this application;

[0047] Figure 9 This application provides a schematic diagram of the structure of a network device according to an embodiment of the present application.

[0048] Figure 10 This is a schematic diagram of the structure of another network device provided in an embodiment of this application;

[0049] Figure 11 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0051] With the deepening of the industry's digitalization concept, addressing the ever-increasing network demands and challenges through digitalization has become an industry consensus. Network digital maps, constructed as digital twins, create detailed replicas of the physical network throughout its entire lifecycle or across multiple dimensions, providing network operations and maintenance with a realistic digital network experience. Among these features, VPN tunnel identification within VPN networks is a crucial characteristic of network digital maps.

[0052] VPN networks are a typical example of overlay networks. An overlay network is one or more virtual logical networks built on the same underlying network using network virtualization technology; it is also called a private network. The underlying network refers to the physical network, consisting of physical devices and physical links—the underlying bearer network. An overlay network consists of logical nodes and logical links, with independent control and forwarding planes. The control plane is used for establishing and maintaining virtual tunnels and announcing host reachability information, while the forwarding plane is used to carry overlay packets within the physical network. Optionally, VPN networks include, but are not limited to, Layer 3 Virtual Private Networks (L3VPNs) or Layer 2 Virtual Private Networks (L2VPNs).

[0053] In a VPN network, customer edge (CE) devices interface with provider edge (PE) devices. The provider (P) network provides network reachability between CEs. Based on the reachability of the P network, the CEs construct a point-to-point VPN network using tunneling technology. VPN tunnels interconnect multiple networks located in different locations. The network formed by the VPN tunnels is an overlay network, completely independent of the underlying P network. The P network is only responsible for providing reachability from the source node to the destination node of the VPN tunnel. Optionally, tunneling technologies include, but are not limited to, multi-protocol label switching (MPLS) or segment routing based on the Internet Protocol version 6 (SRv6) forwarding plane, etc.

[0054] For example, see Figure 1The network topology is shown in the diagram. CE1 is connected to PE1, and CE2 is connected to PE2. PE1 and PE2 are connected via a P-network, which includes P1, P2, P3, and P4 devices. Each PE device establishes and maintains a dedicated VPN instance for the site where the directly connected CE devices reside. In other words, a single PE device can establish and maintain one or more VPN instances. A VPN instance, also known as a virtual routing forwarding (VRF), is a transmission node in the VPN network, i.e., an endpoint of the VPN tunnel. Therefore, the VPN network topology reflects the connection relationship of VRFs, with VPN tunnels established between two VRFs. The tunnel path of the VPN tunnel is the actual forwarding path transmitted through the P-network.

[0055] In this embodiment, the VRF includes VPN membership relationships and routing rules for the corresponding site. For example, the VRF includes, but is not limited to, an Internet Protocol (IP) routing table, a label forwarding information base (LFIB), interfaces bound to the VRF, and VRF management information. The VRF management information includes, but is not limited to, route distinguishers (RDs), route filtering policies, and a list of member interfaces. That is, each VRF on the PE device has a relatively independent IP routing table and LFIB. Therefore, the PE device includes a public network routing table and one or more VPN routing tables, where the VPN routing table is the IP routing table corresponding to the VRF.

[0056] The public network routing table includes IP routes for all PE and P devices, generated by the underlying network's routing protocols or static routes. For example, the routing protocols can be IGP and Border Gateway Protocol (BGP). IGP is a routing protocol running within an Autonomous System (AS), used to discover and advertise IGP routes, enabling route reachability within the underlying network. BGP includes external BGP (eBGP) and internal BGP (iBGP). eBGP is a dynamic routing protocol running between different ASs, used to exchange routing information between ASs, and the routing information can carry AS numbers. iBGP is a dynamic routing protocol running within the same AS, used to exchange routing information between routers within the same AS. Different ASs correspond to different AS numbers, and the same AS can include one or more IGP processes, and the same IGP process can include one or more IGP domains. The VPN routing table includes routes belonging to all sites within the VRF, obtained through VPN routing information exchange between CE devices and PE devices, or between two PE devices.

[0057] Optionally, PE devices use the Multi-Protocol BGP (MP-BGP) protocol to advertise VPN routes. The VPN route prefix uses the VPN address family, which includes both the RD (Route Prefix) and the IP address. That is, an IP address with the RD added is called a VPN address. In other words, the RD is used to distinguish different VPN routes using the same route prefix, resolving the address space overlap issue between different VRFs. For example, after a PE device receives an IP route from a CE device, it converts the IP route's route prefix (i.e., the IP address) into a globally unique VPN address, obtains the VPN route, and advertises it to the corresponding PE device. VPN routes are also called BGP private network routes. VPN address families include, but are not limited to, Virtual Private Network Version 4 (VPNv4) address families, Virtual Private Network Version 6 (VPNv6) address families, Ethernet Virtual Private Network Version 4 (EVPNv4) address families, Ethernet Virtual Private Network Version 6 (EVPNv6) address families, Internet Protocol Version 4 (IPv4) unicast address families, Internet Protocol Version 6 (IPv6) unicast address families, or labeled unicast address families.

[0058] Optionally, the VPN route may also include a private network label, such as a multi-protocol label switching (MPLS) label, for enabling label-based public network forwarding. The private network label is assigned to the VPN route by the PE device before sending the VPN route. A single private network label can be assigned to all VPN routes in the entire VPN instance, or a single private network label can be assigned to each VPN route.

[0059] VPN routes also include an export route target (ERT). After receiving a VPN route, the PE device matches the ERT carried in the received VPN route with the import route target (IRT) of its local VRF. If a match is found, the VPN route is accepted; otherwise, it is discarded. In other words, each VRF is configured with at least one ERT and at least one IRT to define which sites can receive a VPN route and which sites the PE device can receive VPN routes from. The process of matching the ERT carried in the VPN route with the IRT of the local VPN instance is called private network route cross-referencing. The publication of these VPN routes involves both CE and PE devices. The P device maintains the underlying network routing and does not need to know any VPN route information.

[0060] See Figure 1 The network topology diagram shown illustrates that network elements are also connected to the controller. These network elements include, for example, the aforementioned PE or P devices. Optionally, network elements can be directly connected to the controller or connected via a route reflector (RR). This application does not limit the type of physical device the controller can be. Optionally, the controller can be a software-defined network (SDN) or a network control engine (NCE). The controller and network elements communicate using at least one of several protocols, including BGP, BGP-link state (BGP-LS), path computation element communication protocol (PCEP), network configuration protocol (Netconf), and telemetry.

[0061] Among them, BGP-LS is a method for network topology collection, PCEP is a communication protocol for path calculation, Netconf is a protocol for communication between controllers and network elements, and telemetry is a technology for high-speed remote data collection from physical or virtual devices. For example, IGP routes can be collected via BGP and BGP-LS, tunnel information can be collected via PCEP, tunnel policy configurations can be collected via Netconf connections, and routing tables can be collected via telemetry connections.

[0062] During the private network routing crossover process, the controller can directly or indirectly collect VPN routes received by each PE device. Optionally, the VPN routes received by the PE devices do not include VPN routes received but discarded by the PE devices. Based on the collected VPN routes, the controller can obtain the ERT and IRT corresponding to each VRF, and then generate the VPN topology, i.e., the network topology of the VPN network, based on the ERT and IRT corresponding to each VRF. In the VPN topology, VRFs are represented by nodes, and the connection relationships between VRFs are represented by edges between nodes. The VPN private network path of packets transmitted through the VPN network can be reconstructed through the VPN topology.

[0063] In this embodiment, after the VRF is established, a tunneling policy can be configured for the established VRF. The tunneling policy is used to select the tunnel to use for the VRF's packets. The tunneling policy can include tunnel types; different tunnel types indicate different tunnels, and different tunnels correspond to different tunnel paths. In this scenario, since the two ends of the tunnel can be two VRFs, it is called a VPN tunnel. Optionally, the VPN tunnel can be directional, that is, the VPN tunnel from VRFa to VRFb and the VPN tunnel from VRFb to VRFa are two different tunnels.

[0064] In related technologies, after the controller reconstructs the VPN private network path through the VPN network using the VPN topology, the user specifies the corresponding tunnel type for each hop of the VPN private network path, i.e., the VPN tunnel between two VRFs. Then, the tunnel path is reconstructed based on the user-specified tunnel type to build a digital network map. However, this method of manually specifying the tunnel type by the user impacts the user experience and can lead to situations where users are unaware of the tunnel type. Furthermore, in scenarios where VPN tunnels change dynamically, users cannot perceive and update this information in a timely manner.

[0065] This application provides a tunnel identification method for automatically identifying tunnels, such as automatically identifying tunnel types. Optionally, this method can be applied to... Figure 1 In the network shown, for example, by Figure 1 The controller shown executes this method. See also Figure 2 The flowchart shown is for a tunnel identification method, which includes, but is not limited to, the following steps 201-202.

[0066] Step 201: Obtain VPN tunnel information, which includes information about the source endpoint.

[0067] In this embodiment, a VPN tunnel refers to a one-hop private network path on a VPN private network path, meaning a VPN tunnel is established between one-hop private network paths. The transmission node on the VPN private network path is a VRF (Virtual Radio Frequency), and the two VRFs on the one-hop private network path are the two endpoints of the VPN tunnel: the source endpoint and the destination endpoint. For example, if the one-hop private network path is from VRFa to VRFb, then the source endpoint of the VPN tunnel is VRFa, and the destination endpoint is VRFb. Since the VRF is established on the PE (Physical Equipment) device, one VRF can be mapped to one PE device. When multiple VRFs are established on the PE device, the source endpoint of the VPN tunnel refers to the source VRF, and the destination endpoint refers to the destination VRF. When only one VRF is established on the PE device, the source endpoint of the VPN tunnel refers to the source VRF or the PE device corresponding to the source VRF, and the destination endpoint refers to the destination VRF or the PE device corresponding to the destination VRF. When the source endpoint of the VPN tunnel refers to the PE device corresponding to the source VRF, the source endpoint of the VPN tunnel can be called the source node; when the destination endpoint of the VPN tunnel refers to the PE device corresponding to the destination VRF, the destination endpoint of the VPN tunnel can be called the destination node.

[0068] The VPN tunnel information includes source endpoint information, which is information that indicates the source endpoint, such as at least one of the identifier of the source VRF or the identifier of the PE device corresponding to the source VRF. Optionally, the VPN tunnel information also includes destination endpoint information, which is information that indicates the destination endpoint, such as at least one of the identifier of the destination VRF or the identifier of the PE device corresponding to the destination VRF. Optionally, the VPN tunnel information also includes destination address information of the packets transmitted through the VPN tunnel. The destination address information can be the destination address in the packets transmitted through the VPN tunnel, such as the destination IP (destIP); or it can be the destination network segment to which the destination address in the packet belongs. When the source endpoint and destination endpoint are the same, different destination address information may correspond to different VPN tunnels. For example, the VPN tunnel information can be represented as (source endpoint, destination endpoint, destIP).

[0069] This application does not limit the method for obtaining VPN tunnel information. Optionally, the user can directly input the VPN tunnel information. Alternatively, the user can input the source endpoint information and destination address information, and the controller can determine the destination endpoint information matching the user-input destination address information based on the routing message received by the source endpoint. Here, the routing message is a message used to advertise routing information. For example, the routing message can refer to a message used to advertise the aforementioned VPN route, also known as a private network routing message or an MP-BGP routing message.

[0070] For example, the user inputs source VRF information and destination address information. The source VRF can locate the source PE device. Based on the private network routing cross-referencing of MP-BGP routing messages, the target VPN route matching the destination address information is determined from the VPN routes of the source VRF. Optionally, the target VPN route is determined by longest mask prefix matching based on the destination address information. Further, the information of the destination PE device can be obtained based on the next-hop information of the target VPN route. For example, the destination VRF is determined based on the next-hop information of the target VPN route, and the destination VRF can locate the destination PE device, thereby obtaining the information of the destination PE device. Here, taking the destination address information as an example, longest mask prefix matching means selecting the VPN route that matches the highest-order bits of the destination address the most among multiple VPN routes.

[0071] Step 202: Identify the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

[0072] This application provides, but is not limited to, two methods for identifying VPN tunnel types: identifying the VPN tunnel type based on the tunnel policy configuration of the source endpoint, or identifying the VPN tunnel type based on the routing table of the source endpoint. Either of these two identification methods can be chosen, or both can be implemented. When both identification methods are implemented, the method of identifying the VPN tunnel type based on either the tunnel policy configuration or the routing table of the source endpoint is equivalent to identifying the VPN tunnel type based on both the tunnel policy configuration and the routing table of the source endpoint. If both identification methods identify the tunnel type, the two identified tunnel types can be mutually verified, or the VPN tunnel type identified based on the routing table of the source endpoint can be used as the definitive identifier.

[0073] Optionally, for both identification methods, if the tunnel policy configuration is resolvable, the VPN tunnel type can be identified based on the tunnel policy configuration of the source endpoint; if the tunnel policy configuration is not resolvable, the VPN tunnel type can be identified based on the routing table of the source endpoint. In this scenario, since the amount of data in the tunnel policy configuration is relatively small while the amount of data in the routing table is relatively large, if the tunnel policy configuration is resolvable, the VPN tunnel type should be identified based on the tunnel policy configuration of the source endpoint first to avoid the large identification overhead caused by the routing table. In another possible implementation, if the tunnel policy configuration is resolvable, the VPN tunnel type can also be identified through the routing table. Furthermore, since the accuracy of identifying the tunnel type based on the routing table is higher, the probability of identifying the VPN tunnel type can be increased.

[0074] In the embodiments of this application, tunnel types include, but are not limited to, BE type, TE type, and multi-layer tunnel type. BE type tunnels are tunnels that forward data based on the segment ID (SID) using a shortest path first strategy, without forcing any particular path to be taken. Examples of BE type tunnels include Label Distribution Protocol (LDP) paths, Label Switched Paths (LSPs), and Segment Routing Label Switched Paths (SR-LSPs). TE type tunnels are tunnels that forward data based on a combination of multiple SIDs and certain constraints, enabling the tunnel to meet the requirements of traffic engineering. Traffic engineering is a set of tools and methods used to control network resources and improve network performance; it is a network resource regulation technique for solving network resource allocation and network throughput. Examples of TE type tunnels include constraint-based routed label switched path (CR-LSP), SR-TE, MPLS-TE, or SR-TE policies. Multi-layer tunnel types refer to tunnels with at least two layers stacked, where the tunnel type of each layer is not limited, and can be, for example, the aforementioned BE or TE types. Multi-layer tunnel types include BGP-LSP or BGP-LU, with BGP-LU being a routing protocol used for both inter-AS and intra-AS routing.

[0075] The following sections explain the two methods for identifying VPN tunnel types.

[0076] Method 1: Identify the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint.

[0077] In this approach, identifying the VPN tunnel type based on the tunnel policy configuration of the source endpoint can include determining the VPN tunnel type based on at least one of a plurality of first pieces of information and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to at least one of the first pieces of information, and the tunnel policy includes the tunnel type. The VPN tunnel information also includes the destination address information and the destination endpoint information of the packets transmitted through the VPN tunnel. The plurality of first pieces of information includes: the address family to which the destination address information belongs, the node address of the destination endpoint, and the target route prefix or target route attribute matched by the destination address information.

[0078] In this approach, since the tunnel policy configuration includes a tunnel policy bound to at least one piece of first information, and the tunnel policy includes the tunnel type, the tunnel type can be accurately identified through this at least one piece of first information. Furthermore, since the at least one piece of first information can be any combination of multiple pieces of first information, the method of identifying the tunnel type is more flexible, improving the success rate of tunnel type identification. In addition, because the amount of data in the tunnel policy configuration is small, the overhead required to obtain the tunnel policy configuration of the source endpoint is low. Specifically, before identifying the VPN tunnel type based on the tunnel policy configuration of the source endpoint, the tunnel policy configuration of the source endpoint is collected. For example, the tunnel policy configuration of the source endpoint can be collected through a Netconf connection.

[0079] In this application embodiment, at least one different combination of first information includes the following 15 possibilities: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, the target route attribute matched by the destination address information, the address family to which the destination address information belongs and the node address of the destination endpoint, the address family to which the destination address information belongs and the target route prefix matched by the destination address information, the address family to which the destination address information belongs and the target route attribute matched by the destination address information, the node address of the destination endpoint and the target route prefix matched by the destination address information, the node address of the destination endpoint and the target route attribute matched by the destination address information, the address family to which the destination address information belongs, the node address of the destination endpoint, and the target route attribute matched by the destination address information. The destination address information matches the destination route prefix, the address family to which the destination address information belongs, the node address of the destination endpoint, and the destination route attributes matched by the destination address information. The destination address information matches the address family, the destination route prefix, and the destination route attributes matched by the destination address information. The destination address information matches the address family and the node address of the destination endpoint. The destination endpoint node address, the destination route prefix, and the destination route attributes matched by the destination address information. The destination address information matches the address family, the node address of the destination endpoint, the destination route prefix, the destination route attributes matched by the destination address information, and the destination address information matches the address family and the node address of the destination endpoint.

[0080] Optionally, the tunnel type of the VPN tunnel is determined based on the address family to which the destination address information belongs and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the address family to which the destination address information belongs, and the tunnel policy includes the tunnel type. Alternatively, the tunnel type of the VPN tunnel is determined based on the target route prefix matched by the destination address information and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the target route prefix matched by the destination address information, and the tunnel policy includes the tunnel type. Or, the tunnel type of the VPN tunnel is determined based on the address family to which the destination address information belongs, the target route prefix matched by the destination address information, and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the address family to which the destination address information belongs and the target route prefix matched by the destination address information, and the tunnel policy includes the tunnel type. Other possible cases for at least one piece of first information are similar to the examples above and will not be described in detail.

[0081] For the aforementioned 15 combinations of at least one piece of first information, any combination of at least one piece of first information can be randomly selected and queried in the tunnel policy configuration. If no tunnel policy is found that is bound to at least one piece of first information for any combination, then a different combination of at least one piece of first information is randomly selected until a bound tunnel policy is found, and the tunnel type is identified based on that tunnel policy. Alternatively, all 15 combinations of at least one piece of first information can be queried simultaneously in the tunnel policy configuration. If a tunnel policy is found that is bound to at least one piece of first information for any combination, the tunnel type is identified based on that tunnel policy. Alternatively, the 15 combinations of at least one piece of first information can be queried sequentially in the tunnel policy configuration according to a certain order until a bound tunnel policy is found, and the tunnel type is identified based on that tunnel policy. The order of these combinations can be flexibly specified by the user based on the application scenario, or it can be determined based on the priority of the 15 combinations, for example, by obtaining the order in descending order of priority.

[0082] See Figure 3 Taking the first four of the 15 possible combinations, with the priority of these four combinations from highest to lowest as follows: 1. The address family to which the destination address information belongs; 2. The node address of the destination endpoint; 3. The target route prefix matched by the destination address information; 4. The target route attribute matched by the destination address information, this example illustrates the process of identifying the tunnel type of a VPN tunnel based on the source endpoint tunnel policy configuration. Figure 3 As shown, for a given VPN tunnel information, it is first determined whether the tunnel policy configuration of the source endpoint can be parsed. If the tunnel policy configuration can be parsed, the tunnel policy configuration is parsed.

[0083] One method to determine whether a tunnel policy configuration can be parsed is to check if it contains the corresponding format template. If it does, parsing is confirmed as possible, and the parsing is performed according to the template. If it does not contain the template, parsing is confirmed as impossible. Alternatively, the user can pre-configure which types of tunnel policy configurations can be parsed.

[0084] like Figure 3 As shown, during the parsing of tunnel policy configuration, the process first checks whether the tunnel policy configuration contains address family-based binding tunnel policies. If it does, the tunnel type in the tunnel policy is identified based on the address family to which the destination address information belongs. If it does not contain address family-based binding tunnel policies, the process continues to check whether the tunnel policy configuration contains node address-based binding tunnel policies. If it does, the tunnel type in the tunnel policy is identified based on the node address of the destination endpoint. If it does not, the process continues to check whether the tunnel policy configuration contains prefix-based binding tunnel policies. If it does, the tunnel type in the tunnel policy is identified based on the target route prefix matched by the destination address information. If it does not, the process continues to check whether the tunnel policy configuration contains attribute-based binding tunnel policies. If it does, the tunnel type in the tunnel policy is identified based on the target route attribute matched by the destination address information.

[0085] The destination address information can belong to any of the aforementioned VPN address families; the node address of the destination endpoint is the routing address of the destination PE device, such as a loopback address; the target route prefix is ​​the prefix of the target route that matches the destination address information; and the target route attribute is the routing attribute of the target route that matches the destination address information. This application embodiment does not limit the method of matching routes based on the destination address information; for example, the longest mask prefix matching rule can be used. Routing attributes include, but are not limited to, at least one of color values, RD (Relational Development) attributes, or extended community attributes. Optionally, the target route prefix or target route attribute is determined through a routing message, which is a message received by the source endpoint to advertise routing information. The advertised routing information includes at least one of the target route prefix or target route attribute, making the determined target route prefix or target route attribute highly accurate.

[0086] Before determining the target route prefix or target route attributes based on the routing packets, the routing packets are first collected. For example, this can be done via MPBGP. For instance, taking the source endpoint as the source PE device and the destination endpoint as the destination PE device, the destination PE device will advertise the private network route to the source PE device via MPBGP, that is, send routing packets to the source PE to announce the routing information of the private network route. Optionally, the destination PE device can send this routing packet to the controller via MPBGP, so that the controller can collect the routing packets received by the source endpoint. Alternatively, the source PE sends the received routing packets to the RR, and the RR then sends the routing packets received by the source endpoint to the controller.

[0087] The routing information may include the next hop, address family type, prefix, color, and RD. For example, a private network route might be: {nexthop:3.3.3.9,type:VPNv4,prefix:10.22.2.2 / 32,color:100,rd:2:2}. If the source VRF on the source PE device is not configured with a default color, the color value is the color value in the routing packet. If a default color value is configured, the color value is the default color. In some scenarios, the source PE device has a routing policy configured and modifies the color value of the received private network route according to the routing policy. In this embodiment, the routing packets can be configured to be directly collected and processed from the PE1 device. That is, the routing packets collected by the controller are the routing packets received and processed by the source endpoint.

[0088] For different combinations of the aforementioned first information, when the first information includes at least one of the address family to which the destination address information belongs or the node address of the destination endpoint, the tunnel type of the VPN tunnel can be identified based on the tunnel policy configuration of the source endpoint. For example, taking the source endpoint as the source VRF, in the tunnel policy configuration of the source VRF, a first tunnel policy is bound based on at least one of the address family to which the destination address information belongs or the node address of the destination endpoint. The first tunnel policy includes a first tunnel type. Therefore, based on at least one of the address family to which the destination address information belongs or the node address of the destination endpoint in the VPN tunnel information, the tunnel type of the VPN tunnel can be identified as the first tunnel type.

[0089] When at least one of the first pieces of information includes a target route prefix matching the destination address information or a target route attribute matching the destination address information, identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint may include identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint and the routing message. Specifically, identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint and the routing message may include obtaining at least one of a target route prefix matching the destination address information or a target route attribute matching the destination address information based on the routing message, determining a tunnel policy matching the target route prefix or the target route attribute according to the tunnel policy configuration of the source endpoint, and the tunnel type included in the tunnel policy is the identified tunnel type.

[0090] For example, taking the source endpoint as the source VRF, in the tunnel policy configuration of the source VRF, a second tunnel policy is bound based on at least one of the target route prefix or target route attribute. The second tunnel policy includes a second tunnel type. Based on the destination address information and routing packets in the VPN tunnel information, at least one of the target route prefix or target route attribute matching the destination address information can be obtained. Therefore, based on the obtained target route prefix or target route attribute, the tunnel type of the VPN tunnel can be identified as the second tunnel type.

[0091] When identifying the VPN tunnel type based on the tunnel policy configuration and routing message of the source endpoint, if the tunnel type is also identified based on the routing table of the source endpoint, the methods for identifying the VPN tunnel type include identifying the VPN tunnel type based on the tunnel policy configuration, routing message, and routing table of the source endpoint.

[0092] For example, with Figure 4Taking the network topology shown as an example, PE1, P1, P2, and PE2 are all in the same IGP domain, AS:100, and segment routing (SR) is enabled. A BGP VPN is configured between PE1 and PE2. The node address of PE1 is 1.1.1.9 / 32, P1's node address is 2.2.2.9 / 32, P2's node address is 4.4.4.9 / 32, and PE2's node address is 3.3.3.9 / 32. CE1 and CE2 are the CE devices for PE1 and PE2, respectively. CE1 is in AS:65410 with a node address of 10.11.1.9 / 32, and CE2 is in AS:65420 with a node address of 10.22.2.2 / 32. The source endpoint of the VPN tunnel is VPNa on the PE1 device, and the destination endpoint of the VPN tunnel is the PE2 device. The destination address information is 10.22.2.2.

[0093] Taking the address family to which at least one piece of information, including the destination address information, belongs as an example, the tunnel policy configuration of VPNa can be shown in Table 1 below. In Table 1, row 1 represents the VPN instance as VPNa, row 2 represents the address family as IPv4 unicast address family, row 3 represents the route identifier as 1:1, and row 4 represents the tunnel policy p1 bound to the IPv4 unicast address family of VPNa. Rows 5 and 6 in Table 1 represent that the tunnel type for tunnel policy p1 is SR-LSP. SR-LSP type tunnels are SR-MPLSBE, which belongs to the BE type. Therefore, the identified tunnel type is BE.

[0094] Table 1

[0095]

[0096] Alternatively, the VPNa tunnel policy configuration can be as shown in Table 2 below. Rows 1 to 4 in Table 2 represent the tunnel policy p1 bound to the IPv4 unicast address family of this VPNa. Rows 5 and 6 in Table 2 represent that the tunnel type for tunnel policy p1 is SR-TE. SR-TE type tunnels are SR-MPLS TE, which belongs to the TE type. Therefore, the identified tunnel type is TE.

[0097] Table 2

[0098]

[0099] Alternatively, the VPNa tunnel policy configuration can be as shown in Table 3 below. Rows 1 to 4 in Table 3 represent the tunnel policy p1 bound to the IPv4 unicast address family of this VPNa. Rows 5 and 6 in Table 3 represent that the tunnel type for tunnel policy p1 is te; therefore, the identified tunnel type is TE. Furthermore, rows 5 and 6 in Table 3 also represent that tunnel policy p1 binds packets destined for 3.3.3.9 to tunnel interface Tunnel10. Rows 7 to 9 in Table 3 represent that the tunnel protocol corresponding to tunnel interface Tunnel10 is MPLS TE, and the destination address is 3.3.3.9.

[0100] Table 3

[0101]

[0102] Alternatively, the VPNa tunnel policy configuration can be as shown in Table 4 below. Rows 1 to 4 in Table 4 represent the tunnel policy p1 bound to the IPv4 unicast address family of this VPNa. Rows 5 and 6 in Table 4 indicate that the tunnel type for tunnel policy p1 is SR-TE policy. An SR-TE policy is an SR-MPLS TE policy, which is a TE type tunnel. Therefore, the identified tunnel type is TE.

[0103] Table 4

[0104]

[0105] Alternatively, the VPNa tunnel policy configuration can be as shown in Table 5 below. Rows 1 to 4 in Table 5 represent the tunnel policy p1 bound to the IPv4 unicast address family of this VPNa. Rows 5 and 6 in Table 5 indicate that the tunnel type for tunnel policy p1 is BGP, and for SR-BGP type tunnels it is BGP-LSP, belonging to the multi-layer tunnel type. Therefore, the identified tunnel type is a multi-layer tunnel type.

[0106] Table 5

[0107]

[0108] In one possible implementation, if the bound tunnel policy is not determined based on the tunnel policy configuration, the default tunnel type can be used as the identified tunnel type. The default tunnel type can be flexibly specified by the user according to the application scenario.

[0109] Method 2: Identify the VPN tunnel type based on the routing table of the source endpoint.

[0110] In this second method, any entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry, and the target routing table entry is the routing table entry in the routing table that matches the destination network segment with the destination address information. This application embodiment does not limit the method of matching the destination network segment based on the destination address information. When the destination address information is a destination address, the routing table entry in the routing table that matches the destination network segment with the destination address is determined as the target routing table entry. For example, the longest mask prefix matching rule is used to match the destination address. When the destination address information is a destination network segment, the routing table entry in the routing table that includes that destination network segment is determined as the target routing table entry. Where the source endpoint refers to the source VRF, the routing table of the source endpoint refers to the VPN routing table of the source VRF, i.e., the private network routing table.

[0111] Because the routing table includes routing entries that match the destination address information, the tunnel type can be accurately identified through the tunnel type included in the target routing entry. Although the routing table contains a large amount of data, making the overhead of retrieving the routing table of the source endpoint significant, the accuracy of tunnel type identification based on the routing table is higher. Furthermore, due to the higher success rate of tunnel type identification based on the routing table, tunnel type identification can be achieved even when tunnel type cannot be identified based on tunnel policy configuration.

[0112] For example, the routing table of the source endpoint can be as shown in Table 6 below. The routing table shown in Table 6 includes three routing entries. Each routing entry can include routing information such as destination / mask, prefix, cost, flags, next hop, and interface. Each routing entry can include more or less routing information; Table 6 is only an example. Taking the destination address as 10.22.2.2 as an example, the routing entry matching the destination address is the third routing entry. The tunnel type included in the third routing entry is SR-TE policy. An SR-TE policy type tunnel is an SR-MPLS TE Policy, which belongs to the TE type. Therefore, the identified tunnel type is TE.

[0113] Table 6

[0114]

[0115] In this embodiment, before identifying the VPN tunnel type based on the source endpoint's routing table, the source endpoint's routing table is collected. For example, the source endpoint's routing table can be collected via at least one of a Netconf connection or a telemetry connection. Specifically, collecting the routing table via a Netconf connection involves the controller actively querying routing table entries from the network element, while collecting the routing table via a telemetry connection involves the network element actively reporting changes to the controller when routing table entries change.

[0116] In one possible implementation, before identifying the tunnel type of the VPN tunnel based on the routing table of the source endpoint, a collection command is sent to the source endpoint. The collection command is used to collect routing table entries that include the tunnel type value. The routing table entries that include the tunnel type value sent by the source endpoint based on the collection command are received, and the routing table is obtained based on the received routing table entries.

[0117] In other words, when collecting routing table entries from the source endpoint, routing table entries including tunnel type values ​​can be collected. Compared to collecting all routing table entries from the source endpoint, this reduces the overhead of routing table collection and improves the efficiency of routing table collection. Furthermore, based on collecting routing table entries including tunnel type values, for each routing table entry including tunnel type values, routing information related to tunnel identification can be collected, such as destination network segment, prefix, next hop, and attributes. This further reduces the overhead required for routing table collection and decreases the amount of computation required for the controller to store and process routing tables.

[0118] For example, if the routing table is collected via telemetry, the sampling path (sensor-path) can be extended to support the collection of routing table entries that include tunnel type values. For instance, filters can be added to the sensor-path, with filter values ​​representing possible tunnel types, including but not limited to: ldp or bgp or te or static-lsp or sr-te or sr-te-policy or srv6-te-policy or… Here, "or" represents an OR relationship.

[0119] Therefore, through steps 201 and 202 above, this method can automatically identify the tunnel type of a VPN tunnel corresponding to a source endpoint through the tunnel policy configuration or routing table of the source endpoint, achieving automatic tunnel type identification with high accuracy. The identified tunnel type can be used to construct a network digital map, and furthermore, the tunnel path of the VPN tunnel can be reconstructed based on the identified tunnel type.

[0120] In one possible implementation, after identifying the VPN tunnel type based on the tunnel policy configuration or routing table of the source endpoint, the tunnel path between the source endpoint and the destination endpoint is reconstructed according to the tunnel type. Here, the tunnel path refers to the public network forwarding path connecting the source and destination endpoints of the VPN tunnel; the public network forwarding path is also the actual forwarding path between physical devices. This allows for the automatic reconstruction of the VPN tunnel path in addition to automatically identifying the tunnel type, thus restoring the actual forwarding path of packets in the VPN network and providing a foundation for building a digital network map.

[0121] For different tunnel types, a corresponding routing strategy can be used to reconstruct the tunnel path. In other words, the method for reconstructing the tunnel path will vary depending on the tunnel type.

[0122] Scenario 1: The tunnel type is BE.

[0123] Taking the shortest path first (SFP) routing strategy corresponding to the BE type as an example, reconstructing the tunnel path between the source endpoint and the destination endpoint according to the BE type can include reconstructing the tunnel path based on the IGP link-state information and IGP routing prefix information within the AS domain where the source endpoint is located, according to the SFP strategy. Therefore, for a BE type VPN tunnel, the tunnel path of the BE type VPN tunnel can be accurately reconstructed by following the corresponding BE type routing strategy, i.e., the SFP strategy.

[0124] Optionally, before restoring the tunnel path according to the shortest path first policy, based on the IGP link-state information and IGP route prefix information in the AS domain where the source endpoint is located, the IGP link-state information and IGP route prefix information of the source endpoint are also collected from each network element device in the AS domain where the source endpoint is located. For example, the IGP link-state information and IGP route prefix information of the source endpoint can be collected from each network element device in the AS domain where the source endpoint is located through BGP-LS.

[0125] BGP-LS is a network topology collection protocol. BGP-LS routes are the medium carrying network topology information. There are three types of BGP-LS routes, which are used to carry node information, link information, and route prefix information. Node information records the node information of the topology, which may include the node name, the node's router ID, and the domain name, etc. The router ID is also the node address. Link information records the link information between two network elements, which may include the local node name, local interface, local interface address (localInterfaceIP), remote node name, remote interface, remote interface address (remoteInterfaceIP), metric value, and domain, etc. Prefix information records the network segment information that the node can reach, which may include the node name, prefix, or domain, etc. The same node can correspond to multiple prefixes.

[0126] For example, still using Figure 4 Taking the network topology shown as an example, the source endpoint corresponds to the PE1 device, the destination endpoint corresponds to the PE2 device, the AS domain where the source endpoint is located is AS:100, and the nodes in AS:100 include PE1, P1, P2 and PE2. The IGP link state information and IGP routing prefix information of the source endpoint collected can include the following contents.

[0127] Node information:

[0128] {node:PE1,routerId:1.1.1.9,domain:100}

[0129] {node:P1,routerId:2.2.2.9,domain:100}

[0130] {node:P2,routerId:4.4.4.9,domain:100}

[0131] {node:PE2,routerId:3.3.3.9,domain:100}

[0132] Link information:

[0133] {localNode:PE1,remoteNode:P1,Metric:1,domain:100}

[0134] {localNode:PE1,remoteNode:P2,Metric:10,domain:100}

[0135] {localNode:P1,remoteNode:PE1,Metric:1,domain:100}

[0136] {localNode:P1,remoteNode:PE2,Metric:10,domain:100}

[0137] {localNode:PE2,remoteNode:P1,Metric:10,domain:100}

[0138] {localNode:PE2,remoteNode:P2,Metric:10,domain:100}

[0139] {localNode:P2,remoteNode:PE1,Metric:10,domain:100}

[0140] {localNode:P2,remoteNode:PE2,Metric:10,domain:100}

[0141] Prefix information:

[0142] {node:PE1,prefix:1.1.1.9,domain:100}

[0143] {node:PE1,prefix:172.16.1.0 / 24,domain:100}

[0144] {node:PE1,prefix:172.18.1.0 / 24,domain:100}

[0145] {node:P1,prefix:2.2.2.9,domain:100}

[0146] {node:P1,prefix:172.16.1.0 / 24,domain:100}

[0147] {node:P1,prefix:172.17.1.0 / 24,domain:100}

[0148] {node:PE2,prefix:3.3.3.9,domain:100}

[0149] {node:PE2,prefix:172.17.1.0 / 24,domain:100}

[0150] {node:PE2,prefix:172.19.1.0 / 24,domain:100}

[0151] {node:P2,prefix:4.4.4.9,domain:100}

[0152] {node:P2,prefix:172.18.1.0 / 24,domain:100}

[0153] {node:P2,prefix:172.19.1.0 / 24,domain:100}

[0154] Based on the aforementioned IGP link-state information and IGP routing prefix information, the shortest path from PE1 (1.1.1.9) to PE2 (3.3.3.9) is generated using the shortest path first (SPF) algorithm: PE1->P1->PE2, meaning the total metric for PE1->P1->PE2 is minimized. Therefore, the final reconstructed VPN tunnel path is: PE1->P1->PE2.

[0155] Scenario 2: The tunnel type is TE.

[0156] In scenario two, the source endpoint will be configured with TE tunnel paths to different destination endpoints. Multiple TE tunnel paths may be configured to the same destination endpoint, and each TE tunnel path may be bound to corresponding routing information used to select the appropriate TE tunnel path. For example, the routing information may include at least one of the destination endpoint's node address, tunnel interface, routing prefix, or routing attributes. Optionally, the source endpoint can have its TE tunnel paths statically configured by the user or dynamically configured by the controller; that is, the controller sends the configured TE tunnel paths to the source endpoint.

[0157] Reconstructing the tunnel path from the source endpoint to the destination endpoint according to the TE type may include restoring the tunnel path from the source endpoint to the destination endpoint based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint. The TE tunnel path configured for the source endpoint includes a TE tunnel path bound to at least one of the second information. The various second information includes: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, and the target route prefix or target route attribute matching the destination address information.

[0158] Therefore, for TE-type VPN tunnels, the source endpoint is configured with multiple TE tunnel paths. Since the TE tunnel paths configured at the source endpoint include TE tunnel paths bound to at least one type of second information, the tunnel path of the TE-type VPN tunnel can be accurately reconstructed using this at least one type of second information. Furthermore, since the at least one type of second information can be any combination of multiple types of second information, the method of reconstructing the tunnel path according to the TE type is more flexible, improving the success rate of tunnel path reconstruction.

[0159] Optionally, restoring the tunnel path between the source endpoint and the destination endpoint based on at least one of a plurality of second information and a TE tunnel path configured for the source endpoint may include obtaining a TE tunnel path bound to at least one of the second information from the TE tunnel paths configured for the source endpoint, and restoring the tunnel path between the source endpoint and the destination endpoint based on the TE tunnel path bound to at least one of the second information. In one possible implementation, there are multiple TE tunnel paths bound to at least one of the second information, and restoring the tunnel path between the source endpoint and the destination endpoint based on these multiple TE tunnel paths includes randomly selecting one TE tunnel path from the multiple TE tunnel paths as the restored tunnel path between the source endpoint and the destination endpoint; or, directly using the multiple TE tunnel paths as the restored tunnel path between the source endpoint and the destination endpoint; or, the multiple TE tunnel paths each have a corresponding priority, and selecting the TE tunnel path with the highest priority from the multiple TE tunnel paths as the restored tunnel path between the source endpoint and the destination endpoint.

[0160] Regarding the various methods of obtaining the second information, if the tunnel type is identified based on the tunnel policy configuration, then various second information is obtained here based on the tunnel policy configuration and the routing message. For specific methods of obtaining the second information, please refer to the methods of obtaining the first information mentioned above, which will not be repeated here. If the tunnel type is identified based on the routing table, then various second information is obtained here based on the routing table. That is, the target routing table entry that matches the destination address information also includes the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix, and the target route attributes.

[0161] Optionally, based on the node address of the destination endpoint and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the TE tunnel path bound to the node address of the destination endpoint; or, based on the target routing prefix matched by the destination address information and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the TE tunnel path bound to the target routing prefix matched by the destination address information; or, based on the tunnel interface bound to the destination endpoint, the target routing prefix matched by the destination address information, and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes the tunnel interface bound to the destination endpoint and the TE tunnel path bound to the target routing prefix matched by the destination address information. Other possible cases for at least one type of second information are similar to the examples above and will not be described in detail.

[0162] The processing methods for different combinations of at least one second piece of information are similar to those for different combinations of at least one first piece of information, and will not be repeated here. For the 15 possible combinations of at least one second piece of information, any combination can be randomly selected and queried in the TE tunnel path configured at the source endpoint. If no TE tunnel path is found that is bound to at least one second piece of information in that combination, the next combination is randomly changed until a bound TE tunnel path is found. Then, the tunnel path between the source endpoint and the destination endpoint is reconstructed based on that TE tunnel path. Alternatively, all 15 combinations of at least one second piece of information can be queried simultaneously in the TE tunnel path configured at the source endpoint. If a TE tunnel path is found that is bound to at least one second piece of information in any combination, the tunnel path between the source endpoint and the destination endpoint is reconstructed based on that TE tunnel path. Alternatively, all 15 combinations of at least one second piece of information can be queried sequentially in the TE tunnel path configured at the source endpoint in a certain order until a bound TE tunnel path is found. Then, the tunnel path between the source endpoint and the destination endpoint is reconstructed based on that TE tunnel path. The order of arrangement can be flexibly specified by the user according to the application scenario, or it can be determined according to the priority of 15 combinations, for example, the arrangement order can be obtained in descending order of priority.

[0163] See Figure 5Taking the following four combinations of at least one second piece of information—the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix matching the destination address information, and the target route attribute matching the destination address information—as an example, and with the priority of these four combinations from high to low as follows: 1. Node address of the destination endpoint, 2. Tunnel interface bound to the destination endpoint, 3. Target route prefix matching the destination address information, and 4. Target route attribute matching the destination address information, the process of obtaining the TE tunnel path bound to at least one second piece of information in the TE tunnel path configured at the source endpoint is illustrated.

[0164] like Figure 5 As shown, for a given TE type VPN tunnel, the process first checks whether the TE tunnel path configured at the source endpoint contains a TE tunnel path bound to the node address of the destination endpoint. If it does, the TE tunnel path is retrieved from the TE tunnel path configured at the source endpoint based on the node address of the destination endpoint. If it does not, the process continues to check whether the TE tunnel path configured at the source endpoint contains a TE tunnel path bound to the tunnel interface. If it does, the TE tunnel path is retrieved from the TE tunnel path configured at the source endpoint based on the tunnel interface bound to the destination endpoint. If it does not, the process continues to check whether the TE tunnel path configured at the source endpoint contains a TE tunnel path bound to the prefix. If it does, the TE tunnel path is retrieved from the TE tunnel path configured at the source endpoint based on the destination address information and the target route prefix. If it does not, the process continues to check whether the TE tunnel path configured at the source endpoint contains a TE tunnel path bound to the prefix. If a TE tunnel path based on route attribute binding is included, the TE tunnel path is obtained from the TE tunnel path configured at the source endpoint based on the target route attribute matched by the destination address information.

[0165] For example, still using Figure 4Taking the network topology shown as an example, the source endpoint corresponds to PE1 device, and the destination endpoint corresponds to PE2 device. Optionally, taking the TE tunnel path bound to the node address based on the destination endpoint as an example, the controller sends a TE tunnel path (source: PE1, destination: PE2) to PE1 device: PE1->P1->PE2, with a tunnel type of sr-te. The controller saves the sent TE tunnel path in the controller's database. If the TE tunnel path is not sent by the controller, it can be collected from PE1 device through a standard protocol. Optionally, the tunnel type sr-te is identified through the tunnel policy configuration shown in Table 2 above. At this time, it is restored according to the TE type. In the TE tunnel path configured on PE1 device, the PE2 address (3.3.3.9) is filtered and queried to obtain: PE1->P1->PE2, thus completing the restoration of the tunnel path.

[0166] Alternatively, taking the TE tunnel path bound to the tunnel interface as an example, the controller sends a TE tunnel path (source: PE1, destination: PE2) to the PE1 device: PE1->P1->PE2, and binds it to the tunnel interface Tunnel10, with the tunnel type being sr-te. The tunnel type sr-te is identified through the tunnel policy configuration shown in Table 3 above, and it is also identified that private network packets destined for 3.3.3.9 are bound to the tunnel interface Tunnel10. Therefore, the TE tunnel path bound to Tunnel10 can be directly queried to obtain: PE1->P1->PE2, thus restoring the tunnel path.

[0167] Alternatively, taking the TE tunnel path binding based on routing attributes as an example, a dynamic SR-MPLS TEPolicy is configured on the PE1 device, which can dynamically generate a TE tunnel path from PE1 to PE2. The controller will issue an SR-TE Policy to the PE1 device as shown below. Here, the headpoint corresponds to the source endpoint, the tailpoint corresponds to the destination endpoint, and the candidate paths include two paths, path1 and path2. The preference value represents the priority of the candidate paths; a larger value indicates higher priority. Therefore, path1, with its higher priority, is the primary path, and path2, with its lower priority, is the backup path. Load balancing can be performed between path1 and path2.

[0168] headpoint:1.1.1.9,endpoint:3.3.3.9,color:100,

[0169] candidate-path:[{name:path1,path:PE1->P1->PE2,preference:200},

[0170] {name:path2,path:PE1->P1->PE2,preference:100}]

[0171] The tunnel type sr-te-policy is identified through the tunnel policy configuration shown in Table 4 above. A tunnel of type sr-te-policy is an SR-MPLS TE Policy. Taking the route attribute as the color value as an example, the SR-MPLS TE Policy requires tunnel path matching based on the target color value. Therefore, first, the longest mask prefix is ​​matched in the routing packets received from the source VRF using the destination address information corresponding to the VPN tunnel. The target private network route can be found as: {nexthop:3.3.3.9,type:VPNv4,prefix:10.22.2.2 / 32,color:100,rd:2:2}. Then, in the TE tunnel path in the dynamic SR-MPLS TE Policy configured on the PE1 device, the following paths are obtained by filtering and querying using the node address (3.3.3.9) and color value (100) of the destination PE device: PE1->P1->PE2 (primary) and PE1->P1->PE2 (backup), thus completing the tunnel path reconstruction. Therefore, if the TE tunnel path includes a load balancing path, multiple tunnel paths that meet the conditions can be restored according to priority.

[0172] Scenario 3: The tunnel type is a multi-level tunnel.

[0173] In scenario three, reconstructing the tunnel path from the source endpoint to the destination endpoint according to the multi-layer tunnel type may include: determining a first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information; the first tunnel path including at least one sub-tunnel; for any sub-tunnel in the first tunnel path, determining the sub-tunnel type of any sub-tunnel in the tunnel policy configuration of the sub-source endpoint of any sub-tunnel or the routing table of the sub-source endpoint of any sub-tunnel; reconstructing the sub-tunnel path from the sub-source endpoint of any sub-tunnel to the sub-destination endpoint of any sub-tunnel according to the sub-tunnel type; and reconstructing the tunnel path from the source endpoint to the destination endpoint based on the first tunnel path and the sub-tunnel path corresponding to any sub-tunnel. For example, the first tunnel path includes a two-hop forwarding path, which corresponds to two sub-tunnels; by incorporating the sub-tunnel path corresponding to each sub-tunnel into the first tunnel path, the tunnel path from the source endpoint to the destination endpoint is obtained.

[0174] For multi-layer tunnel types, the upper-layer tunnel path is first reconstructed using the destination endpoint as the destination address information and the corresponding route for the multi-layer tunnel type. Then, for each hop in the upper-layer tunnel path, the sub-tunnel paths of the sub-tunnels are reconstructed using the methods described above. Therefore, for multi-layer tunnel types of VPN tunnels, the tunnel path can be accurately reconstructed through iterative reconstruction.

[0175] Optionally, determining the first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information can include determining the first tunnel path from the source endpoint to the destination endpoint based on the routes corresponding to the multi-layer tunnel types of various network element devices within the AS domain where the source endpoint is located, and the routes corresponding to the multi-layer tunnel types of various network element devices within the AS domain where the destination endpoint is located, using the node address of the destination endpoint as the destination address information. In the case where the multi-layer tunnel type is BGP-LSP, the routes corresponding to the multi-layer tunnel type are labeled IPv4 unicast routes.

[0176] For example, see Figure 6 The network topology shown includes network elements CSG, AGG, ABR, and MASG. The node address of CSG is 1.1.1.1, the node address of AGG is 2.2.2.2, the node address of ABR is 3.3.3.3, and the node address of MASG is 4.4.4.4. CSG, AGG, ABR, and MASG are in the same AS domain, configured with MPLS LDP, and have established an MPLS LSP. All network elements have label routing switching capabilities enabled. AGG and ABR act as route reflectors (RRs), enabling CSG and MASG to obtain each other's routes through route reflection. Taking CSG as the source endpoint and MASG as the destination endpoint as an example, the private network route of the source VRF in CSG includes: {nexthop:4.4.4.4,type:VPNv4,prefix:10.0.1.1 / 32,rd:2:2}. CSG, AGG, ABR, and MASG contain labeled unicast routes as shown below.

[0177] CSG:{nexthop:2.2.2.2,type:ipv4 unicast,prefix:4.4.4.4 / 32}; AGG:{nexthop:3.3.3.3,type:ipv4 unicast,prefix:4.4.4.4 / 32},{nexthop:1.1.1.1,type:ipv4 unicast,prefix:1.1.1.1 / 32};ABR:{nexthop:4.4.4.4,type:ipv4unicast,prefix:4.4.4.4 / 32},{nexthop:2.2.2.2,type:ipv4 unicast,prefix:1.1.1.1 / 32};MASG:{nexthop:3.3.3.3,type:ipv4 unicast,prefix:1.1.1.1 / 32}.

[0178] Based on the tunnel strategy configuration shown in Table 5 above, the tunnel type is identified as BGP. The BGP type tunnel is BGP-LSP, which belongs to the multi-layer tunnel type. Therefore, the tunnel is restored according to the multi-layer tunnel type. First, the BGP-LSP path, i.e., the first tunnel path, is restored. On the ASG, using MASG (4.4.4.4) as the destination address, a unicast route with the longest mask prefix is ​​queried using the longest mask prefix matching method, resulting in: {nexthop:2.2.2.2,type:ipv4unicast,prefix:4.4.4.4 / 32}, which is the next hop to the AGG. Then, on the AGG, using 4.4.4.4 as the destination address, a unicast route with the longest mask prefix is ​​queried using the longest mask prefix matching method, resulting in: {nexthop:3.3.3.3,type:ipv4 unicast,prefix:4.4.4.4 / 32}, which is the next hop to the ABR. Finally, on the ABR, using 4.4.4.4 as the destination address, a unicast route with the longest mask prefix is ​​queried using the longest mask prefix matching method, resulting in: {nexthop:4.4.4.4,type:ipv4 unicast,prefix:4.4.4.4 / 32}, which is the next hop to the MASG, with MASG as the destination endpoint, thus completing the reconstruction of the BGP-LSP path. The generated BGP-LSP path is: ASG->AGG->ABR->MASG. Finally, the sub-tunnel path of each hop in the BGP-LSP path needs to be iteratively calculated according to the above method provided in the embodiments of this application. That is, the 4-hop sub-tunnel includes (ASG, AGG, 2.2.2.2), (AGG, ABR, 3.3.3.3), and (ABR, MASG, 4.4.4.4).

[0179] Taking the first hop (ASG, AGG, 2.2.2.2) as an example, the sub-tunnel path of the reconstructed sub-tunnel is illustrated. The VPN tunneling policy configuration on ASG is collected. Here, the tunneling policy is based on address family binding, and the tunneling policy configuration is shown in Table 7 below.

[0180] Table 7

[0181]

[0182] Rows 3 and 4 in Table 7 represent the tunnel policy p1 bound to the tagged unicast address family. Rows 1 and 2 in Table 7 represent the tunnel type of tunnel policy p1 as LDP. LDP type tunnels are BE type tunnels, and the sub-tunnel paths (ASG, AGG, 2.2.2.2) are restored using the method described in Case 1. If the sub-tunnel is of other types, it can be processed according to the method in the corresponding embodiment. Since the BE tunnel path from ASG to AGG contains only one hop, the resulting sub-tunnel path is ASG->AGG. All single-hop paths of BGP-LSP are restored to their corresponding sub-tunnel paths, resulting in the final tunnel path ASG->AGG->ABR->MASG.

[0183] Therefore, by using the above scenarios one through three, it is possible to reconstruct the tunnel path according to the tunnel type after identifying the tunnel type.

[0184] In one possible implementation, in a scenario where tunnel type identification is based on the routing table, if the target routing entry in the routing table directly includes a tunnel identifier, and one tunnel identifier corresponds to one tunnel path, then the tunnel path can be directly reconstructed based on the tunnel identifier; or, if the outgoing interface of the target routing entry in the routing table directly indicates the tunnel policy, then the tunnel path can be directly reconstructed based on the tunnel path corresponding to the tunnel policy. For example, if the target routing entry is determined to be the 3rd routing entry based on the routing table shown in Table 6, and the next hop value of the 3rd routing entry is policy100, then querying the TE tunnel path corresponding to policy100 can reconstruct the tunnel path.

[0185] In summary, the tunnel identification method provided in this application can automatically identify the tunnel type of a VPN tunnel and reconstruct the tunnel path based on the tunnel type. Since users do not need to manually specify the tunnel type, the user experience is improved; for the same source and destination endpoints, different tunnel paths can be reconstructed if the destination addresses are different; for dynamically changing tunnel paths, changes in the tunnel path can be detected; real-time reconstruction is possible with low resource overhead. Therefore, based on reconstructing the VPN private network path (i.e., the VPN forwarding path) according to the VPN topology, a more comprehensive network digital map can be constructed based on the tunnel type and tunnel path automatically identified in this application.

[0186] For example, see Figure 7 The network digital map shown depicts VPN forwarding paths including VPN node 1, VPN node 2, VPN node 3, and VPN node 4. Each VPN node can be located on a PE device. VPN node 1 and VPN node 2 correspond to VPN tunnel 1, and VPN node 3 and VPN node 4 correspond to VPN tunnel 2. Figure 7 It can be seen that VPN tunnel 1 is tunnel type 1, and the tunnel path is PE1->P1->P2->P3->PE2. VPN tunnel 2 is tunnel type 2, and the tunnel path is PE3->P4->P5->PE4.

[0187] The tunnel identification method of this application embodiment has been described above. Corresponding to the above method, this application embodiment also provides a tunnel identification device. Figure 8 This is a schematic diagram of a tunnel identification device provided in an embodiment of this application. The device is applied to a controller, which is the aforementioned... Figure 1 The controller shown. Based on Figure 8 The following modules are shown. Figure 8 The tunnel identification device shown is capable of performing all or part of the operations executed by the controller. It should be understood that the device may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. Figure 8 As shown, the device includes:

[0188] The acquisition module 801 is used to acquire VPN tunnel information, including source endpoint information; the identification module 802 is used to identify the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

[0189] In one possible implementation, the identification module 802 is used to determine the tunnel type of the VPN tunnel based on at least one of a plurality of first information and a tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to at least one of the first information, and the tunnel policy includes a tunnel type. The VPN tunnel information also includes destination address information and / or destination endpoint information of the packets transmitted through the VPN tunnel. The plurality of first information includes: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

[0190] In one possible implementation, the target route prefix or target route attribute is determined by a route message, which is a message received by the source endpoint to advertise route information, including at least one of the target route prefix or target route attribute.

[0191] In one possible implementation, the VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel, and any routing table entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry, and the target routing table entry is the routing table entry in the routing table whose destination network segment matches the destination address information.

[0192] In one possible implementation, the apparatus further includes: a sending module for sending a collection command to a source endpoint, the collection command being used to collect routing table entries including tunnel type values; and a receiving module for receiving routing table entries including tunnel type values ​​sent by the source endpoint based on the collection command, and obtaining a routing table based on the received routing table entries.

[0193] In one possible implementation, the VPN tunnel information also includes information about the destination endpoint, and the apparatus further includes a restoration module for restoring the tunnel path between the source endpoint and the destination endpoint according to the tunnel type.

[0194] In one possible implementation, the tunnel type is BE type; the restoration module is used to restore the tunnel path according to the shortest path first strategy based on the IGP link state information and IGP routing prefix information in the AS domain where the source endpoint is located.

[0195] In one possible implementation, the tunnel type is TE type; the restoration module is used to restore the tunnel path between the source endpoint and the destination endpoint based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint, wherein the TE tunnel path configured for the source endpoint includes a TE tunnel path bound to at least one of the second information; the VPN tunnel information also includes destination address information of the packets transmitted through the VPN tunnel, wherein the variety of second information includes: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix matching the destination address information, or the target route attribute matching the destination address information.

[0196] In one possible implementation, the tunnel type is a multi-layer tunnel type; the restoration module is used to determine a first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information, the first tunnel path including at least one sub-tunnel; for any sub-tunnel in the first tunnel path, the sub-tunnel type of any sub-tunnel is determined in the tunnel policy configuration of the sub-source endpoint of any sub-tunnel or the routing table of the sub-source endpoint of any sub-tunnel; the sub-tunnel path between the sub-source endpoint of any sub-tunnel and the sub-destination endpoint of any sub-tunnel is restored according to the sub-tunnel type; based on the first tunnel path and the sub-tunnel path corresponding to any sub-tunnel, the tunnel path between the source endpoint and the destination endpoint is restored.

[0197] It should be understood that the above Figure 8 The provided device, when implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process and beneficial effects are detailed in the method embodiments, and will not be repeated here.

[0198] See Figure 9 , Figure 9 A schematic diagram of the structure of a network device 2000 provided in an exemplary embodiment of this application is shown. Figure 9 The network device 2000 shown is used to perform the above. Figure 2 The tunnel identification method shown involves the following operations. The network device 2000 is, for example, a switch, router, controller, etc., and can be implemented using a general bus architecture.

[0199] like Figure 9 As shown, the network device 2000 includes at least one processor 2001, a memory 2003, and at least one communication interface 2004.

[0200] Processor 2001 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the embodiments of this application. For example, processor 2001 includes application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this invention. A processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0201] Optionally, the network device 2000 also includes a bus. The bus is used to transfer information between the various components of the network device 2000. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.

[0202] Memory 2003 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 2003 may exist independently and be connected to processor 2001 via a bus. Memory 2003 may also be integrated with processor 2001.

[0203] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), or wireless local area networks (WLAN). The communication interface 2004 can include wired and wireless communication interfaces. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment, the communication interface 2004 can be used by the network device 2000 to communicate with other devices.

[0204] In a specific implementation, as one example, the processor 2001 may include one or more CPUs, such as Figure 9The CPUs shown are CPU0 and CPU1. Each of these processors can be a single-core CPU or a multi-core CPU. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0205] In a specific implementation, as one example, the network device 2000 may include multiple processors, such as... Figure 9 The processors shown are 2001 and 2005. Each of these processors can be a single-core CPU or a multi-core CPU. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0206] In a specific implementation, as one example, the network device 2000 may further include output devices and input devices. The output device communicates with the processor 2001 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 2001 and can receive user input in various ways. For example, the input device may be a mouse, keyboard, touchscreen device, or sensor device, etc.

[0207] In some embodiments, the memory 2003 stores program code 2010 for executing the solution of this application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the tunnel identification method provided in the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of this application.

[0208] In a specific embodiment, the network device 2000 of this application embodiment can correspond to the first network device in the above-described method embodiments. The processor 2001 in the network device 2000 reads instructions from the memory 2003, causing... Figure 9 The network device 2000 shown is capable of performing... Figure 2 The method shown performs all or part of the operations.

[0209] Specifically, the processor 2001 is used to obtain VPN tunnel information, which includes information about the source endpoint; and to identify the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

[0210] Other alternative implementation methods will not be described in detail here for the sake of brevity.

[0211] Network device 2000 can also correspond to the above. Figure 8 The tunnel identification device shown in the diagram implements each functional module of the network device 2000 using software. In other words, the functional modules of the tunnel identification device are generated by the processor 2001 of the network device 2000 reading the program code 2010 stored in the memory 2003.

[0212] in, Figure 2 Each step of the tunnel identification method shown is completed through integrated logic circuits in the hardware or software instructions in the processor of the network device 2000. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. Since this storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method; to avoid repetition, these will not be described in detail here.

[0213] See Figure 10 , Figure 10 This invention provides a schematic diagram of the structure of a network device 2100 according to another exemplary embodiment of the present application. Figure 10 The network device 2100 shown is used to perform the above. Figure 2 The tunnel identification method shown involves all or part of the operations. The network device 2100 is, for example, a switch, router, controller, etc., and can be implemented using a general bus architecture.

[0214] like Figure 10 As shown, the network device 2100 includes a main control board 2110 and an interface board 2130.

[0215] The main control board, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the network device 2100, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes a central processing unit 2111 and a memory 2112.

[0216] Interface board 2130 is also called a line processing unit (LPU), linecard, or service board. Interface board 2130 provides various service interfaces and implements packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc., with Ethernet interfaces including, for example, Flexible Ethernet Clients (FlexE Clients). Interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding table entry memory 2134, and a physical interface card (PIC) 2133.

[0217] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110.

[0218] Network processor 2132 is used to implement packet forwarding processing. Network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). Specifically, network processor 2132 forwards received packets based on the forwarding table stored in forwarding table entry memory 2134. If the destination address of the packet is the address of network device 2100, the packet is sent to the CPU (such as central processing unit 2131) for processing; if the destination address of the packet is not the address of network device 2100, the next hop and outgoing interface corresponding to the destination address are looked up in the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Uplink packet processing may include: packet ingress interface processing, forwarding table lookup; downlink packet processing may include: forwarding table lookup, etc. In some embodiments, the central processing unit can also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for a forwarding chip on the interface board.

[0219] The physical interface card 2133 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 2130 through this card, and processed packets are sent out from the physical interface card 2133. The physical interface card 2133, also called a daughter card, can be installed on the interface board 2130. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 2132 for processing. In some embodiments, the central processing unit 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 2132 in the physical interface card 2133.

[0220] Optionally, network device 2100 includes multiple interface boards. For example, network device 2100 also includes interface board 2140, which includes: a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation methods of each component in interface board 2140 are the same as or similar to those in interface board 2130, and will not be described in detail here.

[0221] Optionally, network device 2100 also includes a switching fabric unit (SFU). When network device 2100 has multiple interface boards, the switching fabric unit 2120 is used to complete data exchange between the interface boards. For example, interface boards 2130 and 2140 can communicate through the switching fabric unit 2120.

[0222] The main control board 2110 and the interface boards are coupled. For example, the main control board 2110, interface boards 2130 and 2140, and the switching network board 2120 communicate with each other via a system bus connected to the system backplane. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and interface boards 2130 and 2140, and communication between the main control board 2110 and interface boards 2130 and 2140 is achieved through the IPC channel.

[0223] Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the status of network devices. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables distributed by the control plane. The forwarding tables distributed by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.

[0224] It's worth noting that a network device may have one or more main control boards, including a primary and a backup main control board. It may also have one or more interface boards; the more powerful the network device's data processing capabilities, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the network device may not need a switching board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the network device can have at least one switching board, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture network device are greater than those of a centralized architecture network device. Alternatively, the network device can also be a single board, without a switching board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of network device has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture adopted depends on the specific network deployment scenario, and no restrictions are imposed here.

[0225] In a specific embodiment, network device 2100 corresponds to the above. Figure 8 The tunnel identification device shown. In some embodiments, Figure 8 The acquisition module 801 in the tunnel identification device shown and the central processing unit 2111 or network processor 2132 in the identification module network device 2100.

[0226] Figure 11This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1000 can vary considerably due to different configurations or performance. It may include one or more processors 1001 and one or more memories 1002. The one or more memories 1002 store at least one computer program, which is loaded and executed by the one or more processors 1001 to enable the server to perform the aforementioned functions. Figure 2 The method embodiment shown provides a tunnel identification method. Of course, the server 1000 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1000 may also include other components for implementing device functions, which will not be described in detail here.

[0227] This application embodiment also provides a communication device, which includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory stores instructions, and the processor executes the instructions stored in the memory to control the transceiver to receive and transmit signals. When the processor executes the instructions stored in the memory, it causes the processor to perform... Figure 2 The method shown.

[0228] It should be understood that the aforementioned processor can be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Computing (RISC) machines (ARM) architecture.

[0229] Furthermore, in an alternative embodiment, the memory described above may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.

[0230] The memory can be volatile or non-volatile, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0231] This application also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to enable a computer to implement any of the tunnel identification methods described above.

[0232] This application also provides a computer program (product) that, when executed by a computer, causes the processor or computer to perform the corresponding steps and / or processes in the above method embodiments.

[0233] This application also provides a chip, including a processor, for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform any of the tunnel identification methods described above.

[0234] This application embodiment also provides another chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute any of the tunnel identification methods described above.

[0235] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to this application are 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. For example, 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, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk), etc.

[0236] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can 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.

[0237] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0238] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.

[0239] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0240] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.

[0241] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0242] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0243] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0244] In the embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.

[0245] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0246] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0247] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0248] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the scope of various examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, they can be separate and distinct images.

[0249] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0250] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

[0251] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0252] It should also be understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects are in an "or" relationship.

[0253] It should also be understood that the term “comprising” (also referred to as “includes”, “including”, “comprises” and / or “comprising”) as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0254] It should also be understood that the terms “if” and “if” can be interpreted as meaning “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrases “if determination…” or “if detection [the stated condition or event]” can be interpreted as meaning “when determination…”, or “in response to determination…”, or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.

[0255] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0256] It should also be understood that the phrases "an embodiment," "an embodiment," and "a possible implementation" used throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "an embodiment," or "a possible implementation" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0257] The above description is only an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A tunnel identification method, characterized in that, The method includes: Obtain information about a Virtual Private Network (VPN) tunnel, including information about the source endpoint. The tunnel type of the VPN tunnel is identified based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

2. The method according to claim 1, characterized in that, The tunnel type of the VPN tunnel is identified based on the tunnel policy configuration of the source endpoint, including: Based on at least one of a variety of first information and the tunnel policy configuration, the tunnel type of the VPN tunnel is determined, wherein the tunnel policy configuration includes a tunnel policy bound to the at least one first information, and the tunnel policy includes the tunnel type; The VPN tunnel information also includes destination address information and / or destination endpoint information of the packets transmitted through the VPN tunnel. The various first pieces of information include: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

3. The method according to claim 2, characterized in that, The target route prefix or the target route attribute is determined by a routing message, which is a message received by the source endpoint for announcing routing information. The routing information includes at least one of the target route prefix or the target route attribute.

4. The method according to claim 1, characterized in that, The VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel. Each routing table entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry. The target routing table entry is the routing table entry in the routing table whose destination network segment matches the destination address information.

5. The method according to claim 4, characterized in that, Before identifying the tunnel type of the VPN tunnel based on the routing table of the source endpoint, the process also includes: Send a collection command to the source endpoint, the collection command being used to collect routing table entries including tunnel type values; Receive routing table entries, including the value of the tunnel type, sent by the source endpoint based on the acquisition command, and obtain the routing table based on the received routing table entries.

6. The method according to any one of claims 1-5, characterized in that, The VPN tunnel information also includes destination endpoint information. After identifying the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint, the information further includes: Reconstruct the tunnel path between the source endpoint and the destination endpoint according to the tunnel type.

7. The method according to claim 6, characterized in that, The tunnel type is a best-effort BE type; The step of reconstructing the tunnel path between the source endpoint and the destination endpoint according to the tunnel type includes: Based on the Interior Gateway Protocol (IGP) link-state information and IGP routing prefix information within the Autonomous System (AS) domain where the source endpoint is located, the tunnel path is reconstructed according to the shortest path first strategy.

8. The method according to claim 6, characterized in that, The tunnel type is Flow Engineering (TE) type; the step of reconstructing the tunnel path between the source endpoint and the destination endpoint according to the tunnel type includes: Based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint, the tunnel path between the source endpoint and the destination endpoint is restored, wherein the TE tunnel path configured for the source endpoint includes a TE tunnel path bound to the at least one second information; The VPN tunnel information also includes destination address information of the packets transmitted through the VPN tunnel. The various second pieces of information include: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

9. The method according to claim 6, characterized in that, The tunnel type is a multi-level tunnel type; The step of reconstructing the tunnel path between the source endpoint and the destination endpoint according to the tunnel type includes: Using the node address of the destination endpoint as the destination address information, a first tunnel path is determined from the source endpoint to the destination endpoint, and the first tunnel path includes at least one sub-tunnel; For any sub-tunnel in the first tunnel path, determine the sub-tunnel type of the sub-tunnel in the tunnel policy configuration of the sub-source endpoint of the sub-tunnel or in the routing table of the sub-source endpoint of the sub-tunnel; and restore the sub-tunnel path between the sub-source endpoint of the sub-tunnel and the sub-destination endpoint of the sub-tunnel according to the sub-tunnel type. Based on the first tunnel path and the sub-tunnel path corresponding to any of the sub-tunnels, the tunnel path between the source endpoint and the destination endpoint is reconstructed.

10. A tunnel identification device, characterized in that, The device includes: The acquisition module is used to acquire information about a Virtual Private Network (VPN) tunnel, including information about the source endpoint. The identification module is used to identify the tunnel type of the VPN tunnel based on the tunnel policy configuration of the source endpoint or the routing table of the source endpoint.

11. The apparatus according to claim 10, characterized in that, The identification module is used to determine the tunnel type of the VPN tunnel based on at least one of a variety of first information and the tunnel policy configuration. The tunnel policy configuration includes a tunnel policy bound to the at least one first information, and the tunnel policy includes the tunnel type. The VPN tunnel information also includes destination address information and / or destination endpoint information of the packets transmitted through the VPN tunnel. The variety of first information includes: the address family to which the destination address information belongs, the node address of the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

12. The apparatus according to claim 11, characterized in that, The target route prefix or the target route attribute is determined by a routing message, which is a message received by the source endpoint for announcing routing information. The routing information includes at least one of the target route prefix or the target route attribute.

13. The apparatus according to claim 1, characterized in that, The VPN tunnel information also includes the destination address information of the packets transmitted through the VPN tunnel. Each routing table entry in the routing table includes the destination network segment and the tunnel type. The tunnel type of the VPN tunnel is the tunnel type included in the target routing table entry. The target routing table entry is the routing table entry in the routing table whose destination network segment matches the destination address information.

14. The apparatus according to claim 13, characterized in that, The device further includes: The sending module is used to send a collection instruction to the source endpoint, the collection instruction being used to collect routing table entries including tunnel type values; The receiving module is used to receive routing table entries, including the value of the tunnel type, sent by the source endpoint based on the acquisition command, and to obtain the routing table based on the received routing table entries.

15. The apparatus according to any one of claims 10-14, characterized in that, The VPN tunnel information also includes destination endpoint information, and the device further includes: The restoration module is used to restore the tunnel path between the source endpoint and the destination endpoint according to the tunnel type.

16. The apparatus according to claim 15, characterized in that, The tunnel type is a best-effort (BE) type; the restoration module is used to restore the tunnel path according to the shortest path first strategy based on the internal gateway protocol (IGP) link state information and IGP routing prefix information within the Autonomous System (AS) domain where the source endpoint is located.

17. The apparatus according to claim 15, characterized in that, The tunnel type is Flow Engineering (TE) type; the restoration module is used to restore the tunnel path between the source endpoint and the destination endpoint based on at least one of a variety of second information and the TE tunnel path configured for the source endpoint, wherein the TE tunnel path configured for the source endpoint includes a TE tunnel path bound to the at least one of the second information. The VPN tunnel information also includes destination address information of the packets transmitted through the VPN tunnel. The various second pieces of information include: the node address of the destination endpoint, the tunnel interface bound to the destination endpoint, the target route prefix matched by the destination address information, or the target route attribute matched by the destination address information.

18. The apparatus according to claim 15, characterized in that, The tunnel type is a multi-level tunnel type; The restoration module is used to determine a first tunnel path from the source endpoint to the destination endpoint using the node address of the destination endpoint as the destination address information. The first tunnel path includes at least one sub-tunnel. For any sub-tunnel in the first tunnel path, the sub-tunnel type of the sub-tunnel is determined in the tunnel policy configuration of the sub-source endpoint of the sub-tunnel or in the routing table of the sub-source endpoint of the sub-tunnel. Reconstruct the sub-tunnel path between the sub-source endpoint and the sub-destination endpoint of any sub-tunnel according to the sub-tunnel type; Based on the first tunnel path and the sub-tunnel path corresponding to any of the sub-tunnels, the tunnel path between the source endpoint and the destination endpoint is reconstructed.

19. A tunnel identification device, characterized in that, The tunnel identification device includes a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the tunnel identification device to implement the tunnel identification method according to any one of claims 1-9.

20. A computer-readable storage medium, characterized in that, The computer storage medium stores at least one instruction, which is loaded and executed by a processor to enable the computer to implement the tunnel identification method as described in any one of claims 1-9.

21. A computer program product, characterized in that, The computer program product includes: computer program code, which is loaded and executed by a computer to enable the computer to implement the tunnel identification method according to any one of claims 1-9.