Define the QoS policy to be applied per class using policy maps—The QoS policy applied per class is defined as the PHB for that specific class. This usually includes the functions of congestion management, congestion avoidance, and traffic shaping and policing on a per class basis. It will also define if the specified class requires preferential treatment as in the case of LLQ. Therefore, this is often where you will find the
police,
shape,
priority,
bandwidth, and
random-detect commands per class.
Figure 13-11 illustrates the configuration pertaining to the implementation of a QoS policy using policy maps and outlines the configuration options available for each class under the policy-map configuration.
With random-detection, the queue can be configured to selectively drop packets to avoid the queue from filling up leading to tail-drop scenarios. Therefore, the minimum threshold at which the selective drop begins and the maximum threshold before the tail drop are to be configured along with the drop probability denominator, which defines the ratio of packets to be dropped at the maximum threshold. Note that the smaller the drop probability denominator, the more aggressive the congestion avoidance scheme. The most common variables are that the
bandwidth command needs to be configured prior to random-detect configuration, as well as random-detect cannot be performed on an LLQ as defined by the
priority command mentioned earlier. Hence, random-detection can be done based on Precedence values or DSCP values, and drops can be done selectively or more aggressively based on the Precedence or DSCP values.
Policing is the process of identifying if traffic conforms to a certain profile. Traffic not conforming to the profile can be either reconfigured (lowered in priority and class) and transmitted or simply dropped. The important difference between traffic shaping and policing is that packets are not dropped that do not match a traffic profile. In shaping, out-of-profile packets are queued and perhaps re-marked and sent at a later time interval. The shaping can be performed using peak or average rates and usually forms a single token bucket model, but, in some higher end routers manufactured by Cisco, the dual token bucket model is used in which a separate bucket is maintained for tokens matching the committed burst rate and the excess burst rates. The key item to note is that shaping is always performed on egress and not on ingress whereas policing can be performed on ingress as well.