Quality of Service (QoS)

Quality of Service (QoS) is the methodology for providing a level of service for communication. It is often thought of as giving certain types of data priority over others. It is actually more than that and embraces the complete network design.

VoIP and QoS

Problems with VoIP:

Voice traffic is real time traffic and must provide the voice stream in real-time. Voice traffic can not be delayed otherwise the intelligence is lost. It makes no sense to insert a word 1 second later in a sentence! So delayed packets are dropped. Lost packets are also dropped and are not re-requested because resending them would introduce a delay.

Fighting for Bandwidth

Voice and Data are battling for the shared bandwidth of the network. During large data transfers, Voice traffic can be delayed, lost and packets can be dropped. Audio quality suffers!

Solutions

Separate the voice traffic and data traffic into separate physical networks. This isolates the traffic but it is not always possible to have two separate physical networks! So do the most practical thing and VLAN the network! You are still using the same infrastructure but have divided up the network into virtual LANs.

Critical areas are where the data and voice traffic transverse the same link. These areas of bandwidth contention are the WAN link, Dot1Q Trunks and MultiVLAN ports.

Critical QoS points in the network.

Quality of Service's Priority to the Rescue!

In these areas of bandwidth contention, we can give the voice traffic an advantage by giving it a higher priority then data traffic. We can do this at the Network layer by using the IP header's ToS/DSCP field. The ToS (Type of Service) field has 3 bits that can assign priority to an IP packet. The priority range is from 0 - 7 with the lowest priority being 0 and it is the default setting.

We can assign voice traffic to a priority of 5. Packets with a higher priority wins in the bandwidth war! This is the most common method of setting priority for VoIP end devices. IP phones can configure the voice traffic for a higher priority through either manually configuring the VLAN ID and priorirty value through the phone's Web GUI or by setting the VLAN ID and priority in the tftp config file.

Priority Bits on Steriods: DSCP!

The ToS/DSCP field can be expanded and used as Differentiated Services Code Point (DSCP), most often referred to as DiffServ. It is an improved ToS mechanism and provides 6 bits for priority. It uses the same 3 bits as ToS plus 3 more! With 6 bits, the priority ranges from 0 to 64. Again the default priority is 0 and voice traffic is usually set to 46. You use either ToS or DiffServ but not both!

Apply QoS to your Network

Data traffic has the default priority of 0 and voice traffic has a priority of either ToS = 5 or DiffServ = 46. Voice will have priority on the links with bandwidth contention mentioned earlier. Voice will not break-up during large data transfers!

VLAN Priority

VLANs can be given priority by using the IEEE802.1Q (Dot1Q) protocol tagging. The Dot1Q protocol inserts an extra field into the Ethernet frame. This field contains a special 802.1P subfield called Classification of Service (CoS). It consists of 3 bits for classification of ranging from 0 - 7 (similar to ToS). It classifies traffic as background to network critical and works at the Frame level. This leads to MultiProtocol Label Switching (MPLS). Just a note: this only applies to trunking that runs the Dot1Q protocol.

Cisco "AutoQoS" command

QoS can be very complicated and sometimes an innocent command like Cisco's "autoqos" can seem like a quick solution but there is always a catch. You apply the autoqos command on your switch to an multiVLAN access port for an IP phone:

interface FastEthernet0/13
switchport access vlan 20
switchport mode access
switchport voice vlan 30
auto qos voip cisco-phone

Here's what happens, you end up with extra code on the interface:

interface FastEthernet0/13
switchport access vlan 20
switchport mode access
switchport voice vlan 30
srr-queue bandwidth share 10 10 60 20
srr-queue bandwidth shape 10 0 0 0
mls qos trust device cisco-phone
mls qos trust cos
auto qos voip cisco-phone
spanning-tree portfast

And a complete QoS implementation on your switch!

mls qos map cos-dscp 0 8 16 26 32 46 48 56
mls qos srr-queue input bandwidth 90 10
mls qos srr-queue input threshold 1 8 16
mls qos srr-queue input threshold 2 34 66
mls qos srr-queue input buffers 67 33
mls qos srr-queue input cos-map queue 1 threshold 2 1
mls qos srr-queue input cos-map queue 1 threshold 3 0
mls qos srr-queue input cos-map queue 2 threshold 1 2
mls qos srr-queue input cos-map queue 2 threshold 2 4 6 7
mls qos srr-queue input cos-map queue 2 threshold 3 3 5
mls qos srr-queue input dscp-map queue 1 threshold 2 9 10 11 12 13 14 15
mls qos srr-queue input dscp-map queue 1 threshold 3 0 1 2 3 4 5 6 7
mls qos srr-queue input dscp-map queue 1 threshold 3 32
mls qos srr-queue input dscp-map queue 2 threshold 1 16 17 18 19 20 21 22 23
mls qos srr-queue input dscp-map queue 2 threshold 2 33 34 35 36 37 38 39 48
mls qos srr-queue input dscp-map queue 2 threshold 2 49 50 51 52 53 54 55 56
mls qos srr-queue input dscp-map queue 2 threshold 2 57 58 59 60 61 62 63
mls qos srr-queue input dscp-map queue 2 threshold 3 24 25 26 27 28 29 30 31
mls qos srr-queue input dscp-map queue 2 threshold 3 40 41 42 43 44 45 46 47
mls qos srr-queue output cos-map queue 1 threshold 3 5
mls qos srr-queue output cos-map queue 2 threshold 3 3 6 7
mls qos srr-queue output cos-map queue 3 threshold 3 2 4
mls qos srr-queue output cos-map queue 4 threshold 2 1
mls qos srr-queue output cos-map queue 4 threshold 3 0
mls qos srr-queue output dscp-map queue 1 threshold 3 40 41 42 43 44 45 46 47
mls qos srr-queue output dscp-map queue 2 threshold 3 24 25 26 27 28 29 30 31
mls qos srr-queue output dscp-map queue 2 threshold 3 48 49 50 51 52 53 54 55
mls qos srr-queue output dscp-map queue 2 threshold 3 56 57 58 59 60 61 62 63
mls qos srr-queue output dscp-map queue 3 threshold 3 16 17 18 19 20 21 22 23
mls qos srr-queue output dscp-map queue 3 threshold 3 32 33 34 35 36 37 38 39
mls qos srr-queue output dscp-map queue 4 threshold 1 8
mls qos srr-queue output dscp-map queue 4 threshold 2 9 10 11 12 13 14 15
mls qos srr-queue output dscp-map queue 4 threshold 3 0 1 2 3 4 5 6 7
mls qos queue-set output 1 threshold 1 138 138 92 138
mls qos queue-set output 1 threshold 2 138 138 92 400
mls qos queue-set output 1 threshold 3 36 77 100 318
mls qos queue-set output 1 threshold 4 20 50 67 400
mls qos queue-set output 2 threshold 1 149 149 100 149
mls qos queue-set output 2 threshold 2 118 118 100 235
mls qos queue-set output 2 threshold 3 41 68 100 272
mls qos queue-set output 2 threshold 4 42 72 100 242
mls qos queue-set output 1 buffers 10 10 26 54
mls qos queue-set output 2 buffers 16 6 17 61
mls qos

Now this might be a good thing but what if it breaks something? How are you going to fix it? What do all those numbers mean? BTW, "mls" stands for multilayer switching. This is scary stuff so you should always test your configuration when using commands like this to see what they do.

Control of QoS

You have complete control over QoS on the LAN, because you are the master of the LAN and can configure and tune it. But what about the WAN connection? You can control the traffic going out but what about the traffic coming in?

To control the incoming traffic, you must have a QoS agreement with Service Provider for the WAN connection. Otherwise, you can only control the QoS on outgoing but not incoming!

The WAN link is the big problem!

WAN QoS Solutions

On some routers, the physical Ethernet ports can have priorities. You can use one port for the voice traffic and give it priority over the data traffic port. Some companies have two WAN connections, one dedicated specifically for voice traffic and the other for data traffic.

Application Layer Gateways

Another option is an Application Layer Gateway (ALG). An ALG can examine the packet for the Application layer information. It can make decisions based on the presence of an Application layer voice protocol such as SIP, IAX, SCCP, H.323, RTP, RTCP, etc. And give the voice protocols priority on the WAN link over the data traffic.

If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.

Return to

TelecomWorld 101

Copyright July 2013 Eugene Blanchard