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
-
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.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.