SR Policies
An SR Policy (RFC 9256) is identified by its headend, color, and endpoint, and steers traffic over a segment list. Pola signals it to the headend PCC as an LSP using PCInitiate (RFC 8281) and the SR-MPLS (RFC 8664) or SRv6 (RFC 9603) path setup type.
Policy file
pola sr-policy add and pola sr-policy delete read a YAML file:
asn: 65000 # required with router IDs or a dynamic path
srPolicy:
pcepSessionAddr: 192.0.2.1 # PCEP peer address of the headend
headend: 192.0.2.1
endpoint: 192.0.2.4
name: policy-name
color: 100
candidatePath:
preference: 100
explicit:
segmentList:
- sid: 16003
- sid: 16004
| Field | Required | Description |
|---|---|---|
asn | Conditional | Must be non-zero. Required for router-ID endpoints or dynamic paths; for dynamic paths, it must match global.ted.asn. |
srPolicy.pcepSessionAddr | Yes | Selects the PCEP session the policy is sent on. |
srPolicy.headend, srPolicy.endpoint | Conditional | Address endpoint form. See Endpoint forms. |
srPolicy.headendRouterID, srPolicy.endpointRouterID, srPolicy.endpointFamily | Conditional | Router-ID endpoint form. |
srPolicy.name | Required for delete | Symbolic name (SYMBOLIC-PATH-NAME) sent in PCInitiate and PCUpd. Optional for add; an empty name is sent as an empty TLV. Not used to identify the LSP. |
srPolicy.color | Yes | Non-zero. |
srPolicy.candidatePath.preference | No | Defaults to 100 when omitted (RFC 9256 §2.7). |
srPolicy.candidatePath.explicit | One of the two | A segment list you define. See Explicit Paths. |
srPolicy.candidatePath.dynamic | One of the two | A path computed by Pola. See Dynamic Paths. |
Each request carries exactly one candidate path, either explicit or dynamic.
JSON Schemas for editor validation of add files: policy.json and segment.json.
Endpoint forms
Use one form; mixing them is rejected.
| Form | Fields | Notes |
|---|---|---|
| Address | headend, endpoint | Both addresses must be the same family. Works without a TED for explicit paths. For dynamic paths, the addresses are looked up in the TED (as /32 or /128 prefixes). |
| Router ID | headendRouterID, endpointRouterID | Requires the TED. The addresses are the loopback addresses of the headend and endpoint nodes. endpointFamily (ipv4 or ipv6) selects the loopback address family for both nodes. If omitted, Pola uses the address family available on both nodes. If both IPv4 and IPv6 are available on both nodes, a dynamic path uses its underlay family; an explicit path requires endpointFamily. The request is rejected if the selected family is not available on both nodes. |
The endpoint family and the underlay family are independent: an IPv6 endpoint can be reached over an IPv4 SR-MPLS underlay, for example. PCCs may reject some combinations, notably SR-MPLS policies with IPv6 endpoints; see Interoperability.
Creating and updating
pola sr-policy add -f policy.yamlsends the request topolad.poladresolves the endpoints, computes or validates the segment list, and finds the session forpcepSessionAddr. The session must beupand synchronized.- If the session already has an LSP with the same color and endpoint,
poladsends a PCUpd with the new segment list. Otherwise it sends a PCInitiate. - The policy appears in
pola sr-policy listafter Pola receives a PCRpt for the LSP.
The command succeeds as soon as the PCEP message is sent. If the PCC rejects it, polad logs the resulting PCErr at debug level.
Check pola sr-policy list to confirm that the policy is up.
Updates match LSPs by color and endpoint within the selected PCEP session, including those configured by the PCC.
A PCUpd carries the new segment list and the request’s name; it does not carry color or preference, so the PCC keeps its existing values.
After the PCC reports the update, pola sr-policy list shows the candidate path of the request.
Before sending, polad rejects a request (PCEP_REQUEST_FAILED) when:
- The PCC did not advertise the path setup type required by the segment list (SR-MPLS or SRv6).
- The segment list is longer than the Maximum SID Depth (MSD) the PCC advertised.
- A new policy (PCInitiate) has an IPv6 endpoint and the PCC uses the legacy Juniper encoding.
polad also returns this error if it cannot build or send the PCEP message.
Deleting
srPolicy:
pcepSessionAddr: 192.0.2.1
endpoint: 192.0.2.4
color: 100
name: policy-name
pola sr-policy delete -f policy.yaml
All four fields are required. pcepSessionAddr selects the session, and the LSP is found by color and endpoint (SR_POLICY_NOT_FOUND if there is none).
polad sends a PCInitiate with the R (remove) flag.
Policies that use the router-ID form must be deleted with their endpoint address.
What is signaled
A PCInitiate carries the segment list (SR-ERO or SRv6-ERO), the endpoints, the symbolic name, and the color and preference. Color and preference are encoded in an SR Policy Association (RFC 9862) when it is negotiated, or in vendor-specific objects; see What Pola sends.
State and restarts
polad keeps LSP state in memory only.
After a restart, it relearns the LSPs from each PCC’s state synchronization when the PCC reconnects.
With the TED enabled, those relearned LSPs are then treated like PCC-configured LSPs; see recomputation on reports.