Vinit's Tech Blog

Life has meaning as long as you keep learning.

Deploying and Using BGP Monitoring Protocol (BMP)

BMP Overview

BGP Monitoring Protocol (BMP) as defined in RFC 7854 is a monitoring protocol which allows users to collect statistics and ADJ-RIB-In (contains unprocessed routing information that has been advertised to the local BGP speaker by its peers i.e. before the received routes are processed by the inbound route policy) of a peer on an ongoing basis along with other statistics from a BGP peer. BMP feature relies on the messages received by various monitored BGP sessions. Following types of messages are provided by BMP:

  • Route Monitoring (RM) : Used to provide an initial dump of all routes received from a peer, as well as an ongoing mechanism that sends the incremental routes advertised and withdrawn by a peer to the monitoring station.
  • Peer Down Notification : Message sent to indicate that the BGP session has gone down.
  • Peer Up Notification : Message sent to indicate that the BGP session has come up.
  • Stats Reports (SR) : An ongoing dump of statistics indicating the ongoing activity on the router.
  • Initiation : A means for monitored router to update about vendor, software version, etc.
  • Termination : A means for monitored router to update the reason on why the BMP server connection was terminated.
  • Route Mirroring : A means for the monitored router to send verbatim duplicates of messages as received. 


BMP Header

BMP information is carried to the monitoring tools using BMP message. Each BMP message has a common part of the header as shown in Figure 1. In this section of the header, the Version number is set to 3 (0-reserved, 1 and 2 were used in draft) and the message length is the combined length of BMP message in bytes which includes the headers, message data and encapsulated messages. The Message Type field is a 1-byte field which holds the following message type information:


  • Type = 0: Route Monitoring
  • Type = 1: Statistics Report
  • Type = 2: Peer Down Notification
  • Type = 3: Peer Up Notification
  • Type = 4: Initiation Message
  • Type = 5: Termination Message
  • Type = 6: Route Mirroring Message


   Figure 1 - Common BMP Message Header

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     |    Version    |
     |                        Message Length                         |
     |   Msg. Type   |

Further details about the BMP messages and their respective fields can be found in RFC 7854.


OPENBMP is an open source BMP server which is available to download via github OpenBMP page. The github page provides detailed information on how to install OpenBMP server. The OpenBMP server can be installed on Ubuntu 16.04 or Centos 6 / 7. Apart from a regular installation, users can deploy OpenBMP server as a container. Users can either run different containers for different features or they can run an All-in-One (AIO) OpenBMP container, which has a collector, kafka, mysql services running. Once AIO container is running, users can then install a UI container for the GUI based interface for viewing OpenBMP data and information.

#@@@Downloading Docker images

# docker pull openbmp/aio
# docker pull openbmp/ui

#@@@ Running the AIO container

# docker run -d --name=openbmp_aio -e KAFKA_FQDN= -e 
http_proxy= -e 
https_proxy= -e
ftp_proxy= -e 
no_proxy="localhost,,," -e 
-v /var/openbmp/mysql:/data/mysql -v /var/openbmp/config:/config -p 3306:3306 
-p 2181:2181 -p 9092:9092 -p 5000:5000 -p 8001:8001 openbmp/aio

#@@@ Running the OpenBMP UI

# docker run -d --name=openbmp_ui \
-p 8000:8000 \
Note: If you want to run the Docker images on Ubuntu, make sure to use Ubuntu 16.04, else the container will not work. 


BMP feature is support on IOS/IOS-XE, IOS-XR and NX-OS platforms. BMP server configuration is part of the BGP configuration. The configuration can be divided into two simple steps:

  1. Defining the BMP Server
  2. Assigning the BGP Server to a BGP neighbor

Example 1 illustrates the configuration of BMP Server on IOS-XE, IOS-XR and NX-OS platforms.

router bgp 65001
bmp server 1
address port-number 5000
neighbor remote-as 65001
neighbor bmp-activate server 1
neighbor update-source Loopback0
address-family ipv4
neighbor activate
neighbor send-community
router bgp 65001
bmp-server 1
address port 5000
address-family ipv4 unicast
bmp-activate-server 1
remote-as 65001
update-source loopback0
address-family ipv4 unicast
bmp server 1
host port 5000
router bgp 65001
bmp-activate server 1
update-source Loopback0
address-family ipv4 unicast

Note that the number of BMP servers that can be configured on each box are different. Up to 4 BMP servers are supported on IOS-XE platforms, 2 on NX-OS and up to 8 on IOS-XR. Also, when deploying BMP ensure that if the reachability of the BMP server is via management interface or L3 links part of global routing table or a particular VRF and accordingly configure source interface under BMP server configuration to reach the BMP server.

Once the BMP servers are configured and activated, the devices will establish a TCP session with the BMP server on port 5000 and start exchanging BMP messages. Example 2 shows the BMP session on the routers and the statistics of the exchanged messages.

XE-R7#show bgp ipv4 unicast bmp server summary
Number of BMP servers configured: 1
Number of BMP neighbors configured: 1
Number of neighbors on TransitionQ: 0, MonitoringQ: 0, ConfigQ: 0
Number of BMP servers on StatsQ: 0
BMP Refresh not in progress, refresh not scheduled
Initial Refresh Delay not configured
BMP buffer size not configured

ID Host/Net Port TCB Status Uptime MsgSent LastStat
1 5000 0x7F999F4953D0 Up 00:26:04 10

RP/0/0/CPU0:XR-R3#show bgp bmp server 1 detail
Tue Jul 9 18:26:38.345 UTC
BMP server 1
Host Port 5000
Connected for 00:00:10
Last Dosconnect event received : 21:40:13
Precedence: internet
BGP neighbors: 1
VRF: - (0x60000000)
Update Source: - (-)
Update Source Vrf ID: 0x0

Message Stats:
Total msgs dropped : 0
Total messages sent: 11
PER-PEER messages: 9

Messages pending: 0
Messages dropped: 0
Messages sent: 9


NX-R5# show bgp bmp server detail

BMP Global Information:

System Name : NX-R5
System Description : Nexus9000 9000v Chassis, Software Version 7.0(3)I7(6)

BMP Server Information:
BMP Server 1:
Server addr :
Port : 5000
Admin state : Up
Oper state : Up for 00:27:07
VRF : default
Update source : Ethernet1/5
Initial delay : 30 sec
Refresh Interval : 30 sec
Stats Interval : Disabled

Server Message Stats:
Initiation : 1
Termination : 0
Peer Up : 1
Peer Down : 0
Route Monitor : 1
Route Mirror : 0
Stats : 0
Messages Dropped : 0

Monitored peers: 1
Refresh Interval : 30 sec
Peer Up : 1
Peer Down : 0
Route Monitor : 1
Route Mirror : 0
Stats : 0
Messages Dropped : 0
Loc-RIB : 1

From the BMP Server perspective, you can either make a RESTful API call to the BMP server or if you are running a UI container for OpenBMP, then you can view the monitoring details using a browser on port 8000. Note that the default username and password is openbmp / CiscoRA.

Once logged in, users can have a global view of where the devices are actually located and also have a peer-view of the BMP monitored peers. In the below example, we picked up router XR-3, with router-id Notice that in the router peer diagram, we can see the different address-families being enabled for the peer router which is being monitored. In this, it is IPv4 and VPNv4 address-family. Further down, looking at the peer details tab, users can view all the details regarding the peer

Moving on to the Graphs tab, we can see more details about the peer and the prefix trends such as updates over time, withdraws, etc. over the period of time. In the below screenshot, we can see the number of withdraws on the router over a certain time interval.

On the Routing Table tab, users can view the prefixes being learnt on the router along with their Next-Hop, AS_PATH, MED and Local Preference values.

On clicking a particular prefix, more details are provided about the prefix such as the AS path it traversed through, the location from where the prefix is originated, etc.