参考:

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. flash 逐字,逐行歌词实现,添加伪3D效果

    项目结构: 效果如图: 项目为公司项目,下载人员禁止用于商业项目中. 项目开发工具:FlashDevelop 点击下载

  2. hihocoder [Offer收割]编程练习赛14 可疑的记录

    题目3 : 可疑的记录 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi有一棵N个节点的树,编号1-N,其中1号节点是整棵树的根.他把这棵树的N-1条边记录成N-1 ...

  3. go http 文件下载

    package main import ( "fmt" "net/http" "os" ) func DownFile() { userFi ...

  4. onethink文章详情如何做上一篇和下一篇!

    其实很简单,如果要做上一篇和下一篇,只要知道当前文章ID的前一个ID和后一个ID即可: //上一篇文章 $prewhere = array(); $prewhere['id'] = array('LT ...

  5. python基础===包的导入和__init__.py的介绍

    转自:https://www.cnblogs.com/botoo/p/8241522.html 调用同级目录: – src |– mod.py |– test.py 若在程序test.py中导入模块m ...

  6. MySQL 慢查询日志工具之pt-query-digest

    1. 工具简介 pt-query-digest是用于分析mysql慢查询的一个工具,它可以分析binlog.General log.slowlog,也可以通过SHOWPROCESSLIST或者通过tc ...

  7. 滚动侦测scrollspy

    <!doctype html><html> <head><meta charset="utf-8"><meta http-eq ...

  8. SchuledExecutorService 使用controller控制线程关闭

    1:SchuledExecutorService  使用controller控制线程关闭 package com.li.controller; import org.springframework.s ...

  9. vuejs和webpack项目(VueComponent)初尝试——瀑布流组件

    碎碎念:     好久不见,最近自己有些懈怠没更过多少博,主要原因之一是对自己学习方式的一些思考,翻看之前的博客多是记录学习笔记这反映出了自己对于前端还停留在学习-复习知识点的阶段压根没多少实践经验啊 ...

  10. Ubuntu 16.04安装Eclipse并创建桌面快捷方式

    系统:Ubuntu 16.04 JDK版本:1.8.0_121 1.官网下载eclipse,我的版本是eclipse-jee-neon-2-linux-gtk-x86_64.tar.gz,只要JDK版 ...