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.

Setup

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.

quickstart-step1

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 ryu-manager.

quickstart-step2

Running Ryu

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:

quickstart-step3

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:

quickstart-step4

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 host as localhost:8080 and the dpid is set to 55930.

quickstart-step5

Passing Traffic

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 103 and 107 with their interfaces configured as 10.253.253.1/24 and 10.253.253.2/24. To create the virtual interfaces, run something like the following:

And repeat on the other device. Once configured, ping across the switch and you should see something like the following on the Ryu console:

quickstart-step6

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.

Happy Coding!

-Leo