Use ovs(openvswitch) as docker network switch and test its performance.
Install OVS
sudo apt-get install openvswitch-switch
Install ovs-docker utility
cd /usr/bin
wget https://raw.githubusercontent.com/openvswitch/ovs/master/utilities/ovs-docker
chmod a+rwx ovs-docker
Create an OVS bridge
Firstly, add an ovs bridge and then assign an IP address to it as network gateway. So that other containers can connect to this bridge network.
sudo ovs-vsctl add-br ovs-br1
sudo ifconfig ovs-br1 173.16.1.1 netmask 255.255.255.0 up
Add iperf3 server on the bridge
docker run -it --rm --name=iperf3-server -p 5201:5201 networkstatic/iperf3 -s
sudo ovs-docker add-port ovs-br1 eth1 iperf3-server --ipaddress=173.16.1.3/24
Add iperf3 client on the bridge
docker run -it --rm --name=iperf3-client networkstatic/iperf3 -c 173.16.1.3
sudo ovs-docker add-port ovs-br1 eth1 iperf3-client --ipaddress=173.16.1.6/24
Check the log
You will get the result from both client and server side. If the two containers are not hosted on a same host, then the host's network interface should also be connected to the bridge.