-
Notifications
You must be signed in to change notification settings - Fork 122
Home
OpenFlow is an open interface for remotely controlling the forwarding tables in network switches, routers, and access points. Upon this low-level primitive, researchers can build networks with new high-level properties. For example, OpenFlow enables more secure default-off networks, wireless networks with smooth handoffs, scalable data center networks, host mobility, more energy-efficient networks and new wide-area networks – to name a few.
This tutorial is your opportunity to gain hands-on experience with the platforms and debugging tools most useful for developing network control applications on OpenFlow. This page contains some material to get you started with Openflow and Mininet. Check the side bar on the right for a list of assignments to walk you through everything from the creation of your virtual machine to the implementation of an openflow router.
The sidebar to the right is an index to the various sections of the tutorial. A good place to start is Installing Required Software.
Innovate in your network!
Active ONS Tutorial Slides (4/16/2012):
Archived Tutorial Slides:- OpenNetSummit Tutorial (10/19/2011)
In this tutorial, you'll turn the provided hub controller into a controller-based learning switch, then a flow-accelerated learning switch, and extend this from a single-switch network to a multiple-switch multiple-host network. You can also find guidelines for further extensions. Along the way, you'll learn the full suite of OpenFlow debugging tools. You will:
- view flow tables with dpctl
- dissect OpenFlow message with Wireshark
- simulate a multi-switch, multi-host network with Mininet
- benchmark your controller with cbench
To get you started quickly, we provide a preconfigured virtual machine with the needed software.
You will need a computer with at least 1GB (preferably 2GB+) of RAM and at least 5GB of free hard disk space (more preferred). A faster processor may speed up the virtual machine boot time, and a larger screen may help to manage multiple terminal windows.
These instructions consider Linux, OS X, and Windows. Linux and OS X are preferred - there's less to install.
You will need administrative access to the machine.
The tutorial instructions require no prior knowledge of OpenFlow. The OpenFlow Learn More page is a concise introduction.
Email openflow-discuss - at - lists.stanford.edu if you're stuck, think you've found a bug, or just want to send some feedback.
If you are asking a question or reporting a bug, try to include as many details about your setup as possible. Include your OS, virtualization software info, X11 and ssh software you're using, VM image you're using, memory size, and the step you're on.
To learn more about OpenFlow in general, consult the main OpenFlow page. There are videos, blog entries, and more. Check the wiki for link to OpenFlow-based projects and demos.
Note: you will need to install additional stuff to get the old regression tests working. See the install instructions for your platform, referenced at the top of the OpenFlow wiki
The OpenFlow reference distribution includes a set of tests to verify that an OpenFlow switch correctly sends and receives packets. In this section, you'll run through some of the "Black Box" tests, where the regression switch acts as a controller and verifies that a switch responds properly to OpenFlow messages, as well as properly forwards packets sent to the input ports of the switch. The Black Box regression tests use this layout:
First, exit from the Mininet console:
mininet> exit
To run the tests, log in as root, from the same SSH terminal:
$ sudo su
Run a script to start up virtual ethernet pairs locally.
# openflow/regress/bin/veth_setup.pl
Veth0 connects to veth1, for example, and anytime a packet is sent to veth0, it'll pop out veth1, and vice versa. The regression suite will allocate four veth pair halves to a software OpenFlow switch and the other four to the test suite, which sends packets and checks the contents and locations of responses.
In an SSH terminal:
# ifconfig -a
You should see 8 new virtual interfaces, veth0..veth7.
Configure Wireshark to show OpenFlow messages and TCP resets in red (which delimit individual tests). In the Wireshark filter box, enter:
of || tcp.flags.reset == 1
Start running the tests, with Wireshark running on lo (loopback interface):
# openflow/regress/bin/of_kmod_veth_test.pl
You may see OpenFlow messages for each test - if not, hit Ctrl-C to stop the tests, and clean up any leftover state:
# openflow/regress/bin/of_kmod_veth_teardown.pl
Sometimes on the first run, the tests fail; we're not sure why this is happening. Restart after tearing down and they should work.
Then, re-run the tests:
# openflow/regress/bin/of_kmod_veth_test.pl
When you get bored, stop the tests and check the messages. Then clean up any state:
# openflow/regress/bin/of_kmod_veth_teardown.pl
The regression suite is useful for verifying new switch features, as well as diagnosis divergent behavior between different switches. The suite is generally used with 4 physical ports on hardware switches. We won't do anything more with it in this tutorial, but feel free to peruse the code. See the openflow/regress/projects/black_box directory, which has a file for each test.
To teardown virtual ethernet pairs, run:
# openflow/regress/bin/veth_teardown.pl
A replacement test suite is in the making, and is expected for mid 2010. The new suite will be based on Python and reorganized to make switch-specific tests and port configurations much easier to define and debug.
Exit back to regular username:
# exit
This tutorial was written by Brandon Heller and Yiannis Yiakoumis and beta-tested by Bob Lantz, KK Yap and Masayoshi Kobayashi.
For the current Tutorial VM setup, see:
https://github.com/mininet/openflow-tutorial/wiki/Installing-Required-Software
OpenFlow Tutorial Wiki - please feel free to fix errors and add improvements!