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 pybgpstream
.
bgpreader -p routeviews-stream
bgpreader
and using pybgpstream
.
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")
from PyBGPStream.
_pybgpstream
, a low-level, almost
exact bindings to the libBGPStream C API.
collector route-views.sg and type ribs and prefix exact 192.172.226.0/24
would extract only RIB records matching the given prefix from the route-views.sg
collector.
-f
option.
filter
parameter to the
BGPStream
constructor, or by
calling the parse_filter_string
method on an existing stream.
caida/bgpstream
on
DockerHub.
get_next_record
API
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.bgpstream_pfx_copy
methodbgpstream_as_path_get_origin_val
method to extract origin ASN as simple integer. (Contributed by
Samir Al-Sheikh.)-o <param>=<value>
rather than
-o <param>,<value>
.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 bgpstream-info@caida.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
OpenBMP
message header.
(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
import pybgpstream
for elem in pybgpstream.BGPStream(project="caida-bmp"):
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)
We appreciate your support of this project, and your willingness to help us test the next version. Please create an issue on either the libBGPStream or PyBGPStream GitHub repos detailing any problems you have, or alternatively, contact bgpstream-info@caida.org.