On this page
Route Optimization
Pathvector can use latency and packet loss metrics to make routing decisions. The optimizer works by sending ICMP or UDP ping out different peer networks and modifying BGP local pref according to average latency and packet loss thresholds.
How it works
- Run
pathvector generatefirst. The optimizer works on the active BIRD configuration in thebird-directory(/etc/bird/by default) thatgeneratewrites. - Start the optimizer with
pathvector optimizer. It probes the globaloptimizer.targetsfrom each peer'sprobe-sourceseveryprobe-intervalseconds and keeps the lastcache-sizeresults per peer. - When a peer's average latency or packet loss meets or exceeds
latency-thresholdorpacket-loss-threshold, the optimizer runs the alert script (if configured) and, for peers withoptimize-inbound: true, lowers the peer's local pref tolocal-pref - modifierby editing the peer's config file in the BIRD directory in place. The modified config is validated with BIRD and BIRD is reconfigured (unless--no-configureis set). The depref is applied once per alerting period; when the peer's metrics drop back below the thresholds, the optimizer restores the configured local pref the same way.
With --dry-run, the optimizer logs the local pref change it would make without modifying any files.
The next pathvector generate run restores the configured local pref.
optimizer:
targets: [ "192.0.2.53" ]
latency-threshold: 100 # ms
packet-loss-threshold: 0.5 # percent
modifier: 20
peers:
Transit:
asn: 64496
local-pref: 100
neighbors:
- 203.0.113.1
probe-sources: [ "203.0.113.2" ]
optimize-inbound: true
Alert Scripts
To be notified of an optimization event, you can add a custom alert script that Pathvector will call when the latency or packet loss meet or exceed the configured thresholds.