QoS Frequently Asked Questions

What does QoS stand for?

Quality of Service. It is usually pronounced "kwoz" or "kwoss". Bing claims it means "birthday" in Klingon.

What is QoS?

QoS is a set of features that allow traffic to be prioritized. Traffic is separated into different classes of traffic, based either on a priority marked in their DSCP or PCP fields, or on other header properties such as addresses, ports etc. Each class of traffic is then directed to a separate queue, and a scheduler decides how many packets to transmit from each queue based on its configuration. In this way, higher priority traffic like voice or video can be prioritized over file transfers, email or other lower priority traffic, and bandwidth can be split across the different classes according to Service Level Agreements our users form with their customers. The effects of QoS are usually only apparent when there is more traffic to be transmitted than the interface supports or than is allowed for a particular class of traffic. Otherwise, all packets are transmitted as usual, although some actions such as DSCP remarking may still occur.

Where can I find out more about the DANOS QoS implementation?

The QoS Configuration and Resources page contains links to other useful documents and RFCs.

How do I configure a basic QoS policy?

Follow this handy Basic QoS Configuration.

Why is the QoS policy configuration suddenly invalid?

To bring QoS more inline with other features, QoS policies are now stored under a name list below the policy qos node. If you see this error:

Configuration path: policy qos [foo] is not valid

Try using the following instead:

set policy qos name foo shaper ...


What are DSCP and PCP?

The Differentiated Services Code Point is a 6-bit field in the IP header which can be used to indicate the relative priority of a packet. At its simplest, higher values indicate higher priority, but there are RFCs which give significance to certain values. The default DSCP value is 0, the lowest priority which indicates the standard best-effort approach to transmitting traffic through the internet.

The Priority Code Point is a 3-bit field in the VLAN tag which is used to indicate the relative priority of VLAN-tagged packets. Often DSCP values are mapped to PCP values when the tag is added. This allows prioritization to occur at layer 2, without needing to inspect the IP header.

How do Traffic Classes work?

Traffic Classes represent different priorities of traffic within a profile. For example, a class may match all traffic destined for the 10.10.10.0/24 subnet, and the DSCP value of the packets could be used to map them to queues in the 4 traffic classes.

The traffic classes are processed in strict priority order, from 0 to 3. If bandwidth is configured in a traffic-class it acts like a maxrate and will limit the bandwidth available to the traffic-class to the configured value. Any traffic-class which does not have a bandwidth configured will have a maxrate set to the parent shaper rate and will be able to utilize all of it unless a higher priority traffic class has consumed some of the available bandwidth. If a traffic-class does have a reduced bandwidth, it will always be limited to this upper limit, even if a higher priority traffic class has not used all of the bandwidth available to it.

How do shapers work?

The underlying algorithm for the subport and profile shapers is known as a Token Bucket. This can be visualized as a large bucket which water is being added and removed from. At regular intervals, a certain amount of water is added to the bucket and can then be removed as needed. If the bucket is full, no extra water is added, and this limits the amount of water that can be removed from the bucket at one time.  

In our case, the size of the bucket is the burst parameter and is measured in bytes. The interval is defined by the period parameter in ms, and the number of credits (i.e. the water) added each period is derived from the bandwidth parameter. For example, with a bandwidth of 10kbps and a period of 10ms, then every period 100 credits will be added to the total available. If we have already accumulated as many credits as the burst parameter, then the extra credits are discarded.

When the QoS scheduler dequeues packets for transmission, it checks to see if there are enough credits available to send a packet of its length. The default MTU of a packet is 1500, so for the example above at least 15 periods will need to pass (150ms) before we have enough credits to transmit the largest packet we expect to see.

What is RED?

Random Early Detection is a way of indicating congestion in the network to receiving hosts, in the hope that they will be able to adjust their TCP windows to account for this.

Normally when the QoS queues fill up we start dropping packets instead of inserting them into the queue. RED is a means of dropping packets before the queues fill up, based on how full the queues are in order to provide this signal to the receiving host.

The two main parameters are the min-threshold and the mark-probability.

  • min-threshold is how many packets need to be in the queue before RED will start randomly dropping packets.

  • mark-probability is a weighting for how likely a randomly selected is to be dropped, once the queue fills up past the min-threshold.

  • max-threshold is the point at which all packets are dropped.

  • filter-weight allows the different traffic classes to have different relative weightings for RED.  For example, this could be used to only drop a few or no TC0 packets, but drop many TC3 packets.  

How does frame overhead work?

The frame overhead parameter is used to increase how large the QoS scheduler thinks packets are. If packets are 1000 bytes long, then set the frame overhead to 500 makes the scheduler treat them as if they were 1500 bytes long.

Calculating the exact resulting output bandwidth will depend on the average size of the input packets. For example, if packets are hitting the default MTU of 1500 bytes, then adding 500 bytes of frame overhead would result in a 25% reduction (500/1500+ 500). If the traffic has been shaped to 800mbit, then the actual observed throughput would be closer to 600mbit instead because of the extra frame overhead. Smaller packets will be more strongly affected by the frame overhead than larger packets, which is why the average packet size needs to be considered.

This setting is only really useful if you expect this overhead to be used further downstream of the router and wish to account for it.

What's wrong with my QoS config?

Have a look at this page on Troubleshooting QoS.