This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

User Guide

Installation, configuration, and operation of Pola PCE.

Start with Installation and the Quick Start.

1 - Installation

Install polad and pola from a release, with go install, from source, or as a container image.

Pola consists of two binaries: polad (the daemon) and pola (the CLI).

Release binaries

Each GitHub release has Linux binaries for amd64, arm64, 386, and arm.

go install

Requires the Go version declared in go.mod.

go install github.com/nttcom/pola/cmd/polad@latest
go install github.com/nttcom/pola/cmd/pola@latest

@latest installs the latest released version, not the develop branch this site describes.

From source

git clone https://github.com/nttcom/pola.git
cd pola
make build      # writes bin/polad and bin/pola
make install    # or install both into GOPATH/bin

Container image

The image ghcr.io/nttcom/pola runs polad -f polad.yaml in /pola. Mount pola-config/ to /pola and logs/ to /var/log/pola/.

Available tags are latest, vX.Y.Z, and their debug variants (latest-debug, vX.Y.Z-debug), which add network tools, vim, and bash completion. Images are available for linux/amd64 and linux/arm64.

Create pola-config/polad.yaml using the Configuration example, and set global.log.path to /var/log/pola/. Logs are written to the mounted directory on the host and to standard output. View the latter with docker logs polad.

mkdir -p pola-config logs

The examples below use gRPC port 50052 to avoid conflicting with GoBGP on port 50051. Adjust the address and port if needed.

Host network

polad uses the host network, so no ports need to be published. Set global.pcep.address to a host address or wildcard, and configure PCCs to connect to a reachable host address.

docker run -d --name polad --network host \
  -v "$(pwd)/pola-config:/pola" \
  -v "$(pwd)/logs:/var/log/pola" \
  ghcr.io/nttcom/pola:latest

# With the gRPC server on 127.0.0.1:50052
docker exec polad pola -p 50052 session
# or, with the pola binary installed on the host
pola -p 50052 session

Bridge network

Give polad a fixed address on a dedicated network, and connect the PCC container to the same network. Ensure the GoBGP gRPC server is reachable from the polad container.

docker network create --subnet <PCEP network subnet> pcep_net

docker run -d --name polad --network pcep_net --ip <PCE address> \
  -p 127.0.0.1:50052:50052 \
  -v "$(pwd)/pola-config:/pola" \
  -v "$(pwd)/logs:/var/log/pola" \
  ghcr.io/nttcom/pola:latest

docker network connect pcep_net <PCC container name>

global.pcep.address is the address polad listens on inside the container. It accepts an IP address or wildcard (0.0.0.0 or ::), but not a hostname.

PCCs connect to a reachable PCE address on global.pcep.port (4189 by default). PCC containers on pcep_net can connect directly without port publishing.

PCCs outside Docker. Publish the PCEP port with -p 4189:4189 and configure PCCs with the Docker host’s address and port. Set global.pcep.address to a wildcard so polad accepts connections forwarded to the container.

gRPC API. The CLI defaults to 127.0.0.1:50051. The examples below use port 50052.

FromRequirementCommand
Inside the polad containerglobal.grpcServer.address is 127.0.0.1 or a wildcard.docker exec polad pola -p 50052 session
Docker hostglobal.grpcServer.address must be a wildcard or the container’s address. Publish the port with -p 127.0.0.1:50052:50052.pola -p 50052 session
Another container on pcep_netglobal.grpcServer.address is a wildcard or <PCE address>. No publishing needed.pola --host <PCE address> -p 50052 session

The gRPC API has no authentication or encryption. Publish its port on 127.0.0.1 or leave it unpublished unless the network is trusted. If HTTPS_PROXY is set where pola runs, see pola for NO_PROXY.

To build the image yourself, see Building images.

Check the installation

polad --version
pola --version

Release binaries and container images print the release version. Binaries built with go install or from source print dev.

Next, follow the Quick Start.

2 - Quick Start

Run polad without a TED and add an explicit-path SR Policy.

This guide shows how to add an explicit-path SR Policy with the TED disabled. Dynamic paths require a Traffic Engineering Database.

You need polad and pola (Installation) and a router that can act as a PCEP client (PCC) for SR-MPLS. For a ready-made lab, see Examples.

1. Write polad.yaml

global:
  pcep:
    address: "192.0.2.254"    # an address of this host that the PCC can reach
    port: 4189
  grpcServer:
    address: "127.0.0.1"
    port: 50051
  log:
    path: "/var/log/pola/"
    name: "polad.log"
  ted:
    enable: false

The ted section is required even when the TED is disabled. log.path must end with /. Every key is described in Configuration.

2. Start polad

polad -f polad.yaml

polad creates the log directory if needed and logs to the file and to standard output. Port 4189 does not require special privileges. Ensure the user running polad can write to the log directory (for example, /var/log/pola/).

3. Connect the PCC

Configure the router to connect to 192.0.2.254 port 4189 as a stateful PCEP client with PCE-initiated LSPs and SR enabled. Then check the session:

pola session

Wait until the state is up and LSP-DB Sync is finished.

4. Add an SR Policy

Write policy.yaml. pcepSessionAddr is the PCC’s source address for its PCEP session. Use segment labels that are valid in your network:

srPolicy:
  pcepSessionAddr: 192.0.2.1
  headend: 192.0.2.1
  endpoint: 192.0.2.4
  name: policy-name
  color: 100
  candidatePath:
    explicit:
      segmentList:
        - sid: 16003
        - sid: 16004

Without a TED, SIDs cannot be validated, so pass --no-sid-validate:

pola sr-policy add -f policy.yaml --no-sid-validate
pola sr-policy list

The policy appears in the list once the PCC reports it. If it does not, see Troubleshooting.

5. Delete the SR Policy

pola sr-policy delete -f policy.yaml

Next steps

3 - PCEP Sessions

How PCCs connect to Pola, timer settings, Keepalive negotiation, and session inspection.

Pola listens for PCEP connections on global.pcep.address and global.pcep.port. Configure each PCC to connect to that address. Pola accepts one session per peer address; another connection from the same address is answered with PCErr 9/1 and closed.

Timers Pola advertises

keepalive and deadTimer under global.pcep are the values Pola advertises in its Open message (RFC 5440, Section 7.3).

KeyDefaultRule
keepalive300-255 seconds. 0 disables Keepalive transmission.
deadTimer4 x keepalive, capped at 2550 or greater than keepalive. Must be 0 if keepalive is 0. Because of the cap, keepalive: 255 requires deadTimer: 0.

Pola sends Keepalives every keepalive seconds, or every deadTimer / 4 seconds if that is shorter, with a minimum interval of 1 second. If deadTimer is 0, it uses keepalive. If keepalive is 0, it sends no Keepalives.

global:
  pcep:
    address: "192.0.2.254"
    port: 4189
    keepalive: 30
    deadTimer: 120

Peer timers

Pola closes the session with Close reason “DeadTimer expired” if no message arrives within the peer’s advertised DeadTimer.

Pola does not time out the session if the peer advertises a Keepalive or DeadTimer of 0. A Keepalive of 0 also disables DeadTimer processing, even if the DeadTimer is nonzero.

Validating the peer’s Keepalive

minKeepalive sets the lower bound and maxKeepalive sets the upper bound for the Keepalive in a peer’s Open. Each bound is optional: the lower bound defaults to 0 and the upper bound to 255. Omit both to disable the check.

A peer’s Open is also unacceptable if its DeadTimer is nonzero and not greater than its nonzero Keepalive.

allowNegotiation (default true) decides what Pola does with an unacceptable Open:

ValueBehavior
truePola sends PCErr 1/4 proposing a Keepalive clamped to the configured range and a DeadTimer of four times that value, capped at 255 (0 when the Keepalive is 255). If the peer’s next Open is still unacceptable, Pola sends PCErr 1/5 and closes the session.
falsePola sends PCErr 1/3 and closes the session.
global:
  pcep:
    address: "192.0.2.254"
    port: 4189
    minKeepalive: 10
    maxKeepalive: 60
    allowNegotiation: true

Pola accepts a PCErr 1/4 proposal for its own Open only if the proposed values satisfy the same rules, including the minKeepalive/maxKeepalive range. For the full negotiation, see Session State Machine.

Capabilities

Pola advertises the Stateful PCE capability with support for LSP updates and instantiation (RFC 8231, RFC 8281), the Color capability (RFC 9863), and the SR-MPLS (RFC 8664) and SRv6 (RFC 9603) path setup types.

Pola refuses the session if the PCC’s PATH-SETUP-TYPE-CAPABILITY lists no path setup type (PCErr 10/11) or none that Pola supports (PCErr 21/2).

Pola does not track delegation. It ignores the D flag in PCC reports and sets D in every PCInitiate and PCUpd it sends. Pola answers stateless PCReq messages with PCErr 2/0.

Inspecting and closing sessions

pola session                   # list all sessions and their state
pola session 192.0.2.1 detail  # also show creation time, initiator, and message counters
pola session delete 192.0.2.1  # send Close and drop the session

Session states are tcp-pending, open-wait, keep-wait, and up.

SR Policies can be provisioned only when the session is up and LSP-DB synchronization is finished. Synchronization finishes when the PCC sends its end-of-sync report (a PCRpt with PLSP-ID 0, RFC 8231, Section 5.6).

After pola session delete, the PCC normally reconnects according to its own retry timer. When polad stops, it sends Close to every session.

See the pola reference for the output format.

4 - Traffic Engineering Database

Build the TED from BGP-LS through GoBGP, for dynamic paths, router-ID endpoints, and SID validation.

The Traffic Engineering Database (TED) is Pola’s representation of the network topology. polad builds it from BGP-LS (RFC 9552) routes received by a GoBGP instance.

The TED is used for:

Without a TED, Pola can provision only explicit paths with address endpoints, and SID validation must be disabled with --no-sid-validate.

Enable the TED

global:
  ted:
    enable: true
    source: "gobgp"
    asn: 65000
  gobgp:
    grpcClient:
      address: "127.0.0.1"
      port: 50051

asn is the AS number of the topology. gobgp.grpcClient specifies GoBGP’s gRPC API endpoint. GoBGP uses port 50051 by default, so configure polad’s own gRPC server to use a different port (see Configuration).

To run without a TED, keep the section and set enable: false:

global:
  ted:
    enable: false

Configure GoBGP

GoBGP needs a BGP session with a router that exports IGP topology into BGP-LS, using the ls address family. A minimal gobgpd configuration:

global:
  config:
    as: 65000
    router-id: 10.255.0.254
neighbors:
  - config:
      neighbor-address: 10.100.0.1
      peer-as: 65000
    transport:
      config:
        local-address: 10.100.0.254
    afi-safis:
      - config:
          afi-safi-name: ls

The router must also be configured to advertise its IS-IS or OSPF database into BGP-LS, including SR information (SRGB, Prefix-SIDs, Adj-SIDs, SRv6 SIDs, and SID structures).

How the TED is updated

  • At startup, polad reads the BGP-LS routes from GoBGP and builds the TED.
  • It then watches GoBGP for changes. Each change to GoBGP’s Adj-RIB-In, in any address family, resets a 5-second timer. When the timer expires, polad reads all BGP-LS routes again and replaces the TED. Continuous changes postpone the refresh.
  • If the watch stream breaks, polad reconnects every 10 seconds and then refreshes the TED.
  • If the initial read fails, polad retries when GoBGP reports a change or the watch stream reconnects after a break.
  • If any BGP-LS route cannot be converted, the whole refresh is discarded and the previous TED is kept. The error is logged. Examples are an NLRI with multiple paths in GoBGP, a node with more than one SRGB range, and BGP-LS SR Policy routes.

Use pola ted to see what polad currently holds.

What the TED contains

  • Nodes, keyed by IGP router ID. A dual-stack node is one node. Nodes also contain their advertised SR-Algorithms and Flexible Algorithm Definitions (FADs; RFC 9350, RFC 9351).
  • Prefixes with a Prefix-SID per advertised algorithm, and the SRGB.
  • Links with top-level IGP, TE, delay, and min-delay metrics, administrative groups (including the Extended Administrative Group), SRLGs, Adj-SIDs, and SRv6 End.X SIDs.
  • Application-Specific Link Attributes (ASLA, RFC 9294): application masks and application-scoped affinity, SRLGs, TE metric, delay, and min-delay. Flex-Algo selects among these as described in Link attributes.
  • SRv6 SIDs with endpoint behavior and SID structure.

Information not listed here, such as MSD, bandwidth, the SRv6 Locator TLV, and FAPM, is not stored; see Not supported. A top-level TE, delay, or min-delay metric of 0 is treated as not advertised. Inside ASLA, 0 is a valid value.

Constraints

  • GoBGP is the only TED source. The connection to GoBGP is plaintext gRPC without authentication.
  • One AS only: nodes, prefixes, and SIDs from other AS numbers are ignored, and so are links to them.
  • One path per BGP-LS NLRI: if GoBGP receives the same NLRI from several BGP-LS peers (for example, redundant BGP-LS speakers or route reflectors), every refresh fails and the TED is not updated while the duplicates exist. Peer GoBGP with a single BGP-LS speaker.

Initial synchronization

With the TED enabled, polad starts with an empty, unsynchronized TED. It becomes synchronized after the first complete read from GoBGP, even if that read returns no BGP-LS routes. PCEP sessions can be established before that point. Until then, polad defers path computation for PCC reports; see Dynamic Paths.

Requests through the gRPC API and the CLI are not deferred. While the TED has no nodes, dynamic paths and SID validation fail with TED_NOT_SYNCED, and router-ID endpoints fail with INVALID_REQUEST. These errors also occur after synchronization if the TED becomes empty, for example because no BGP-LS node matches global.ted.asn.

5 - 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.

6 - Explicit Paths

Provision an SR Policy with a segment list you define, and validate it against the TED.

An explicit candidate path uses the segment list you provide. For other policy fields, see SR Policies.

SR-MPLS

asn: 65000
srPolicy:
  pcepSessionAddr: 192.0.2.1
  headend: 192.0.2.1
  endpoint: 192.0.2.4
  name: policy-name
  color: 100
  candidatePath:
    preference: 100
    explicit:
      segmentList:
        - sid: 16003
        - sid: 16002
        - sid: 16004
pola sr-policy add -f policy.yaml

Each sid is an MPLS label in the range 0–1048575.

SRv6

asn: 65000
srPolicy:
  pcepSessionAddr: "2001:db8::1"
  headend: "2001:db8::1"
  endpoint: "2001:db8::2"
  name: policy-name
  color: 100
  candidatePath:
    explicit:
      segmentList:
        - sid: "2001:db8:1005::"
          localAddr: "2001:db8::5"
          sidStructure: "32,16,0,80"
        - sid: "2001:db8:1006::"
          localAddr: "2001:db8::6"
          sidStructure: "32,16,0,80"

Each sid is an IPv6 address. See SRv6 for SID structures and uSID.

A segment list must be entirely SR-MPLS or entirely SRv6.

Segment fields

FieldDescription
sidRequired unless sidAbsent is set. MPLS label or SRv6 SID.
localAddrOptional. Address of the node that owns the SID; used as the Node or Adjacency Identifier (NAI). Without it, no NAI is sent.
remoteAddrOptional; requires localAddr. Specifies an adjacency NAI from localAddr to remoteAddr. Both addresses must be the same family.
localInterfaceId, remoteInterfaceIdRequired when localAddr and remoteAddr are IPv6 link-local addresses (both must then be link-local).
sidStructureSRv6 only, optional; rejected for SR-MPLS. LBL,LNL,FL,AL: locator block, locator node, function, and argument lengths in bits. Each is 0-255 and the sum is at most 128.
behaviorSRv6 only, optional; rejected for SR-MPLS. Endpoint behavior code (RFC 8986, RFC 9800), 1-65535, for example 0x0030 for uN. Overrides the derived behavior; 0 or omitted derives it as described below.
sidAbsentOptional. Sends the segment without a SID (S flag, RFC 8664 and RFC 9603), so the PCC chooses the SID from the NAI. sid must be omitted. localAddr and dataPlane are required: without a SID, the NAI is the only way to identify the segment, and Pola cannot determine whether it uses SR-MPLS or SRv6. For SRv6, sidStructure is rejected because it describes a SID, and the NAI addresses must be IPv6.
dataPlanesr-mpls or srv6. Required with sidAbsent. Otherwise optional, and an error if it contradicts the SID.

Unless behavior is set, Pola derives the SRv6 behavior: End (or uN with usidMode) when only localAddr is set, and End.X (or uA) when both localAddr and remoteAddr are set. Without localAddr, the behavior is signaled as opaque.

To let the PCC choose the SID, identify a segment by its NAI alone:

segmentList:
  - sidAbsent: true
    dataPlane: srv6
    localAddr: "2001:db8::5"
    remoteAddr: "2001:db8::6"

SID validation

Unless --no-sid-validate is given, polad validates each segment against the TED before sending the policy. It walks the segment list from the headend:

  • A node SID (an SR-MPLS Prefix-SID label or an SRv6 SID) must be advertised by some node, which becomes the current node.
  • An Adj-SID or End.X SID must be advertised by the current node; validation then advances to the neighbor on that link.
  • If several nodes advertise the same SID (anycast), the current node becomes unknown: subsequent SIDs are checked only for existence in the TED until a node SID advertised by a single node is reached.
  • A sidAbsent segment is checked by its NAI instead. A node NAI must be a /32 or /128 prefix advertised by some node, which becomes the current node. An adjacency NAI must match a link of the current node: by its interface IDs when both are given, otherwise by its interface addresses; validation then advances to the neighbor on that link. When the current node is unknown, an adjacency NAI that matches a link of a single node advances to that link’s neighbor.

Validation does not check path reachability or loop freedom, and requires the headend address to appear in the TED as a /32 or /128 prefix.

Validation requires an enabled TED that contains at least one node. If the TED is disabled, the request fails with TED_DISABLED; if it is enabled but has no nodes yet, it fails with TED_NOT_SYNCED. To provision without it, for example when the TED is disabled:

pola sr-policy add -f policy.yaml --no-sid-validate

pola and polad both log a warning when validation is skipped. Label ranges and the SR-MPLS/SRv6 mix are checked even with --no-sid-validate.

The TED is always required for router-ID endpoints, which are resolved from it.

7 - Dynamic Paths

Compute segment lists with CSPF over the TED and understand when paths are recomputed.

polad computes a dynamic candidate path from the TED.

Prerequisites

  • The TED is enabled (global.ted.enable: true) and contains the topology (pola ted shows nodes).
  • asn in the policy file equals global.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

FieldValuesDescription
metricigp, te, delay, min-delay, hopcountRequired when algorithm selects the default SPF algorithm (0 or omitted). Must not be set for a Flex-Algorithm.
algorithm0-255Optional, default 0. 0 is the default SPF algorithm; 128-255 select a Flexible Algorithm (RFC 9350). 1-127 are rejected.
dataPlanesr-mpls, srv6Optional.
underlayFamilyipv4, ipv6Optional. The address family of the links the path uses.
waypointslist of routerID, optional sidOptional. Nodes the path must visit, in order.

The dataPlane and underlayFamily fields select the underlay plane. The supported combinations are:

dataPlaneunderlayFamilyStatus
sr-mplsipv4Supported
sr-mplsipv6Supported
srv6ipv6Supported
srv6ipv4Rejected; 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, and min-delay fail with METRIC_NOT_CARRIED if any link examined during the search lacks the metric, even if that link is not on the resulting path. A value of 0 counts 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:

  • metric must 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 with TED_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.

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 aslaMalformed in the TED.

Metric Types

  • Default SPF: igp, te, delay, and hopcount use the top-level link attributes or hop count. min-delay uses 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 list does 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.

8 - SRv6

SRv6 requirements, uSID mode, SID structures, and endpoint behaviors.

Requirements

  • To use SRv6, the PCC must advertise the SRv6 path setup type (PST 3, RFC 9603) in its Open message. Otherwise, Pola rejects SRv6 segment lists.
  • The underlay is IPv6. IPv4 with SRv6 is not a valid plane.

Full SID and uSID

By default, SRv6 SIDs are full 128-bit SIDs.

Setting global.usidMode: true in polad.yaml enables uSID mode for explicit SRv6 paths:

  • Unless the request specifies an endpoint behavior, Pola signals uN (node) or uA (adjacency) instead of End or End.X.
  • SID validation first checks for an exact SID match. Otherwise, it treats the SID as a uSID container and requires its first locator to be advertised in the TED. An unresolved later micro-segment does not cause validation to fail; its node association remains unknown, as with an anycast SID.

usidMode applies to all explicit SRv6 policies handled by the polad instance. It does not affect SR-MPLS, dynamic paths (which use the behavior from the TED), or LSPs reported by PCCs.

SID structure

sidStructure specifies the bit lengths of the locator block, locator node, function, and argument, in that order (LBL,LNL,FL,AL), for example 32,16,0,80.

It is a per-SID property. Dynamic paths use the structure from the TED; for explicit paths, specify it in the segment or omit it to send no structure.

uSID validation requires SID structures advertised in BGP-LS to derive locators.

Endpoint behavior

The TED records each SRv6 SID’s endpoint behavior as advertised in BGP-LS (RFC 9514). The behavior definitions are specified in RFC 8986.

The gRPC EndpointBehavior message has three fields. pola ted -j additionally includes name, the behavior’s name:

FieldMeaning
behaviorEndpoint behavior code, for example End, End.X, uN, uA.
flagsThe raw flags octet from the advertisement. Pola does not interpret it.
algorithmThe SR algorithm associated with the SID, for example 0 (SPF) or 1 (strict SPF).

Limitations

  • CSPF outputs one SRv6 SID per hop; it does not pack uSIDs into containers.
  • For dynamic paths, CSPF uses the first advertised SRv6 SID for each node, regardless of its behavior or algorithm.
  • uSID support varies by vendor; see Interoperability.

9 - Examples

Containerlab labs and Go gRPC client examples in the repository.

The labs run polad with emulated routers under Containerlab. Each lab’s README is the canonical description of its topology, images, and commands. Host setup shared by all labs is in the Containerlab conventions.

LabData planePathRoutersTED
sr-mpls-explicit-pathSR-MPLSExplicitIOS-XR (XRd), Junos (vJunos), FRRoutingDisabled
sr-mpls-explicit-path-l3vpnSR-MPLS, VPNv4ExplicitFRRoutingDisabled
srv6-explicit-path-l3vpnSRv6, VPNv4/VPNv6ExplicitJunos (vJunos)Disabled
srv6-usid-dynamic-pathSRv6 uSIDDynamicIOS-XR (XRd), Junos (vJunos, PCC)GoBGP
flex-algo-sr-mplsSR-MPLSDynamic, Flex-Algo 128-130IOS-XR (XRd, PCC), Junos (vJunos, PCC)GoBGP
flex-algo-srv6-usidSRv6 uSIDDynamic, Flex-Algo 128-130IOS-XR (XRd), Junos (vJunos, PCC)GoBGP
srv6-usid-dynamic-path-loose-source-routing-sfcSRv6 uSIDDynamic with waypointsIOS-XR (XRd), Junos (vJunos, PCC)GoBGP

The explicit-path labs disable the TED and therefore use --no-sid-validate when adding policies.

The uSID labs use port 50051 for GoBGP and 50052 for polad’s gRPC server. Their commands use pola -p 50052.

Router images (XRd, vJunos) are not distributed with Pola; obtain them from the vendors. The labs run the latest released image (ghcr.io/nttcom/pola:latest-debug), so features that exist only on the develop branch may not be available. The scenario tests use their own topologies.

Go gRPC client

examples/grpc/go contains small programs demonstrating the gRPC API: listing and deleting sessions, creating explicit, SRv6, and dynamic policies (with and without SID validation), listing and deleting policies, and querying the TED.

Use them as a starting point for your own controller.

10 - Interoperability

PCC interoperability, vendor-specific encodings, and known issues.

PCC implementations

Data planeImplementationsWhere
SR-MPLSCisco IOS-XR, Juniper Junos, FRRoutingsr-mpls-explicit-path lab and scenario tests
SRv6 full SIDJuniper Junossrv6-explicit-path-l3vpn lab
SRv6 uSIDJuniper Junos (headend); Cisco IOS-XR (PCC and transit)uSID labs and scenario tests
SRv6 uSIDHuawei VRPPreviously verified; not tested with current releases; no lab in the repository

The labs and scenario tests use IOS-XR 24.4.1 (XRd), Junos 25.2R1.9 (vJunos), and FRRouting 8.4.1. The labs run the latest released polad image; the scenario tests run binaries built from the source tree.

Vendor-specific encodings

Pola sends the SR Policy Association (RFC 9862) when the PCC advertises the required capability in its Open message. As a compatibility exception, it also sends the association to PCCs that list the SR Policy Association type in ASSOC-TYPE-LIST but omit SRPOLICY-CAPABILITY, as Junos 25.2R1.9 does.

Otherwise, Pola uses a vendor-specific encoding selected by the association types in the PCC’s ASSOC-TYPE-LIST: a Juniper ASSOCIATION object for association type 0xffe1, and a Cisco VENDOR-INFORMATION object for all other PCCs.

See What Pola sends for the exact rules.

The Juniper encoding supports IPv4 endpoints only: Pola refuses to initiate a policy with an IPv6 endpoint on such a PCC (PCEP_REQUEST_FAILED). There is no Huawei-specific encoding.

pola session detail shows the capabilities each PCC advertised.

Known issues

Observed in the scenario tests with the dual-stack SR-MPLS topology:

  • IOS-XR 24.4.1 rejects PCE-initiated SR-MPLS policies with IPv6 endpoints (pcinitiate: bad sock info).
  • IOS-XR 24.4.1 rejects PCE-initiated SR-MPLS policies with IPv4 endpoints when their SIDs are IPv6 Prefix-SIDs (Path-Type mismatch detected).
  • Junos 25.2R1.9 rejects PCE-initiated SR-MPLS policies with IPv6 endpoints because their SR Policy Association uses IPv6 (IPv6 SRPAG received for non SRv6 LSP).

Both implementations reject SR-MPLS policies with IPv6 endpoints. Junos accepts IPv4 endpoints over an IPv6 underlay; IOS-XR does not.

Observed in the Flex-Algo scenario tests (tested versions and topology only):

  • IOS-XR 24.4.1 reports a PCE-initiated LSP with SRP-ID 0 before responding to PCInitiate and includes the NUL terminator in the SYMBOLIC-PATH-NAME length. Pola correlates the early report by name and strips the terminator.
  • IOS-XR 24.4.1 silently ignores PCE-initiated SRv6 policies; therefore, the SRv6 Flex-Algo scenario uses Junos as its only headend.
  • Multi-uSID forwarding through the tested IOS-XR transit routers does not complete end-to-end. The scenario verifies forwarding per locator, not end-to-end uSID-list forwarding.
  • IOS-XR and Junos advertise Flex-Algo affinity, TE metric, and min-delay through ASLA. The scenarios configure no legacy attributes and verify this in the TED.

11 - Troubleshooting

Diagnose session, TED, and SR Policy problems.

Start with the CLI and logs

pola session detail    # state, timers, capabilities, and message counters
pola sr-policy list    # policies per session and their state
pola ted               # the topology polad uses

At the default info level, polad logs little about PCEP exchanges. Set global.log.level: debug in polad.yaml and restart polad to see:

  • Session establishment failures.
  • PCErr messages from PCCs, such as rejection of a PCInitiate.

Errors from pola sr-policy add and delete

The CLI prints the server’s error message. add also prints a hint for common reasons. See gRPC API for error definitions.

ReasonTypical causeWhat to do
INVALID_REQUESTMalformed input; headend, endpoint, or waypoint missing from the TED; address family mismatch; endpointFamily missing for an explicit path between dual-stack nodes; mixed SR-MPLS and SRv6 SIDs; label out of range; IPv4 with SRv6; ASN mismatch.Read the message and compare the file with SR Policies.
PCEP_SESSION_NOT_FOUNDNo session for pcepSessionAddr.Check the address with pola session.
PCEP_SESSION_NOT_SYNCEDSession not up, or LSP-DB synchronization not finished.Wait for synchronization; check the PCC.
TED_DISABLEDDynamic paths, router-ID endpoints, and SID validation require the TED.Enable the TED, or use the address form with --no-sid-validate.
TED_NOT_SYNCEDThe TED has no nodes: synchronization is incomplete, or no BGP-LS node matches global.ted.asn.Check GoBGP, its BGP-LS session, and global.ted.asn (pola ted); retry.
TED_DATA_INCOMPLETEA node lacks a required node SID, SRGB, or SRv6 SID; or the data plane is ambiguous.Check what the routers advertise in BGP-LS, or set dataPlane and underlayFamily.
SID_VALIDATION_FAILEDAn explicit SID is not in the TED, or an Adj-SID or End.X SID does not belong to the node reached at that point.Fix the segment list, or use --no-sid-validate.
DESTINATION_UNREACHABLENo path in the selected plane.Check the links and the plane.
METRIC_NOT_CARRIEDThe TE or delay metric is missing on a link.Use igp, or advertise the metric.
SR_POLICY_NOT_FOUNDDelete: no LSP with that color and endpoint on the session.Check pola sr-policy list.
PCEP_REQUEST_FAILEDThe PCC did not advertise the needed path setup type, the segment list exceeds its MSD, a new policy for a legacy Juniper PCC has an IPv6 endpoint, or Pola cannot build or send the PCEP request.Check pola session detail for the PCC’s capabilities and the polad log.
PATH_COMPUTATION_FAILEDUnexpected CSPF failure.Check the polad log.

A PCEP session does not come up

  • Pola acts as a passive PCEP speaker. Configure the PCC to connect to global.pcep.address and global.pcep.port, and check connectivity.
  • pola session shows sessions that are still establishing (open-wait, keep-wait).
  • A PCC Keepalive outside minKeepalive..maxKeepalive is negotiated or rejected; see PCEP Sessions.
  • A PCC that advertises no path setup type in common with Pola is rejected.
  • A second connection from the same address while a session exists is rejected with PCErr 9/1.

A policy is down or missing after a successful add

add returns when Pola sends the PCInitiate, not when the PCC accepts it. Enable debug logging and look for a PCErr from the PCC, and check the PCC’s own logs. Common causes are SIDs the headend cannot resolve and endpoint families the PCC does not support (see Interoperability).

A dynamic policy does not follow topology changes

polad recomputes a path on eligible unsolicited PCRpt messages, using the latest TED. It does not recompute paths on TED changes. See Recomputation on reports.

pola cannot connect to polad

pola connects to 127.0.0.1:50051 by default. If global.grpcServer uses another address or port, pass --host and -p.