Quality of Service (QoS) on the Cisco ASA
Students tend to have a difficult time understanding Quality of Service where it is most often covered in Cisco certificationthe Routing and Switching and Voice disciplines. But now, QoS is so important to networks, that we must also master it in Security, Wireless, Data Center, and just about every major area of Cisco discipline. In this article, we will examine the Quality of Service capabilities that exist on the Cisco Adaptive Security Appliance (ASA).
Cisco made sure to integrate some much needed features on the next-generation firewall device, and it is no surprise. These features are not only critical to understand and potentially implement in your production networks, but they are also listed as potential areas of testing in the FIREWALL portion of the Cisco Certified Network Professional (CCNP) Security track.
A QoS Refresher
There are three overall, broad-brushed approaches to QoS that an organization can employ. The first is called Best Effort, and in this approach, more bandwidth is provided to each link of the network than can possibly be used. This over-provisioning of bandwidth results in a lack of contention for network bandwidth resources and allows for the default queuing mechanisms of the devices to be sufficient. Typically, Cisco devices (including the ASA) will engage in a First-In First-Out (FIFO) approach to traffic under the default arrangement. This works perfectly well, if there is an overabundance of network bandwidth.
The Best Effort approach sure sounds wonderful in theory, but it breaks down when organizations look at the recurring costs associated with over-provisioning the bandwidth everywhere. The first major overall approach to QoS that did not involve Best Effort was called Integrated Services (IntServ). Under this approach, the Resource Reservation Protocol (RSVP) is used to have devices signal ahead into the network regarding information flows that will need certain levels of bandwidth reserved. You can see why this approach was nicknamed “hard QoS” by many network engineers.
The issue with the IntServ approach is the fact that this model just does not scale well. Imagine the difficulty one might have in verifying all devices in the corporate network are using RSVP correctly; now expand this out to other networks that the corporate network interacts with. It might be impossible to provide the end-to-end QoS needs using this Integrated Services approach. Also, consider the overhead placed on the network from the RSVP processes alone. It is easy to see why a new, overall model for QoS was needed.
The Differentiated Services (DiffServ) approach to QoS seeks to address the concerns of scalability and the achievement of true end-to-end QoS. Unfortunately, the approach is very complex consisting of many different functional categories. For example, traffic might be first classified, and then marked with a service designation. Then, traffic might be policed or shaped as it is sent on to the next hop in the network. There, the traffic might be queued using a sophisticated queueing algorithm, and sent to the next hop where it might be fragmented and interleaved between other data packets. The official list of functions found under the DiffServ approach is listed for you below. You should note that the Cisco ASA can indeed support several tools within these categories:
- Classification
- Marking
- Congestion Avoidance
- Congestion Management
- Policing
- Shaping
- Traffic Conditioning
QoS Mechanisms on the Cisco ASA
The ASA supports several of the key tools found in the Differentiated Services approach. Specifically, the ASA can do the following:
- Classification
- Congestion ManagementLow Latency Queueing (LLQ)
- Policing
- Shaping
Classification on the Cisco ASA
While the ASA cannot mark packets for special treatment in the network, it does preserve existing markings, and it can classify traffic based on these QoS markings. Traffic classification on the Cisco ASA is accomplished with class-maps. This is consistent with how traffic classification is accomplished on Cisco’s routers and switches in the network. In the following example, the ASA detects traffic that is marked with a Differentiated Services Code Point (DSCP) marking of Expedited Forwarding (EF). This traffic is typically Voice over IP (VoIP) traffic and the network is programmed to provide it with the best possible service:
ciscoasa(config)# class-map CM_VOICE ciscoasa(config-cmap)# match dscp ef
Remember, with classification, the Cisco ASA will automatically create a class-default class-map. This structure is used to classify all traffic passing through the device that does not fall into one of your user-created class-maps. This is very important on the ASA, since some of the QoS mechanisms only work against this unclassified traffic.
Congestion ManagementLow Latency Queuing (LLQ) on the Cisco ASA
LLQ priority queuing on the Cisco ASA is very important because it allows you prioritize certain traffic flows (like voice and video) and send this traffic through interfaces in advance of less important traffic forms. The ASA supports two types of priority queuing. The first is standard priority queuing. Under this approach, the ASA uses an LLQ priority queue on an interface for the traffic that you classify as important, and the device takes all other traffic and places it in a “best effort” queue.
The second type that is available is called hierarchical priority queuing. You use this approach on interfaces where you also need to use traffic shaping. Thanks to the hierarchical priority queuing capability, a subset of the shaped traffic can be prioritized.
Here is an example of the standard priority queuing approach:
ciscoasa(config)# access-list AL_TCPTRAFFIC permit tcp any any ciscoasa(config)# class-map CM_TCPTRAFFIC ciscoasa(config-cmap)# match access-list AL_TCPTRAFFIC ciscoasa(config-cmap)# match dscp ef ciscoasa(config)# policy-map PM_LLQ ciscoasa(config-pmap)# class CM_TCPTRAFFIC ciscoasa(config-pmap-c)# priority ciscoasa(config-pmap-c)# service-policy PM_LLQ global
This configuration not only demonstrates the LLQ approach on the Cisco ASA, but it also serves to illustrate how the QoS configuration on the ASA follows the original Modular Quality of Service Command Line Interface (MQC) that was invented for routers and multi-layer switches when Class-based Weighted Fair Queuing (CB-WFQ) was invented. Notice the configuration follows the classic three step approach. Class-maps classify the traffic, a policy-map dictates the QoS treatment for the class(es), and service-policy indicates the placement of the QoS policy. Here in our example, the policy applies globally on the device, but keep in mind that specific interfaces can be referenced for more specific policies.
Policing
Policing allows us to ensure that no traffic exceeds a maximum rate that we can define on the Cisco ASA. This is extremely beneficial in networks where bandwidth is a precious and scarce commodity, because it can prevent various types of network traffic from monopolizing the available resources on an interface. With policing, when traffic exceeds the maximum rate you have defined, the ASA drops the excess traffic. With policing, you can also define the largest single burst of traffic permitted on the ASA interface(s).
Here is an example of policing. Notice that we are not showing the class-map definition step for brevity:
ciscoasa(config)# policy-map PM_POLICE ciscoasa(config-pmap)# class CM_SAMPLE ciscoasa(config-pmap-c)# police output 56000 10500 ciscoasa(config-pmap-c)# service-policy PM_POLICE interface outside
Here we can see the maximum rate for traffic of the CM_SAMPLE class is 56,000 bits/second and a maximum burst size is configured of 10,500 bytes per second. I always recommend the use of context sensitive help when configuring such parameters so you can ensure the exact measurement of rate in use for the QoS feature.
Shaping
Traffic shaping is used to control the rate of at which a Cisco ASA interface sends traffic. The configuration is for all traffic on an interface. Therefore, the class-default class-map is used. Unlike policing, the Cisco ASA does not drop excess traffic, but attempts to buffer it for sending in the next time interval.
Here is an example of traffic shaping on the Cisco ASA. Once again, the class-map configuration is omitted:
ciscoasa(config-pmap-c)# policy-map PM_SHAPING ciscoasa(config-pmap)# class class-default ciscoasa(config-pmap-c)# shape average 2000000 16000 ciscoasa(config-pmap-c)# service-policy PM_SHAPING interface outside
Conclusion
To keep pace with the demands of the network, more and more Differentiated Services tools have made their way to the Cisco ASA. Whether it is to prioritize certain traffic forms, or limit the rate of others, the Cisco ASA continues to become more QoS aware to ensure critical service levels to important traffic forms. This article demonstrated the capabilities of classification, congestion management, and shaping and policing that exist on the ASA as of the time of this writing.