Installing RYU SDN controller on Ubuntu 14.04 and running Simple Hub Application

October 31, 2016

In this post I will illustrate how to install RYU controller which is a python based SDN controller and run a simple RYU application.

RYU supports OpenFlow 1.0, 1.2, 1.3, 1.4, 1.5 and Nicira extensions. All of code is freely available under the Apache 2.0 license

Source :


I am using a Linux machine with the following configuration

OS : Ubuntu 14.04.1 LTS
Python : Python 2.7.6

Installing RYU

Lets get started by installing RYU first and then to run the sample application we will setup mininet, OVS.

I have written a shell script which will install RYU and its dependencies. On your machine download the script by running


Now run the script, (please note you should have sudo access to run this script)


It will take around 3 minutes to install the script.

Now we will install mininet which help us emulate a network. Please run the following commands line by line on your terminal.

git clone git://
cd mininet/
git tag
git checkout -b 2.2.2b2 2.2.2b2
cd ..
mininet/util/ -nfv

Once we install mininet now lets run a simple learning hub application on controller that is available in the ryu example applications. First we will understand what this applications does and then verify the functionalities

We need a "HUB" and a few hosts connected to it. So lets construct a topology similar to that given in RYU-BOOK. Following is our topology of 3 hosts, 1 switch and 1 controller.


Functions achieved by Simple Hub application (ryu/app/

Confirming Default Rule Insertion in Switch

In order to start the topology as drawn aboveon your terminal run

sudo mn --topo single,3 --mac --switch ovsk --controller remote -x

Now lets first set the openflow version of switch to 1.3 by running,

sudo ovs-vsctl set Bridge s1 protocols=OpenFlow13

We will now have a look at the flow table of the switch, (it should be empty)

sudo ovs-ofctl -O openflow13 dump-flows s1


The flow table is empty as we anticipated. Start the controller application after the control channel connection is established there should be a default flow entry added to the switch. Lets confirm this. Open a second terminal on your machine and run

ryu-manager --verbose

Once the controller and switch exchange hello packets and the switch features are received by the controller the control channel is established. We can see the output like below


Now lets check the flow table for the switch again, run

sudo ovs-ofctl -O openflow13 dump-flows s1


The default flow entry is added with the least priority. Thats Great !!! Our first functionality is confirmed.