QoS Classification and Marking Configuration

This article covers the details for proper QoS Marking and Classification configuration. As discussed in the VoIP Quality of Service (QoS) Basics article, the first thing that must be accomplished when configuring QoS is the classification and marking of traffic; this marking is then used by the devices on the network to prioritize high priority over low priority marked traffic. This article discusses the commonly used Differentiated Services Code Point (DSCP) values and the basic concepts of classification and marking. The article then goes on to show the basic configuration steps required to implement traffic classification and marking.

The material in this article can be used as a jumping off point for studying for the CCNP Voice certification as this material is found in the CVOICE (642-437) exam that must be passed to obtain this certification. With the integration of voice and video becoming more and more common on modern networks, a solid understanding of what is possible with QoS is essential.

DSCP – Per Hob Behaviors (PHB)

The purpose of DSCP is to differentiate the different classes or types of traffic on the network; the DSCP section takes up the first 6 bits of the Type of Service field in the IP header. This space was previously used for IP precedence, and while some older implementations may still use IP precedence, most modern implementations have moved over to using DSCP. The value contained within the DSCP section is called a Per Hob Behavior (PHB); the PHB is what dictates how the traffic is handled when being routed through a network.

There are four PHB classes:

  1. Default
  2. Class Selector (CS)
  3. Assured Forwarding (AF)
  4. Expedited Forwarding (EF)

The Default class (000000) is typically used as a catch-all for all traffic that does not require a specific priority over the network; this traffic is handled as best effort going across the network. This means simply that the traffic is routed as the resources of the forwarding devices allow.

The Class Selector type is used in order to remain backward compatible with existing IP precedence implementations, the last three bits of the CS DHCP is always 000 with the first three bits being set based on the values of IP precedence, i.e., IP Precedence 7 would be 111000. The CS DHCP values that are typically used are DSCP 8 (001000), 16 (010000), 24 (011000), 32 (100000), 40 (101000), 48 (110000), and 56 (111000).

The Assured Forwarding type provides a framework of traffic classes; these are detailed in Table 1.


Drop Probability Class 1 Class 2 Class 3 Class 4
Low Drop AF11DSCP 10








Medium Drop AF12DSCP 12








High Drop AF13DSCP 14








The Expedited Forwarding type is used to dignify the highest traffic priority; the EF PHB uses a DSCP value of 46 or 101110. This type is typically used on voice and video traffic when it is being passed over a common data network.

Traffic Classification and Marking Configuration

The first thing to note here is that this article is focusing on how traffic classification and traffic marking work together. However, traffic classification can be used for a number of different purposes including use with traffic management. If there is a serious interest in learning all the capabilities of traffic classification, please review the IOS QoS guide available at http://www.cisco.com.

To perform traffic classification and marking, the Modular QoS Command Line Interface (MQC) is used. The MQC follows a basic structure regardless of what task is being completed, this structure includes:

  • Defining a traffic class, with matching criteria
  • Creating a traffic policy, that is used to define QoS actions
  • Apply the traffic policy, to a specific interface or sub-interface

Defining a Traffic Class

The definition of a traffic class is where traffic classification occurs. It is during this part of configuration that the specific traffic that is to be matched is configured. There are a number of different ways that can be used to match specific traffic; some of the available options are included in Table 2.


Match Command Match Criteria
match access group Matches based on a predefined access-list
match cos Matches based on traffic with a specific Class of Service (CoS) value
match dscp Matches based on traffic with a specific Differentiated Services Code Point (DSCP) value
match precedence Matches based on traffic with a specific IP precedence value
match protocol protocol Matches based on the traffic classified by the Network-based application recognition feature.

The basic syntax to define a traffic class is:

  • router(config)#class-map class-map-name [match-all | match-any]
  • router(config-cmap)#match (See Table 2)

Creating a Traffic Policy

A traffic policy defines how to handle the traffic that was matched within the class-map command; this is where traffic marking can occur. There are a number of different supported traffic policy commands. However, as related to traffic marking, the commands in Table 3 are commonly used:


Set command Traffic attribute
set cos Sets the value of the CoS field
set dscp Sets the value of the DSCP field
set precedence Sets the value of the IP precedence field.

The basic syntax to create a traffic policy is:

  • router(config)#policy-map policy-map-name
  • router(config-pmap)#class {class-name | class-default} (This comes from the class-map command)
  • router(config-pmap-c)#set (see Table 3)

Apply the Traffic Policy

Of course, the creation of a traffic class and a traffic policy will do very little if it is not applied to a specific interface or subinterface. Traffic policies are applied to an interface in a specific direction, ensuring that the configured direction provides the expected results. Typically, when classifying traffic from an external source, the traffic will be classified and marked at the perimeter of the network coming in to the network.

The basic syntax to apply a traffic policy is:

  • router(config)#interface type number
  • router(config-if)#service-policy {input | output} policy-map-name


The concepts used to classify and mark traffic are not hard to understand once the basics are made clear. Hopefully, this article gives a good base for understanding how Quality of Service is implemented on Cisco equipment, specifically QoS Classification and Marking Configuration.