3 releases

0.1.0 Jan 18, 2024
0.1.0-rc0 Jan 10, 2024
0.1.0-dev Oct 11, 2023

#1245 in Network programming


Used in roto

MPL-2.0 license

78KB
991 lines

BGP routing related tools

bmp-speaker

bmp-speaker is a command line tool that simulates an RFC 7854 BMP (BGP Monitoring Protocol) monitored router. The tool connects to a BMP monitoring station and then offers a REPL-like interface from which you can instruct it to send BMP protocol messages to the monitoring station.

The tool was created to aid with testing of BMP monitoring stations and assumes detailed knowledge of BMP message structure and content as well as the correct sequence in which the various BMP message types should be sent. It thus also allows sending BMP messages in the incorrect order and with logically inconsistent content. For example, sending a Peer Down Notification message without having first sent the corresponding Peer Up Notification message.

Disclaimer

The functionality availability is the subset that was needed by the authors until now. No guarantees are made about correctness of the messages produced or that RFC 7854 is fully implemented.

Contributions

Contributions and requests are welcome via GitHub pull requests and issues.

This tool uses some functionality from the NLnet Labs routecore crate with the intention that all BMP and BGP message construction should be done by that crate. Some contributions may therefore be better suited as contributions to the routecore repository rather than to this repository.

Installation

As bmp-speaker is not yet published to crates.io installation via cargo install requires that you point cargo to the bmp-speaker Git repository:

cargo install routes --bin bmp-speaker --git https://github.com/NLnetLabs/routes

Usage

bmp-speaker --server <BMP monitoring station ip or hostname>[:<port>]

Executing this command will drop you into the REPL from where you can instruct bmp-speaker to send BMP messages, for example:

> initiation my-sys-name "my-sys-desc long description"
> peer_up_notification global 0 10.0.0.1 12345 127.0.0.1 80 81 888 999 0 0
> route_monitoring global 0 10.0.0.1 12345 0 none "e [123,456,789] 10.0.0.1 BLACKHOLE,123:44 127.0.0.1/32"

One can also use the tool in a batch-like mode by storing the commands to send in a text file and piping them into the tool. Beware however that the tool exits when the input pipe is closed.

Note: RFC 7854 section 3.2 states that "No BMP message is ever sent from the monitoring station to the monitored router". As such there is no feedback from bmp-speaker about the messages it sends as it has no idea what the monitoring station does with them, if anything.

Documentation

TO DO

Dependencies

~11–21MB
~287K SLoC