The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
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).
Your software release may not support all the features documented in this module. 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 Table at the end of this document.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
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.
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:
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 theclass-mapciscocommand while configuring the traffic class in the CLI, the traffic class would be named "cisco".
Thematch 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.
Before attaching the policy map to an interface, the policy map must be created using the MQC.
Command or Action | Purpose | |||
---|---|---|---|---|
|
Example: Router> enable |
Enables privileged EXEC mode.
|
||
|
Example: Router# configure terminal |
Enters global configuration mode. |
||
|
Example:
Example: Router(config)# interface serial4/0/0 |
Configures an interface (or subinterface) type and enters interface configuration mode
|
||
|
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.
|
||
|
Example: Router(config-if)# service-policy input policy1 Example:
Example: Router(config-if-atm-vc)# service-policy input policy1 Example:
|
Specifies the name of the policy map to be attached to either the input or output direction of the interface.
|
||
|
Example: Router(config-if)# end Example:
Example: Router(config-if-atm-vc)# end |
(Optional) Exits interface configuration mode and returns to privileged EXEC mode. |
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:
If the packets are not being matched correctly (for example, the packet counters are not incrementing correctly), performs the following operations:
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
Use either the showclass-map command or the showpolicy-mapinterface 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 showclass-mapcommand and concludes with sample output of the showpolicy-mapinterface command.
The sample output of the showclass-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 showpolicy-mapinterface 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
Related Topic |
Document Title |
---|---|
Cisco IOS commands |
|
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 |
Standard |
Title |
---|---|
No new or modified standards are supported, and support for existing standards has not been modified. |
-- |
RFC |
Title |
---|---|
No new or modified RFCs are supported, and support for existing RFCs has not been modified. |
-- |
Description |
Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
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: matchpacketlength (class-map), showclass-map, showpolicy-mapinterface. |
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.