Network Congestion
Which traffic goes first? Quality of Service on Infix
Say you have a gigabit switch where two traffic flows come in on two ports, both flows bound for the same third port:
Two ports can bring in up to 2 Gbps, the third can only send 1 Gbps.
As long as the two flows together stay under 1 Gbps there is room for both. When they don’t, frames pile up in a queue on the outgoing port, and once the queue is full the switch has to drop some. That is congestion, and Quality of Service (QoS) is how you control which traffic goes first and how much bandwidth each flow is guaranteed.
Simplified, a frame makes three stops on its way through the switch:
Classify on the way in, then queue and send on the way out.
The figures that follow are taken from Infix test cases, which run on real switch hardware and are verified against these numbers to within a few percent.
Classify
Every frame gets a priority, 0 to 7, on the port where it enters the switch. The priority is read from a marking in the frame itself, PCP or DSCP. Unmarked frames get a default priority from the port.
PCP, the Priority Code Point, is a three-bit field in the VLAN tag of an Ethernet frame. It holds a priority, 0 to 7, and only frames with a VLAN tag have one.
DSCP, the Differentiated Services Code Point, is a six-bit field in the header of every IP packet. Applications and operating systems set it, and the common values have names. Three of them appear below: EF, Expedited Forwarding, which phones and other voice applications use, AF21, a common marking for low-latency data, and CS1, the usual marking for bulk traffic that can wait, e.g. backups.
The guide’s Terminology section has the full list.
A port trusts the PCP by default. Access ports connecting end devices are usually better off with DSCP, since that is what applications set:
admin@example:/config/> edit interface e1 qos ingress
admin@example:/config/interface/…/ingress/> set trust dscp
admin@example:/config/interface/…/ingress/> leave
With the standard map, voice marked EF gets priority 5 and bulk traffic marked CS1 gets priority 1. This is a job for the edge of the network. Switches further in keep the default and go by the PCP.
Queue and Send
On the way out, the priority selects a traffic class: one of up to eight queues on the port, where frames wait their turn. The port then picks which queue to send from next, by one of two rules.
Strict priority, the default, always serves the highest class that has something to send. Here are two flows, EF and CS1, each offering 80 percent of what the port can send:
Strict priority: the higher class is served first, whatever that leaves.
At the same priority the two split the port evenly. Put EF above CS1 and all 80 percent of it gets through, leaving 20 for CS1. If EF then grows past what the port can send, CS1 gets nothing at all, which is why strict priority is best kept for traffic whose volume you know, e.g. voice and network control.
Weighted sharing divides the port between classes in proportions you set, so no class can starve another. With the same two flows and equal weights, each gets half. At 2:1, EF gets 67 percent and CS1 the remaining 33. The standard calls this Enhanced Transmission Selection, ETS, and so does the configuration.
Weighted sharing: the split follows the weights, however much each flow offers.
Combining the Two Rules
Most setups use both: one or two strict classes on top for traffic that must not wait, and weighted classes below for everything else. On a port with four queues:
admin@example:/config/> edit interface e3 qos egress
admin@example:/config/interface/…/egress/> set traffic-class 3 algorithm strict-priority
admin@example:/config/interface/…/egress/> set traffic-class 2 algorithm strict-priority
admin@example:/config/interface/…/egress/> set traffic-class 1 algorithm enhanced-transmission-selection
admin@example:/config/interface/…/egress/> set traffic-class 1 bandwidth 67
admin@example:/config/interface/…/egress/> set traffic-class 0 algorithm enhanced-transmission-selection
admin@example:/config/interface/…/egress/> set traffic-class 0 bandwidth 33
admin@example:/config/interface/…/egress/> leave
The strict class is served first, the weighted classes divide what it leaves 2:1.
Profiles
Some switch chips only have room for a few different sets of QoS settings, and some for just one, shared by every port. Ports with the same role want the same settings anyway, so a QoS profile holds them in one place and each port refers to it:
admin@example:/config/> set system qos-profile edge ingress trust dscp
admin@example:/config/> set interface e1 qos profile edge
admin@example:/config/> set interface e2 qos profile edge
admin@example:/config/> leave
Profiles also make ports easy to compare. Two ports on the same profile are set up the same, so you don’t have to check them setting by setting.
Summary
Classify traffic once, at the edge. Give strict priority to the few flows that must not wait and whose volume you know, let the rest share by weight, and keep the settings in one profile per port role.
A switch fabric forwards frames between ports directly, without passing
the CPU, so QoS has to be done there as well. How much a switch can do
varies. Each port lists what it supports under qos capabilities, and
the Hardware Offload section of the guide has the details for each
supported switch family.
The same settings are in the web interface under Configure > QoS, which offers the common roles as templates. For every setting and table, see the QoS section of the User’s Guide.