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
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.