In a previous tutorial we have built DPDK 18.11.2 and Open vSwitch 2.11.1 on Linux Debian 10.1 VM (buster). We have created a L3 Open vSwitch QEMU appliance that we will use to compare performance of Open vSwitch with enabled/disabled DPDK. A network topology is depicted on the Picture 1.
The lab is created as GNS3 project which consists of a single Debian Open vSwitch appliance. Two Linux Core 6.3 hosts PC1 and PC2 are connected to the switchports Ethernet0 and Ethernet1, respectively. Firstly, we are going to bind the both ports to DPDK-compatible driver and create a bridge with the DPDK ports attached to the bridge. As a last step, we will measure maximum achievable bandwidth with iPerf3 tool. The host PC1 will be be acting as a iPerf3 client connecting to the iPerf3 server running on the host PC2.
Note: Open vSwitch 2.11.1 appliance built on Debian 10 buster and DPDK 18.11.2 is available in Download-> Appliance Section. The Linux Core 6.3 image is available there, as well.
Picture 1 - Debian Open vSwitch/DPSK Appliance with Connected Host
1. GNS3 Configuration
Check GNS3 settings for Open vSwitch appliance. Right click on node and navigate to General Settings tab. Allocate 5000 MB for RAM. Configure 4x vCPUs. Switch to Network tab and select Intel Gigabit Ethernet (e1000) network adapter from menu. Add another NIC so we can use two adapters. Finally, switch to Advanced settings tab. Advanced QEMU VM settings are depicted on the Picture 2. Do not forget to set CPU flags SSE 3, SSE 4.1 and SSE 4.2 to support these instruction sets for our appliance.
Picture 2 - GNS3 Advanced Settings Configuration
2. Bind Network Adapters to DPDK-compatible Driver
Start Open vSwitch appliance and login with username/password: debian/debian. The Picture 3 shows the log from starting vswitch daemon. All the startup commands are stored in /etc/rc.local.
Picture 3 - Starting vswitcd Daemon
DPDK support can be confirmed by validating the dpdk_initialized boolean value from the ovsdb. A value of true means that the DPDK EAL initialization succeeded (Picture 4).
$ sudo /usr/local/bin/ovs-vsctl get Open_vSwitch . dpdk_initialized
Picture 4 - Checking DPDK Initialization
Check if they are any network cards binded to DPDK (Picture 5).
$ /usr/local/sbin/dpdk-devbind --status
Picture 5 - Checking Network Adapters Binding Status
They are not adapters binded to any DPDK compatible drivers (igb_uio, vfio-pci). Notice, the Interfaces eth0-eth7 binded to kernel driver e1000. To bind devices eth0 and eth1 to the driver igb_kio, issue the commands bellow.
$ sudo /usr/local/sbin/dpdk-devbind --bind=igb_uio 0000:00:03.0
$ sudo /usr/local/sbin/dpdk-devbind --bind=igb_uio 0000:00:04.0
Picture 6 - Ethernet Interfaces eth0 and eth1 Binded to DPDK-compatibile driver igb_uio
Once binded to igb_uio driver, interfaces eth0 and eth1 are not presented in the output of the command ifconfig (Picture 7).
Picture 7 - No Adapters eth0 and eth1 Presented in Output of Ifconfig
Note: To unbind the device from dpdk-compatible driver, select the driver to “none”. For example, to unbind the eth1 from igb_uio type the command:
$ sudo /usr/local/sbin/dpdk-devbind --bind=none 0000:00:04.0
3. Create OvS-DPDK Bridge and Assign DPDK Ports to Bridge
# sudo su
Create the bridge interface br0 and set bridge to datapah netdev.
$ ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
Add two dpdk interfaces to the bridge br0 (Picture 8).
# ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk options:dpdk-devargs=0000:00:03.0
# ovs-vsctl add-port br0 dpdk-p1 -- set Interface dpdk-p1 type=dpdk options:dpdk-devargs=0000:00:04.0
Picture 8 - Open vSwitch Configuration
4. Testing Open vSwitch Performance
4.1 Open vSwitch with DPDK
Configure the NIC IP address on both hosts to be on the same subnet 192.168.1.0/24. Install iPerf3 and then run a simple network test case. On PC2 start iPerf3 in server mode iperf3 -s and run the iperf3 client on the other PC1, iperf3 –c server_ip. The network throughput and performance varies, depending on your system hardware capabilities and configuration. Throughput is 530 Mbps when DPDK is used (Picture 9).
PC2$ iperf3 -s
PC1$ iperf3 -c 192.168.1.2
Picture 9 - Network Throughput when DPDK-compatible Driver is Used
4.2 Open vSwitch with DPDK
Delete the bridge br0.
$ sudo /usr/local/bin/ovs-vsctl del-br br0
Unbind the interfaces eth0 and eth1 from the driver and bind them to the driver e1000.
$ sudo /usr/local/sbin/dpdk-devbind --bind=none 0000:00:04.0
$ sudo /usr/local/sbin/dpdk-devbind --bind=none 0000:00:03.0
$ sudo /usr/local/sbin/dpdk-devbind --bind=e1000 0000:00:04.0
$ sudo /usr/local/sbin/dpdk-devbind --bind=e1000 0000:00:03.0
Create the bridge br0 and assign the interfaces eth0 and eth1 to the bridge.
$ sudo /usr/local/bin/ovs-vsctl add-br br0
$ sudo /usr/local/bin/ovs-vsctl add-port br0 eth0
$ sudo /usr/local/bin/ovs-vsctl add-port br0 eth1
Again, we are going to measure the network throughput with iPerf3 (Picture 10).
Picture 10 - Network Throughput when DPDK is not Used
The measured throughput of Open vSwitch-DPDK is 530Mbps while the throughput of Open vSwitch is only about 417 Mbps while. The performance of Open vSwitch-DPDK is therefore 1.27x greater than OVS without DPDK.
Finishi :)
Dear sir,
Open vSwitch 2.11.1 appliance built on Debian 10 buster and DPDK 18.11.2 is available in Download is not working. Could you pls send me that vmdk zip file of ovs-dpdk
Dear sir,
It downloaded and i m able to implement too. This article is a huge help for me. Thank you so much for your blog. It would be very helpful if you write a blog to implement our own application in dpdk and how to integrate an SDN application with more than one dpdk switches. Thanks in advance. GBU
Hello sir, how could we create two vms with the interfaces which we bind to dpdk, since it moved to userspace I am not able to access those two vms.