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
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.
-
Plasma Desktop 6.1.4 Release Includes Improvements and Bug Fixes
The latest release from the KDE team improves the KWin window and composite managers and plenty of fixes.
-
Manjaro Team Tests Immutable Version of its Arch-Based Distribution
If you're a fan of immutable operating systems, you'll be thrilled to know that the Manjaro team is working on an immutable spin that is now available for testing.