Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member


Hi Guys,

My question is about MDRR on ASR9Ks.

It is my understanding that ASR9Ks (and CSR12K) platforms support only MDRR scheduling technique. Now, MDRR can operate in one of two modes when configured with Priority Queue - Strict Priority mode, and Alternate mode.


My questions are-

1. What mode does ASR9K use for PQ? What command can be used to check this mode?

2. Is the mode and Quantum/Weight configurable? Can we check this using a show command?

3. Consider this - If mode is Strict Priority and there are 3 queues - Queue1 (Priority queue), Queue2 (normal queue) and Queue3 (normal queue). If the Quantum value is high enough (based on MTU and Weight) and Queue1 always has packets, will Queue2 and Queue3 always starve? 

4. Consider the same scenario as [3] but with Alternate mode.


Your comments will be appreciated.



Everyone's tags (2)
Cisco Employee

Correct, the QOS scheduler in

Correct, the QOS scheduler in the NPU is closest to the MDRR way of operating.

When a priority queue is configured it gets served until all packets are drained of that queue (so strict), so it is imperative to have a policer on this queue to ensure that it can't starve teh other queues.

Some XR releases enforce the need of a policer, but if you want to create a strict prio queue, then you can use a policer with a rate of 100% or set the exceed/violate actions to transmit.

The weight of shaped queues is derived from their assigned bandwidth of the circuit (parent) shaper. But you can affect that weight by using the bw remaining option.

Your scenario "3" is indeed why you would want a policer on the PQ to make sure that it wont starve the other guys.

It doesnt do alternate mode; for as long as there are packets in the PQ it gets served. PQ-1 before PQ-2 before the remaining bw is weighted shared over the shaped queues. Whatever is left after that, is for the class-default.

You can see the hw programming of the queues with the command:

show qos interface <intf> <direction> Example below.

If you like to understand this output more or get some more guidance on QOS, see the article on this forum "quality of service architecture asr9000" and also check cisco live 2904 from orlando last year and sanfran this year. (available for download from the ciscolive websites.



RP/0/RSP0/CPU0:A9K-BNG#show qos int g 0/0/0/0 out
Wed Jun 18 08:57:35.949 EDT
Interface: GigabitEthernet0_0_0_0 output
Bandwidth configured: 200000 kbps Bandwidth programed: 200000 kbps
ANCP user configured: 0 kbps ANCP programed in HW: 0 kbps
Port Shaper programed in HW: 200000 kbps
Policy: xtp Total number of classes: 4
Level: 0 Policy: xtp Class: class-default
QueueID: N/A
Shape CIR : NONE
Shape PIR Profile : 0/4(S) Scale: 195 PIR: 199680 kbps  PBS: 2496000 bytes
WFQ Profile: 0/9 Committed Weight: 10 Excess Weight: 10
Bandwidth: 0 kbps, BW sum for Level 0: 0 kbps, Excess Ratio: 1
Level: 1 Policy: xt Class: m2
Parent Policy: xtp Class: class-default
QueueID: 137 (Priority 2)
Queue Limit: 8 kbytes Abs-Index: 6 Template: 0 Curve: 6
Shape CIR Profile: INVALID
Policer Profile: 57 (Single)
Conform: 600 kbps (600 kbps) Burst: 7500 bytes (0 Default)
Child Policer Conform: TX
Child Policer Exceed: DROP
Child Policer Violate: DROP
Level: 1 Policy: xt Class: m1
Parent Policy: xtp Class: class-default
QueueID: 138 (Priority Normal)
Queue Limit: 40 kbytes (150 packets) Abs-Index: 14 Template: 0 Curve: 0
Shape CIR Profile: INVALID
WFQ Profile: 0/253 Committed Weight: 1937 Excess Weight: 1937
Bandwidth: 100000 kbps, BW sum for Level 1: 100000 kbps, Excess Ratio: 1
Level: 1 Policy: xt Class: class-default
Parent Policy: xtp Class: class-default
QueueID: 139 (Priority Normal)
Queue Limit: 126 kbytes Abs-Index: 29 Template: 0 Curve: 0
Shape CIR Profile: INVALID
WFQ Profile: 0/0 Committed Weight: 1 Excess Weight: 1
Bandwidth: 0 kbps, BW sum for Level 1: 100000 kbps, Excess Ratio: 1

Xander Thuijs CCIE #6775 Principal Engineer ASR9000, CRS, NCS6000 & IOS-XR
New Member

Hi Alexander,Thank you for

Hi Alexander,

Thank you for replying. I would like to extend this discussion bit more using the output you provided.

Okay, so from Cisco Press book -

Bytes Dequeued (Quantum) = Number of bytes a queue can serve in each round

Deficit Counter = Number of bytes served by a queue in each round


Also from the book,

Bytes Dequeued = MTU+(Configured Weight-1)*512

If we use this formula and the output above, the values come out as (ignoring the Shaping rate of Parent Policy, and assuming an interface MTU of 9000 bytes) -


Class : m2 (Priority Queue)

bytes dequeued = 7500 bytes = Bc

Class : m1

Quantum = 9000 + (1937-1)*512 = 1000232 bytes

Class : class-default

Quantum = 9000 + (1-1)*512 = 9000 bytes


Due to Strict Priority mode, Class m2 will always be served in each round and depending on the data in the queue, 7500 bytes of data will always be dequeued first.

Question : If I had another Class configured with Priority Level-2, would that be served next?


Then packets from Class m1 will be dequeued until the deficit counter reaches 0 or negative.

Question : Since Queue Limit is 40Kbytes (from output), what happens to the packets that cannot be accomodated in this queue? What role is played by bandwidth configured under the Class since we have the Quantum and Deficit Counter values?


Question : Does this leave enough time to serve Class class-default?


- AB


Cisco Employee

That what you described AB,

That what you described AB, is MDRR to the "T". But the scheduler inside this NPU operates in somewhat different.

The pmap definition is below for reference, it is a parent shaper at 200M and a child class at 100M and a PQ of 600k. Worst case in that model is that class-default has about 99.4M

shaped classes use a token bucket that is by default refreshed every 4msec (Tc) for the bw worth of tokens. If there are no tokens left at a dequeue cycle the packet is buffered and in this config we buffer up to 150 packets (which in the end converts to an x number of bytes worth of packet buffer memory.

The bandwidth command on a class creates a queue and its rate defines the token number refresh at every "Tc".

Shaped classes at the same priority level are dequeued at their weighted rate to retain fairness between the same (low priority) classes.






RP/0/RSP0/CPU0:A9K-BNG#sh run policy-map xt
Thu Jun 19 07:31:47.711 EDT
policy-map xt
 class m2
  priority level 2
  police rate 600 kbps
 class m1
  bandwidth 100 mbps
  queue-limit 150 packets
 class class-default

RP/0/RSP0/CPU0:A9K-BNG#sh run policy-map xtp
Thu Jun 19 07:31:51.467 EDT
policy-map xtp
 class class-default
  service-policy xt
  shape average 200 mbps

Xander Thuijs CCIE #6775 Principal Engineer ASR9000, CRS, NCS6000 & IOS-XR
CreatePlease to create content