Lab 1 100 points
Part A: Installing and Using Mininet
Parts 1 and 2: Software Installation
Part 1: Installing Virtualbox
The first thing required to use Mininet is a Virtual Machine (VM) manager to run our Mininet VM. VirtualBox is free and open source and can be downloaded here. You are free to use kvm, vmware, or xen if you are familiar with those hypervisors - however, the TAs will not support them, so if you choose this route you are on your own for support.
Common Problems Installing VirtualBox:
- Did you download the correct version? (32-bit vs 64-bit)
- Is your computer really old? It might not be able to use virtualization -- talk to the TA.
- Make sure that virtualization is enabled in your BIOS.
- Do you have a M1 chip? -- check out the special instructions pdf and talk to a TA.
Part 2: Installing Mininet
Once VirtualBox is installed, you can install the Mininet VM. For this class, please use the Mininet VM available at this link. (You must use your UCSC Google account to get access.)
Using a GUI:
● Once the download is complete, open VirtualBox and select File>Import Appliance... Navigate to the OVA file you downloaded.
● When the mininet VM has been successfully imported, start the VM.
● You should be presented with a GUI. Helpful tips:
1. Chromium is a web browser. You can use this to go to the class webpage and copy/paste example code from the PDFs.
2. You can use your Google Drive or VirtualBox shared folders to copy files to/from the VM. The TAs or student tutor can help you with this in lab.
Part 3: Experimenting with Mininet
A walkthrough can be found on the Mininet page. In this lab you are expected to spend some time familiarizing yourself with Mininet. First and foremost, here’s some background and information on what Mininet is and why we are using it (we used to have the labs using actual routers and switches; since then we have migrated to virtualized labs).
How does Mininet Work? Mininet works simply by creating a virtual network on your computer/laptop. It accomplishes this task by creating host namespaces (h1, h2, etc) and connecting them through virtual interfaces. So when we run the command ping between the linux namespaces h1 and h2, the ping will run from h1’s namespace through a virtual interface pair created for h1 and h2, before it reaches h2. If h1 and h2 are connected through a switch as shown in the Python code in the Mininet walkthrough, the ping will transit multiple virtual interface pairs.
1. sudo mn: will start Mininet
- You can use mn -h or type help after you have run Mininet.
- We can see that when we launched Mininet above, a mini-network was created.
- The net command shows that h1 indicates host 1 has one network interface eth0, which is
connected to the switch on interface eth1 (on the output line: h1 h1-eth0:s1-eth1). There is also host 2 (h2), switch 1 (s1), and controller 0 (c0).
- From dump we can also see what IP addresses have been assigned to h1 and h2. We also are given the pids of each process. Processes in Mininet are used for hosts, switches, and controllers. Mininet is composed of processes using Interprocess Communication (IPC) to emulate a network environment.
- sudo mn -c: cleans the Mininet system. Use this if you are having errors to start Mininet, in case some problem from a previous execution has persisted.
[50 pts] Part 4: Building Your Own Network in Mininet
Running Mininet as a Python script:
To make custom topologies, it is useful to be able to refine a topology in a script. The following is an example of using a Python script to launch Mininet with a custom topology. You should use this as a skeleton for getting started on the lab exercises that follow. On the Mininet site, the API Reference will be an excellent resource for figuring out how to run pings or open the command prompt in between the net.start() and net.stop() lines.
#!/usr/bin/python
from mininet.topo import Topo from mininet.net import Mininet from mininet.cli import CLI from mininet.link import TCLink
class MyTopology(Topo): """
A basic topology """
def __init__(self):
Topo.__init__(self)
Mininet Exercises:
- [4 pts] Mininet Commands
a) What command do you use to find the interfaces of a host?
b) What are the commands used to test connectivity between hosts and what is the difference between them?
c) What command do you use to close Mininet?
d) What command would you use to run Wireshark? - [8 pts] Writing your own topology script
In Mininet change the default configuration through a Python script to create the topology in Figure 1. Provide a single screenshot with markup showing these connections. - [2 pts] Server1 and Server2 are connected to Switch 4
- [2 pts] Alexa, Laptop and SmartTV are connected to Switch 1
- [2 pts] desktop1, desktop2, and desktop3 are connected to Switch 3
- [2 pts] Switch1, Switch3 and Switch4 are connected to Switch2
Figure1:
3. [2 pts] Verify the topology
Run a command that will display the different devices and connections in Figure 1. (Hint: refer to the description given above in the introduction to Mininet) Save a screenshot of the output after running the command and highlight the connections of desktop2 and desktop3.
4. [2 pts] Check the IP Addresses
Run a command that will display the IP address of ALL of the devices in Figure 1. Save a screenshot of the output after running the command and highlight the IP addresses of Server1 and Server2 in the screenshot.
5. [4 pts] Verifying connectivity
Run the pingallfull command in the Mininet command line, and explain what you understand from the output of pingall. Save a screenshot of the output and highlight the row that represents the Laptop pinging all other devices in the network.
6. [16 pts] Ping: Wireshark Analysis for topology in Figure 1
Note: Run Wireshark as “sudo wireshark” and choose the “any” interface to capture on.
- [4 pts] What is ICMP? Use your own words - no copy/paste for credit. (Your textbook has a good small section on ICMP.)
- [4 pts] Run Ping from a host to any other host using X ping -c 5 Y (replace X and Y with the names of the source host and destination host respectively). With the help of the display filter, filter to show only ICMP packets, find the packets which were sent and received by Ping and highlight them in your screenshot.
- [4 pts] Discuss the 2 types of ICMP messages that Ping is using (as highlighted in (b)) and briefly describe how the Ping application operates using these 2 messages.
- [4 pts] In Wireshark, drill into a single ICMP echo request. Mark the request you are examining in your screenshot. What is the total length of the transmission frame? Include a screenshot of the drilldown that shows the details of this packet, particularly its total length.
7. [14pts] Exploring Propagation Delay
Make a table highlighting the average RTT reported by ping with respect to the link delay set in Mininet as described in (a)(b)(c) below. A sample table:
Make the following changes to the topology in Figure 1: Set all links to have a link delay of 20ms.
- [3pts] Run Laptop ping -c 5 server1. What is the IP address of server1? Take a screenshot of your results and highlight the average delay and IP addresses of the Laptop and Server.
- [3pts] Run SmartTV ping -c 5 Laptop. What could be some reasons that cause a variation in the different ICMP messages sent out in ping? Take a screenshot of your results and highlight the RTT for the first ICMP message sent.
c. [4pts] Run server2 ping -c 5 desktop3. Do you notice any changes? Take a screenshot of your results and highlight the changes if any, and explain in support of your answer.
d. [4pts] Run Alexa ping -c 5 Laptop. Do you notice any changes? Explain in support of your answer. Take a screenshot of your results and mark references in your screenshot.