Use reference on release notes
[docs.git] / docs / user-guide / bgpcep-guide / bgp / bgp-user-guide-topology-provider.rst
1 .. _bgp-user-guide-topology-provider:
2
3 Topology Provider
4 =================
5 This section provides an overview of the BGP topology provider service.
6 It shows how to configure and use all available BGP topology providers.
7 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
8 Output topologies are rendered in a form of standardised IETF network topology model.
9
10 .. contents:: Contents
11    :depth: 2
12    :local:
13
14 Inet Reachability Topology
15 ^^^^^^^^^^^^^^^^^^^^^^^^^^
16 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
17
18 Configuration
19 '''''''''''''
20 Following example shows how to create a new instance of IPv4 BGP topology exporter:
21
22 **URL:** ``/restconf/config/network-topology:network-topology``
23
24 **Method:** ``POST``
25
26 **Content-Type:** ``application/xml``
27
28 **Request Body:**
29
30 .. code-block:: xml
31    :linenos:
32    :emphasize-lines: 2,4,6
33
34    <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
35        <topology-id>bgp-example-ipv4-topology</topology-id>
36        <topology-types>
37            <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
38        </topology-types>
39        <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
40    </topology>
41
42 @line 2: An identifier for a topology.
43
44 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
45
46 @line 6: A name of the local BGP speaker instance.
47
48 -----
49
50 The topology exporter instance can be removed in a following way:
51
52 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
53
54 **Method:** ``DELETE``
55
56 -----
57
58 Following example shows how to create a new instance of IPv6 BGP topology exporter:
59
60 **URL:** ``/restconf/config/network-topology:network-topology``
61
62 **Method:** ``POST``
63
64 **Content-Type:** ``application/xml``
65
66 **Request Body:**
67
68 .. code-block:: xml
69
70    <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
71        <topology-id>bgp-example-ipv6-topology</topology-id>
72        <topology-types>
73            <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
74        </topology-types>
75        <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
76    </topology>
77
78 Usage
79 '''''
80 Operational state of the topology can be verified via REST:
81
82 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
83
84 **Method:** ``GET``
85
86 **Response Body:**
87
88 .. code-block:: xml
89    :linenos:
90    :emphasize-lines: 8,11
91
92    <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
93        <topology-id>bgp-example-ipv4-topology</topology-id>
94        <server-provided>true</server-provided>
95        <topology-types>
96            <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
97        </topology-types>
98        <node>
99            <node-id>10.10.1.1</node-id>
100            <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
101                <prefix>
102                    <prefix>10.0.0.10/32</prefix>
103                </prefix>
104            </igp-node-attributes>
105        </node>
106    </topology>
107
108 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
109
110 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
111
112 BGP Linkstate Topology
113 ^^^^^^^^^^^^^^^^^^^^^^
114 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
115
116 Configuration
117 '''''''''''''
118 Following example shows how to create a new instance of linkstate BGP topology exporter:
119
120 **URL:** ``/restconf/config/network-topology:network-topology``
121
122 **Method:** ``POST``
123
124 **Content-Type:** ``application/xml``
125
126 **Request Body:**
127
128 .. code-block:: xml
129
130    <topology  xmlns="urn:TBD:params:xml:ns:yang:network-topology">
131        <topology-id>bgp-example-linkstate-topology</topology-id>
132        <topology-types>
133            <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
134        </topology-types>
135        <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
136    </topology>
137
138 Usage
139 '''''
140 Operational state of the topology can be verified via REST.
141 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
142
143 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
144
145 **Method:** ``GET``
146
147 **Response Body:**
148
149 .. code-block:: xml
150
151    <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
152        <topology-id>bgp-example-linkstate-topology</topology-id>
153        <server-provided>true</server-provided>
154        <topology-types>
155            <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
156        </topology-types>
157        <node>
158            <node-id>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0040</node-id>
159            <termination-point>
160                <tp-id>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.40</tp-id>
161                <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
162            </termination-point>
163            <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
164                <prefix>
165                    <prefix>40.40.40.40/32</prefix>
166                    <metric>10</metric>
167                </prefix>
168                <prefix>
169                    <prefix>203.20.160.0/24</prefix>
170                    <metric>10</metric>
171                </prefix>
172                <name>node1</name>
173                <router-id>40.40.40.40</router-id>
174                <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
175                    <ted>
176                        <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
177                    </ted>
178                    <iso>
179                        <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
180                    </iso>
181                </isis-node-attributes>
182            </igp-node-attributes>
183        </node>
184        <node>
185            <node-id>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0039</node-id>
186            <termination-point>
187                <tp-id>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.39</tp-id>
188                <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
189            </termination-point>
190            <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
191                <prefix>
192                    <prefix>39.39.39.39/32</prefix>
193                    <metric>10</metric>
194                </prefix>
195                <prefix>
196                    <prefix>203.20.160.0/24</prefix>
197                    <metric>10</metric>
198                </prefix>
199                <name>node2</name>
200                <router-id>39.39.39.39</router-id>
201                <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
202                    <ted>
203                        <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
204                    </ted>
205                    <iso>
206                        <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
207                    </iso>
208                </isis-node-attributes>
209            </igp-node-attributes>
210        </node>
211        <link>
212            <destination>
213                <dest-node>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0039</dest-node>
214                <dest-tp>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.39</dest-tp>
215            </destination>
216            <link-id>bgpls://IsisLevel2:1/type=link&amp;local-as=65000&amp;local-domain=673720360&amp;local-router=0000.0000.0040&amp;remote-as=65000&amp;remote-domain=673720360&amp;remote-router=0000.0000.0039&amp;ipv4-iface=203.20.160.40&amp;ipv4-neigh=203.20.160.39</link-id>
217            <source>
218                <source-node>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0040</source-node>
219                <source-tp>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.40</source-tp>
220            </source>
221            <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
222                <metric>10</metric>
223                <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
224                    <ted>
225                        <color>0</color>
226                        <max-link-bandwidth>1250000.0</max-link-bandwidth>
227                        <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
228                        <te-default-metric>0</te-default-metric>
229                        <unreserved-bandwidth>
230                            <bandwidth>12500.0</bandwidth>
231                            <priority>0</priority>
232                        </unreserved-bandwidth>
233                        <unreserved-bandwidth>
234                            <bandwidth>12500.0</bandwidth>
235                            <priority>1</priority>
236                        </unreserved-bandwidth>
237                        <unreserved-bandwidth>
238                            <bandwidth>12500.0</bandwidth>
239                            <priority>2</priority>
240                        </unreserved-bandwidth>
241                        <unreserved-bandwidth>
242                            <bandwidth>12500.0</bandwidth>
243                            <priority>3</priority>
244                        </unreserved-bandwidth>
245                        <unreserved-bandwidth>
246                            <bandwidth>12500.0</bandwidth>
247                            <priority>4</priority>
248                        </unreserved-bandwidth>
249                        <unreserved-bandwidth>
250                            <bandwidth>12500.0</bandwidth>
251                            <priority>5</priority>
252                        </unreserved-bandwidth>
253                        <unreserved-bandwidth>
254                            <bandwidth>12500.0</bandwidth>
255                            <priority>6</priority>
256                        </unreserved-bandwidth>
257                        <unreserved-bandwidth>
258                            <bandwidth>12500.0</bandwidth>
259                            <priority>7</priority>
260                        </unreserved-bandwidth>
261                    </ted>
262                </isis-link-attributes>
263            </igp-link-attributes>
264        </link>
265        <link>
266            <destination>
267                <dest-node>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0040</dest-node>
268                <dest-tp>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.40</dest-tp>
269            </destination>
270            <link-id>bgpls://IsisLevel2:1/type=link&amp;local-as=65000&amp;local-domain=673720360&amp;local-router=0000.0000.0039&amp;remote-as=65000&amp;remote-domain=673720360&amp;remote-router=0000.0000.0040&amp;ipv4-iface=203.20.160.39&amp;ipv4-neigh=203.20.160.40</link-id>
271            <source>
272                <source-node>bgpls://IsisLevel2:1/type=node&amp;as=65000&amp;domain=673720360&amp;router=0000.0000.0039</source-node>
273                <source-tp>bgpls://IsisLevel2:1/type=tp&amp;ipv4=203.20.160.39</source-tp>
274            </source>
275            <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
276                <metric>10</metric>
277                <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
278                    <ted>
279                        <color>0</color>
280                        <max-link-bandwidth>1250000.0</max-link-bandwidth>
281                        <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
282                        <te-default-metric>0</te-default-metric>
283                        <unreserved-bandwidth>
284                            <bandwidth>12500.0</bandwidth>
285                            <priority>0</priority>
286                        </unreserved-bandwidth>
287                        <unreserved-bandwidth>
288                            <bandwidth>12500.0</bandwidth>
289                            <priority>1</priority>
290                        </unreserved-bandwidth>
291                        <unreserved-bandwidth>
292                            <bandwidth>12500.0</bandwidth>
293                            <priority>2</priority>
294                        </unreserved-bandwidth>
295                        <unreserved-bandwidth>
296                            <bandwidth>12500.0</bandwidth>
297                            <priority>3</priority>
298                        </unreserved-bandwidth>
299                        <unreserved-bandwidth>
300                            <bandwidth>12500.0</bandwidth>
301                            <priority>4</priority>
302                        </unreserved-bandwidth>
303                        <unreserved-bandwidth>
304                            <bandwidth>12500.0</bandwidth>
305                            <priority>5</priority>
306                        </unreserved-bandwidth>
307                        <unreserved-bandwidth>
308                            <bandwidth>12500.0</bandwidth>
309                            <priority>6</priority>
310                        </unreserved-bandwidth>
311                        <unreserved-bandwidth>
312                            <bandwidth>12500.0</bandwidth>
313                            <priority>7</priority>
314                        </unreserved-bandwidth>
315                    </ted>
316                </isis-link-attributes>
317            </igp-link-attributes>
318        </link>
319    </topology>
320
321 BGP Network Topology Configuration Loader
322 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
323
324 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
325 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgpcep".
326 Once the file is processed, the defined configuration will be available from the configuration Data Store.
327
328 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
329
330 **PATH:** ``etc/opendaylight/bgpcep/network-topology-config.xml``
331
332 .. code-block:: xml
333
334     <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
335         <topology>
336             <topology-id>example-ipv4-topology</topology-id>
337             <topology-types>
338                 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
339             </topology-types>
340             <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
341         </topology>
342         <topology>
343             <topology-id>example-ipv6-topology</topology-id>
344             <topology-types>
345                 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
346             </topology-types>
347             <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
348         </topology>
349         <topology>
350             <topology-id>example-linkstate-topology</topology-id>
351             <topology-types>
352                 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
353             </topology-types>
354             <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
355         </topology>
356     </network-topology>