Marking and Policing Commands

This chapter describes the commands to configure marking and policing.

set dscp

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

set dscp [tunnel] dscp-value

no set dscp [tunnel] dscp-value

Syntax Description

tunnel

(Optional) Sets the DSCP on the outer IP header. This command is available on Layer 3 interfaces in the ingress direction.

dscp-value

Number from 0 to 63 that sets the DSCP value. Reserved keywords can be specified instead of numeric values.

Command Default

No default behavior or values

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

After the DSCP bit is set, other quality-of-service (QoS) services can then operate on the bit settings. The set dscp is supported only in the ingress direction.

The network gives priority (or some type of expedited handling) to marked traffic. Typically, you set the DSCP value at the edge of the network (or administrative domain); data then is queued based on the DSCP value.

Task ID

Task ID

Operations

qos

read, write

Examples

In this example, the DSCP ToS byte is set to 6 in the policy map called policy-in. All packets that satisfy the match criteria of class1 are marked with the DSCP value of 6. The network configuration determines how packets are marked.


RP/0/ (config)# policy-map policy-in 
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# set dscp 6
  

set discard-class

To set the discard class and Quality of Service (QoS) group identifiers on IP Version 4 (IPv4) or Multiprotocol Label Switching (MPLS) packets, use the set discard-class command in policy map class configuration mode. To leave the discard-class values unchanged, use the no form of this command.

set discard-class discard-class-value

no set discard-class discard-class-value

Syntax Description

discard-class-value

Discard class ID. An integer 0 to 1, to be marked on the packet.

Command Default

No default behavior or values

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The set discard-class command associates a discard class ID with a packet. After the discard class is set, other QoS services such as Weighted Random Early Detection (WRED) can operate on the bit settings.

Discard-class indicates the discard portion of the per hop behavior (PHB). The set discard-class command is typically used in Pipe mode. Discard-class is required when the input PHB marking is used to classify packets on the output interface.

The set discard-class command is supported only in the ingress direction. Unconditional discard-class marking is supported.

The discard-class values can be used to specify the type of traffic that is dropped when there is congestion.


Note

Marking of the discard class has only local significance on a node.


Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to set the discard class value to 1 for packets that match the MPLS experimental bits 1:


RP/0/(config)# class-map cust1
RP/0/(config-cmap)# match mpls experimental topmost 1
RP/0/(config-cmap)# exit
RP/0/(config)# policy-map policy2
RP/0/(config-pmap)# class cust1
RP/0/(config-pmap-c)# set discard-class 1
RP/0/(config-pmap-c)# exit
RP/0/(config-pmap)# exit
RP/0/(config)# interface HundredGigE 0/1/0/0
RP/0/(config-if)# service-policy input policy2
  

set precedence

To set the precedence value in the IP header, use the set precedence command in policy map class configuration mode. To leave the precedence value unchanged, use the no form of this command.

set precedence [tunnel] value

no set precedence [tunnel] value

Syntax Description

tunnel

(Optional) Sets the IP precedence on the outer IP header.

value

Number or name that sets the precedence bits in the IP header. Range is from 0 to 7. Reserved keywords can be specified instead of numeric values.

Command Default

No default behavior or values

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

Precedence can be set using a number or corresponding name. After IP Precedence bits are set, other QoS services can then operate on the bit settings.

The set precedence command is supported only in the ingress direction. Unconditional precedence marking is supported.

The network gives priority (or some type of expedited handling) to the marked traffic. IP precedence can be set at the edge of the network (or administrative domain) and have queueing act on it thereafter.

The mapping from keywords such as 0 (routine) and 1 (priority) to a precedence value is useful only in some instances. That is, the use of the precedence bit is evolving. You can define the meaning of a precedence value by enabling other features that use the value. In the case of high-end Internet QoS, IP precedences can be used to establish classes of service that do not necessarily correspond numerically to better or worse handling in the network.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to set the IP precedence to 5 (critical):


RP/0/(config)# class-map class1
RP/0/(config-cmap)# match dscp ipv4 customer1
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# set precedence 5
RP/0/(config-pmap-c)# exit
RP/0/(config-pmap)# exit

RP/0/(config)# interface HundredGigE 0/1/0/9
RP/0/(config-if)# service-policy input policy1
  

set qos-group

To set the quality of service (QoS) group identifiers on packets, use the set qos-group command in policy map class configuration mode. To leave the QoS group values unchanged, use the no form of this command.

set qos-group qos-group-value

no set qos-group qos-group-value

Syntax Description

qos-group-value

QoS group ID. An integer from 1 to 7, to be marked on the packet.

The qos-group-value is used to select a CoSQ and eventually to a VOQ

Command Default

No group ID is specified.

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The set qos-group command is supported only in the ingress direction.

The set qos-group will be used as internal priority to choose the queue on the egress port.

In the ingress policy-map, in order to designate the traffic class to a certain CoSQ other than CoSQ 0, the class-map needs to have an explicit set qos-group x statement, where 'x' is the CoSQ in the range of 0 to 7. The default COSQ is 0. In the egress policy-map, a class-map with a corresponding match qos-group x will allow further Quality of Service actions to be applied to the traffic class. For example,

class-map prec1
  match prec 1
 
policy-map test-ingress
  class prec1
    set qos-group 1
    police rate percent 50
 
 
class-map qg1
  match qos-group 1
 
 
policy-map test-egress
  class qg1
    shape average percent 70

Task ID

Task ID

Operations

qos

read, write

Examples

This example sets the QoS group to 5 for packets that match the MPLS experimental bit 1:


RP/0/(config)# class-map class1
RP/0/(config-cmap)# match mpls experimental topmost 1
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# set qos-group 5
RP/0/(config-pmap-c)# exit
RP/0/(config-pmap)# exit

RP/0/(config)# HundredGigE interface 0/1/0/0
RP/0/(config-if)# service-policy input policy1