Book Image

Software-Defined Networking with OpenFlow - Second Edition

By : SIAMAK AZODOLMOLKY, Oswald Coker
Book Image

Software-Defined Networking with OpenFlow - Second Edition

By: SIAMAK AZODOLMOLKY, Oswald Coker

Overview of this book

OpenFlow paves the way for an open, centrally programmable structure, thereby accelerating the effectiveness of Software-Defined Networking. Software-Defined Networking with OpenFlow, Second Edition takes you through the product cycle and gives you an in-depth description of the components and options that are available at each stage. The aim of this book is to help you implement OpenFlow concepts and improve Software-Defined Networking on your projects. You will begin by learning about building blocks and OpenFlow messages such as controller-to-switch and symmetric and asynchronous messages. Next, this book will take you through OpenFlow controllers and their existing implementations followed by network application development. Key topics include the basic environment setup, the Neutron and Floodlight OpenFlow controller, XORPlus OF13SoftSwitch, enterprise and affordable switches such as the Zodiac FX and HP2920. By the end of this book, you will be able to implement OpenFlow concepts and improve Software-Defined Networking in your projects.
Table of Contents (17 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Software-Defined Networks

Running a Ryu application


Ryu applications are basically Python modules that define a subclass of ryu.base.app_manager.RyuApp. Two or more classes could be defined in a single module but priority is given to the first module sorted by name order and this is processed by the app manager. One instance of any Ryu application can run at a time in an environment. To run an application in the environment, you need to run the following script:

% ryu-manager MyFirstApplication.py 
where MyFirstApplication refers to the application name which works as a simple Layer Two switch. 

The application can be found as follows:

from ryu.base import app_manager 
from ryu.controller import ofp_event 
from ryu.controller.handler import MAIN_DISPATCHER 
from ryu.controller.handler import set_ev_cls 
class MyFirstApplication(app_manager.RyuApp): 
         def __init__(self, *args, **kwargs): 
   super(MyFirstApplication, self).__init__(*args, **kwargs) 
   @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)...