Architecture
Processes, packages, and data flow in Pola PCE.
Packages
| Package | Role |
|---|---|
cmd/polad | The daemon: loads configuration and starts the PCEP listener, gRPC server, and GoBGP monitor. |
cmd/pola | The CLI client of the gRPC API. |
api/pola/v1 | Protocol Buffers definitions and generated code for PCEService. |
pkg/server | PCEP listener, one session per peer address, and the PCEService implementation. |
pkg/packet/pcep | PCEP message, object, and TLV encoding and decoding. See PCEP Library. |
pkg/table | TED, SR Policy and segment models, SID validation, and underlay planes. |
pkg/cspf | Shortest-path computation over the TED. |
pkg/logger | Structured logging. |
internal/gobgp | Reads BGP-LS from GoBGP and converts it into TED elements. |
internal/config | Parses and validates polad.yaml. |
Data flow
pola CLI / gRPC clients
|
v
+-- PCInitiate / PCUpd ----------------- APIServer
| ^
v |
PCC <--PCEP--> Session (one per peer) | reads current TED
^ |
| reads current TED |
| |
+---------------------------------------- Server (holds current TED)
^
syncTEDLoop replaces the current TED with a new LsTED
|
GoBGP --(ListPath, triggered by watch)--> internal/gobgp --> []TEDElem
- Each accepted TCP connection creates a
Session. A duplicate connection from the same peer address is rejected with PCErr 9/1. - Each TED update replaces the current TED with a new
LsTEDrather than modifying the existing one. Sessions read the current TED and its readiness on each use. See TED and CSPF. - SR Policy state is held in memory per session and is not persisted.
- The gRPC handlers validate requests and pass them to the session, which sends PCInitiate or PCUpd. The handlers return once the message is written.