BMP and BMPaaS
By Aravind
Advantages of BMP
- A way in which monitoring station to get a complete set of dump of routes received from peer(s)
- All on going updates from the peer(s) are passed
- View of ADJ_RIB_IN along with
- Pre-policy (unprocessed routing information that has been advertised to the local BGP speaker by its peers. )
- Post-policy (The result of applying inbound policy to an Adj-RIB-In, but prior to the application of route selection to form the Loc-RIB)
- Very useful for network analysis
- BMP provides information about all paths not just the best path
- Initial set of routes present are wrapped in a BGP UPDATE message and passed
- Defined counters for prefixes (rejected, withdraws, advertisements, invalidated updates )
- Time stamping
- Peer up/down notifications and Stats reports
- Route Mirroring
- No misconfiguration such that it interferes with BGP routing
- Minimum configuration to monitor all families/routes
- Can use the same for IGP/Static routes
- Can leverage BGP-LS to advertise IGP information
- No need for screen scraping and easily publish updates for consumption
- Selective monitoring of peers based on configs
- Standard BGP policy methods applicable
Connection establishment
- Uses TCP
- All options are controlled on the router and no messages are sent from the monitoring station back to the monitored router.
- routers can talk to one or more monitoring stations
life cycle
- configure
- successful TCP connection and determine session is UP
- router to send BMP messages
- Initiation message
- Peer up message for each of its peer that is in established state
- Send ADJ_RIB_IN (pre/post/both policies)
- once the above is sent, send END_OF_RIB for each monitored peer
- send any incremental updates encapsulated in route monitoring messages4. Send stats message
- BMP session ends when TCP session is closed for any reason. Router may send Termination message prior to closing the session
Read RFC 7854 for more details and exact message formats and types.
Configure BMP
To configure and use BMP, there are 2 parts.
- Station
- Clients The connection between them can be either active/passive. BMP stations can behave as passive because it is not required to open connections. The clients can be active.
BMP Station config
root@crpd-749558787c-jmzmf> show configuration routing-options
bmp {
traceoptions {
file bmp.log size 3g;
flag event;
}
station SC-DISCOVERY {
local-port 17002;
station-address 10.244.0.0;
bmp-server;
kafka {
broker-address kafka:9092;
}
}
}
Here the kafka stanza is not mandatory. This is used if one needs to publish msgs on kafka to use BMPaaS. In this example, the station is running on a k8s cluster. The 10.244.0.0 is the flannel CNI subnet and all pods run on that. If you notice the next section where client config is mentioned, we would connect to the station using the nodePort exposed. This can also be simplified using a service IP (ingress VIP, metalLB VIP) The local-port
17002 is exposed on the node as 31002
.
BMP Client config
root@ob1> show configuration routing-options
autonomous-system 65500;
bmp {
station SC-DISCOVERY {
connection-mode active;
route-monitoring {
rib-out;
}
station-address 10.85.47.166;
station-port 31002;
}
}
Verify
root@crpd-749558787c-jmzmf> show bgp bmp
Station name: SC-DISCOVERY
Local address/port: -/17002, Station address/port: 10.244.0.0/-, passive
State: listening
Last state change: 1d 8:35:57
Hold-down: 600, flaps 3, period 300
Priority: low
BMP server: enabled
Clients count (current/max): 3/20
Version: 3
Routing Instance: default
Trace options: event
Trace file: /var/log//bmp.log size 3221225472 files 10
Kafka broker address: kafka:9092, status: Up, elapsed time: 17:22:18
BMP server connected clients:
Remote sysname: pe2 address/port: 10.244.1.1+50344, up time: 1d 8:35:47
Remote sysname: ob1 address/port: 10.244.1.1+17901, up time: 1d 8:35:44
Remote sysname: pe1 address/port: 10.244.1.1+44253, up time: 1d 8:35:42
BMP as a service
Sometimes you may want to use the BMP information for various purposes.
- monitor and publish data to be consumed by end systems
- convert and correlate the BGP related data into use case specific information The end system could include controllers, databases etc.
One example is to discover service chains. How can one use BGP as a means to discover service chains? The idea is to use BMP to advertise the service IPs of the service chain element based on a community value to the BMP station. The BMP station would further process this data and store them in a database. Finally a webUI or the controller can query this DB to fetch the details. The data stored consists of location of the BMP client and the service IP associated. Take a look at this repo for more information
[crpd
junos
mx
]
tags: crpd - junos - mx