Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
meetup #2 
OpenvSwitch 初探pichuang@sdnds-tw
About me 
❖ pichuang a.k.a. ⼩小⾶飛機! 
❖ 救⽕火員型研究⽣生! 
❖ NCTU CSCC TA! 
❖ NCTU Wireless Internet Lab! 
❖ http://roan.logdown.com! 
❖ http://fbl.me/pichuang
OpenvSwitch Introduction 
❖ Production Quality! 
❖ Multi Layer virtual switch! 
❖ L2 - L4! 
❖ Support OpenFlow protocol! 
❖ Written in platform-independent C
OpenvSwitch Features 
❖ VLAN tagging and trunking (802.1q)! 
❖ Standard Spanning Tree Protocol (802.1d)! 
❖ Link Aggregation Control Protocol (802.3ad)! 
❖ Port mirror! 
❖ RSPAN! 
❖ SPAN
❖ Flow monitor! 
❖ sFlow! 
❖ NetFlow! 
❖ IP Flow Information Export (IPFIX)! 
❖ QoS Control! 
❖ Tunneling Protocol! 
❖ VXLAN! 
❖ GRE! 
❖ IPSEC! 
❖ Support Intel® DPDK! 
❖ Support Linux Kenrel 3.11 ~ 3.14
OpenvSwitch Overview 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel module 
Kernel space 
unix socket 
netlink
kmod_openvswitch 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel module 
Kernel space 
unix socket 
netlink
❖ a.k.a “datapath"! 
❖ Fast Path lookup! 
❖ Strict match! 
❖ Similar to linux bridge ! 
❖ Hook network device handle! 
❖ Extract Flow key! 
❖ jhash3! 
❖ Implement tunneling 
protocol! 
❖ Megaflow (Wildcard table)
ovs-dpctl 
❖ Manage datapath command! 
❖ ovs-dpctl show! 
❖ ovs-dpctl dump-flows! 
❖ ovs-dpctl add-flow! 
❖ ovs-dpctl -h! 
! 
❖ ovs-dpctl-top (python)
ovs-vswitchd 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel module 
Kernel space 
unix socket 
netlink
❖ OpenvSwitch core component! 
❖ Talk to datapath via netlink! 
❖ Communicate with ovsdb-server via unix socket! 
❖ Implement various protocols! 
❖ like OpenFlow protocol! 
❖ Include exactly table(Fast lookup) and wildcard table 
(Slow lookup)
ovs-ofctl 
❖ Manage ovs-vswitchd command! 
❖ ovs-ofctl dump-flows <bridge name>! 
❖ ovs-ofctl show <bridge name>! 
❖ ovs-ofctl dump-tables <bridge name>! 
❖ ovs-ofctl -h
ovs-appctl 
❖ Manage logging level! 
❖ ovs-appctl vlog/list! 
❖ ovs-appctl vlog/set {module name}:{console, syslog, 
file}:{off, emer, err, warn, info, dbg}! 
❖ Generate packet for trace! 
❖ ovs-appctl ofproto/trace <bridge name>! 
❖ http://goo.gl/tWbZXH
ovsdb-server 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel module 
Kernel space 
unix socket 
netlink
❖ ovs-vswitchd configuration is stored on disk! 
❖ The OVSDB management protocol (RFC 7047)! 
❖ vswitch.ovsschema! 
❖ JSON Format
ovs-vsctl 
❖ Manages ovs-vswitchd configuration ! 
❖ ovs-vsctl show! 
❖ …! 
❖ ovs-vsctl -h
ovsdb-tool 
❖ Open vSwitch database management utility! 
❖ ovsdb-tool create conf.db vswitch.ovsschema! 
❖ ovsdb-tool query! 
❖ ovsdb-tool -h
Sdnds tw-meetup-2
ovs-ctl 
❖ OpenvSwitch Startup Script! 
❖ /usr/share/openvswitch/scripts/ovs-ctl! 
❖ ovs-ctl start! 
❖ ovs-ctl stop! 
❖ ovs-ctl -h
Match Flow
Flow match 
OpenFlow Controller 
OpenFlow PACKET_IN 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly flow table 
unknown packet 
upcall (netlink) 
Kernel space
Flow install 
OpenFlow Controller 
datapath flow table 
ovs-vswitchd 
wildcard flow table 
ovs-vswitchd 
exactly flow table 
install flow entry 
Kernel space 
OpenFlow PACKET_OUT 
execute actions 
packet out
Debugging OpenvSwitch
OpenvSwitch Setting
Daemon 
❖ Start! 
❖ ovs-ctl start! 
❖ custom init script ! 
❖ Check! 
❖ ovs-ctl status! 
❖ ps aux |grep ovs
Logging 
❖ ovsdb-tool show-log [-mmm]! 
❖ cat /var/log/openvswitch/{ovsdb-server,ovs-vswitchd}. 
log
ovs-vsctl show 
❖ Controller! 
❖ Connection methods: tcp, ssl! 
❖ OpenFlow protocol: 6633, 6653! 
❖ is_connected: true! 
❖ fail_mode! 
❖ secure, standalone
ovs-ofctl 
OpenFlow Controller 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly flow table 
Kernel space
ovs-ofctl show <bridge name> 
❖ Features Reply! 
❖ dpid! 
❖ ofport <-> interface
ovs-dpctl 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly 
OpenFlow Controller 
Kernel space
ovs-dpctl show 
❖ hit! 
❖ hit existing entry! 
❖ missed! 
❖ send to userspace! 
❖ drop! 
❖ flows
Flow
ovs-ofctl 
OpenFlow Controller 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly flow table 
Kernel space
ovs-ofctl dump-flows <bridge name> 
❖ xid! 
❖ check fields! 
❖ duration, idle_age, priority, in_port! 
❖ actions
ovs-dpctl 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly 
OpenFlow Controller 
Kernel space
ovs-dpctl dump-flows 
❖ packets! 
❖ used! 
❖ actions
ovs-appctl bridge/dump-flows <br> 
❖ Include hidden flow! 
❖ Send packet to OpenFlow Controller
Thank you

More Related Content

Sdnds tw-meetup-2

  • 1. meetup #2 OpenvSwitch 初探pichuang@sdnds-tw
  • 2. About me ❖ pichuang a.k.a. ⼩小⾶飛機! ❖ 救⽕火員型研究⽣生! ❖ NCTU CSCC TA! ❖ NCTU Wireless Internet Lab! ❖ http://roan.logdown.com! ❖ http://fbl.me/pichuang
  • 3. OpenvSwitch Introduction ❖ Production Quality! ❖ Multi Layer virtual switch! ❖ L2 - L4! ❖ Support OpenFlow protocol! ❖ Written in platform-independent C
  • 4. OpenvSwitch Features ❖ VLAN tagging and trunking (802.1q)! ❖ Standard Spanning Tree Protocol (802.1d)! ❖ Link Aggregation Control Protocol (802.3ad)! ❖ Port mirror! ❖ RSPAN! ❖ SPAN
  • 5. ❖ Flow monitor! ❖ sFlow! ❖ NetFlow! ❖ IP Flow Information Export (IPFIX)! ❖ QoS Control! ❖ Tunneling Protocol! ❖ VXLAN! ❖ GRE! ❖ IPSEC! ❖ Support Intel® DPDK! ❖ Support Linux Kenrel 3.11 ~ 3.14
  • 6. OpenvSwitch Overview OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  • 7. kmod_openvswitch OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  • 8. ❖ a.k.a “datapath"! ❖ Fast Path lookup! ❖ Strict match! ❖ Similar to linux bridge ! ❖ Hook network device handle! ❖ Extract Flow key! ❖ jhash3! ❖ Implement tunneling protocol! ❖ Megaflow (Wildcard table)
  • 9. ovs-dpctl ❖ Manage datapath command! ❖ ovs-dpctl show! ❖ ovs-dpctl dump-flows! ❖ ovs-dpctl add-flow! ❖ ovs-dpctl -h! ! ❖ ovs-dpctl-top (python)
  • 10. ovs-vswitchd OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  • 11. ❖ OpenvSwitch core component! ❖ Talk to datapath via netlink! ❖ Communicate with ovsdb-server via unix socket! ❖ Implement various protocols! ❖ like OpenFlow protocol! ❖ Include exactly table(Fast lookup) and wildcard table (Slow lookup)
  • 12. ovs-ofctl ❖ Manage ovs-vswitchd command! ❖ ovs-ofctl dump-flows <bridge name>! ❖ ovs-ofctl show <bridge name>! ❖ ovs-ofctl dump-tables <bridge name>! ❖ ovs-ofctl -h
  • 13. ovs-appctl ❖ Manage logging level! ❖ ovs-appctl vlog/list! ❖ ovs-appctl vlog/set {module name}:{console, syslog, file}:{off, emer, err, warn, info, dbg}! ❖ Generate packet for trace! ❖ ovs-appctl ofproto/trace <bridge name>! ❖ http://goo.gl/tWbZXH
  • 14. ovsdb-server OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  • 15. ❖ ovs-vswitchd configuration is stored on disk! ❖ The OVSDB management protocol (RFC 7047)! ❖ vswitch.ovsschema! ❖ JSON Format
  • 16. ovs-vsctl ❖ Manages ovs-vswitchd configuration ! ❖ ovs-vsctl show! ❖ …! ❖ ovs-vsctl -h
  • 17. ovsdb-tool ❖ Open vSwitch database management utility! ❖ ovsdb-tool create conf.db vswitch.ovsschema! ❖ ovsdb-tool query! ❖ ovsdb-tool -h
  • 19. ovs-ctl ❖ OpenvSwitch Startup Script! ❖ /usr/share/openvswitch/scripts/ovs-ctl! ❖ ovs-ctl start! ❖ ovs-ctl stop! ❖ ovs-ctl -h
  • 21. Flow match OpenFlow Controller OpenFlow PACKET_IN ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly flow table unknown packet upcall (netlink) Kernel space
  • 22. Flow install OpenFlow Controller datapath flow table ovs-vswitchd wildcard flow table ovs-vswitchd exactly flow table install flow entry Kernel space OpenFlow PACKET_OUT execute actions packet out
  • 25. Daemon ❖ Start! ❖ ovs-ctl start! ❖ custom init script ! ❖ Check! ❖ ovs-ctl status! ❖ ps aux |grep ovs
  • 26. Logging ❖ ovsdb-tool show-log [-mmm]! ❖ cat /var/log/openvswitch/{ovsdb-server,ovs-vswitchd}. log
  • 27. ovs-vsctl show ❖ Controller! ❖ Connection methods: tcp, ssl! ❖ OpenFlow protocol: 6633, 6653! ❖ is_connected: true! ❖ fail_mode! ❖ secure, standalone
  • 28. ovs-ofctl OpenFlow Controller ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly flow table Kernel space
  • 29. ovs-ofctl show <bridge name> ❖ Features Reply! ❖ dpid! ❖ ofport <-> interface
  • 30. ovs-dpctl ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly OpenFlow Controller Kernel space
  • 31. ovs-dpctl show ❖ hit! ❖ hit existing entry! ❖ missed! ❖ send to userspace! ❖ drop! ❖ flows
  • 32. Flow
  • 33. ovs-ofctl OpenFlow Controller ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly flow table Kernel space
  • 34. ovs-ofctl dump-flows <bridge name> ❖ xid! ❖ check fields! ❖ duration, idle_age, priority, in_port! ❖ actions
  • 35. ovs-dpctl ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly OpenFlow Controller Kernel space
  • 36. ovs-dpctl dump-flows ❖ packets! ❖ used! ❖ actions
  • 37. ovs-appctl bridge/dump-flows <br> ❖ Include hidden flow! ❖ Send packet to OpenFlow Controller