


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to Mininet, a network emulator that allows network software to be run as is. It includes lab settings, objectives, and a lab roadmap. The document covers topics such as invoking Mininet using the CLI, building and emulating a network using the GUI, and configuring a router. It also includes references for further reading.
Typology: Lecture notes
1 / 26
This page cannot be seen from the preview
Don't miss anything!



















Document Version: 05 - 27 - 2020
an inexpensive solution and streamlined development running in line with production networks^1. Mininet offers the following features:
Each container is an independent network namespace, a lightweight virtualization feature that provides individual processes with separate network interfaces, routing tables, and Address Resolution Protocol (ARP) tables. Mininet provides network emulation opposed to simulation, allowing all network software at any layer to be simply run as is ; i.e. nodes run the native network software of the physical machine. On the other hand, in a simulated environment applications and protocol implementations need to be ported to run within the simulator before they can be used. 2 Invoke Mininet using the CLI The first step to start Mininet using the CLI is to start a Linux terminal. 2.1 Invoke Mininet using the default topology Step 1. Launch a Linux terminal by holding the Ctrl+Alt+T keys or by clicking on the Linux terminal icon. Figure 3. Shortcut to open a Linux terminal. The Linux terminal is a program that opens a window and permits you to interact with a command-line interface (CLI). A CLI is a program that takes commands from the keyboard and sends them to the operating system for execution. Step 2. To start a minimal topology, enter the command shown below. When prompted for a password, type password and hit enter. Note that the password will not be visible as you type it. sudo mn
Figure 6. Mininet’s help command. Step 4. To display the available nodes, type the following command: nodes Figure 7. Mininet’s nodes command. 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. net
Figure 8. Mininet’s net command. The output of this command shows that:
Figure 1 1. Stopping the emulation using exit. 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). 3 Build and emulate a network in Mininet using the GUI In this section, you will use the application MiniEdit^5 to deploy the topology illustrated below. MiniEdit is a simple GUI network editor for Mininet. Figure 12. Lab topology. 3.1 Build the network topology Step 1. A shortcut to MiniEdit is located on the machine’s Desktop. Start MiniEdit by clicking on MiniEdit’s shortcut. When prompted for a password, type password. Figure 13. MiniEdit Desktop shortcut.
MiniEdit will start, as illustrated below. Figure 14. MiniEdit Graphical User Interface (GUI). The main buttons in this lab are:
Step 1. Click on the Run button to start the emulation. The emulation will start and the buttons of the MiniEdit panel will gray out, indicating that they are currently disabled. Figure 1 7. Starting the emulation. Step 2. Open a terminal on host h1 by holding the right click on host h1 and selecting Terminal. This opens a terminal on host h1 and allows the execution of commands on the host h1. Repeat the procedure on host h2. Figure 18. Opening a terminal on host h1. The network and terminals at host h1 and host h2 will be available for testing.
Figure 19. Terminals at host h1 and host h2. Step 3. On host h1’s terminal, type the command shown below to display its assigned IP addresses. The interface h1-eth0 at host h1 should be configured with the IP address 10.0.0.1 and subnet mask 255.0.0.0. ifconfig Figure 20. Output of ifconfig command on host h1. Repeat Step 3 on host h2. Its interface h2-eth0 should be configured with IP address 10.0.0. 2 and subnet mask 255.0.0.0. Step 4. On host h1’s terminal, 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
Figure 23. Host h1 properties. Step 2. Click on Edit , Preferences button. The default IP base is 10.0.0.0/8. Modify this value to 15.0.0.0/8, and then press the OK button. Figure 24. Modification of the IP Base (network address and prefix length). Step 3. Run the emulation again by clicking on the Run button. The emulation will start and the buttons of the MiniEdit panel will be disabled. Step 4. Open a terminal on host h1 by holding the right click on host h1 and selecting Terminal.
Figure 25. Opening a terminal on host h1. Step 5. Type the command shown below to display the IP addresses assigned to host h1. The interface h1-eth0 at host h1 now has the IP address 15 .0.0.1 and subnet mask 255.0.0.0. ifconfig Figure 26. Output of ifconfig command on host h1. You can also verify the IP address assigned to host h2 by repeating Steps 4 and 5 on host h2’s terminal. The corresponding interface h2-eth0 at host h2 has now the IP address 15 .0.0.2 and subnet mask 255.0.0.0. Step 6. Stop the emulation by clicking on Stop button.
Figure 29. Opening a topology. 4 Configure router r In the previous section, you loaded a topology that consists in two networks directly connected to router r1. Consider Figure 30. In this topology two LANs, defined by switch s1 and switch s2 are connected to router r1. Initially, host h1 and host h2 do not have connectivity thus, you will configure router r1’s interfaces in order to establish connectivity between the two networks. Figure 30. Topology. Table 2 summarized the IP addresses used to configure router r1 and the end-hosts. Table 2. Topology information. Device Interface IIP Address Subnet Default gateway r r1-eth0 192.168.1.1 /24 N/A r1-eth1 192.168. 2 .1 / 24 N/A h1 h1-eth0 192.168.1.10 /24 192.168.1.
h2 h2-eth0 192.168.2.10 /24 192.168.2. Step 1. Click on the Run button to start the emulation. The emulation will start and the buttons of the MiniEdit panel will gray out, indicating that they are currently disabled. Figure 31. Starting the emulation. 4.1 Verify end-hosts configuration In this section, you will verify that the IP addresses are assigned according to Table 2. Additionally, you will check routing information. Step 1. Hold right-click on host h1 and select Terminal. This opens the terminal of host h1 and allows the execution of commands on that host. Figure 32. Opening a terminal on host h1. Step 2. In host h1 terminal, type the command shown below to verify that the IP address was assigned successfully. You will verify that host h1 has two interfaces, h1-eth configured with the IP address 192.168.1.10 and the subnet mask 255.255.255.0 and, the loopback interface lo configured with the IP address 127.0.0.1. ifconfig