Setup¶
Last updated on: 23 October, 2020
Compiled by: Evan Tay
In this section you will find my notes on:
- Setting up and running Mininet VM on a virtualization program.
- Setting up and running NOX/POX controller on your local machine.
- Connecting your POX controller to your Mininet application (and troubleshooting).
Info
I wrote this setup guide using MacOS, POX using Python3, and VMware Fusion. However, the setup flow and troubleshooting should be similar for Linux/Window and other virtualization programs.
Set up Mininet VM¶
- Download, setup and launch the latest Mininet VM here.
- For virtualization program, try VirtualBox first given that it is free and open-source.
- If you do use VirtualBox, remember to add a Host-only network adapter to your VM under
Select VM > Settings > Network - If you are on MacOS, and the Mininet VM aborts when you launch it (as it does for me), you may have to consider using VMware Fusion instead.
- If you do use VMware Fusion, change your network adapter:
Virtual Machine > Network Adapter > Bridged (Autodetect)
- Log into the VM using
mininet
as both username and password.
Before setting up the NOX/POX on your local machine, it would be best to familiarise and verify that your Mininet setup is working fine. Try out a few of the commands in #mininet-cheat-sheet such as pingall
.
Set up POX¶
You will be setting up the NOX/POX controller on your local machine, and linking it up with the Mininet application in your VM.
Verify that your POX installation is working:
1 2 3 |
|
- Verify that you see:
INFO:core:POX 0.7.0 (gar) is up.
- You can terminate POX after step 1.
- If it does not work, it is likely because you do not have Python3 installed. You can
git checkout master
to change to the Python2 version for POX. See this for more information.
Connecting POX to Mininet VM¶
Next, we will set up a Mininet network (on your Mininet VM) with the remote controller set to the POX controller (on your local machine). To do so, you will need to open two terminals, one on your local machine where POX is at, and another terminal in your Mininet VM.
Verify POX is reachable by VM¶
On your local machine, at the pox/
directory:
1 |
|
- Verify that you see something similar to:
DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
On your Mininet VM, check if your VM can reach the POX controller at the port it is listening on:
1 |
|
- Replace the IP address and port with what you see after
Listening on
in the previous step. - Verify that you see something similar to:
Connection to 127.0.0.1 port 6633 [tcp/*] succeeded!
- If you see something like:
nc: connectx to 127.0.0.1 port 6633 (tcp) failed: Connection refused
,
it is probably because your VM cannot access your host machine. See #troubleshoot-connectivity.
Verify Mininet uses remote POX¶
Next, start Mininet with the controller set to your POX controller on your local machine:
1 |
|
- Replace the IP address and port accordingly.
Lastly, check if your POX remote controller is connected:
1 |
|
- Verify that
h1
is able to pingh2
. If not, your remote controller is not connected. - You should also see output in the POX window similar to:
DEBUG:forwarding.l2_learning:installing flow for 52:1e:48:64:23:43.2 -> 02:07:aa:33:88:e5.1
If you are able to make it to this point, your setup for Mininet VM and remote POX is completed. See #resources for more information on what you can do next with Mininet!
Mininet Cheat-sheet¶
Enter Mininet¶
1 |
|
Display¶
Display all Mininet commands:
1 |
|
Display all nodes:
1 |
|
Display all links:
1 |
|
Display information on everything:
1 |
|
Test connectivity¶
This command tests the connectivity between all hosts:
1 |
|
Exit Mininet¶
1 2 |
|
sudo mn -c
is used to clean up Mininet.
Troubleshoot connectivity¶
If you are unable to connect to the POX controller from your VM, it could be one of the following problems:
- Firewall rules are blocking it.
- Incorrect IP address or port.
If you are certain you are specifiying the correct IP address and port, and that your firewall is off or allowing traffic in for the port POX is listening on, attempt the fix in #vm-host-connectivity.
VM-Host connectivity¶
The instructions here are for VMware Fusion and MacOS, but you can use it as a guide for solving connectivity issues between Windows/Linux and VirtualBox/other virtualization programs too. See this for more information.
On your local machine:
- Turn off your Mininet VM:
Virtual Machine > Shutdown (for VMware Fusion) - Change your network adapter to Bridged (Autodetect) if you have not done so yet:
Virtual Machine > Network Adapter > Bridged (Autodetect) - Turn on your Mininet VM.
- Find out your local machine's IP address:
System Preferences > Network > Wi-Fi - Look out for something similar to:
Wi-Fi is connected to YourWifi and has the IP address 192.168.0.152
On your Mininet VM:
Use your local machine's IP address for the nc
command:
1 |
|
If this works, use this address instead of 127.0.0.1
or 0.0.0.0
whenever you are specifying the remote controller's IP address for Mininet.
1 |
|
Resources¶
- Download/Get Started With Mininet
- Mininet Walkthrough
- NUS CS4226: A short walk-through of Mininet and POX
- StackOverflow: VMWare fusion: connecting to host's web server from guest