1 .. _bgp-monitoring-protocol-user-guide:
2 BGP Monitoring Protocol User Guide
3 ==================================
4 This guide contains information on how to use the OpenDaylight BGP Monitoring Protocol (BMP) plugin.
5 It covers BMP basic concepts, supported capabilities, configuration and operations.
13 This section provides high-level overview of the BMP plugin, OpenDaylight implementation and BMP usage for SDN.
15 .. contents:: Contents
19 BGP Monitoring Protocol
20 ^^^^^^^^^^^^^^^^^^^^^^^
21 The BGP Monitoring Protocol (BMP) serves to monitor BGP sessions.
22 The BMP can be used to obtain route view instead of screen scraping.
23 The BMP provides access to unprocessed routing information (Adj-RIB-In) and processed routes (applied inbound policy) of monitored router's peer.
24 In addition, monitored router can provide periodic dump of statistics.
26 The BMP runs over TCP.
27 Both monitored router and monitoring station can be configured as active or passive party of the connection.
28 The passive party listens at particular port.
29 The router can be monitored by multiple monitoring stations.
30 BMP messages are sent by monitored router only, monitoring station supposed to collect and process data received over BMP.
32 .. figure:: ./images/bgpcep/bmp.png
36 The BMP overview - Monitoring Station, Monitored Router and Monitored Peers.
41 The main concept of BMP is to monitor BGP sessions - monitoring station is aware of monitored peer's status, collects statistics and analyzes them in order to provide valuable information for network operators.
43 Moreover, BMP provides provides peer RIBs visibility, without need to establish BGP sessions.
44 Unprocessed routes may serve as a source of information for software-driven routing optimization.
45 In this case, SDN controller, a BMP monitoring station, collects routing information from monitored routers.
46 The routes are used in subsequent optimization procedures.
49 OpenDaylight BMP plugin
50 ^^^^^^^^^^^^^^^^^^^^^^^
51 The OpenDaylight BMP plugin provides monitoring station implementation.
52 The plugin can establish BMP session with one or more monitored routers in order to collect routing and statistical information.
54 * Runtime configurable monitoring station
55 * Read-only routes and statistics view
56 * Supports various routing information types
58 .. figure:: ./images/bgpcep/bmp-plugin.png
62 OpenDaylight BMP plugin overview.
64 .. important:: The BMP plugin is not storing historical data, it provides current snapshot only.
66 List of supported capabilities
67 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68 The BMP plugin implementation is based on Internet standards:
70 * `RFC7854 <https://tools.ietf.org/html/rfc7854>`_ - BGP Monitoring Protocol (BMP)
72 .. note:: The BMP plugin is capable to process various types of routing information (IP Unicast, EVPN, L3VPN, Link-State,...).
73 Please, see complete list in BGP user guide.
77 This section explains how to install BMP plugin.
79 1. Install BMP feature - ``odl-bgpcep-bmp``.
80 Also, for sake of this sample, it is required to install RESTCONF.
81 In the Karaf console, type command:
83 .. code-block:: console
85 feature:install odl-restconf odl-bgpcep-bmp
87 2. The BMP plugin contains a default configuration, which is applied after the feature starts up.
88 One instance of BMP monitoring station is created (named *example-bmp-monitor*), and its presence can be verified via REST:
90 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor``
98 <monitor xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor">
99 <monitor-id>example-bmp-monitor</monitor-id>
102 BMP Monitoring Station
103 ----------------------
104 The following section shows how to configure BMP basics, how to verify functionality and presents essential components of the plugin. Next samples demonstrate the plugin’s runtime configuration capability.
106 The monitoring station is responsible for received BMP PDUs processing and storage.
107 The default BMP server is listening at port *12345*.
109 .. contents:: Contents
115 This section shows the way to configure the BMP monitoring station via REST API.
117 .. warning:: The BMP monitoring station configuration is going to be changed in Carbon.
118 This user-guide will be updated accordingly.
120 Monitoring station configuration
121 ''''''''''''''''''''''''''''''''
122 In order to change default's BMP monitoring station configuration, use following request.
123 It is required to install ``odl-netconf-connector-ssh`` feature first.
125 **URL:** ``/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/config:module/odl-bmp-impl-cfg:bmp-monitor-impl/example-bmp-monitor``
129 **Content-Type:** ``application/xml``
135 :emphasize-lines: 4,5
137 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
138 <name>example-bmp-monitor</name>
139 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">x:bmp-monitor-impl</type>
140 <binding-port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">12355</binding-port>
141 <binding-address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">0.0.0.0</binding-address>
142 <bmp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
143 <type>bmp-dispatcher</type>
144 <name>global-bmp-dispatcher</name>
146 <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
147 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
148 <name>runtime-mapping-singleton</name>
149 </codec-tree-factory>
150 <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
151 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
152 <name>global-rib-extensions</name>
154 <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
155 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
156 <name>pingpong-broker</name>
160 @line 4: **binding-port** - The BMP server listening port.
162 @line 5: **binding-address** - The BMP server biding address.
164 .. note:: User may create multiple BMP monitoring station instances at runtime.
166 Active mode configuration
167 '''''''''''''''''''''''''
168 In order to enable active connection, use following request.
169 It is required to install ``odl-netconf-connector-ssh`` feature first.
171 **URL:** ``/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/config:module/odl-bmp-impl-cfg:bmp-monitor-impl/example-bmp-monitor``
175 **Content-Type:** ``application/xml``
181 :emphasize-lines: 23,24,25
183 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
184 <name>example-bmp-monitor</name>
185 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">x:bmp-monitor-impl</type>
186 <bmp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
187 <type>bmp-dispatcher</type>
188 <name>global-bmp-dispatcher</name>
190 <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
191 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
192 <name>runtime-mapping-singleton</name>
193 </codec-tree-factory>
194 <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
195 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
196 <name>global-rib-extensions</name>
198 <binding-address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">0.0.0.0</binding-address>
199 <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
200 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
201 <name>pingpong-broker</name>
203 <binding-port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">12345</binding-port>
204 <monitored-router xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
205 <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">10.10.10.10</address>
206 <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">1234</port>
207 <active xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">true</active>
211 @line 23: **address** - The monitored router's IP address.
213 @line 24: **port** - The monitored router's port.
215 @line 25: **active** - Active mode set.
217 .. note:: User may configure active session establishment for multiple monitored routers.
219 MD5 authentication configuration
220 ''''''''''''''''''''''''''''''''
221 In order to enable active connection, use following request.
222 It is required to install ``odl-netconf-connector-ssh`` feature first.
224 **URL:** ``/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/config:module/odl-bmp-impl-cfg:bmp-monitor-impl/example-bmp-monitor``
228 **Content-Type:** ``application/xml``
234 :emphasize-lines: 23,24
236 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
237 <name>example-bmp-monitor</name>
238 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">x:bmp-monitor-impl</type>
239 <bmp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
240 <type>bmp-dispatcher</type>
241 <name>global-bmp-dispatcher</name>
243 <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
244 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
245 <name>runtime-mapping-singleton</name>
246 </codec-tree-factory>
247 <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
248 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
249 <name>global-rib-extensions</name>
251 <binding-address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">0.0.0.0</binding-address>
252 <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
253 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
254 <name>pingpong-broker</name>
256 <binding-port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">12345</binding-port>
257 <monitored-router xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
258 <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">11.11.11.11</address>
259 <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">topsecret</password>
263 @line 23: **address** - The monitored router's IP address.
265 @line 24: **password** - The TCP MD5 signature.
270 .. code-block:: console
274 +--ro monitor* [monitor-id]
275 +--ro monitor-id monitor-id
276 +--ro router* [router-id]
278 +--ro description? string
280 +--ro router-id router-id
282 +--ro peer* [peer-id]
283 +--ro peer-id rib:peer-id
286 | +--ro distinguisher-type? distinguisher-type
287 | +--ro distinguisher? string
288 +--ro peer-distinguisher? union
289 +--ro address inet:ip-address
290 +--ro as inet:as-number
291 +--ro bgp-id inet:ipv4-address
292 +--ro router-distinguisher? string
294 | +--ro local-address inet:ip-address
295 | +--ro local-port inet:port-number
296 | +--ro remote-port inet:port-number
298 | | +--ro version? protocol-version
299 | | +--ro my-as-number? uint16
300 | | +--ro hold-timer uint16
301 | | +--ro bgp-identifier inet:ipv4-address
302 | | +--ro bgp-parameters*
303 | | +--ro optional-capabilities*
304 | | +--ro c-parameters
305 | | +--ro as4-bytes-capability
306 | | | +--ro as-number? inet:as-number
307 | | +--ro bgp-extended-message-capability!
308 | | +--ro multiprotocol-capability
309 | | | +--ro afi? identityref
310 | | | +--ro safi? identityref
311 | | +--ro graceful-restart-capability
312 | | | +--ro restart-flags bits
313 | | | +--ro restart-time uint16
314 | | | +--ro tables* [afi safi]
315 | | | +--ro afi identityref
316 | | | +--ro safi identityref
317 | | | +--ro afi-flags bits
318 | | +--ro add-path-capability
319 | | | +--ro address-families*
320 | | | +--ro afi? identityref
321 | | | +--ro safi? identityref
322 | | | +--ro send-receive? send-receive
323 | | +--ro route-refresh-capability!
324 | +--ro received-open
325 | | +--ro version? protocol-version
326 | | +--ro my-as-number? uint16
327 | | +--ro hold-timer uint16
328 | | +--ro bgp-identifier inet:ipv4-address
329 | | +--ro bgp-parameters*
330 | | +--ro optional-capabilities*
331 | | +--ro c-parameters
332 | | +--ro as4-bytes-capability
333 | | | +--ro as-number? inet:as-number
334 | | +--ro bgp-extended-message-capability!
335 | | +--ro multiprotocol-capability
336 | | | +--ro afi? identityref
337 | | | +--ro safi? identityref
338 | | +--ro graceful-restart-capability
339 | | | +--ro restart-flags bits
340 | | | +--ro restart-time uint16
341 | | | +--ro tables* [afi safi]
342 | | | +--ro afi identityref
343 | | | +--ro safi identityref
344 | | | +--ro afi-flags bits
345 | | +--ro add-path-capability
346 | | | +--ro address-families*
347 | | | +--ro afi? identityref
348 | | | +--ro safi? identityref
349 | | | +--ro send-receive? send-receive
350 | | +--ro route-refresh-capability!
352 | | +--ro string-information*
354 | | +--ro string-info? string
355 | +--ro status? status
356 | +--ro timestamp-sec? yang:timestamp
357 | +--ro timestamp-micro? yang:timestamp
359 | +--ro rejected-prefixes? yang:counter32
360 | +--ro duplicate-prefix-advertisements? yang:counter32
361 | +--ro duplicate-withdraws? yang:counter32
362 | +--ro invalidated-cluster-list-loop? yang:counter32
363 | +--ro invalidated-as-path-loop? yang:counter32
364 | +--ro invalidated-originator-id? yang:counter32
365 | +--ro invalidated-as-confed-loop? yang:counter32
366 | +--ro adj-ribs-in-routes? yang:gauge64
367 | +--ro loc-rib-routes? yang:gauge64
368 | +--ro per-afi-safi-adj-rib-in-routes
369 | | +--ro afi-safi* [afi safi]
370 | | +--ro afi identityref
371 | | +--ro safi identityref
372 | | +--ro count? yang:gauge64
373 | +--ro per-afi-safi-loc-rib-routes
374 | | +--ro afi-safi* [afi safi]
375 | | +--ro afi identityref
376 | | +--ro safi identityref
377 | | +--ro count? yang:gauge64
378 | +--ro updates-treated-as-withdraw? yang:counter32
379 | +--ro prefixes-treated-as-withdraw? yang:counter32
380 | +--ro duplicate-updates? yang:counter32
381 | +--ro timestamp-sec? yang:timestamp
382 | +--ro timestamp-micro? yang:timestamp
384 | +--ro tables* [afi safi]
385 | +--ro afi identityref
386 | +--ro safi identityref
388 | | +--ro uptodate? boolean
390 +--ro post-policy-rib
391 | +--ro tables* [afi safi]
392 | +--ro afi identityref
393 | +--ro safi identityref
395 | | +--ro uptodate? boolean
398 +--ro information? bmp-msg:mirror-information-code
399 +--ro timestamp-sec? yang:timestamp
400 +--ro timestamp-micro? yang:timestamp
405 The BMP plugin offers view of collected routes and statistical information from monitored peers.
406 To get top-level view of monitoring station:
408 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor``
416 :emphasize-lines: 3,5,11,12,13,14,15,17,20,21,22,27,33,50,53
418 <bmp-monitor xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor">
420 <monitor-id>example-bmp-monitor</monitor-id>
422 <router-id>10.10.10.10</router-id>
424 <description>monitored-router</description>
425 <info>monitored router;</info>
428 <peer-id>20.20.20.20</peer-id>
429 <address>20.20.20.20</address>
430 <bgp-id>20.20.20.20</bgp-id>
434 <remote-port>1790</remote-port>
435 <timestamp-sec>0</timestamp-sec>
437 <local-address>10.10.10.10</local-address>
438 <local-port>2200</local-port>
440 <hold-timer>180</hold-timer>
441 <my-as-number>65000</my-as-number>
442 <bgp-identifier>20.20.20.20</bgp-identifier>
445 <hold-timer>180</hold-timer>
446 <my-as-number>65000</my-as-number>
447 <bgp-identifier>65000</bgp-identifier>
452 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
453 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
454 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
456 <prefix>10.10.10.0/24</prefix>
463 <uptodate>true</uptodate>
471 <timestamp-sec>0</timestamp-sec>
472 <invalidated-cluster-list-loop>0</invalidated-cluster-list-loop>
473 <duplicate-prefix-advertisements>0</duplicate-prefix-advertisements>
474 <loc-rib-routes>100</loc-rib-routes>
475 <duplicate-withdraws>0</duplicate-withdraws>
476 <invalidated-as-confed-loop>0</invalidated-as-confed-loop>
477 <adj-ribs-in-routes>10</adj-ribs-in-routes>
478 <invalidated-as-path-loop>0</invalidated-as-path-loop>
479 <invalidated-originator-id>0</invalidated-originator-id>
480 <rejected-prefixes>8</rejected-prefixes>
487 @line 3: **monitor-id** - The BMP monitoring station instance identifier.
489 @line 5: **router-id** - The monitored router IP address, serves as an identifier.
491 @line 11: **peer-id** - The monitored peer's BGP identifier, serves a an identifier.
493 @line 12: **address** - The IP address of the peer, associated with the TCP session.
495 @line 13: **bgp-id** - The BGP Identifier of the peer.
497 @line 14: **as** - The Autonomous System number of the peer.
499 @line 15: **type** - Identifies type of the peer - *Global Instance*, *RD Instance* or *Local Instance*
501 @line 17: **remote-port** - The peer's port number associated with TCP session.
503 @line 20: **local-address** - The IP address of the monitored router associated with the peering TCP session.
505 @line 21: **local-port** - The port number of the monitored router associated with the peering TCP session.
507 @line 22: **received-open** - The full OPEN message received by monitored router from the peer.
509 @line 27: **sent-open** - The full OPEN message send by monitored router to the peer.
511 @line 33: **pre-policy-rib** - The Adj-RIB-In that contains unprocessed routing information.
513 @line 50: **post-policy-rib** - The Post-Policy Ad-RIB-In that contains routes filtered by inbound policy.
515 @line 53: **stats** - Contains various statistics, periodically updated by the router.
519 * To view collected information from particular monitored router:
520 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor/router/10.10.10.10``
522 * To view collected information from particular monitored peer:
523 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor/router/10.10.10.10/peer/20.20.20.20``
527 BMP test tool serves to test basic BMP functionality, scalability and performance.
531 The BMP mock is a stand-alone Java application purposed to simulate a BMP-enabled router(s) and peers.
532 The simulator is capable to report dummy routes and statistics.
533 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
535 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-bmp-mock``
539 The application can be run from command line:
541 .. code-block:: console
543 java -jar bgp-bmp-mock-*-executable.jar
546 with optional input parameters:
548 .. code-block:: console
550 --local_address <address> (optional, default 127.0.0.1)
551 The IPv4 address where BMP mock is bind to.
553 --remote_address <address:port> (optional, default 127.0.0.1:12345)
554 The remote IPv4 Address and port number of BMP monitoring station.
556 --passive (optional, not present by default)
557 This flags enables passive mode for simulated routers.
559 --routers_count <0..N> (optional, default 1)
560 An amount of BMP routers to be connected to the BMP monitoring station.
562 --peers_count <0..N> (optional, default 0)
563 An amount of peers reported by each BMP router.
565 --pre_policy_routes <0..N> (optional, default 0)
566 An amount of "pre-policy" simple IPv4 routes reported by each peer.
568 --post_policy_routes <0..N> (optional, default 0)
569 An amount of "post-policy" simple IPv4 routes reported by each peer.
571 --log_level <FATAL|ERROR|INFO|DEBUG|TRACE> (optional, default INFO)
572 Set logging level for BMP mock.
576 This section offers advices in a case OpenDaylight BMP plugin is not working as expected.
578 .. contents:: Contents
582 BMP is not working...
583 ^^^^^^^^^^^^^^^^^^^^^
584 * First of all, ensure that all required features are installed, local monitoring station and monitored router/peers configuration is correct.
586 To list all installed features in OpenDaylight use the following command at the Karaf console:
588 .. code-block:: console
592 * Check OpenDaylight Karaf logs:
596 .. code-block:: console
600 or open log file: ``data/log/karaf.log``
602 Possibly, a reason/hint for a cause of the problem can be found there.
604 * Try to minimize effect of other OpenDaylight features, when searching for a reason of the problem.
606 * Try to set DEBUG severity level for BMP logger via Karaf console commands, in order to collect more information:
608 .. code-block:: console
610 log:set DEBUG org.opendaylight.protocol.bmp
614 Before you report a bug, check `BGPCEP Bugzilla <https://bugs.opendaylight.org/buglist.cgi?list_id=65849&product=bgpcep&resolution=--->`_ to ensure same/similar bug is not already filed there.
616 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
618 #. State OpenDaylight version
620 #. Describe your use-case and provide as much details related to BMP as possible
622 #. Steps to reproduce
624 #. Attach Karaf log files, optionally packet captures, REST input/output