Software OpenFlow Solutions using Open vSwitch Ryan Izard rizard@g.clemson.edu
Open vSwitch (OVS) Software OpenFlow switch Documentation and code Production quality Open source Documentation and code http://openvswitch.org https://github.com/openvswitch/ovs Kernel and userspace modes Supports Monitoring: Netflow, sFlow, SPAN, RSPAN Control: OpenFlow, OVSDB
OpenFlow Support Supports OpenFlow 1.0 through 1.5 Suggest OVS >= 2.4.0 Meter protocol support Limited 1.5 support Consult the change logs when in doubt ofsoftswitch supports meters Can daisy-chain with OVS
How to use OVS? General Instructions For GENI Download OVS Install OVS Start OVS daemons Configure OVS bridges Connect controller to OVS bridges Install flows and control your network Start with an OVS image Ubuntu 12 or 14 Configure OVS bridges Connect controller to OVS bridges Install flows and control your network
Select OVS Image in GENI using the Jacks GUI Node Type: “emulab-xen” Disk Image: “Ubuntu 14 with OVS, by Niky”
Before We Get Started For this guide <…> indicates variable substitution […] indicates an optional parameter …|… indicates a exclusive-or between two parameters You must be root for any ovs-* command
OpenFlow Version Support OVS w/OpenFlow version > 1.0 Must use “-O OpenFlow<ver>” flag for any ovs-ofctl cmd Include flag at end of command Note capital O, not zero Examples OpenFlow 1.0, <ver> = 10, e.g. “-O OpenFlow10” OpenFlow 1.1, <ver> = 11, e.g. “-O OpenFlow11” OpenFlow 1.2, <ver> = 12, e.g. “-O OpenFlow12” OpenFlow 1.3, <ver> = 13, e.g. “-O OpenFlow13” OpenFlow 1.4, <ver> = 14, e.g. “-O OpenFlow14” OpenFlow 1.5, <ver> = 15, e.g. “-O OpenFlow15”
Creating and Viewing a Bridge Add/remove a bridge $ ovs-vsctl add-br <bridge-name> $ ovs-vsctl del-br <bridge-name> Add/remove a port to/from a bridge $ ovs-vsctl add-port <bridge> <port-name> $ ovs-vsctl del-port <bridge> <port-name> Show general configuration $ ovs-vsctl show Show detailed switch configuration $ ovs-ofctl show <bridge-name>
Datapath and Controller Set datapath ID (DPID) $ ovs-vsctl set bridge <bridge-name> \ other-config:datapath-id=0011223344556677 Set OpenFlow version protocols=OpenFlow<ver>,OpenFlow<ver>,… Set controller $ ovs-vsctl set-controller <bridge-name> \ tcp:<controller-ip>:<controller-port> Also supports SSL (tutorial)
Fail Modes Perform learning switch if controller disconnects $ ovs-vsctl set-fail-mode <bridge-name> standalone Only use installed flows if controller disconnects $ ovs-vsctl set-fail-mode <bridge-name> secure
Debugging View OpenFlow channel b/t controller and switch $ ovs-vsctl snoop <bridge-name> $ ovs-vsctl monitor <bridge-name>
Table Operations Typically done by controller, but useful when debugging or for testing For full documentation, see ovs-ofctl man page Show flow table entries $ ovs-ofctl dump-flows <bridge-name> Add an entry to flow table $ ovs-ofctl add-flow [<priority>] [<table-id>] [<cookie>] \ <matches> [<actions> | <instructions>] Remove an entry from a flow table $ ovs-ofctl del-flow [--strict] <priority> <table-id> \ [<cookie>] <matches> ]
Table Operations Modify a flow table entry $ ovs-ofctl mod-flow [--strict] <priority> <table-id> \ [<cookie>] <matches> [<actions> | <instructions>] Can also set cookie and other flow fields Can also add, remove, modify, show groups and buckets ovs-ofctl add-group, del-group, mod-group, dump-groups, insert-buckets, remove-buckets Consult ovs-ofctl docs for details
Spanning Tree Enable/disable Configure priority (for root election) $ ovs-vsctl set bridge <bridge-name> stp_enable=true $ ovs-vsctl set bridge <bridge-name> stp_enable=false Configure priority (for root election) $ ovs-vsctl set bridge <bridge-name> \ other_config:stp-priority=0x<some-hex-value> Configure per-port path cost $ ovs-vsctl set port <port-name> \ other_config:stp-path-cost=<some-decimal-value>
Allow Host to TX/RX Packets LOCAL port of OVS is network interface e.g. LOCAL <--> br0 can route into iface
Example Workflow To turn an example machine into a switch: switch$ ovs-vsctl add-br br0 switch$ ovs-vsctl add-port br0 eth1 switch$ ovs-vsctl add-port br0 eth2 switch$ ovs-vsctl set-controller tcp:192.168.1.1:6653 switch$ ifconfig br0 10.0.0.100/24 up # “host” on LOCAL port switch$ ping 10.0.0.2 # assume host-2 out eth2 switch$ ping 10.0.0.1 # assume host-1 out eth1 10.0.0.1 and 10.0.0.2 on host-1 and host-2, respectively, will also be able to communicate through the OVS bridge br0 on the switch node
Give it a Try Yourself Tutorial