Networking stuff | findings from experience…

Single post

How to start with OpenDayLight automation for WAN ??

Would you like to evaluate ODL in a WAN environment ?
Test BGP-LS and collect your IGP topology ?
Try to setup and teardown some LSPs if your network is MPLS TE enabled ?
Query and configure your network devices without even using SNMP or CLI ?

Then you came to the right place, hopefully…

The purpose of this post is to give you a starting point on how you can test ODL capabilities regarding WAN automation, nothing more…

The pieces of software I have used in this setup

  • CML for « Cisco Modeling Lab » network virtualisation solution.
    However, this is not required and you can use any alternate virtual solution (see here for a totally free VirtualBox IOS XR network solution).
    If you have a real lab, that would be better for sure…
  • Cisco virtual instances : XRv, CSR1000v and IOSv
    Once again, not a requirement, you only need a single instance (or actual router) running IOS XR 5.1.2 at least, in order to comply with BGP-LS and PCEP implementations running in ODL.
  • One Debian Linux VM with 1GB RAM – Intel Xeon 3.5GHz
  • OpenDayLight Helium SR1 « Karaf » distribution, latest release here : Pre-Build Tar File
  • Postman, a great solution to query ODL controller using REST methods
  • Python as a scripting language to build a very basic and dumb application on top of ODL

The network topology

First of all, I have built the following topology in CML, with IPv4 addressing, ISIS routing and MPLS Traffic engineering enabled on all nodes :


Then, I have installed my small Linux VM in the cloud called « flat » in the above picture.

The only thing that you have to care about here is IP connectivity between the VM that will become your ODL controller and the « special instance » (here iosxrv1) that will become :

  1. a BGP linkstate speaker talking to ODL
  2. a PCE peer talking PCEP to ODL

Router Configuration

Here below the relevant configuration of iosxrv1 :

RP/0/0/CPU0:iosxrv-1#sho run router bgp
Mon Feb  2 10:24:02.302 UTC
router bgp 1
 address-family link-state link-state
  remote-as 1
  session-open-mode passive-only
  address-family link-state link-state
RP/0/0/CPU0:iosxrv-1#sho run mpl traffic-eng pce
Mon Feb  2 10:24:08.412 UTC
mpls traffic-eng
  peer ipv4
  address ipv4
RP/0/0/CPU0:iosxrv-1#sho run router isis 1 distribute bgp-ls 
Tue Feb 24 15:01:30.625 UTC
router isis 1
 distribute bgp-ls


As you can see, nothing complicated :

  • ODL controller and iosxrv1 share subnet
  • BGP passive open-mode to avoid TCP SYN coming from iosxrv1
  • if you want to use PCEP, the whole network has to be MPLS TE enabled, and the above piece of config is mandatory to allow for a statefull PCEP connection between ODL and the PCE peer (here iosxrv1)

ODL installation and setup

The OpenDayLight website provides tons of information on how to install and customize the controller.

In this section I will focus only on BGP-LS and PCEP features, and the simplest way to activate both of them :

    1. warm up : untar the distribution in your VM
    2. start karaf shell (located in « bin » directory of the distribution), this will launch a container and start the whole ODL controller
    3. play with karaf shell to understand the basics
    4. install the following features :
      odl-bgpcep-all ==> BGP-LS and PCEP features
      odl-restconf-all ==> REST
      odl-dlux-all ==> basic UI showing controller data
    5. remove 05-clustering.xml from « ./etc/opendaylight/karaf » because this could cause some problems in a standalone environment
    6. edit 41-bgp-example.xml in same directory and follow instructions given in comments. Basically, you will have to conform to your addressing plan (IPv4+ASN)
    7. edit 32-pcep… and 39-pcep… to declare version 02 of draft
      version 07 does not work with XR 5.1.2 ( you can read this link for further details)
    8. exit from karaf shell and start/stop/probe ODL by using start/stop/status scripts located in « bin » directory.
      Note that even if you don’t use karaf container, you can still access karaf shell by using the « client » script in « bin » directory.
amoretti@linuxvm:~/distribution-karaf-0.2.1-Helium-SR1$ ./bin/status
Running ...
amoretti@linuxvm:~/distribution-karaf-0.2.1-Helium-SR1$ ./bin/client
Logging in as karaf
346 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at / presented unverified key: 

    ________                       ________                .__  .__       .__     __
    \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
     /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
    /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
    \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
            \/|__|        \/     \/        \/     \/\/            /_____/      \/          

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.


Check BGP and PCEP status

From now on, your special instance « iosxrv1 », the one ODL is talking to, should be a working BGP-LS peer as well as a valid stateful PCEP peer.
In order to check this out :

RP/0/0/CPU0:iosxrv-1#sho bgp link-state link-state summary
Mon Feb  2 12:44:52.293 UTC
BGP router identifier, local AS number 1
BGP generic scan interval 60 secs
BGP table state: Active
Table ID: 0x0   RD version: 121
BGP main routing table version 121
BGP scan interval 60 secs

BGP is operating in STANDALONE mode.

Process       RcvTblVer   bRIB/RIB   LabelVer  ImportVer  SendTblVer  StandbyVer
Speaker             121        121        121        121         121         121

Neighbor        Spk    AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down  St/PfxRcd     0     1  285976  513507      121    0    0     4w2d          0

RP/0/0/CPU0:iosxrv-1#sho bgp link-state link-state advertised summary
Mon Feb  2 12:45:04.092 UTC
Network            Next Hop        From            Advertised to
RP/0/0/CPU0:iosxrv-1#sho mpls traffic-eng pce peer stateful
Mon Feb  2 12:46:20.927 UTC
PCE Address
State Up
  PCEP has been up for: 4w2d
  Update capability
  Instantiation capability

OK that sounds good…

In case you have a problem here :

      • double check your config
      • check out ODL logs for error (located in « data/log » subdir)
      • try to debug from your router : you have a lot of information already available by using either « show bgp link-state link-state » and « show mpls traffic-eng pce trace » CLI commands.

Start to play with ODL APIs

Now the funny part !!
There are many ways to query your ODL controller, I will show you three of them :

Use a web browser

Pretty simple… you can use any web browser to query the REST API.
Authentication is « admin/admin » by default.
Don’t forget that you can query your controller remotely by changing « localhost » in the URL below…
Here is the URL where you will find API documentation as well as a tool to test all the documented primitives : http://localhost:8181/apidoc/explorer/

Here is the URL that you can use if you want to play with raw HTTP queries : http://localhost:8181/restconf/operational/network-topology:network-topology/

Use Postman

Postman is a very convenient tool for REST operations, the following URL is a good starting point :


Use Dlux embedded Yang UI

A nice interface to look into data stored in the controller : http://localhost:8181/dlux/index.html#/yangui/index

Log in with admin/admin


click on « yangUI », then expand config>operational>network-topology and select your link state topology :



Now you can display the topology and a nice and accurate graph pops up, showing all devices and attached links, as well as more information when you « mouseHover » :


Build your own App, on top of ODL…

Even funnier !
Here is a very small script that can show you the list of node names in the network, assuming you run ISIS on your nodes and BGP-LS with one instance :

#!/usr/bin/env python
import urllib
import json
from pprint import pprint

result = urllib.urlopen('http://admin:admin@localhost:8181/restconf/operational/network-topology:network-topology/')
r = json.load(result.fp)
#access to data...
#highest level :
#node or link content :
#nodes id list :
print '\nlist of node names:\n'
for n in r['network-topology']['topology'][2]['node']:
   print n['l3-unicast-igp-topology:igp-node-attributes']['name']

And the output :


list of node names:


A simple network topology graphing tool…

work in progress 🙂

2015 Apr 22 : I’ve given up with this, since BLT by provides a very good graphic view of BGP LS data…

02 Fév 2015

There are no comments for How to start with OpenDayLight automation for WAN ??

Laisser un commentaire

  • Google add

  • Commentaires récents

    • Latest Tweets

    • Archives