LabSDN Use Mininet With Command
LabSDN Use Mininet With Command
1)
2)
3)
MỤC LỤC
1. Overview.............................................................................................................1
2. Objectives...........................................................................................................1
3. Lab settings........................................................................................................2
4. Introduction to Mininet.....................................................................................2
5. Invoke Mininet using the CLI..........................................................................3
5.1. Invoke Mininet using the default topology................................................................3
5.2. Test connectivity........................................................................................................8
6. Invoke Mininet with custom topology..............................................................9
7. Build and emulate a network in mininet.......................................................10
8. References.........................................................................................................11
>> Yêu cầu chụp hình ảnh là kết quả thực hành của SV. Không sử dụng lại hình ảnh của
bài lab.
1. Overview
This lab provides an introduction to Mininet, a virtual testbed used for testing network
tools and protocols. It demonstrates how to invoke Mininet from the command-line
interface (CLI) utility and how to build and emulate topologies using a graphical user
interface (GUI) application. In this lab we will use Containernet, a Mininet network
emulator fork that allows to use Docker containers as hosts in emulated network
topologies. However, all the concepts covered are bounded to Mininet.
2. Objectives
By the end of this lab, students should be able to:
3. Lab settings
The information in Table 1 provides the credentials of the machine containing
Mininet.
Table 1. Credentials to access Client1 machine.
4. Introduction to Mininet
Mininet is a virtual testbed enabling the development and testing of network tools and
protocols. With a single command, Mininet can create a realistic virtual network on any
type of machine (Virtual Machine (VM), cloud-hosted, or native). Therefore, it provides
an inexpensive solution and streamlined development running in line with production
networks1. Mininet offers the following features:
Mininet’s logical nodes can be connected into networks. These nodes are sometimes
called containers, or more accurately, network namespaces. Containers consume
sufficiently fewer resources that networks of over a thousand nodes have created, running
on a single laptop. A Mininet container is a process (or group of processes) that no longer
has access to all the host system’s native network interfaces. Containers are then assigned
virtual Ethernet interfaces, which are connected to other containers through a virtual
switch4. Mininet connects a host and a switch using a virtual Ethernet (veth) link. The
veth link is analogous to a wire connecting two virtual interfaces, as illustrated below.
C:\Users\ABC>ssh [email protected] -p 15
[email protected]'s password:
Có thể chạy lại nhiều lần để vào dấu nhắc lệnh mininet>
Mininet initializes the topology and launches its command line interface which looks
like this:
mininet>
Step 3. To display the list of Mininet CLI commands and examples on their usage,
type the following command:
help
The output of this command shows that there is a controller, two hosts (host h1 and
host h2), and a switch (s1).
Step 5. It is useful sometimes to display the links between the devices in Mininet to
understand the topology. Issue the command shown below to see the available links.
mininet> links
mininet> ports
mininet> net
1. Host h1 is connected using its network interface h1-eth0 to the switch on interface
s1-eth1.
2. Host h2 is connected using its network interface h2-eth0 to the switch on interface
s1-eth2.
3. Switch s1:
a. has a loopback interface lo.
b. connects to h1-eth0 through interface s1-eth1.
c. connects to h2-eth0 through interface s1-eth2.
4. Controller c0 is the brain of the network, where it has a global knowledge about
the network. A controller instructs the switches on how to forward/drop packets in
the network.
This command executes the Linux command on host h1. The command shows host
h1’s interfaces. The display indicates that host h1 has an interface h1-eth0 configured
with IP address 10.0.0.1, and another interface lo configured with IP address 127.0.0.1
(loopback interface).
Step 1. On the CLI, type the command shown below. This command tests the
connectivity between host h1 and host h2. To stop the test, press Ctrl + c . The figure
below shows a successful connectivity test. Host h1 (10.0.0.1) sent four packets to host
h2 (10.0.0.2) and successfully received the expected responses.
mininet> h1 ping 10.0.0.2
The command sudo mn -c is often used on the Linux terminal (not on the Mininet CLI)
to clean a previous instance of Mininet (e.g., after a crash).
8. References
[1]. http://manpages.ubuntu.com/manpages/xenial/man1/mn.1.html
[2]. Mininet walkthrough. [Online]. Available: http://Mininet.org.
[3]. B. Lantz, G. Gee, “MiniEdit: a simple network editor for Mininet,” 2013. [Online]. Available:
https://github.com/Mininet/Mininet/blob/master/examples.