2021年4月29日星期四

How to connect two docker containers to openvswitch+DPDK

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

  • DPDK version is 20.11.0
  • OVS version is 2.15.90
  • Iperf3

Here are the steps I take:

  1. I install dpdk using apt: sudo apt install openvswitch-switch-dpdk

  2. set the alternative as: sudo update-alternatives --set OvS-vswitchd /usr/lib/openvswitch-switch -dpdk/OvS-vswitchd-dpdk

  3. Allocate the hugepages and update the grub.

  4. mount hugepages

  5. 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.

  6. I create a bridge: ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev

  7. 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)

  8. Open bidirectional flow between ports:

    1. sudo ovs-ofctl del-flows br0
    2. sudo ovs-ofctl add-flow br0 in_port=1,action=output:2
    3. 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.

https://stackoverflow.com/questions/67257888/how-to-connect-two-docker-containers-to-openvswitchdpdk April 26, 2021 at 04:18AM

没有评论:

发表评论