Monday 6 April 2015

Setting up Mininet From Scratch Ubuntu 14.04

Prerequisites for this set up:
-VMWare Workstation [recommended] or
-Virtual Box [Free software not as good as VMWare but works just fine]
-Ubuntu 14.04 operating system 32bit link below
[  http://www.ubuntu.com/download/desktop ]
-Internet connection with access to GitHub
-Patience and composure are also required [you cannot download this :)]
___________________________________________________________________________

Software defined networking (SDN) is the new kid on the block when it comes to networking, but to understand it we must first get hands on with the technology. The best way to do this with out going bankrupt is to use the Stanford University SDN emulation software known as mininet. There are many in-depth tutorials on how to install the software and after running into a number of different issues I have decided to let you know how I installed mininet with all of its bells and whistles. Don't forget that http://mininet.org/ is a gold mind of information when it comes to this technology and should be referred to for guidelines and instructions. I will also upload videos on this blog that you can follow step by step with me as I run through an install of mininet from start to finish. Your going to have to set up the virtual machine yourself but this is very straight forward and there are many different tutorial on this so lets go straight to getting mininet up and running.

The first step is to access the setting on the Ubuntu OS and turn off the lock function; this stops the machine locking during an install and knocking out your connection to Github which will happen if the machine locks. 
The next step is to open the terminal and type in the following commands.
sudo apt-get install mininet
This command will install a number of core files for mininet and allow mininet to run you can see to output of this command by referring to Fig 2.1 below.












Fig 2.1

The next step is to kill any controllers that mininet may have activated by issuing the following command you can see the output from this command below in Fig 2.2.
sudo mn –c









Fig 2.2


The next step is to install git so that mininet can be downloaded from Github and create a file structure on our test machine. The output from the following command can be seen in Fig 2.3.
sudo apt-get install git










Fig 2.3

Now that git has installed we need to pull mininet down from GitHub using the following command you can view this output in Fig 2.4 below.
git clone git://github.com/mininet/mininet









Fig 2.4

The next step is to switch mininet to the latest version by entering the below commands you can see this output below in Fig 2.5.
cd mininet
git tag # list available versions
git checkout –b cs244-spring-2012-final










Fig 2.5


The next step is the most important one as we now want to install of the elements that mininet has to offer. If this step is not carried out mininet may not connect properly with the controller and wireshark will not run. To carry out this step enter the below command you may need to cd ..  to get back first.
mininet/util/install.sh –a
if this doesnt work try 
mininet/util/install.sh -a Ubuntu 14.04 trusty i386 Ubuntu
The final step is to run wireshark and to start mininet to do this we must first open a separate terminal to run wireshark in and enter the following command.
sudo wireshark &
In wireshark select lo as the interface to sniff and type of into the filter box and apply it this tells wireshark to sniff open flow packets. We won’t see anything in wireshark until mininet is started to start mininet type the following command.
sudo mn
In order to get traffic flowing and to see it in wireshark inside mininet type.
h1 ping h2
If you refer to Fig 2.6 below you can now see that mininet is running and wireshark is reading the packets.










Fig 2.6

If you want to follow my video tutorial you can view it below it is just all of the above on a clean install of Ubuntu 14.04 from start to finish.




I hit a few bumps during the installation
which is good as you can see the potential issues that can arise so I have left it unedited.
Please note that unfortunately there is no audio but all of the steps can be followed and you can pause and rewind the video as many times as you need to get it right. Best of luck.
Refer to the mininet walk through to learn more about the functionality of the software http://mininet.org/walkthrough/ .

1 comment:

  1. Miniedit is a tool for creating mininet topology. If you want a reverse tool you can use Mininet Topology Visualizer: http://mininet.spear.narmox.com

    ReplyDelete