Saturday, June 21, 2014

How to integrate GNS3 and Mininet.

Before we dive into the configuration first lets review the components needed to build the lab.


  1. GNS3 is a software suite that simulates complex networks, providing an intuitive graphical user interface to design and configure virtual networks.
  2. Virtualbox is a virtualization software package for x86 and AMD64/Intel64-based computers from Oracle Corporation. It can be integrated into the GNS3 software suite.
  3. MiniNet is an OpenFlow testing platform consisting of a realistic virtual network, running real kernel, switch and application code, with a single command prompt.

Virtualbox / Mininet 

Download Virtualbox HERE, and install (default settings are fine in most cases). Download Mininet HERE. After installing Virtualbox, and downloading Mininet. 

Now create the Mininet VM in Virtualbox. To do this select NEW button from the toolbar and go through the wizard to install the Mininet VM. At step one select the name and operating system. Type is Linux and Version is Ubuntu. Click NEXT through the memory size configuration. At the Hard drive selection option, select 'Use an existing virtual hard drive file' and add the mininet vmdk file. Now click CREATE.


The Mininet VM is created. Now we need to add extra network adapters to Virtualbox. To do this open the File -> Preferences... menu item, and open the NETWORK tab. Within the NETWORK tab, select the 'Host-only Adapter' tab and click 'Add host-only network' icon, until there are at least three 'VirtualBox Host-Only Adapter's', then click OK.


Now we need to configure the Mininet VM with the newly created virtual ethernet adapters. To do this open the SETTINGS button, and open the NETWORK tab. Select the 'Host-only Adapter', choose the first 'Virtual Host-Only Ethernet Adapter'. And open the Advanced settings of the adapter, and uncheck the 'Cable Connected' option. Add Adapter 2 and Adapter 3 in the same way. And click OK.


Virtualbox is now configured.


GNS3

In GNS3 click Edit -> Preferences... and open the VirtualBox tab. Select the 'VirtualBox Guest' sub tab. Now select the 'Mininet' VM from the 'VM List' drop down list. Set the 'Number of NICs' to 3, and check the 'Reserve first NIC for VirtualBox NAT to host OS', the 'Enable Console Support', and the 'Enable Console Server' checkboxes. Add an 'Identifier name', I choose Mininet, click SAVE button and then click OK button.




Now we are ready the to build our first lab.

The lab

For demonstration purposes the lab will consist of two routers connected to the Mininet VM. The Mininet VM will be started in the standard configuration: one Openflow switch, one controller, and two virtual hosts.












After which I manually attached both the interfaces eth1 and eth2, to the switch s1.

Both routers are configured with in the IP range 10.0.0.0/24. The .1 and .2 are used by the two virtual hosts.

The result of a ping from R1 to R2, from the perspective of R2.

R2#
*Mar  1 00:07:24.155: IP ARP: rcvd req src 10.0.0.3 c00d.2440.0000, dst 10.0.0.4 FastEthernet0/0
*Mar  1 00:07:24.155: IP ARP: sent rep src 10.0.0.4 c00e.2440.0000,
                 dst 10.0.0.3 c00d.2440.0000 FastEthernet0/0
*Mar  1 00:07:24.159: IP ARP: rcvd rep src 10.0.0.3 c00d.2440.0000, dst 10.0.0.3 FastEthernet0/0
R2#
*Mar  1 00:07:42.775: ICMP: echo reply sent, src 10.0.0.4, dst 10.0.0.3
*Mar  1 00:07:42.823: ICMP: echo reply sent, src 10.0.0.4, dst 10.0.0.3
*Mar  1 00:07:42.847: ICMP: echo reply sent, src 10.0.0.4, dst 10.0.0.3
*Mar  1 00:07:42.867: ICMP: echo reply sent, src 10.0.0.4, dst 10.0.0.3

*Mar  1 00:07:42.887: ICMP: echo reply sent, src 10.0.0.4, dst 10.0.0.3

Conclusion

Mininet provides a great tool to experiment with Software-defined networking (SDN), while providing an software switching platform within the GNS3 environment. Non of the routers available in the GNS3 (officially) support Openflow. Limiting the experimentation with Openflow to switching only.


References

5 comments:

  1. Thanks for the post. Im trying to develope some knowledge on SDN architecture but its still too fuzzy to understand as information is scattered around.

    Can you point me out to a real live SDN lab scenario please? Im working on a presentation and would like to put the lab as part of the presentation.

    Would be very much appreciated if you can help me out.

    Thanks

    ReplyDelete
  2. Thanks for the post. Im trying to develope some knowledge on SDN architecture but its still too fuzzy to understand as information is scattered around.

    Can you point me out to a real live SDN lab scenario please? Im working on a presentation and would like to put the lab as part of the presentation.

    Would be very much appreciated if you can help me out.

    Thanks

    ReplyDelete
  3. Hi and thanks for the tutorial it is really great ,however am having a problem. only one adapter, eth0 is working when attached to mininet sw1, the other eth1 wont work. i have tried with multiple topology still it wont. after trying for a long period of time, once it worked after i think uncheck the "allow gns to use any configured network interface" and then went back to same old. i tried recreating the scenario and uncheck it again and still cant get it to work. can someone pelase help

    ReplyDelete
  4. Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. https://192-168-i-i.com/cisco-router-default-password/

    ReplyDelete