A routing label allocation method and device, electronic equipment and storage medium

By selecting primary and alternative paths in the network to generate different routing labels, and selecting the target label based on the path relationship of neighboring devices, the label loop problem caused by FRR is solved, achieving a stable network topology and efficient packet forwarding.

CN118869585BActive Publication Date: 2025-11-18RUIJIE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310466661.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2025-11-18
Estimated Expiration
2043-04-27

AI Technical Summary

Technical Problem

In complex network environments, Fast Rerouting (FRR) can cause label allocation loops between routing devices, leading to network topology instability and reduced packet forwarding rate and accuracy.

Method used

By selecting the primary path and alternative paths from the candidate paths, the first route label and the second route label of the first device are generated, and the target route label is selected according to the path relationship of neighboring devices to avoid circular allocation.

Benefits of technology

It improves the reliability of routing labels, stabilizes the network topology, increases packet forwarding rate and accuracy, and saves routing label resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869585B_ABST
    Figure CN118869585B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, in particular to a routing label allocation method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining each candidate path between a first device and a target device, and selecting a main path and a backup path from the candidate paths; generating a first routing label of the first device based on the next hop information of the main path and the backup path, and generating a second routing label of the first device based on the next hop information of the main path; determining each neighbor device having a connection relationship with the first device, and performing the following operation on each neighbor device: selecting the first routing label or the second routing label as a target routing label used when the first device and one neighbor device interact with the target device according to the path relationship between the one neighbor device and the first device. In this way, the cyclic routing label allocation is avoided, and the use reliability of the routing label is improved.
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 a routing label allocation method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of network forwarding technology, the application of Multi-Protocol Label Switching (MPLS) and Segment Routing IPv6 (SRv6) based on Internet Protocol version 6 is becoming increasingly widespread. For example, in Virtual Private Network (VPN) scenarios that span autonomous systems, before forwarding packets, it is necessary to create a feasible path for the packet to reach the destination address in the network, assign labels to each routing device in the feasible path, and forward packets through labels.

[0003] In related technologies, when assigning labels to various routing devices, a unique label is usually assigned directly based on all the next-hop information of the routing device as the key field.

[0004] However, in real-world applications, the complexity of the network environment often increases, such as with Fast Reroute (FRR). FRR includes a primary path and a backup path. Since FRR can result in a situation where a routing device and its neighboring devices act as backups for each other, circular label assignments can occur, leading to network topology instability and reducing packet forwarding rate and accuracy.

[0005] For example, see Figure 1The diagram illustrates a type of FRR (Free Route Redirection). Routing device R1 assigns label L1 to route 100.1.1.1 / 32 and carries outgoing label L1, advertising the route to routing devices R2 and R3. Assume R2 first receives route 100.1.1.1 / 32 from R1, preferentially using R1 as the primary next hop, and assigns label L1 as the outgoing label. Based on the next hop information and outgoing label information, R2 assigns label L2 and advertises route 100.1.1.1 / 32 to R3, with R3's outgoing label being L2. R3 receives route 100.1.1.1 / 32 from both R1 and R2, preferentially using R1 as the primary next hop, and assigns label L1 as the outgoing label, and preferentially using R2 as the backup next hop, with outgoing label L2 as the outgoing label. Based on the primary and backup next hop information and outgoing label information, R3 assigns label L3. R2 announces route 100.1.1.1 / 32 to R2, with R2's outgoing label being L3; R2 receives route 100.1.1.1 / 32 from R3, with outgoing label L3, prefers R1 as the primary next hop, with outgoing label L1, and prefers R3 as the backup next hop, with outgoing label L3. Based on the primary and backup next hop information and outgoing label information, R2 assigns label L4 and announces route update to R3, with R3's outgoing label being L4; R3 receives route 100.1.1.1 / 32 from R2, prefers R1 as the primary next hop, with outgoing label L1, and prefers R2 as the backup next hop, with outgoing label L4. Based on the primary and backup next hop information and outgoing label information, R3 assigns label L5 and announces route 100.1.1.1 / 32 to R2, with R2's outgoing label being L5. Labels are assigned in a cyclical manner using R2 and R3. The labels are constantly changing, which leads to high CPU resource consumption and unstable network topology, thereby reducing the forwarding rate and accuracy of packets.

[0006] In view of this, a new label allocation method is needed to address the above problems. Summary of the Invention

[0007] This application provides a routing label allocation method, apparatus, electronic device, and storage medium to improve the reliability of routing label usage.

[0008] The specific technical solutions provided in this application are as follows:

[0009] Firstly, a method for assigning route labels is provided, including:

[0010] Determine each candidate path between the first device and the target device, and select the main path and at least one alternative path from each candidate path;

[0011] Based on the next-hop information of the primary path and at least one alternative path, a first route label for the first device is generated, and a second route label for the first device is generated based on the next-hop information of the primary path; wherein, the next-hop information includes at least: the connection address and route label of the next-hop device of the first device on the corresponding path, and the connection interface between the first device and the next-hop device;

[0012] Identify each neighboring device that has a connection with the first device, and perform the following operations for each neighboring device: Select a first route label or a second route label based on the path relationship between a neighboring device and the first device, as the target route label used when the first device interacts with a neighboring device for relevant information about the target device.

[0013] Optionally, from the candidate paths, a primary path and at least one alternative path are selected, including:

[0014] Based on the path length of each candidate path, the candidate path whose path length meets the preset length condition is taken as the main path.

[0015] At least one of the remaining candidate paths will be used as alternative paths.

[0016] Optionally, based on the next-hop information of the primary path and at least one alternative path, a first route label for the first device is generated, including:

[0017] The next-hop information of the main path and at least one alternative path is used as the first information tuple;

[0018] Select a value from the preset label set as the first routing label for the first device;

[0019] A binding relationship is established between the first routing label and the first information tuple, wherein the first routing label is used to uniquely identify the first information tuple;

[0020] Optionally, based on the next-hop information of the primary path, a second route label for the first device is generated, including:

[0021] Use the next hop information of the main path as the second information tuple;

[0022] Select a value from the preset label set as the second routing label for the first device;

[0023] A binding relationship is established between the second routing label and the second information tuple, wherein the second routing label is used to uniquely identify the second information tuple.

[0024] Optionally, after generating the second route label for the first device based on the next-hop information of the primary path, the method further includes:

[0025] Based on the first route label and the first information tuple, the first forwarding table entry is obtained and saved to the preset forwarding table. The first forwarding table entry records the binding relationship between the first route label and the first information tuple.

[0026] Based on the second routing label and the second information tuple, the second forwarding table entry is obtained and saved to the forwarding table. The second forwarding table entry records the binding relationship between the second routing label and the second information tuple.

[0027] Optionally, based on the path relationship between a neighboring device and the first device, a first route label or a second route label is selected as the target route label used when the first device interacts with a neighboring device to exchange information related to the target device, including:

[0028] If the path relationship between a neighboring device and the first device is a non-alternative path, then the first route label is used as the destination route label;

[0029] If the path relationship between a neighboring device and the first device is a candidate path, then the second route label is used as the target route label.

[0030] Optionally, based on the path relationship between a neighboring device and the first device, a first route label or a second route label is selected as the target route label used when the first device interacts with a neighboring device to exchange information related to the target device. The method further includes:

[0031] Receive message forwarding instructions, which carry the tag information of the message to be forwarded;

[0032] Based on the tag information, a matching forwarding path is selected from the forwarding table, and the packet to be forwarded is forwarded to the next-hop device of the first device on the forwarding path.

[0033] Secondly, a routing label allocation device is provided, comprising:

[0034] The processing module is used to determine each candidate path between the first device and the target device, and select the main path and at least one alternative path from each candidate path;

[0035] The generation module is used to generate a first route label for the first device based on the next-hop information of the main path and at least one alternative path, and to generate a second route label for the first device based on the next-hop information of the main path; wherein the next-hop information includes at least: the connection address and route label of the next-hop device of the first device on the corresponding path, and the connection interface between the first device and the next-hop device;

[0036] The determination module is used to determine each neighboring device that has a connection with the first device, and for each neighboring device, perform the following operations: select a first route label or a second route label based on the path relationship between a neighboring device and the first device, as the target route label used when the first device interacts with a neighboring device to exchange relevant information about the target device.

[0037] Optionally, when selecting the primary path and at least one alternative path from among the candidate paths, the processing module is used to:

[0038] Based on the path length of each candidate path, the candidate path whose path length meets the preset length condition is taken as the main path.

[0039] At least one of the remaining candidate paths will be used as alternative paths.

[0040] Optionally, when generating the first route label for the first device based on the next-hop information of the primary path and at least one alternative path, the generation module is used to:

[0041] The next-hop information of the main path and at least one alternative path is used as the first information tuple;

[0042] Select a value from the preset label set as the first routing label for the first device;

[0043] A binding relationship is established between the first routing label and the first information tuple, wherein the first routing label is used to uniquely identify the first information tuple;

[0044] Optionally, when generating the second route label for the first device based on the next-hop information of the primary path, the generation module is used to:

[0045] Use the next hop information of the main path as the second information tuple;

[0046] Select a value from the preset label set as the second routing label for the first device;

[0047] A binding relationship is established between the second routing label and the second information tuple, wherein the second routing label is used to uniquely identify the second information tuple.

[0048] Optionally, after generating the second routing label for the first device based on the next-hop information of the primary path, the device further includes a storage module, which is used for:

[0049] Based on the first route label and the first information tuple, the first forwarding table entry is obtained and saved to the preset forwarding table. The first forwarding table entry records the binding relationship between the first route label and the first information tuple.

[0050] Based on the second routing label and the second information tuple, the second forwarding table entry is obtained and saved to the forwarding table. The second forwarding table entry records the binding relationship between the second routing label and the second information tuple.

[0051] Optionally, based on the path relationship between a neighboring device and the first device, a first route label or a second route label is selected as the target route label used when the first device interacts with a neighboring device to exchange information about the target device. The determining module is used for:

[0052] If the path relationship between a neighboring device and the first device is a non-alternative path, then the first route label is used as the destination route label;

[0053] If the path relationship between a neighboring device and the first device is a candidate path, then the second route label is used as the target route label.

[0054] Optionally, based on the path relationship between a neighboring device and the first device, a first routing label or a second routing label is selected as the target routing label used when the first device interacts with a neighboring device to exchange relevant information about the target device. The device further includes a forwarding module, which is used to:

[0055] Receive message forwarding instructions, which carry the tag information of the message to be forwarded;

[0056] Based on the tag information, a matching forwarding path is selected from the forwarding table, and the packet to be forwarded is forwarded to the next-hop device of the first device on the forwarding path.

[0057] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described in any of the first aspects above.

[0058] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of any of the methods of the first aspect described above.

[0059] Fifthly, a computer program product is provided, the computer program product comprising a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of the method described in any of the first aspects above.

[0060] In this embodiment of the application, when the first device receives a routing advertisement for the target device, it selects a primary path and a backup path from the candidate paths between the first device and the target device. Then, based on the next-hop information of the primary path and the backup path, it generates a first routing label for the first device and a second routing label for the first device based on the next-hop information of the primary path. Finally, according to the path relationship between each neighboring device and the first device, it selects the target routing label used by the first device when interacting with the neighboring device for relevant information of the target device from the first routing label and the second routing label.

[0061] In this way, when there is a primary path and alternative paths, not only is a first routing label generated based on all next-hop information, but a second routing label is also generated based on the next-hop information of the primary path, resulting in two different routing labels. Based on the path relationship between each neighboring device and the primary device, the target routing label corresponding to each neighboring device is selected from the two different routing labels. This ensures that the target routing label corresponding to the next-hop device on the alternative path is not associated with the next-hop information of the alternative path, avoiding circular routing label allocation. The routing labels are in a steady state, improving the reliability of routing label use, and saving routing label resources by avoiding repeated allocation of routing labels. Attached Figure Description

[0062] Figure 1 A schematic diagram of an FRR provided in an embodiment of this application;

[0063] Figure 2 This is a schematic diagram illustrating the application scenario in the embodiments of this application;

[0064] Figure 3 This is a flowchart illustrating a routing label allocation method according to an embodiment of this application;

[0065] Figure 4 This is a flowchart illustrating the path optimization process in the embodiments of this application;

[0066] Figure 5 This is a schematic diagram of the preferred path in the embodiments of this application;

[0067] Figure 6 This is a schematic diagram illustrating the process of generating the first routing label in an embodiment of this application;

[0068] Figure 7 This is a schematic diagram of the first information tuple and the second information tuple in the embodiments of this application;

[0069] Figure 8 This is a schematic diagram illustrating the process of generating the second routing label in an embodiment of this application;

[0070] Figure 9 This is a schematic diagram of the forwarding table in the embodiments of this application;

[0071] Figure 10 This is a schematic diagram illustrating the process of determining the target routing label in an embodiment of this application;

[0072] Figure 11 This is a schematic diagram illustrating the determination of the target routing label in an embodiment of this application;

[0073] Figure 12 This is a schematic diagram of the message forwarding process in an embodiment of this application;

[0074] Figure 13 This is a first schematic diagram of message forwarding in an embodiment of this application;

[0075] Figure 14 This is a second schematic diagram of message forwarding in the embodiments of this application;

[0076] Figure 15 This is a schematic diagram of the routing label allocation device in the embodiments of this application;

[0077] Figure 16 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation

[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0079] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0080] (1) Multi-Protocol Label Switching (MPLS): A technology that uses MPLS labels to guide high-speed and efficient data transmission over open communication networks.

[0081] (2) Segment Routing IPv6 (SRv6) based on Internet Protocol version 6: a technology that uses SRv6SID to guide data transmission at high speed and efficiency.

[0082] (3) Label space: The range of values ​​for routing labels.

[0083] (4) Next-hop device: The next device that a message passes through in the network path from the current device to the target device. It is used to receive the message sent by the current device and pass it to the target device.

[0084] (5) Output interface: The connection interface between the device and the next hop device.

[0085] (6) Outgoing label: The routing label of the next-hop device.

[0086] The design concept of the embodiments of this application is briefly introduced below:

[0087] Currently, with the rapid development of network forwarding technology, the application of Multi-Protocol Label Switching (MPLS) and Segment Routing IPv6 (SRv6) based on Internet Protocol version 6 is becoming increasingly widespread. For example, in Virtual Private Network (VPN) scenarios that span autonomous systems, before forwarding packets, it is necessary to create a feasible path for the packet to reach the destination address in the network, assign labels to each routing device in the feasible path, and forward packets through labels.

[0088] In related technologies, common label allocation methods for assigning labels to various routing devices include: (1) assigning labels based on Virtual Private Network (VPN) instances, i.e., assigning a unique label to each VPN instance. (2) assigning labels based on next-hop information. (3) assigning labels based on routing prefixes.

[0089] Among them, the number of labels allocated based on next-hop information is much smaller than that allocated based on routing prefix.

[0090] However, in real-world applications, the complexity of the network environment often increases, such as with Fast Reroute (FRR). FRR includes a primary path and a backup path. Since FRR can result in a situation where a routing device and its neighboring devices act as backups for each other, circular label assignments can occur, leading to network topology instability and reducing packet forwarding rate and accuracy.

[0091] For example, such as Figure 1As shown, routing device R1 assigns label L1 to route 100.1.1.1 / 32 and carries outgoing label L1, advertising the route to routing devices R2 and R3. Assume R2 first receives route 100.1.1.1 / 32 from R1, preferring R1 as the primary next hop and assigning label L1. Based on the next hop and outgoing label information, R2 assigns label L2 and advertises route 100.1.1.1 / 32 to R3, with R3's outgoing label being L2. R3 receives route 100.1.1.1 / 32 from both R1 and R2, preferring R1 as the primary next hop and assigning label L1, and preferring R2 as the backup next hop and assigning label L2. Based on the primary and backup next hop information and outgoing label information, R3 assigns label L3 and advertises the route to R2. When R2 receives the route 100.1.1.1 / 32 from R3, with an outgoing label of L3, it preferentially uses R1 as the primary next hop, also with an outgoing label of L1, and R2 preferentially uses R3 as the backup next hop, also with an outgoing label of L3. Based on the primary and backup next hop information and the outgoing label information, R2 assigns label L4 and announces the route update to R3, with R3's outgoing label being L4. When R3 receives the route 100.1.1.1 / 32 from R2, it preferentially uses R1 as the primary next hop, with an outgoing label of L1, and R2 preferentially uses R2 as the backup next hop, also with an outgoing label of L4. Based on the primary and backup next hop information and the outgoing label information, R3 assigns label L5 and announces the route 100.1.1.1 / 32 to R2, with R2's outgoing label being L5. R2 and R3 perform label allocation cyclically, and the labels are constantly changing, leading to high CPU resource consumption, network topology instability, and thus reducing packet forwarding rate and accuracy.

[0092] In view of this, this application proposes a routing label allocation method, apparatus, device, and storage medium. When a first device receives a routing advertisement for a target device, it determines each candidate path between the first device and the target device, selects a primary path and a backup path from each candidate path, generates a first routing label for the first device based on the next-hop information of the primary path and the backup path, and generates a second routing label for the first device based on the next-hop information of the primary path. Finally, it determines each neighboring device that has a connection with the first device, and performs the following operations for each neighboring device: selects either a first routing label or a second routing label based on the path relationship between a neighboring device and the first device, as the target routing label used when the first device interacts with a neighboring device for information related to the target device. In this way, when there is a primary path and alternative paths, not only is a first routing label generated based on all next-hop information, but a second routing label is also generated based on the next-hop information of the primary path, resulting in two different routing labels. Based on the path relationship between each neighboring device and the first device, the target routing label corresponding to each neighboring device is selected from the two obtained routing labels, so that the routing label of the first device is in a steady state, avoiding circular routing label allocation, improving the reliability of routing label use, stabilizing complex network topologies, and ensuring that packets can be fault-protected through the FRR mechanism, improving packet forwarding rate and accuracy. Furthermore, it saves routing label resources by avoiding repeated allocation of routing labels.

[0093] The preferred embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0094] like Figure 2 The diagram illustrates an application scenario of an embodiment of this application. The application scenario diagram includes a first device 110, a target device 130, and neighboring devices 120 (including neighboring devices 1201, 1202, ..., 120n). The first device 110 and neighboring devices 120 are connected via a communication link. When the first device 110 receives a routing advertisement related to the target device, it determines each candidate path between the first device and the target device, selects a primary path and an alternative path from each candidate path, generates a first routing label for the first device based on the next-hop information of the primary path and the alternative path, and generates a second routing label for the first device based on the next-hop information of the primary path. Finally, it determines each neighboring device that has a connection with the first device and performs the following operations for each neighboring device: based on the path relationship between a neighboring device and the first device, it selects either a first routing label or a second routing label as the target routing label used when the first device interacts with a neighboring device regarding information related to the target device.

[0095] Based on the above embodiments, see Figure 3 The diagram shown is a flowchart illustrating a routing label allocation method according to an embodiment of this application, specifically including:

[0096] Step 30: Determine each candidate path between the first device and the target device, and select the main path and at least one alternative path from each candidate path.

[0097] In this embodiment of the application, when the first device receives a routing advertisement for the target device, it determines each candidate path between the first device and the target device based on the neighboring devices that sent the routing advertisement for the target device, performs path optimization on each candidate path, and selects the main path and the alternative path.

[0098] For example, suppose the first device receives a routing advertisement 100.1.1.1 / 32 about the target device sent by neighbor device 1, then a candidate path 1 is determined, and the next hop device of the first device on candidate path 1 is neighbor device 1. Suppose the first device receives a routing advertisement 100.1.1.1 / 32 about the target device sent by neighbor device 2, then a candidate path 2 is determined, and the next hop device of the first device on candidate path 2 is neighbor device 2.

[0099] Specifically, the following operations are performed during path optimization. (See also...) Figure 4 As shown, it is a flowchart illustrating the path optimization in an embodiment of this application. The following is a detailed explanation in conjunction with the attached diagram. Figure 4 The specific operations to be performed will be explained in detail:

[0100] Step 300: Based on the path length of each candidate path, select the candidate path whose path length meets the preset length condition as the main path.

[0101] In this embodiment of the application, the path lengths of each candidate path are compared, and a candidate path whose path length meets the preset length condition is selected and used as the main path.

[0102] The preset length condition can be the candidate path with the shortest path length, but this application embodiment does not impose any restrictions on it.

[0103] For example, see Figure 5 The diagram shown is a schematic diagram of path selection in an embodiment of this application. Assuming that the candidate path with the shortest path length is taken as the main path, and the path lengths of each candidate path are as follows: the path length of candidate path 1 is 2, the path length of candidate path 2 is 3, then the path lengths of each candidate path are compared, and the candidate path whose path length meets the preset length condition is selected as candidate path 1, and candidate path 1 is taken as the main path.

[0104] Step 301: Select at least one remaining candidate path as an alternative path.

[0105] In this embodiment of the application, after filtering out candidate paths whose path length meets the preset length condition, at least one remaining candidate path is used as an alternative path.

[0106] For example, such as Figure 5 As shown, after filtering out candidate paths whose path length meets the preset length condition, at least one remaining candidate path includes: candidate path 2, which is used as an alternative path.

[0107] Step 31: Based on the next-hop information of the primary path and at least one alternative path, generate a first route label for the first device, and based on the next-hop information of the primary path, generate a second route label for the first device.

[0108] The next-hop information includes at least: the connection address and routing label of the next-hop device of the first device on the corresponding path, and the connection interface between the first device and the next-hop device, wherein the connection address is the address corresponding to the connection interface.

[0109] In this embodiment of the application, after obtaining the main path and at least one candidate path, a first routing label for the first device is generated based on the next-hop information of the main path and at least one candidate path, and a second routing label for the first device is generated based on the next-hop information of the main path.

[0110] Specifically, the following operations are performed when generating the first routing label for the first device. See also... Figure 6 As shown, this is a schematic diagram of the process for generating the first routing label in an embodiment of this application. The following is a detailed explanation in conjunction with the attached diagram. Figure 6 The specific operations to be performed will be explained in detail:

[0111] Step 310: Take the next-hop information of the main path and at least one alternative path as the first information tuple.

[0112] In this embodiment of the application, the next-hop information of the main path and the next-hop information of at least one alternative path are used as the first information tuple. That is, the connection address and routing label of the next-hop device of the first device on the main path, the connection interface between the first device and the next-hop device, the connection address and routing label of the next-hop device of the first device on at least one alternative path, and the connection interface between the first device and the next-hop device are used as the first information tuple.

[0113] For example, see Figure 7The diagram shown is a schematic of the first information tuple and the second information tuple in an embodiment of this application. Assume that the next-hop device of the first device on the main path is R1, the connection address between R1 and the first device is 12.1.1.1, the routing label of R1 is 1000, and the connection interface between the first device and R1 is Gi0 / 0. On the alternative path, the next-hop device of the first device is R3, the connection address between R3 and the first device is 23.1.1.3, the routing label of R3 is 3000, and the connection interface between the first device and R3 is Gi0 / 1. Then, (12.1.1.1, 1000, Gi0 / 0; 23.1.1.3, 3000, Gi0 / 1) is taken as the first information tuple.

[0114] Step 311: Select a value from the preset label set as the first routing label of the first device.

[0115] The preset tag set can have a tag space of 20 bits, but this application embodiment does not impose any limitation on this.

[0116] For example, assuming a value of 2000 is selected from the preset label set, then 2000 will be used as the first routing label of the first device.

[0117] Additionally, it is worth noting that the type of the first routing label can be either an MPLS label or an SRv6 label, and this application embodiment does not impose any restrictions on this.

[0118] Step 312: Establish a binding relationship between the first routing label and the first information tuple.

[0119] The first routing label is used to uniquely identify the first information tuple.

[0120] In this embodiment of the application, the first routing label is associated with the first information tuple, and a binding relationship is established between the first routing label and the first information tuple.

[0121] For example, assuming the first route label is 2000 and the first information tuple is (12.1.1.1, 1000, Gi0 / 0; 23.1.1.3, 3000, Gi0 / 1), a binding relationship is established between 2000 and (12.1.1.1, 1000, Gi0 / 0; 23.1.1.3, 3000, Gi0 / 1).

[0122] Specifically, when generating the second routing label for the first device, the following operations are performed. See [link / reference]. Figure 8 As shown, this is a schematic diagram of the process for generating the second routing label in an embodiment of this application. The following is a detailed explanation in conjunction with the attached diagram. Figure 8 The specific operations to be performed will be explained in detail:

[0123] Step 313: Use the next hop information of the main path as the second information tuple.

[0124] In this embodiment of the application, the next-hop information of the main path is used as the second information tuple, that is, the connection address and routing label of the next-hop device of the first device on the main path, as well as the connection interface between the first device and the next-hop device, are used as the second information tuple.

[0125] For example, such as Figure 7 As shown, assuming the next-hop device of the first device on the main path is R1, the connection address between R1 and the first device is 12.1.1.1, the routing label of R1 is 1000, and the connection interface between the first device and R1 is Gi0 / 0, then (12.1.1.1, 1000, Gi0 / 0) will be used as the second information tuple.

[0126] Step 314: Select a value from the preset label set as the second routing label for the first device.

[0127] For example, assuming a value of 2001 is selected from a preset label set, then 2001 will be used as the second routing label for the first device.

[0128] Additionally, it is worth noting that the type of the second routing label can be either an MPLS label or an SRv6 label, and this application embodiment does not impose any restrictions on this.

[0129] Step 315: Establish a binding relationship between the second routing label and the second information tuple.

[0130] The second routing label is used to uniquely identify the second information tuple.

[0131] In this embodiment of the application, the second routing label is associated with the second information tuple, and a binding relationship is established between the second routing label and the second information tuple.

[0132] For example, assuming the second route label is 2001 and the second information tuple is (12.1.1.1, 1000, Gi0 / 0), a binding relationship is established between 2001 and (12.1.1.1, 1000, Gi0 / 0).

[0133] In this way, a first route label for the first device is generated based on the next-hop information of the primary path and at least one alternative path, and a second route label for the first device is generated based on the next-hop information of the primary path. When there is a primary path and at least one alternative path, not only is a first route label generated based on all the next-hop information, but a second route label is also generated based on the next-hop information of the primary path, resulting in two different route labels and avoiding circular label allocation.

[0134] Furthermore, after generating the first routing label of the first device based on the next-hop information of the primary path and at least one alternative path, the first forwarding table entry is obtained based on the first routing label and the first information tuple, and saved to the preset forwarding table.

[0135] The first forwarding table entry records the binding relationship between the first route label and the first information tuple.

[0136] In this embodiment of the application, the first device obtains a first forwarding table entry based on the first routing label and the first information tuple. The key field of the first forwarding table entry is the first routing label, the path is the main path and at least one alternative path, and it is saved to a local preset forwarding table so that the first device can transmit the packet based on the forwarding table.

[0137] For example, see Figure 9 The diagram shown is a schematic of the forwarding table in an embodiment of this application. The first forwarding table entry includes: a first routing label, i.e., outgoing routing label 2000; a routing label of the next-hop device of the first device on the main path, i.e., incoming routing label 1000; a connection interface between the first device and the next-hop device, i.e., outgoing interface Gi0 / 0; a routing label of the next-hop device of the first device on the alternative path, i.e., outgoing routing label 3000; and a connection interface between the first device and the next-hop device, i.e., outgoing interface Gi0 / 1.

[0138] Additionally, it is worth noting that if the type of the first routing label is an MPLS label, then the corresponding forwarding table entry is an Incoming Label Map (ILM) entry. For an MPLS label, the first routing label is a label value. If the type of the first routing label is an SRv6 SID, then the corresponding forwarding table entry is an SRv6 entry. For an SRv6 SID, the first routing label is an IPv6 address. In this embodiment, the first routing label is an MPLS label as an example.

[0139] Furthermore, after generating the second routing label of the first device based on the next-hop information of the main path, the second forwarding table entry is obtained based on the second routing label and the second information tuple, and saved to the preset forwarding table.

[0140] The second forwarding table entry records the binding relationship between the second route label and the second information tuple.

[0141] In this embodiment of the application, the first device obtains a second forwarding table entry based on the second routing label and the second information tuple. The key field of the second forwarding table entry is the second routing label, the path is the main path, and it is saved to a local preset forwarding table so that the first device can transmit packets based on the forwarding table.

[0142] For example, such as Figure 9 As shown, the second forwarding table entry includes: the second route label, i.e., the outgoing route label 2001; the route label of the next-hop device of the first device on the main path, i.e., the incoming route label 1000; and the connection interface between the first device and the next-hop device, i.e., the outgoing interface Gi0 / 0.

[0143] Additionally, it is worth noting that if the type of the second routing label is an MPLS label, the corresponding forwarding table entry is an Incoming Label Map (ILM) entry. For an MPLS label, the second routing label is a label value. If the type of the second routing label is an SRv6 SID, the corresponding forwarding table entry is an SRv6 entry. For an SRv6 SID, the second routing label is an IPv6 address. In this embodiment, the type of the second routing label is an MPLS label, which is used as an example.

[0144] Step 32: Determine each neighboring device that has a connection with the first device, and perform the following operations for each neighboring device: Based on the path relationship between a neighboring device and the first device, select a first route label or a second route label as the target route label used when the first device interacts with a neighboring device to exchange relevant information about the target device.

[0145] The relevant information for the target device includes at least: routing information.

[0146] Specifically, the following operations are performed during step 32. (See also...) Figure 10 As shown, this is a flowchart illustrating the process of determining the target route label in an embodiment of this application. The following is a detailed explanation in conjunction with the attached diagram. Figure 10 The specific operations to be performed will be explained in detail:

[0147] Step 320: Determine whether the path relationship between a neighboring device and the first device is a candidate path. If yes, proceed to step 321; otherwise, proceed to step 322.

[0148] Step 321: Use the second route label as the target route label.

[0149] In this embodiment of the application, it is determined whether the path relationship between a neighboring device and the first device is a candidate path. If the path relationship between the neighboring device and the first device is a candidate path, the second routing label is used as the target routing label, and the relevant information of the target device is announced to the neighboring device along with the target routing label.

[0150] For example, see Figure 11The diagram shown is a schematic of determining the target route label in an embodiment of this application. Assuming that the routing information corresponding to the current target device is 100.1.1.1 / 32 and the second route label is 2001, for route 100.1.1.1 / 32, the path relationship between neighboring device R3 and the first device is an alternative path. Then, the second route label 2001 is used as the target route label, and the target route label 2001 is carried to announce the routing information corresponding to the target device to neighboring device R3.

[0151] Step 322: Use the first route label as the target route label.

[0152] In this embodiment of the application, it is determined whether the path relationship between a neighboring device and the first device is a candidate path. If the path relationship between the neighboring device and the first device is not a candidate path, the first routing label is used as the target routing label, and the relevant information of the target device is announced to the neighboring device along with the target routing label.

[0153] For example, such as Figure 11 As shown, assuming the routing information corresponding to the current target device is 100.1.1.1 / 32 and the first routing label is 2000, for route 100.1.1.1 / 32, the path relationship between neighboring device R4 and the first device is a non-alternative path. Then, the first routing label 2000 is used as the target routing label, and the target routing label 2000 is carried to announce the routing information corresponding to the target device to neighboring device R4.

[0154] In this way, based on the path relationship between each neighboring device and the first device, the target routing label corresponding to each neighboring device is selected from the two obtained routing labels, so that the routing label of the first device is in a steady state, avoiding cyclic routing label allocation, improving the reliability of routing label use, stabilizing complex network topologies, and saving routing label resources by avoiding repeated allocation of routing labels.

[0155] Furthermore, based on the path relationship between a neighboring device and the first device, a first routing label or a second routing label is selected as the target routing label used when the first device interacts with a neighboring device to exchange information about the target device. Then, according to the forwarding table, the packets to be forwarded can be forwarded. (See [link to relevant documentation]). Figure 12 The diagram shown below illustrates the message forwarding process in an embodiment of this application. The following section, in conjunction with the attached diagram, further details the process. Figure 12 Detailed explanation:

[0156] Step 33: Receive message forwarding instructions.

[0157] The message forwarding instruction carries the tag information of the message to be forwarded.

[0158] In this embodiment of the application, a message forwarding instruction sent by a neighboring device is received, and the message forwarding instruction carries the tag information of the message to be forwarded.

[0159] Step 34: Based on the tag information, select a matching forwarding path from the forwarding table and forward the packet to be forwarded to the next-hop device of the first device on the forwarding path.

[0160] In this embodiment of the application, after obtaining the tag information, a matching forwarding path is selected from the forwarding table based on the tag information, and the packet to be forwarded is forwarded to the next-hop device of the first device on the forwarding path.

[0161] For example, see Figure 13 As shown, this is a first schematic diagram of message forwarding in an embodiment of this application. Assuming that the first device receives a message forwarding instruction sent by the neighboring device R3, and the label information of the message to be forwarded is 2001, then the forwarding path matching the routing label 2001 is selected from the forwarding table. The matching forwarding path is the main path, and the message to be forwarded is forwarded to the next-hop device R1 of the first device on the main path.

[0162] For example, see Figure 14 The diagram shown is a second schematic diagram of message forwarding in this embodiment of the application. Assuming that the first device receives a message forwarding instruction sent by the neighboring device R4, and the label information of the message to be forwarded is 2000, the device selects a forwarding path that matches the routing label 2000 from the forwarding table. The matching forwarding path is the main path and the alternative path, and forwards the message to be forwarded to the next-hop device R1 of the first device on the main path, or forwards the message to be forwarded to the next-hop device R3 of the first device on the alternative path.

[0163] This ensures that messages can be protected against faults through the FRR mechanism, improving message forwarding rate and accuracy.

[0164] Based on the same inventive concept, this application also provides a routing label allocation device, see reference. Figure 15 The diagram shown is a structural schematic of the routing label allocation device in an embodiment of this application, specifically including:

[0165] The processing module 1501 is used to determine each candidate path between the first device and the target device, and select the main path and at least one alternative path from each candidate path;

[0166] The generation module 1502 is used to generate a first route label for the first device based on the next-hop information of the main path and at least one alternative path, and to generate a second route label for the first device based on the next-hop information of the main path; wherein the next-hop information includes at least: the connection address and route label of the next-hop device of the first device on the corresponding path, and the connection interface between the first device and the next-hop device;

[0167] The determination module 1503 is used to determine each neighboring device that has a connection relationship with the first device, and for each neighboring device, perform the following operations: select a first route label or a second route label based on the path relationship between a neighboring device and the first device, as the target route label used when the first device interacts with a neighboring device to exchange relevant information about the target device.

[0168] Optionally, when selecting the primary path and at least one alternative path from among the candidate paths, the processing module 1501 is used to:

[0169] Based on the path length of each candidate path, the candidate path whose path length meets the preset length condition is taken as the main path.

[0170] At least one of the remaining candidate paths will be used as alternative paths.

[0171] Optionally, when generating the first route label for the first device based on the next-hop information of the primary path and at least one alternative path, the generation module 1502 is used to:

[0172] The next-hop information of the main path and at least one alternative path is used as the first information tuple;

[0173] Select a value from the preset label set as the first routing label for the first device;

[0174] A binding relationship is established between the first routing label and the first information tuple, wherein the first routing label is used to uniquely identify the first information tuple;

[0175] Optionally, when generating the second route label for the first device based on the next-hop information of the primary path, the generation module 1502 is used for:

[0176] Use the next hop information of the main path as the second information tuple;

[0177] Select a value from the preset label set as the second routing label for the first device;

[0178] A binding relationship is established between the second routing label and the second information tuple, wherein the second routing label is used to uniquely identify the second information tuple.

[0179] Optionally, after generating the second routing label for the first device based on the next-hop information of the primary path, the device further includes a storage module 1504, which is used for:

[0180] Based on the first route label and the first information tuple, the first forwarding table entry is obtained and saved to the preset forwarding table. The first forwarding table entry records the binding relationship between the first route label and the first information tuple.

[0181] Based on the second routing label and the second information tuple, the second forwarding table entry is obtained and saved to the forwarding table. The second forwarding table entry records the binding relationship between the second routing label and the second information tuple.

[0182] Optionally, based on the path relationship between a neighboring device and the first device, a first routing label or a second routing label is selected as the target routing label used when the first device interacts with a neighboring device to exchange information about the target device. The determining module 1503 is used for:

[0183] If the path relationship between a neighboring device and the first device is a non-alternative path, then the first route label is used as the target route label;

[0184] If the path relationship between a neighboring device and the first device is a candidate path, then the second route label is used as the target route label.

[0185] Optionally, based on the path relationship between a neighboring device and the first device, a first routing label or a second routing label is selected as the target routing label used when the first device interacts with a neighboring device to exchange relevant information about the target device. The device also includes a forwarding module 1505, which is used for:

[0186] Receive message forwarding instructions, which carry the tag information of the message to be forwarded;

[0187] Based on the tag information, a matching forwarding path is selected from the forwarding table, and the packet to be forwarded is forwarded to the next-hop device of the first device on the forwarding path.

[0188] Based on the above embodiments, see Figure 16 The diagram shown is a structural schematic of the electronic device in an embodiment of this application.

[0189] This application provides an electronic device that may include a processor 1610 (Center Processing Unit, CPU), a memory 1620, an input device 1630, and an output device 1640. The input device 1630 may include a keyboard, a mouse, a touch screen, etc., and the output device 1640 may include a display device, such as a liquid crystal display (LCD) or a cathode ray tube (CRT).

[0190] The memory 1620 may include read-only memory (ROM) and random access memory (RAM), and provides the processor 1610 with program instructions and data stored in the memory 1620. In this embodiment, the memory 1620 may be used to store the program of any routing label allocation method in this embodiment.

[0191] The processor 1610 executes any of the routing label allocation methods in this application embodiment according to the program instructions stored in the memory 1620.

[0192] Based on the above embodiments, this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the routing label allocation method in any of the above method embodiments.

[0193] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0194] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0195] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0196] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0197] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method of allocating a routing label, characterized by, The method comprises the following steps: determining each candidate path between the first device and the target device, and selecting a main path and at least one alternative path from the candidate paths; generating a first routing label of the first device based on the next hop information of the main path and the at least one alternative path, and generating a second routing label of the first device based on the next hop information of the main path; wherein the next hop information at least comprises the connection address and routing label of the next hop device of the first device on the corresponding path, and the connection interface between the first device and the next hop device; determining each neighbor device having a connection relationship with the first device, and performing the following operations for each neighbor device: selecting the first routing label or the second routing label as the target routing label used by the first device to interact with the one neighbor device to obtain the related information of the target device according to the path relationship between the one neighbor device and the first device.

2. The method of claim 1, wherein, The method further comprises the following steps: selecting the candidate path with a path length meeting a preset length condition as the main path based on the path length of each candidate path; selecting the remaining at least one candidate path as the alternative path.

3. The method of claim 1, wherein, The method further comprises the following steps: taking the next hop information of the main path and the at least one alternative path as a first information tuple; selecting a value from a preset label set as the first routing label of the first device; establishing a binding relationship between the first routing label and the first information tuple, wherein the first routing label is used to uniquely identify the first information tuple; The method further comprises the following steps: taking the next hop information of the main path as a second information tuple; selecting a value from a preset label set as the second routing label of the first device; establishing a binding relationship between the second routing label and the second information tuple, wherein the second routing label is used to uniquely identify the second information tuple.

4. The method of claim 3, wherein, The method further comprises the following steps after generating the second routing label of the first device based on the next hop information of the main path: obtaining a first forwarding table item based on the first routing label and the first information tuple, and saving the first forwarding table item to a preset forwarding table, wherein the first forwarding table item records the binding relationship between the first routing label and the first information tuple; obtaining a second forwarding table item based on the second routing label and the second information tuple, and saving the second forwarding table item to the forwarding table, wherein the second forwarding table item records the binding relationship between the second routing label and the second information tuple.

5. The method according to any one of claims 1 to 4, wherein The selecting the first routing label or the second routing label as a target routing label used by the first device when interacting with the one neighbor device about the target device according to a path relationship between the one neighbor device and the first device comprises: If the path relationship between the one neighbor device and the first device is a non-alternative path, the first routing label is selected as the target routing label; If the path relationship between the one neighbor device and the first device is an alternative path, the second routing label is selected as the target routing label.

6. The method of claim 4, wherein, After the selecting the first routing label or the second routing label as a target routing label used by the first device when interacting with the one neighbor device about the target device according to a path relationship between the one neighbor device and the first device, the method further comprises: Receiving a packet forwarding instruction, wherein the packet forwarding instruction carries label information of a to-be-forwarded packet; Based on the label information, selecting a matched forwarding path from the forwarding table, and forwarding the to-be-forwarded packet to a next-hop device of the first device on the forwarding path.

7. A routing label allocation apparatus characterized by comprising: Comprise: The processing module is used for determining each candidate path between the first device and the target device, and selecting a main path and at least one alternative path from the each candidate path; The generating module is used for generating a first routing label of the first device based on next-hop information of the main path and the at least one alternative path, and generating a second routing label of the first device based on next-hop information of the main path; wherein the next-hop information at least comprises a connection address and a routing label of a next-hop device of the first device on a corresponding path, and a connection interface between the first device and the next-hop device; The determining module is used for determining each neighbor device having a connection relationship with the first device, and performing the following operations for the each neighbor device respectively: selecting the first routing label or the second routing label as a target routing label used by the first device when interacting with the one neighbor device about the target device according to a path relationship between the one neighbor device and the first device.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the steps of the method in any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the method in any one of claims 1-6.

10. A computer program product, characterised in that, The computer program is stored in a computer readable storage medium; when the processor of the electronic device reads the computer program from the computer readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of the method in any one of claims 1-6. The computer program is stored in a computer readable storage medium; when the processor of the electronic device reads the computer program from the computer readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of the method in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and apparatus for forwarding label distribution protocol multicast traffic during fast reroute

    US20070253416A1

  • Packet forwarding method, device, and storage medium

    WO2021077972A1