Good afternoon, in this article I would like to talk a little about the method of constructing QoS rules in Cisco devices. First I want to give a brief definition of the concept of QoS.
QoS is the ability of a network to provide improved service for network traffic, regardless of the technologies selected, including Frame Relay, ATM, Ethernet or IP network with routing.
The main function of QoS is to provide improved and more predictable behavior of network services, using mechanisms such as:
- Dedicated bandwidth
- Improved loss performance
- Congestion Prevention and Management
- Traffic division
- Traffic prioritization
We now turn to reviewing the detailed command line QoS control structure in Cisco devices. This model is central to QoS solutions built on the basis of Cisco IOS. In the original, it sounds like a Modular QoS CLI, then I will call it MQC.
MQC divides QoS related tasks into the following modules:
- Traffic flow determination
- Classify it as belonging to the QoS class
- QoS policing for this class
- Defining the interfaces on which the policy should be enforced.
Below is a diagram of the approximate interaction of this algorithm.

I will try to take a closer look at the commands related to this configuration mode.
Switch(config)# class-map cisco
Switch(config-cmap)#
The class-map command is used to describe the traffic class.
- The purpose of the traffic class is to classify or identify the traffic that will be transmitted to a specific QoS.
- Traffic that meets certain criteria.
The traffic class consists of 3 main elements:
- Name
- Match command set
- If there is more than one match command, the class must contain instructions for calculating
data commands.
Below is an example, all the traffic that is allowed through the ACL test will be part of a class known as cisco.
Switch(config)# class-map cisco
Switch(config-cmap)# match access-group name test
The match command is used to define various criteria for classifying packets.
If the package matches the specified criteria:
- The package starts to belong to this class.
- The packet is forwarded following the QoS specifications specified in the traffic policy.
Packages that do not match the specified criteria:
- Classified as default class.
- Distributed by other traffic policies.
If there is more than one match in this class, use:
- class-map match-any or
- class-map match-all
If match-any is used, the traffic will move based on the rule, “must meet one of the specified criteria”
If match-all is used, the traffic will move based on the rule, “must meet all specified criteria”
As an example, consider a set of commands:
')
Switch(config)# class-map match-any cisco
Switch(config-cmap)# match access-group name test
Switch(config-cmap)# match interface fastethernet 0/1
If the traffic matches the “allowed” assertion in the test ACL or the traffic is generated by the Fa0 / 1 interface, it will be recognized as part of the traffic known as cisco.
The policy-map command is used to create a traffic policy.
- The assignment of a traffic policy is the configuration of QoS functions that should be associated with traffic that has been classified as user-defined traffic.
The traffic policy also consists of three elements:
- Policy name
- Traffic class (indicated by the class command)
- QoS policies that will be applied to each class.
Consider an example:
Switch(config)# policy-map policy1
Switch(config-pmap)# class cisco
Switch(config-pmap-c)# bandwidth 3000
Switch(config-pmap)# class class-default
Switch(config-pmap-c)# bandwidth 2000
This policy-map creates a traffic policy called policy1.
- The policy applies to all traffic classified by the previously described traffic class "cisco". Indicates that traffic in this example should be allocated a bandwidth of 3000 kbps.
- All traffic that does not belong to this “cisco” class forms part of the class-default class. It will be provided with a bandwidth of 2000 kbps.
Switch(config)# interface fastethernet 0/1
Switch(config-if)# service-policy output policy1
The service policy command is used to attach the traffic policy specified by the policy-map command to an interface.
- It can be applied to both incoming and outgoing packets on the specified interface, so this command should indicate the direction of traffic.
Example:
Switch(config)#interface fastethernet 0/1
Switch(config-if)#service-policy output policy1
Switch(config-if)#exit
All packets leaving the specified interface must be compatible with the criteria specified in the traffic policy named policy1.
Now we will try to combine all that we have got into a single configuration, with some explanations:
1. Add traffic policy to the interface.
Switch(config)#interface fastethernet 0/1
Switch(config-if)#service-policy output policy1
2. Identify the QoS function of this policy using classes.
Switch(config)#policy-map policy1
Switch(config-pmap)#class cisco
Switch(config-pmap-c)#bandwidth 3000
Switch(config-pmap)#class class-default
Switch(config-pmap-c)#bandwidth 2000
3. Classification of traffic flow, as belonging to the specified QoS class.
Switch(config)# class-map match-any cisco
Switch(config-cmap)# match access-group name test
Switch(config-cmap)# match interface fastethernet 0/1
This is how a Cisco IOS based QoS model works, I hope I could at least a little reveal the algorithm of this functionality. Of course, this article is only the tip of the iceberg called QoS, but I hope that it will help you acquire a small base in building QoS policies on Cisco devices.