Flow QoS using OpenVSwitch
Flow level Bandwidth Provisioning to the Docker Containers using OpenVSwitch (OVS)
The goal of this Proof of Concept to show the flow level bandwidth provisioning using the OvS Switch. We achieve it using below steps.
- Docker Networking using OVS
- Creation of OVS Queues
- Adding the Flow Rules
- Test the Bandwidth Provisioning
In this setup we have two Docker Containers. We attach the two docker containers to OVS and test the bandwidth provisioning using them.
Dependencies for the setup
- Ubuntu 16.04
- Docker
Docker Networking using OvS
First of all we need to create the OVS based Docker Networking.
- Install OVS and ovs-docker utility
- Create the OVS bridge
- Configure the OVS-br and create two ubuntu Docker Containers without network
- Connect the containers to OVS bridge
- Add NAT Rules (Change your pubintf from “enp0s1” appropriatly)
- Test the connection between two containers connected via OVS bridge using Ping command
Creation of OVS Queues
- We need the OVS port-ids of cont1 and cont2 that are connected to ovs-br1 (See the above figure).
- Let say we got the below values for ovs-port-ids (from the above step).
- Now, we create OvS Queues at ovs-br1. We create two queues at e0715799fb694_l and 38c9206b60f94_l with maximum rates of 30Mbps in one queue and 5Mbps in other queue.
Adding the Flow Rules
- To list QoS rules
- Use below commands to create flow rules for TCP/UDP ports. If the TCP destination port is 9090, we set the packet to go through queue-0 and if the TCP destination port is 9091, we set the packet to go through queue-1. Else, it goes through the default queue.
- To view all added flow rules in a switch
- To delete all flow rules in a switch
Test the Bandwidth Provisioning
- Execute the cont2
- Parallely in another terminal execute cont1
-
Observe the iperf3 sender throughput at cont1 after iperf session. It should be nearly 30 Mbps. If we repeat the above steps by changing the iperf3 port to 9091, we should see iperf3 sender throughput at cont1 after iperf session to be nearly 5Mbps.
-
References
- https://developer.ibm.com/recipes/tutorials/using-ovs-bridge-for-docker-networking/
- http://docs.openvswitch.org/en/latest/faq/qos/