Over the last several years, we have been working on a new release of BGPStream. This version contains several new features including native support for true real-time data access via BMP, as well as a bunch of bug fixes, and performance improvements. See the Changes section below for a more detailed list.
See the Live BMP Stream section below for help accessing the new realtime BMP stream.
Pre-release available now. The V2 API is now stable and has been tested by many beta testers (including the ARTEMIS project). We're still working on ironing out some lingering stability issues with the RIS Live stream, but in the meantime we have made the first public release of the V2 series (Release Candidate 2). Click the button below to get started with BGPStream V2.
bgpreader -p ris-live
cache-dirparameter of the "broker" data interface. E.g., by passing
bgpreader, or by calling
stream.set_data_interface_option("broker", "cache-dir", "/path/to/cache")from PyBGPStream.
_pybgpstream, a low-level, almost exact bindings to the libBGPStream C API.
collector route-views.sg and type ribs and prefix exact 18.104.22.168/24would extract only RIB records matching the given prefix from the
filterparameter to the
BGPStreamconstructor, or by calling the
parse_filter_stringmethod on an existing stream.
get_next_recordAPI to return a borrowed pointer to an internal record structure, rather than filling a structure passed by the user.
fieldsattribute is now cached so that subsequent field accesses do not needlessly rebuild the entire fields dictionary.
bgpstream_as_path_get_origin_valmethod to extract origin ASN as simple integer. (Contributed by Samir Al-Sheikh.)
-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 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" project without time-window:
bgpreader -p caida
import pybgpstream for elem in pybgpstream.BGPStream(project="caida"): print(elem)
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 \ -o topic=openbmp.bmp_raw
Or, if you are using the PyBGPStream Python API here is a minimal working example:
import pybgpstream 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: print(elem)
In BGPStream version 2, we added the support for streaming directly from RIPE RIS-Live. RIS-Live is a streaming service that offers real-time BGP messages collected from all RIPE RIS Route Collectors (RRCs).
Using ris-live stream is super easy. You just need to start a stream with no time-interval specified, and use "ris-live" as the project for the stream.
If you want to use BGPReader to access the stream, just do
bgpreader -p ris-live. That's it!