Border Gateway Protocol (BGP) is the routing protocol that holds the Internet together. Every autonomous system uses BGP to exchange reachability information with its peers. When BGP misconfigurations, route hijacks, or leaks occur, they can take down large portions of the Internet within minutes.
Analyzing BGP data — historical route announcements, RIB dumps, and real-time update streams — is essential for network operators, security researchers, and organizations that depend on reliable Internet routing. This guide compares three open-source tools for BGP data analysis: BGPStream, BGPKIT, and ExaBGP.
| Feature | BGPStream | BGPKIT | ExaBGP |
|---|---|---|---|
| Stars | 124+ (CAIDA) | 130+ (parser) | 1,200+ |
| Language | C/C++ | Rust | Python |
| Data Sources | CAIDA, RIPE RIS, RouteViews | RIPE RIS, RouteViews MRT | Local BGP sessions |
| Primary Use | Historical BGP analysis | MRT data parsing and API | BGP peer and speaker |
| Real-time | Yes (live stream) | No (historical only) | Yes (live BGP speaker) |
| Output Format | C API, Python bindings | Rust, Python bindings | JSON, text, API calls |
| Docker Support | Community images | Community images | Official Dockerfile |
| License | Custom (CAIDA) | Apache 2.0 | GPLv3 |
Understanding BGP Data Sources
Before diving into tools, it is important to understand the data sources available for BGP analysis.
RIPE RIS — The RIPE NCC Routing Information Service collects BGP data from over 900 route collectors worldwide, providing near-real-time BGP update streams and periodic RIB (Routing Information Base) dumps.
RouteViews — The University of Oregon Route Views project operates BGP collectors across multiple vantage points, offering MRT format dumps and live update feeds.
MRT Format — The Multi-Threaded Routing Toolkit format is the standard for storing BGP routing tables and update messages. Both RIPE RIS and RouteViews publish data in MRT format.
BGPStream: CAIDA BGP Analysis Platform
BGPStream is a C library and CLI tool developed by CAIDA (Center for Applied Internet Data Analysis) at UC San Diego. It provides a unified interface for accessing both historical and live BGP data from multiple collectors.
Key Features
- Access to years of historical BGP data from RIPE RIS and RouteViews
- Live streaming of real-time BGP updates
- Python bindings (pybgpstream) for programmatic access
- Filterable queries by prefix, peer, timestamp, and collector
- Pre-built analysis tools for detecting route hijacks and leaks
Using BGPStream with Python
| |
Deploying BGPStream with Docker
| |
BGPStream CLI tool bgpstreamcli supports filtering by prefix, peer AS number, collector, and time range. The Python bindings (pybgpstream) enable building custom analysis pipelines for anomaly detection, prefix monitoring, and route visualization.
BGPKIT: Modern BGP Data Parsing in Rust
BGPKIT is a suite of Rust-based tools for parsing and analyzing BGP MRT data. It offers a modern, memory-safe alternative to BGPStream C codebase, with significantly faster parsing performance.
BGPKIT Parser
| |
BGPKIT Broker
The BGPKIT Broker provides an index of all available MRT files across RIPE RIS and RouteViews, with a REST API for discovering data files by time range, collector, and type.
| |
Python Integration
| |
Deploying BGPKIT with Docker Compose
| |
ExaBGP: Programmable BGP Speaker
ExaBGP is a Python-based BGP speaker that allows network operators to inject and receive BGP routes programmatically. Unlike BGPStream and BGPKIT which analyze historical data, ExaBGP establishes live BGP sessions with real routers.
ExaBGP Configuration
| |
Using ExaBGP for Route Monitoring
| |
ExaBGP is particularly valuable for testing BGP configurations before deploying to production routers, monitoring live BGP sessions with JSON-formatted route updates, injecting routes programmatically for traffic engineering or DDoS mitigation, and BGP blackholing where you announce routes to a null interface to drop attack traffic.
Deploying ExaBGP with Docker
| |
Why Self-Host BGP Analysis Tools?
Complete data access. Self-hosted BGP analysis gives you access to the full stream of BGP updates without rate limits or API quotas. Cloud-based BGP analysis services often throttle queries or limit historical data access to paid tiers.
Custom anomaly detection. By running your own BGP analysis pipeline, you can implement custom detection algorithms for route hijacks, MOAS (Multiple Origin Autonomous System) conflicts, and route leaks tailored to your network topology and risk tolerance.
Security research capabilities. BGPStream and BGPKIT enable researchers to study global routing patterns, measure the impact of RPKI deployment, and analyze the propagation of route changes across the Internet without relying on third-party data providers.
Network operations support. ExaBGP provides real-time visibility into BGP sessions, enabling automated route injection, blackhole signaling for DDoS mitigation, and integration with network management platforms like Prometheus and Grafana.
Regulatory compliance. For ISPs and network operators, maintaining independent BGP analysis capabilities supports regulatory requirements for routing transparency and incident reporting.
For BGP monitoring and looking glass setups, see our BGP monitoring guide. For broader network analysis, check our distributed tracing backends. For alerting on routing anomalies, our alert routing comparison covers it.
Choosing the Right BGP Analysis Tool
BGPStream is best for historical BGP analysis and academic research. Its Python bindings make it easy to build custom analysis scripts, and its access to CAIDA curated data ensures data quality. Ideal for security researchers and network analysts.
BGPKIT is the right choice for high-performance BGP data processing. Its Rust implementation delivers faster parsing than BGPStream C codebase, and the Broker API simplifies data discovery. Best for building production BGP analytics pipelines.
ExaBGP is essential for live BGP session management and testing. It is the only tool of the three that establishes real BGP sessions, making it invaluable for network operators who need to inject, monitor, or troubleshoot BGP routes in production environments.
FAQ
What is the difference between BGPStream and BGPKIT?
BGPStream provides a unified API for accessing both live and historical BGP data with built-in filtering. BGPKIT is a lower-level parsing library focused on speed and accuracy of MRT file parsing. BGPStream is better for exploratory analysis; BGPKIT is better for building high-throughput data pipelines.
Can ExaBGP replace a hardware router?
No. ExaBGP is a BGP speaker, not a full router. It can establish BGP sessions and exchange routes, but it does not perform packet forwarding. It is used alongside routers for monitoring, testing, and programmable route injection — not as a routing platform itself.
How do I detect BGP route hijacks?
Use BGPStream to monitor for MOAS (Multiple Origin AS) conflicts — when multiple autonomous systems announce the same prefix. A sudden origin change for a well-known prefix (especially large blocks like /8 or /16) is a strong indicator of a route hijack.
Does BGPKIT support real-time BGP data?
No. BGPKIT works with historical MRT files from RIPE RIS and RouteViews. For real-time BGP analysis, use BGPStream live streaming mode or ExaBGP live BGP session monitoring.
Is BGPStream free to use?
Yes. BGPStream is developed by CAIDA (UC San Diego) and is freely available for research and operational use. The data comes from public collectors (RIPE RIS, RouteViews) that publish their data openly.
What MRT files should I analyze first?
Start with RIB (Routing Information Base) dumps from a major collector like rrc00 (RIPE RIS) or route-views2 (RouteViews). RIB dumps contain the full routing table at a point in time and are easier to analyze than continuous update streams.