Priority Shaper

Earlier, when the priority of a queue at Per-Hop Behavior (PHB) was propagated all the way up the hierarchy towards the channel level, the PHB classes that had priority at PHB level would only be prioritized over other classes of subchannels. To avoid this, Priority Shaper feature is implemented.

Priory Shaper feature helps to balance the packet drops between the streams when multiple steams egress out of a priority queue. Egress QoS policy is supported on Priority Shaper.

You can configure priority shaper in one of the following ways:

  • Strict priority—You can apply one shaper per policy. Use the priorityshaper-value command to configure strict priority.

  • Priority levels—You can apply two priority levels per policy.

You can view in the following show run policy-map command on how the priority levels are used to configure the shaper.


router#show run policy-map pq_test
Building configuration...

Current configuration : 590 bytes
!
policy-map pq_test
class qg1
priority level 1 percent 20
queue-limit percent 10
class qg0
priority level 2 percent 10
queue-limit percent 10
class qg2
bandwidth remaining percent 15
queue-limit percent 10
class qg3
bandwidth remaining percent 20
queue-limit percent 10
class qg4
bandwidth remaining percent 25
queue-limit percent 10
class qg5
bandwidth remaining percent 10
queue-limit percent 10
class qg6
bandwidth remaining percent 25
queue-limit percent 10
class class-default
bandwidth remaining percent 5
queue-limit percent 10
!
end

Restrictions for Priority Shaper

  • Priority Shaper is supported only for PHB level classes.

  • Egress QoS Policy map with Priority Shaper can be applied only on the member interface of port channel and not at the logical level.

  • Policer configuration is not supported with the Priority Shaper configuration under same class map.

  • Priority Traffic Latency is increased during congestion with Priority Shaper configuration at Q level. Configure the queue limit with a lesser value for the priority queue to reduce the latency of priority traffic.

  • If the packet is from a 10G interface to a 1G interface, the burstiness is introduced. Due to this, dequeuing rate of this strict priority queue may be sometimes more than enqueuing. As a result, very few packet counters are seen in other queues.

Configuring Priority Shaper

Perform the following steps to configure Priority Shaper.

Procedure


Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

class-map class-map-name

Example:

Device(config)#class-map class_priority

Configures class map and specifies the name of the class map to be created.

Step 4

match qos-group number

Example:

Device(config-cmap)# match qos-group 1

Matched different PHBs for different class maps.

Step 5

policy-map policy-map-name

Example:

Device(config)#policy-map shape_priority

Configures the policy map.

Step 6

class class-map-name

Example:

Device(config-pmap)#class class_priority

Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map that is created earlier.

Step 7

priority level <level 1/2 > percent <percentage 1-100 > or priority level <level 1/2> <kbps> <burst size>

Example:

Device(config-pmap-c)# priority <1-10000000> Kilo Bits per second
Device(config-pmap-c)# priority Percent <1-100>
Device(config-pmap-c)# priority level <1-2> <1-10000000> Kilo Bits per second
Device(config-pmap-c)# priority level <1-2> percent <1-100>

Assigns priority to a traffic class at the priority level specified.

Note 
level is the level of priority assigned to the priority class. Valid values are 1 (high priority) and 2 (low priority). The default value is 1. Do not specify the same priority level for two different classes in the same policy map.
Step 8

interface interface-type interface-number

Example:

Device(config)# interface gigabitethernet 0/0/1

Specifies the port to attach to the policy map and allows to enter the interface configuration mode. Valid interfaces are physical ports.

Step 9

service-policy output policy-map-name

Example:

Device(config-if)# service instance 1 ethernet
Device(config-if-srv)# service-policy output shape_priority

Applies output policy to the interface.

Note 
You can also attach the service policy over the service instance.
Step 10

end

Example:

Device(config)#end

Returns to privileged EXEC mode.


Configuration Examples for Priority Shaper

This section shows sample configurations for Priority Shaper.

Example: Configuring Priority Shaper

The following is a sample configuration for priority shaper.

Device(config)#class-map match-any class_level1
Device(config-cmap)#match qos-group 1
Device(config-cmap)#match qos-group 2
Device(config-cmap)#class-map match-any class_level2
Device(config-cmap)#match qos-group 3
Device(config-cmap)#match qos-group 4
Device(config-cmap)#class-map match-any class_bw
Device(config-cmap)#match qos-group 5
Device(config-cmap)#end

.
Device(config)#policy-map shape_priority
Device(config-pmap)#class class_level1
Device(config-pmap-c)#priority level 1 per 10
Device(config-pmap-c)#class class_level2
Device(config-pmap-c)#priority level 2 per 20
Device(config-pmap-c)#class class_bw
Device(config-pmap-c)#bandwidth remaining percent 70
Device(config-pmap-c)#end


Device(config)#interface GigabitEthernet0/0/3
Device(config-if)#load-interval 30
Device(config-if)#service-policy input shape_priority
Device(config-if)#end

Verifying Priority Shaper

Use the following command to verify that the Priority Shaper feature is configured on your interface.
Device# show policy-map interface TenGigabitEthernet0/0/2
show policy-map interface TenGigabitEthernet0/0/2
TenGigabitEthernet0/0/2 
 
  Service-policy output: shape_priority

    queue stats for all priority classes:
      Queueing
      priority level 1
      queue limit 3932 us/ 49152 bytes
      (queue depth/total drops/no-buffer drops) 49476/44577300/0
      (pkts output/bytes output) 2348138/1202246656

    queue stats for all priority classes:
      Queueing
      priority level 2
      queue limit 1966 us/ 49152 bytes
      (queue depth/total drops/no-buffer drops) 51072/42228358/0
      (pkts output/bytes output) 4697080/2404904960

    Class-map: class_priority (match-any)  
      46925438 packets, 24025824256 bytes
      30 second offered rate 1871849000 bps, drop rate 1778171000 bps
      Match: qos-group  1 
      Match: qos-group  2 
      Priority: 10% (100000 kbps), burst bytes 2500000, b/w exceed drops: 44577300
      
      Priority Level: 1 

    Class-map: class_priority_level2 (match-any)  
      46925438 packets, 24025824256 bytes
      30 second offered rate 1871849000 bps, drop rate 1684485000 bps
      Match: qos-group  3 
      Match: qos-group  4 
      Priority: 20% (200000 kbps), burst bytes 5000000, b/w exceed drops: 42228358
      
      Priority Level: 2 

    Class-map: class_bw (match-any)  
      23462719 packets, 12012912128 bytes
      30 second offered rate 935925000 bps, drop rate 281045000 bps
      Match: qos-group  5 
      Queueing
      queue limit 393 us/ 49152 bytes
      (queue depth/total drops/no-buffer drops) 49476/7045085/0
      (pkts output/bytes output) 16417634/8405828608
      bandwidth remaining 70%

    Class-map: class-default (match-any)  
      0 packets, 0 bytes
      30 second offered rate 0000 bps, drop rate 0000 bps
      Match: any 
      
      queue limit 393 us/ 49152 bytes
      (queue depth/total drops/no-buffer drops) 0/0/0
      (pkts output/bytes output) 0/0