Open Network Operating System (ONOS) is an open source network operating system for software-defined networks (SDN). Intended to run on white box switches, ONOS is targeted at mission critical networks, including service providers. It provides benefits including:
ONOS is intended to help service providers migrate their existing networks to white box switches, thus lowering CapEx and OpEx. It was developed in conjunction with service providers including AT&T and NTT Communications.
This document describes how to install ONOS.
INSTALLING ONOS :-
1) INSTALL GIT CORE
$ sudo apt-get install git-core
2) ONOS REQUIREMENTS
System requirements
3) INSTALL MAVEN AND KARAF
Software requirements
i) Maven
Install Maven 3.3.9 on your Applications directory
$ cd ~
$ mkdir Applications
$ wget http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
$ tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ../Applications/
NOTE: Although ONOS has been migrated to Buck, maven was used in earlier releases.
ii) Karaf
Install Karaf 3.0.5 on your Applications directory
$ cd ~
$ cd Applications
$ wget http://archive.apache.org/dist/karaf/3.0.5/apache-karaf-3.0.5.tar.gz
$ tar -zxvf apache-karaf-3.0.5.tar.gz -C ../Applications/
4) INSTALL JAVA 8 and set JAVA_HOME
i) Java 8
$ sudo apt-get install software-properties-common -y
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer oracle-java8-set-default -y
ii) SET YOUR JAVA_HOME
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
iii) VERIFY IT WITH FOLLOWING COMMAND
$ env | grep JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-8-oracle
5) DOWNLOAD THE LATEST ONOS
$ git clone https://gerrit.onosproject.org/onos
$ cd onos
$ git checkout master
6) ENVIRONMENTAL VARIABLES
The ONOS source comes with a sample bash_profile that can set these variables for you.
i) Edit ~/.bashrc
$ nano ~/.bashrc
ii) Add the following line at the end
. ~/onos/tools/dev/bash_profile
iii) Reload .bashrc or log out and log in again to apply the changes
. ~/.bashrc
iv) Once you run the above command, you will see in the output of the env command that several new variables, such as ONOS_ROOT, MAVEN, and KARAF_ROOT, have been set.
$ env | grep ONOS_ROOT
ONOS_ROOT=/Users/nirmalkaria/onos
$ env | grep MAVEN
MAVEN=/Users/nirmalkaria/Applications/apache-maven-3.3.9
$ env | grep KARAF_ROOT
KARAF_ROOT=/Users/nirmalkaria/Applications/apache-karaf-3.0.8
7) BUILD AND DEPLOY ONOS
i) Edit ~/Applications/apache-karaf-3.0.5/etc/org.apache.karaf.features.cfg file by appending the following line to featuresRepositories:
$ nano ~/Applications/apache-karaf-3.0.5/etc/org.apache.karaf.features.cfg
ii) Locate the featuresRepositories and append this line (will need a comma before appending the text to separate from the previous value)
mvn:org.onosproject/onos-features/1.10.0-SNAPSHOT/xml/features
8) BUILD ONOS WITH MAVEN
$ cd ~/onos
$ mvn clean install or use the alias ‘mci’
9) Selecting IP address
Export ONOS4_IP or ONOS_NIC environment variables with the IP address prefix to configure ONOS clustering component. This IP address is the ip address of the controller.
$ export ONOS_IP=10.1.9.255
$ export ONOS_NIC=10.1.9.*
10) Selecting ONOS apps to activate
To configure ONOS with a set of applications that should be automatically activated on startup, use the ONOS_APPS environment variable as follows:
$ export ONOS_APPS=drivers,openflow,proxyarp,mobility,fwd
11) Starting ONOS
$ ok clean Creating local cluster configs for IP 10.1.9.247... Setting up hazelcast.xml for subnet 10.1.9.*... Staging builtin apps... Customizing apps to be auto-activated: drivers,openflow,proxyarp,mobility,fwd... Welcome to Open Network Operating System (ONOS)! ____ _ ______ ____ / __ \/ |/ / __ \/ __/ / /_/ / / /_/ /\ \ \____/_/|_/\____/___/
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 ONOS. onos>
At this point, typing help onos at the prompt should still bring up a list of available commands. Pressing Ctrl-D or logout will exit the CLI. |
METHOD 2
BUILDING ONOS USING BUCK
1) INSTALL JAVA 8 and set JAVA_HOME
i) Java 8
$ sudo apt-get install software-properties-common -y
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer oracle-java8-set-default -y
ii) SET YOUR JAVA_HOME
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
iii) Verify it with the following command
$ env | grep JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-8-oracle
2) Download latest ONOS
$ git clone https://gerrit.onosproject.org/onos
$ cd onos
$ git checkout master
3) Development Environment Setup
The ONOS_ROOT environment variable is exported in the shell profile (.bash_aliases, .profile, etc.)
$ export ONOS_ROOT=~/onos
$ source $ONOS_ROOT/tools/dev/bash_profile
4) Build with Buck
$ sudo apt-get install zip unzip
$ cd $ONOS_ROOT
$ tools/build/onos-buck build onos --show-output
ii) To execute ONOS unit tests,
$ tools/build/onos-buck test
![]()
|
iii) To import the project into IntelliJ
$ tools/build/onos-buck project
5) Run ONOS
$ cd $ONOS_ROOT
$ tools/build/onos-buck run onos-local -- clean debug
i) To attach to the ONOS CLI console, run:
$ tools/test/bin/onos localhost
ii) To open your default browser on the ONOS GUI page, simply type:
$ tools/test/bin/onos-gui localhost or alternatively visit http://localhost:8181/onos/ui