QoS using OpenDaylight

OpenFlow provides limited support for QoS using queues and meters. Most of the software switches support queues. Queues are created and configured outside the OpenFlow protocol. OpenFlow provides the implementation to the controller to use these queues in the flows. In this blog post, we explain how to use queues in OpenFlow 1.3 and implement QoS in a network topology created using mininet and OpenDaylight(ODL) controller.

Configuring queues in Open vSwitch (OVS)
To implement quality of service (QoS) in an OVS switch, we need to create a QoS policy and queues with different bandwidths. Next, we need to add these queues in the QoS policy and connect the policy to a port on the switch where we want to implement the QoS. Finally we have to map the required queue Id with the flow. Below are OVS commands to list all qos and queues

sudo ovs-vsctl list qos
sudo ovs-vsctl list queue

Below are OVS commands to bulk destroy all qos and queues

sudo ovs-vsctl --all destroy qos
sudo ovs-vsctl --all destroy queue

Implementing Queues in OpenDaylight using REST API
1. Create a single switch, 2 hosts mininet topology using command below:

sudo mn --topo single,2 --controller=remote,ip=

This will create a topology with a single switch connected with two hosts h1( and h2( Next, Start the ODL controller and test a ping from h1 to h2.  If ping is successful you are good to go to next steps. We are using beryllium version of ODL.

2. Create a QoS policy and attach it with the desired switch port using commands below:

sudo ovs-vsctl set port s1-eth1 qos=@newqos -- --id=@newqos create qos
 type=linux-htb other-config:max-rate=5000000 queues=1=@q1,2=@q2
 -- --id=@q1 create queue other-config:min-rate=5000000
 other-config:max-rate=5000000 -- --id=@q2 create queue
 other-config:min-rate=3000000 other-config:max-rate=3000000

In the command above, we are creating a QoS policy of type linux-htb having maximum data transfer rate of 5 Mbps and attaching it to port s1-eth1. We are also creating 2 queues q1 with queue id = 1 and q2 with queue id = 2 and adding these queues in the QoS policy. q1 has a maximum transfer rate of 5 Mbps and a minimum transfer rate of 5 Mbps. q2 has a maximum transfer rate of 3 Mbps and a minimum transfer rate of 3 Mbps.  One thing to note down is that the QoS method is egress only which means these rates will be applicable when the packets are being forwarded out from the port.

3. Map the queue with the flow from h1 to h2 using REST API as below:
Submit a HTTP PUT request using Postman to the ODL controller using headers:

Set body of the request as shown in code block below. The <set-queue-action> in the flow mentioned below is mapping the queue with queue id = 1 with the flow.

<flow xmlns="urn:opendaylight:flow:inventory">

Iperf Testing
Test it using iperf data transfer. Start iperf server on h1 on port 12345 and send data from h2 on that port. Below we are attaching some screen shots for reference:
Before implementing QoS:


After implementing the QoS:


OpenFlow provides limited support for QoS on cost of its complexity. In this post we explained how to use queues and implement QoS using ODL controller. Meters are supported in OpenFlow 1.3 which unlike queues are created and configured using OpenFlow protocol itself. We will be discussing meters in our next blog post.


One thought on “QoS using OpenDaylight

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s