BGP (Border Gateway Protocol) is the routing protocol that powers the Internet. When BGP sessions flap, peer connections drop, or routes are incorrectly advertised, the impact can range from degraded application performance to complete network isolation. This guide compares how FRRouting, BIRD, and GoBGP expose BGP session state, telemetry data, and monitoring interfaces — enabling you to build comprehensive BGP observability on self-hosted infrastructure.
Why BGP Session Monitoring Is Critical
BGP sessions carry routing information between autonomous systems. A single session failure can withdraw thousands of routes, redirecting traffic through suboptimal paths or making destinations unreachable. Monitoring BGP session state — peer status, route counts, update messages, and flap history — is essential for network operators who need to detect issues before they cause outages.
Key metrics for BGP monitoring include:
- Peer state: Established, Idle, Active, Connect, OpenSent, OpenConfirm
- Route counts: Routes received, routes advertised, routes filtered
- Update statistics: Messages sent/received, withdrawals, notification errors
- Session uptime: Duration of current established session
- Flap history: Number of session resets over time
FRRouting BGP Monitoring
FRRouting (FRR) is the most feature-complete open-source BGP implementation, supporting BGP, OSPF, IS-IS, RIP, and more. Its monitoring interface is accessed through the vtysh CLI and a JSON API.
VTYSH CLI Monitoring
| |
JSON API for Automation
FRR supports JSON output for all CLI commands, enabling programmatic monitoring:
| |
Sample output includes peer address, AS number, state, uptime, messages sent/received, and route counts — all parseable by monitoring scripts.
Prometheus Integration via FRR Exporter
The frr_exporter scrapes FRR’s VTYSH JSON output and exposes it as Prometheus metrics:
| |
Key metrics: frr_bgp_peer_state, frr_bgp_peer_uptime_seconds, frr_bgp_peer_prefixes_received, frr_bgp_peer_updates_received_total.
Docker Compose Deployment
| |
BIRD BGP Monitoring
BIRD (BGP Internet Routing Daemon) is a lightweight, high-performance routing daemon popular in IXPs and small-to-medium networks. Its monitoring interface uses the birdc CLI and a Unix socket protocol.
BIRD CLI Monitoring
| |
BIRD’s output format is structured and parseable, showing peer state, BGP state machine transitions, route counts, and filter results.
BIRD Exporter for Prometheus
The bird_exporter connects to BIRD’s Unix socket and exposes metrics:
| |
Metrics include bird_bgp_protocol_state, bird_bgp_prefixes_received, bird_bgp_prefixes_accepted, bird_bgp_uptime_seconds.
Docker Compose Deployment
| |
GoBGP Monitoring
GoBGP is a BGP implementation written in Go, designed for programmatic control via gRPC and CLI. It’s particularly suited for SDN environments and cloud-native networking.
CLI Monitoring
| |
gRPC API for Automation
GoBGP exposes a comprehensive gRPC API for programmatic monitoring and control:
| |
Prometheus Metrics
GoBGP has built-in Prometheus metrics exposure:
| |
GoBGP exposes metrics on port 50052 by default when metrics are enabled, including peer state, route counts, and update statistics.
Docker Compose Deployment
| |
Comparison Table
| Feature | FRRouting | BIRD | GoBGP |
|---|---|---|---|
| CLI Interface | vtysh (Cisco-style) | birdc (own syntax) | gobgp CLI |
| JSON Output | Built-in (–json flag) | No (text-only) | Built-in (gRPC) |
| Prometheus Exporter | frr_exporter (community) | bird_exporter (community) | Built-in |
| gRPC API | No | No | Yes (first-class) |
| BGP Protocol Support | Full (RFC 4271 + extensions) | Full (BGP4) | Full (BGP4 + extensions) |
| BFD Integration | Yes | Yes | Yes |
| Route Server Mode | Yes | Yes | Yes |
| Policy Language | Route maps, prefix lists | Filter expressions | Policy config (TOML) |
| Multiprotocol BGP | Yes | Yes | Yes |
| GitHub Stars | 4,100+ | 189 | 4,000+ |
| License | GPLv2 | GPLv2+ | Apache 2.0 |
Building BGP Monitoring Dashboards
A comprehensive BGP monitoring dashboard should include:
- Peer state panel: Color-coded peer status (green = Established, red = any other state)
- Route count trends: Historical graph of routes received per peer
- Session uptime: Current session duration with alerts on resets
- Update rate: Messages per second (sudden spikes may indicate route flapping)
- Filter effectiveness: Routes accepted versus routes received
| |
Why Self-Host BGP Monitoring?
Running your own BGP routing stack with integrated monitoring gives you complete visibility into session state, route propagation, and policy effectiveness. Managed BGP services hide the protocol internals behind abstraction layers — you can’t see individual peer state, filter results, or update messages. Self-hosted BGP with FRR, BIRD, or GoBGP, combined with Prometheus exporters, enables real-time alerting on peer state changes, historical trending of route counts, and integration with your broader network observability stack.
For BGP routing fundamentals, see our FRRouting vs BIRD vs OpenBGPD guide. For BGP monitoring and alerting, check our BGPalerter vs ExaBGP vs GoBGP guide. For anycast deployment, see our Bird/FRR anycast guide.
FAQ
What BGP session states should trigger alerts?
Any state other than “Established” should trigger an alert. The BGP finite state machine progresses through Idle, Connect, Active, OpenSent, and OpenConfirm before reaching Established. Sessions stuck in Active or Connect typically indicate TCP connectivity issues.
How often should I poll BGP session state?
Every 15-30 seconds is sufficient for most monitoring needs. BGP session state changes are rare during stable operation, and the BGP keepalive interval (typically 60 seconds) sets an upper bound on how quickly state changes can occur.
What is the difference between BGP and BFD for session monitoring?
BGP monitors the protocol-level session (route exchange, policy enforcement), while BFD (Bidirectional Forwarding Detection) monitors the underlying IP connectivity between peers. BFD detects link failures in milliseconds, while BGP hold timers typically take 30-180 seconds. Using both provides fast failure detection with protocol-level visibility.
Can I monitor BGP sessions without root access?
FRR and BIRD require root (or CAP_NET_ADMIN) to bind to privileged ports and manage routing tables. However, the monitoring exporters (frr_exporter, bird_exporter) only need read access to the VTYSH socket or Unix control socket, which can be configured for non-root users.
How do I detect BGP route leaks?
Monitor the prefix count received from each peer against expected baselines. A sudden increase in received routes may indicate a route leak. Set alerts when prefixes_received deviates by more than 10-20% from the historical average. RPKI validation (with rpki in FRR or BIRD) can also filter invalid routes.
Does GoBGP support BGP FlowSpec?
Yes, GoBGP supports BGP FlowSpec (RFC 8955) for traffic filtering and DDoS mitigation. You can install FlowSpec rules programmatically via the gRPC API, enabling automated response to traffic anomalies detected by your monitoring system.