Repository navigation
Releases
bgpls 0.1.0
bgpls 0.1.0 release notes
Version 0.1.0 brings a BGP Link-State collector to Swift as both a library
and a command-line tool. The FRR walkthrough uses
the CLI to watch a backbone link disappear and return. The
library example shows how to consume the same topology
in a Swift application. See GitHub Releases
for publication status and downloads.
bgpls is part of
RouteObjects’ Swift for Infrastructure initiative,
powered by swift-cidr for its network types.
Features
- Receive-only BGP-LS sessions over IPv4 and unscoped IPv6, with explicit BGP
identifiers and two-/four-byte ASN capability negotiation. - IS-IS and OSPF topology identities; Node, Link, and canonical IPv4/IPv6 Prefix
records with advertisements and withdrawals. - Typed node names, IGP/prefix metrics, and advertised bandwidth, alongside
retained raw evidence and structured interpretation diagnostics. - In-memory RIB, deterministic JSON snapshots, and
AsyncStreamwatch events. - Strict atomic UPDATE application and isolated recoverable content rejection.
- Lazy protocol timers, scoped outbound NOTIFICATION handling, native NIO
backpressure, bounded pending UPDATE admission, and ordered shutdown draining. - Foreground CLI with
--watch,--show-attributes,--dump-rib, optional
PCAP capture through--pcap FILEor--pcap-auto, and explicit
normal/failure/SIGINT/SIGTERM exit statuses. - Terminal-first FRR and optional entitled cEOS reference labs, script recipes,
topology diagrams, and public fixture provenance.
The package uses swift-cidr 0.11.0 for addresses, canonical networks,
endpoints, and ASNs. Applications supply their own session configuration.
The SwiftNIO requirement starts at 2.104.0 within the 2.x series.
Packet capture
The opt-in --pcap-auto flag selects a capture in the current working directory
named bgpls_yyyyMMdd_HHmmssZ_peer-ADDRESS_port-PORT_UUID.pcap. It uses a UTC
timestamp selected before connecting, Gregorian/POSIX formatting, a literal
Z, and a full lowercase, hyphenated UUID. The configured numeric peer address
omits any prefix and replaces IPv6 colons with hyphens; that peer may be a relay
rather than the topology producer. The CLI prints the escaped absolute selected
path before session creation and retains its separate writing PCAP
confirmation. --pcap FILE still selects an explicit path. Omitting both
options disables capture; combining them fails validation.
PCAP output requires a new file in a trusted directory. Existing paths,
including symbolic links, are refused without modification. Automatic naming
does not probe for available names, overwrite, or retry a collision.
Files are created with owner-only permissions
(0600, subject to a more restrictive umask), and writes retain the safely
opened descriptor. PCAP encoding is unchanged. Creation or header-write errors
fail before connecting; later capture-write errors remain logged while
collection continues. Successful collection alone does not certify a complete
capture. See capture-file safety.
Capture has internal per-file limits of 8 MiB of pending encoded PCAP
bytes and 4,096 pending chunks, counting queued data and the active write.
Accepted bytes use independent compact storage; allocator and queue metadata
are outside the byte count, with chunk count bounded separately. The initial
file header is written before connection and is outside the pending budget.
If either limit would be exceeded, the whole overflowing chunk is refused and
capture stops for that session. Accepted chunks drain and the file closes;
BGP collection, RIB updates, watch events, and session exit statuses continue
unchanged. One overload warning identifies the incomplete capture. It runs on
the file queue before close completes and can wait behind stalled I/O. Capture
does not resume after overload. See the capture budget.
Swift 6.3 and fixed wire constants
Thirty fixed public scalar wire constants use computed static properties with
@export(implementation). If you built against a preview that used stored
properties, rebuild precompiled BGPLSClient consumers for the new accessor
ABI. Source code accesses the constants with the same names and types.
Requirements and limits
Swift 6.3 or later is required. The package declares macOS 15 and iOS 18
deployment floors; the CLI targets macOS and Linux. The library's iOS compile
check is distinct from operational qualification.
This release provides a BGP-LS collector and reproducible reference lab.
Callbacks must return promptly; synchronous callbacks or stderr can delay
processing and cleanup. The pending UPDATE and PCAP limits do not bound total
process memory. The capture budget is not a disk quota or shutdown deadline.
Slow watch subscribers can lose events, and exact replay requires complete
delivery.
Rejected withdrawals or replacement advertisements can leave earlier accepted
information stale. There is no automatic stale-state reconciliation. AS paths
remain raw evidence, NOTIFICATION coverage is scoped, and reconnection,
persistence, access controls, multi-peer supervision, and operational history
belong to the embedding application.
See protocol support and
architecture for the full contract.
Known FRR producer limitation
FRR can advertise a replacement BGP-LS Link NLRI after IPv6 address descriptors
change without withdrawing the previous identity. Stale entries can therefore
remain in the producer's BGP-LS RIB and its collectors. Independent GoBGP and
bgpls observations, regression tests, and the proposed correction are recorded
in FRR PR #24113.
bgpls retains distinct received identities and applies received withdrawals;
it does not coalesce those records or synthesize withdrawals. Restarting only
the collector can receive the stale entries again. See the
lab limitation and investigation guidance.
The upstream FRR merge or release is not a publication dependency for bgpls.
Expected topology counts and exact-restoration checks remain unchanged. The
separate Containerlab startup fix is included in
Containerlab 0.83.0.
The fresh 2026-11-15 rehearsal passed installation, startup, and bounded
--churn verification with that released runtime. On 2026-11-20 the
packaged FRR quickstart
also passed. The collector observed both p1–p2 withdrawals and recovered its
exact 5/14/10 baseline on the same session. The packaged teardown removed
only the owned deployment.
New lab deployments require stable Containerlab 0.83.0 or newer, and the
one-time OrbStack setup installs the official 0.83.0 ARM64 package after checksum
and package-metadata verification. Existing deployment inspection and teardown
remain available with their original runtime; the new minimum applies to
creation of fresh labs.
Validation
The public main CI run on 36b64ca
passed on macOS with Xcode 26.6 and on native Linux x86_64 and ARM64 with
Swift 6.3.3. The Linux jobs exercised IPv4 and IPv6 loopback. The macOS job
also checked the macOS 15 build, the iOS 18 simulator library build, and the
offline lab tooling. The qualification summary
records the individual checks and the scope of the live lab rehearsals.
On 2026-11-09, the Swift 6.3 constants change passed baseline and full churn
verification on the existing paired FRR/cEOS deployment. A native macOS ARM64
debug collector built with Apple Swift 6.3.3 used IPv4 TCP and four-byte ASN
4200000001, receiving both IPv4 and IPv6 topology. Both producers reached and
exactly restored 6 nodes / 18 links / 12 prefixes; directional metric probes,
wire/native/CLI comparisons, Swift replay, and both signal shutdown paths passed.
See the dated results and scope.
This workload did not reproduce the stale-link behavior; FRR PR #24113 remained
open as of that date. Earlier failed runs retain their original outcomes.
To report a security issue privately, use the form linked in the
security policy.