OpenVSwitch PDF
OpenVSwitch PDF
OpenVSwitch PDF
Components
ovsdb-server
Database that holds switch-level configuration
Bridge, interface, tunnel definitions
OVSDB and OpenFlow controller addresses
Core Tables
Open_vSwitch is the root
table and there is always
only a single row. The tables
here are the ones most
commonly used; a full entityrelationship diagram is
available in the ovsvswitchd.conf.db man page.
ovs-vswitchd
Core component in the system:
Implements tunnels
Tools: ovs-dpctl
Userspace Processing
Packet received from kernel
Given to the classifier to look for matching flows
accumulates actions
If normal action included, accumulates actions from
normal processing, such as L2 forwarding and bonding
Actions accumulated from configured modules, such as
mirroring
Prior to 1.11, an exact match flow is generated with the
accumulated actions and pushed down to the kernel
module (along with the packet)
Kernel Processing
Packet arrives and header fields extracted
Header fields are hashed and used as an
index into a set of large hash tables
If entry found, actions applied to packet
and counters are updated
If entry is not found, packet sent to
userspace and miss counter incremented
Kernel Datapath
ovs-dpctl speaks to kernel module
See datapaths and their attached
interfaces:
ovs-dpctl show
See flows cached in datapath:
ovs-dpctl dump-flows
Flow Debugging
Flow tables can become incredibly complex, but OVS has tools to
make it easier to debug
Here is a set of rules to (poorly) implement a firewall (with an
unnecessary resubmit) to block all TCP traffic except port 80:
# Move TCP traffic arriving on port 1 to next stage of pipeline!
priority=100,tcp,in_port=1 actions=resubmit:4000!
!
# Allow port TCP port 80 traffic (and implicitly drop all others)!
priority=100,tcp,in_port=4000,tp_dst=80 actions=NORMAL!
!
# Allow all non-TCP traffic arriving on port 1!
priority=90,in_port=1 actions=NORMAL!
!
# Allow all traffic arriving on port 2!
priority=100,in_port=2 actions=NORMAL !
Links
http://openvswitch.org/
Examples and diagrams from - http://
openvswitch.org/slides/
OpenStack-131107.pdf