The Road to Ryu: Hi 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的更多相关文章
- SDN学习之RYU源码安装
近些天开始接触SDN,即软件定义网络的学习,由于是初学者,想通过写博客来分享自己对sdn学习中所使用的ryu以及mininet仿真软件. Mininet源码安装: 尽管网上对mininet的安装教程很 ...
- RYU基础整理
1. RYU结构,源码 1.1 RYU文件目录 下面介绍ryu/ryu目录下的主要目录内容. base base中有一个非常重要的文件:app_manager.py,其作用是RYU应用的管理中心.用于 ...
- Easy install ryu
参考:Ubuntu14.04安装Ryu控制器 环境:Ubuntu 14.04 64bit 使用pip安装ryu: // dependencies sudo apt-get install Python ...
- SDN实验---Ryu的源码分析
一:安装Pycharm https://www.cnblogs.com/huozf/p/9304396.html(有可取之处) https://www.jetbrains.com/idea/buy/# ...
- Ubuntu16.04 RYU pip命令安装
pip命令安装方法 sudo apt install gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev ...
- Ryu控制器安装部署和入门
Ryu官网简介,原滋原味 Ryu is a component-based software defined networking framework. Ryu provides software c ...
- 八位彻底改变App Store的iOS开发者
我们与 app 交互的方式已经被一群聪明的开发者所完全改变,他们的共性是对 app 都有各自独到的见解.下面就是其中最顶尖的八位. Loren Brichter Tweeite 不是 iOS 上第一个 ...
- [转] List of OpenFlow Software Projects
List of OpenFlow Software Projects (that I know of) http://yuba.stanford.edu/~casado/of-sw.html (I a ...
- en-zh(科学技术)science and technology
S Korea to roll out 5G韩国正式推5G商用服务 South Korea will become the first country to commercially launch f ...
随机推荐
- Egret3D初步笔记二 (Unity导出场景使用)
一 Scene 根据上一节的继续.在导入unity4.7.1_Egret3D_Dll.unitypackage后. 在Unity中双击打开Assets/Egret3D/Example下的Example ...
- innodb的innodb_buffer_pool_size和MyISAM的key_buffer_size(转自:http://www.java123.net/898181.html)
一. key_buffer_size 对MyISAM表来说非常重要. 如果只是使用MyISAM表,可以把它设置为可用内存的 -%.合理的值取决于索引大小.数据量以及负载 -- 记住,MyISAM表会使 ...
- python2在安装pywin32后出现ImportError: DLL load failed 解决方法
python2在安装pywin32后出现ImportError: DLL load failed 解决方法 在python2中有时候会出现: import win32api ImportError ...
- mysql-sql高级应用
sql语言进阶 典型操作 order by - select * from play_list order by createtime; - select * from play_list order ...
- 【NotePad++】使用指南
身为一名程序员,这绝对是很常用的工具,但是你真的用了他的全部功能么? 教程参考: [crifan 推荐]轻量级文本编辑器,Notepad 最佳替代品:Notepad++ 注:一个很详细的教程,虽然老, ...
- scribe、chukwa、kafka、flume日志系统对比
scribe.chukwa.kafka.flume日志系统对比 1. 背景介绍许多公司的平台每天会产生大量的日志(一般为流式数据,如,搜索引擎的pv,查询等),处理 这些日志需要特定的日志系统,一 ...
- Rancher OS
Rancher OS 是生产规模中运行 Docker 最小,最简单的方式.RancherOS 的所有东西都作为 Docker 管理的容器.这些系统服务包括 udev 和 rsyslog.Rancher ...
- Django - 路由层(URLconf)
一.django 静态文件配置 /mysite1/settings.py STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_ ...
- web前端开发http-server
windows环境下需先安装npm 安装 npm install -g http-server http-server -a hostip -p port
- ansible(3)
一.setup模块 ansible的setup模块主要用来收集信息,查看参数: [root@localhost ~]# ansible-doc -s setup # 查看参数,部分参数如下: filt ...