cc/td/doc/product/software/ios121/121newft/121t
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Class-Based Packet Marking

Class-Based Packet Marking

This document describes the Class-Based Packet Marking feature and includes the following sections:

Feature Overview

Table 1 documents the history of this feature.


Table 1: Feature History
Cisco IOS Release Enhancement

Release 12.0(5)XE

This feature was introduced.

Release 12.1(2)T

This feature was introduced for Cisco IOS Release 12.1(2)T and support for ATM virtual circuits (VCs) was added. In addition, support was added for the Cisco 2600 series, Cisco 3640 series, and Cisco 4500 series routers.

The Class-Based Packet Marking feature provides users with a user-friendly command-line interface (CLI) for efficient packet marking by which users can differentiate packets by designating them identifying values. The Class-Based Packet Marking feature allows users to perform the following tasks:

After setting the IP precedence bits or the IP DSCP, a user can classify a packet based on the IP precedence bit or IP DSCP value. These classifications are then used to apply user-defined differentiated QoS services to the packet.

Associating a packet with a local QoS group allows users to associate a group ID with a packet. The group ID can be used to classify packets into QoS groups based on prefix, autonomous system, and community string.

A user can set up to 8 IP precedence markings, 64 IP DSCP markings, and 100 QoS group markings.

Support for ATM Virtual Circuits

Packet marking is supported on ATM VCs. The user can configure the marking action in the same policy map where he or she configures the queueing actions, on a per-VC basis. Previously, packet marking was supported on at the main interface or subinterface configuration level.

Additional Statistics

Output from the show policy-map interface command is enhanced to indicate the number of packets that are marked using class-based marking.

The QoS Packet Marking feature is configured with the Modular Quality of Service Command-Line Interface (Modular QoS CLI). For additional information on the Modular QoS CLI, see the Modular Quality of Service Command-Line Interface  document on CCO and the Documentation CD-ROM.

Benefits

Packet Marking Through IP Precedence, QoS Group, and DSCP Value Setting

Packet marking allows you to partition your network into multiple priority levels or classes of service (CoS), as follows:

Restrictions

Related Features and Technologies

Related Documents

Supported Platforms

Supported Standards, MIBs, and RFCs

Standards

None

MIBs

None

For descriptions of supported MIBs and how to use MIBs, see the Cisco MIB web site on CCO at http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml.

RFCs

Prerequisites

CEF must be configured on the interface before QoS packet marking can be used.

For additional information on CEF, see the Cisco Express Forwarding and Distributed Cisco Express Forwarding feature modules.

Configuration Tasks

See the following sections for configuration tasks for the Class-Based Packet Marking feature. Each task in the list is identified as optional or required.

To configure the Class-Based Packet Marking feature, you must either configure an IP precedence value or an IP DSCP value.

Configuring an IP Precedence Value

To mark a packet by setting the IP precedence bit in the ToS byte, use the following commands beginning in global configuration mode:
Command Purpose

Step 1

Router(config)# policy-map policy-name

Specifies the name of the service policy to configure.

Step 2

Router(config-pmap)# class class-name

Specifies the name of a predefined class, which was defined with the class-map command, included in the service policy.

Step 3

Router(config-pmap-c)# set ip precedence ip-precedence-value

Specifies the IP precedence of packets within a traffic class. The ip-precedence-value is in the range 0 to 7.

This command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface  document.

Configuring an IP DSCP Value

To mark a packet by setting the IP DSCP, use the following commands beginning in global configuration mode:
Command Purpose

Step 1

Router(config)# policy-map policy-name

Specifies the name of the service policy to configure.

Step 2

Router(config-pmap)# class class-name

Specifies the name of a predefined class, which was defined with the class-map command, included in the service policy.

Step 3

Router(config-pmap-c)# set ip dscp ip-dscp-value

Specifies the IP DSCP of packets within a traffic class. The number is in the range 0 to 63.

Reserved keywords such as EF (expedited forwarding) and AF11 (assured forwarding class AF11) can be specified instead of numeric values.

This command is applied when you create a service policy in policy map configuration mode. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface  document.

Configuring a QoS Group Value

To associate a local QoS group value with a packet, use the following commands beginning in global configuration mode:
Command Purpose

Step 1

Router(config)# policy-map policy-name

Specifies the name of the service policy to configure.

Step 2

Router(config-pmap)# class class-name

Specifies the name of a predefined class, which was defined with the class-map command, included in the service policy.

Step 3

Router(config-pmap-c)# set qos-group group-id

Specifies a QoS group value to associate with the packet. The number is in the range 0 to 99.

This command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface  document.

Configuring a Specific IP Precedence Value Marking

To configure a specific IP precedence value as the match criterion, first configure the appropriate class map using the following commands beginning in global configuration mode:
Command Purpose
Router(config)#class-map 
class-map-name

Specifies the name of the class map to be created.

Router(config-cmap)#match ip precedence 
ip-precedence-value

Specifies the IP precedence value as the match criterion.

Next, configure the policy map, using the following commands beginning in global configuration mode:
Command Purpose

Router(config)#policy-map policy-name

Specifies the name of the service policy to configure.

Router(config-pmap)#class class-name

Specifies the name of a predefined class, which was defined with the class-map command, included in the service policy.

Router (config-pmap-c)#shape {average | peak} cir [bc] [be]

Specifies average or peak rate traffic shaping.

Finally, attach the policy map to the interface, using the following command in interface configuration mode:
Command Purpose

Router (config-if)#service-policy {input | output} policy-map

Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.

Using the RTP Port as the Match Criterion

To configure a class map to use the RTP port as the match criterion, first configure the appropriate class map, using the following commands beginning in global configuration mode:
Command Purpose
Router(config)#class-map 
class-map-name

Specifies the name of the class map to be created.

Router(config-cmap)#match ip rtp 
starting-port-number port-range

Specifies the RTP port as the match criterion.

Next, configure the policy map, using the following commands beginning in global configuration mode:
Command Purpose

Router(config)#policy-map policy-name

Specifies the name of the service policy to configure.

Router(config-pmap)#class class-name

Specifies the name of a predefined class, which was defined with the class-map command, included in the service policy.

Router (config-pmap-c)#priority bandwidth

Specifies the priority of a class within a policy map.

Finally, attach the policy map to the interface, using the following command in interface configuration mode:
Command Purpose

Router (config-if)#service-policy {input | output} policy-map

Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.

Verifying the Class-Based Packet Marking Feature

To verify the Class-Based Packet Marking feature and display the configuration of a policy map and retrieve information regarding QoS packet marking features that are configured in policy map configuration mode, using the show policy-map [interface [interface-spec [input | output [class class-name]]]] command in EXEC mode.

Command Purpose

Router# show policy-map

Displays all configured policy maps.

Router# show policy-map policy-map-name

Displays the user-specified policy map.

Router# show policy-map interface

Displays statistics and configurations of all input and output policies, which are attached to an interface.

Router# show policy-map interface interface-spec

Displays configuration and statistics of the input and output policies attached to a particular interface.

Router# show policy-map interface interface-spec [input]

Displays configuration and statistics of the input policy attached to an interface.

Router# show policy-map interface interface-spec [output]

Displays configuration statistics of the output policy attached to an interface.

Router# show policy-map interface-spec [input | output] class class-name

Displays the configuration and statistics for the class name configured in the policy.

Configuration Examples

This section provides the following configuration examples:

Configuring an IP Precedence Value Example

In the following example, a service policy called policy1 is created. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured.

In this example, the IP precedence bit in the ToS byte is set to 1.

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set ip precedence 1

This command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface document.

Configuring an IP DSCP Value Example

In the following example, a service policy called policy1 is created. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured.

In the following example, the IP DSCP in the ToS byte is set to 5.

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set ip dscp 5 Router(config-pmap-c)# class class2
Router(config-pmap-c)# set ip dscp ef

After you configure the settings shown for voice packets at the edge, all intermediate routers are configured to provide low latency treatment to the voice packets, as follows:

Router(config)# class-map voice
Router(config-cmap)# match ip dscp ef
Router(config)# policy qos-policy
Router(config-pmap)# class voice
Router(config-pmap-c)# priority 24
 

The set ip dscp command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface document.

Configuring a QoS Group Value Example

In the following example, a service policy called policy1 is created. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured.

In the following example, the QoS group value is set to 4.

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set qos-group 4

This command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface document.

Configuring a Specific IP Precedence Value Marking Example

In the following example, a classification policy called class1 is created. The IP precedence levels 0 through 3 are all assigned as the match criteria. Next, a service policy called policy1 is created. Average traffic rate shaping is configured, and the service policy is attached to the interface. Using this service policy, all traffic that matches precedence 0, 1, 2, and 3 is shaped as an aggregate to an average rate of 64 kbps.

Router(config)#class-map class1
Router(config-cmap)#match ip precedence 0 1 2 3
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#shape average 64000 8000 8000
Router(config-if)#service-policy output policy1

Using the RTP Port as the Match Criterion Example

In the following example, a classification policy called class1 is created. RTP ports 16383 through 32767 are configured as the match criteria. Next, a service policy called policy1 is created and assigned a bandwidth of 24 kbps. The service policy is then attached to the interface. Using this service policy, all UDP packets in the even port range from 16384 to 32767 (16384 + 16383) are given priority queueing treatment at the interface.

Router(config)#class-map class1
Router(config-cmap)#match ip rtp 16384 16383
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#priority 24
Router(config-if)#service-policy output policy1

Command Reference

This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.1 command reference publications.

match ip precedence

To identify a specific IP precedence value as the match criterion, use the match ip precedence class-map configuration command. To remove a specific IP precedence value from a class map, use the no form of this command.

match ip precedence ip-precedence-value

no match ip precedence ip-precedence-value

Syntax Description

ip-precedence-value

Specifies the exact value from 0 to 3 used to identify an IP precedence value.

Defaults

No default behavior or values.

Command Modes

Class-map configuration

Command History
Release Modification

12.0(5)XE

This command was introduced.

12.1(2)T

This command was modified to be used with the Class-Based Marking feature.

Usage Guidelines

This command is used by the class map to identify a specific IP precedence value marking on a packet.

The ip-precedence-value arguments are used as markings only. The IP precedence values have no mathematical significance. For instance, the ip-precedence-value of 2 is not greater than 1. The value simply indicates that a packet marked with the ip-precedence-value of 2 is different than a packet marked with the ip-precedence-value of 1. The treatment of these different packets is defined by the user through the setting of quality of service (QoS) policies in policy map class configuration mode.

When used with the Class-Based Marking feature, the ip-precedence-value argument can be from 0 to 3.

Examples

The following example shows how to configure service policy priority50 and attach service policy priority50 to an interface. In this example, class map ipprec3 will evaluate all packets entering interface fast-ethernet 1/0/0 for an IP precedence value of 3. If the incoming packet has been marked with the IP precedence value of 3, the packet will be treated with a priority level of 50.

Router(config)#class-map ipprec3
Router(config-cmap)#match ip precedence 3
Router(config)##exit
Router(config)##policy-map priority50
Router(config-pmap)##class ipprec3
Router(config-pmap-c)#priority 50
Router(config-pmap-c)#exit
Router(config-pmap)#exit
Router(config)#interface fa1/0/0
Router(config-if)#service-policy input priority50

Related Commands
Command Description

class-map

Specifies the user-defined name of the traffic class.

policy-map

Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.

service-policy

Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.

set ip precedence

Sets the precedence value in the IP header.

show class-map

Display all class maps and their matching criteria.

match ip rtp

To configure a class map to use the Real-Time Protocol (RTP) protocol port as the match criteria, use the match ip rtp class-map configuration command. To remove the RTP protocol port match criteria, use the no form of this command.

match ip rtp starting-port-number port-range

no match ip rtp

Syntax Description

starting-port-number

The starting RTP port number. Values range from 2000 to 65535.

port-range

The RTP port number range. Values range from 0 to 16383.

Defaults

No default behavior.

Command Modes

Class-map configuration

Command History
Release Modification

12.1(2)T

This command was introduced.

Usage Guidelines

This command is used to match IP RTP packets that fall within the specified port range. It matches packets destined to all even UDP port numbers in the range <starting port range> <starting port range + port range>.

Use of an RTP port range as the match criterion is particularly effective for applications that use the RTP protocol, such as voice or video.

Examples

The following example specifies a class map called eth1 and configures the RTP port number 2024 and range 1000 to be used as the match criterion for this class:

class-map eth1 
 match ip rtp 2024 1000

Related Commands
Command Description

ip rtp priority

Reserves a strict priority queue for a set of RTP packet flows belonging to a range of UDP destination ports.

match access-group

Configures the match criteria for a class map based on the specified ACL.

set ip dscp

To mark a packet by setting the IP differentiated services code point(DSCP) in the type of service (ToS) byte, use the set ip dscp policy map configuration command. To remove a previously set IP DSCP value, use the no form of this command.

set ip dscp ip-dscp-value

no set ip dscp ip-dscp-value

Syntax Description

ip-dscp-value

A number from 0 to 63 that sets the IP DSCP value. Reserved keywords, such as EF (expedited forwarding) and AF11 (assured forwarding class AF11), can be specified instead of numeric values.

Defaults

No default behavior or values.

Command Modes

Policy map configuration

Command History
Release Modification

12.0(5)XE

This command was introduced in policy map configuration mode.

12.1(2)T

This command was enhanced to include reserved keywords such as EF, AF11, AF12, and so on instead of numeric values.

Usage Guidelines

Once the IP DSCP bit is set, other quality of service (QoS) services can then operate on the bit settings.

The network gives priority (or some type of expedited handling) to marked traffic. Typically, you set IP precedence at the edge of the network (or administrative domain); data then is queued based on the precedence. Weighted fair queueing(WFQ) can speed up handling for high-precedence traffic at congestion points. Weighted random early detection(WRED) ensures that high-precedence traffic has lower loss rates than other traffic during times of congestion.

Reserved keywords such as EF, AF11, AF12 and so on can be specified instead of numeric values.

Examples

In the following example, the IP DSCP ToS byte is set to 8 in the policy map named policy1:

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set ip dscp 8

All packets that satisfy the match criteria of class1 are marked with the IP DSCP value of 8. How packets marked with the IP DSCP value of 8 are treated is determined by the network configuration.

After you configure the settings shown for voice packets at the edge, all intermediate routers are then configured to provide low latency treatment to the voice packets, as follows:

Router(config)# class-map voice
Router(config-cmap)# match ip dscp ef
Router(config)# policy qos-policy
Router(config-pmap)# class voice
Router(config-pmap-c)# priority 24
 

The set ip dscp command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface document.

Related Commands
Command Description

policy-map

Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.

service-policy

Displays the configuration of classes configured for service policies on the specified interface or PVC.

show policy-map

Displays the configuration of all classes comprising the specified service policy map or all classes for all existing policy maps.

show policy-map class

Displays the configuration for the specified class of the specified policy map.

show policy-map interface

Displays the configuration of classes configured for service policies on the specified interface or PVC.

set ip precedence

To set the precedence value in the IP header, use the set ip precedence policy map configuration command. To leave the precedence value as-is use the no form of this command.

set ip precedence ip-precedence-value

no set ip precedence

Syntax Description

ip-precedence-value

A number from 0 to 7 that sets the precedence bit in the IP header.

Defaults

This command is disabled by default.

Command Modes

Policy map configuration

Command History
Release Modification

11.0

This command was introduced.

12.0(5)XE

This command was introduced in the modular quality of service (QoS) command-line interface.

Usage Guidelines

Once the IP precedence bits are set, other QoS services such as weighted fair queueing (WFQ) and weighted random early detection (WRED) then operate on the bit settings.

The network gives priority (or some type of expedited handling) to marked traffic through the application of WFQ or WRED at points downstream in the network. Typically, you set IP precedence at the edge of the network (or administrative domain); data then is queued based on the precedence. WFQ can speed up handling for certain precedence traffic at congestion points. WRED can ensure that certain precedence traffic has lower loss rates than other traffic during times of congestion.

Examples

The following example sets the IP precedence to 5 for packets that satisfy the match criteria of class map class1:

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set ip precedence 5

All packets that satisfy the match criteria of class1 are marked with the IP precedence value of 5. How packets marked with the IP precedence value of 5 are treated is determined by the network configuration.

The set ip precedence command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface or to an ATM virtual circuit. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interface document.

Related Commands
Command Description

policy-map

Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.

service-policy

Displays the configuration of classes configured for service policies on the specified interface or PVC.

show policy-map

Displays the configuration of all classes comprising the specified service policy map or all classes for all existing policy maps.

show policy-map interface

Displays the configuration of classes configured for service policies on the specified interface or PVC.

set qos-group

To set a group ID that can be used later to classify packets, use the set ip qos-group policy map configuration command. To remove the group ID, use the no form of this command.

set qos-group group-id

no set qos-group group-id

Syntax Description

group-id

Group ID number in the range 0 to 99.

Defaults

This command is disabled by default. No group ID is specified.

Command Modes

Policy map configuration

Command History
Release Modification

11.1 CC

This command was introduced.

12.0(5)XE

This command was introduced in the modular quality of service (QoS) command-line interface.

Usage Guidelines

This command allows you to associate a group ID with a packet. The group ID can be used later to classify packets into QoS groups based on prefix, autonomous system, and community string.

To display QoS group information, use the show ip cef command.

Examples

The following example sets the QoS group to 1 for all packets that match the class 1 class map. These packets are then rate limited based on the QoS group ID.

Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)#set qos-group 1

The set qos-group command is applied when you create a service policy in policy map configuration mode. This service policy is not yet attached to an interface or an ATM virtual circuit. For information on attaching a service policy to an interface, see the Modular Quality of Service Command-Line Interfacedocument.

Related Commands
Command Description

policy-map

Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.

service-policy

Displays the configuration of classes configured for service policies on the specified interface or PVC.

show policy-map

Displays the configuration of all classes comprising the specified service policy map or all classes for all existing policy maps.

show policy-map interface

Displays the configuration of classes configured for service policies on the specified interface or PVC.

show policy-map interface

To display the configuration of all classes configured for all service policies on the specified interface or to display the classes for the service policy for a specific permanent virtual circuit (PVC) on the interface, use the show policy-map interface global configuration command.

show policy-map interface interface-name [vc [vpi/] vci]]

Syntax Description

interface-name

Name of the interface or subinterface whose policy configuration is to be displayed.

vc

(Optional) For ATM interfaces only, shows the policy configuration for a specified PVC. The name can be up to 16characters long.

vpi/

(Optional) ATM network virtual path identifier (VPI) for this PVC. The absence of the "/" and a vpi value defaults the vpi value to 0.

On the Cisco 7200 and 7500 series routers, this value ranges from 0 to 255.

The arguments vpi and vci cannot both be set to 0; if one is 0, the other cannot be 0.

If this value is omitted, information for all VCs on the specified ATM interface or subinterface is displayed.

vci

(Optional) ATM network virtual channel identifier (VCI) for this PVC. This value ranges from 0 to 1 less than the maximum value set for this interface by the atm vc-per-vp command. Typically, lower values 0 to 31 are reserved for specific traffic (for example, F4 Operation, Administration, and Maintenance (OAM), switched virtual circuit (SVC) signalling, Integrated Local Management Interface (ILMI), and so on) and should not be used.

The VCI is a 16-bit field in the header of the ATM cell. The VCI value is unique only on a single link, not throughout the ATM network, because it has local significance only.

The arguments vpi and vci cannot both be set to 0; if one is 0, the other cannot be 0.

Defaults

There is no default behavior.

Command Modes

Global configuration

Command History
Release Modification

12.0(5)T

This command was introduced.

12.1(2)T

This command was modified to display the total number of packets marked by the quality of service (QoS) set action.

Usage Guidelines

This command displays the configuration for classes on the specified interface or the specified PVC only if a service policy has been attached to the interface or the PVC.

You can use the pvc-name argument to display output for a PVC only for Enhanced ATM port adapters (PA-A3) that support per-VC queueing.

Examples

The following example displays configurations for classes on the output interface e1/1:

Router# show policy-map interface output e1/1
 
Ethernet1/1 output : po1
Class class1
QoS Set
Packets marked 10000
Class class2
Qos Set
Packets marked 20000

hometocprevnextglossaryfeedbacksearchhelp
Posted: Mon Jul 24 09:54:48 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.