Dynamic Paths
polad computes a dynamic candidate path from the TED.
Prerequisites
- The TED is enabled (
global.ted.enable: true) and contains the topology (pola tedshows nodes). asnin the policy file equalsglobal.ted.asn.- The headend must advertise a node SID for the selected data plane: an SR-MPLS Prefix-SID with an SRGB, or an SRv6 SID. Requirements for other nodes depend on the algorithm; see How the path is computed and Flexible Algorithm (Flex-Algo).
Example
asn: 65000
srPolicy:
pcepSessionAddr: 192.0.2.1
headendRouterID: 0000.0aff.0001
endpointRouterID: 0000.0aff.0004
name: policy-name
color: 100
candidatePath:
dynamic:
metric: igp
pola sr-policy add -f policy.yaml
The address-based endpoint form (headend, endpoint) is also supported; both addresses are looked up in the TED.
Fields
| Field | Values | Description |
|---|---|---|
metric | igp, te, delay, min-delay, hopcount | Required when algorithm selects the default SPF algorithm (0 or omitted). Must not be set for a Flex-Algorithm. |
algorithm | 0-255 | Optional, default 0. 0 is the default SPF algorithm; 128-255 select a Flexible Algorithm (RFC 9350). 1-127 are rejected. |
dataPlane | sr-mpls, srv6 | Optional. |
underlayFamily | ipv4, ipv6 | Optional. The address family of the links the path uses. |
waypoints | list of routerID, optional sid | Optional. Nodes the path must visit, in order. |
The dataPlane and underlayFamily fields select the underlay plane.
The supported combinations are:
dataPlane | underlayFamily | Status |
|---|---|---|
sr-mpls | ipv4 | Supported |
sr-mpls | ipv6 | Supported |
srv6 | ipv6 | Supported |
srv6 | ipv4 | Rejected; SRv6 SIDs are IPv6 addresses |
If either field is omitted, Pola selects the only compatible plane for which the headend advertises SIDs.
If multiple planes are possible, such as dual-stack SR-MPLS, the request fails with TED_DATA_INCOMPLETE; specify both fields explicitly.
Waypoints
dynamic:
metric: igp
waypoints:
- routerID: 0000.0aff.0002
- routerID: 0000.0aff.0003
sid: "2001:db8:3:e000::"
The path concatenates shortest paths from the headend through each waypoint, in order, to the endpoint.
By default, Pola uses each waypoint’s node SID.
The optional sid overrides the waypoint’s node SID with an MPLS label (SR-MPLS) or IPv6 address (SRv6); the SID is not validated against the TED.
For SRv6, the waypoint must still advertise an SRv6 SID.
The overriding segment uses the endpoint behavior and SID structure of the waypoint’s first SRv6 SID for the requested algorithm.
How the path is computed
CSPF runs Dijkstra’s algorithm over the links of the selected plane, minimizing one metric. The result contains one node SID for each node after the headend:
- SR-MPLS: the node’s Prefix-SID for the requested algorithm, in the plane’s address family.
- SRv6: the node’s SRv6 SID advertised for the requested algorithm.
If a node advertises multiple Prefix-SIDs for the requested algorithm, Pola uses the first one received from GoBGP. SRv6 SID selection requires an exact algorithm match.
- Long paths produce long segment lists. If a list exceeds the MSD the PCC advertised, the request fails with
PCEP_REQUEST_FAILED. - Adj-SIDs, SID-list compression, and uSID packing are not used.
- When several equal-cost paths exist, any one of them may be chosen, and repeated computations may differ.
te,delay, andmin-delayfail withMETRIC_NOT_CARRIEDif any link examined during the search lacks the metric, even if that link is not on the resulting path. A value of0counts as missing.- For the default SPF algorithm, if the destination node of any link examined during the search lacks a node SID for the selected plane, the request fails with
TED_DATA_INCOMPLETE, even if that node is not on the resulting path.
Limitations
- Bandwidth and disjointness constraints, and MSD-aware computation, are not supported.
- Affinity and SRLG constraints are available only through Flex-Algo FADs.
Flexible Algorithm (Flex-Algo)
Setting algorithm to a value in 128-255 computes the path over a Flexible Algorithm (RFC 9350) instead of the default SPF algorithm:
metricmust not be set; the FAD advertised via BGP-LS determines the optimization metric.- If no node advertises a FAD for the requested algorithm, the request fails with
FLEX_ALGO_DEFINITION_NOT_FOUND. This check precedes headend SID validation for both SR-MPLS and SRv6. - Only nodes that advertise the algorithm in the SR-Algorithm TLV and have a node SID for it in the selected plane are eligible. A SID alone does not imply participation. Other transit nodes are pruned. A headend or endpoint that does not advertise the algorithm fails with
FLEX_ALGO_NOT_PARTICIPATING; one that advertises it but lacks the required node SID fails withTED_DATA_INCOMPLETE. - Links are additionally filtered by the FAD’s Exclude-Any, Include-Any, Include-All affinity constraints and Exclude-SRLG constraint.
- If the winning FAD uses an unsupported Metric-Type or Calculation-Type, the request fails with
FLEX_ALGO_UNSUPPORTED. See Metric Types. - The winning FAD is unsupported if it contains unknown or repeated sub-TLVs, the FAD Unsupported sub-TLV (RFC 9351 §3.6), unsupported Flags bits, or content that Pola cannot fully validate. Multiple FAD TLVs for the same algorithm from one node also make that algorithm unsupported, without affecting the node’s other algorithms. The error message lists the reasons.
- The M-flag (bit 0 of the FAD Flags) is accepted but ignored. It makes inter-area and external prefix reachability use the Flex-Algo Prefix Metric (FAPM), which Pola does not read. Pola assumes the endpoints’ Prefix-SIDs are intra-area. If the network relies on inter-area or external Flex-Algo prefixes with the M-flag set, Pola’s path may differ from the routers’ computation.
FAD election
The winning FAD follows RFC 9350 §5.3:
- Every advertised FAD is considered, whether or not its advertiser participates in the algorithm.
- The highest Priority wins, and the numerically highest router ID breaks ties (OSPF router IDs compare as IPv4 addresses, IS-IS system IDs by value).
- RFC 9350 scopes FAD selection to an area (§5.3, §15.1). Pola’s TED has no per-area or per-level partition, so its election considers all FADs in the TED.
- Only the elected FAD is checked for support. An unsupported FAD that wins fails the request with
FLEX_ALGO_UNSUPPORTED; Pola does not fall back to a lower-priority FAD. An unsupported FAD that loses the election has no effect.
Link attributes
Flex-Algo uses only ASLAs (RFC 9294) whose Standard Application Bit Mask has the Flex-Algo bit set (RFC 9350 §12). The IGP metric is the one exception and comes from the top-level attribute.
- An ASLA with both application masks empty is used only if no ASLA sets the Flex-Algo bit (RFC 8919 §4.2). If any Flex-Algo ASLA exists, empty-mask ASLAs are ignored, even for attributes the Flex-Algo ASLAs lack.
- Where attributes conflict, Pola keeps the first value in the order of the ASLA TLVs in the BGP-LS attribute. RFC 8919 §4.2 recommends using the first advertisement in the lowest-numbered LSP, but BGP-LS does not preserve the LSP order.
- A link without the metric the FAD requires is pruned. A delay or min-delay with the A-bit set is treated as not advertised.
- A missing affinity fails an Include rule and passes an Exclude rule.
- A link whose ASLA cannot be decoded is pruned and reported as
aslaMalformedin the TED.
Metric Types
- Default SPF:
igp,te,delay, andhopcountuse the top-level link attributes or hop count.min-delayuses the minimum unidirectional link delay (RFC 8570). - Flex-Algo: the winning FAD selects the metric. Metric-Type 0 (IGP) uses the top-level IGP metric; Metric-Type 1 (minimum delay) and Metric-Type 2 (TE) use ASLA values (see Link attributes). Only Calculation-Type 0 (SPF) is supported.
Recomputation on reports
polad computes paths for unsolicited PCRpt messages (those that neither answer a Pola request nor belong to the initial state synchronization).
These include reports reflecting LSP state changes and reports for LSPs configured locally on the PCC.
Reports received during initial synchronization are registered but not recomputed.
For each such report, with the TED enabled, polad computes a path and sends a PCUpd with the result.
It skips the computation for explicit paths that it created itself in the current session, and when the TED is disabled.
- Metric: the policy’s metric if Pola created it; otherwise, the first METRIC object in the report (IGP, TE, or hop count). If no METRIC object is present or its type is unsupported, Pola uses TE by default, or IGP for legacy Juniper PCCs. For a Flex-Algo plane, no metric is used; the FAD’s metric always applies, so a later FAD change takes effect on the next recomputation.
- Plane: the policy’s plane if Pola created it, including its algorithm; otherwise the LSP’s address family with SR-MPLS for IPv4 and algorithm 0. For IPv6, the data plane is derived from the PCC’s path setup types, which fails if the PCC supports both SR-MPLS and SRv6.
- If computation fails, the error is logged and the report is dropped, so
pola sr-policy listdoes not show the new state for that LSP. - If the PCUpd cannot be sent (for example, the segment list exceeds the PCC’s MSD), the error is logged and the report is registered as the PCC sent it.
Each computation uses the latest TED, including topology changes received after the session was established.
Reports received before the first TED synchronization
With the TED enabled, polad waits for the initial GoBGP synchronization before computing paths because the TED is initially empty.
An unsolicited report that arrives earlier is registered exactly as the PCC sent it, with no PCUpd.
When the initial synchronization completes, polad computes the path for one deferred report per LSP (the one with the highest LSP-ID, the latest among equals) and sends the PCUpd.
The deferred computation is skipped if the LSP has been removed or given an explicit path in the meantime.
This does not depend on whether the session or the TED synchronization finishes first.
If the initial read from GoBGP fails, reports stay deferred until a later read succeeds.
polad recomputes a path only when the PCC sends a report, and once after the initial TED synchronization for reports that were deferred.
A later topology change, including a changed or newly advertised Flexible Algorithm Definition, does not by itself move existing LSPs; they follow it the next time the PCC reports them.
After polad restarts, it no longer knows which LSPs had explicit paths.
With the TED enabled, the next unsolicited report for such an LSP triggers a CSPF computation and a PCUpd that replaces the explicit segment list.