You are on page 1of 6

CPSC 5590: Advanced Computer Networks 1

Project 1
Fall 2017

1 Learning Outcome:
By the end of this project, the students will:

Learn how to use Mininet.

Become familiar with ping and iPerf networking measuring tools.

Be able to configure and create custom network typologies in Mininet.

2 Task 1: Mininet Tutorial


In this project, you will learn how to use Mininet to create virtual networks and run simple experi-
ments. According to the Mininet website, Mininet creates a realistic virtual network, running real
kernel, switch and application code, on a single machine (VM or native), in seconds, with a single
command.

2.1 Running Mininet


We will be using 64-bit Mininet 2.2.2. To run Mininet, you will need a virtual machine (VM). We
will be using VirtualBox, which is a free and open-source hypervisor.
You need to:

Download and setup Virtualbox.

Download Mininet 2.2.2 and import it to your Virtualbox.


You can follow the step here to upload the image to your Virtualbox.

When you boot up the VM, youll have to log in using mininet and mininet as username and pass-
word.

This programming assignment is based on Mosharaf Chowdhurys Assignment 1 from EECS 489: Computer
Networks.

Dr. K., 2017


CPSC 5590: Advanced Computer Networks 2

2.1.1 GUI in MininetVM


Details can be found at Option 2: Native Installation from Source, but you can follow this basic
set of instructions to setup a working GUI:

Update: sudo apt-get update

Install the lxde desktop environment: sudo apt-get install xinit lxde

Install VirtualBox guest additions: sudo apt-get install virtualbox-guest-dkms

Restart the VM: sudo reboot

Start the GUI using startx

To avoid having to startx every time you boot, you can add the following snippet to the end of
your v/.bashrc:

if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then


exec startx
fi

You can reload .bashrc by typing source v/.bashrc

To transfer files to/from your VM you should use the scp (secure copy) command. See the scp man
page, or find a tutorial online, for instructions on how to use scp.

2.2 Mininet Walkthrough


Once you have a Mininet VM, you should complete the following sections of the standard Mininet
walkthrough:

All of Part 1, except the section Start Wireshark

The first four sections of Part 2 Run a Regression Test, Changing Topology Size and
Type, Link variations, and Adjustable Verbosity

All of Part 3

You do not need to submit anything for this part of the project.

Dr. K., 2017


CPSC 5590: Advanced Computer Networks 3

3 Task 2: Measurements in Mininet


For the this task of the project you will use the iPerf tool and the standard latency measurement tool
ping (ping measures RTT), to measure the bandwidth and latency in a virtual network in Mininet.

You must include the output from some of your experiments and the answers to the questions be-
low in your submission.

A python script to run Mininet with the topology described below is provided here.

To get the python script you can run the following command:
wget http://cecs-leda.utc.edu/files/Mininet/Topology.py

OR:
curl -o Topology.py wget http://cecs-leda.utc.edu/files/Mininet/Topology.py

To run Mininet with the provided topology, run the Python script Topology.py using sudo:

sudo python Topology.py

If you have trouble launching the script, a common fix is to first try running sudo mn -c, and
then try launching the script again.

Hosts (h1 to h10) are represented by squares and switches (s1 to s6) are represented by circles; the
names in the diagram match the names of hosts and switches in Mininet. The hosts are assigned
IP addresses 10.0.0.1 through 10.0.0.10; the last number in the IP address matches the host number.

Dr. K., 2017


CPSC 5590: Advanced Computer Networks 4

NOTE: When running ping and iPerf in Mininet, you must use IP addresses, not hostnames.

For each of the following questions, please note that along with your answers you
need to provide screenshots showing your work. Please add a brief description
under each screenshot you provide in your report.

3.1 Q1: Link Latency and Throughput


First, you should measure the RTT and bandwidth of each of the five individual links between
switches (L1 - L5).

To measure the link latency, you should choose any two hosts sharing a specific link and run ping
with 20 packets. You need to repeat the same steps for the other links.

To measure the links throughput, you should do the same as before but run iPerf for 20 seconds.
Repeat the same steps for the other links.

Based on your measurements, fill in the following table (Table 1):

3.2 Q2: Path Latency and Throughput


A. Now, assume h1 wants to communicate with h10. What is the expected latency and throughput
of the path between the hosts? Fill in Table 2 with your prediction.
Measure the latency and throughput between h1 and h10 using ping and iPerf. It does not
matter which host is the client and which is the server. Use the same parameters as above (20
packets / 20 seconds) and fill in the table with your actual measurements. Briefly explain the
results. If your prediction was wrong, explain why.

B. Repeat the previous measurements between h3 and h7. Fill in Table 2 with your predictions and
the actual measurements for this connection. Briefly explain the results. If your prediction
was wrong, explain why.

Dr. K., 2017


CPSC 5590: Advanced Computer Networks 5

3.3 Q3: Effects of Multiplexing


Next, assume multiple hosts connected to s1 want to simultaneously talk to hosts connected to s6.

A. What is the expected latency and throughput when two pairs of hosts are communicating si-
multaneously? Fill in Table 3 with your predictions.
Use ping and iPerf to measure the latency and throughput when there are two pairs of hosts
communicating simultaneously; it does not matter which pairs of hosts are communicating as
long as one is connected to s1 and one is connected to s6. Use the same parameters as above
(20 packets / 20 seconds) and fill in the table with your actual measurements. Briefly explain
the results. If your prediction was wrong, explain why.

B. Repeat for three pairs of hosts communicating simultaneously and fill in the table with your
predictions and actual measurements.

Dont worry too much about starting the clients at the exact same time. As long as the connections
overlap significantly, you should achieve the correct results. One simple way is to open up termi-
nals for each of the hosts youll use, start the iPerf servers, type in the iPerf client command on
each of the client hosts without hitting ENTER, and then quickly hit ENTER on all client hosts so
that they start at roughly the same time.

3.4 Q4: Effects of Latency


Lastly, assume h1 wants to communicate with h10 at the same time h3 wants to communicate with
h7.

What is the expected latency and throughput for each pair? Put your prediction in Table 4 for each
connection.

Dr. K., 2017


CPSC 5590: Advanced Computer Networks 6

Use ping and iPerf to conduct measurements. Use the same parameters as above (20 packets / 20
seconds) and fill in the table with your actual measurements. Briefly explain the results. If your
prediction was wrong, explain why.

4 Task 3: Create a Custom Topology


For the last part of this project, write a python script to create a custom network topology in Mininet
that has at least 5 hosts and 5 switches. Save your python script as yourname topology.py. You
might find looking into the source code for Topology.py particularly helpful.

Finally, create a visualization of your custom topology (using circles to denote switches and
squares to represent hosts) and save it as yourname topology.png.

End of Project

Dr. K., 2017

You might also like