BGPStream V2 adds several new features, including native support for true real-time data access via BMP and performance improvements. See the Changes section below for a summary and the GitHub releases page for details.
See the Live BMP Stream section below for help accessing the new realtime BMP stream.
Release available now. The V2 API is now stable and has been tested by many beta testers (including the ARTEMIS project). Click the button below to get started with BGPStream V2.
bgpreader -p ris-live
bgpreader and using
bgpreader -p routeviews-stream
bgpreader and using
cache-dir parameter of the "broker"
data interface. E.g., by passing
-o cache-dir=/path/to/cache to
bgpreader, or by calling
stream.set_data_interface_option("broker", "cache-dir", "/path/to/cache")
_pybgpstream, a low-level, almost
exact bindings to the libBGPStream C API.
collector route-views.sg and type ribs and prefix exact 22.214.171.124/24
would extract only RIB records matching the given prefix from the
filter parameter to the
BGPStream constructor, or by
method on an existing stream.
to return a borrowed pointer to an internal
record structure, rather than filling a
structure passed by the user.
fields attribute is now cached so
that subsequent field accesses do not needlessly rebuild
the entire fields dictionary.
method to extract origin ASN as simple integer. (Contributed by
-o <param>=<value> rather than
As part of the BGPStream project, we have begun to provide a public BMP feed. Currently we are only providing data from a few Route Views and Cisco Research peers, but we expect additional peers to be added soon. (If you would like to contribute a feed, please contact us at firstname.lastname@example.org.)
We are providing access to these feeds by way of a
publicly-accessible, read-only, Kafka cluster
bmp.bgpstream.caida.org:9092) which contains
raw BMP data encapsulated in a custom
(We plan to contribute the code we developed to generate
these headers back to the upstream OpenBMP repository.)
In this release, access to this live BMP feed is available via the broker data interface alongside
the traditional MRT-based data from Route Views and RIPE RIS.
This data has
caida-bmp as the project name, so can be filtered using the standard
project filters. See below for examples of how to use this interface.
Accessing the feed from BGPReader is as simple as choosing the "caida-bmp" project without time-window:
bgpreader -p caida-bmp
for elem in pybgpstream.BGPStream(project="caida-bmp"):
If you have a router that you would like to monitor using OpenBMP and BGPStream, you can use the dockerized OpenBMP deployment from the OpenBMP project, and then simply configure the "kafka" data interface of BGPStream to stream data from your collector.
You will first need to deploy and configure an OpenBMP collector and Kafka instance. The easiest way to do this is using the docker container provided by the OpenBMP project. See the OpenBMP documentation for a detailed tutorial. (You do not need to run any consumers to use OpenBMP with BGPStream.)
See the OpenBMP documentation for some sample router configurations.
See the BGPStream Install instructions for more information.
Use the "kafka" data interface of BGPStream, and configure it to point to your OpenBMP Kafka instance.
For example, if you are using the BGPReader CLI:
bgpreader -d kafka \
-o brokers=<docker_host>:9092 \
Or, if you are using the PyBGPStream Python API here is a minimal working example:
stream = pybgpstream.BGPStream(data_interface="kafka")
stream.set_data_interface_option("kafka", "brokers", "<docker_host>:9092")
stream.set_data_interface_option("kafka", "topic", "openbmp.bmp_raw")
for elem in stream: