I'm trying to test the throughput between two docker containers using Iperf3 (any throughput tester app) connected to OVS (openvswitch) and DPDK on ubuntu 18.04 (VMWare workstation). The goal of this is to compare the performance of OVS-DPDK vs Linux kernel in some scenarios.
I can't find a proper solution, which explains how to connect OVS+DPDK to the docker containers so that the containers can pass TCP/UDP traffic to each other.
I'd appreciate your help explaining how to connect two docker containers with OVS+DPDK. The configuration that needs to be done in the docker containers, and the ones that need to be done in the host OS.
BTW I don't have traffic from outside.
Thanks
Edit
Here are the steps I take:
I install dpdk using apt: sudo apt install openvswitch-switch-dpdk
set the alternative as: sudo update-alternatives --set OvS-vswitchd /usr/lib/openvswitch-switch -dpdk/OvS-vswitchd-dpdk
Allocate the hugepages and update the grub.
mount hugepages
bind NIC to DPDK: sudo dpdk-devbind --bind=vfio-pci ens33
. Although I don't need this step because I don't have traffic from outside if I don't bind my NIC the sudo service openvswitch-switch restart
fails.
I create a bridge: ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
I create two ports for my containers: ovs-vsctl add-port br0 client -- set Interface client type=dpdk options:dpdk-devargs=<binded_nic_pci_addr>
and ovs-vsctl add-port br0 server -- set Interface server type=dpdk options:dpdk-devargs=<binded_nic_pci_addr>
. (server port number: 1, client port number: 2)
Open bidirectional flow between ports:
sudo ovs-ofctl del-flows br0
sudo ovs-ofctl add-flow br0 in_port=1,action=output:2
ovs-ofctl add-flow br0 in_port=2,action=output:1
After step 8 I don't know how to connect my iperf3 docker containers to use these ports. I appreciate your help in letting me know how to connect containers to the ports and test the network.
Edit 2
Based on Vipin's answer these steps won't work considering my requirements.
[EDIT: update to reflect only using OVS-DPDK and iperf3 on container]
There are multiple ways one can connect 2 dockers to talk directly with each other using to run iperf3.
For scenario 2 one needs to add TAP interface to OVS. because end application iperf3 is using Kernel Stack for TCP|UDP termination. One can use the below settings (modified based on OVS-DPDK version) to achieve the result.
sudo ./utilities/ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
sudo ./utilities/ovs-vsctl add-port br0 myeth0 -- set Interface myeth0 type=dpdk options:dpdk-devargs=net_tap0,iface=tap0
sudo ./utilities/ovs-vsctl add-port br0 myeth1 -- set Interface myeth1 type=dpdk options:dpdk-devargs=net_tap1,iface=tap1
sudo ./utilities/ovs-ofctl add-flow br0 in_port=1,action=output:2
sudo ./utilities/ovs-ofctl add-flow br0 in_port=2,action=output:1
Note:
[EDIT-1] based on the conversation https://chat.stackoverflow.com/rooms/231963/ovs-dpdk, @MohammadSiavashi
testpmd, l2fwd, skeleton
instead of running OVS-DPDK.Current agreement:
TAP PMD based OVS-DPDK
and alternate to userspace iperf3
.