One of the largest hurdles with getting started with OF-DPA is finding everything you need just to get an example OF-DPA pipeline application running. Once an example is working, it becomes much easier to experiment. This tutorial will cover setting up your Ryu environment with a modified Simple Switch application designed to provide simple L2 switching in the OF-DPA pipeline. As an extra bonus, this will also cover getting Ryu’s REST interface operational while the switch application is running.
All you need is an Ubuntu (or Ubuntu-based distribution) server or VM running the equivalent of version 14.04 LTS or 15.04 and OF-DPA Insider’s Simple Switch Quick Start for Ryu package available in our Marketplace as a free download.
For this tutorial, I am using Ubuntu Desktop 14.04 VM as the container for my Ryu controller and development environment.
On your server, extract the quick start package and enter the new simpleswitch-quickstart directory. Go ahead and run make without any arguments to see the targets available.
Now that the quick start environment is extracted, run
make setup to automatically install the required libraries and a local Ryu environment under
./usr/. Sudo may ask for your password while installing system components. At the end, you should now have a new local
usr directory with its own
Now it is time to start Ryu and the Simple Switch application. Run
make run-ryu-switch to start Ryu with the switch and REST applications enabled. Once started, configure your OF-DPA 2.0 switch to connect to your new controller on port
6633. The result should look something like this:
The switch connected to Ryu and the Simple Switch application has set up the proper flows to get it started.
Connecting to Ryu’s REST Interface
Now let’s see if the REST interface is available. Point your browser to the server running Ryu. If you are running it locally, that would be
http://localhost:8080/stats/switches. We recommend using Postman when browsing the REST interface. As a quick example, enter that URL in Postman and click Send:
Of course, if you have our Ryu REST API Collection for Postman (also a free download!), you can easily explore. In this case, the environment defines the
localhost:8080 and the
dpid is set to
The whole point of having a switch is being able to pass data from one place to another. In this example application, the switch is configured to attach all ports to a single VLAN, which is VLAN ID 1. This version of Simple Switch will only pass tagged traffic on that VLAN so any network devices connected to it will need to be configured to communicate over VLAN ID 1, rather than being untagged. For Linux, this is as simple as using vconfig to create the VLAN interfaces. For example, I have two VMs connected to the switch through two different physical 10GigE connections on OpenFlow ports
107 with their interfaces configured as
10.253.253.2/24. To create the virtual interfaces, run something like the following:
$ sudo vconfig add eth2 1
$ sudo ifconfig eth2.1 10.253.253.1/24
And repeat on the other device. Once configured, ping across the switch and you should see something like the following on the Ryu console:
More information is available in the
README.pdf file included in the quick start package. I hope you enjoyed this quick start tutorial! Please let us know if this worked for you or what other articles you would like to see in the comments below.