Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Software-Defined Networking with OpenFlow

You're reading from   Software-Defined Networking with OpenFlow Deliver innovative business solutions

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781783984282
Length 246 pages
Edition 2nd Edition
Languages
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Oswald Coker Oswald Coker
Author Profile Icon Oswald Coker
Oswald Coker
SIAMAK AZODOLMOLKY SIAMAK AZODOLMOLKY
Author Profile Icon SIAMAK AZODOLMOLKY
SIAMAK AZODOLMOLKY
Arrow right icon
View More author details
Toc

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)...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images