Nick Feamster’s SDN Course

I just want to put in a recommendation for Nick Feamster’s excellent Software Defined Networking course. It’s free on Coursera, and not only does he do a great job of clearly explaining SDN, network virtualization, and related topics, he has also created some excellent videos explaining the usage, design, and rationale for the Mininet system, which is also being used for programming assignments and labs in the course.

There are also interesting interviews with notable people like Martin Casado, David Clark, and Teemu Koponen. It’s quite excellent, very approachable for anyone who has a basic networking background, and highly recommended:

https://www.coursera.org/course/sdn

The course has already started, but as of today (Thursday July 11th) you can still sign up for it.

-Bob

Automating Controller Startup

One of Mininet’s key features is that it makes it very easy to create a complete virtual network including hosts, switches, links and OpenFlow controllers. By default, Mininet runs Open vSwitch in OpenFlow mode, which requires an OpenFlow controller.

As you probably know, Mininet comes with built-in Controller() classes to support several controllers, including the OpenFlow reference controller (controller), Open vSwitch’s ovs-controller, and the now-deprecated NOX Classic.

You can easily choose which one you want when you invoke the mn command:

sudo mn --controller ref
sudo mn --controller ovsc
sudo mn --controller NOX,pyswitch

Each of the above examples uses a controller which turns your OVS switches into Ethernet bridges (aka learning switches.)

Note that ovsc is easy to install but only supports 16 switches. You can install the reference controller (patched to support many switches) using install.sh -f. (As of this writing, you can also install NOX Classic using install.sh -x.)

The manual way: using remote controllers

But what do you do if you want another controller like POX? Well, one way is to start up POX (or Beacon, Floodlight, etc.) in another terminal window and then use --controller remote:

sudo mn --controller remote,ip=127.0.0.1

If your controller is running locally, you can just use

sudo mn --controller remote

You might be asking: is there a way for Mininet to automatically start up my controller so that I don’t have to do it manually? The answer is, of course, yes!

The automatic way #1: using the command line

The latest Mininet master branch allows you to change the command and arguments for --controller ref to invoke another controller as desired. For example, here’s how you could invoke POX:

sudo mn --controller ref,command='python pox.py',cdir=$HOME/pox,cargs='openflow.of_01 --port=%s forwarding.l2_learning'

Note the following options:

cdir: the directory to change to before invoking the controller

command: the command to start your controller

cargs: the controller’s arguments (including %s for wherever the controller’s listening port should go)

The super automatic way #2: creating a custom Controller() subclass

This is much easier than it sounds, and it has worked in Mininet since version 1.0!

Here is a custom class for POX’s l2_learning:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from mininet.node import Controller
from os import environ

POXDIR = environ[ 'HOME' ] + '/pox'

class POX( Controller ):
    def __init__( self, name, cdir=POXDIR,
                  command='python pox.py',
                  cargs=( 'openflow.of_01 --port=%s '
                          'forwarding.l2_learning' ),
                  **kwargs ):
        Controller.__init__( self, name, cdir=cdir,
                             command=command,
                             cargs=cargs, **kwargs )

controllers={ 'pox': POX }

With this class saved into pox.py, you can now do the following:

sudo mn --custom pox.py --controller pox

Additionally you can use the custom class in your Mininet scripts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python

from mininet.log import setLogLevel
from mininet.net import Mininet
from mininet.topolib import TreeTopo
from mininet.cli import CLI

# We assume you are in the same directory as pox.py
# or that it is loadable via PYTHONPATH
from pox import POX

setLogLevel( 'info' )

net = Mininet( topo=TreeTopo( depth=2, fanout=2 ),
               controller=POX )

net.start()
CLI( net )
net.stop()

Note that in this custom class we’ve simply changed __init__, but in a more complicated example you might wish to change the start() and stop() methods as well.

Announcing Mininet 2.0.0

We are pleased to announce the availability of Mininet 2.0.0!

In the last few years, the Mininet community has grown from a few users at Stanford to an active mailing list with over 500 members in academia, startups, and industry.

Version 2 (“HiFi”) is a major upgrade that expands Mininet’s scope from functional testing (“does my network control plane work?”) to performance testing (“how well does my custom congestion control perform with 10 Mb/s links?”). New APIs now allow you to create links with specified bandwidths, latencies and loss rates, and to limit the CPU usage of virtual hosts. Using these new features, 37 students in Stanford University’s Advanced Topics in Networking course (CS244) replicated 16 published research experiments; you’re encouraged to browse their stories at The Reproducing Network Research Blog.

Other new features of Mininet 2.0.0 include:

  • An all-new website, http://mininet.github.com, with online doxypy documentation for all classes.
  • More flexible mn command line options, including the ability to specify NOX (and, in the future, POX) modules from the mn command line, and the ability to set link and CPU bandwidth limits
  • Dynamic link reconnection in OVS (supports migration and mobility emulation)
  • First-class abstractions/classes for link (Link) and interface (Intf) objects
  • Interface/link bandwidth limiting support using tc, via TCIntf and TCLink classes
  • CPU bandwidth limiting supporting both CFS bandwidth limiting and POSIX real-time scheduling, via the CPULimitedHost class
  • Easier task execution on virtual hosts via the Host.Popen() interface, implemented in mnexec using the setns system call
  • Easier and faster native installations that can use the latest Open vSwitch packages.

Note that the Topo object has changed somewhat to enable more flexible topology params, and as a result, your old code may need a few changes.

Download and installation instructions are available at http://mininet.github.com/download and Mininet source code may be found at https://github.com/mininet/mininet. We welcome new feature implementations, bug fixes, bug reports, FAQ additions and other contributions, and we look forward to high-quality discussions on mininet-discuss.

Thanks to all the code contributors, bug reporters, and active users who helped make this release possible!

The Mininet Team

  • Bob Lantz
  • Brandon Heller
  • Nikhil Handigol
  • Vimalkumar Jeyakumar

Website Updated

The old website had an obscure, needed-Google-to-find-it address, and was generated server-side, so it could be a bit slow. The new page you’re seeing was built with Octopress and is hosted on GitHub Pages. Since it’s all statically generated pages now, it should load super-quick, and it’ll be easier to add blog entries and do page customization.

Try it out, and let us know what you think!

-The Mininet Team