Skip to content
Documentation Prelude Topology Engine 1.0.0

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-algo block listing the algorithms the node participates in and the Flexible Algorithm Definitions (FADs) it advertises.
  • Across the topology, as an algorithm field 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]
    }
  ]
}
  • algorithms lists every SR algorithm the node participates in. Values can be 0 (plain SPF), 1 (Strict-SPF), or any Flex-Algo identifier in 128–255.
  • definitions carries one Flexible Algorithm Definition (FAD) per Flex-Algo the node advertises a definition for. Nodes that participate without advertising only appear in algorithms.

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:

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.

Filtering by: