Class commands

Use these M4500 CLI commands to create DiffServ class maps and define match criteria such as CoS, DSCP, IP precedence, addresses, ports, and protocols.

The 'class' command set is used in DiffServ to define:

Traffic Classification specifies Behavior Aggregate (BA) based on DSCP, and Multi- Field (MF) classes of traffic (name, match criteria)

Service Levels specifies the BA forwarding classes / service levels. Conceptually, DiffServ is a two-level hierarchy of classes: 1. Service/PHB, 2. Traffic Class

This set of commands consists of class creation/deletion and matching, with the class match commands specifying layer 3, layer 2, and general match criteria. The class match criteria are also known as class rules, with a class definition consisting of one or more rules to identify the traffic belonging to the class. Note that once a class match criterion is created for a class, it cannot be changed or deleted - the entire class must be deleted and re-created.

The CLI command root is class-map.

class-map

This command defines a new DiffServ class of type match-all, match-any or match-access-group.

Format class-map [match-all] <class-map-name> [{ipv4 | ipv6}]
Parameter Description
<class-map-name> Case sensitive alphanumeric string from 1 to 31 characters uniquely identifying the class.

When used without any match condition, this command enters the class-map mode. The <class-map-name> is the name of an existing DiffServ class.

!

The class name 'default' is reserved and is not allowed here. The class type of match-all indicates all of the

individual match conditions must be true for a packet to be considered a member of the class.

The optional keywords [{ipv4 | ipv6}] specify the Layer 3 protocol for this class. If not specified, this parameter defaults to ‘ipv4’. This maintains backward compatibility for configurations defined on systems before IPv6 match items were supported.

The CLI mode is changed to Class-Map Config or Ipv6-Class-Map Config when this command is successfully executed depending on the [{ipv4 | ipv6}] keyword specified.

Default None
Mode Global Config

no class-map

This command eliminates an existing DiffServ class.

Format no class-map <class-map-name>
Parameter Description
<class-map-name> The name of an existing DiffServ class..

!

The class name 'default' is reserved and is not allowed here. This command may be issued at any time; if

the class is currently referenced by one or more policies or by any other class, this deletion attempt shall fail.

Default None
Mode Global Config

rename

This command changes the name of a DiffServ class.

Format rename <new-class-map-name>
Parameter Description
<new-class-map-name> Case-sensitive alphanumeric string from 1 to 31 characters uniquely identifying the class.

!

The class name ‘default’ is reserved and must not be used here.

Default None
Mode Class-Map Config / Ipv6-Class-Map Config

match any

This command adds to the specified class definition a match condition whereby all packets are considered to belong to the class.

Default None
Format match any
Mode Class-Map Config / Ipv6-Class-Map Config

match class-map

This command adds to the specified class definition the set of match conditions defined for another class.

Format match class-map <refclassname>
Parameter Description
<refclassname> The name of an existing DiffServ class whose match conditions are being referenced by the specified class definition.
Note: There is no [not] option for this match command.
Default None
Mode Class-Map Config / Ipv6-Class-Map Config

Restrictions

The class types of both <classname> and <refclassname> must be identical (that is, any vs. any, or all vs. all). A class type of acl is not supported by this command.

Cannot specify <refclassname> the same as <classname> (that is, self-referencing of class name not allowed). At most one other class may be referenced by a class. Any attempt to delete the <refclassname> class while still referenced by any <classname> shall fail.

The combined match criteria of <classname> and <refclassname> must be an allowed combination based on the class type. Any subsequent changes to the <refclassname> class match criteria must maintain this validity, or the change attempt shall fail. The total number of class rules formed by the complete reference class chain (includes both predecessor and successor classes) must not exceed a platform-specific maximum. In some cases, each removal of a refclass rule reduces the maximum number of available rules in the class definition by one.

no match class-map

This command removes from the specified class definition the set of match conditions defined for another class.

Format no match class-map <refclassname>
Parameter Description
<refclassname> The name of an existing DiffServ class whose match conditions are being referenced by the specified class definition.
Note: There is no [not] option for this match command.
Default None
Mode Class-Map Config / Ipv6-Class-Map Config

match cos

This command adds to the specified class definition a match condition for the Class of Service value (the only tag in a single tagged packet or the first or outer 802.1Q tag of a double VLAN tagged packet). The value may be from 0 to 7.

Default None
Format match cos <0-7>
Mode Class-Map Config
Parameter Description
<0-7> Integer in the range of 0 to 7 specifying the COS value.

match secondary-cos

This command adds to the specified class definition a match condition for the secondary Class of Service value (the inner 802.1Q tag of a double VLAN tagged packet). The value may be from 0 to 7.

Default None
Format match secondary-cos <0-7>
Mode Class-Map Config
Parameter Description
<0-7> Integer in the range of 0 to 7 specifying the COS value.

match destination-address mac

This command adds to the specified class definition a match condition based on the destination MAC address of a packet. The <address> parameter is any layer 2 MAC address formatted as six, two-digit hexadecimal numbers separated by colons (e.g., 00:11:22:dd:ee:ff). The <mac-mask> parameter is a layer 2 MAC address bit mask, which need not be contiguous, and is formatted as six, two-digit hexadecimal numbers separated by colons (e.g., ff:07:23:ff:fe:dc).

Default None
Format match destination-address mac <address> <mac-mask>
Mode Class-Map Config
Parameter Description
<address> Specifies any layer 2 MAC address.
<mac-mask> Specifies a layer 2 MAC address bit mask.

match dstip

This command adds to the specified class definition a match condition based on the destination IP address of a packet.

Default None
Format match dstip <ipaddr> <ipmask>
Mode Class-Map Config
Parameter Description
<ipaddr> Specifies an IP address.
<ipmask> Specifies an IP address bit mask; note that although similar to a standard subnet mask, this bit mask need not be contiguous.

match dstI4port

This command adds to the specified class definition a match condition based on the destination layer 4 port of a packet using a single keyword or numeric notation or a numeric range notation.

Default None
Format match dstl4port {<port-key> | <0-65535>}
Mode Class-Map Config / Ipv6-Class-Map Config
Parameter Description
<port-key> To specify the match condition as a single keyword, the value for <portkey> is one of the supported port name keywords. The currently supported <portkey> values are: domain, echo, ftp, ftpdata, http, smtp, snmp, telnet, tftp, www. Each of these translates into its equivalent port number, which is used as both the start and end of a port range.
<0-65535> To specify the match condition using a numeric notation, one layer 4 port number is required. The port number is an integer from 0 to 65535. To specify the match condition using a numeric range notation, two layer 4 port numbers are required and together they specify a contiguous port range. Each port number is an integer from 0 to 65535, but with the added requirement that the second number be equal to or greater than the first.

match ethertype

This command adds to the specified class definition a match condition based on the value of the ethertype. The <ethertype> value is specified as one of the following keywords: appletalk, arp, ibmsna, ipv4, ipv6, ipx, mplsmcast, mplsucast, netbios, novell, pppoe, rarp or as a custom ethertype value in the range of 0x0600-0xFFFF.

Default None
Format match ethertype {<keyword> | <0x0600-0xFFFF>}
Mode Class-Map Config
Parameter Description
<keyword> Specifies appletalk, arp, ibmsna, ipv4, ipv6, ipx, mplsmcast etc.
<0x0600-0xFFFF> Specifies ethertype value.

match ip dscp

This command adds to the specified class definition a match condition based on the value of the IP DiffServ Code Point (DSCP) field in a packet, which is defined as the high-order six bits of the Service Type octet in the IP header (the low-order two bits are not checked).

Format match {ip | ipv6} dscp <value>
Parameter Description
<value> Specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef.
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation. To specify a match on all DSCP values, use the match [not] ip tos <tosbits> <tosmask> command with <tosbits> set to 0 and <tosmask> set to 03 (hex).
Default None
Mode Class-Map Config / Ipv6-Class-Map Config

match ip precedence

This command adds to the specified class definition a match condition based on the value of the IP Precedence field in a packet, which is defined as the high-order three bits of the Service Type octet in the IP header (the low-order five bits are not checked). The precedence value is an integer from 0 to 7.

Format match ip precedence <0-7>
Parameter Description
<0-7> Integer from 0 to 7.
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation.

To specify a match on all Precedence values, use the match [not] ip tos <tosbits> <tosmask> command with <tosbits> set to 0 and <tosmask> set to 1F (hex).

Default None
Mode Class-Map Config

match ip tos

This command adds to the specified class definition a match condition based on the value of the IP TOS field in a packet, which is defined as all eight bits of the Service Type octet in the IP header.

Format match ip tos <tosbits> <tosmask>
Parameter Description
<tosbits> Two-digit hexadecimal number from 00 to ff.
<tosmask> Two-digit hexadecimal number from 00 to ff. The <tosmask> denotes the bit positions in <tosbits> that are used for comparison against the IP TOS field in a packet. For example, to check for an IP TOS value having bits 7 and 5 set and bit 1 clear, where bit 7 is most significant, use a <tosbits> value of a0 (hex) and a <tosmask> of a2 (hex).
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation.

In essence, this the “free form” version of the IP DSCP/Precedence/TOS match specification in that the user has complete control of specifying which bits of the IP Service Type field are checked.Default None

Mode Class-Map Config

match protocol

This command adds to the specified class definition a match condition based on the value of the IP Protocol field in a packet using a single keyword notation or a numeric value notation.

Format match protocol {<protocol-name> | <0-255>}
Parameter Description
<protocol-name> One of the supported protocol name keywords . The currently supported values are: icmp, igmp, ip, tcp, udp. Note that a value of ip is interpreted to match all protocol number values.
<0-255> To specify the match condition using a numeric value notation, the protocol number is a standard value assigned by IANA and is interpreted as an integer from 0 to 255.
Note: This command does not validate the protocol number value against the current list defined by IANA.Default None
Mode Class-Map Config / Ipv6-Class-Map Config

match source-address mac

This command adds to the specified class definition a match condition based on the source MAC address of a packet. The <address> parameter is any layer 2 MAC address formatted as six, two-digit hexadecimal numbers separated by colons (e.g., 00:11:22:dd:ee:ff). The <macmask> parameter is a layer 2 MAC address bit mask, which may not be contiguous, and is formatted as six, two-digit hexadecimal numbers separated by colons (e.g., ff:07:23:ff:fe:dc).

Default None
Format match source-address mac <address> <macmask>
Mode Class-Map Config
Parameter Description
<address> Specifies any layer 2 MAC address.
<macmask> Specifies a layer 2 MAC address bit mask.

match scrip

This command adds to the specified class definition a match condition based on the source IP address of a packet.

Format match srcip <ipaddr> <ipmask
CODE
>
Parameter Description
< ipaddr > Specifies an IP address .
< ipmask > specifies an IP address bit mask; note that although it resembles a standard subnet mask, this bit mask need not be contiguous.
Default None
Mode Class-Map Config

match srcI4port

This command adds to the specified class definition a match condition based on the source layer 4 port of a packet using a single keyword or numeric notation or a numeric range notation.

Default None
Format match srcl4port {<port-key> | <0-65535>}
Mode Class-Map Config / IPv6-Class-Map Config
Parameter Description
<port-key> One of the supported port name keywords (listed below). The currently supported <portkey> values are: domain, echo, ftp, ftpdata, http, smtp, snmp, telnet, tftp, www. Each of these translates into its equivalent port number, which is used as both the start and end of a port range.
<0-65535> To specify the match condition as a numeric value, one layer 4 port number is required. The port number is an integer from 0 to 65535. To specify the match condition as a range, two layer 4 port numbers are required and together they specify a contiguous port range. Each port number is an integer from 0 to 65535, but with the added requirement that the second number be equal to or greater than the first.

match vlan

This command adds to the specified class definition a match condition based on the value of the layer 2 VLAN Identifier field (the only tag in a single tagged packet or the first or outer tag of a double VLAN tagged packet). The VLAN ID is an integer from 1 to 4093.

Default None
Format match vlan <1-4093>
Mode Class-Map Config
Parameter Description
<1-4093> The VLAN ID is an integer from 1 to 4093.

match secondary-vlan

This command adds to the specified class definition a match condition based on the value of the layer 2 secondary VLAN Identifier field (the inner 802.1Q tag of a double VLAN tagged packet). The VLAN ID is an integer from 1 to 4093.

Default None
Format match secondary-vlan <1-4093>
Mode Class-Map Config
Parameter Description
<1-4093> The VLAN ID is an integer from 1 to 4093.

match dstipv6

This command adds to the specified class definition a match condition based on the destination IPv6 address of a packet.

Default None
Format match dstip6 <destination-ipv6-prefix/prefix-length>
Mode IPv6-Class-Map Config
Parameter Description
<destination-ipv6-prefix/prefix-length> IPv6 address and prefix length.

match srcipv6

This command adds to the specified class definition a match condition based on the source IP address of a packet.

Default None
Format match srcip6 <source-ipv6-prefix/prefix-length>
Mode IPv6-Class-Map Config
Parameter Description
<source-ipv6-prefix/prefix-length> IPv6 address and prefix length.

match ip6flowlbl

This command adds to the specified class definition a match condition based on the IPv6 flow label value.

Default None
Format match ip6flowlbl <label>
Mode IPv6-Class-Map Config
Parameter Description
<label> IPv6 flow label value in the range of 0 to 1048575.