Testing SDN behavior with Mininet
Interaction with Mininet
Mininet offers an extensive Python API [11], which you can use to control the overall behavior of each component. You can also use it to define the topology of the network, launch arbitrary processes on hosts, change the parameters of a network interface dynamically, and cycle switch ports off and back on again during emulation. To observe the behavior of a network in a dynamic environment, Mininet even lets you add additional switches, hosts, and network interfaces during an ongoing emulation.
One special feature of Mininet is its interactive command-line (CLI) mode, which allows you to run commands on hosts while the emulation is running. Additionally, it lets you type and run Python code – for example, to change the network topology interactively.
To see whether the OpenFlow controller you are using can cope with dynamically appearing computers, the following example adds a host named H3
to an existing network:
# py net.addHost("H3") <Host H3: pid=1165>
In the next step, you patch the host to S1,
# py net.addLink( net.get("S1"),net.get("H3"))<mininet.link.Link object at 0x13e1c90>
and enable the new interface on S1. To do this, you need to discover the name of the new interface:
# py net.get("S1").intfList() [<Intf lo>, <Intf s1-eth1>, <Intf s1-eth2>, <Intf s1-eth3>]
Armed with the knowledge that the name is s1-eth3
, you can now enable the Mininet interface:
# py net.get("S1").attach("s1-eth3")
Finally, you need to configure the IP address on H3:
# py net.get('H3').cmd("ifconfig h3-eth0 10.0.0.3")
A ping test finally checks to see whether H1 can reach the new host, H3. As Figure 2 shows, the test was successful. For a more detailed demonstration of the capabilities of Mininet, check out the OpenFlow article in this issue.
Conclusions
Mininet is ideal for implementing automated network experiments under realistic conditions. CLI mode makes it a handy tool for rapid prototyping development of controller extensions, and MiniEdit (Figure 3) provides a GUI for creating networks [12].
Because Mininet only runs on one computer, its performance is limited. For example, on an i7 processor clocked at 3.2GHz, Mininet creates a total data throughput of 2.3Gbps. If you want to emulate a network with a higher data volume, you can try out the MaxiNet [13] project, which distributes Mininet across multiple physical computers.
Infos
- Mininet: http://mininet.org
- OpenFlow: https://www.opennetworking.org
- Network namespaces: http://blog.scottlowe.org/2013/09/04/introducing-linux-network-namespaces/
- Nox controller: http://www.noxrepo.org
- Open vSwitch controller: http://openvswitch.org/cgi-bin/ovsman.cgi?page=utilities%2Fovs-controller.8
- OpenFlow 1.0, release notes: http://archive.openflow.org/wk/index.php/OpenFlow_1.0_release_notes
- tc: http://tldp.org/HOWTO/Traffic-Control-HOWTO/software.html#s-iproute2
- Indigo virtual switch: http://www.projectfloodlight.org/indigo-virtual-switch/
- Open vSwitch: http://openvswitch.org
- OpenFlow specs: https://www.opennetworking.org/sdn-resources/onf-specifications/openflow
- Python API for Mininet: http://mininet.org/api/annotated.html
- MiniEdit: http://gregorygee.wordpress.com/category/miniedit/
- MaxiNet: http://www.cs.uni-paderborn.de/?maxinet
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.