OpenDaylight with network emulated by Mininet |
Once you have built OpenDaylight controller (or just chose to use the built OpenDaylight controller bundle), you may build and test the SDN solutions, with either networks or networks of virtual machines. Network emulators such as Mininet provide an effective alternative for SDN prototyping. Mininet can easily be installed from the regular repositories in Ubuntu.
$ sudo apt-get install mininet
Run OpenDaylight Controller (often as super user, for the privileges).
$ cd ~/OpenDayLight/controller/opendaylight/distribution/opendaylight/target/opendaylight
$ ./run.sh
$ ./run.sh
Starting Mininet, for example, with a three-level tree topology.
The below command creates a tree topology with 3 levels.
The below command creates a tree topology with 3 levels.
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,3
[sudo] password for pradeeban:
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4 h5 h6 h7 h8
*** Adding switches:
s1 s2 s3 s4 s5 s6 s7
*** Adding links:
(h1, s3) (h2, s3) (h3, s4) (h4, s4) (h5, s6) (h6, s6) (h7, s7) (h8, s7) (s1, s2) (s1, s5) (s2, s3) (s2, s4) (s5, s6) (s5, s7)
*** Configuring hosts
h1 h2 h3 h4 h5 h6 h7 h8
*** Starting controller
*** Starting 7 switches
s1 s2 s3 s4 s5 s6 s7
*** Starting CLI:
mininet>
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4 h5 h6 h7 h8
*** Adding switches:
s1 s2 s3 s4 s5 s6 s7
*** Adding links:
(h1, s3) (h2, s3) (h3, s4) (h4, s4) (h5, s6) (h6, s6) (h7, s7) (h8, s7) (s1, s2) (s1, s5) (s2, s3) (s2, s4) (s5, s6) (s5, s7)
*** Configuring hosts
h1 h2 h3 h4 h5 h6 h7 h8
*** Starting controller
*** Starting 7 switches
s1 s2 s3 s4 s5 s6 s7
*** Starting CLI:
mininet>
OpenDaylight OSGi console would produce the below logs connecting to the network topology emulated by Mininet.
osgi>
osgi> 2014-10-16 11:58:07.606 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33215 is connected to the Controller
2014-10-16 11:58:08.450 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33216 is connected to the Controller
2014-10-16 11:58:08.502 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33217 is connected to the Controller
2014-10-16 11:58:08.552 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33218 is connected to the Controller
2014-10-16 11:58:08.613 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33219 is connected to the Controller
2014-10-16 11:58:08.686 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33220 is connected to the Controller
2014-10-16 11:58:08.770 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33221 is connected to the Controller
2014-10-16 11:58:08.849 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33222 is connected to the Controller
osgi>
osgi> 2014-10-16 11:58:07.606 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33215 is connected to the Controller
2014-10-16 11:58:08.450 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33216 is connected to the Controller
2014-10-16 11:58:08.502 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33217 is connected to the Controller
2014-10-16 11:58:08.552 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33218 is connected to the Controller
2014-10-16 11:58:08.613 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33219 is connected to the Controller
2014-10-16 11:58:08.686 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33220 is connected to the Controller
2014-10-16 11:58:08.770 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33221 is connected to the Controller
2014-10-16 11:58:08.849 WEST [ControllerI/O Thread] INFO o.o.c.p.o.core.internal.Controller - Switch:127.0.0.1:33222 is connected to the Controller
osgi>
The connected networked devices can be monitored from the admin console of OpenDaylight. In the default configurations, you may access the admin console in a browser from the url, http://127.0.0.1:8080, with user name and password 'admin'.
Different Topology options
Network topologies can be visualized using Mininet and OpenDaylight. While a few topologies are available out of the box with Mininet, more custom topologies can be programmed as well.
1. Single node with 5 ports
$ sudo mn --controller=remote,ip=127.0.0.1 --topo single,5
Different Topology options
Network topologies can be visualized using Mininet and OpenDaylight. While a few topologies are available out of the box with Mininet, more custom topologies can be programmed as well.
1. Single node with 5 ports
$ sudo mn --controller=remote,ip=127.0.0.1 --topo single,5
2. Linear topology with 5 nodes
$ sudo mn --controller=remote,ip=127.0.0.1 --topo linear,5
3. Tree topology
a. 3-ary, 2 level tree
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=2,fanout=3
b. 3-ary, 4 level tree
(This looks a bit messy)
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=4,fanout=3
$ sudo mn --controller=remote,ip=127.0.0.1 --topo linear,5
3. Tree topology
a. 3-ary, 2 level tree
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=2,fanout=3
b. 3-ary, 4 level tree
(This looks a bit messy)
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=4,fanout=3
OpenDaylight wiki page mentions that only the Mininet in a VM (option #1) is tested with the OpenDaylight controller. However, as seen in this post, Mininet works well with OpenDaylight even in the Mininet installation from the packages (option #3).