ONOSTutorial
ONOSTutorial
net/publication/316075546
CITATIONS READS
2 4,827
1 author:
Muhammad Imran
National Cyber Security Auditing and Evaluation Lab
9 PUBLICATIONS 256 CITATIONS
SEE PROFILE
All content following this page was uploaded by Muhammad Imran on 13 April 2017.
3
Computing has advanced rapidly over the past three decades.
4
The traditional network devices are:
Closed
Complex
Inflexible
Proprietary
Operationally Expensive
6
Software Defined Networking (SDN) separates the control
plane from the data plane.
7
8
The software defined networks are:
Open
Simple
Flexible
Enterprises
Data centers
10
11
Following are some Open and community driven controllers:
Open Daylight
ONOS (Open Networking Operating System)
Project Floodlight
Beacon
NOX/POX
Open vSwitch
Ryu Controller (supported by NTT Labs)
Faucet (Python based on Ryu for production networks)
12
ONOS is a SDN operating system for service providers to make it
easy to create apps and services.
Top-Level Features:
High availability through clustering and distributed state management.
Scalability through clustering and sharing of network device control.
Northbound abstractions for a global network view, network graph and
application intents.
Pluggable southbound for support of OpenFlow and new or legacy
protocols.
Graphical user interface to view multi-layer topologies and inspect elements
of the topology.
REST API for access to Northbound abstractions as well as CLI commands.
CLI for debugging.
Support for both proactive and reactive flow setup.
13
14
15
In broad scenario, there are four ONOS deployment models
16
Building ONOS
Development Environment
17
In this section, we will build the complete ONOS
development environment from scratch in a Virtual Machine.
18
Following major software are required:
19
The commands at the build machine shell will start with
sdn@ONOS:~$
sdn@ONOS:~$ sudo su
root@ONOS:~#
20
Install Oracle’s Virtual Box
21
22
23
24
25
26
27
28
29
1. Apply proxy setting and password less sudo access (optional)
2. Install pre-requisite software
3. Install Mininet
4. Install Karaf and Maven
5. Install Oracle Java 8
6. Clone ONOS 1.8
7. Apply settings for ONOS 1.8.1
8. Setting up remote system
9. Apply cell settings for ONOS
10. Build ONOS
11. Package ONOS
12. Run ONOS
13. Install IntelliJ IDEA
30
31
In terminal type sudo visudo and add highlighted lines
32
Execute following commands in Linux terminal to install pre-
requisite softwares
33
To download and install Mininet execute following
commands:
34
35
To download and install Appache Karaf and Maven execute
following commands in terminal:
36
37
To install Oracle’s Java 8 execute following commands in
terminal :
38
39
40
41
42
To download the ONOS 1.8 source code
43
To apply settings for ONOS, execute following command in
Linux terminal and add highlighted lines (shown in next
slides) in files:
44
45
46
47
48
There are two options to set remote machine
Make another VM
▪ Create new VM and install Linux as done before
▪ Perform Deployment Steps 1, 2 and 5.
49
To install, download and setup LXC container execute
following commands:
50
Make a new user in sudo group with username “sdn” and
password “rocks” with following commands:
ubuntu@onos1:~$ sudo su
root@onos1:~# adduser sdn
root@onos1:~# adduser sdn sudo
root@onos1:~# exit
ubuntu@onos1:~$ logout
51
To add proxy settings (optional)
52
Repeat step 1 for password less sudo access
sdn@onos1:~$ sudo visudo
53
To make clone of container and for their settings execute
following commands:
sdn@ONOS:~$ sudo lxc-clone onos1 onos2
sdn@ONOS:~$ sudo lxc-start -n onos1 -d
sdn@ONOS:~$ sudo lxc-start -n onos2 -d
sdn@ONOS:~$ sudo lxc-ls -fancy
Now two containers are running to verify and save ssh keys
enter following commands:
sdn@ONOS:~$ ssh sdn@<onos1 IP>
sdn@ONOS:~$ ssh sdn@<onos2 IP>
54
To apply ONOS environment settings execute following
commands:
55
Cell settings can also be applied by making a cell file at the
location showing in file header below
To load cell settings in terminal execute following command:
sdn@ONOS:~$ cell <file-name>
56
After applying cell settings execute following commands to
push key:
57
58
Run the following command to build ONOS:
sdn@ONOS:~$ cd ~/onos
sdn@ONOS:~$ mvn clean install # or use the alias 'mci‘
sdn@ONOS:~$ onos-package
sdn@ONOS:~$ stc setup
sdn@ONOS:~$ onos
59
60
61
62
63
64
65
66
67
To download and install IntelliJ IDEA development tool
perform the following steps:
70
A complete SDN simulation tool with different controllers,
switches and other networking tools like wireshark etc.
Controllers
NOX
Ryu
OVS Controller
Switches
OVSSwitch
IVSSwitch
LinuxBridge
OVSBridge
71
To make basic topology
$ sudo mn
To display mininet CLI commands
mininet> help
To display nodes
mininet> nodes
To display links
mininet> links
To display network
mininet> net
To dump information about all nodes
mininet> dump
72
To execute a command on a specific node
mininet> h1 ifconfig ‐a
mininet> s1 ifconfig ‐a
mininet> h1 ps ‐a
mininet> s1 ps ‐a
73
To ping from host 1 to host 2
mininet> h1 ping ‐c 1 h2
74
Run a Regression Test
$ sudo mn ‐‐test pingpair
Run a bandwidth test
$ sudo mn ‐‐test iperf
Link variations
$ sudo mn ‐‐link tc,bw=10,delay=10ms
mininet> iperf
mininet> h1 ping ‐c10 h2
Adjustable verbosity
$ sudo mn ‐v debug
75
To make single topology
$ sudo mn ‐‐topo single,3
76
For more complex debugging, you can start Mininet so that it
spawns one or more xterms.
To start an xterm for every host and switch, pass the ‐x option
$ sudo mn ‐x
77
For fault tolerance testing, it can be helpful to bring links up
and down
78
The ONOS is very useful to learn the basic knowledge of SDN.
79
To see help
onos> help
To check hosts
onos> hosts
80
To check links between devices
onos> links [device]
To check flows
onos> flows
To check paths
onos> paths device1 device2
To check intents
onos> intents
81
To check all installed applications
onos> apps -s
To activate an application
onos> app activate org.onosproject.fwd
To deactivate an application
onos> app deactivate org.onosproject.fwd
82
ONOS has ability to show the topology in graphical form in
the browser.
83
84
In addition to topology view, ONOS GUI also has:
Summary pane
▪ It shows you a summary of what is going on at this ONOS cluster
Switch details
▪ This pane gives information about the switch
Host details
▪ This pane gives information about the host
Instance pane
▪ The GUI has the ability to show which ONOS instances are active
Show traffic
▪ Show traffic between hosts
Install intents
85
86
87
88
This component of ONOS is used for development purpose.
89
Run IntelliJ IDEA
Select "Import Project" and import the onos-byon project.
Import the project from external model, and select "Maven".
Check "Sources" and "Documentation" in the Automatically
download section
Click 'Next' and click next as well on the following window.
Pick Java 8 in the next window by first clicking on the green '+'
sign and JDK
Select 'java-8-oracle‘ from jvm directory and click 'ok'
Finally click on 'Finish‘
90
To build new application
cd $ONOS_ROOT/tools/package/archetypes
mci
cd
To build new application
onos‐create‐app
Enter appropriate parameters
Define value for property 'groupId': : org.foo
Define value for property 'artifactId': : foo‐app
Define value for property 'version': 1.0‐SNAPSHOT: :
Define value for property 'package': org.foo: : org.foo.app
Confirm properties configuration:
groupId: org.foo
artifactId: foo‐app
version: 1.0‐SNAPSHOT
package: org.foo.app
Y: :
91
To build new application unzip the downloaded onos-byon.zip
Open a new terminal and enter following commands:
sdn@ONOS:~$ cell <settings>
sdn@ONOS:~$ cd onos-byon
sdn@ONOS:~$ mci
sdn@ONOS:~$ onos-app $OC1 install target/byon-1.0-
SNAPSHOT.oar
sdn@ONOS:~$ onos> apps -s app activate org.onos.byon
sdn@ONOS:~$ onos> apps -s -a
sdn@ONOS:~$ onos> list-networks
92
93
94
95
96
97
To rebuild an application enter following commands:
sdn@ONOS:~$ cell <settings>
sdn@ONOS:~$ cd onos-byon
sdn@ONOS:~$ mci
sdn@ONOS:~$ onos-app $OC1 reinstall target/byon-1.1-
SNAPSHOT.oar
sdn@ONOS:~$ onos> apps -s app activate org.onos
sdn@ONOS:~$ onos> apps -s -a
sdn@ONOS:~$ onos> list-networks
98
99
Questions?
100
http://onosproject.org/
https://wiki.onosproject.org/display/ONOS/Wiki+Home
https://github.com/
https://www.opennetworking.org/
http://opennetsummit.org/
http://searchsdn.techtarget.com/
https://en.wikipedia.org/wiki/
101
View publication stats