Jump to: navigation, search

BGP LS PCEP:User Guide

This site is for SNAPSHOT codebase only. If you are using release, check main site for it's specific User guide.

This user guide does not contain full parts of configuration files, only those that can or need to be configured by the user.

BGP Configuration

OpenDaylight karaf edition comes pre-configured with baseline BGP configuration. You can find it in the etc/opendaylight/karaf directory and it consists of two files:

  • 31-bgp.xml, which defines the basic parser and RIB support
  • 41-bgp-example.xml, which contains a sample configuration which needs to be customized to your deployment.


Note: These static initial XML configuration files are not located in etc/opendaylight/karaf until the odl-bgpcep-bgp feature is non installed. If you want to edit the initial configuration for fresh ODL distribution, you can find these configuration files in the ODL Karaf distribution:

  • system/org/opendaylight/bgpcep/bgp-controller-config/0.6.*/bgp-controller-config-0.6.*.xml
  • system/org/opendaylight/bgpcep/bgp-controller-config/0.6.*/bgp-controller-config-0.6.*-config-example.xml


Following sections will guide you through manual BGP configuration by showing which parts of configuration files you have to edit. Other way how to configure BGP is through RESTCONF.

RIB

RIB configuration also contains types of supported data tables. They default to ipv4-unicast, ipv6-unicast, linkstate and ipv4-flowspec, ipv4-labeled-unicast and ipv6-labeled-unicast.

  1. <module>
  2.  <type>prefix:rib-impl</type>
  3.  <name>example-bgp-rib</name>
  4.  <rib-id>example-bgp-rib</rib-id>
  5.  <local-as>64496</local-as> 
  6.  <bgp-rib-id>192.0.2.2</bgp-rib-id>
  7.  <cluster-id>192.0.2.3</cluster-id>
  8.  ...
  9. </module>
  • 4: rib-id - BGP RIB Identifier, in this configuration file you can specify more BGP RIBs by copy-pasting the above module. These RIBs must have a unique rib-id and name.
  • 5: local-as - Our local AS number (where Opendaylight is deployed), we use this in best path selection
  • 6: bgp-id - Our local BGP identifier (the IP of the VM where Opendaylight is deployed), we use this in best path selection.
  • 7: cluster-id - Cluster Identifier, non-mandatory, if not specified, BGP Identifier will be used

MIGHT NOT BE NEEDED: depending on your BGP router, you might need a switch from linkstate attribute type 99 to 29. Check with your router vendor. Switch the field iana-linkstate-attribute-type to true if your router supports type 29. This snippet is located in 31-bgp.xml file.

  1. <module>
  2.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">prefix:bgp-linkstate</type>
  3.  <name>bgp-linkstate</name>
  4.  <iana-linkstate-attribute-type>true</iana-linkstate-attribute-type>
  5. </module>
  • 4: iana-linkstate-attribute-type - IANA has issued an early allocation for the BGP Linkstate path attribute (=29). To preserve (TYPE = 99) set value bellow to false; to use IANA assigned type set the value to true or remove (true by default)

BGP Peer

The initial configuration is written so that it will be ignored to prevent the client from starting with default configuration. Therefore the first step is to uncomment the module containing bgp-peer.

  1. <module>
  2.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
  3.  <name>example-bgp-peer</name>
  4.  <host>192.0.2.1</host>
  5.  <holdtimer>180</holdtimer>
  6.  <retrytimer>10</retrytimer>
  7.  <peer-role>ibgp</peer-role>
  8.  <rib>
  9.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
  10.   <name>example-bgp-rib</name>
  11.  </rib>
  12.  <rpc-registry>
  13.   <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
  14.   <name>binding-rpc-broker</name>
  15.  </rpc-registry>
  16.  ...
  17. </module>
  • 3: 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.
  • 4: host - IP address of BGP speaker (IP where Opendaylight should connect to gather topology)
  • 5: holdtimer - unit: seconds
  • 6: retrytimer - Interval between BGP client reconnection attempts. unit: seconds
  • 7: 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.
  • 8: rib - BGP RIB identifier
  • 9: rpc-registry - remote procedure call registry enables to use RPC
  • If you wish to change what multiprotocol capabilities will be sent to BGP peer, consult this section.
Simple routing policy

Simple routing policy allows us to configure peer in 2 specific policies:

  • learn-none: Any route coming from this peer wont be learned, therefore it won't contain effective-rib-in.
  • announce-none: No route will be advertised to this peer, therefore it won't contain adj-rib-out.
  1.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
  2.  <name>example-bgp-peer</name>
  3.  <host>192.0.2.1</host>
  4.  <simple-routing-policy>announce-none</simple-routing-policy
  5. ...
  • by default specific policies per role will be applied, if this configuration is not specified.

BGP Path Selection Mode

Initial configuration for "All Paths Selection" and "N Paths Selection" is written. Therefore the first step is to uncomment the module containing the selection mode desired.

N Paths Selection
  1.   <!--<module>
  2.       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">prefix:advertise-n-paths</type>
  3.       <name>n-paths</name>
  4.       <n-best-paths>2</n-best-paths>
  5.   </module>-->
  • 4: n-best-paths - Configure with the desired max N Paths selection.
All Paths Selection
  1.   <!--<module>
  2.       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">prefix:advertise-all-paths</type>
  3.       <name>all-paths</name>
  4.   </module>-->


Second step is to uncomment the module which will be used for RIB configuration, as a example we find the configuration for ipv4-unicast family using N paths selection mode.

  1. <!--<module>
  2.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-psm-impl</type>
  3.     <name>ipv4-unicast-path-selection-mode</name>
  4.     <path-address-family>
  5.         <type xmlns:ribimpl="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">ribimpl:bgp-table-type</type>
  6.         <name>ipv4-unicast</name>
  7.     </path-address-family>
  8.     <path-selection-mode>
  9.         <type xmlns:ribimpl="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">ribimpl:path-selection-mode-factory</type>
  10.         <name>n-paths</name>
  11.     </path-selection-mode>
  12. </module>-->


Finally same process need to be applied to services

  1. <!--<service>
  2.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">prefix:path-selection-mode-factory</type>
  3.     <instance>
  4.         <name>n-paths</name>
  5.         <provider>/config/modules/module[name='advertise-n-paths']/instance[name='n-paths']</provider>
  6.     </instance>
  7. </service>-->
  8. <!--<service>
  9.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">prefix:path-selection-mode-factory</type>
  10.     <instance>
  11.         <name>all-paths</name>
  12.         <provider>/config/modules/module[name='advertise-all-paths']/instance[name='all-paths']</provider>
  13.     </instance>
  14. </service>-->
  15. <!--<service>
  16.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-path-selection-mode</type>
  17.     <instance>
  18.         <name>ipv4-unicast-path-selection-mode</name>
  19.         <provider>/modules/module[type='bgp-psm-impl'][name='ipv4-unicast-path-selection-mode']</provider>
  20.     </instance>
  21. </service>-->

Connection Attributes

As part of reconnect simplification, this config has been removed and replaced with a simple per-peer retry timer.

BGP Speaker

Previous entries addressed the configuration of a BGP connection initiated by Opendaylight. Opendaylight also supports BGP Speaker functionality and can accept incoming BGP connections.

The configuration of BGP speaker is located in: 41-bgp-example.xml :

  1. <module>
  2.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-acceptor</type>
  3.  <name>bgp-peer-server</name>
  4.  
  5.  <!--Default parameters-->
  6.  <!--<binding-address>0.0.0.0</binding-address>-->
  7.  <!--<binding-port>1790</binding-port>-->
  8.  
  9.  <!--Drops or accepts incoming BGP connection, every BGP Peer that should be accepted needs to be added to this registry-->
  10.  <peer-registry>
  11.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
  12.   <name>global-bgp-peer-registry</name>
  13.  </peer-registry>
  14.  ...
  15. </module>
  • 6: 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.
  • 7: Changing binding port: Uncomment tag binding-port and change the port to e.g. 1790. The default binding port is 179 as specified in BGP RFC.
Incoming BGP Connections

By default, the BGP speaker drops all BGP connections from unknown BGP peers. The decision is made in component bgp-peer-registry that is injected into the speaker (The registry is configured in 31-bgp.xml).

To add BGP Peer configuration into the registry, it is necessary to configure regular BGP peer just like in example in this section. Notice that the BGP peer depends on the same bgp-peer-registry as bgp-speaker:

  1. <module>
  2.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
  3.  <name>example-bgp-peer</name>
  4.  <host>192.0.2.1</host>
  5.  ...
  6.  <peer-registry>
  7.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
  8.   <name>global-bgp-peer-registry</name>
  9.  </peer-registry>
  10. </module>

The BGP peer registers itself into the registry, which allows incoming BGP connections handled by the bgp-speaker. (Config attribute peer-registry is optional for now to preserve backwards compatibility). With this configuration, the connection to 192.0.2.1 is initiated by Opendaylight but will also be accepted from 192.0.2.1. In case both connections are being established, only one of them will be preserved and the other will be dropped. The connection initiated from device with lower bgp id will be dropped by the registry.

Each BGP peer must be configured in its own module. Note, that the name of the module needs to be unique, so if you are configuring more peers, when changing the host, change also the name.

There is a way to configure the peer only for incoming connections (The connection will not be initiated by the Opendaylight, Opendaylight will only wait for incoming connection from the peer. The peer is identified by its IP address). To configure peer only for incoming connection add attribute initiate-connection to peer's configuration:

  1. <module>
  2.  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
  3.  <name>example-bgp-peer</name>
  4.  <host>192.0.2.1</host>
  5.  <holdtimer>180</holdtimer>
  6.  <retrytimer>10</retrytimer>
  7.  <peer-role>ibgp</peer-role>
  8.  <initiate-connection>false</initiate-connection>
  9.  ...
  10. </module>
  • 7: initiate-connection - if set to false Opendaylight will not initiate connection to this peer. Default value is true for all peers.

When connecting via eBGP it will be necessary to add a parameter <remote-as> defining the ASN of the external peer.

  1. <module>
  2.    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
  3.    <name>example-bgp-peer</name>
  4.    <host>192.0.2.1</host>
  5.    <holdtimer>180</holdtimer>
  6.    <retrytimer>10</retrytimer>
  7.    <peer-role>ebgp</peer-role>
  8.    <remote-as>33364</remote-as>
  9.  ...
  10. </module>
  • 7: remote-as - AS of remote peer
BGP Application Peer

BGP speaker needs to register all peers that can be connected to it (meaning if a BGP peer is not configured, the connection with Opendaylight won't be successful). As a first step, configure RIB. Then, instead of configuring regular peer, configure this application peer. Change the value in bold bgp-peer-id which is your local BGP-ID that will be used in BGP Best Path Selection algorithm.

  1. <module>
  2.  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
  3.  <name>example-bgp-peer-app</name>
  4.  <bgp-peer-id>10.25.1.9</bgp-peer-id>
  5.  <target-rib>
  6.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
  7.   <name>example-bgp-rib</name>
  8.  </target-rib>
  9.  <application-rib-id>example-app-rib</application-rib-id>
  10.  <data-broker>
  11.   <type xmlns:sal="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">sal:dom-async-data-broker</type>
  12.   <name>pingpong-broker</name>
  13.  </data-broker>
  14. <bgp-peer-registry>
  15.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
  16.   <name>global-bgp-peer-registry</name>
  17. </bgp-peer-registry>
  18. </module>
  • 4: bgp-peer-id - Our local BGP identifier (the IP of the VM where Opendaylight is deployed), we use this in best path selection.
  • 5: target-rib - RIB ID of existing RIB where the data should be transferred
  • 9: application-rib-id - RIB ID of local application RIB (all the routes that you put to Opendaylight will be displayed here)
  • 14-17: bgp-peer-registry - Peer-registry dependency, which is used to check for conflicting addresses. Use same value as configured for other BGP peers

To populate the RIB, use this guide.

In order to get routes advertised to other peers, you have to also configure the peers, like it's described in this section.

3-node Clustering

With the default configuration, RIB instance is actively running on one node only, other node instances are in "stand-by" mode, serving as a back-up. If the active node fails, the RIB instance is started on one of the other nodes.

  • BGP topology providers: Each BGP topology-provider instance has to have a unique "topology-id"

Before starting ODL, modify a file: distribution-karaf-*/system/org/opendaylight/bgpcep/bgp-controller-config/*/bgp-controller-config-*-config-example.xml

 <!-- node 1 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv4">prefix:bgp-reachability-ipv4</type>
  <name>example-ipv4-topology</name>
  ...
  <topology-id>example-ipv4-topology-1</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv6">prefix:bgp-reachability-ipv6</type>
  <name>example-ipv6-topology</name>
  ...
  <topology-id>example-ipv6-topology-1</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:topology:provider">prefix:bgp-linkstate-topology</type>
  <name>example-linkstate-topology</name>
  ...
  <topology-id>example-linkstate-topology-1</topology-id>
 </module>
...
 <!-- node 2 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv4">prefix:bgp-reachability-ipv4</type>
  <name>example-ipv4-topology</name>
  ...
  <topology-id>example-ipv4-topology-2</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv6">prefix:bgp-reachability-ipv6</type>
  <name>example-ipv6-topology</name>
  ...
  <topology-id>example-ipv6-topology-2</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:topology:provider">prefix:bgp-linkstate-topology</type>
  <name>example-linkstate-topology</name>
  ...
  <topology-id>example-linkstate-topology-2</topology-id>
 </module>
...
 <!-- node 3 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv4">prefix:bgp-reachability-ipv4</type>
  <name>example-ipv4-topology</name>
  ...
  <topology-id>example-ipv4-topology-3</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:reachability:ipv6">prefix:bgp-reachability-ipv6</type>
  <name>example-ipv6-topology</name>
  ...
  <topology-id>example-ipv6-topology-3</topology-id>
 </module>
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:topology:provider">prefix:bgp-linkstate-topology</type>
  <name>example-linkstate-topology</name>
  ...
  <topology-id>example-linkstate-topology-3</topology-id>
 </module>
BGP RIB sharding (non-replicated)

Replicating RIBs across the cluster nodes is causing severe scalability issue and overall performance degradation. To avoid this problems, configure BGP RIB module as a separate shard without enabled replication. Change configuration on all nodes as following (configuration/initial)

  • In modules.conf add a new module:
    {
        name = "bgp_rib"
        namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
        shard-strategy = "module"
    }


  • In module-shards.conf define a new module shard:
    {
        name = "bgp_rib"
        shards = [
            {
                name="bgp_rib"
                replicas = [
                    "member-1"
                ]
            }
        ]
    }

Note: Use correct member's name in module shard configuration.

PCEP Configuration

OpenDaylight karaf edition comes pre-configured with baseline PCEP configuration. The configuration files are located inetc/opendaylight/karaf

  • 32-pcep.xml - basic PCEP configuration, including session parameters
  • 39-pcep-provider.xml - configuration for PCEP provider

Server Binding

The default shipped configuration will start a PCE server on 0.0.0.0:4189. You can change this behavior in 39-pcep-provider.xml:

  1.  <module>
  2.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:topology:provider">prefix:pcep-topology-provider</type>
  3.   <name>pcep-topology</name>
  4.   <listen-address>192.168.122.55</listen-address>
  5.   <listen-port>4189</listen-port>
  6.   ...
  7.  </module>
  • 4: listen-address - adress on which PCE will be started and listen
  • 5: listen-port - port on which the address will be started and listen

PCEP default configuration is set to conform stateful PCEP extension:

draft-ietf-pce-stateful-pce - in versions 07

PCEP Segment Routing

Conforms draft-ietf-pce-segment-routing-01 - PCEP extension for Segment Routing,

The default configuration file is located in etc/opendaylight/karaf.

  • 33-pcep-segment-routing.xml

MIGHT NOT BE NEEDED: you might need a switch from sub-object EXPLICIT_ROUTE and ROUTE_RECORD code point 5/6 to code point 36 defined by draft https://tools.ietf.org/html/draft-ietf-pce-segment-routing-06. Switch the field iana-sr-subobjects-type to true if your router supports code point 36.

  1.  <module>
  2.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr:cfg">prefix:pcep-parser-segment-routing</type>
  3.   <name>pcep-parser-segment-routing</name>
  4.   <iana-sr-subobjects-type>true</iana-sr-subobjects-type>-->
  5.  </module>
  • 4: iana-sr-subobjects-type - IANA is requested to allocate code points (36) in the RSVP Parameters registry for SR-ERO and SR-RRO. To use IANA assigned type set the value to true, to preserve code points 5/6, set value bellow to false or remove (false by default);

3-node Clustering

In a case of a 3 node clustering setup for PCE, where each node is running it's own PCE instance, following configuration changes are required to be done for each PCE node instance.


  • PCEP topology-provider: Each PCEP topology-provider instance has to have a unique "topology-id"

Before starting ODL, modify a file: distribution-karaf-*/system/org/opendaylight/bgpcep/pcep-controller-config/*/pcep-controller-config-*-config-provider.xml

 <!-- node 1 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:topology:provider">prefix:pcep-topology-provider</type>
  <name>pcep-topology</name>
  ...
  <topology-id>pcep-topology-1</topology-id>
 </module>
...
 <!-- node 2 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:topology:provider">prefix:pcep-topology-provider</type>
  <name>pcep-topology</name>
  ...
  <topology-id>pcep-topology-2</topology-id>
 </module>
...
 <!-- node 3 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:topology:provider">prefix:pcep-topology-provider</type>
  <name>pcep-topology</name>
  ...
  <topology-id>pcep-topology-3</topology-id>
 </module>
...


  • Programming instruction scheduler: Each Programming instruction scheduler instance has to have a unique "instruction-queue-id"

Before starting ODL, modify a file: distribution-*/system/org/opendaylight/bgpcep/programming-controller-config/*/programming-controller-config-*-config.xml

 <!-- node 1 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:programming:impl">prefix:instruction-scheduler-impl</type>
  <name>global-instruction-scheduler</name>
  ...
  <instruction-queue-id>global-instruction-queue-1</instruction-queue-id>
 </module>
...
 <!-- node 2 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:programming:impl">prefix:instruction-scheduler-impl</type>
  <name>global-instruction-scheduler</name>
  ...
  <instruction-queue-id>global-instruction-queue-2</instruction-queue-id>
 </module>
...
 <!-- node 3 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:programming:impl">prefix:instruction-scheduler-impl</type>
  <name>global-instruction-scheduler</name>
  ...
  <instruction-queue-id>global-instruction-queue-3</instruction-queue-id>
 </module>

BMP Configuration

OpenDaylight karaf edition comes pre-configured with baseline BMP configuration. The configuration files are located in etc/opendaylight/karaf

  • 32-bmp.xml - initial configuration for BMP messages handler service provider and BMP client/server dispatcher settings
  • 42-bmp-example.xml - sample initial configuration for the BMP Monitoring Station application

Server Binding

The default shipped configuration will start a BMP server on 0.0.0.0:12345. You can change this behavior in 42-bmp-example.xml:

  1.  <module>
  2.   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor-impl</type>
  3.   <name>example-bmp-monitor</name>
  4.   <!--<binding-address>0.0.0.0</binding-address>-->
  5.   <binding-port>12345</binding-port>
  6.   ...
  7.  </module>
  • 4: binding-address - adress on which BMP will be started and listen, to change value, uncomment line first
  • 5: binding-port - port on which the address will be started and listen

Multiple instances of the BMP monitoring station (bmp-monitor-impl module) can be created - module name, binding-address and/or binding-port must be unique for each BMP monitoring station instance.

Active mode

OpenDaylight's BMP might be configured to act as an active party of the connection (ODL BMP <-> Monitored router). To enable this functionality, configure monitored-router with mandatory parameters: address (must be unique for each configured "monitored-router"), port, active. See following example from 42-bmp-example.xml:

  1. <monitored-router>
  2.    <address>192.0.2.2</address>
  3.    <port>1234</port>
  4.    <active>true</active>
  5. </monitored-router>

3-node Clustering

In a case of a 3 node clustering setup for BMP, where each node is running it's own BMP instance, following configuration changes are required to be done for each PCE node instance.

  • BMP monitoring station: Each BMP instance has to have a unique "name"

Before starting ODL, modify a file: distribution-karaf-*/system/org/opendaylight/bgpcep/bgp-controller-config/*/bgp-controller-config-*-bmp-config-example.xml

 <!-- node 1 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor-impl</type>
  <name>example-bmp-monitor-1</name>
  ...
 </module>
...
 <service>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor</type>
  <instance>
   <name>example-bmp-monitor-1</name>
   <provider>/config/modules/module[name='bmp-monitor-impl']/instance[name='example-bmp-monitor-1']</provider>
  </instance>
 </service>
...
 <!-- node 2 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor-impl</type>
  <name>example-bmp-monitor-2</name>
  ...
 </module>
...
 <service>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor</type>
  <instance>
   <name>example-bmp-monitor-2</name>
   <provider>/config/modules/module[name='bmp-monitor-impl']/instance[name='example-bmp-monitor-2']</provider>
  </instance>
 </service>
...
 <!-- node 3 -->
 <module>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor-impl</type>
  <name>example-bmp-monitor-3</name>
  ...
 </module>
...
 <service>
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">prefix:bmp-monitor</type>
  <instance>
   <name>example-bmp-monitor-3</name>
   <provider>/config/modules/module[name='bmp-monitor-impl']/instance[name='example-bmp-monitor-3']</provider>
  </instance>
 </service>

Configuration through RESTCONF

Another method how to configure BGP/PCEP is dynamically through RESTCONF. Before you start, make sure, you've completed steps 1-5 in Installation Guide. Instead of restarting Karaf, install another feature, that provides you the access to 'restconf/config/' URLs.

feature:install odl-netconf-connector-all

To check what modules you have currently configured, check following link: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/

This URL is also used to POST new configuration. If you want to change any other configuration that is listed here, make sure you include the correct namespaces. RESTCONF will tell you if some namespace is wrong.

To update an existing configuration use PUT and give the full path to the element you wish to update.

BGP Configuration

It is vital that you respect the order of steps described in user guide. For more information about the fields, check this section.

RIB

First, configure RIB.

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:rib-impl/example-bgp-rib

PUT:

  1. <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.   <name>example-bgp-rib</name>
  3.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-impl</type>
  4.   <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  5.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
  6.     <name>runtime-mapping-singleton</name>
  7.   </codec-tree-factory>
  8.   <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  9.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
  10.     <name>inmemory-data-broker</name>
  11.   </dom-data-provider>
  12.   <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  13.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
  14.     <name>global-rib-extensions</name>
  15.   </extensions>
  16.   <local-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">64496</local-as>
  17.   <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  18.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type>
  19.     <name>pingpong-binding-data-broker</name>
  20.   </data-provider>
  21.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  22.     <type>bgp-table-type</type>
  23.     <name>ipv4-unicast</name>
  24.   </local-table>
  25.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  26.     <type>bgp-table-type</type>
  27.     <name>ipv6-unicast</name>
  28.   </local-table>
  29.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  30.     <type>bgp-table-type</type>
  31.     <name>linkstate</name>
  32.   </local-table>
  33.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  34.     <type>bgp-table-type</type>
  35.     <name>ipv4-flowspec</name>
  36.   </local-table>
  37.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  38.     <type>bgp-table-type</type>
  39.     <name>ipv6-flowspec</name>
  40.   </local-table>
  41.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  42.     <type>bgp-table-type</type>
  43.     <name>ipv4-flowspec-l3vpn</name>
  44.   </local-table>
  45.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  46.     <type>bgp-table-type</type>
  47.     <name>ipv6-flowspec-l3vpn</name>
  48.   </local-table>
  49.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  50.     <type>bgp-table-type</type>
  51.     <name>ipv4-labeled-unicast</name>
  52.   </local-table>
  53.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  54.     <type>bgp-table-type</type>
  55.     <name>ipv6-labeled-unicast</name>
  56.   </local-table>
  57.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  58.      <type>bgp-table-type</type>
  59.      <name>ipv4-l3vpn</name>
  60.   </local-table>
  61.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  62.      <type>bgp-table-type</type>
  63.      <name>ipv6-l3vpn</name>
  64.   </local-table>
  65.   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  66.     <type>bgp-table-type</type>
  67.     <name>evpn</name>
  68.  </local-table>
  69.   <!--
  70.   <rib-path-selection-mode xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  71.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-path-selection-mode</type>
  72.     <name>ipv4-unicast-path-selection-mode</name>
  73.    </rib-path-selection-mode>
  74.    -->
  75.   <bgp-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.2</bgp-rib-id>
  76.   <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-bgp-rib</rib-id>
  77.   <openconfig-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  78.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp-openconfig-spi">x:bgp-openconfig-provider</type>
  79.     <name>openconfig-bgp</name>
  80.   </openconfig-provider>
  81.     <bgp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  82.     <type>bgp-dispatcher</type>
  83.     <name>global-bgp-dispatcher</name>
  84.   </bgp-dispatcher>
  85. </module>
  • 16 : local-as - change this value
  • 49 : bgp-rib-id - change the value
  • 53-56: ""path-selection-mode"" - Uncomment if Add Path desired

MIGHT NOT BE NEEDED: depending on your BGP router, you might need a switch from linkstate attribute type 99 to 29. Check with your router vendor. Switch the field to true if your router supports type 29.

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

PUT:

 <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">x:bgp-linkstate</type>
  <name>bgp-linkstate</name>
  <iana-linkstate-attribute-type xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate">true</iana-linkstate-attribute-type>
 </module>

BGP Peer

We also need to add new module to configuration (bgp-peer). In this case, the whole module needs to be configured.

POST:

  1.  <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer</type>
  3.   <name>example-bgp-peer</name>
  4.   <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.1</host>
  5.   <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">180</holdtimer>
  6.   <retrytimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">10</retrytimer>
  7.   <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">ibgp</peer-role> 
  8.   <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  9.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
  10.    <name>example-bgp-rib</name>
  11.   </rib>
  12.   <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  13.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer-registry</type>
  14.    <name>global-bgp-peer-registry</name>
  15.   </peer-registry>
  16.   <rpc-registry>
  17.    <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
  18.    <name>binding-rpc-broker</name>
  19.   </rpc-registry>
  20.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  21.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  22.    <name>ipv4-unicast</name>
  23.   </advertized-table>
  24.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  25.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  26.    <name>ipv6-unicast</name>
  27.   </advertized-table>
  28.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  29.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  30.    <name>linkstate</name>
  31.   </advertized-table>
  32.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  33.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  34.    <name>ipv4-flowspec</name>
  35.   </advertized-table>
  36.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  37.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  38.    <name>ipv6-flowspec</name>
  39.   </advertized-table>
  40.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  41.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  42.    <name>ipv4-labeled-unicast</name>
  43.   </advertized-table>
  44.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  45.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
  46.    <name>ipv6-labeled-unicast</name>
  47.   </advertized-table>
  48.   <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  49.    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
  50.    <name>ipv4-l3vpn</name>
  51.   </advertized-table>
  52.   <advertized-table>
  53.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
  54.     <name>evpn</name>
  55.   </advertized-table>
  56.   <add-path>
  57.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:add-path</type>
  58.     <name>ipv4-unicast-both</name>
  59.   </add-path>
  60.  </module>
  • 4 : host - IP address where this peer should connect
  • 6 : peer-role - ibgp, ebgp or rr-client

This is all necessary information that you need to get ODL connect to your speaker.

BGP Path Selection Mode

If Path selection mode is desired then we need to configure corresponding modules and services. Below example is for N Paths selection mode configured for Ipv4 unicas family

A

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-path-selection-mode:advertise-n-paths/n-paths

Content-Type: application/xml

Method: PUT

Body:

  1.     <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.         <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">x:advertise-n-paths</type>
  3.         <name>n-paths</name>
  4.         <n-best-paths xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">2</n-best-paths>
  5.     </module>

B

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-psm-impl/ipv4-unicast-path-selection-mode

Content-Type: application/xml

Method: PUT

Body:

  1.     <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-psm-impl</type>
  3.     <name>ipv4-unicast-path-selection-mode</name>
  4.     <path-address-family xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  5.         <type>bgp-table-type</type>
  6.         <name>ipv4-unicast</name>
  7.     </path-address-family>
  8.     <path-selection-mode xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  9.         <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">prefix:path-selection-mode-factory</type>
  10.         <name>n-paths</name>
  11.     </path-selection-mode>
  12. </module>


POST:
A

URL: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:services/service/odl-bgp-path-selection-mode:path-selection-mode-factory

Content-Type: application/xml

Method: PUT

Body:

  1. <service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.         <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:path:selection:mode">x:path-selection-mode-factory</type>
  3.         <instance>
  4.             <name>n-paths</name>
  5.             <provider>/modules/module[type='advertise-n-paths'][name='n-paths']</provider>
  6.         </instance>
  7.     </service>

B

URL: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:services/service/odl-bgp-rib-impl-cfg:bgp-path-selection-mode

Content-Type: application/xml

Method: PUT

Body:

  1. <service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-path-selection-mode</type>
  3.     <instance>
  4.     <name>ipv4-unicast-path-selection-mode</name>
  5.     <provider>/modules/module[type='bgp-psm-impl'][name='ipv4-unicast-path-selection-mode']</provider>
  6.     </instance>
  7. </service>

BGP Application Peer

Change the value in bold bgp-peer-id which is your local BGP-ID that will be used in BGP Best Path Selection algorithm.

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-application-peer/example-bgp-peer-app

PUT:

  1.  <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
  3.   <name>example-bgp-peer-app</name>
  4.   <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">10.25.1.9</bgp-peer-id> 
  5.   <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  6.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
  7.    <name>example-bgp-rib</name>
  8.    </target-rib>
  9.   <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
  10.   <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
  11.    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
  12.    <name>pingpong-broker</name>
  13.   </data-broker>
  14.  </module>
  • 4 : bgp-peer-id - your local BGP-ID

In order to get routes advertised to other peers, you have to also configure the peers, like it's described in this section.

BMP Configuration

Server Binding

To change parameters of BMP monitoring station instance.

URL: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/config:module/odl-bmp-impl-cfg:bmp-monitor-impl/example-bmp-monitor

Content-Type: application/xml

Method: PUT

Body:

  1. <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.   <name>example-bmp-monitor</name>
  3.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">x:bmp-monitor-impl</type>
  4.   <bmp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  5.     <type>bmp-dispatcher</type>
  6.     <name>global-bmp-dispatcher</name>
  7.   </bmp-dispatcher>
  8.   <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  9.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
  10.     <name>runtime-mapping-singleton</name>
  11.   </codec-tree-factory>
  12.   <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  13.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
  14.     <name>global-rib-extensions</name>
  15.   </extensions>
  16.   <binding-address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">0.0.0.0</binding-address>
  17.   <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  18.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
  19.     <name>pingpong-broker</name>
  20.   </dom-data-provider>
  21.   <binding-port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">12345</binding-port>
  22. </module>

Change value at line 16 and/or 21.

Active mode

To add active reconnecting client for BMP monitoring station instance.

URL: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/config:module/odl-bmp-impl-cfg:bmp-monitor-impl/example-bmp-monitor

Content-Type: application/xml

Method: PUT

Body:

  1.   <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  2.   <name>example-bmp-monitor</name>
  3.   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">x:bmp-monitor-impl</type>
  4.   <bmp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  5.     <type>bmp-dispatcher</type>
  6.     <name>global-bmp-dispatcher</name>
  7.   </bmp-dispatcher>
  8.   <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  9.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
  10.     <name>runtime-mapping-singleton</name>
  11.   </codec-tree-factory>
  12.   <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  13.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
  14.     <name>global-rib-extensions</name>
  15.   </extensions>
  16.   <binding-address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">0.0.0.0</binding-address>
  17.       <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  18.     <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
  19.     <name>pingpong-broker</name>
  20.   </dom-data-provider>
  21.   <binding-port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">12345</binding-port>
  22.   <monitored-router xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">
  23.     <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">127.0.0.1</address>
  24.     <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">1234</port>
  25.     <active xmlns="urn:opendaylight:params:xml:ns:yang:controller:bmp:impl">true</active>
  26.   </monitored-router>
  27. </module>

Change values at line 23 and 24.

Note: Multiple instances of "monitored-router" might be added.

OpenConfig BGP

The OpenDaylight's BGP OpenConfig implementation offers an alternative way for BGP components configuration. For more info about OpenConfig BMP at http://www.openconfig.net/ and draft-ietf-idr-bgp-model-00

  • Prerequisites: installed feature odl-restconf, odl-netconf-connector-ssh

RIB

Following sample shows how to reconfigure initial BGP RIB instance - change Router ID (equivalent of bgp-rib-id) and AS Number (local-as) Actually, it is possible to hold only instance of the BGP RIB.

RESTCONF

URL: http://localhost:8181/restconf/config/openconfig-bgp:bgp/global/config

Method: PUT

Content-Type: application/xml

Body:

  1. <config xmlns="http://openconfig.net/yang/bgp">
  2.   <router-id>192.0.2.3</router-id>
  3.   <as>64495</as>
  4. </config>

Java API

  1. final ConfigBuilder bgpConfigBuilder = new ConfigBuilder();
  2. bgpConfigBuilder.setAs(new AsNumber(64495L));
  3. bgpConfigBuilder.setRouterId(new Ipv4Address("192.0.2.3"));
  4.  
  5. final InstanceIdentifier<Config> bgpConfigIId = InstanceIdentifier.create(Bgp.class).child(Global.class).child(Config.class);
  6. final WriteTransaction wTx = ...newWriteOnlyTransaction();
  7. wTx.put(LogicalDatastoreType.CONFIGURATION, bgpConfigIId, bgpConfigBuilder.build());
  8. wTx.submit();

BGP Peer

Following sample shows how to add a new Neighbor (peer) configuration instance.

RESTCONF

URL: http://localhost:8181/restconf/config/openconfig-bgp:bgp/openconfig-bgp:neighbors

Method: POST

Content-Type: application/xml

Body:

  1. <neighbor xmlns="http://openconfig.net/yang/bgp">
  2.   <neighbor-address>192.0.2.1</neighbor-address>
  3.   <afi-safis>
  4.     <afi-safi>
  5.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
  6.     </afi-safi>
  7.     <afi-safi>
  8.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
  9.     </afi-safi>
  10.     <afi-safi>
  11.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
  12.     </afi-safi>
  13.     <afi-safi>
  14.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
  15.     </afi-safi>
  16.     <afi-safi>
  17.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
  18.     </afi-safi>
  19.     <afi-safi>
  20.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
  21.     </afi-safi>
  22.     <afi-safi>
  23.       <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
  24.     </afi-safi>
  25.     <afi-safi>
  26.       <afi-safi-name xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">x:LINKSTATE</afi-safi-name>
  27.     </afi-safi>
  28.     <afi-safi>
  29.       <afi-safi-name xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">x:IPV4-FLOW</afi-safi-name>
  30.     </afi-safi>
  31.     <afi-safi>
  32.       <afi-safi-name xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">x:IPV6-FLOW</afi-safi-name>
  33.     </afi-safi>
  34.     <afi-safi>
  35.       <afi-safi-name xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">x:IPV4-L3VPN-FLOW</afi-safi-name>
  36.     </afi-safi>
  37.     <afi-safi>
  38.       <afi-safi-name xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">x:IPV6-L3VPN-FLOW</afi-safi-name>
  39.     </afi-safi>
  40.   </afi-safis>
  41.   <route-reflector>
  42.     <config>
  43.       <route-reflector-client>false</route-reflector-client>
  44.     </config>
  45.   </route-reflector>
  46.   <timers>
  47.     <config>
  48.       <hold-time>180</hold-time>
  49.     </config>
  50.   </timers>
  51.   <transport>
  52.     <config>
  53.       <passive-mode>false</passive-mode>
  54.     </config>
  55.   </transport>
  56.   <config>
  57.     <peer-type>INTERNAL</peer-type>
  58.     <peer-as>64496</peer-as>
  59.   </config>
  60. </neighbor>

Java API

final NeighborBuilder neighborBuilder = new NeighborBuilder();
 
neighborBuilder.setAfiSafis(new AfiSafisBuilder().setAfiSafi(Lists.newArrayList(
    new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(IPV6UNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(IPV4LABELLEDUNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(IPV6LABELLEDUNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(L3VPNIPV4UNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(L3VPNIPV6UNICAST.class).build(),
    new AfiSafiBuilder().setAfiSafiName(L2VPNEVPN.class).build(),
    new AfiSafiBuilder().setAfiSafiName(LINKSTATE.class).build(),
    new AfiSafiBuilder().setAfiSafiName(IPV4FLOW.class).build(),
    new AfiSafiBuilder().setAfiSafiName(IPV6FLOW.class).build())).build());
 
neighborBuilder.setConfig(
    new ConfigBuilder()
        .setPeerAs(new AsNumber(64496L))
        .setPeerType(PeerType.INTERNAL)
        .build());
 
neighborBuilder.setNeighborAddress(new IpAddress(new Ipv4Address("192.0.2.1")));
 
neighborBuilder.setKey(new NeighborKey(neighborBuilder.getNeighborAddress()));
 
neighborBuilder.setRouteReflector(new RouteReflectorBuilder().setConfig(
    new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.route.reflector.ConfigBuilder()
        .setRouteReflectorClient(false)
        .build()).build());
 
neighborBuilder.setTimers(new TimersBuilder().setConfig(
    new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.timers.ConfigBuilder()
        .setHoldTime(BigDecimal.valueOf(180L))
        .build()).build());
 
neighborBuilder.setTransport(new TransportBuilder().setConfig(
    new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.transport.ConfigBuilder()
        .setPassiveMode(false)
        .build()).build());
 
final InstanceIdentifier<Neighbor> neighborIId = InstanceIdentifier.create(Bgp.class).child(Neighbors.class).child(Neighbor.class,
    neighborBuilder.getKey());
final WriteTransaction wTx = ...newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.CONFIGURATION, neighborIId, neighborBuilder.build());
wTx.submit();

BGP Application Peer

Following sample shows how to add a new application peer configuration instance. The application peer is represented as Neighbor in the OpenConfig API, belonging to peer group application-peers.

RESTCONF

URL: http://localhost:8181/restconf/config/openconfig-bgp:bgp/openconfig-bgp:neighbors

Method: POST

Content-Type: application/xml

Body:

  1. <neighbor xmlns="http://openconfig.net/yang/bgp">
  2.   <neighbor-address>10.25.1.9</neighbor-address>
  3.   <config>
  4.     <peer-group>application-peers</peer-group>
  5.   </config>
  6. </neighbor>

Java API

  1. final NeighborBuilder neighborBuilder = new NeighborBuilder();
  2. neighborBuilder.setConfig(
  3.     new ConfigBuilder()
  4.         .addAugmentation(Config1.class, new Config1Builder().setPeerGroup("application-peers").build())
  5.         .build());
  6.  
  7. neighborBuilder.setNeighborAddress(new IpAddress(new Ipv4Address("10.25.1.9")));
  8.  
  9. neighborBuilder.setKey(new NeighborKey(neighborBuilder.getNeighborAddress()));
  10.  
  11. final InstanceIdentifier<Neighbor> neighborIId = InstanceIdentifier.create(Bgp.class).child(Neighbors.class).child(Neighbor.class,
  12.     neighborBuilder.getKey());
  13. final WriteTransaction wTx = ...newWriteOnlyTransaction();
  14. wTx.put(LogicalDatastoreType.CONFIGURATION, neighborIId, neighborBuilder.build());
  15. wTx.submit();