Flex-Algo
How Prelude TE surfaces IGP Flexible Algorithm data — Flexible Algorithm Definitions on nodes and the algorithm field that cross-references SR-MPLS and SRv6 segments.
IGP Flexible Algorithm (RFC 9350) lets operators define custom
routing algorithms based on constraints. Flex-Algo identifiers live
in the range 128–255, and Flex-Algo is independent of the data
plane — the same algorithm can be served by SR-MPLS, SRv6, or both.
Prelude TE surfaces Flex-Algo data in two places:
- On nodes, as a
flex-algoblock listing the algorithms the node participates in and the Flexible Algorithm Definitions (FADs) it advertises. - Across the topology, as an
algorithmfield on every Segment Routing identifier (SR-MPLS Node and Prefix SIDs, SRv6 locators and End.X SIDs).
On nodes: participation and definitions
The flex-algo block on a node looks like this:
"flex-algo": {
"algorithms": [0, 1, 128],
"definitions": [
{
"algorithm": 128,
"metric-type": 0,
"metric-type-name": "IGP",
"calc-type": 0,
"calc-type-name": "SPF",
"priority": 128,
"exclude-any": 32,
"exclude-any-bits": [5]
}
]
}
algorithmslists every SR algorithm the node participates in. Values can be0(plain SPF),1(Strict-SPF), or any Flex-Algo identifier in128–255.definitionscarries one Flexible Algorithm Definition (FAD) per Flex-Algo the node advertises a definition for. Nodes that participate without advertising only appear inalgorithms.
Each FAD entry carries:
| Field | Meaning |
|---|---|
algorithm |
The Flex-Algo identifier (128–255). |
metric-type |
0 IGP, 1 Min-Unidirectional-Delay (RFC 8571), 2 TE metric. |
metric-type-name |
Human-readable name: IGP, Delay, TE. |
calc-type |
The SPF calculation type. 0 is plain SPF. |
calc-type-name |
Human-readable name: SPF. |
priority |
FAD priority. The highest-priority FAD wins when multiple nodes advertise different definitions. |
exclude-any |
32-bit admin-group bitmask. A link must not match any of these colors. |
exclude-any-bits |
The bit positions set in exclude-any, decoded for convenience. |
include-any |
A link must match at least one of these colors. |
include-any-bits |
Decoded positions for include-any. |
include-all |
A link must match every one of these colors. |
include-all-bits |
Decoded positions for include-all. |
exclude-srlgs |
A link must not carry any of these SRLG identifiers. |
The *-bits arrays are there so you can read the constraints
directly without converting bitmasks by hand. The inputs the
constraints evaluate against — link admin groups, SRLGs, delay
metrics — live on Links.
The cross-cutting algorithm field
Flex-Algo is IGP-level, but every Segment Routing identifier
carries the algorithm value it was advertised for. Filtering by
algorithm is how you reconstruct a per-algorithm view of the
network. Look for the field on:
- Nodes / SR-MPLS Node SIDs — one Node SID per algorithm the node participates in.
- Nodes / SRv6 locators — one locator per algorithm.
- Links / SR-MPLS Adjacency SIDs and Links / SRv6 End.X SIDs — algorithm-aware adjacency segments.
- Prefixes / SR-MPLS Prefix SIDs — one Prefix SID per algorithm.
- Prefixes / SRv6 locator metadata — the algorithm the locator serves.
A topology view scoped to one algorithm is the set of nodes whose
algorithms list includes that algorithm, plus the links and
prefixes that carry a matching algorithm on their SR identifiers.