Replace supported admonitions with rst directives
[docs.git] / docs / developer-guide / bgp-monitoring-protocol-developer-guide.rst
1 BGP Monitoring Protocol Developer Guide
2 =======================================
3
4 Overview
5 --------
6
7 This section provides an overview of **feature odl-bgpcep-bmp**. This
8 feature will install everything needed for BMP (BGP Monitoring Protocol)
9 including establishing the connection, processing messages, storing
10 information about monitored routers, peers and their Adj-RIB-In
11 (unprocessed routing information) and Post-Policy Adj-RIB-In and
12 displaying data in BGP RIBs overview. The OpenDaylight BMP plugin plays
13 the role of a monitoring station.
14
15 Key APIs and Interfaces
16 -----------------------
17
18 Session handling
19 ~~~~~~~~~~~~~~~~
20
21 *32-bmp.xml* defines only bmp-dispatcher the parser should be using
22 (global-bmp-extensions).
23
24 .. code:: xml
25
26      <module>
27       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-dispatcher-impl</type>
28       <name>global-bmp-dispatcher</name>
29        <bmp-extensions>
30         <type xmlns:bmp-spi="urn:opendaylight:params:xml:ns:yang:controller:bmp:spi">bmp-spi:extensions</type>
31         <name>global-bmp-extensions</name>
32        </bmp-extensions>
33        <boss-group>
34         <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">netty:netty-threadgroup</type>
35         <name>global-boss-group</name>
36        </boss-group>
37        <worker-group>
38         <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">netty:netty-threadgroup</type>
39         <name>global-worker-group</name>
40       </worker-group>
41      </module>
42
43 For user configuration of BMP, check User Guide.
44
45 Parser
46 ~~~~~~
47
48 The base BMP parser includes messages and attributes from
49 https://tools.ietf.org/html/draft-ietf-grow-bmp-15
50
51 Registration
52 ~~~~~~~~~~~~
53
54 All parsers and serializers need to be registered into *Extension
55 provider*. This *Extension provider* is configured in initial
56 configuration of the parser (*32-bmp.xml*).
57
58 .. code:: xml
59
60      <module>
61       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:spi">prefix:bmp-extensions-impl</type>
62       <name>global-bmp-extensions</name>
63       <extension>
64        <type xmlns:bmp-spi="urn:opendaylight:params:xml:ns:yang:controller:bmp:spi">bmp-spi:extension</type>
65        <name>bmp-parser-base</name>
66       </extension>
67      </module>
68
69 -  *bmp-parser-base* - will register parsers and serializers implemented
70    in bmp-impl module
71
72 Parsing
73 ~~~~~~~
74
75 Parsing of BMP elements is mostly done equally to BGP. Some of the BMP
76 messages includes wrapped BGP messages.
77
78 BMP Monitoring Station
79 ~~~~~~~~~~~~~~~~~~~~~~
80
81 The BMP application (Monitoring Station) serves as message processor
82 incoming from monitored routers. The processed message is transformed
83 and relevant information is stored. Route information is stored in a BGP
84 RIB data structure.
85
86 BMP data is displayed only through one URL that is accessible from the
87 base BMP URL:
88
89 *`http://<controllerIP>:8181/restconf/operational/bmp-monitor:bmp-monitor <http://<controllerIP>:8181/restconf/operational/bmp-monitor:bmp-monitor>`__*
90
91 Each Monitor station will be displayed and it may contains multiple
92 monitored routers and peers within:
93
94 .. code:: xml
95
96     <bmp-monitor xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor">
97      <monitor>
98      <monitor-id>example-bmp-monitor</monitor-id>
99       <router>
100       <router-id>127.0.0.11</router-id>
101        <status>up</status>
102        <peer>
103         <peer-id>20.20.20.20</peer-id>
104         <as>72</as>
105         <type>global</type>
106         <peer-session>
107          <remote-port>5000</remote-port>
108          <timestamp-sec>5</timestamp-sec>
109          <status>up</status>
110          <local-address>10.10.10.10</local-address>
111          <local-port>220</local-port>
112         </peer-session>
113         <pre-policy-rib>
114          <tables>
115           <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
116           <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
117           <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
118            <ipv4-route>
119             <prefix>10.10.10.0/24</prefix>
120              <attributes>
121               ...
122              </attributes>
123            </ipv4-route>
124           </ipv4-routes>
125           <attributes>
126            <uptodate>true</uptodate>
127           </attributes>
128          </tables>
129         </pre-policy-rib>
130         <address>10.10.10.10</address>
131         <post-policy-rib>
132          ...
133         </post-policy-rib>
134         <bgp-id>20.20.20.20</bgp-id>
135         <stats>
136          <timestamp-sec>5</timestamp-sec>
137          <invalidated-cluster-list-loop>53</invalidated-cluster-list-loop>
138          <duplicate-prefix-advertisements>16</duplicate-prefix-advertisements>
139          <loc-rib-routes>100</loc-rib-routes>
140          <duplicate-withdraws>11</duplicate-withdraws>
141          <invalidated-as-confed-loop>55</invalidated-as-confed-loop>
142          <adj-ribs-in-routes>10</adj-ribs-in-routes>
143          <invalidated-as-path-loop>66</invalidated-as-path-loop>
144          <invalidated-originator-id>70</invalidated-originator-id>
145          <rejected-prefixes>8</rejected-prefixes>
146         </stats>
147        </peer>
148        <name>name</name>
149        <description>description</description>
150        <info>some info;</info>
151       </router>
152      </monitor>
153     </bmp-monitor>
154     </source>
155
156 API Reference Documentation
157 ---------------------------
158
159 Javadocs are generated while creating mvn:site and they are located in
160 target/ directory in each module.
161