Skip to content
LinkState
Go back

OVS kernel datapath versus Linux bridge under fan-out load

Introduction to Benchmarking OVS and Linux Bridge

The Open vSwitch (OVS) kernel datapath is a software switch implemented in the Linux kernel via the openvswitch module. It forwards packets using flow tables programmed with OpenFlow or OVSDB. The Linux bridge (bridge module) is a simpler Layer‑2 switch that maintains a forwarding database (FDB) learned from source MAC addresses and forwards based on destination MAC lookups. Both can be backed by the same NIC and share identical offload capabilities (RSS, GRO, GSO, XDP) when configured accordingly.

Benchmarking OVS versus the Linux bridge under identical hardware, offload settings, and traffic patterns isolates the software datapath overhead. Understanding where the CPU ceiling diverges helps operators decide when OVS’s richer feature set justifies its cost, or when a plain bridge suffices.


Setup and Configuration

Environment

OVS Kernel Datapath Configuration

# Create bridge with netdev datapath
ovs-vsctl add-br ovsbr0
ovs-vsctl set bridge ovsbr0 datapath_type=netdev
ovs-vsctl set bridge ovsbr0 other-config:disable-in-band=true
ovs-vsctl set bridge ovsbr0 fail_mode=secure

# Attach NIC (enp3s0f0)
ip link set dev enp3s0f0 up
ovs-vsctl add-port ovsbr0 enp3s0f0 -- set Interface enp3s0f0 ofport_request=1

# Create 8 veth pairs for VMs/containers
for i in {1..8}; do
  ip link add veth${i}a type veth peer name veth${i}b
  ip link set veth${i}a up
  ip link set veth${i}b up
  ovs-vsctl add-port ovsbr0 veth${i}a -- set Interface veth${i}a ofport_request=$((i+1))
done

# Disable software offloads that would obscure datapath cost
ethtool -K enp3s0f0 gso off gro off tso off ufo off lro off rx off tx off
ethtool -K enp3s0f0 rx-vlan-offload off tx-vlan-offload off

# Flush existing flows and install a simple flood flow
ovs-ofctl del-flows ovsbr0
ovs-ofctl add-flow ovsbr0 "actions=output:IN_PORT"

Linux Bridge Configuration

# Create bridge
ip link add name linuxbr0 type bridge
ip link set dev linuxbr0 up

# Attach same NIC
ip link set dev enp3s0f0 master linuxbr0
ip link set dev enp3s0f0 up

# Add the same veth pairs (veth*a) to the bridge
for i in {1..8}; do
  ip link set veth${i}a master linuxbr0
done

# Disable identical offloads
ethtool -K enp3s0f0 gso off gro off tso off ufo off lro off rx off tx off
ethtool -K enp3s0f0 rx-vlan-offload off tx-vlan-offload off

Ensuring Consistent Offloads and East‑West Fan‑Out

ip link add vgen0 type veth peer name vgen1
ip link set vgen0 up
ip link set vgen1 up
# OVS test
ovs-vsctl add-port ovsbr0 vgen0
# Bridge test
# ip link set vgen1 master linuxbr0

Benchmarking Methodology

Tools and Techniques

Workload Generation and Traffic Patterns

Performance Metrics


Performance Comparison

CPU Utilization and Ceiling

Packet Throughput and Latency

ConfigurationOffered Load (pps)Measured Rx (pps)Avg Latency (µs)99th % Latency (µs)CPU % (datapath)
OVS kernel800 k795 k224522
OVS kernel1.2 M1.18 M285838
Linux bridge800 k798 k183815
Linux bridge1.2 M1.19 M224927

Latency differences stem from the additional flow hash and action execution in OVS; the bridge’s FDB lookup is typically a single memory access.

Comparison Summary


Troubleshooting Common Issues

Identifying Bottlenecks in OVS Kernel Datapath

  1. Check flow miss rate: ovs-appctl dpif/show displays lookup hit/miss. A high miss ratio (>5 %) indicates insufficient flow cache size; increase with ovs-vsctl set Open_vSwitch . other_config:max-idle=30000 or install a proactive flow via ovs-ofctl.
  2. Inspect softirq load: cat /proc/softirqs shows NET_RX and NET_TX increments. If NET_RX grows linearly with packet rate while ksoftirqd CPU stays low, the NIC is the limit; if ksoftirqd spikes, the datapath is CPU‑bound.
  3. Verify offloads: Ensure ethtool -k shows all offloads disabled; residual GRO can cause large aggregates that hide per‑packet cost, leading to misleading CPU numbers.
  4. Check for dropped packets due to insufficient queue length: ethtool -S rx_drop increments suggest the driver’s ring is too small; increase with ethtool -G enp3s0f0 rx 4096.

Resolving Configuration‑Related Issues in Linux Bridge


All commands assume the NIC interface is enp3s0f0; adjust as necessary for your hardware.


Share this post on:

Previous Post
When Local Success Hides a Shared-Runner Failure
Next Post
Can AI isolate a stuck OSPF session safely