This workflow is recommended for developers who want an easy, end-to-end workflow that automatically creates a single or multiple-node ONOS controller and a Mininet-modeled control and data network, all in a single VM, on a single development machine (typically a laptop with a few gigabytes of memory and an Ubuntu VM running in VirtualBox.) It can also run on a hardware server (or laptop) running Ubuntu natively.
Mininet is a lightweight container orchestration system that is specialized for network emulation. With Mininet and onos.py
, you can easily start up an ONOS cluster, and a modeled data network for any topology you might like, in a single VM or server. This is usually the most convenient way to create an ONOS development environment on your laptop, and you can be up and running in a matter of minutes (or seconds if you have already built ONOS and have already installed Mininet!)
Children Display |
---|
Mininet is a container orchestration system for network emulation.
If you are using Mininet in a VM or on a physical server, it is easy to use onos.py
to start up a complete emulated ONOS network, including ONOS cluster, modeled control network, and data network.
Note: This is work in progress - if you wish to try it now, you will need to get onos.py from the following patch: https://gerrit.onosproject.org/#/c/9143/
First, make sure that you have built ONOS using buck
:
cd ~/onos
buck build onos
Next, use Mininet and onos.py
to start up a virtual ONOS cluster and data network:
cd ~/onos/tools/dev/mininet
sudo mn --custom onos.py --controller onos,3 --switch onosovs --topo torus,4,4
What does this do?
--custom onos.py
: uses onos.py
to extend Mininet with new controller and switch types
--controller onos,3
: tells Mininet to start up an ONOS controller cluster with 3 ONOS nodes
--switch onosovs
: this is currently necessary to enable Mininet to automatically connect to a controller with multiple IP addresses (you can also just use --switch onos
)
--topo torus,4,4
: tells Mininet to use a 4x4 torus topology for the data network
How can I get more information on Mininet?
For more information on Mininet, please check out http://docs.mininet.org
How can I specify the apps for ONOS to load?
For now, try using ONOS_APPS
or connecting to the karaf
console and using ONOS CLI commands.
In the future, it will be an option to --controller onos
and/or ONOSCluster()
.
How are IP addresses of the ONOS cluster specified?
ONOSCluster
takes an ipBase
option; default is 192.168.123.0/24
How can I connect to the ONOS console?
Make sure karaf's bin
directory is in your path, then:
client -h 192.168.123.1 # or the address of the ONOS node you wish to connect to
How can I connect to the karaf console using ssh
?
ssh -p 8101 karaf@192.168.123.1
How can I connect to the ONOS GUI?
One way is to use ssh port forwarding, e.g.
ssh -L 8101:192.168.123.1:8101 mininet-vm
Another way is to run a browser such as Firefox or Chromium in your VM or server.
firefox &
We hope to make it easier and more automatic in the future.
Can I ssh
into the ONOS cluster?
Not directly with this version of onos.py
, since the nodes are not running ssh
by default. However, you can attach to it using mininet/util/m
:
~/mininet/util/mn 192.168.123.1
Can I use the onos-*
scripts from tools/test/bin with this environment?
No, but you should not need to use them for the most part.