Deployment Guide

89
B Appendix Setting up flows with the DNOS-OF SDN
Agent, Ryu SDN Controller, and Ryu REST API
The following shows annotated console extracts of installing the Ryu 3.23 controller, setting up the Ryu
REST API JSON parser, connecting the DNOS-OF switch agent to the Ryu controller, setting up sone test
flows, and shows some other useful utility commands available through the Ryu controller. This example
is shown running on a Debian Linux machine but also runs fine on Ubuntu and CentOS.
1. Ryu 3.23.2 Installation
Install the RYU controller using the below set of commands on a Debian Linux machine.
Prerequisites: (for Debian-based distributives)
sudo apt-get install git
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install python-dev
To install but not build Ryu controller:
sudo pip install ryu
To install and build sources : Ryu BUILD:
git clone git://github.com/osrg/ryu.git
cd ryu
sudo python ./setup.py install
Make sure you get one of the latest RYU controller releases, 3.23 or later. The prior versions had a bug
that would not allow the JSON scripts to execute properly in a multi table environment. Also note that
these later releases of Ryu require a newer Python release, V3.4, to run properly. However many things
rely on their old Python 2.7 installations for many applications, so you will want to have both with one
listed as the primary alternative and the other as the backup alternative.
2. Starting the Ryu controller with the REST API enabled
Once you have the controller downloaded, installed and validated, you are ready to start it up and
establish a link from the DNOS-OF SDN agent.
Navigate to the ryu/ryu/app subdirectory created when Ryu is installed and find the ofctl_rest.py file.
Start the Ryu controller with the REST API as shown below and you should see something like the
following messages:
khughes@ODL42:~/Ryu/ryu/ryu/app$ ryu-manager --verbose ofctl_rest.py
loading app ofctl_rest.py
loading app ryu.controller.ofp_handler
instantiating app None of DPSet
creating context dpset
creating context wsgi
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app ofctl_rest.py of RestStatsApi
BRICK dpset
CONSUMES EventOFPStateChange
CONSUMES EventOFPPortStatus
CONSUMES EventOFPSwitchFeatures
BRICK ofp_event