SR Policies

The policy file, endpoint forms, and how Pola creates, updates, and deletes 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
FieldRequiredDescription
asnConditionalMust be non-zero. Required for router-ID endpoints or dynamic paths; for dynamic paths, it must match global.ted.asn.
srPolicy.pcepSessionAddrYesSelects the PCEP session the policy is sent on.
srPolicy.headend, srPolicy.endpointConditionalAddress endpoint form. See Endpoint forms.
srPolicy.headendRouterID, srPolicy.endpointRouterID, srPolicy.endpointFamilyConditionalRouter-ID endpoint form.
srPolicy.nameRequired for deleteSymbolic 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.colorYesNon-zero.
srPolicy.candidatePath.preferenceNoDefaults to 100 when omitted (RFC 9256 §2.7).
srPolicy.candidatePath.explicitOne of the twoA segment list you define. See Explicit Paths.
srPolicy.candidatePath.dynamicOne of the twoA 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.

FormFieldsNotes
Addressheadend, endpointBoth 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 IDheadendRouterID, endpointRouterIDRequires 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

  1. pola sr-policy add -f policy.yaml sends the request to polad.
  2. polad resolves the endpoints, computes or validates the segment list, and finds the session for pcepSessionAddr. The session must be up and synchronized.
  3. If the session already has an LSP with the same color and endpoint, polad sends a PCUpd with the new segment list. Otherwise it sends a PCInitiate.
  4. The policy appears in pola sr-policy list after 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.