First complete pass over User Guide
[docs.git] / manuals / user-guide / src / main / asciidoc / bgpcep / odl-bgpcep-bgp-all-user.adoc
1 == BGP User Guide ==
2
3 === Overview ===
4 The OpenDaylight Karaf distribution comes pre-configured with baseline BGP
5 configuration. You can find it in the etc/opendaylight/karaf directory and it
6 consists of two files:
7
8 - *31-bgp.xml* (defines the basic parser and RIB support)
9 - *41-bgp-example.xml* (which contains a sample configuration which needs to be
10   customized to your deployment)
11
12 The next sections will describe how to configure BGP manually or using RESTCONF.
13
14 === Configuring BGP ===
15
16 ==== RIB ====
17 [source,xml]
18 ----
19 <module>
20     <type>prefix:rib-impl</type>
21     <name>example-bgp-rib</name>
22     <rib-id>example-bgp-rib</rib-id>
23     <local-as>64496</local-as>
24     <bgp-id>192.0.2.2</bgp-id>
25     <cluster-id>192.0.2.3</cluster-id>
26     ...
27 </module>
28 ----
29
30 - *rib-id* - BGP RIB Identifier, in this configuration file you can specify more BGP RIBs by
31 copy-pasting the above module. These RIBs must have a unique rib-id and name.
32 - *local-as* - Our local AS number (where OpenDaylight is deployed), we use this in best path selection
33 - *bgp-id* - Our local BGP identifier (the IP of the VM where OpenDaylight is deployed),
34 we use this in best path selection.
35 - *cluster-id* - Cluster Identifier, non-mandatory, if not specified, BGP Identifier will be used
36
37 MIGHT NOT BE NEEDED: depending on your BGP router, you might need to switch from
38 linkstate attribute type 99 to 29. Check with your router vendor. Change the
39 field iana-linkstate-attribute-type to true if your router supports type 29.
40 This snippet is located in 31-bgp.xml file.
41
42 [source,xml]
43 ----
44 <module>
45  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">prefix:bgp-linkstate</type>
46  <name>bgp-linkstate</name>
47  <iana-linkstate-attribute-type>true</iana-linkstate-attribute-type>
48 </module>
49 ----
50
51 - *iana-linkstate-attribute-type* - IANA has issued an early allocation for the
52 BGP Linkstate path attribute (=29). To preserve (TYPE = 99) set value bellow
53 to false; to use IANA assigned type set the value to true or remove it as it's true by default.
54
55 ==== BGP Peer ====
56
57 The initial configuration is written so that it will be ignored to prevent the
58 client from starting with default configuration. Therefore the first step is to
59 uncomment the module containing bgp-peer.
60
61 [source,xml]
62 ----
63 <module>
64  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
65  <name>example-bgp-peer</name>
66  <host>192.0.2.1</host>
67  <holdtimer>180</holdtimer>
68  <peer-role>ibgp</peer-role>
69  <rib>
70   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:cfg">prefix:rib</type>
71   <name>example-bgp-rib</name>
72  </rib>
73  ...
74 </module>
75 ----
76
77 - *name* - BGP Peer name, in this configuration file you can specify more BGP Peers by copy-pasting the above module. These peers must have a *unique* name.
78 - *host* - IP address or hostname of BGP speaker (IP where OpenDaylight should connect to gather topology)
79 - *holdtimer* - unit: seconds
80 - *peer-role* - If peer role is not present, default value "ibgp" will be used (allowed values are also "ebgp" and "rr-client"). This field is case-sensitive.
81 - *rib* - BGP RIB identifier
82
83 ==== Configure Connection Attributes - OPTIONAL ====
84
85 [source,xml]
86 ----
87 <module>
88    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:reconnectstrategy">prefix:timed-reconnect-strategy</type>
89    <name>example-reconnect-strategy</name>
90    <min-sleep>1000</min-sleep>
91    <max-sleep>180000</max-sleep>
92    <sleep-factor>2.00</sleep-factor>
93    <connect-time>5000</connect-time>
94    <executor>
95        <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">netty:netty-event-executor</type>
96        <name>global-event-executor</name>
97    </executor>
98 </module>
99 ----
100
101 - *min-sleep* - Minimum sleep time (miliseconds) in between reconnect tries
102 - *max-sleep* - Maximum sleep time (miliseconds) in between reconnect tries
103 - *sleep-factor* - Power factor of the sleep time between reconnect tries
104 - *connect-time* - How long we should wait (miliseconds) for the TCP connect
105 attempt, overrides default connection timeout dictated by TCP retransmits
106
107
108 ==== BGP Speaker Configuration ====
109
110 Previous entries addressed the configuration of a BGP connection initiated by
111 OpenDaylight. OpenDaylight also supports BGP Speaker functionality and accepts
112 incoming BGP connections.
113
114 *The configuration of BGP speaker is located in: 41-bgp-example.xml:
115
116 [source,xml]
117 ----
118 <module>
119     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-acceptor</type>
120     <name>bgp-peer-server</name>
121
122     <!--Default parameters-->
123     <!--<binding-address>0.0.0.0</binding-address>-->
124     <!--<binding-port>1790</binding-port>-->
125
126     ...
127     <!--Drops or accepts incoming BGP connection, every BGP Peer that should be accepted needs to be added to this registry-->
128     <peer-registry>
129         <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
130         <name>global-bgp-peer-registry</name>
131     </peer-registry>
132 </module>
133 ----
134
135 *Changing speaker configuration*
136 - Changing binding address: Uncomment tag binding-address and change the address to e.g. _127.0.0.1_. The default binding address is _0.0.0.0_.
137 - Changing binding port: Uncomment tag binding-port and change the port to e.g.
138   _1790_. The default binding port is _179_ as specified in link:http://tools.ietf.org/html/rfc4271[BGP RFC].  --
139
140 ==== Incomming BGP Connections ====
141
142 *BGP speaker drops all BGP connections from unknown BGP peers.* The decision is
143 made in component bgp-peer-registry that is injected into the speaker (The
144 registry is configured in 31-bgp.xml).
145
146 To add BGP Peer configuration into the registry, it is necessary to configure
147 regular BGP peer just like in example in 41-bgp-example.xml. Notice that the
148 BGP peer depends on the same bgp-peer-registry as bgp-speaker:
149
150 [source,xml]
151 ----
152 <module>
153     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
154     <name>example-bgp-peer</name>
155     <host>192.0.2.1</host>
156     ...
157     <peer-registry>
158         <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
159         <name>global-bgp-peer-registry</name>
160     </peer-registry>
161     ...
162 </module>
163 ----
164
165 The BGP peer registers itself into the registry, which allows incoming BGP
166 connections handled by the bgp-speaker. (Config attribute peer-registry is
167 optional for now to preserve backwards compatibility). With this configuration,
168 the connection to 192.0.2.1 is initiated by OpenDaylight but will also be accepted from
169 192.0.2.1. In case both connections are being established, only one of them
170 will be preserved and the other will be dropped. The connection initiated from
171 device with lower bgp id will be dropped by the registry.  Each BGP peer must
172 be configured in its own module. Note, that the name of the module needs to be
173 unique, so if you are configuring more peers, when changing the *host*, change
174 also the *name*.
175 There is a way to configure the peer only for incoming connections (The
176 connection will not be initiated by the OpenDaylight, OpenDaylight will only wait for incoming
177 connection from the peer. The peer is identified by its IP address). To
178 configure peer only for incoming connection add attribute initiate-connection
179 to peer's configuration:
180
181 [source,xml]
182 ----
183 <module>
184     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
185     <name>example-bgp-peer</name>
186     <host>192.0.2.1</host>                         // IP address or hostname of the speaker
187     <holdtimer>180</holdtimer>
188     <initiate-connection>false</initiate-connection>  // Connection will not be initiated by ODL
189     ...
190 </module>
191 ----
192
193 - *initiate-connection* - if set to false OpenDaylight will not initiate connection to this peer. Default value is true for all peers.
194
195 ==== BGP Application Peer  ====
196
197 A BGP speaker needs to register all peers that can be connected to it (meaning if
198 a BGP peer is not configured, the connection with OpenDaylight won't be
199 successful). As a first step, configure RIB. Then, instead of configuring
200 regular peer, configure this application peer, with its own application RIB.
201 Change the value in bold bgp-peer-id which is your local BGP-ID that will be
202 used in BGP Best Path Selection algorithm.
203
204 [source,xml]
205 ----
206 <module>
207  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
208  <name>example-bgp-peer-app</name>
209  <bgp-peer-id>10.25.1.9</bgp-peer-id>
210  <target-rib>
211   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
212   <name>example-bgp-rib</name>
213  </target-rib>
214  <application-rib-id>example-app-rib</application-rib-id>
215  ...
216 </module>
217 ----
218
219 - *bgp-peer-id* - Our local BGP identifier (the IP of the VM where OpenDaylight is deployed), we use this in best path selection
220 - *target-rib* - RIB ID of existing RIB where the data should be transferred
221 - *application-rib-id* - RIB ID of local application RIB (all the routes that you put to OpenDaylight will be displayed here)
222
223 //TODO: internal link to Populate RIB
224 //To populate RIB use 
225
226 //TODO: internal jump to section?
227 //In order to get routes advertised to other peers, you have to also configure the peers, as described in section BGP Peer 
228
229 === Configuration through RESTCONF ===
230
231 Another method to configure BGP is dynamically through RESTCONF. Before you
232 start, make sure, you've completed steps 1-5 in Installation Guide. Instead of
233 restarting Karaf, install another feature, that provides you the access to
234 'restconf/config/' URLs.
235
236 feature:install odl-netconf-connector-all
237
238 To check what modules you have currently configured, check following link:
239 http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/
240 This URL is also used to POST new configuration. If you want to change any
241 other configuration that is listed here, make sure you include the correct
242 namespaces. RESTCONF will tell you if some namespace is wrong.
243
244 To update  an existing configuration use *PUT* and give the full path to the element you  wish to update.
245
246 It is vital that you respect the order of steps described in user guide.
247
248 ==== RIB ====
249
250 First, configure RIB. This module is already present in the configuration,
251 therefore we change only the parameters we need. In this case, it's
252 *bgp-rib-id* and *local-as*.
253
254 *URL:* _http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-rib/example-bgp-rib_
255
256 *PUT:*
257 [source,xml]
258 ----
259 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
260  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-impl</type>
261  <name>example-bgp-rib</name>
262  <session-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
263   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type>
264   <name>example-reconnect-strategy-factory</name>
265  </session-reconnect-strategy>
266  <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-bgp-rib</rib-id>
267  <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
268   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
269   <name>global-rib-extensions</name>
270  </extensions>
271  <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
272   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
273   <name>runtime-mapping-singleton</name>
274  </codec-tree-factory>
275  <tcp-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
276   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type>
277   <name>example-reconnect-strategy-factory</name>
278  </tcp-reconnect-strategy>
279  <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
280   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type>
281   <name>pingpong-binding-data-broker</name>
282  </data-provider>
283  <local-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">64496</local-as>
284  <bgp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
285   <type>bgp-dispatcher</type>
286   <name>global-bgp-dispatcher</name>
287  </bgp-dispatcher>
288  <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
289   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
290   <name>pingpong-broker</name>
291  </dom-data-provider>
292  <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
293   <type>bgp-table-type</type>
294   <name>ipv4-unicast</name>
295  </local-table>
296  <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
297   <type>bgp-table-type</type>
298   <name>ipv6-unicast</name>
299  </local-table>
300  <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
301   <type>bgp-table-type</type>
302   <name>linkstate</name>
303  </local-table>
304  <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
305   <type>bgp-table-type</type>
306   <name>flowspec</name>
307  </local-table>
308  <bgp-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.2</bgp-rib-id>
309 </module>
310 ----
311
312 IMPORTANT: MIGHT NOT BE NEEDED depending on your BGP router, you might need a
313 switch from linkstate attribute type 99 to 29. Check with your router vendor.
314 Switch the field to true if your router supports type 29.
315
316 *URL:* _http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-linkstate-cfg:bgp-linkstate_
317
318 *PUT:*
319 [source,xml]
320 ----
321 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
322  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">x:bgp-linkstate</type>
323  <name>bgp-linkstate</name>
324  <iana-linkstate-attribute-type xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">true</iana-linkstate-attribute-type>
325 </module>
326 ----
327
328 ==== BGP Peer ====
329
330 We also need to add new module to configuration (bgp-peer). In this case, the
331 whole module needs to be configured. Please change values *host*, *holdtimer*
332 and *peer-role* (if necessary).
333
334 .*POST:*
335
336 [source,xml]
337 ----
338 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
339  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer</type>
340  <name>example-bgp-peer</name>
341  <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.1</host>
342  <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">180</holdtimer>
343  <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">ibgp</peer-role>
344  <rib xmlns"urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
345   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:cfg">x:rib</type>
346   <name>example-bgp-rib</name>
347  </rib>
348  <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
349   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer-registry</type>
350   <name>global-bgp-peer-registry</name>
351  </peer-registry>
352  <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
353   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
354   <name>ipv4-unicast</name>
355  </advertized-table>
356  <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
357   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
358   <name>ipv6-unicast</name>
359  </advertized-table>
360  <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
361   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
362   <name>linkstate</name>
363  </advertized-table>
364  <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
365   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
366   <name>flowspec</name>
367  </advertized-table>
368 </module>
369 ----
370
371 This is all necessary information that you need to get ODL connect to your speaker.
372
373 ==== BGP Application Peer ====
374
375 Change the value *bgp-peer-id* which is your local BGP ID that will be used in
376 BGP Best Path Selection algorithm.
377
378 .*POST:*
379 [source,xml]
380 ----
381 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
382  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
383  <name>example-bgp-peer-app</name>
384  <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">10.25.1.9</bgp-peer-id> <!-- Your local BGP-ID that will be used in BGP Best Path Selection algorithm -->
385  <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
386   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
387   <name>example-bgp-rib</name>
388   </target-rib>
389  <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
390  <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
391   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type>
392   <name>pingpong-binding-data-broker</name>
393  </data-broker>
394 </module>
395 ----
396
397 === Tutorials ===
398
399 ==== Viewing BGP Topology ====
400
401 This section summarizes how data from BGP can be viewed through RESTCONF. Currently it is the only way to view the data.
402
403 IMPORTANT: From Helium release the port changed from 8080 to 8181.
404
405 ===== Network Topology View =====
406
407 Basic URL for network topology is *http://localhost:8181/restconf/operational/network-topology:network-topology/* .
408
409 If BGP is configured properly, it should display output similar to this one:
410
411 [source,xml]
412 ----
413 <network-topology>
414  <topology>
415   <topology-id>pcep-topology</topology-id>
416   <topology-types>
417    <topology-pcep/>
418   </topology-types>
419  </topology>
420  <topology>
421   <server-provided>true</server-provided>
422   <topology-id>example-ipv4-topology</topology-id>
423   <topology-types/>
424  </topology>
425  <topology>
426   <server-provided>true</server-provided>
427   <topology-id>example-linkstate-topology</topology-id>
428   <topology-types/>
429  </topology>
430 </network-topology>
431 ----
432
433 BGP data as were sent from BGP speaker are listed in three topologies (if all three are configured):
434
435 *example-linkstate-topology* - displays links and nodes advertised through linkstate Update messages
436
437 http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-linkstate-topology
438
439 *example-ipv4-topology* - display Ipv4 adresses of nodes in the topology
440
441 http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv4-topology
442
443 *example-ipv6-topology* - display Ipv6 adresses of nodes in the topology
444
445 http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv6-topology
446
447 ===== Route Information Base (RIB) View =====
448
449 Another view of BGP data is through *BGP RIBs*, located here:
450
451 http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/
452
453 There are multiple RIBs configured:
454
455 - AdjRibsIn (per Peer) : Adjacency RIBs In, BGP routes as they come from BGP Peer
456 - EffectiveRib (per Peer) : BGP routes after applying Import policies
457 - LocRib (per RIB) : Local RIB, BGP routes from all peers
458 - AdjRibsOut (per Peer) : BGP routes that will be advertizes, after applying Export policies
459
460 This is how the output looks like, when address families for IPv4 and Linkstate were configured:
461
462 [source,xml]
463 ----
464 <loc-rib>
465  <tables>
466   </attributes>
467   <safi>x:linkstate-subsequent-address-family</safi>
468   <afi>x:linkstate-address-family</afi>
469   </linkstate-routes>
470  </tables>
471  <tables>
472   </attributes>
473   <safi>x:unicast-subsequent-address-family</safi>
474   <afi>x:ipv4-address-family</afi>
475   </ipv4-routes>
476  </tables>
477 </loc-rib>
478 ----
479
480 You can see details for each AFI by expanding the RESTCONF link:
481
482 *IPv4* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes
483
484 *Linkstate* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/linkstate-routes
485
486 ==== Populate RIB ====
487
488 If your peer is configured, you can populate the RIB by making following POST call to RESTCONF:
489
490 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/
491
492 - where example-app-rib is your application RIB id (that you specified in the configuration) and tables specifies AFI and SAFI of the data that you want to add.
493
494 *POST:*
495
496 *Content-Type:* application/xml
497
498 [source,xml]
499 ----
500 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
501 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
502  <ipv4-route>
503   <prefix>200.20.160.1/32</prefix>
504   <attributes>
505    <ipv4-next-hop>
506     <global>199.20.160.41</global>
507    </ipv4-next-hop><as-path/>
508    <multi-exit-disc>
509     <med>0</med>
510    </multi-exit-disc>
511    <local-pref>
512     <pref>100</pref>
513    </local-pref>
514    <originator-id>
515     <originator>41.41.41.41</originator>
516    </originator-id>
517    <origin>
518     <value>igp</value>
519    </origin>
520    <cluster-id>
521     <cluster>40.40.40.40</cluster>
522    </cluster-id>
523   </attributes>
524  </ipv4-route>
525 </ipv4-routes>
526 ----
527
528 The request results in *204 No content*. This is expected.