Skip to content

JustinLoye/bgpflux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bgpflux

A Rust library and CLI tool for historical BGP data analysis.
Similar to bgpreader, it streams BGP elements in chronological order from:

  • Multiple RIPE RIS and RouteViews route collectors
  • Arbitrary time ranges
  • Both RIBs and updates

Features

  • High Performance: Built with Rust for maximum speed
  • Robust Ecosystem: Uses BGPKIT parser and broker
  • Streaming: Efficiently process BGP data on the fly without loading everything into memory
  • Caching: Optional local file caching to avoid re-downloading archive data

Installation

Add bgpflux to your Cargo.toml or install the CLI tool:

cargo install bgpflux

Quick Start

As a CLI Tool

Stream updates from specific collectors

bgpflux \
  --start "2010-09-01T00:00:00Z" \
  --end "2010-09-01T01:00:00Z" \
  --collectors route-views.wide,rrc04 \
  --data-type update

Stream RIB dumps

bgpflux \
  --start "2010-09-01T00:00:00Z" \
  --end "2010-09-01T01:00:00Z" \
  --collectors route-views.wide,rrc04 \
  --data-type rib

Stream both RIB and updates

bgpflux \
  --start "2010-09-01T00:00:00Z" \
  --end "2010-09-01T01:00:00Z" \
  --collectors route-views.wide,rrc04 \
  --data-type rib,update

Cache archive files

bgpflux \
  --start "2010-09-01T00:00:00Z" \
  --end "2010-09-01T01:00:00Z" \
  --collectors route-views.wide,rrc04 \
  --data-type update \
  --cache-dir cache

As a Library

use bgpflux::{BgpStream, BgpStreamConfig, DataType};

fn main() {
    let config = BgpStreamConfig::new(
        "2010-09-01T00:00:00Z",
        "2010-09-01T01:00:00Z",
        vec!["route-views.wide", "route-views.sydney"],
        DataType::Update,
    ).unwrap();

    let stream = BgpStream::new(config).build();

    for elem in stream {
        println!("{}", elem);
    }
}

Core Components

  • BgpStream: Main streaming interface that aggregates data from multiple collectors
  • BgpStreamConfig: Configuration for time ranges, collectors, and data types
  • BgpStreamElem: Represents a single BGP element with metadata

Acknowledgments

This project uses code adapted from:

Roadmap

  • filter support
  • live mode

About

BGP live and historical data preprocessing. Similar to BGPStream, but written in Rust on top of BGPKIT.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages