0% found this document useful (0 votes)
25 views10 pages

CEG5101 Lab01

i. The document provides instructions for downloading and installing Mininet, an open-source network emulator used for prototyping networks on a single machine. It discusses downloading Mininet from its GitHub repository and compiling and installing it from source on Linux. ii. After installing Mininet, it describes how to launch a simple network with two hosts and a switch using commands in the Mininet CLI. It also introduces the MiniEdit GUI and how to use it to design and simulate networks by adding devices and links. iii. The goal of the document is to familiarize readers with downloading, installing, and using Mininet for network emulation by walking through creating simple example networks in both the CLI and GUI interfaces.

Uploaded by

poorguy2333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

CEG5101 Lab01

i. The document provides instructions for downloading and installing Mininet, an open-source network emulator used for prototyping networks on a single machine. It discusses downloading Mininet from its GitHub repository and compiling and installing it from source on Linux. ii. After installing Mininet, it describes how to launch a simple network with two hosts and a switch using commands in the Mininet CLI. It also introduces the MiniEdit GUI and how to use it to design and simulate networks by adding devices and links. iii. The goal of the document is to familiarize readers with downloading, installing, and using Mininet for network emulation by walking through creating simple example networks in both the CLI and GUI interfaces.

Uploaded by

poorguy2333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

CEG5101 Modern Computer Networking

Graduate Assistant: Mr. Binghui Wu and Ms. Divya D Kulkarni,


Prepared by: Ms. Anum Talpur (Ex-Graduate Assistant)
Lecturer: Assoc. Prof. Mohan Gurusamy
ECE Department, CDE., National University of Singapore

Laboratory 01
Introduction to Mininet
LEARNING OBJECTIVES

Upon successful completion of this laboratory, the students will be able to learn:
i. To download and install Mininet.
ii. To become familiar with the Mininet Interface.

EQUIPMENT

i. Hardware – Laptop/Computer with internet access


ii. Software – Mininet, Linux OS

DISCUSSION

Task 1: To download and install Mininet

1.1 Mininet is a network emulator for prototyping a large network on a single machine.

1.2 It is a virtual environment that allows network administrators to experiment and run
a collection of network devices, such as routers, switches, and other related network
devices on a Linux kernel.

1.3 Mininet is used to design simple as well as complex custom-defined topologies.

1.4 Mininet offers a user-friendly environment for development and research and allows
users to deploy custom networks through the CLI and/or GUI interfaces.

1.5 Mininet is an open-source project, and its source code can be explored on
https://github.com/mininet

1.6 To download and install Mininet, you need a Linux environment. NOTE: If you are not
using Linux, follow and complete lab-00 first before proceeding to the next steps.

1.7 To download and get started with Mininet, proceed to http://mininet.org/download/


and choose “Option 2: Native Installation from Source” as shown below.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 1
1.8 Next, open the terminal on Ubuntu and follow the given steps to complete the
installation process.

1.9 The first step is to get the source code using the command, “git clone
https://github.com/mininet/mininet”

1.10 Next, open the mininet folder (using the command “cd mininet”) and check for
the latest available version using the command “git tag # list available
versions”. You can continue with any version, but it’s recommended to install the
latest one.

1.11 Choose your version for installation with the command “git checkout -b
mininet-2.3.1b4 2.3.1b4”. Note: I have chosen the latest available version
here.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 2
1.12 Next, go back to the source tree or home location of your PC with the command
“cd ..”.

1.13 Once you are at the root location, then type the command
“mininet/util/install.sh [options]” to begin the installation process.

For example, I installed everything: “mininet/util/install.sh -a”

1.14 Once the installation is complete, you will see the process ended with a message
“Enjoy Mininet!”.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 3
1.15 To test the mininet, type “sudo mn” and you will see a small network of 2 hosts
connected with a single switch and a controller is created, and the mininet is initiated
as shown below.

1.16 This confirms the successful installation of the Mininet.


1.17 Then type “exit” to shut down the Mininet

1.18 It is optional but recommended to sign up for the mininet-discuss mailing list at
https://mailman.stanford.edu/mailman/listinfo/mininet-discuss to get support and
discuss with the Mininet community.

Task 2: To become familiar with the Mininet Interface

2.1 In this activity, we will become familiar with the Mininet environment and start with
building a simple network by connecting two end devices with the switch.

2.2 After completing the installation, launch a terminal and type “sudo mn -h” to get
help describing Mininet options and commands. This gives a list of commands to be
used to create a network emulation.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 4
2.3 Following the above help, the command to build a custom topology of a single switch
and two hosts is “sudo mn --topo single,2”

2.4 The default topology is a minimal topology, and it can be changed with the command
“--topo=NAME”. The available NAME for defining different topologies can be found
from the output of “sudo mn -h” in step 2.2.

2.5 To find out more about the current network topology, type “net” and enter. The
window is shown below. It shows that port eth0 of host h1 is connected to port eth1

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 5
of switch s1. Similarly, port eth0 of host h2 is connected to eth2 of a switch s1. Also,
switch s1 has a loopback interface lo.

2.6 Mininet allows users to issue a specific command on a device with the format of
“DEVICE-NAME COMMAND”. The first string typed into Mininet CLI is the name of the
host, controller, or switch, and the command typed next to the device name is the one
executed on that node. As an example, to check the configured IP address for the host
h1, type “h1 ifconfig”, and for host h2 type “h2 ifconfig”. To print the
process list from host h1 type “h1 ps -a” and so on.

2.7 To find and explore more on available Mininet commands, type “help”. As an
example, the command “nodes” display nodes, “links” displays links and their
active status, and so on.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 6
2.8 You can check network connectivity by sending a ping command from one host to
another. (control + C to quit the ping process)

2.9 To leave Mininet and end the current network setup, type “exit”.

2.10 Next, we will learn to use the GUI interface of Mininet, known as MiniEdit.

2.11 To get started with MiniEdit, locate the folder where mininet is installed and type
“sudo python3 mininet/examples/miniedit.py” The default
interface window for MiniEdit is shown below. (if you are using python2, you can use
the command : “sudo ~/mininet/examples/miniedit.py” )

2.12 You can move your cursor around different icons and a help option will appear with
an explanatory title. Some of the key interface bars and their functioning is highlighted
below.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 7
2.13 We can add devices to the workspace by selecting the device type from the sidebar
and clicking it on the workspace. A link between two devices can be created by
dragging the link option from one device and dropping it on another device.

2.14 Next, to configure a device, right-click on the icon, and select the properties.

2.15 Below shows the property window of host h1 and switch s1, to add or remove
different parameters to the devices.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 8
2.16 We can configure the IP address of host h1 and host h2 using the device property
window. As an example, we use 10.0.0.1/8 for host h1 and 10.0.0.2/8 for host
h2.

2.17 To start the simulation, click on the “Run” button.

2.18 After starting the simulation, we can view the network summary by clicking “Show
OVS summary” from the Run tab.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 9
2.19 We can also check connectivity between devices by sending a ping command from
one host to another. To do so, right-click on the host and select terminal. Type
ping from one host with the address of another host.

2.20 Finally, to save your file as a completed network and for future use, click on
File>save and then save it with .mn (mininet activity file) file format.

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet
http://mininet.org/walkthrough/
pg. 10

You might also like