Traditionally, IGPs can use only the SPF algorithm to calculate the shortest paths to destination addresses based on link costs. As the SPF algorithm is fixed and cannot be adjusted by users, the optimal paths cannot be calculated according to users' diverse requirements, such as the requirement for traffic forwarding along the lowest-delay path or without passing through certain links.
On a network, constraints used for path calculation may be different. For example, as autonomous driving requires an ultra-low delay, an IGP needs to use delay as the constraint to calculate paths on such a network. Another constraint that needs to be considered is cost, so some links with high costs need to be excluded in path calculation. These constraints may also be combined.
To make path calculation more flexible, users may want to customize IGP route calculation algorithms to meet their varying requirements. They can define an algorithm value to identify a fixed algorithm. When all devices on a network use the same algorithm, their calculation results are also the same, preventing loops. Since users, not standards organizations, are the ones to define these algorithms, they are called Flex-Algos.
With Flex-Algo, an IGP can automatically calculate eligible paths based on the link cost, delay, or TE constraint to flexibly meet TE requirements. This means that when SR-MPLS uses an IGP to calculate paths, prefix SIDs can be associated with Flex-Algos to calculate SR-MPLS BE paths that meet different requirements.
Each device can use an IGP to advertise their supported Flex-Algos and the related calculation rules through the FAD Sub-TLV.
These Flex-Algos can also be associated with prefix SIDs during prefix SID configuration. The IGP then advertises the Flex-Algos and prefix SIDs through the Prefix-SID Sub-TLV.
The Flex-Algo value occupies 8 bits in the FAD Sub-TLV and Prefix-SID Sub-TLV. Values 128 to 255 are reserved for users to customize the Flex-Algos represented by these values.
To ensure that the forwarding path calculated by an IGP is loop free, the same Flex-Algo must be used across an IGP domain. IS-IS advertises its Flex-Algo Definition (FAD) through the IS-IS FAD Sub-TLV.
IS-IS FAD Sub-TLV
IS-IS uses the IS-IS Router Capability TLV-242 to carry the IS-IS FAD Sub-TLV and advertises the sub-TLV to neighbors. Figure 1 shows the format of the IS-IS FAD Sub-TLV.
Table 1 describes the fields in the IS-IS FAD Sub-TLV.
Field |
Length |
Description |
---|---|---|
Type |
8 bits |
Type of the sub-TLV. |
Length |
8 bits |
Total length of the sub-TLV (excluding the Type and Length fields). |
Flex-Algo |
8 bits |
Flex-Algo ID, which is an integer ranging from 128 to 255. |
Metric-Type |
8 bits |
Metric type used during calculation, which can be IGP metric, link delay, or TE metric. |
Calc-Type |
8 bits |
Calculation type, which currently can only be SPF and does not need setting. |
Priority |
8 bits |
Priority of the sub-TLV. |
Sub-TLVs |
Variable |
Optional sub-TLVs, which can define some constraints. |
These constraints are described by the Sub-TLVs field in the FAD Sub-TLV and share the same format, as shown in Figure 2.
SR-Algorithm Sub-TLV
A node may use different algorithms to calculate reachability to other nodes or to prefixes attached to these nodes. Examples of these algorithms are SPF and various SPF variant algorithms. The SR-Algorithm sub-TLV allows the node to advertise the algorithms that the node is currently using. It is also inserted into the IS-IS Router Capability TLV-242 for transmission. The SR-Algorithm sub-TLV can be propagated only within the same IS-IS level and must not be propagated across IS-IS levels.
Field |
Length |
Description |
---|---|---|
Type |
8 bits |
Unassigned. The recommended value is 2. |
Length |
8 bits |
Packet length. |
Algorithm |
8 bits |
Algorithm that is used. |
Figure 4 is used as an example to describe how SR-MPLS Flex-Algo is implemented.
A device using Flex-Algos for path calculation must advertise its Flex-Algos to other devices.
Besides Flex-Algos 128 and 129, all devices support the most basic IGP cost-based algorithm, which has value 0. This algorithm is not advertised through the SR-Algorithm Sub-TLV.
After a prefix SID is associated with a Flex-Algo on PE2, other devices on the network calculate a route to the prefix SID based on the Flex-Algo. As this configuration method repeats, different prefix SID routes that represent different paths calculated using different Flex-Algos can be generated, meeting diverse service requirements.
For example, in Figure 4, Flex-Algo 128 is defined as follows: calculate a path based on the IGP cost and link affinity, with the constraint being Exclude Admin Group (excluding the links between P2 and P3 as well as between P2 and P4). Figure 5 shows the possible path obtained on PE1 with this Flex-Algo.
Prefix SIDs are manually set and therefore may conflict on different devices. Prefix SID conflicts can occur in either the prefix or SID. A prefix conflict indicates that the same prefix with the same Flex-Algo is associated with different SIDs, whereas a SID conflict indicates that the same SID is associated with different prefixes.
If prefix SIDs conflict, handle prefix conflicts before SID conflicts by matching the following rules to preferentially select a route:
For example, there are prefix SID conflicts in the following 7 routes expressed in the prefix/mask length SID Flex-Algo format:
The process for handling the prefix SID conflicts is as follows:
Figure 6 shows how service traffic is steered into an SR-MPLS BE path based on Flex-Algo. The specific process is as follows:
After the configuration is complete, the VPN route is recursed based on the tunnel policy. Specifically, if the tunnel policy specifies a preferential use of Flex-Algo-based SR-MPLS BE tunnels, the VPN route is recursed to the target Flex-Algo-based SR-MPLS BE tunnel based on the next hop address and color attribute of the route; if the tunnel policy specifies a preferential use of common SR-MPLS tunnels, the VPN route is recursed to the target common SR-MPLS BE tunnel based on the next hop address of the route.