Configuring Classification


This chapter describes how to configure classification on the Cisco 1000 Series Connected Grid Routers (hereafter referred to as Cisco CG-OS router). This chapter includes the following sections:

Information About Classification

Prerequisites for Classification

Guidelines and Limitations

Configuring Traffic Classes

Verifying the Classification Configuration

Configuration Examples for Classification

Information About Classification

Classification is the separation of packets into traffic classes. You configure the Cisco CG-OS router to take a specific action on the specified classified traffic, such as marking or priority queuing.

You can create class maps to represent each traffic class by matching packet characteristics with the classification criteria in Table 3-1.

For more information on class maps, see Chapter 2 "Using Modular QoS CLI".

Table 3-1 Classification Criteria 

Classification Criteria
Description

IP precedence

Precedence value within the Type of Service (ToS) byte of the IP header.

Differentiated Services Code Point (DSCP)

DSCP value within the DiffServ field of the IP header.

Packet length

Size range of Layer 3 packet lengths.

Class map

Criteria specified in a named class-map object.


You can specify multiple match criteria, you can choose to not match on a particular criterion, or you can determine the traffic class by matching any or all criteria. Traffic that fails to match any class within a QoS policy map is assigned to a default class of traffic called class-default. You can also directly reference class-default within a QoS policy map to select unmatched traffic.

You can reuse class maps on the Cisco CG-OS router when defining QoS policies for different interfaces that process the same types of traffic.

For more information on class maps, see Chapter 2 "Using Modular QoS CLI".

Prerequisites for Classification

You must be familiar with Chapter 2 "Using Modular QoS CLI".

You are logged on to the Cisco CG-OS router.

Guidelines and Limitations

You can specify a maximum of 1024 match criteria in a class map.

You can configure a maximum of 4096 classes for use in a single policy map.

When you match on an ACL, the only other match you can specify is the Layer 3 packet length in a match-all class.

Configuring Traffic Classes

This section includes the following topics:

Configuring Access Control List Classification

Configuring DSCP Classification

Configuring IP Precedence Classification

Configuring Layer 3 Packet Length Classification

Configuring Class Map Classification


Note For the examples within this section, please note that because type qos is the system-defined default, you can exclude type qos from the class-map [type qos] [match-any | match-all] class-map-name command when you are configuring class maps and it yields the same result.


Configuring Access Control List Classification

You can classify traffic by matching packets based on existing access control lists (ACLs). The permit and deny ACL keywords are ignored in the matching process. QoS does not use the permit and deny functions of ACLs. You can classify traffic as either IPv4 or IPv6.


Note Tunneled IP packets are matched unless the tunneling protocol is also IP, and then the match applies to the outer IP header and not the encapsulated IP header.


BEFORE YOU BEGIN

No prerequisites.

DETAILED STEPS

 
Command
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

class-map [type qos] [match-any | match-all] class-map-name

Creates or accesses the class map named class-map-name and enters class-map mode.

The class map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

To delete the class map, enter the no class-map [[type qos] [match-any | match-all] class-map-name command.

Step 3 

match access-group name acl-name

Configures the traffic class by matching packets based on the acl-name. The permit and deny ACL keywords are ignored in the matching.

EXAMPLE

This example shows how to create or access an ACL class map on the Cisco CG-OS router.

router# configure terminal
router(config)# class-map class_acl
router(config-cmap-qos)# match access-group name my_acl
 
   

Configuring DSCP Classification

You can classify traffic based on the DSCP value in the DiffServ field of the IP header. The standard DSCP values are listed in Table 3-2.

Table 3-2 Standard DSCP Values 

Value
List of DSCP Values

af11

AF11 dscp (001010)—decimal value 10

af12

AF12 dscp (001100)—decimal value 12

af13

AF13 dscp (001110)—decimal value 14

af21

AF21 dscp (010010)—decimal value 18

af22

AF22 dscp (010100)—decimal value 20

af23

AF23 dscp (010110)—decimal value 22

af31

AF31 dscp (011010)—decimal value 26

af32

AF32 dscp (011100)—decimal value 28

af33

AF33 dscp (011110)—decimal value 30

af41

AF41 dscp (100010)—decimal value 34

af42

AF42 dscp (100100)—decimal value 36

af43

AF43 dscp (100110)—decimal value 38

cs1

CS1 (precedence 1) dscp (001000)—decimal value 8

cs2

CS2 (precedence 2) dscp (010000)—decimal value 16

cs3

CS3 (precedence 3) dscp (011000)—decimal value 24

cs4

CS4 (precedence 4) dscp (100000)—decimal value 32

cs5

CS5 (precedence 5) dscp (101000)—decimal value 40

cs6

CS6 (precedence 6) dscp (110000)—decimal value 48

cs7

CS7 (precedence 7) dscp (111000)—decimal value 56

default

Default dscp (000000)—decimal value 0

ef

EF dscp (101110)—decimal value 46



Note Tunneled IP packets are matched unless the tunneling protocol is also IP, and the match applies to the outer IP header and not the encapsulated IP header.


BEFORE YOU BEGIN

No prerequisites.

DETAILED STEPS

 
Command
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

class-map [type qos] [match-any | match-all] class-map-name

Creates or accesses the class map named class-map-name and enters class-map mode. The class-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3 

match [not] dscp dscp-list

Configures the traffic class by matching packets based on a dscp-list. Table 3-2 shows the standard DSCP values.

Use the not keyword to match on values that do not match the specified range.

Step 4 

copy running-config startup-config

(Optional) Saves the running configuration to the startup configuration.

EXAMPLE

This example shows how to configure a DSCP class-map with matching criteria of af21 and af32:

router# configure terminal

router(config)# class-map class_dscp

router(config-cmap-qos)# match dscp af21 af32

router(config-cmap-qos)# copy running-config startup-config

Configuring IP Precedence Classification

You can classify traffic based on the precedence value in the type of service (ToS) byte field of the IP header. Table 3-3 shows the precedence values.

Table 3-3 Precedence Values 

Value
List of Precedence Values

<0-7>

IP precedence value

critical

Critical precedence (5)

flash

Flash precedence (3)

flash-override

Flash override precedence (4)

immediate

Immediate precedence (2)

internet

Internetwork control precedence (6)

network

Network control precedence (7)

priority

Priority precedence (1)

routine

Routine precedence (0)



Note Tunneled IP packets are matched unless the tunneling protocol is also IP, and the match applies to the outer IP header and not the encapsulated IP header.


BEFORE YOU BEGIN

No prerequisites.

DETAILED STEPS

 
Command
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

class-map [type qos] [match-any | match-all] class-map-name

Creates or accesses the class map named class-map-name, and then enters class-map mode. The class-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3 

match [not] precedence precedence-values

Configures the traffic class by matching packets based on precedence-values. Values are shown in Table 3-3. Use the not keyword to match on values that do not match the specified range.

Step 4 

copy running-config startup-config

(Optional) Saves the running configuration to the startup configuration.

EXAMPLE

This example shows how to classify traffic based on the precedence values of 1-2 and 5-7 (see Table 3-3) in the type of service (ToS) byte field of the IP header:

router# configure terminal
router(config)# class-map class_ip_precedence
router(config-cmap-qos)# match precedence 1-2, 5-7
router(config-cmap-qos)# copy running-config startup-config

Configuring Layer 3 Packet Length Classification

You can classify Layer 3 traffic based on various packet lengths.


Note This feature is designed for IPv4 and IPv6 packets only.


BEFORE YOU BEGIN

No prerequisites.

DETAILED STEPS

 
Command
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

class-map [type qos] [match-any | match-all] class-map-name

Creates or accesses the class map named class-map-name, and then enters class-map mode. The class-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3 

match [not] packet length packet-length-list

Configures the traffic class by matching packets based on various packet lengths. Values can range from 1 to 9198. Use the not keyword to match on values that do not match the specified range.

Step 4 

copy running-config startup-config

(Optional) Saves the running configuration to the startup configuration.

EXAMPLE

This example shows how to configure a packet length class-map.

router# configure terminal

router(config)# class-map class_packet_length

router(config-cmap-qos)# match packet length 2000

router(config-cmap-qos)# copy running-config startup-config

Configuring Class Map Classification

Before you reference a class-map within a match class-map command, you must create that referenced class map. Additionally, you can configure only one level of nesting of class maps; and, you cannot reference a class map that references another class map.


Note Before you delete a referenced class map, you must delete all references to that class map.


You can classify traffic based on the match criteria in another class map. You can reference the same class map in multiple policies.

Follow these guidelines while configuring the class-map classification:

To perform a logical OR operation for a class map within the match class-map command, use the match-any keyword.

To perform a logical AND operation for a class map within the class map specified in the match class-map command, use the match-all keyword.

BEFORE YOU BEGIN

Create the class map that you want to reference within the match class-map command.

DETAILED STEPS

 
Command
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

class-map [type qos] [match-any | match-all] class-map-name

Creates or accesses the class map named class-map-name, and then enters class-map mode. The class-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3 

match [not] class-map class-map-name

Configures the traffic class by matching packets based on the match criteria in another class map.

match-all is the default for the class-map command.

Use the not keyword to match on values that do not match the specified range.

Step 4 

copy running-config startup-config

(Optional) Saves the running configuration to the startup configuration.

EXAMPLE

This example shows how to configure the class-map, class_class_map to match its criteria with the match criteria defined within the class_map3 class-map:

router# configure terminal 
router(config)# class-map class_class_map 
router(config-cmap-qos)# match class-map class_map3
router(config-cmap-qos)# copy running-config startup-config

Verifying the Classification Configuration

Use the show class-map command to verify the class-map configuration. This command displays all class maps.

router# show class-map
show class-map 
 
   
Type qos class-maps
====================
class-map type qos match-all class1
      match dscp 5
class-map type qos match-all class33
      match dscp 10

Configuration Examples for Classification

The following example shows how to configure classification for two classes of traffic:

class-map class_dscp
  match dscp af21 af32
exit
class-map class_packet_length
  match packet length 2000
  exit