Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
meetup #2 
OpenvSwitch 初探pichuang@sdnds-tw
About me 
❖ pichuang a.k.a. ⼩小⾶飛機! 
❖ 救⽕火員型研究⽣生! 
❖ NCTU CSCC TA! 
❖ NCTU Wireless Internet Lab! 
❖ http://roan.logdown.co...
OpenvSwitch Introduction 
❖ Production Quality! 
❖ Multi Layer virtual switch! 
❖ L2 - L4! 
❖ Support OpenFlow protocol! 
...
OpenvSwitch Features 
❖ VLAN tagging and trunking (802.1q)! 
❖ Standard Spanning Tree Protocol (802.1d)! 
❖ Link Aggregati...
❖ Flow monitor! 
❖ sFlow! 
❖ NetFlow! 
❖ IP Flow Information Export (IPFIX)! 
❖ QoS Control! 
❖ Tunneling Protocol! 
❖ VXL...
OpenvSwitch Overview 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ov...
kmod_openvswitch 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs ke...
❖ a.k.a “datapath"! 
❖ Fast Path lookup! 
❖ Strict match! 
❖ Similar to linux bridge ! 
❖ Hook network device handle! 
❖ E...
ovs-dpctl 
❖ Manage datapath command! 
❖ ovs-dpctl show! 
❖ ovs-dpctl dump-flows! 
❖ ovs-dpctl add-flow! 
❖ ovs-dpctl -h! ...
ovs-vswitchd 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel...
❖ OpenvSwitch core component! 
❖ Talk to datapath via netlink! 
❖ Communicate with ovsdb-server via unix socket! 
❖ Implem...
ovs-ofctl 
❖ Manage ovs-vswitchd command! 
❖ ovs-ofctl dump-flows <bridge name>! 
❖ ovs-ofctl show <bridge name>! 
❖ ovs-o...
ovs-appctl 
❖ Manage logging level! 
❖ ovs-appctl vlog/list! 
❖ ovs-appctl vlog/set {module name}:{console, syslog, 
file}...
ovsdb-server 
OpenFlow Controller 
Remote 
User space 
OpenFlow protocol 
ovs-vswitchd ovsdb-server 
datapath! 
ovs kernel...
❖ ovs-vswitchd configuration is stored on disk! 
❖ The OVSDB management protocol (RFC 7047)! 
❖ vswitch.ovsschema! 
❖ JSON...
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 quer...
ovs-ctl 
❖ OpenvSwitch Startup Script! 
❖ /usr/share/openvswitch/scripts/ovs-ctl! 
❖ ovs-ctl start! 
❖ ovs-ctl stop! 
❖ ov...
Match Flow
Flow match 
OpenFlow Controller 
OpenFlow PACKET_IN 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd ...
Flow install 
OpenFlow Controller 
datapath flow table 
ovs-vswitchd 
wildcard flow table 
ovs-vswitchd 
exactly flow tabl...
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! 
❖...
ovs-ofctl 
OpenFlow Controller 
ovs-vswitchd 
wildcard flow table 
datapath flow table 
ovs-vswitchd 
exactly flow table 
...
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 spac...
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 
...
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 spac...
ovs-dpctl dump-flows 
❖ packets! 
❖ used! 
❖ actions
ovs-appctl bridge/dump-flows <br> 
❖ Include hidden flow! 
❖ Send packet to OpenFlow Controller
Thank you
Sdnds tw-meetup-2
Upcoming SlideShare
Loading in …5
×

Sdnds tw-meetup-2

25,530 views

Published on

介紹 OpenvSwitch Componets 和 debugging OpenvSwitch

Published in: Internet
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • 太專業啦!!!!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Sdnds tw-meetup-2

  1. 1. meetup #2 OpenvSwitch 初探pichuang@sdnds-tw
  2. 2. About me ❖ pichuang a.k.a. ⼩小⾶飛機! ❖ 救⽕火員型研究⽣生! ❖ NCTU CSCC TA! ❖ NCTU Wireless Internet Lab! ❖ http://roan.logdown.com! ❖ http://fbl.me/pichuang
  3. 3. OpenvSwitch Introduction ❖ Production Quality! ❖ Multi Layer virtual switch! ❖ L2 - L4! ❖ Support OpenFlow protocol! ❖ Written in platform-independent C
  4. 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. 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. 6. OpenvSwitch Overview OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  7. 7. kmod_openvswitch OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  8. 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. 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. 10. ovs-vswitchd OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  11. 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. 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. 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. 14. ovsdb-server OpenFlow Controller Remote User space OpenFlow protocol ovs-vswitchd ovsdb-server datapath! ovs kernel module Kernel space unix socket netlink
  15. 15. ❖ ovs-vswitchd configuration is stored on disk! ❖ The OVSDB management protocol (RFC 7047)! ❖ vswitch.ovsschema! ❖ JSON Format
  16. 16. ovs-vsctl ❖ Manages ovs-vswitchd configuration ! ❖ ovs-vsctl show! ❖ …! ❖ ovs-vsctl -h
  17. 17. ovsdb-tool ❖ Open vSwitch database management utility! ❖ ovsdb-tool create conf.db vswitch.ovsschema! ❖ ovsdb-tool query! ❖ ovsdb-tool -h
  18. 18. ovs-ctl ❖ OpenvSwitch Startup Script! ❖ /usr/share/openvswitch/scripts/ovs-ctl! ❖ ovs-ctl start! ❖ ovs-ctl stop! ❖ ovs-ctl -h
  19. 19. Match Flow
  20. 20. 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
  21. 21. 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
  22. 22. Debugging OpenvSwitch
  23. 23. OpenvSwitch Setting
  24. 24. Daemon ❖ Start! ❖ ovs-ctl start! ❖ custom init script ! ❖ Check! ❖ ovs-ctl status! ❖ ps aux |grep ovs
  25. 25. Logging ❖ ovsdb-tool show-log [-mmm]! ❖ cat /var/log/openvswitch/{ovsdb-server,ovs-vswitchd}. log
  26. 26. ovs-vsctl show ❖ Controller! ❖ Connection methods: tcp, ssl! ❖ OpenFlow protocol: 6633, 6653! ❖ is_connected: true! ❖ fail_mode! ❖ secure, standalone
  27. 27. ovs-ofctl OpenFlow Controller ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly flow table Kernel space
  28. 28. ovs-ofctl show <bridge name> ❖ Features Reply! ❖ dpid! ❖ ofport <-> interface
  29. 29. ovs-dpctl ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly OpenFlow Controller Kernel space
  30. 30. ovs-dpctl show ❖ hit! ❖ hit existing entry! ❖ missed! ❖ send to userspace! ❖ drop! ❖ flows
  31. 31. Flow
  32. 32. ovs-ofctl OpenFlow Controller ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly flow table Kernel space
  33. 33. ovs-ofctl dump-flows <bridge name> ❖ xid! ❖ check fields! ❖ duration, idle_age, priority, in_port! ❖ actions
  34. 34. ovs-dpctl ovs-vswitchd wildcard flow table datapath flow table ovs-vswitchd exactly OpenFlow Controller Kernel space
  35. 35. ovs-dpctl dump-flows ❖ packets! ❖ used! ❖ actions
  36. 36. ovs-appctl bridge/dump-flows <br> ❖ Include hidden flow! ❖ Send packet to OpenFlow Controller
  37. 37. Thank you

×