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 :
- a BGP linkstate speaker talking to ODL
- a PCE peer talking PCEP to ODL
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 ! neighbor 192.168.255.2 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 pce peer ipv4 192.168.255.2 ! address ipv4 192.168.255.1 stateful-client instantiation ! ! ! 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 ! RP/0/0/CPU0:iosxrv-1#
As you can see, nothing complicated :
- ODL controller and iosxrv1 share 192.168.255.0/30 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 :
- warm up : untar the distribution in your VM
- start karaf shell (located in « bin » directory of the distribution), this will launch a container and start the whole ODL controller
- play with karaf shell to understand the basics
- install the following features :
odl-bgpcep-all ==> BGP-LS and PCEP features
odl-restconf-all ==> REST
odl-dlux-all ==> basic UI showing controller data
- remove 05-clustering.xml from « ./etc/opendaylight/karaf » because this could cause some problems in a standalone environment
- 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)
- 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)
- 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 /0.0.0.0:8101 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. opendaylight-user@root>logout amoretti@linuxvm:~/distribution-karaf-0.2.1-Helium-SR1$
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 169.254.0.101, 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 192.168.255.2 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 [V][L1][I0x1][N[c1][b169.254.0.101][s1692.5400.0014.00]]/328 192.168.255.1 Local 192.168.255.2 [V][L2][I0x1][N[c1][b169.254.0.101][s1692.5400.0001.00]]/328 192.168.255.1 Local 192.168.255.2 <snip> RP/0/0/CPU0:iosxrv-1#sho mpls traffic-eng pce peer stateful Mon Feb 2 12:46:20.927 UTC <snip> PCE Address 192.168.255.2 State Up PCEP has been up for: 4w2d <snip> Stateful Update capability Instantiation capability RP/0/0/CPU0:iosxrv-1#
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/
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) result.close() ### #access to data... #highest level : #print(r['network-topology']['topology']) # #node or link content : #print(r['network-topology']['topology']['node']) #print(r['network-topology']['topology']['link']) # #nodes id list : print '\nlist of node names:\n' for n in r['network-topology']['topology']['node']: print n['l3-unicast-igp-topology:igp-node-attributes']['name']
And the output :
amoretti@linuwvm:~$ amoretti@linuxvm:~$ view_nodenames.py list of node names: iosxrv-4 iosxrv-3 csr1000v-1 iosxrv-1 csr1000v-4 csr1000v-3 iosv-8 iosxrv-2 iosv-7 iosv-6 iosxrv-1 iosv-5 iosv-1 iosv-2 iosv-3 csr1000v-2 iosv-4 amoretti@linuxvm:~$
A simple network topology graphing tool…
work in progress 🙂