参考:

ryu入门教程

ryu

ryu/ryu Structure

-ryu/ryu
app
base
cmd
contrib
controller
lib
ofproto
services
tests
topology

ryu/ryu/app

基于ryu控制器开发的app,内含ryu的图形界面、北向防火墙、北向QoS、简易L2交换机、L3路由器等。

ryu/ryu/base

内含app_manager.py脚本,用于加载ryu应用程序,接受从APP发送过来的信息,同时也完成消息的路由。

定义了两大基类:RyuApp和AppManager。RyuApp定义了App的基本属性,AppManager则定义了用于管理多个App的方法和属性。

ryu/ryu/controller

该文件夹中含有许多关键的ryu源码文件,这里提一下controller.py,该文件中含有两个十分重要的类:

class OpenFlowController(object)

class Datapath(ofproto_protocol.ProtocolDesc)

其中类OpenFlowController定义了构建一个控制器的基本方法和属性,DataPath是用于描述OpenFlow控制器和交换机是如何连接的类:

    A class to describe an OpenFlow switch connected to this controller.

    An instance has the following attributes.

    .. tabularcolumns:: |l|L|

    ==================================== ======================================
Attribute Description
==================================== ======================================
id 64-bit OpenFlow Datapath ID.
Only available for
ryu.controller.handler.MAIN_DISPATCHER
phase.
ofproto A module which exports OpenFlow
definitions, mainly constants appeared
in the specification, for the
negotiated OpenFlow version. For
example, ryu.ofproto.ofproto_v1_0 for
OpenFlow 1.0.
ofproto_parser A module which exports OpenFlow wire
message encoder and decoder for the
negotiated OpenFlow version.
For example,
ryu.ofproto.ofproto_v1_0_parser
for OpenFlow 1.0.
ofproto_parser.OFPxxxx(datapath,...) A callable to prepare an OpenFlow
message for the given switch. It can
be sent with Datapath.send_msg later.
xxxx is a name of the message. For
example OFPFlowMod for flow-mod
message. Arguemnts depend on the
message.
set_xid(self, msg) Generate an OpenFlow XID and put it
in msg.xid.
send_msg(self, msg) Queue an OpenFlow message to send to
the corresponding switch. If msg.xid
is None, set_xid is automatically
called on the message before queueing.
send_packet_out deprecated
send_flow_mod deprecated
send_flow_del deprecated
send_delete_all_flows deprecated
send_barrier Queue an OpenFlow barrier message to
send to the switch.
send_nxt_set_flow_format deprecated
is_reserved_port deprecated
==================================== ======================================

ryu/ryu/cmd

定义了ryu的命令系统。

ryu/ryu/contrib

社区贡献者的代码。

ryu/ryu/lib

该目录下定义了一些数据报的格式和数据结构,及诸多网络协议。

ryu/ryu/ofproto

该目录下的文件分为两类,一类定义协议的数据结构,另外一类用于协议报文解析。

ryu/ryu/services

完成了bgp、vrrp协议及ovsdb的实现。

ryu/ryu/tests

用于测试。

ryu/ryu/topology

定义了自定义拓扑文件中需要的一些模块和方法,其中的关键文件是switches.py,完成了对一整套交换机处理流程的定义。

Hi Ryu

Env:

Mac OS X.

0.pre:


python-eventlet
python-routes
python-webob
python-paramiko

1.install it:

git clone git://github.com/osrg/ryu.git
cd ryu
sudo pip3 install -r tools/pip-requires
sudo python setup.py install

2.执行:

ryu-manager simple_switch.py

2017/2/29

The Road to Ryu: Hi Ryu的更多相关文章

  1. SDN学习之RYU源码安装

    近些天开始接触SDN,即软件定义网络的学习,由于是初学者,想通过写博客来分享自己对sdn学习中所使用的ryu以及mininet仿真软件. Mininet源码安装: 尽管网上对mininet的安装教程很 ...

  2. RYU基础整理

    1. RYU结构,源码 1.1 RYU文件目录 下面介绍ryu/ryu目录下的主要目录内容. base base中有一个非常重要的文件:app_manager.py,其作用是RYU应用的管理中心.用于 ...

  3. Easy install ryu

    参考:Ubuntu14.04安装Ryu控制器 环境:Ubuntu 14.04 64bit 使用pip安装ryu: // dependencies sudo apt-get install Python ...

  4. SDN实验---Ryu的源码分析

    一:安装Pycharm https://www.cnblogs.com/huozf/p/9304396.html(有可取之处) https://www.jetbrains.com/idea/buy/# ...

  5. Ubuntu16.04 RYU pip命令安装

    pip命令安装方法 sudo apt install gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev ...

  6. Ryu控制器安装部署和入门

    Ryu官网简介,原滋原味 Ryu is a component-based software defined networking framework. Ryu provides software c ...

  7. 八位彻底改变App Store的iOS开发者

    我们与 app 交互的方式已经被一群聪明的开发者所完全改变,他们的共性是对 app 都有各自独到的见解.下面就是其中最顶尖的八位. Loren Brichter Tweeite 不是 iOS 上第一个 ...

  8. [转] List of OpenFlow Software Projects

    List of OpenFlow Software Projects (that I know of) http://yuba.stanford.edu/~casado/of-sw.html (I a ...

  9. en-zh(科学技术)science and technology

    S Korea to roll out 5G韩国正式推5G商用服务 South Korea will become the first country to commercially launch f ...

随机推荐

  1. C# DateTime.Now详细用法

    //2008年4月24日 System.DateTime.Now.ToString("D"); //2008-4-24 System.DateTime.Now.ToString(& ...

  2. mysql存储过程基础示例

    转自:http://database.51cto.com/art/201608/516661.htm http://www.cnblogs.com/mark-chan/p/5384139.html D ...

  3. [Gradle] 输出构建 APK 的版本名到文件

    android { // 输出版本名到 build 目录下的 version_name.txt 文件 applicationVariants.all { variant -> project.t ...

  4. Postgresql源码安装

    以在64位CentOS6.5操作系统上源码安装postgresql-9.6beta1为例 一.进入官网下载代码(postgresql-9.6beta1.tar.gz) https://www.post ...

  5. Fiddler关闭自动更新

    1,fiddler 启动时老弹出要更新,但不想更新,可以这样设置 Tools-Optons->General 把第一个√去掉

  6. 关于typecho,404页面错误

    之前用typecho,但是没发现404错误页面; 现在只要发布文章就提示404页面错误. 解决方法 点击发布日期,将发布日期的分向后拖动几分钟: 然后发布,发现404错误不见了: 我是遇到这种情况了不 ...

  7. SQL Server 存储过程生成流水号

    SQL Server利用存储过程生成流水号 USE BiddingConfig SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON GO -- =========== ...

  8. JS生成GUID方法

    function GUID() { this.date = new Date(); /* 判断是否初始化过,如果初始化过以下代码,则以下代码将不再执行,实际中只执行一次 */ if (typeof t ...

  9. yii2 controller发送json数据给前端

    最近要用yii2把之前老项目重构一下,因为前端打算用vuejs,所以Yii2前端那一套就放弃了,直接给前端传json数据 控制器代码: $response = Yii::$app->respon ...

  10. s3对象存储

    bkstorages 模块帮助你在蓝鲸应用中使用多种文件存储服务作为后端,用于加速静态资源,管理用户上传文件. 自定静态文件 storage 如果通过修改配置文件满足不了你的需求,你随时可以通过继承 ...