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

Return to the regular view of this page.

polad

Command line, signals, logging, and exit status of the polad daemon.

polad is the PCE daemon. It reads its configuration file, accepts PCEP sessions, and serves the gRPC API. See Installation to install it.

polad [-f <file>]
polad --version
OptionDefaultDescription
-fpolad.yamlConfiguration file. A relative path is resolved against the working directory.
--versionPrint polad <version> and exit. Recognized only as the first argument. Release binaries and container images print the release version; binaries built with go install or make build print dev.
-hPrint the usage to standard error and exit with 1.

The application settings of polad are defined in its configuration file.

Environment variables

polad defines no application-specific environment variables. Its GoBGP gRPC client (gobgp.grpcClient) honors the standard proxy variables HTTPS_PROXY, https_proxy, NO_PROXY, and no_proxy.

If HTTPS_PROXY is set, connections to non-loopback GoBGP addresses use the proxy (HTTP CONNECT) unless the GoBGP host matches an entry in NO_PROXY. To bypass the proxy, add the GoBGP hostname, IP address, or CIDR range to NO_PROXY. Loopback addresses, such as 127.0.0.1 and localhost, are never proxied.

The gRPC library also reads GRPC_GO_LOG_SEVERITY_LEVEL, GRPC_GO_LOG_VERBOSITY_LEVEL, and GRPC_GO_LOG_FORMATTER to configure its own logging.

Running

polad writes logs to the log file and to standard output. On SIGINT or SIGTERM it sends Close to every PCEP session and exits with 0.

Exit status

StatusMeaning
0--version printed the version, or polad was stopped by SIGINT or SIGTERM.
1-h printed the usage, an invalid command line, unreadable or invalid configuration file, or a server that failed to start or run. The reason is printed to standard error.

1 - Configuration

Every polad.yaml key, default, and validation rule.

polad reads this file at startup. See polad for command-line options.

Example

global:
  pcep:
    address: "192.0.2.254"
    port: 4189
  grpcServer:
    address: "127.0.0.1"
    port: 50052
  log:
    path: "/var/log/pola/"
    name: "polad.log"
    level: "info"
  ted:
    enable: true
    source: "gobgp"
    asn: 65000
  gobgp:
    grpcClient:
      address: "127.0.0.1"
      port: 50051
  usidMode: false

GoBGP listens on port 50051 by default, and pola connects to that port by default. This example puts polad’s gRPC server on 50052 instead, so run pola -p 50052.

Keys

All keys are under global. Unknown keys are rejected.

KeyRequiredDefaultDescription
pcep.addressyesPCEP listen address. A literal IPv4 or IPv6 address; hostnames are not resolved.
pcep.portyesPCEP listen port. The standard port is 4189.
pcep.keepaliveno30Keepalive in seconds (0-255) advertised in Pola’s Open.
pcep.deadTimerno4 × keepalive, capped at 255DeadTimer in seconds (0-255) advertised in Pola’s Open. Set it to 0 if keepalive is 255.
pcep.minKeepalivenono lower boundLowest Keepalive accepted from a peer (0-255).
pcep.maxKeepalivenono upper boundHighest Keepalive accepted from a peer (0-255).
pcep.allowNegotiationnotruePropose acceptable timers to a peer instead of rejecting its Open.
grpcServer.addressyesgRPC API listen address. A literal IPv4 or IPv6 address; hostnames are not resolved.
grpcServer.portyesgRPC API listen port.
log.pathyesLog directory, created with mode 0750 if missing. Prepended to name as is; include a trailing /.
log.nameyesLog file name. Opened for appending; its mode is set to 0600, even for an existing file.
log.levelnoinfodebug, info, warn, or error (lowercase).
tedyesTED section. Required even when the TED is disabled.
ted.enablenofalseBuild a TED from BGP-LS.
ted.sourcewhen enabledTED source. Only gobgp is supported.
ted.asnwhen enabledAS number of the topology; non-zero.
gobgp.grpcClient.addresswhen source is gobgpGoBGP gRPC API address.
gobgp.grpcClient.portwhen source is gobgpGoBGP gRPC API port.
usidModenofalseTreat SRv6 SIDs in explicit segment lists as uSID. See SRv6.

All port values can be written as numbers or strings.

Timer behavior is described in PCEP Sessions, and the TED in Traffic Engineering Database.

Validation

polad checks the file at startup and exits on the first stage that fails.

Read errors

If the file cannot be opened or parsed, the error begins with failed to read config file:. Examples: a missing file, invalid YAML, or an unknown key.

Validation errors

Violations of these rules are reported together in one error beginning with invalid config file:. Timer rules apply after defaults are filled in.

  • Every key marked yes under Required is present; string values are non-empty.
  • log.level is debug, info, warn, or error.
  • If ted.enable is true, ted.source is gobgp, ted.asn is non-zero, and gobgp.grpcClient.address and port are set. Otherwise, these keys are not checked.
  • If keepalive is 0, deadTimer is 0.
  • If keepalive is non-zero, deadTimer is 0 or greater than keepalive.
  • minKeepalive is not greater than maxKeepalive.

Startup errors

A listen address that is not a literal IP address causes an error when its listener starts.

JSON Schema

polad_config.json provides editor completion and catches most single-key errors. Rules that span keys, such as the timer rules, are checked only by polad.

Security

  • The gRPC API has no TLS and no authentication: anyone who can reach it can create and delete SR Policies. Bind it to loopback or a trusted management network.
  • The PCEP listener has no TLS, TCP-MD5, or TCP-AO, and accepts any PCC that connects. Restrict access with network controls.
  • The connection to GoBGP is plaintext gRPC.