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