Cisco – Use bandwidth and shape concurrent

ciscoqos

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?

Configuration:

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

Best Answer

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

Edit:

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.