The easiest way to get started with Mininet is to download a prepackaged VM image of Mininet (which runs over Ubuntu). This VM includes all OpenFlow binaries and preinstalled tools to support large Mininet networks along with Mininet itself. In addition to prepackaged VM installation, those of you interested can install it natively from the source code or packages on Ubuntu.
If you want to get the VM image, you have to download and install a virtualization system. VirtualBox (free, GPL) or VMware Player (free for non-commercial use) are the available choices, which are free and work on Windows, macOS, and Linux. Mininet is an Open Virtualization Format (OVF) image file (approximately 1 GB), which can be imported by VirtualBox or VMware Player (free for non-commercial use).
In VirtualBox, you can import the Mininet's OVF file by double-clicking on the VM image or going to File and selecting Import Appliance. Then, go to Settings and add an additional host-only network adapter to log in to the VM image. If you are using VMware, it may ask you to install VMware tools on the VM; if it asks, decline. In the following examples, we have used VirtualBox as our virtualization system for Mininet.
Here, are the steps are shown pictorially.
To reach the same environment, you can take the following steps:
- Download and install Xming X-Server, Putty (with X11 forwarding option enabled) and VirtualBox. The X11 forwarding (refer to the following information box for more information) enables you to execute programs with a graphical output (for example, Wireshark, which is preinstalled and included in the Mininet VM image).
-
Set up the networking preference of the VirtualBox, shown as follows:
- Enable the second adapter on the VirtualBox, go to Preferences | Network | Host-only Networks. Accessing the preferences tab can be done using the Ctrl + G shortcut. Ensure the configuration match with the following screenshot:
- The DHCP server is enabled
- The address space matches what is in the diagram
- Enable the second adapter on the VirtualBox, go to Preferences | Network | Host-only Networks. Accessing the preferences tab can be done using the Ctrl + G shortcut. Ensure the configuration match with the following screenshot:
-
- Import the extracted downloaded Mininet appliance:
-
- Configure the Putty to enable X11 forwarding:
-
- Right-click on the VM and navigate to Settings | Network. Enable the network Adapter 2 ensure the settings are configured as Attached to: Host-only Adapter and Name: VirtualBox Host-Only Ethernet Adapter.
- Start the Mininet VM image in the virtualization program of your choice (VirtualBox is shown in the following screenshot):
- Log in to the Mininet VM using the default username and password. The default username and password are both mininet. The root account is not enabled for login and you can use sudo to execute a command with superuser privileges.
- In order to establish an SSH session to the Mininet VM, you have to find the IP address of the VM. This address for VirtualBox is probably in the range of 192.168.x.y. Type the following command in the VM console:
/sbin/ifconfig eth0
- You can SSH to the VM using the putty window open previously as follows. Also, the Putty session configuration can be saved for future logins:
- In the following screenshot, you can see the experimental environment based on VMware Player, Mininet, Xming (X-Server), and Putty (SSH terminal). You can see that we have logged in to the Mininet VM using PuTTY (SSH client) and then we have started the Wireshark as a background process (that is, sudo wireshark &). Since the X11 forwarding is enabled, the Wireshark GUI appears as a separate window:
- Before starting the Mininet emulator, you have to select the Capture device in Wireshark (lo or loopback interface) and start capturing the traffic. In order to display the OpenFlow related traffic, you have to add (OpenFlow) in the filter box of Wireshark and apply it to the capturing traffic. This will instruct Wireshark to just display OpenFlow related traffic. Since Mininet has not been started yet, no OpenFlow packets should be displayed in the main window of Wireshark. In the next section, you will run a sample experiment using Mininet.