您好,欢迎访问三七文档
RYU学习指南StateKeyLaboratoryofNetworkingandSwitchingTechnologyFutureNetworkingLaboratoryChengLiAgendaWhatisRYUHowRYUworkHowtodevelopWhatRYUcandoWhatisRYURyuisacomponent-basedsoftwaredefinednetworkingframework.WhatisRYUOSSSDNFrameworkfoundedbyNTT:•PythonlibraryforSDN•Apachev2license•Supportsvariousprotocolsformanagingnetworkdevices:-OpenFlow,Netconf,OF-config,SNMPetc.Features:•OpenFlow-Version:1.0,1.2,1.3,1.4,1.5•Parsingandbuildingvariousprotocolspackets:-IP,UDP,TCP,MPLS…•RyucanconfigureOpenvSwitchdirectlywithoutovs-vsctl,ovsdb-client•Integrationwithotherproject-OpenStack-HAwithZookeeper-IDS(IntrusionDetectionSystem)withsnortWhatRYUcando•VariousSDNApplicationandlibrary:-simple_switchfirewallrouter…-LACP,STP…-RESTAPI,RPC•Integrationwithotherproject:-OpenStack-HAwithZookeeper-IDS(IntrusionDetectionSystem)withsnort•TopologyViewer-Topologydiscovery-Flowentrymanagement.Mininet创建的host,switch等实例实际上是运行在不同namespace下的某个进程。默认情况下Host运行在自己的namespace中,交换节点运行在rootnamespace中。UserRYU在工业界得到了不错的应用,使用RYU作为控制器的厂家包括pica8,centec,broadcom等。开源软件交换机OVS,CPQD等也均支持RYU控制器。更多企业的SDN解决方案采用RYU控制器。RYU以其轻巧,快速开发,协议支持完整,支持和其他开源软件协同工作的特点,在开源控制器的竞争中获得了一席之地。Ref:=b548fb40-1f9d-477c-ad35-2b9c85f47358&v=default&b=&from_search=1Howtodevelop•Installation•Gettingstarted•CLI•GUI•RESTAPI•Simple_switchInstallation•Pipinstall~pipinstallryu•NativeInstallationformSource~gitclone~cdryu~sudopythonsetup.pyinstall•Installhelper~gitclone~cdryuInstallHelper~./ryuInstallHelper.shGettingStartedStartupOptions●ryu-manager启动ryu,如果不加任何参数,则默认启动ofphandler模块。●ryurun等同于ryu-manager●Ryu-manager–h查看帮助信息●--verbose打印详细信息●--version●--observe-links自动下发LLDP,用于拓扑发现。●…●Example:ryu-managersimple_switch.pyofctl_rest.py–observe-linksCLICLIregister●参数注册统一使用oslo:OpenStackCommonLibraries。●cfg.py:CONF=oslo.config.cfg.ConfigOpts()●fromryuimportcfg:cfg模块定义了CONF对象●CONF.register_cli_opts([cfg.StrOpt(“wsapi-port”,default=8080,help=‘webapplistenport’)])GUI●使用官方GUIo官方提供GUI套件o详细教程:●使用第三方GUIo第三方GUI提供者有很多o提供了RESTAPI,用于可以使用RESTAPI来开发应用程序。•Ofctl_rest.py提供OpenFlow方面的RESTAPI接口:getthelistofallswitchesGET/stats/switchesgetthedescstatsoftheswitchGET/stats/desc/dpidgetflowsstatsoftheswitchGET/stats/flow/dpidgetflowsstatsoftheswitchfilteredbythefields:POST/stats/flow/dpid•Rest_topology.py提供获取拓扑相关API:getalltheswitchesGET/v1.0/topology/switchesgettheswitchGET/v1.0/topology/switches/dpidgetallthelinksGET/v1.0/topology/linksgetthelinksofaswitchGET/v1.0/topology/links/dpidWriteyourfirstAPP控制器需要做的事情:•创建一个app类,用于描述hub的行为:•注册监听Packet_in事件的处理函数,用于处理packet_in事件EventEventOFPMsgBaseEventbaseOFPEVENTEventMSG(datapath,version,msg_type,msg_len,xid,buf)DatapathProtocolDesc(ofproto,ofproto_parser)OthersOFPActionOutputOFPActionOutputOFPActionOFPActionHeaderStringifyMixinSimpleswitch控制器需要做的事情:•创建一个app类,用于描述switch的行为:•注册监听Packet_in事件的处理函数,用于处理packet_in事件:相比hub,多了MAC地址自学习功能•链接:控制器需要做的事情:•创建一个app类,用于描述流量监控,继承Simpleswitch;•完成发送获取网络信息报文的函数;•注册处理统计数据回复报文的handler。•教程:•••Architecture•RYUcode•CallGraphArchitectureRYUcoderyuappbasecmdcontribcontrollerlibofprotoservicesteststopologyCallGraphDataplaneMain(RYU)AppManagerServicebrick(eventrouter)OpenVSwitchOFHandler(RyuAPP)ofprotoofproto_v1_*ofproto_v1_*_parserOpenFlowControllerHellohandlerSwitchfeatureshandlerHandlers…libARPipv4…icmpDatapathsdp1dp2dp3dpnStreamServerOpenVSwitchOpenVSwitchSocketClientRead&wirtesocketSocketserverconnectCONFAPPnAPP2OFPHandlerAPPlistresponseNewdatapathQ&AThankyouMUZIXING.COMStateKeyLaboratoryofNetworkingandSwitchingTechnologyFutureNetworkingLaboratoryChengLi
本文标题:RYU学习指南
链接地址:https://www.777doc.com/doc-7447479 .html