Download - Opendaylight app development
![Page 1: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/1.jpg)
ODL App DevelopmentVijay Anand R
![Page 2: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/2.jpg)
Mobile Software Trends..
![Page 3: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/3.jpg)
Why SDN ?
![Page 4: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/4.jpg)
SDN
Brain child of clean slate initiative.. from Stanford.. and active contributions from UC Berekley.
The current network architecture closed for innovation.
SDN is all about abstraction. Control Plane and Data Plane completely
abstracted. Control Plane now runs in a central location and
programs the forwarding elements. OpenFlow is used to program the Forwarding
Elements – rules to handle incoming traffic.
![Page 5: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/5.jpg)
Flow Table Entries(MATCH RULES)
H E A D E R F I E L D S
AC T I O N S C O U N T E R S
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Ingress port
Source
MAC
Dest MAC
Ether
Type
VLAN ID
VLAN priorit
y
IPSRC
IPDEST
IP Protoco
l
IP TOS
TCP/UDPSRC
TCP/UDPDEST
1 2 3 4 5 6 7 8 9 10 11 12
HEADER F IELDS
12 Tup le key
![Page 6: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/6.jpg)
Flow Table Entries(ACTIONS)
HEADER F IELDS
ACT IONS COUNTERS
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
ACTIONSActions To be performed upon a matchForward out all ports except input ports (flood)Forward to group of ports (multicast)Redirect to Controller (controller packet)
Forward to local CPU (punt path)Forward to destination port (unicast routing)Drop packet (limited queueing QOS capabilities)
![Page 7: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/7.jpg)
Flow Table Entries(Counters)
HEADER F IELDS
ACT IONS COUNTERS
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
COUNTERSCounters – To keep track of stats Forward out all ports except input ports
(flood) Per Table counters (active entries, packet
lookups, packet matches) Per Flow Counters ( Received packets,
Received Bytes, Duration of the flow)
Per Queue (Transmit packets, Transmit Bytes , TX Overrun Errors)
Per Port Counters ( Received Packets, Transmit Packets, Received Bytes, Transmit Bytes, Received Drops…...
![Page 8: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/8.jpg)
SDN Network PARADIGM
Network Virtualization
Layer
Network OS / SDN Contro l ler
APP
APP
APP
APP
Data PathForwarding
TableData Path
Forwarding Table
Data PathForwarding
Table
NETC
ON
F
ONEPK
North Bound APIs
North Bound APIs
N o r t h B o u n d A P I s
ANDROID OS
APPs
Mobile Phone
Hardware
OPEN
FLOW
![Page 9: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/9.jpg)
ODL Controller Architecture.
![Page 10: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/10.jpg)
ReST - REpresentational State Transfer
Its an architectural style, based on the current architecture of World Wide Web, with certain constraints.
Every resource in the web is identified by an URI.
Use traditional HTTP methods GET, PUT,POST.
Resource state represented in JSON or XML format.
https://apigee.com/console/facebook
![Page 11: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/11.jpg)
JSON - JavaScript Object Notation
human-readable text to transmit data objects consisting of attribute–value pairs.
{"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"}]}
<employees> <employee> <firstName>John</firstName> <lastName>Doe</lastName> </employee> <employee> <firstName>Anna</firstName> <lastName>Smith</lastName> </employee> <employee> <firstName>Peter</firstName> <lastName>Jones</lastName> </employee></employees>
![Page 12: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/12.jpg)
Environment Setup
Java Setup apt-get install git apt-get install openjdk-7-jre apt-get install openjdk-7-jdk apt-get install maven export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386/
Mininet - Network, host virtualization software. git clone git://github.com/mininet/mininet mininet/util/install.sh –a
Eclipse setup - https://www.eclipse.org/downloads/ From Eclipse, go to Help => Install New Software... Paste "http://download.eclipse.org/technology/m2e/releases" into the "Work
with:" field Select m2e and (optionally) m2e - slf4j both (1.4.0 is current as of the writing of
these instructions) Click Next, OK and Finish else until things install Restart Eclipse when it asks.
![Page 13: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/13.jpg)
Accessing, Building and Running the
Opendaylight Controller
https://wiki.opendaylight.org/view/OpenDaylight_Controller:Pulling,_Hacking,_and_Pushing_the_Code_from_the_CLI
Pulling the code. git clone https://git.opendaylight.org/gerrit/p/controller.git cd controller/opendaylight/distribution/opendaylight/ mvn clean install (uses maven build system, POM.xml is the makefile equivalent). cd target/distribution.opendaylight-osgipackage/opendaylight/ ./run.sh
Prebuild binary download wget https://jenkins.opendaylight.org/controller/job/controller-merge/lastSuccessfulBuild/artifact/
opendaylight/distribution/ opendaylight/target/distribution.opendaylight-osgipackage.zip gunzip distribution.opendaylight-osgipackage.zip cd opendaylight ./run.sh
Run mininet instances. sudo mn --controller=remote,ip=127.0.0.1 --topo=linear,2 (topology with 2 hosts and 2 switches).
Access the Controller http://localhost:8080/ Username : admin Passwd : admin
![Page 14: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/14.jpg)
Simple REST based application
![Page 15: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/15.jpg)
Sample Programs
Download and add the following Jars to you Project Build Path. ODL REST API reference -
https://wiki.opendaylight.org/view/OpenDaylight_Controller:REST_Reference_and_Authentication
Jersey Download Page - The sample program was built using jersey-bundle-1.18.jar jar.
https://jersey.java.net/download.html wget
http://repo1.maven.org/maven2/com/sun/jersey/jersey-bundle/1.18/jersey-bundle-1.18.jar
JavaX Json Bundle Download Page - The sample program was build using javax.json-1.0.4.jar
http://mvnrepository.com/artifact/org.glassfish/javax.json wget http://
repo1.maven.org/maven2/org/glassfish/javax.json/1.0.4/javax.json-1.0.4.jarTopologyRest.java FlowMgr.java
![Page 16: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/16.jpg)
OSGI - Open Service Gateway initiative
OSGi specification defines a component and service model for Java.
The components and services (bundles) can be dynamically installed, activated, de-activated, updated and de-installed.
![Page 17: Opendaylight app development](https://reader036.vdocument.in/reader036/viewer/2022081502/55395e314a79595b7a8b49b4/html5/thumbnails/17.jpg)
Sample Applications.
https://github.com/fredhsu/odl-apps Go to the folder where the controller
code was downloaded using “git clone” cd controller/opendaylight and extract
mystats.tar.gz cd mystats mvn clean install The bundle is built in the target folder. Copy the bundle onto OSGI and verify as
in OSGI_OP.
mystats.tar.gz OSGI_op.txt