3 === Configuring BGP ===
5 The OpenDaylight Karaf distribution comes pre-configured with a baseline BGP
6 configuration. You can find it in the `etc/opendaylight/karaf` directory and it
9 `31-bgp.xml`:: defines the basic parser and RIB support
10 `41-bgp-example.xml`:: contains a sample configuration which needs to be
11 customized to your deployment)
13 The next sections will describe how to configure BGP manually or using RESTCONF.
17 The configuration of the Routing Information Base (RIB) is specified using a block in the `41-bgp-example.xml` file.
22 <type>prefix:rib-impl</type>
23 <name>example-bgp-rib</name>
24 <rib-id>example-bgp-rib</rib-id>
25 <local-as>64496</local-as>
26 <bgp-id>192.0.2.2</bgp-id>
27 <cluster-id>192.0.2.3</cluster-id>
32 - *type* - should always be set to `prefix:rib-impl`
33 - *name* and *rib-id* - BGP RIB Identifier, you can specify multiple BGP RIBs by
34 having multiple the above `module` blocks. Each such RIB must have a unique rib-id and name.
35 - *local-as* - the local AS number (where OpenDaylight is deployed), we use this in best path selection
36 - *bgp-id* - the local BGP identifier (the IP of the VM where OpenDaylight is deployed),
37 we use this in best path selection.
38 - *cluster-id* - cluster identifier, optional, if not specified, BGP Identifier will be used
40 Depending on your BGP router, you might need to switch from
41 linkstate attribute type 99 to 29. Check with your router vendor. Change the
42 field iana-linkstate-attribute-type to true if your router supports type 29.
43 This snippet is located in `31-bgp.xml` file.
48 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">prefix:bgp-linkstate</type>
49 <name>bgp-linkstate</name>
50 <iana-linkstate-attribute-type>true</iana-linkstate-attribute-type>
54 - *iana-linkstate-attribute-type* - IANA has issued an early allocation for the
55 BGP linkstate path attribute (=29). To preserve he old value (=99) set this to
56 to false; to use IANA assigned type set the value to true or remove it as it's true by default.
60 The initial configuration is written so that it will be ignored to prevent the
61 client from starting with default configuration. Therefore the first step is to
62 uncomment the module containing bgp-peer.
67 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
68 <name>example-bgp-peer</name>
69 <host>192.0.2.1</host>
70 <holdtimer>180</holdtimer>
71 <peer-role>ibgp</peer-role>
73 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
74 <name>example-bgp-rib</name>
80 - *name* - BGP Peer name, in this configuration file you specify multiple BGP Peers by replicating the above `module` block. Each peers must have a unique name.
81 - *host* - IP address or hostname of BGP speaker where OpenDaylight should connect to the peer
82 - *holdtimer* - hold time in seconds
83 - *peer-role* - If peer role is not present, default value "ibgp" will be used (other allowed values are "ebgp" and "rr-client"). This field is case-sensitive.
84 - *rib* - BGP RIB identifier
86 ==== Configure Connection Attributes (Optional) ====
91 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:reconnectstrategy">prefix:timed-reconnect-strategy</type>
92 <name>example-reconnect-strategy</name>
93 <min-sleep>1000</min-sleep>
94 <max-sleep>180000</max-sleep>
95 <sleep-factor>2.00</sleep-factor>
96 <connect-time>5000</connect-time>
98 <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">netty:netty-event-executor</type>
99 <name>global-event-executor</name>
104 - *min-sleep* - minimum sleep time (miliseconds) in between reconnect tries
105 - *max-sleep* - maximum sleep time (miliseconds) in between reconnect tries
106 - *sleep-factor* - power factor of the sleep time between reconnect tries, i.e., the previous sleep time will be multiplied by this number to determine the next sleep time, but never exceed *max-sleep*
107 - *connect-time* - how long BGP should wait (miliseconds) for the TCP connect
108 attempt, overrides default connection timeout dictated by TCP.
111 ==== BGP Speaker Configuration ====
113 The previous entries described configuration of a BGP connections initiated by
114 OpenDaylight. OpenDaylight can also accept incoming BGP connections.
116 The configuration of BGP speaker is located in: `41-bgp-example.xml`:
121 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-acceptor</type>
122 <name>bgp-peer-server</name>
124 <!--Default parameters-->
125 <!--<binding-address>0.0.0.0</binding-address>-->
126 <!--<binding-port>1790</binding-port>-->
129 <!--Drops or accepts incoming BGP connection, every BGP Peer that should be accepted needs to be added to this registry-->
131 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
132 <name>global-bgp-peer-registry</name>
137 - 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_.
138 - Changing binding port: Uncomment tag binding-port and change the port to e.g.
139 _1790_. The default binding port is _179_ as specified in link:http://tools.ietf.org/html/rfc4271[RFC 4271].
141 ==== Incomming BGP Connections ====
143 *The BGP speaker drops all BGP connections from unknown BGP peers.* The decision is
144 made in component bgp-peer-registry that is injected into the speaker (The
145 registry is configured in `31-bgp.xml`).
147 To add a BGP Peer configuration into the registry, it is necessary to configure
148 regular BGP peer just like in example in `41-bgp-example.xml`. Notice that the
149 BGP peer depends on the same bgp-peer-registry as bgp-speaker:
154 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
155 <name>example-bgp-peer</name>
156 <host>192.0.2.1</host>
159 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
160 <name>global-bgp-peer-registry</name>
166 The BGP peer registers itself into the registry, which allows incoming BGP
167 connections handled by the bgp-speaker. (Config attribute peer-registry is
168 optional for now to preserve backwards compatibility). With this configuration,
169 the connection to 192.0.2.1 is initiated by OpenDaylight but will also be accepted from
170 192.0.2.1. In case both connections are being established, only one of them
171 will be preserved and the other will be dropped. The connection initiated from
172 device with lower BGP id will be dropped by the registry. Each BGP peer must
173 be configured in its own `module` block. Note, that the name of the module needs to be
174 unique, so if you are configuring more peers, when changing the *host*, also change
177 To configure a peer that only listens for incoming connections and instruct
178 OpenDaylight not to initiate the connection, add the initiate-connection attribute
179 to peer's configuration and set it to false:
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
193 - *initiate-connection* - if set to false OpenDaylight will not initiate connection to this peer. Default value is true.
195 ==== BGP Application Peer ====
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 bgp-peer-id, which is your local BGP ID that will be
202 used in BGP best path selection algorithm.
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>
211 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
212 <name>example-bgp-rib</name>
214 <application-rib-id>example-app-rib</application-rib-id>
219 - *bgp-peer-id* - the 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)
223 //TODO: internal link to Populate RIB
224 //To populate RIB use
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
229 === Configuration through RESTCONF ===
231 Another method to configure BGP is dynamically through RESTCONF. Instead of
232 restarting Karaf, install another feature, that provides you the access to
233 'restconf/config/' URLs.
235 feature:install odl-netconf-connector-all
237 To check what modules you have currently configured, check following link:
238 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.
244 To update an existing configuration use *PUT* and give the full path to the element you wish to update.
246 It is vital that you respect the order of steps described in user guide.
250 First, configure the 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*.
255 _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:rib-impl/example-bgp-rib_
260 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
261 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-impl</type>
262 <name>example-bgp-rib</name>
263 <session-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
264 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type>
265 <name>example-reconnect-strategy-factory</name>
266 </session-reconnect-strategy>
267 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-bgp-rib</rib-id>
268 <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
269 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
270 <name>global-rib-extensions</name>
272 <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
273 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
274 <name>runtime-mapping-singleton</name>
275 </codec-tree-factory>
276 <tcp-reconnect-strategy xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
277 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:protocol:framework">x:reconnect-strategy-factory</type>
278 <name>example-reconnect-strategy-factory</name>
279 </tcp-reconnect-strategy>
280 <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
281 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type>
282 <name>pingpong-binding-data-broker</name>
284 <local-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">64496</local-as>
285 <bgp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
286 <type>bgp-dispatcher</type>
287 <name>global-bgp-dispatcher</name>
289 <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
290 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
291 <name>pingpong-broker</name>
293 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
294 <type>bgp-table-type</type>
295 <name>ipv4-unicast</name>
297 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
298 <type>bgp-table-type</type>
299 <name>ipv6-unicast</name>
301 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
302 <type>bgp-table-type</type>
303 <name>linkstate</name>
305 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
306 <type>bgp-table-type</type>
307 <name>ipv4-flowspec</name>
309 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
310 <type>bgp-table-type</type>
311 <name>ipv6-flowspec</name>
313 <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
314 <type>bgp-table-type</type>
315 <name>labeled-unicast</name>
317 <bgp-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.2</bgp-rib-id>
318 <openconfig-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
319 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp-openconfig-spi">x:bgp-openconfig-provider</type>
320 <name>openconfig-bgp</name>
321 </openconfig-provider>
325 Depending on your BGP router, you might need to switch from
326 linkstate attribute type 99 to 29. Check with your router vendor. Change the
327 field iana-linkstate-attribute-type to true if your router supports type 29.
328 You can do that with the following RESTCONF operation:
330 *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/bgp-linkstate_
335 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
336 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">x:bgp-linkstate</type>
337 <name>bgp-linkstate</name>
338 <iana-linkstate-attribute-type xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">true</iana-linkstate-attribute-type>
344 We also need to add a new module to configuration (bgp-peer). In this case, the
345 whole module needs to be configured. Please change values *host*, *holdtimer*
346 and *peer-role* (if necessary).
348 *URL:* _http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules_
354 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
355 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer</type>
356 <name>example-bgp-peer</name>
357 <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.1</host>
358 <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">180</holdtimer>
359 <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">ibgp</peer-role>
360 <rib 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:rib-instance</type>
362 <name>example-bgp-rib</name>
364 <peer-registry 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-peer-registry</type>
366 <name>global-bgp-peer-registry</name>
368 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
369 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
370 <name>ipv4-unicast</name>
372 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
373 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
374 <name>ipv6-unicast</name>
376 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
377 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
378 <name>linkstate</name>
380 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
381 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
382 <name>ipv4-flowspec</name>
384 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
385 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
386 <name>ipv6-flowspec</name>
388 <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
389 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
390 <name>labeled-unicast</name>
395 This is all necessary information that you need to get ODL connect to your speaker.
397 ==== BGP Application Peer ====
399 Change the value *bgp-peer-id* which is your local BGP ID that will be used in
400 BGP Best Path Selection algorithm.
402 *URL:* _http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules_
407 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
408 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
409 <name>example-bgp-peer-app</name>
410 <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 -->
411 <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
412 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
413 <name>example-bgp-rib</name>
415 <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
416 <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
417 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
418 <name>pingpong-broker</name>
425 ==== Viewing BGP Topology ====
427 This section summarizes how data from BGP can be viewed through RESTCONF. Currently it is the only way to view the data.
429 ===== Network Topology View =====
431 The URL for network topology is: http://localhost:8181/restconf/operational/network-topology:network-topology/
433 If BGP is configured properly, it should display output similar to:
439 <topology-id>pcep-topology</topology-id>
445 <server-provided>true</server-provided>
446 <topology-id>example-ipv4-topology</topology-id>
450 <server-provided>true</server-provided>
451 <topology-id>example-linkstate-topology</topology-id>
457 BGP topology information as learned from BGP peers are is in three topologies (if all three are configured):
459 * *example-linkstate-topology* - displays links and nodes advertised through linkstate update messages
461 ** http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-linkstate-topology
463 * *example-ipv4-topology* - display IPv4 addresses of nodes in the topology
465 ** http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv4-topology
467 * *example-ipv6-topology* - display IPv6 addresses of nodes in the topology
469 ** http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv6-topology
471 ===== Route Information Base (RIB) View =====
473 Another view of BGP data is through *BGP RIBs*, located here: http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/
475 There are multiple RIBs configured:
477 - AdjRibsIn (per Peer) : Adjacency RIBs In, BGP routes as they come from BGP Peer
478 - EffectiveRib (per Peer) : BGP routes after applying Import policies
479 - LocRib (per RIB) : Local RIB, BGP routes from all peers
480 - AdjRibsOut (per Peer) : BGP routes that will be advertizes, after applying Export policies
482 This is how the empty output looks like, when address families for IPv4 Unicast, IPv6 Unicast, IPv4 Flowspec, IPv6 Flowspec, IPv4 Labeled Unicast and Linkstate were configured:
486 <loc-rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
488 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv6-address-family</afi>
489 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
491 <uptodate>false</uptodate>
493 <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
497 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
498 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
500 <uptodate>false</uptodate>
502 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
506 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
507 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">x:flowspec-subsequent-address-family</safi>
509 <uptodate>false</uptodate>
511 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
515 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv6-address-family</afi>
516 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">x:flowspec-subsequent-address-family</safi>
518 <uptodate>false</uptodate>
520 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
521 </flowspec-ipv6-routes>
524 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
525 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">x:labeled-unicast-subsequent-address-family</safi>
527 <uptodate>false</uptodate>
529 <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
530 </labeled-unicast-routes>
533 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-address-family</afi>
534 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-subsequent-address-family</safi>
536 <uptodate>false</uptodate>
538 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
544 You can see details for each AFI by expanding the RESTCONF link:
546 * *IPv4 Unicast* : 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
548 * *IPv6 Unicast* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/ipv6-routes
550 * *IPv4 Labeled Unicast* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes
552 * *IPv4 Flowspec* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes
554 * *IPv6 Flowspec* : http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes
556 * *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
558 ==== Populate RIB ====
560 If an application peer is configured, you can populate its RIB by making POST calls to RESTCONF like the following.
562 ===== IPv4 Unicast =====
566 *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/bgp-inet:ipv4-routes/
568 - 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.
572 *Content-Type:* application/xml
576 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
577 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
578 <prefix>1.1.1.1/32</prefix>
581 <global>199.20.160.41</global>
582 </ipv4-next-hop><as-path/>
590 <originator>41.41.41.41</originator>
596 <cluster>40.40.40.40</cluster>
602 The request results in *204 No content*. This is expected.
606 *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/bgp-inet:ipv4-routes/bgp-inet:ipv4-route/<route-id>
610 ===== IPv6 Unicast =====
614 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv6-routes/
618 *Content-Type:* application/xml
622 <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
623 <prefix>2001:db8:30::3/128</prefix>
626 <global>2001:db8:1::6</global>
636 The request results in *204 No content*. This is expected.
640 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv6-routes/bgp-inet:ipv6-route/<route-id>
644 ===== IPv4 Labeled Unicast =====
648 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes
652 *Content-Type:* application/xml
656 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
657 <route-key>label1</route-key>
658 <prefix>1.1.1.1/32</prefix>
660 <label-value>123</label-value>
663 <label-value>456</label-value>
666 <label-value>342</label-value>
670 <global>199.20.160.41</global>
680 </labeled-unicast-route>
683 The request results in *204 No content*. This is expected.
687 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes/bgp-labeled-unicast:labeled-unicast-route/<route-id>
691 ===== IPv4 Flowspec =====
695 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes
699 *Content-Type:* application/xml
703 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
704 <route-key>flow1</route-key>
706 <destination-prefix>192.168.0.1/32</destination-prefix>
709 <source-prefix>10.0.0.1/32</source-prefix>
713 <op>equals end-of-list</op>
719 <op>equals end-of-list</op>
725 <op>greater-than</op>
729 <op>and-bit less-than end-of-list</op>
735 <op>greater-than end-of-list</op>
741 <op>equals end-of-list</op>
747 <op>equals end-of-list</op>
753 <op>match end-of-list</op>
759 <op>greater-than</op>
763 <op>and-bit less-than end-of-list</op>
769 <op>equals end-of-list</op>
775 <op>match end-of-list</op>
787 <extended-communities>
789 </extended-communities>
794 *Flowspec Extended Communities (Actions):*
798 <extended-communities>
799 <transitive>true</transitive>
800 <traffic-rate-extended-community>
801 <informative-as>123</informative-as>
802 <local-administrator>AAAAAA==</local-administrator>
803 </traffic-rate-extended-community>
804 </extended-communities>
806 <extended-communities>
807 <transitive>true</transitive>
808 <traffic-action-extended-community>
809 <sample>true</sample>
810 <terminal-action>false</terminal-action>
811 </traffic-action-extended-community>
812 </extended-communities>
814 <extended-communities>
815 <transitive>true</transitive>
816 <redirect-extended-community>
817 <global-administrator>123</global-administrator>
818 <local-administrator>AAAAew==</local-administrator>
819 </redirect-extended-community>
820 </extended-communities>
822 <extended-communities>
823 <transitive>true</transitive>
825 <global-administrator>192.168.0.1</global-administrator>
826 <local-administrator>12345</local-administrator>
828 </extended-communities>
830 <extended-communities>
831 <transitive>true</transitive>
833 <global-administrator>64495</global-administrator>
834 <local-administrator>12345</local-administrator>
836 </extended-communities>
838 <extended-communities>
839 <transitive>true</transitive>
840 <redirect-ip-nh-extended-community>
842 </redirect-ip-nh-extended-community>
843 </extended-communities>
845 <extended-communities>
846 <transitive>true</transitive>
847 <traffic-marking-extended-community>
848 <global-administrator>20</global-administrator>
849 </traffic-marking-extended-community>
850 </extended-communities>
853 The request results in *204 No content*. This is expected.
857 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes/bgp-flowspec:flowspec-route/<route-id>
861 ===== IPv6 Flowspec =====
865 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes
869 *Content-Type:* application/xml
873 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
874 <route-key>flow-v6</route-key>
876 <destination-prefix>2001:db8:30::3/128</destination-prefix>
879 <source-prefix>2001:db8:31::3/128</source-prefix>
883 <op>equals end-of-list</op>
888 <extended-communities>
890 <global-administrator>2001:db8:1::6</global-administrator>
891 <local-administrator>12345</local-administrator>
893 </extended-communities>
905 The request results in *204 No content*. This is expected.
909 *URL:* http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes/bgp-flowspec:flowspec-route/<route-id>