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/config/odl-bmp-monitor-config:odl-bmp-monitors/bmp-monitor-config/example-bmp-monitor``
98 <bmp-monitor-config xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor-config">
99 <monitor-id>example-bmp-monitor</monitor-id>
101 <binding-port>12345</binding-port>
102 <binding-address>0.0.0.0</binding-address>
104 </bmp-monitor-config>
106 BMP Monitoring Station
107 ----------------------
108 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.
110 The monitoring station is responsible for received BMP PDUs processing and storage.
111 The default BMP server is listening at port *12345*.
113 .. contents:: Contents
119 This section shows the way to configure the BMP monitoring station via REST API.
121 Monitoring station configuration
122 ''''''''''''''''''''''''''''''''
123 In order to change default's BMP monitoring station configuration, use following request.
125 **URL:** ``/restconf/config/odl-bmp-monitor-config:odl-bmp-monitors/bmp-monitor-config/example-bmp-monitor``
129 **Content-Type:** ``application/xml``
135 :emphasize-lines: 4,5
137 <bmp-monitor-config xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor-config">
138 <monitor-id>example-bmp-monitor</monitor-id>
140 <binding-port>12345</binding-port>
141 <binding-address>0.0.0.0</binding-address>
143 </bmp-monitor-config>
145 @line 4: **binding-port** - The BMP server listening port.
147 @line 5: **binding-address** - The BMP server biding address.
149 .. note:: User may create multiple BMP monitoring station instances at runtime.
151 Active mode configuration
152 '''''''''''''''''''''''''
153 In order to enable active connection, use following request.
155 **URL:** ``/restconf/config/odl-bmp-monitor-config:odl-bmp-monitors/bmp-monitor-config/example-bmp-monitor``
159 **Content-Type:** ``application/xml``
165 :emphasize-lines: 8,9,10
167 <bmp-monitor-config xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor-config">
168 <monitor-id>example-bmp-monitor</monitor-id>
170 <binding-port>12345</binding-port>
171 <binding-address>0.0.0.0</binding-address>
174 <address>192.0.2.2</address>
176 <active>true</active>
178 </bmp-monitor-config>
180 @line 8: **address** - The monitored router's IP address.
182 @line 9: **port** - The monitored router's port.
184 @line 10: **active** - Active mode set.
186 .. note:: User may configure active session establishment for multiple monitored routers.
188 MD5 authentication configuration
189 ''''''''''''''''''''''''''''''''
190 In order to enable active connection, use following request.
192 **URL:** ``/restconf/config/odl-bmp-monitor-config:odl-bmp-monitors/bmp-monitor-config/example-bmp-monitor``
196 **Content-Type:** ``application/xml``
202 :emphasize-lines: 8,9
204 <bmp-monitor-config xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor-config">
205 <monitor-id>example-bmp-monitor</monitor-id>
207 <binding-port>12345</binding-port>
208 <binding-address>0.0.0.0</binding-address>
211 <address>192.0.2.2</address>
212 <password>changeme</password>
214 </bmp-monitor-config>
216 @line 8: **address** - The monitored router's IP address.
218 @line 9: **password** - The TCP MD5 signature.
220 BMP Monitors Configuration Loader
221 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223 BMP Monitors Configuration Loader allows user to define static initial configuration for a BMP protocol instance.
224 This service will detect the creation of new configuration files following the pattern "odl-bmp-monitors-*.xml" under the path "etc/opendaylight/bgpcep".
225 Once the file is processed, the defined configuration will be available from the configuration Data Store.
227 .. note:: If the BMP Monitor instance is already present, no update or configuration will be applied.
229 **PATH:** ``etc/opendaylight/bgpcep/odl-bmp-monitors-config.xml``
233 <odl-bmp-monitors xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor-config">
235 <monitor-id>example-bmp-monitor</monitor-id>
237 <binding-port>12345</binding-port>
238 <binding-address>0.0.0.0</binding-address>
240 </bmp-monitor-config>
243 BMP Monitor Configuration Example
244 '''''''''''''''''''''''''''''''''
246 BGP provides a feature providing a BMP Monitor configuration file example.
247 Once feature is installed defined configuration will be loaded and setup.
249 .. code-block:: console
251 feature:install odl-bgpcep-bmp-config-example
256 .. code-block:: console
260 +--ro monitor* [monitor-id]
261 +--ro monitor-id monitor-id
262 +--ro router* [router-id]
264 +--ro description? string
266 +--ro router-id router-id
268 +--ro peer* [peer-id]
269 +--ro peer-id rib:peer-id
272 | +--ro distinguisher-type? distinguisher-type
273 | +--ro distinguisher? string
274 +--ro peer-distinguisher? union
275 +--ro address inet:ip-address
276 +--ro as inet:as-number
277 +--ro bgp-id inet:ipv4-address
278 +--ro router-distinguisher? string
280 | +--ro local-address inet:ip-address
281 | +--ro local-port inet:port-number
282 | +--ro remote-port inet:port-number
284 | | +--ro version? protocol-version
285 | | +--ro my-as-number? uint16
286 | | +--ro hold-timer uint16
287 | | +--ro bgp-identifier inet:ipv4-address
288 | | +--ro bgp-parameters*
289 | | +--ro optional-capabilities*
290 | | +--ro c-parameters
291 | | +--ro as4-bytes-capability
292 | | | +--ro as-number? inet:as-number
293 | | +--ro bgp-extended-message-capability!
294 | | +--ro multiprotocol-capability
295 | | | +--ro afi? identityref
296 | | | +--ro safi? identityref
297 | | +--ro graceful-restart-capability
298 | | | +--ro restart-flags bits
299 | | | +--ro restart-time uint16
300 | | | +--ro tables* [afi safi]
301 | | | +--ro afi identityref
302 | | | +--ro safi identityref
303 | | | +--ro afi-flags bits
304 | | +--ro add-path-capability
305 | | | +--ro address-families*
306 | | | +--ro afi? identityref
307 | | | +--ro safi? identityref
308 | | | +--ro send-receive? send-receive
309 | | +--ro route-refresh-capability!
310 | +--ro received-open
311 | | +--ro version? protocol-version
312 | | +--ro my-as-number? uint16
313 | | +--ro hold-timer uint16
314 | | +--ro bgp-identifier inet:ipv4-address
315 | | +--ro bgp-parameters*
316 | | +--ro optional-capabilities*
317 | | +--ro c-parameters
318 | | +--ro as4-bytes-capability
319 | | | +--ro as-number? inet:as-number
320 | | +--ro bgp-extended-message-capability!
321 | | +--ro multiprotocol-capability
322 | | | +--ro afi? identityref
323 | | | +--ro safi? identityref
324 | | +--ro graceful-restart-capability
325 | | | +--ro restart-flags bits
326 | | | +--ro restart-time uint16
327 | | | +--ro tables* [afi safi]
328 | | | +--ro afi identityref
329 | | | +--ro safi identityref
330 | | | +--ro afi-flags bits
331 | | +--ro add-path-capability
332 | | | +--ro address-families*
333 | | | +--ro afi? identityref
334 | | | +--ro safi? identityref
335 | | | +--ro send-receive? send-receive
336 | | +--ro route-refresh-capability!
338 | | +--ro string-information*
340 | | +--ro string-info? string
341 | +--ro status? status
342 | +--ro timestamp-sec? yang:timestamp
343 | +--ro timestamp-micro? yang:timestamp
345 | +--ro rejected-prefixes? yang:counter32
346 | +--ro duplicate-prefix-advertisements? yang:counter32
347 | +--ro duplicate-withdraws? yang:counter32
348 | +--ro invalidated-cluster-list-loop? yang:counter32
349 | +--ro invalidated-as-path-loop? yang:counter32
350 | +--ro invalidated-originator-id? yang:counter32
351 | +--ro invalidated-as-confed-loop? yang:counter32
352 | +--ro adj-ribs-in-routes? yang:gauge64
353 | +--ro loc-rib-routes? yang:gauge64
354 | +--ro per-afi-safi-adj-rib-in-routes
355 | | +--ro afi-safi* [afi safi]
356 | | +--ro afi identityref
357 | | +--ro safi identityref
358 | | +--ro count? yang:gauge64
359 | +--ro per-afi-safi-loc-rib-routes
360 | | +--ro afi-safi* [afi safi]
361 | | +--ro afi identityref
362 | | +--ro safi identityref
363 | | +--ro count? yang:gauge64
364 | +--ro updates-treated-as-withdraw? yang:counter32
365 | +--ro prefixes-treated-as-withdraw? yang:counter32
366 | +--ro duplicate-updates? yang:counter32
367 | +--ro timestamp-sec? yang:timestamp
368 | +--ro timestamp-micro? yang:timestamp
370 | +--ro tables* [afi safi]
371 | +--ro afi identityref
372 | +--ro safi identityref
374 | | +--ro uptodate? boolean
376 +--ro post-policy-rib
377 | +--ro tables* [afi safi]
378 | +--ro afi identityref
379 | +--ro safi identityref
381 | | +--ro uptodate? boolean
384 +--ro information? bmp-msg:mirror-information-code
385 +--ro timestamp-sec? yang:timestamp
386 +--ro timestamp-micro? yang:timestamp
391 The BMP plugin offers view of collected routes and statistical information from monitored peers.
392 To get top-level view of monitoring station:
394 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor``
402 :emphasize-lines: 3,5,11,12,13,14,15,17,20,21,22,27,33,50,53
404 <bmp-monitor xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor">
406 <monitor-id>example-bmp-monitor</monitor-id>
408 <router-id>10.10.10.10</router-id>
410 <description>monitored-router</description>
411 <info>monitored router;</info>
414 <peer-id>20.20.20.20</peer-id>
415 <address>20.20.20.20</address>
416 <bgp-id>20.20.20.20</bgp-id>
420 <remote-port>1790</remote-port>
421 <timestamp-sec>0</timestamp-sec>
423 <local-address>10.10.10.10</local-address>
424 <local-port>2200</local-port>
426 <hold-timer>180</hold-timer>
427 <my-as-number>65000</my-as-number>
428 <bgp-identifier>20.20.20.20</bgp-identifier>
431 <hold-timer>180</hold-timer>
432 <my-as-number>65000</my-as-number>
433 <bgp-identifier>65000</bgp-identifier>
438 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
439 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
440 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
442 <prefix>10.10.10.0/24</prefix>
449 <uptodate>true</uptodate>
457 <timestamp-sec>0</timestamp-sec>
458 <invalidated-cluster-list-loop>0</invalidated-cluster-list-loop>
459 <duplicate-prefix-advertisements>0</duplicate-prefix-advertisements>
460 <loc-rib-routes>100</loc-rib-routes>
461 <duplicate-withdraws>0</duplicate-withdraws>
462 <invalidated-as-confed-loop>0</invalidated-as-confed-loop>
463 <adj-ribs-in-routes>10</adj-ribs-in-routes>
464 <invalidated-as-path-loop>0</invalidated-as-path-loop>
465 <invalidated-originator-id>0</invalidated-originator-id>
466 <rejected-prefixes>8</rejected-prefixes>
473 @line 3: **monitor-id** - The BMP monitoring station instance identifier.
475 @line 5: **router-id** - The monitored router IP address, serves as an identifier.
477 @line 11: **peer-id** - The monitored peer's BGP identifier, serves a an identifier.
479 @line 12: **address** - The IP address of the peer, associated with the TCP session.
481 @line 13: **bgp-id** - The BGP Identifier of the peer.
483 @line 14: **as** - The Autonomous System number of the peer.
485 @line 15: **type** - Identifies type of the peer - *Global Instance*, *RD Instance* or *Local Instance*
487 @line 17: **remote-port** - The peer's port number associated with TCP session.
489 @line 20: **local-address** - The IP address of the monitored router associated with the peering TCP session.
491 @line 21: **local-port** - The port number of the monitored router associated with the peering TCP session.
493 @line 22: **received-open** - The full OPEN message received by monitored router from the peer.
495 @line 27: **sent-open** - The full OPEN message send by monitored router to the peer.
497 @line 33: **pre-policy-rib** - The Adj-RIB-In that contains unprocessed routing information.
499 @line 50: **post-policy-rib** - The Post-Policy Ad-RIB-In that contains routes filtered by inbound policy.
501 @line 53: **stats** - Contains various statistics, periodically updated by the router.
505 * To view collected information from particular monitored router:
506 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor/router/10.10.10.10``
508 * To view collected information from particular monitored peer:
509 **URL:** ``/restconf/operational/bmp-monitor:bmp-monitor/monitor/example-bmp-monitor/router/10.10.10.10/peer/20.20.20.20``
513 BMP test tool serves to test basic BMP functionality, scalability and performance.
517 The BMP mock is a stand-alone Java application purposed to simulate a BMP-enabled router(s) and peers.
518 The simulator is capable to report dummy routes and statistics.
519 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
521 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-bmp-mock``
525 The application can be run from command line:
527 .. code-block:: console
529 java -jar bgp-bmp-mock-*-executable.jar
532 with optional input parameters:
534 .. code-block:: console
536 --local_address <address> (optional, default 127.0.0.1)
537 The IPv4 address where BMP mock is bind to.
539 -ra <IP_ADDRESS:PORT,...>, --remote_address <IP_ADDRESS:PORT,...>
540 A list of IP addresses of BMP monitoring station, by default 127.0.0.1:12345.
542 --passive (optional, not present by default)
543 This flags enables passive mode for simulated routers.
545 --routers_count <0..N> (optional, default 1)
546 An amount of BMP routers to be connected to the BMP monitoring station.
548 --peers_count <0..N> (optional, default 0)
549 An amount of peers reported by each BMP router.
551 --pre_policy_routes <0..N> (optional, default 0)
552 An amount of "pre-policy" simple IPv4 routes reported by each peer.
554 --post_policy_routes <0..N> (optional, default 0)
555 An amount of "post-policy" simple IPv4 routes reported by each peer.
557 --log_level <FATAL|ERROR|INFO|DEBUG|TRACE> (optional, default INFO)
558 Set logging level for BMP mock.
562 This section offers advices in a case OpenDaylight BMP plugin is not working as expected.
564 .. contents:: Contents
568 BMP is not working...
569 ^^^^^^^^^^^^^^^^^^^^^
570 * First of all, ensure that all required features are installed, local monitoring station and monitored router/peers configuration is correct.
572 To list all installed features in OpenDaylight use the following command at the Karaf console:
574 .. code-block:: console
578 * Check OpenDaylight Karaf logs:
582 .. code-block:: console
586 or open log file: ``data/log/karaf.log``
588 Possibly, a reason/hint for a cause of the problem can be found there.
590 * Try to minimize effect of other OpenDaylight features, when searching for a reason of the problem.
592 * Try to set DEBUG severity level for BMP logger via Karaf console commands, in order to collect more information:
594 .. code-block:: console
596 log:set DEBUG org.opendaylight.protocol.bmp
600 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.
602 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
604 #. State OpenDaylight version
606 #. Describe your use-case and provide as much details related to BMP as possible
608 #. Steps to reproduce
610 #. Attach Karaf log files, optionally packet captures, REST input/output