In this article, we are going to show you how to setup a CORD Fabric environment with Mininet and CpqD software switches.
This pure software environment allows us to develop and test the control logic (i.e. the Segment Routing app on ONOS) without any hardware switches.
Setup an ONOS cluster with 3 instances. Here we only show brief steps. Please refer to Installing and Running ONOS for detail.
Enable Segment Routing applications in your cell configuration:
ONOS_APPS=drivers,openflow,segmentrouting |
Configure Segment Routing
You can copy and modify from the following sample json file:
$ONOS_ROOT/tools/package/config/samples/network-cfg-fabric2x2.json $ONOS_ROOT/tools/package/config/samples/network-cfg-fabric4x4.json |
For multiple instances
Copy the sample json file to the following location and rename it to network-cfg.json:
$ONOS_ROOT/tools/package/config/network-cfg.json |
Run onos-package and onos-install to apply new configuration on ONOS instances.
For single instance
Copy the sample json file to the following location and rename it to network-cfg.json:
~/Application/config/network-cfg.json |
Run ok clean to start ONOS with the new configuration.
Install Mininet from source code. Please refer to Install Mininet from source code for detail.
$ git clone git://github.com/mininet/mininet $ cd mininet $ git checkout -b 2.2.1 2.2.1 |
Patch Mininet.
We will probably commit this back to the Mininet main stream. |
A patch multi_controller.patch is required to allow CpqD software switches to connect to multiple controller instances simultaneously.
Apply the patch using:
# In the Mininet root directory $ git apply multi_controller.patch |
Install Mininet and CpqD Software Switch
$ sudo ./util/install.sh -3fn |
Start the Fabric
We write a Mininet script cord_fabric.py that can help you easily create a leaf-spine topology with CpqD software switches.
Since cord_fabric.py reads controller information from cell configuration, you should check your cell and see if $OC[1-9] is correctly set up before running the script. |
$ sudo -E ./cord_fabric.py --spine=4 --leaf=4 |
Run pingall
mininet> pingall *** Ping: testing ping reachability h1 -> h2 h3 h4 h5 h6 h7 h8 h2 -> h1 h3 h4 h5 h6 h7 h8 h3 -> h1 h2 h4 h5 h6 h7 h8 h4 -> h1 h2 h3 h5 h6 h7 h8 h5 -> h1 h2 h3 h4 h6 h7 h8 h6 -> h1 h2 h3 h4 h5 h7 h8 h7 -> h1 h2 h3 h4 h5 h6 h8 h8 -> h1 h2 h3 h4 h5 h6 h7 *** Results: 0% dropped (56/56 received) |
Configure sprites
$ onos-upload-sprites $OC1 onos/web/gui/src/main/webapp/data/sprites/segmentRouting.json |
and then access the URL: http://<ONOS_IP>/onos/ui?sprites=segmentrouting
Configure topology view
$ onos-topo-cfg $OC1 onos/tools/test/topos/cord.json |