Quality of Service (QoS) is a way to tell routers and switches to prefer, process and prioritize some packets over others.
- By default, QoS is not applied and packets are treated as First In First Out (FIFO)
- Some packets like Voice over IP and Video are time sensitive and should be prioritized above other packets when transiting layer 2 and layer 3 devicse. For example, the FTP protocol is used to transfer files. If an FTP packet or two doesn’t make it to the destination it will just get retransmitted and nobody is the wiser. Compare that to VoIP or Video. If a VoIP packet doesn’t make it to the destination then you get a choppy phone call. There’s no sense retransmitting the VoIP packet because it would just arrive out of sequence anyways. This is why we typically apply QoS to packets that are more sensitive when it comes to:
- Latency - Amount of time it takes for a packet to get to the destination (delay)
- Jitter - the variance of delay
- Loss - number of packets that never arrive
- Bandwidth - amount of data that can be sent
- QoS can be applied to improve each of these measures
- Marking is when QoS changes the Type of Service (ToS) byte in a packet header
- Marking can be accomplished by setting the IP precedence bits (3 bits) or the Differentiated Services Code Point (DSCP) bits (6 bits)
- Other devices that receive these packet can then ake action based on the ToS markings
- ToS is preserved over trunk links. It is removed when packets are routed so you’ll have to have layer 3 devices remark the packets
4.7.b Device trust
- This normally applies to a switchport that a VoIP phone is connected to
- Should the switch trust the attached device or not?
- To tell the switchport to trust the attached device, maybe it’s a Cisco VoIP phone, use the command
mls qos trust device cisco-phone
- Then you must also configure the switchport which marking to trust - ToS, DSCP, or IP Precedence
mls qos trust cos
- Without any trust configuration on the switchport, all traffic would be processed per the default switchport configuration, which is normally FIFO
4.7.c. (i) Voice
- CoS 5
- DSCP 46 (Expedited Forwarding EF)
4.7.c. (ii) Video
- CoS 4
- DSCP 34 (Assured Forwarding AF41)
4.7.c. (iii) Data
- Depends what kind of data, but should be lower than Voice and Video
- CoS 1 or 2
- DSCP AF11 or AF21
|Type of Packets||Class of Service (CoS)||Differentiated Services Code Point (DSCP)|
|VoIP and Video||5||EF|
What happens when the amount of data being transmitted or received goes above the set traffic rate? Shaping policies treat the data packets differently than policing policies.
- Applies queues, memory and buffers to store and forward as many packets up to the set data rate as possible. Shaping smooths out the data transfer and it appears a smooth line right at the traffic rate when viewing a traffic graph.
- Drops excess traffic when it reaches the set traffic rate. Policing results in peaks and valleys when looking at a traffic graph.
4.7.f Congestion management
- During periods with light traffic, that is, when no congestion exists, packets are sent out the interface as soon as they arrive. During periods of transmit congestion at the outgoing interface, packets arrive faster than the interface can send them. If you use congestion management features, packets accumulating at an interface are queued until the interface is free to send them; they are then scheduled for transmission according to their assigned priority and the queueing mechanism configured for the interface. The router determines the order of packet transmission by controlling which packets are placed in which queue and how queues are serviced with respect to each other.