SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
Ryu: SDN framework and Python
experience
Isaku Yamahata <yamahata@private.email.ne.jp>
<isaku.yamahata@gmail.com>
Pycon APAC 2013, September 14
Agenda
● Introduction
● Ryu: SDN framework
● Ryu Internals
– Openstack support
● Ryu development
● Python experience through Ryu
This presentation represents my personal view/opinion. Not Ryu project nor any companies.
Who am I?
● My background is OS/virtualization/cloud
– Not network guy
● Programming language
– C/C++/assembler
● Projects I've contributed
– Linux
– Virtualization
● Qemu, KVM, Xen
– OpenStack
● Nova, neutron(formarly quantum) Ryu plugin
– Open vSwitch
● My python experience had begun with OpenStack and Ryu
Introduction
What's SDN? And why?
●
Software Defined Networking
– Making network programmable
– http://www.opennetsummit.org/why-sdn.html
●
SDN is a disruptive technology that is making
networks programmable by ordinary programmers
using ordinary software running on ordinary
operating systems in ordinary servers. With SDN,
the introduction of new features becomes less
manual, less prone to error, and faster to
implement.
– [Paraphrased from the HotSDN ‘13 Solicitaion]
●
Software Defined Networking (SDN) is a refactoring
of the relationship between network devices and the
software that controls them.
● Motivations behind SDN
– Academic research
● Allow researchers to program/modify
switches freely
– Industry technology trends
● Virtualization/cloud technology
● Network is behind those technology
progress
● Networkig virtualization/automation
From http://opennetsummit.org/why.html
Separating data/control plan
From http://www.opennetsummit.org/why-sdn.html
SDN architecture
Openflow
datapath(hardware)
controlpath(software)
datapath(hardware)
controlpath(software) openflow
Openflow controller
Openflow protocol(tcp/ssl)
Ethernet switch Openflow ethernet switch
● protocol to control switches
Flow table and match/action
Openflow controller
Flow table
MAC
src
MAC
dst
IP
src
IP
dst
TCP
src
TCP
dst ... action
Packet in event
When entry miss
* * * * * 80
output
port N
port PacketportPacket
Packet match Action
Ryu, a component-based
software-defined networking
framework
What's Ryu?
流 龍
Flow
Oriental Dragion,
A god of water
Manages flow control to
enable intelligent networking
http://ja.wikipedia.org/wiki/%E8%B5%A4%E7%9B%AE%E5%9B%9B%E5%8D%81%E5%85%AB%E6%BB%9D
What's Ryu?
● a component-based software-defined
networking framework
● License: Apache 2.0
● Fully written in Python
● Supports various protocols for managing
network devices
– OpenFlow, Netconf, OF-config, SNMP etc.
●
Official site http://osrg.github.io/ryu/
●
MLhttps://lists.sourceforge.net/lists/listinfo/ryu-devel
●
Download https://github.com/osrg/ryu
●
Documentation http://ryu.readthedocs.org/en/latest/
● Wiki https://github.com/osrg/ryu/wiki
Supported features/protocols
● Openflow protoocol
– OF-wire: 1.0,1.2, 1.3, Nicira extension
– OF-config 1.1
● Non-openflow protocols
– Netconf, OVSDB, netflow, sflow,
VRRP, SNMP
● Snmp: Enterprise OID: 41786
– Ryu can configure Open vSwitch
directly without ovs-vsctl, ovsdb-client
Some features are under development. The patches can be found on ML archive.
● RyuApp, library
– Packet library
– STP, LACP
– Sample apps, etc...
– Conversion from/to JSON
representation from/to OF
– RPC to communicate/control Ryu
● Integration with other project
– OpenStack
– HA with Zookeeper
– IDS(Intrusion Detection System)
with snort
OF/firewall/router REST API
● OF REST (ofctl_reset)
– Insert/delete openflow rule
● Firewall (rest_firewall)
– Configure firewall
– https://github.com/osrg/ryu/wiki/Third-Party-Tools,-Etc.
● Router(rest_router)
– Configure router
Ryu
REST
OF REST API
add a flow entry
POST http://example.org/stats/flownetry/add
delete flow entries
DELETE http://example.org/stats/flowentry/delete
get flow stats
GET http://example.org/stats/flow/{dpid}
allow
drop
firewall
OF switch
Ryu
REST
OF switch
router
Topology Viewer
● Discover topology
by LLDP and
show
topology/flows
dynamically
HA support
● Centralized controller is single pointer of
failure(SPOF)
● Ryu + Zookeeper can be used to address
SPOF
Ryu Ryu
zookeeper
OF switch
master slave
failover
IDS support
● Snort integration
https://github.com/osrg/ryu/wiki/Snort-Integration
Ryu
OF switch
Sort
Control app IDS(snort)
1. L1-L4 matching
2. send patcket to IDS
3. alert4. take actions
e.g. loggingt
Ryu Internals
Ryu implementation
● Quite normal python program from the point of implementation
view
– It doesn't use any special tricks
● Event driven
– Event source/dispatcher/sink
– Core(= Event dispatcher) is very small
– It is so generic that Ryu can be used without OpenFlow
● Component based
– Event source/sink are created as components
● Even OpenFlow related codes are so
– Message passing via events, not directly communite.
Ryu architecture
● Follows standard SDN architecture
OpenFlow switch OpenFlow switch Network device
SDN apps
Well defined API
(REST, RPC...)
Open protocols
(OpenFlow, OF-config,
NETConfig, OVSDB...)
SDN apps SDN apps
Ryu SDN framework
OpenFlow
Parser/serializer
Event dispatcher
Ryu built-in app
(tenant isolation,
Topology discovery, firewall )
Ryu App
libraries
Protocol support
(OVSDB, VRRP, ...)
Ryu App...
operator openstack User app
Control layer
Application layer
Aio/thread
● Uses eventlet
– Like OpenStack
– gevent was used before
– switched to eventlet for pypy
● twisted was not adopted for simplicity
● eventlet(or gevent) is cooperative threading, so
some cautions are needed
– This is different from preemptive threading like pthread
Event Dispatcher
● class AppManager and class RyuApp
● The guts of Ryu
● Decouples event sources/sinks
– Event sources generate whatever events
– Event sinks register handlers dynamically
● Dispatches events based on class of events
– To event sinks that want class of events
– Class is a first class object in Python
● knows which methods are interested in which event by
methods attributes
– Methods are also first class object in Python
RyuAppRyuApp
queue
BRICKS
Event
Determin which RyuApp to deliver
Based on class of event
dispatch
Events are read only because
It is shared with many RyuApps
Event sink
Event dispatcher
RyuAppRyuApp
queue
RyuAppRyuApp
queueEvent source
EventEvent source
Event source/sink
● source
– Call methods of the event dispatcher to generate events
● sink
– Subclass of class RyuApp
● Event dispatcher knows which methods are interested in which
events
– Event handlers are invoked in its own thread context of each
RyuApp
– To avoid race condition
– Direct queuing is also possible
RyuApp
queue
Event thread
Consuming events
Event
Event request/reply
● request/reply messaging between RyuApps for
easy programming
RyuApp
Event thread
RyuAppevent
queue
RyuApp
Event thread
RyuApp
event
queue
reply
queue
reply
queue
request
event
reply
event
1. queue request event
3. process request
4. queue back result
5. wake up
waiting event thread
If necessary
2. wait for reply if
synchronous
OpenFlow parser and its event
● Only controller part is supported
● OF events are created automatically on startup
– Introspection is used
● “Where EventOFPxxx is defined?” is FAQ
ofproto_v1_N_parser
OFPxxx EventOFPxxx
ofp_event
Connection to OpenFlow switch
● class OpenFlowController, class Datapath
● Receiving loop and sending loop
OpenFlow switch
Receiving thread
Generates OFPEvents
Sending thread
Serialize and send
OF packets
Send queue
EventOFP
message
Ryu
Datapath
RyuAppRyuApp
queue
Event sink
OpenStack support
OpenStack Component
● Composed of Many
component
● Neutron
– Plugin architecture
– Able to support many
network technology
service Openstack project
compute nova
storage swift(object)
glance(image)
cinder(block)
identity keystone
network neutron
... ...
Ryu Plugin for Neutron
● L2 isolation
● Multi tenant w/o or w/ VLAN
– Mac address based
– VLAN
– GRE tunnel
Overview of Ryu plugin
Compute-node
Vif driver
Create
OVS port
Ryu
agent OVS
OVS
initialization
OVS
Ryu
agent
OVS
initialization
L3 agent
Neutron Node
Neutron DB
(Network ID, key)
Ryu server
(Network ID, key)
Neutron API
Ryu node
r
Ryu REST
OpenFlow & OVSDB
Neutron server
Ryu
plugin
Network node
OpenStack L2 isolation: logical view
VM VM VM VM VM VM
Tenant X Tenant Y
OpenStack L2 isolation: physical view
Compute
Node
Compute
Node
Compute
/network
OVS
OVS
Tenant X
VM
Tenant Y
VM
Tenant X
VM
Tenant Y
VM
Tenant X
VM
Tenant Y
VM
Tenant => GRE key
GRE tunnel
OpenFlow
Tenant X
GRE key = M
Tenant Y
GRE key = N
L2 over L3 with GRE tunnel
- Able to span over network
segments
(l2 segment can over multi
data centers)
- can coexists with
Conventional network
technology
Set GRE key
Deliver packets
based on GRE key
En/de-cupsel packet
Into/from GRE packet
Ryu
nw-gw
nw-gw OVS
Table 0 Table 1 Table 2
Src table Tunnel out Local out
VM port
match action
in_port
src mac
set_tunnel
goto table 1
in_port drop
match action
tunnel_id
dst mac
output(tunnel)
goto table 2
match action
tunnel_id
dst mac
output(vm)
tunnel_id goto table 2
tunnel_id drop
Tunnel
port in_port
tunnel_id
goto table 2
in_port drop
OVS
VM1
VM2
GRE tunnel
tunnel
port
VM port
In port
Flow Table Usage
Nicira extension is used for GRE tunnel
GRE tunneling with OpenStack
● Composed of several RyuApps
● Network tenant creation
– Assign GRE key
– Create gateway
● Guest VM instance creation
– Create port
● Tenant ↔ key ↔ port relationship
– Set flow to the VM port
● Tunnel port management
– Create/delete tunnel port
● Track physical compute node
– Set flow to the tunnel port
rest_quantum
gre_tunnel
tunnel_port_updater
quantum_adapter
REST
OVS
ovsdbOpenFlow
Neutron
Ryu
quantum: former name of neutron project
Ryu development
Development process
● Open development
● Linux style
● Discuss on Mailing List openly
● Send/review patches on Mailing List
– git format-patch
– git send-patch
– No pull request on github
● Evolution
– Ryu has evoleved from
very small program
http://dir.gmane.org/gmane.network.ryu.devel
Python experience through Ryu
Python
●
Good things
– Easy/fast to learn/use
– Many useful features
●
Dynamic language, first class everything, decorator, introspection...
– Especially introspection is very useful
– Decorator is handy
– Many useful libraries
● Bad things
– Hard to debug
● debugger(pdb) is unstable
● Debugger isn't compatible with eventlet
– Magic attributes(__xxx___)
– Many similar libraries: which to use?
AIO libraries
● Gevent → Eventlet
● In general, monky-patching is ugly hack and
very fragile
● Monkey patching of gevent/eventlet works
stably
● Hit some issues and patches are proposed.
● epoll is removed by monkey patching
Threading
● eventlet(or gevent) is cooperative threading
– Needs special care for protection
● Starvation
● Thread scheduling
– Different from native threading like pthread
● Synchronization primitives
● Hard to debug
– When debugger(pdb) tries to stop, the thread is switched to other thread
● Need to consider
– Native vs green
– Giant Interpreter Lock
– What context to deliver events?
Performance
● Gevent performs slightly better than eventlet
– But it's very slight.
– Needs other approach for more performance boost
● Pypy
– Needs patch for eventlet
● Mulit process?
Network programming
● For IGMP with VRRP
● Needs to read Cpython code or C-module code
– Much better than unsupported, though
Thank you
Questions?
http://osrg.github.com/ryu/

Contenu connexe

Tendances

SDN Networks Programming Languages
SDN Networks Programming LanguagesSDN Networks Programming Languages
SDN Networks Programming LanguagesFlavio Vit
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRoutingFaisal Reza
 
ONOS SDN-IP: Tutorial and Use Case for SDX
ONOS SDN-IP: Tutorial and Use Case for SDXONOS SDN-IP: Tutorial and Use Case for SDX
ONOS SDN-IP: Tutorial and Use Case for SDXAPNIC
 
Packet flow on openstack
Packet flow on openstackPacket flow on openstack
Packet flow on openstackAchhar Kalia
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012 Erik Onnen
 
Peer-to-Peer Systems
Peer-to-Peer SystemsPeer-to-Peer Systems
Peer-to-Peer SystemsUwe Schmidt
 
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa Rojas
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa RojasClash of Titans in SDN: OpenDaylight vs ONOS - Elisa Rojas
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa RojasOpenNebula Project
 
Introduction to OpenDaylight & Application Development
Introduction to OpenDaylight & Application DevelopmentIntroduction to OpenDaylight & Application Development
Introduction to OpenDaylight & Application DevelopmentMichelle Holley
 
Vlan Types
Vlan TypesVlan Types
Vlan TypesIT Tech
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingKernel TLV
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Diverajdeep
 
ContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling ProtocolContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling ProtocolSalah Amean
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikGLC Networks
 
OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to BottomKernel TLV
 
OVN 設定サンプル | OVN config example 2015/12/27
OVN 設定サンプル | OVN config example 2015/12/27OVN 設定サンプル | OVN config example 2015/12/27
OVN 設定サンプル | OVN config example 2015/12/27Kentaro Ebisawa
 
Operating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresOperating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresVaibhav Khanna
 

Tendances (20)

SDN Networks Programming Languages
SDN Networks Programming LanguagesSDN Networks Programming Languages
SDN Networks Programming Languages
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRouting
 
ONOS SDN-IP: Tutorial and Use Case for SDX
ONOS SDN-IP: Tutorial and Use Case for SDXONOS SDN-IP: Tutorial and Use Case for SDX
ONOS SDN-IP: Tutorial and Use Case for SDX
 
Packet flow on openstack
Packet flow on openstackPacket flow on openstack
Packet flow on openstack
 
Ppt of routing protocols
Ppt of routing protocolsPpt of routing protocols
Ppt of routing protocols
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Peer-to-Peer Systems
Peer-to-Peer SystemsPeer-to-Peer Systems
Peer-to-Peer Systems
 
Open v ran
Open v ranOpen v ran
Open v ran
 
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa Rojas
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa RojasClash of Titans in SDN: OpenDaylight vs ONOS - Elisa Rojas
Clash of Titans in SDN: OpenDaylight vs ONOS - Elisa Rojas
 
Introduction to OpenDaylight & Application Development
Introduction to OpenDaylight & Application DevelopmentIntroduction to OpenDaylight & Application Development
Introduction to OpenDaylight & Application Development
 
Vlan Types
Vlan TypesVlan Types
Vlan Types
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
ContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling ProtocolContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling Protocol
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
 
OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to Bottom
 
OVN 設定サンプル | OVN config example 2015/12/27
OVN 設定サンプル | OVN config example 2015/12/27OVN 設定サンプル | OVN config example 2015/12/27
OVN 設定サンプル | OVN config example 2015/12/27
 
Operating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresOperating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphores
 

En vedette

2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-
2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-
2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-Asuka Nakajima
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN FrameworkAPNIC
 
Ryu Learning Guide
Ryu Learning GuideRyu Learning Guide
Ryu Learning Guide呈 李
 
Brocade Software Networking (SDN NFV Day ITB 2016)
Brocade Software Networking (SDN NFV Day ITB 2016)Brocade Software Networking (SDN NFV Day ITB 2016)
Brocade Software Networking (SDN NFV Day ITB 2016)SDNRG ITB
 
Brocade SDN Controller -Sample Code for Brocade vRouter-
Brocade SDN Controller -Sample Code for Brocade vRouter-Brocade SDN Controller -Sample Code for Brocade vRouter-
Brocade SDN Controller -Sample Code for Brocade vRouter-Brocade
 
OpenFlow: What is it Good For?
OpenFlow: What is it Good For? OpenFlow: What is it Good For?
OpenFlow: What is it Good For? APNIC
 
Implementing MPLS Services using Openflow
Implementing MPLS Services using OpenflowImplementing MPLS Services using Openflow
Implementing MPLS Services using OpenflowAPNIC
 
Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Scott Sims
 
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFV
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFVOVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFV
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFVNAIM Networks, Inc.
 
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)SDNRG ITB
 

En vedette (10)

2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-
2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-
2014年10月江戸前セキュリティ勉強会資料 -セキュリティ技術者になるには-
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN Framework
 
Ryu Learning Guide
Ryu Learning GuideRyu Learning Guide
Ryu Learning Guide
 
Brocade Software Networking (SDN NFV Day ITB 2016)
Brocade Software Networking (SDN NFV Day ITB 2016)Brocade Software Networking (SDN NFV Day ITB 2016)
Brocade Software Networking (SDN NFV Day ITB 2016)
 
Brocade SDN Controller -Sample Code for Brocade vRouter-
Brocade SDN Controller -Sample Code for Brocade vRouter-Brocade SDN Controller -Sample Code for Brocade vRouter-
Brocade SDN Controller -Sample Code for Brocade vRouter-
 
OpenFlow: What is it Good For?
OpenFlow: What is it Good For? OpenFlow: What is it Good For?
OpenFlow: What is it Good For?
 
Implementing MPLS Services using Openflow
Implementing MPLS Services using OpenflowImplementing MPLS Services using Openflow
Implementing MPLS Services using Openflow
 
Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016
 
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFV
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFVOVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFV
OVNC 2015-THE NEW IP - Open Networking Architecture with SDN & NFV
 
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)
Cisco SDN/NVF Innovations (SDN NVF Day ITB 2016)
 

Similaire à Ryu sdn framework

software defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllerssoftware defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllersIsaku Yamahata
 
Quantum - Virtual networks for Openstack
Quantum - Virtual networks for OpenstackQuantum - Virtual networks for Openstack
Quantum - Virtual networks for Openstacksalv_orlando
 
neutron_icehouse_update
neutron_icehouse_updateneutron_icehouse_update
neutron_icehouse_updateAkihiro Motoki
 
2015 COSCUP SDN Workshop -- SDN Quick Start
2015 COSCUP SDN Workshop -- SDN Quick Start2015 COSCUP SDN Workshop -- SDN Quick Start
2015 COSCUP SDN Workshop -- SDN Quick StartYi Tseng
 
Openstack Neutron and SDN
Openstack Neutron and SDNOpenstack Neutron and SDN
Openstack Neutron and SDNinakipascual
 
BKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateBKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateLinaro
 
Open stack networking_101_update_2014
Open stack networking_101_update_2014Open stack networking_101_update_2014
Open stack networking_101_update_2014yfauser
 
[AI Dev World 2022] Build ML Enhanced Event Streaming
[AI Dev World 2022] Build ML Enhanced Event Streaming[AI Dev World 2022] Build ML Enhanced Event Streaming
[AI Dev World 2022] Build ML Enhanced Event StreamingTimothy Spann
 
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Big mountain data and dev conference   apache pulsar with mqtt for edge compu...Big mountain data and dev conference   apache pulsar with mqtt for edge compu...
Big mountain data and dev conference apache pulsar with mqtt for edge compu...Timothy Spann
 
OpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by AkandaOpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by AkandaSean Roberts
 
OpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by AkandaOpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by Akandaakanda_inc
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingThomas Graf
 
Network Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingNetwork Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingDigicomp Academy AG
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xrkr10
 
NaaS in OpenStack - CloudCamp Moscow
NaaS in OpenStack - CloudCamp MoscowNaaS in OpenStack - CloudCamp Moscow
NaaS in OpenStack - CloudCamp MoscowIlya Alekseyev
 
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...Timothy Spann
 
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...
Data science online camp   using the flipn stack for edge ai (flink, nifi, pu...Data science online camp   using the flipn stack for edge ai (flink, nifi, pu...
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...Timothy Spann
 

Similaire à Ryu sdn framework (20)

software defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllerssoftware defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllers
 
Quantum - Virtual networks for Openstack
Quantum - Virtual networks for OpenstackQuantum - Virtual networks for Openstack
Quantum - Virtual networks for Openstack
 
neutron_icehouse_update
neutron_icehouse_updateneutron_icehouse_update
neutron_icehouse_update
 
2015 COSCUP SDN Workshop -- SDN Quick Start
2015 COSCUP SDN Workshop -- SDN Quick Start2015 COSCUP SDN Workshop -- SDN Quick Start
2015 COSCUP SDN Workshop -- SDN Quick Start
 
Openstack Neutron and SDN
Openstack Neutron and SDNOpenstack Neutron and SDN
Openstack Neutron and SDN
 
BKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateBKK16-106 ODP Project Update
BKK16-106 ODP Project Update
 
NS3 Overview
NS3 OverviewNS3 Overview
NS3 Overview
 
Open stack networking_101_update_2014
Open stack networking_101_update_2014Open stack networking_101_update_2014
Open stack networking_101_update_2014
 
[AI Dev World 2022] Build ML Enhanced Event Streaming
[AI Dev World 2022] Build ML Enhanced Event Streaming[AI Dev World 2022] Build ML Enhanced Event Streaming
[AI Dev World 2022] Build ML Enhanced Event Streaming
 
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Big mountain data and dev conference   apache pulsar with mqtt for edge compu...Big mountain data and dev conference   apache pulsar with mqtt for edge compu...
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
 
Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101
 
OpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by AkandaOpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by Akanda
 
OpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by AkandaOpenStack Neutron Advanced Services by Akanda
OpenStack Neutron Advanced Services by Akanda
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
 
Network Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingNetwork Virtualization & Software-defined Networking
Network Virtualization & Software-defined Networking
 
OpenStack Astara
OpenStack AstaraOpenStack Astara
OpenStack Astara
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
NaaS in OpenStack - CloudCamp Moscow
NaaS in OpenStack - CloudCamp MoscowNaaS in OpenStack - CloudCamp Moscow
NaaS in OpenStack - CloudCamp Moscow
 
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...
Machine Intelligence Guild_ Build ML Enhanced Event Streaming Applications wi...
 
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...
Data science online camp   using the flipn stack for edge ai (flink, nifi, pu...Data science online camp   using the flipn stack for edge ai (flink, nifi, pu...
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...
 

Dernier

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Ryu sdn framework

  • 1. Ryu: SDN framework and Python experience Isaku Yamahata <yamahata@private.email.ne.jp> <isaku.yamahata@gmail.com> Pycon APAC 2013, September 14
  • 2. Agenda ● Introduction ● Ryu: SDN framework ● Ryu Internals – Openstack support ● Ryu development ● Python experience through Ryu This presentation represents my personal view/opinion. Not Ryu project nor any companies.
  • 3. Who am I? ● My background is OS/virtualization/cloud – Not network guy ● Programming language – C/C++/assembler ● Projects I've contributed – Linux – Virtualization ● Qemu, KVM, Xen – OpenStack ● Nova, neutron(formarly quantum) Ryu plugin – Open vSwitch ● My python experience had begun with OpenStack and Ryu
  • 5. What's SDN? And why? ● Software Defined Networking – Making network programmable – http://www.opennetsummit.org/why-sdn.html ● SDN is a disruptive technology that is making networks programmable by ordinary programmers using ordinary software running on ordinary operating systems in ordinary servers. With SDN, the introduction of new features becomes less manual, less prone to error, and faster to implement. – [Paraphrased from the HotSDN ‘13 Solicitaion] ● Software Defined Networking (SDN) is a refactoring of the relationship between network devices and the software that controls them. ● Motivations behind SDN – Academic research ● Allow researchers to program/modify switches freely – Industry technology trends ● Virtualization/cloud technology ● Network is behind those technology progress ● Networkig virtualization/automation
  • 8. Openflow datapath(hardware) controlpath(software) datapath(hardware) controlpath(software) openflow Openflow controller Openflow protocol(tcp/ssl) Ethernet switch Openflow ethernet switch ● protocol to control switches
  • 9. Flow table and match/action Openflow controller Flow table MAC src MAC dst IP src IP dst TCP src TCP dst ... action Packet in event When entry miss * * * * * 80 output port N port PacketportPacket Packet match Action
  • 11. What's Ryu? 流 龍 Flow Oriental Dragion, A god of water Manages flow control to enable intelligent networking http://ja.wikipedia.org/wiki/%E8%B5%A4%E7%9B%AE%E5%9B%9B%E5%8D%81%E5%85%AB%E6%BB%9D
  • 12. What's Ryu? ● a component-based software-defined networking framework ● License: Apache 2.0 ● Fully written in Python ● Supports various protocols for managing network devices – OpenFlow, Netconf, OF-config, SNMP etc. ● Official site http://osrg.github.io/ryu/ ● MLhttps://lists.sourceforge.net/lists/listinfo/ryu-devel ● Download https://github.com/osrg/ryu ● Documentation http://ryu.readthedocs.org/en/latest/ ● Wiki https://github.com/osrg/ryu/wiki
  • 13. Supported features/protocols ● Openflow protoocol – OF-wire: 1.0,1.2, 1.3, Nicira extension – OF-config 1.1 ● Non-openflow protocols – Netconf, OVSDB, netflow, sflow, VRRP, SNMP ● Snmp: Enterprise OID: 41786 – Ryu can configure Open vSwitch directly without ovs-vsctl, ovsdb-client Some features are under development. The patches can be found on ML archive. ● RyuApp, library – Packet library – STP, LACP – Sample apps, etc... – Conversion from/to JSON representation from/to OF – RPC to communicate/control Ryu ● Integration with other project – OpenStack – HA with Zookeeper – IDS(Intrusion Detection System) with snort
  • 14. OF/firewall/router REST API ● OF REST (ofctl_reset) – Insert/delete openflow rule ● Firewall (rest_firewall) – Configure firewall – https://github.com/osrg/ryu/wiki/Third-Party-Tools,-Etc. ● Router(rest_router) – Configure router Ryu REST OF REST API add a flow entry POST http://example.org/stats/flownetry/add delete flow entries DELETE http://example.org/stats/flowentry/delete get flow stats GET http://example.org/stats/flow/{dpid} allow drop firewall OF switch Ryu REST OF switch router
  • 15. Topology Viewer ● Discover topology by LLDP and show topology/flows dynamically
  • 16. HA support ● Centralized controller is single pointer of failure(SPOF) ● Ryu + Zookeeper can be used to address SPOF Ryu Ryu zookeeper OF switch master slave failover
  • 17. IDS support ● Snort integration https://github.com/osrg/ryu/wiki/Snort-Integration Ryu OF switch Sort Control app IDS(snort) 1. L1-L4 matching 2. send patcket to IDS 3. alert4. take actions e.g. loggingt
  • 19. Ryu implementation ● Quite normal python program from the point of implementation view – It doesn't use any special tricks ● Event driven – Event source/dispatcher/sink – Core(= Event dispatcher) is very small – It is so generic that Ryu can be used without OpenFlow ● Component based – Event source/sink are created as components ● Even OpenFlow related codes are so – Message passing via events, not directly communite.
  • 20. Ryu architecture ● Follows standard SDN architecture OpenFlow switch OpenFlow switch Network device SDN apps Well defined API (REST, RPC...) Open protocols (OpenFlow, OF-config, NETConfig, OVSDB...) SDN apps SDN apps Ryu SDN framework OpenFlow Parser/serializer Event dispatcher Ryu built-in app (tenant isolation, Topology discovery, firewall ) Ryu App libraries Protocol support (OVSDB, VRRP, ...) Ryu App... operator openstack User app Control layer Application layer
  • 21. Aio/thread ● Uses eventlet – Like OpenStack – gevent was used before – switched to eventlet for pypy ● twisted was not adopted for simplicity ● eventlet(or gevent) is cooperative threading, so some cautions are needed – This is different from preemptive threading like pthread
  • 22. Event Dispatcher ● class AppManager and class RyuApp ● The guts of Ryu ● Decouples event sources/sinks – Event sources generate whatever events – Event sinks register handlers dynamically ● Dispatches events based on class of events – To event sinks that want class of events – Class is a first class object in Python ● knows which methods are interested in which event by methods attributes – Methods are also first class object in Python RyuAppRyuApp queue BRICKS Event Determin which RyuApp to deliver Based on class of event dispatch Events are read only because It is shared with many RyuApps Event sink Event dispatcher RyuAppRyuApp queue RyuAppRyuApp queueEvent source EventEvent source
  • 23. Event source/sink ● source – Call methods of the event dispatcher to generate events ● sink – Subclass of class RyuApp ● Event dispatcher knows which methods are interested in which events – Event handlers are invoked in its own thread context of each RyuApp – To avoid race condition – Direct queuing is also possible RyuApp queue Event thread Consuming events Event
  • 24. Event request/reply ● request/reply messaging between RyuApps for easy programming RyuApp Event thread RyuAppevent queue RyuApp Event thread RyuApp event queue reply queue reply queue request event reply event 1. queue request event 3. process request 4. queue back result 5. wake up waiting event thread If necessary 2. wait for reply if synchronous
  • 25. OpenFlow parser and its event ● Only controller part is supported ● OF events are created automatically on startup – Introspection is used ● “Where EventOFPxxx is defined?” is FAQ ofproto_v1_N_parser OFPxxx EventOFPxxx ofp_event
  • 26. Connection to OpenFlow switch ● class OpenFlowController, class Datapath ● Receiving loop and sending loop OpenFlow switch Receiving thread Generates OFPEvents Sending thread Serialize and send OF packets Send queue EventOFP message Ryu Datapath RyuAppRyuApp queue Event sink
  • 28. OpenStack Component ● Composed of Many component ● Neutron – Plugin architecture – Able to support many network technology service Openstack project compute nova storage swift(object) glance(image) cinder(block) identity keystone network neutron ... ...
  • 29. Ryu Plugin for Neutron ● L2 isolation ● Multi tenant w/o or w/ VLAN – Mac address based – VLAN – GRE tunnel
  • 30. Overview of Ryu plugin Compute-node Vif driver Create OVS port Ryu agent OVS OVS initialization OVS Ryu agent OVS initialization L3 agent Neutron Node Neutron DB (Network ID, key) Ryu server (Network ID, key) Neutron API Ryu node r Ryu REST OpenFlow & OVSDB Neutron server Ryu plugin Network node
  • 31. OpenStack L2 isolation: logical view VM VM VM VM VM VM Tenant X Tenant Y
  • 32. OpenStack L2 isolation: physical view Compute Node Compute Node Compute /network OVS OVS Tenant X VM Tenant Y VM Tenant X VM Tenant Y VM Tenant X VM Tenant Y VM Tenant => GRE key GRE tunnel OpenFlow Tenant X GRE key = M Tenant Y GRE key = N L2 over L3 with GRE tunnel - Able to span over network segments (l2 segment can over multi data centers) - can coexists with Conventional network technology Set GRE key Deliver packets based on GRE key En/de-cupsel packet Into/from GRE packet Ryu nw-gw nw-gw OVS
  • 33. Table 0 Table 1 Table 2 Src table Tunnel out Local out VM port match action in_port src mac set_tunnel goto table 1 in_port drop match action tunnel_id dst mac output(tunnel) goto table 2 match action tunnel_id dst mac output(vm) tunnel_id goto table 2 tunnel_id drop Tunnel port in_port tunnel_id goto table 2 in_port drop OVS VM1 VM2 GRE tunnel tunnel port VM port In port Flow Table Usage Nicira extension is used for GRE tunnel
  • 34. GRE tunneling with OpenStack ● Composed of several RyuApps ● Network tenant creation – Assign GRE key – Create gateway ● Guest VM instance creation – Create port ● Tenant ↔ key ↔ port relationship – Set flow to the VM port ● Tunnel port management – Create/delete tunnel port ● Track physical compute node – Set flow to the tunnel port rest_quantum gre_tunnel tunnel_port_updater quantum_adapter REST OVS ovsdbOpenFlow Neutron Ryu quantum: former name of neutron project
  • 36. Development process ● Open development ● Linux style ● Discuss on Mailing List openly ● Send/review patches on Mailing List – git format-patch – git send-patch – No pull request on github ● Evolution – Ryu has evoleved from very small program http://dir.gmane.org/gmane.network.ryu.devel
  • 38. Python ● Good things – Easy/fast to learn/use – Many useful features ● Dynamic language, first class everything, decorator, introspection... – Especially introspection is very useful – Decorator is handy – Many useful libraries ● Bad things – Hard to debug ● debugger(pdb) is unstable ● Debugger isn't compatible with eventlet – Magic attributes(__xxx___) – Many similar libraries: which to use?
  • 39. AIO libraries ● Gevent → Eventlet ● In general, monky-patching is ugly hack and very fragile ● Monkey patching of gevent/eventlet works stably ● Hit some issues and patches are proposed. ● epoll is removed by monkey patching
  • 40. Threading ● eventlet(or gevent) is cooperative threading – Needs special care for protection ● Starvation ● Thread scheduling – Different from native threading like pthread ● Synchronization primitives ● Hard to debug – When debugger(pdb) tries to stop, the thread is switched to other thread ● Need to consider – Native vs green – Giant Interpreter Lock – What context to deliver events?
  • 41. Performance ● Gevent performs slightly better than eventlet – But it's very slight. – Needs other approach for more performance boost ● Pypy – Needs patch for eventlet ● Mulit process?
  • 42. Network programming ● For IGMP with VRRP ● Needs to read Cpython code or C-module code – Much better than unsupported, though