Quality of Service (QoS) is a key aspect that needs to be considered when designing and implementing enterprise campus solutions to ensure performance optimization across the network. There are many different categories of the QoS approach, including:
- Shaping
- Policing
- Congestion management
- Congestion avoidance
- Link efficiency mechanisms
QoS is usually needed when traffic goes from a high-bandwidth connection (LAN) to a low-bandwidth connection (Internet or WAN). This is the reason QoS techniques are usually applied at the network’s exit point.
QoS involves a wide variety of techniques used, especially in networks that offer multimedia services (voice and/or video) because these services are usually delay-sensitive and require low latency and low jitter. Traffic generated by these applications must be prioritized and this is the role of QoS techniques.
Congestion Management
In situations in which a specific link is constantly congested, the link may need to be upgraded. However, when experiencing occasional congestion on a particular link, you can use QoS congestion management techniques. Congestion happens for a lot of different reasons in modern networks.
The approach of congestion management is called queuing. Applying queuing techniques means using other techniques than the default FIFO (First In, First Out) method. An interface consists of two different queue areas, which are shown in Figure 26.1 below:
- Hardware queue (or Transmit Ring – TX Ring)
- Software queue
Figure 26.1 – Interface Queue Types
The hardware queue on the interface always uses the FIFO method for packet treatment. This mode of operation assures that the first packet in the hardware queue is the first packet that will leave the interface. The only TX Ring parameter that can be modified on most devices is the queue length.
The software queue is where most of the congestion management manipulations are performed. The software queue is used to order packets before they use the hardware queue and they can be configured with different queuing strategies.
Congestion might happen because of the high-speed LAN connections that aggregate into the lower-speed WAN connections. Aggregation refers to being able to support the cumulative effect of all the users wanting to use the connection.
There are many different approaches (queuing strategies) that can be used in congestion management:
- FIFO (First In First Out)
- PQ (Priority Queuing)
- RR (Round Robin)
- WRR (Weighted Round Robin)
- DRR (Deficit Round Robin)
- MDRR (Modified Deficit Round Robin)
- SRR (Shaped Round Robin)
- CQ (Custom Queuing)
- FQ (Fair Queuing)
- WFQ (Weighted Fair Queuing)
- CBWFQ (Class Based Weighted Fair Queuing)
- LLQ (Low Latency Queuing)
| Note: All of the techniques mentioned above are used in the interface software queue. The hardware queue always uses FIFO.
|
FIFO is a technique used in the hardware queue and is the least complex method of queuing. It operates by giving priority to the packets first received. This is also usually the default queuing mechanism for software queues on high-speed interfaces. If you have a sufficient budget to overprovision the congested links, you can use FIFO on all your interfaces (hardware and software queues). However, in most situations this is not the case, so you will need to use some kind of advanced queuing technique, like WFQ, CBWFQ, or LLQ. These are the most modern queuing strategies that will enable you to make sure that important packets are getting priority during times of congestion.
FIFO used in the software queue will not make a determination on packet priorities that are usually signaled using QoS markings. If you rely on FIFO and experience congestion, the traffic will be affected by things like delay or jitter and important traffic might be starved and might not reach its destination.
Weighted Fair Queuing (WFQ) is usually the default technique used on slow-speed interfaces (less than 2Mbps) because it is considered to be more efficient than FIFO in this case. Weighted Fair Queuing functions by dynamically sorting the traffic into flows and then dedicating a queue for each flow while trying to allocate the bandwidth fairly. It does this by inspecting the QoS markings and giving priority to higher priority traffic.
WFQ is not the best solution in every scenario because it does not provide enough control in the configuration (i.e., it does everything automatically), but it is far better than the FIFO approach because interactive flows that generally use small packets (e.g., VoIP) get prioritized to the front of the software queue. The WFQ fairness element makes sure that high priority interactive conversations don’t get starved by high volume traffic flows. In other words, high volume talkers won’t use all of the interface bandwidth.
Figure 26.2 – Weighted Fair Queuing Logic
As shown in Figure 26.2 above, the different WFQ flows are placed into different queues, and then they hit a WFQ scheduler that allows them to pass to the hardware queue based on the defined logic. If one queue fills to the limit, the packets will be dropped, but this will also be based on the WFQ approach (lower priority packets are dropped first), as opposed to the FIFO approach of tail dropping.
Because WFQ lacks a certain level of control, another congestion management technology was created called Custom Queuing (CQ). Even though CQ is a legacy technology it is still implemented in some environments. CQ is similar to WFQ but it operates by manually defining 16 static queues. Network administrators can assign a byte count for each queue (i.e., the number of bytes that are to be sent from each queue). Queue number 0 is reserved for the system to avoid starvation on key router messages. CQ allows for manual allocation of the number of bytes or packets for each queue.
Even though CQ provides flexible congestion management, this does not work well with VoIP implementations because of the round-robin nature of Custom Queuing. Let’s consider an example with four queues that are allocated a different number of packets (Q1: 10 packets; Q2: 20 packets; Q3: 50 packets; and Q4: 100 packets) over a particular time interval. Even though Queue 4 has priority, the interface is still using a round-robin approach (Q4-Q3-Q2-Q1-Q4…and so on). This is not appropriate for VoIP scenarios because voice traffic needs strict priority to maintain a constant traffic flow that will minimize jitter. As a result, another legacy technology was invented called Priority Queuing (PQ). PQ places packets into four priority queues:
- Low
- Normal
- Medium
- High
VoIP traffic is placed in the high priority queue to ensure absolute priority. However, this can lead to the starvation of other queues. For this reason, PQ is not recommended for use in modern networks.
If VoIP is not used in the network, the most recommended congestion management technique is Class Based Weighted Fair Queuing (CBWFQ). CBWFQ defines the amounts of bandwidth that the various forms of traffic will get. Minimum bandwidth reservations are defined for different classes of traffic.
Figure 26.3 – Class Based Weighted Fair Queuing Logic
Referencing Figure 26.3 above, CBWFQ logic is based on a WFQ scheduler that receives information from queues defined for different forms of traffic. The traffic that does not fit any manually defined queue automatically falls into the “class-default” queue. These queues can be assigned minimum bandwidth guarantees to all traffic classes. CBWFQ offers powerful methodologies for controlling exactly how much bandwidth these various classifications will receive. If it contains more than one traffic type, each individual queue will use the FIFO method instead, so be careful not to combine too many forms of traffic inside a single queue.
Because CBWFQ is not efficient when using VoIP, another QoS technique was developed: Low Latency Queuing (LLQ). As can be seen in Figure 26.4 below, LLQ adds a priority queue (usually for voice traffic) to the CBWFQ system, so LLQ is often referred to as an extension of CBWFQ:
Figure 26.4 – Low Latency Queuing Logic
Adding a priority queue to CBWFQ will not lead to starvation because this queue is policed, which means that the amount of bandwidth guaranteed for voice is also policed to ensure that it doesn’t exceed a particular value. In other words, voice traffic gets its own priority treatment and the remaining traffic forms will fall under WFQ based on the bandwidth reservation values.
Congestion Avoidance
Congestion avoidance is another category of Differentiated Services QoS often deploys in Wide Area Networks. When both the hardware and the software queues fill up, the packets are tail dropped at the end of the queue, which can lead to voice traffic starvation and/or to the TCP global synchronization process described earlier. Using congestion avoidance techniques can guard against these global synchronization problems.
The most popular congestion avoidance mechanism is called Random Early Detection (RED). The job of this QoS tool is to try to prevent congestion from occurring by randomly dropping unimportant traffic before the queue gets full. As the queue fills up, more and more unimportant packets are randomly dropped.
Shaping and Policing
Shaping and policing do not represent one and the same thing, as many people think. Shaping is the process that tries to control the way traffic is sent, by buffering excess packets. Policing, on the other hand, will drop or re-mark (penalize) packets that exceed a given rate.
Policing might be used when there is fast WAN access available but it is not needed. This prevents certain applications from using all the connection resources. Another situation is where there are certain applications with clear bandwidth requirements that are offered only as many resources as they need.
Shaping is often used to prevent congestion in situations where you have asymmetric bandwidth. An example in this regard can be a headquarters router that connects to a branch router that has a lower bandwidth connection. In this type of environment, you can set up shaping when the HQ router sends data so it does not overwhelm the branch office router.
Many times the contract between a service provider and its customer specifies a committed information rate (CIR) value. This represents the amount of bandwidth purchased from the service provider. Shaping can be used when you want to make sure that the data you send conforms to the specified CIR.
When comparing shaping and policing, notice that shaping can only be done outbound, while policing can be used both in the ingress and egress direction. Another key distinction is that policing will drop or re-mark the packet (i.e., it is not a queuing mechanism, as it can also handle inbound traffic), while shaping will queue the excess traffic. Because of this behavior, policing will require less buffering. With shaping, one advantage is that it supports Frame Relay congestion indicators by responding to FECN and BECN messages.
Link Efficiency Mechanisms
Link efficiency mechanisms are divided into two categories:
- Compression
- Link fragmentation and interleaving (LFI)
Compression involves reducing the size of certain packets in order to increase the available bandwidth and decrease delay. Multiple types of compression exist:
- TCP header compression (compresses the IP and TCP headers, reducing the overhead from 40 bytes to 3 to 5 bytes)
- RTP header compression (compresses the IP, UDP, and RTP headers of voice packets, reducing the overhead to 2 to 4 bytes)
There are three different flavors of LFI used today:
- Multilink PPP with interleaving (used in PPP environments)
- FRF.12 (used with Frame Relay data connections)
- FRF.11 Annex C (used with Voice over Frame Relay – VoFR)
LFI techniques are efficient on slow links where certain problems might appear even after applying congestion management features. These problems are generated by big data packets that arrive at the interface before other smaller, more important packets. If a big packet enters the FIFO TX Ring before a small VoIP packet arrives at the software queue, the VoIP packet will get stuck behind the data packet and might have to wait a long time before its transmission is finished. To solve this problem, LFI splits the large data packet into smaller pieces (fragments) so the voice packets can be interleaved between them, as illustrated in Figure 26.5 below. Using LFI, the voice packets do not have to wait behind the large packet until it is completely transmitted.
Figure 26.5 – Link Fragmentation and Interleaving
QoS Design Recommendations for Voice Transport
Network engineers should use general guidelines when designing Quality of Service for voice transport. These QoS techniques are applied to WAN connections that are equal to T1 or lower. When using high-bandwidth connections, you do not need to think about QoS techniques because congestion is less likely to occur.
QoS techniques are most effective on bursty connections, typically in Frame Relay environments where committed information rates and burst rates are usually specified in the contract. Traffic bursts occur when large packets are sent over the network or when the network is very busy during certain periods of the day. QoS techniques should be mandatory if the enterprise uses any kind of delay-sensitive applications, for example, applications that must function in real-time (e.g., presentations over the Internet or video training sessions).
Congestion management should be considered only when the network experiences congestion and this should be planned by analyzing the organizational policies and goals and following the network design steps (PDIOO – Plan, Design, Implement, Operate, Optimize). Before applying any QoS configuration, traffic should be carefully analyzed to detect congestion problems. The best QoS mechanism should be chosen by consulting with the implementation team and this can include packet classification and marking, queuing techniques, congestion avoidance techniques (traffic shaping or policing), or bandwidth reservation mechanisms (e.g., RSVP).
Network engineers should also be familiar with the most important QoS mechanisms available for IP telephony:
- cRTP
- LFI
- PQ-WFQ
- LLQ
- Auto QoS
The compressed Real-time Transport Protocol (cRTP) is a compression mechanism that reduces the IP, UDP, and RTP headers’ size from 40 bytes to 2 or 4 bytes. cRTP is configured on a link-by-link basis and the recommendation is to use this technique for links that are lower than 768Kbps.
| Note: cRTP should not be configured on devices that have high processor utilization (above 75%).
|
LFI is a QoS mechanism used to reduce serialization delay. PQ is also referred to as IP RTP priority. This adds a single priority queue to the WFQ technique, which is used for VoIP traffic. All of the other traffic is queued based on the WFQ algorithm. When using PQ, the router places VoIP RTP packets in a strict priority queue that is always serviced first.
LLQ, also known as Priority Queuing-Class Based Weighted Fair Queuing (PQ-CBWFQ), also provides a single priority queue but it is preferred over the PQ-WFQ technique because it guarantees bandwidth for different classes of traffic. All voice call traffic is assigned to the priority queue, while VoIP signaling and video traffic is assigned to its own traffic class. For example, FTP can be assigned to the low priority traffic class and all other data traffic can be assigned to a regular class.
| Note: QoS techniques should be carefully configured on all the devices involved in voice transport, not just on individual devices.
|
Some of the best practices to be used in a VoIP environment to ensure optimal performance include the following:
- Separate voice traffic into its own subnets and VLANs
- Use private addressing (RFC 1918) for IP phones, combined with NAT/PAT if necessary
- Strategically place the IP telephony servers on filtered VLANs in the data center
- Use QoS IP precedence or DSCP for packet classification and markings
- Use LLQ on WAN links
- Use LFI on slower WAN links
- Use the CAC (Call Admission Control) mechanism to avoid oversubscribing priority queues; the main goal of CAC is to protect voice traffic from being affected by other voice traffic by rerouting it through alternative network paths or to the PSTN
Analyzing Delay-Sensitive Traffic
When using Multicasting or Web streaming, e-commerce, e-learning solutions, or IP telephony, the traffic involved in this process will be delay-sensitive and QoS techniques might be necessary to ensure that the traffic is treated with priority.
In Layer 3 applications like Frame Relay environments using EIGRP, OSPF, or BGP as the routing protocols with the ISP, it is very common to use QoS techniques to shape and control traffic at the IP Layer. You can also use QoS at Layer 2. When using QoS or analyzing or controlling delay-sensitive traffic at Layer 2, there are four categories of QoS techniques:
- Tagging and traffic classification
- Congestion control
- Policing and traffic shaping
- Scheduling
Figure 26.6 – Layer 2 QoS Techniques
Examining Figure 26.6 above, tagging and traffic classification takes place between the end-user nodes, through the Access Layer and up to the Distribution Layer. This is where packets are classified, and they can be grouped and partitioned based on different priority levels or Classes of Service. This procedure involves inspecting the Layer 2 packet headers and determining the priority of the traffic based on the type of traffic (e.g., IP telephony, Telnet traffic, printer traffic, file services, or other traffic). The traffic is then tagged and classified and the Layer 2 frame can be changed depending on the priority.
| Note: Tagging and traffic classification is also called traffic marking.
|
The next three techniques (congestion control, policing and traffic shaping, and scheduling) occur at the Distribution Layer (building distribution and edge distribution), primarily on Layer 3 switches. You should avoid applying any QoS techniques at the Core Layer because you want as little overhead as possible on the backbone devices so they can successfully achieve their goal, which is fast connectivity, high availability, and reliability.
Congestion control involves looking at the interfaces of the access switches and the queuing mechanisms configured on them. Queuing techniques should be used to deal with the congestion of packets coming in and going out of the switch ports. This also ensures that traffic from critical applications will be forwarded properly. Congestion control is especially helpful when using real-time applications (e.g., VoIP) that require a reduced amount of jitter and latency so the specific application will function in an optimal way, with as little delay as possible.
Policing and shaping help move important traffic to the top of the list and dynamically adjust the priorities of certain types of traffic during periods of congestion. Scheduling is the process of establishing the order in which the congested queues will be served.
Quality of Service techniques can be used to allow Layer 2 switches to help out in the queuing process by scheduling certain processes. Much of the QoS activity occurs at Layer 3, but many features can also be taken into consideration at Layer 2 and they can be implemented on higher-end switches to provide support for tagging, traffic classification, congestion control, policing/shaping traffic, and traffic scheduling.





