Open vSwitch requirements
sudo apt-get install libxml2-dev gcc-multilib
This section summarizes Mininet specific details such as running different topologies and connecting to Mininet hosts and switches.
To run a VIRO experiment you need to create a topology file.
The topology file contains one edge per line.
For example, to create a linear topology with three switches, the topology file exp.txt
will look like this
1 2
2 3
Then, you can do the following to start Mininet
cd py/mininet
source env-vars.sh
sudo -E ./mininet-exp.py exp.txt
-
To create a VIRO topology in mininet, you have to append the prefix 1 in the VIRO vids because OVS doesn't recognize 000 (all zeros ) for the switch dpid. For example: node A has vid 000 (write as 1000), B has vid 010 (write as 1010) and so on (see example at https://github.com/dumb0002/viro-geni/blob/master/geni-viro/py/mininet/exp1.txt )
-
Decrease the mtu size for the host in a VIRO network, for example: sudo ifconfig eth0 mtu 1400
Mininet will start and create the linear toplogy in exp.txt
. Each will be attached to one host and one local controller.
All switches will be connected to the remote controller. To change this behavior, you will need to change mininet-exp.py
file.
Nodes will be named in the following form:
- Hosts: h1, h2, ...
- Switches: s1, s2, ...
- Local controllers: c1, c2, ...
- Remote controller: remote
Host h1 and local controller c1 will be connected to switch s1. Other hosts and local controller follow the same pattern.
Connecting to nodes in your Mininet experiment is very simple. For instance, to connect to h1 and run ifconfig
sudo ./node.sh h1
ifconfig
To disconnect from h1, use the keyboard shortcut Ctrl+A D
OVS source code is located under the openvswitch
directory.
To start OVS, you need to run ./ovs.sh start
from inside the openvswitch
direcotry.
The ovs.sh
file has other useful commands to install and uninstall OVS to a raw VM.
For example, ./ovs.sh install
will install openvswitch
to the new VM.
Controller log files are located under the tmp
directory with the name of each controller.
For example, local controller 1 log file "c1" is located in /tmp/c1.log
To start the remote controller outside of Mininet, you just need to run the following command on the machine hosting the remote controller
./pox.py --verbose openflow.of_01 --port=6633 viro.core viro.remote.controller viro.remote.dhcpd viro.remote.arpd
To start the local controller on a VM hosting our VIRO OVS instance, you need to run
./pox.py --verbose openflow.of_01 --port=6634 viro.core viro.local.controller
To force Mininet to kill all controllers and hosts, you can run sudo ./stop.sh
from inside py/mininet
directory.
We need to export our Mininet VM image and use that across all our GENI nodes.