参考:

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. 邮件欺诈与SPF防御

    一.邮件欺诈: 众所周知,现在邮件的发件人是自己生成的,其实发件域名也是可以自己生成的.例如,A得知B组织的邮箱域(前提是B组织邮箱域没有配置SPF),那么A可以自己起一个邮箱服务器,配置相同的域名. ...

  2. Eclipse 真机调试检测不到手机解决方案

    想用Eclipse真机调试,但是死活检测不到手机. 手机已经打开了usb调试模式. 开始用的华为Mate9,后面试了下小米,都不行. 在网上搜了一堆,什么安全驱动.adb占用.删除360手机助手.修改 ...

  3. CodeForces 651 C Watchmen

    C. Watchmen time limit per test 3 seconds memory limit per test 256 megabytes input standard input o ...

  4. 设置webView头部不能滑动

    设置webView头部不能滑动 _webView.scrollView.bounces=NO;

  5. stark - 数据列表

    一.效果图 二.数据列表 知识点: 完成(list_display)(list_display_links) 1.根据str,拿字段对象,取中文 val = self.model._meta.get_ ...

  6. 20144306《网络对抗》MAL_后门原理与实践

    本期收获 1.了解后门的基本概念. 2.Netcat.socat.MSF meterpreter的使用(MSF meterpreter实在太好玩了) 3.后门软件的启动方式: Windows任务计划程 ...

  7. 洛谷P1156 垃圾陷阱 dp

    正解:dp 解题报告: 这儿是传送门! 话说最近怎么神仙们都开始狂刷dp,,,感觉今天写了好多dp的题解的样子?(也就三四道其实× 然后这题,首先看到要么吃要么堆起来就会想到01背包趴?然后就考虑设方 ...

  8. windows下安装redis(转)

    add by zhj: redis相比memcached相比,性能上并没有绝对的优势.我们用redis的是因为它支持更多的数据类型,而且在分配给redis的内存用满了之后, redis也不会删除没有过 ...

  9. request对象的常用属性和方法

    request的属性 /* 1.HttpRequest.GET 一个类似于字典的对象,包含 HTTP GET 的所有参数.详情请参考 QueryDict 对象. 2.HttpRequest.POST ...

  10. mysql 数据操作 单表查询 查询排序: order by

    如果不指定排序 默认是按照id字段 从小到大排序的  升序 mysql> select * from employee; +----+------------+--------+-----+-- ...