Cisco IOS XE Quality of Service Solutions Configuration Guide, Release 2
Packet Classification Based on Layer 3 Packet Length

Table Of Contents

Packet Classification Based on Layer 3 Packet Length

Finding Feature Information

Contents

Prerequisites for Packet Classification Based on Layer 3 Packet Length

Restrictions for Packet Classification Based on Layer 3 Packet Length

Information About Packet Classification Based on Layer 3 Packet Length

MQC and Packet Classification Based on Layer 3 Packet Length

How to Configure Packet Classification Based on Layer 3 Packet Length

Configuring the Class Map to Match on Layer 3 Packet Length

Attaching the Policy Map to an Interface

Prerequisite

Verifying the Layer 3 Packet Length Classification Configuration

Troubleshooting Tips

Configuration Examples for Packet Classification Based on Layer 3 Packet Length

Configuring the Layer 3 Packet Length as a Match Criterion: Example

Verifying the Layer 3 Packet Length Setting: Example

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Feature Information for Packet Classification Based on Layer 3 Packet Length


Packet Classification Based on Layer 3 Packet Length


First Published: November 25, 2002
Last Updated: March 2, 2009

This feature provides the added capability of matching and classifying traffic on the basis of the Layer 3 packet length in the IP header. The Layer 3 packet length is the IP datagram length plus the IP header length. This new match criterion supplements the other match criteria, such as the IP precedence, the differentiated services code point (DSCP) value, and the class of service (CoS).

Finding Feature Information

For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for Packet Classification Based on Layer 3 Packet Length" section.

Use Cisco Feature Navigator to find information about platform support and Cisco IOS XE Software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Contents

Prerequisites for Packet Classification Based on Layer 3 Packet Length

Restrictions for Packet Classification Based on Layer 3 Packet Length

Information About Packet Classification Based on Layer 3 Packet Length

How to Configure Packet Classification Based on Layer 3 Packet Length

Configuration Examples for Packet Classification Based on Layer 3 Packet Length

Additional References

Feature Information for Packet Classification Based on Layer 3 Packet Length

Prerequisites for Packet Classification Based on Layer 3 Packet Length

When configuring this feature, you must first create a policy map (sometimes referred to as a service policy or a traffic policy) using the Modular QoS Command-Line Interface (CLI) (MQC). Therefore, you should be familiar with the procedure for creating a policy map using the MQC.

For more information about creating a policy map (traffic policy) using the MQC, see the "Applying QoS Features Using the MQC" module.

Restrictions for Packet Classification Based on Layer 3 Packet Length

This feature is intended for use with IP packets only.

This feature considers only the Layer 3 packet length in the IP header. It does not consider the Layer 2 overhead.

Information About Packet Classification Based on Layer 3 Packet Length

To configure the Packet Classification Based on Layer 3 Packet Length feature, you should understand the following concept:

MQC and Packet Classification Based on Layer 3 Packet Length

MQC and Packet Classification Based on Layer 3 Packet Length

Use the MQC to enable packet classification based on Layer 3 packet length. The MQC is a CLI that allows you to create traffic policies, enable a QoS feature (such as packet classification), and attach these policies to interfaces.

In the MQC, the class-map command is used to define a traffic class (which is then associated with a traffic policy). The purpose of a traffic class is to classify traffic.

The MQC consists of the following three processes:

Defining a traffic class with the class-map command.

Creating a traffic policy by associating the traffic class with one or more QoS features (using the policy-map command).

Attaching the traffic policy to the interface with the service-policy command.

A traffic class contains three major elements: a name, a series of match commands, and, if more than one match command exists in the traffic class, an instruction on how to evaluate these match commands. The traffic class is named in the class-map command line; for example, if you enter the class-map cisco command while configuring the traffic class in the CLI, the traffic class would be named "cisco".

The match commands are used to specify various criteria for classifying packets. Packets are checked to determine whether they match the criteria specified in the match commands. If a packet matches the specified criteria, that packet is considered a member of the class and is forwarded according to the QoS specifications set in the traffic policy. Packets that fail to meet any of the matching criteria are classified as members of the default traffic class.

How to Configure Packet Classification Based on Layer 3 Packet Length

This section contains the following procedures. Each procedure is identified as either required or optional.

Configuring the Class Map to Match on Layer 3 Packet Length (required)

Attaching the Policy Map to an Interface (required)

Verifying the Layer 3 Packet Length Classification Configuration (optional)

Configuring the Class Map to Match on Layer 3 Packet Length

Class maps can be used to classify packets into groups that can then receive specific QoS features. For example, class maps can be configured to match packets on the basis of one or more user-specified criteria (for example, the DSCP value or access list number). In this procedure, the class map is configured to match on the Layer 3 packet length.

To configure the class map to match on the Layer 3 packet length, complete the following steps.

SUMMARY STEPS

1. enable

2. configure terminal

3. class-map class-map-name

4. match packet length {max maximum-length-value [min minimum-length-value] | min minimum-length-value [max maximum-length-value]}

5. end

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

class-map class-map-name

Example:

Router(config)# class-map class1

Specifies the name of the class map to be created and enters class-map configuration mode.

Enter the class map name.

Step 4 

match packet length {max maximum-length-value [min minimum-length-value] | min minimum-length-value [max maximum-length-value]}

Example:

Router(config-cmap)# match packet length min 100 max 300

Configures the class map to match traffic on the basis of the Layer 3 packet length.

Enter the Layer 3 packet length in bytes.

Step 5 

end

Example:

Router(config-cmap)# end

(Optional) Exits class-map configuration mode and returns to privileged EXEC mode.


Attaching the Policy Map to an Interface

After a policy map is created, the next step is to attach the policy map to an interface. Policy maps can be attached to either the input direction or the output direction of the interface.


Note Depending on the needs of your network, you may need to attach the policy map to a subinterface, an ATM permanent virtual circuit (PVC), a Frame Relay data-link connection identifier (DLCI), or other type of interface.


To attach the policy map, complete the following steps.

Prerequisite

Before attaching the policy map to an interface, the policy map must be created using the MQC. To create a policy map using the MQC, see the "Applying QoS Features Using the MQC" module.

SUMMARY STEPS

1. enable

2. configure terminal

3. interface type number

4. pvc [name] vpi/vci [ilmi | qsaal | smds]

5. service-policy {input | output} policy-map-name

6. end

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

interface type number


Example:

Router(config)# interface serial4/0/0

Configures an interface (or subinterface) type and enters interface configuration mode

Enter the interface type and number.

Step 4 

pvc [name] vpi/vci [ilmi | qsaal | smds]

Example:

Router(config-if)# pvc cisco 0/16 ilmi

(Optional) Creates or assigns a name to an ATM PVC, specifies the encapsulation type on an ATM PVC, and enters ATM VC configuration mode.

Note This step is required only if you are attaching the policy map to an ATM PVC. If you are not attaching the policy map to an ATM PVC, skip this step and proceed with Step 5.

Step 5 

service-policy {input | output} policy-map-name

Example:

Router(config-if)# service-policy input policy1

or

Example:

Router(config-if-atm-vc)# service-policy input policy1


Specifies the name of the policy map to be attached to either the input or output direction of the interface.

Note Policy maps can be configured on ingress or egress routers. They can also be attached in the input or output direction of an interface. The direction (input or output) and the router (ingress or egress) to which the policy map should be attached varies according your network configuration. When using the service-policy command to attach the policy map to an interface, be sure to choose the router and the interface direction that are appropriate for your network configuration.

Enter the policy map name.

Step 6 

end

Example:

Router(config-if)# end

or

Example:

Router(config-if-atm-vc)# end

(Optional) Exits interface configuration mode and returns to privileged EXEC mode.


Verifying the Layer 3 Packet Length Classification Configuration

This task allows you to verify that you created the configuration that you intended and that the feature is functioning correctly.

To verify the configuration, use one or more of the show commands listed in the following steps.

SUMMARY STEPS

1. enable

2. show class-map [class-map-name]

3. show policy-map interface interface-name [vc [vpi/] vci] [dlci dlci] [input | output]

4. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

show class-map [class-map-name]

Example:

Router# show class-map class1

(Optional) Displays all information about a class map, including the match criterion.

Enter the class map name.

Step 3 

show policy-map interface interface-name [vc [vpi/] vci] [dlci dlci] [input | output]

Example:

Router# show policy-map interface serial4/0/0

(Optional) Displays the packet statistics of all classes that are configured for all service policies either on the specified interface or subinterface or on a specific PVC on the interface.

Enter the interface name.

Step 4 

exit

Example:

Router# exit

(Optional) Exits privileged EXEC mode.


Troubleshooting Tips

The commands in the "Verifying the Layer 3 Packet Length Classification Configuration" section allow you to verify that you achieved the intended configuration and that the feature is functioning correctly. If, after using the show commands listed above, you find that the configuration is not correct or that the feature is not functioning as expected, perform these operations:

If the configuration is not the one that you intended, perform the following operations:

Use the show running-config command and analyze the output of the command.

If the policy map does not appear in the output of the show running-config command, enable the logging console command.

Attach the policy map to the interface again.

If the packets are not being matched correctly (for example, the packet counters are not incrementing correctly), performs the following operations:

Run the show policy-map command and analyze the output of the command.

Run the show running-config command and analyze the output of the command.

Use the show policy-map interface command and analyze the output of the command. Check the the following:

If a policy map applies queueing, and the packets are matching the correct class, but you see unexpected results, compare the number of packets in the queue with the number of packets matched.

If the interface is congested, and only a small number of packets are being matched, check the tuning of the tx ring and evaluate whether queueing is happening on the tx ring. To do this, use the show controllers command and look at the value of the tx count in the output.

Configuration Examples for Packet Classification Based on Layer 3 Packet Length

This section provides the following configuration examples:

Configuring the Layer 3 Packet Length as a Match Criterion: Example

Verifying the Layer 3 Packet Length Setting: Example

Configuring the Layer 3 Packet Length as a Match Criterion: Example

In the following example, a class map called "class 1" has been created, and the Layer 3 packet length has been specified as a match criterion. In this example, packets with a minimum Layer 3 packet length of 100 bytes and a maximum Layer 3 packet length of 300 bytes are viewed as meeting the match criterion. Packets matching this criterion are placed in class1.

Router(config)# class map class1
Router(config-cmap)# match packet length min 100 max 300

Verifying the Layer 3 Packet Length Setting: Example

Use either the show class-map command or the show policy-map interface command to verify the setting of the Layer 3 packet length value used as a match criterion for the class map and the policy map. The following section begins with sample output of the show class-map command and concludes with sample output of the show policy-map interface command.

The sample output of the show class-map command shows the defined class map and the specified match criterion. In the following example, a class map called "class1" is defined. The Layer 3 packet length has been specified as a match criterion for the class. Packets with a Layer 3 length of between 100 bytes and 300 bytes belong to class1.

Router# show class-map 

class-map match-all class1
    match packet length min 100 max 300

The sample output of the show policy-map interface command displays the statistics for FastEthernet interface 4/1/1, to which a service policy called "mypolicy" is attached. The configuration for the policy map called "mypolicy" is given below.

Router(config)# policy-map mypolicy
Router(config-pmap)# class class1
Router(config-pmap-c)# set qos-group 20
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet4/1/1
Router(config-if)# service-policy input mypolicy

The following are the statistics for the policy map called "mypolicy" attached to FastEthernet interface 4/1/1. These statistics confirm that matching on the Layer 3 packet length has been configured as a match criterion.


Router# show policy-map interface FastEthernet4/1/1

 FastEthernet4/1/1 

  Service-policy input: mypolicy

    Class-map: class1 (match-all)
       500 packets, 125000 bytes
       5 minute offered rate 4000 bps, drop rate 0 bps
       Match: packet length min 100 max 300
       QoS Set
         qos-group 20
           Packets marked 500

Additional References

The following sections provide additional references related to the Packet Classification Based on Layer 3 Packet Length feature.

Related Documents

Related Topic
Document Title

QoS commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples

Cisco IOS Quality of Service Solutions Command Reference

MQC and information about attaching policy maps to interfaces

"Applying QoS Features Using the MQC" module

Additional match criteria that can be used for packet classification

"Classifying Network Traffic" module

Marking network traffic

"Marking Network Traffic" module


Standards

Standard
Title

No new or modified standards are supported, and support for existing standards has not been modified.


MIBs

MIB
MIBs Link

CISCO-CLASS-BASED-QOS-CAPABILITY-MIB

CISCO-CLASS-BASED-QOS-MIB

To locate and download MIBs for selected platforms, Cisco IOS XE Software releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFC
Title

No new or modified RFCs are supported, and support for existing RFCs has not been modified.


Technical Assistance

Description
Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/techsupport


Feature Information for Packet Classification Based on Layer 3 Packet Length

Table 1 lists the release history for this feature.

Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS XE Software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.


Note Table 1 lists only the Cisco IOS XE Software release that introduced support for a given feature in a given Cisco IOS XE Software release train. Unless noted otherwise, subsequent releases of that Cisco IOS XE Software release train also support that feature.


Table 1 Feature Information for Packet Classification Based on Layer 3 Packet Length

Feature Name
Releases
Feature Information

Packet Classification Based on Layer 3 Packet Length

Cisco IOS XE Release 2.2

This feature provides the added capability of matching and classifying traffic on the basis of the Layer 3 packet length in the IP header.

The following commands were introduced or modified: match packet length (class-map), show class-map, show policy-map interface.