I have a question about QoS with multiple classes. In our switch with IOS-XE we use five classes to define QoS. Class 1 is a priority class so configured “priority level 1”. The remaining bandwidth of the link must be divided over the four remaining classes. This is done by the command “bandwidth remaining ratio 4” in class 2 to 5. This works OK. But what I want is also to shape the traffic in class 2 to 25% of the link speed. So I want the remaining bandwidth evenly divided over class 2 to 5 but make sure class 2 doesn’t use more than 25% of the link speed. I tried to use a child-policy map in class 2 that shaped the traffic to a quarter of the link speed but got the following error when I tried to configure the child policy-map: “Unsupported hierarchical policy.. Two level queuing policies are not supported!!”

Are my wishes possible to configure in IOS-XE?


policy-map testqos
  class q1
    priority level 1
  class q2
    bandwidth remaining ratio 4
  class q3
    bandwidth remaining ratio 4
  class q4
    bandwidth remaining ratio 4
  class q5
    bandwidth remaining ratio 4
  • You should edit your question to include the configuration.
    – Ron Maupin
    Oct 14, 2016 at 15:06

1 Answer 1


If you want class q2 to use up to, but no more than, 25% of the link speed, you need to use policing. Something like:

  class q2
    bandwidth percent 25
    police cir percent 25 conform-action transmit exceed-action drop


You can create a shaping policy for the physical interface that calls your policy map:

!***** QoS - Generic Traffic Shaping *****
policy-map testshaping
 description Physical Interface Shaping
  class class-default
    shape average <SHAPE RATE> <SHAPE BC>
    service-policy testqos

You probably want to shape to a percentage of your actual link rate if your WAN bandwidth is a sub-rate of the interface speed. For instance, if your interface is a 1 Gb interface, but your WAN bandwidth is only 10 Mb, you probably want to shape to something like 95% of the 10 Mb (shape rate = 9500000, shape BC = 38000) to account for protocol overhead. If you use a real-time protocol like VoIP that has a lot of very small packets, you will want to decrease the percentage. You don't need to do that for a full-rate WAN bandwidth.

Apply the shaping policy to the physical interface instead of your original policy map. The shaping policy calls your original policy map.

  • Thank you Ron for your answer. I tested the configuration and it worked perfectly.
    – CmrNtw
    Oct 18, 2016 at 7:41
  • A disadvantage of using policing is that more packets get dropped compared to traffic shaping. That is why I tried to configure shaping instead of policing. When I try to configure shaping in a class (for example class q2) which also contain a bandwidth command (bandwidth remaining percent 33) the following error is shown: Bandwidth and shape cannot coexist in the same class. My question: why can't I use "bandwidth remaining" (to configure a minimum bandwidth) and "shape average" (to configure a maximum bandwidth) in the same class?
    – CmrNtw
    Oct 18, 2016 at 7:46
  • Based on your requirement of not exceeding 25% of the bandwidth, you need to police. Shaping would actually let that class burst over 25%, while policing does not. Shaping really needs to be done on the physical interface. See my edit for how to do shaping using your policy map.
    – Ron Maupin
    Oct 18, 2016 at 13:45
  • Thanks Ron for your answer. If I understand it correctly the class “class-default” contains all traffic that is not classified in any other class that is included in the same policy-map. This means that all the traffic going out on the physical port is inside class “class-default” and is shaped and after that the “testqos” service policy is applied. The policy-map “testshaping” doesn’t take the priority of class “q1” in account for example. Can I say that policy-map “testshaping” is applied on all traffic instead of only shaping traffic in class “q2”?
    – CmrNtw
    Oct 24, 2016 at 10:38
  • It have been playing around with hierarchical policy-maps but only got it working in class “class-default”. Using a policy-map in another class than “class-default” resulted in an error. Is that correct?
    – CmrNtw
    Oct 24, 2016 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.