QOS Shaping -

Answered Question
May 23rd, 2008
User Badges:

I have a 100MB ethernet connection to our service provider, but am only buying 10MB of bandwidth.


I am shaping our traffic to 10MB and then applying QOS to prioritize Voice and Video and this works great.


Here is the existing running config that works just fine:


class-map match-any Voice

match ip dscp ef

class-map match-any Video

match ip dscp af41

class-map match-any Call-Control

match ip dscp cs3


policy-map QOS_classes

class Voice

priority 900

class Video

bandwidth 460

class Call-Control

bandwidth 27

class class-default

fair-queue

random-detect


policy-map Shape_QOS_classes

class class-default

shape average 10000000

service-policy QOS_classes


Now I need to limit the amount of imaging traffic (large file transfers) to 2MB going across this link. I could police the image class to 2MB, but to stay away from retransmissions when the policer drops packets, I thought I'd shape the image class instead.


class-map match-any Imaging

match access-group 151 (ACL permits TCP ports 104 and 6464)


When I add this new class to the policy-map with shaping I get this error:


VoIP-2621-MDF(config)#policy-map QOS_classes

VoIP-2621-MDF(config-pmap)#class Imaging

VoIP-2621-MDF(config-pmap-c)#shape average 2000000

GTS : Can be enabled only at the first level


So instead I added the class to the top level like:


policy-map Shape_QOS_classes

class Imaging

shape average 2000000

set dscp af11

class class-default

shape average 10000000

service-policy QOS_classes


This works well, but my question is how does adding a class with shaping at the top level affect the class-default shaping of the original bandwidth to 10MB below it?


Should I stick with policing the Image class and not have two levels of shaping?


Correct Answer by johgill about 9 years 1 month ago

I couldn't agree more with this post. He would have 2Mb/s for imaging and then an additional 10Mb/s for the other traffic.


I was checking earlier to make sure this wasn't a switch. I see this is a router, so that error message is letting you know that generic traffic shaping is not supported in child policies. The idea of hierarchical shaping is to apply relative weights and bandwidth statements all within a sub-line rate pipe.


A shaper is absolutely a policer with a big buffer, that's all - good point.


The final point here is also a good one; why not give a lower bandwidth to this imaging class within the 10Mb/s shaped class? This way you can have the minimum required bandwidth of whatever you choose but not restrict it when you have more bandwidth available.


Does that make sense?


For what it's worth, shaping within a shaper is on the roadmap. Likely in 12.4T/12.5 code. I work with switching and don't deal with much above 12.2 most days so I am not 100% on this one.


Regards,

John Gill

Correct Answer by Joseph W. Doherty about 9 years 1 month ago

What I believe you now have is the possibility of 12 Mbps outbound, 2 for images and 10 for everything else. To avoid going over the 10 Mbps, you could reconfigure the class-default to only use 8 Mbps but then the two distinct shapers couldn't use available bandwidth the other shaper isn't using. So, to be able to use the full 10 Mbps but still constrain imaging, you'll need to police it.


PS:

BTW: shapers drop packets too, although usually with more buffering than a default policier provides. The policier could (I believe) be tuned to be a bit more burst tolerant. Also, with something like file transfers of images, the queuing of a shaper isn't as advantageous.


PPS:

You might also consider, instead of trying to shape or police the image class, just provide it its own class but with the minimal bandwidth allowance. This will then permit it to transfer using all available bandwidth, but yield bandwidth to other more important traffic.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Joseph W. Doherty Fri, 05/23/2008 - 19:21
User Badges:
  • Super Bronze, 10000 points or more

What I believe you now have is the possibility of 12 Mbps outbound, 2 for images and 10 for everything else. To avoid going over the 10 Mbps, you could reconfigure the class-default to only use 8 Mbps but then the two distinct shapers couldn't use available bandwidth the other shaper isn't using. So, to be able to use the full 10 Mbps but still constrain imaging, you'll need to police it.


PS:

BTW: shapers drop packets too, although usually with more buffering than a default policier provides. The policier could (I believe) be tuned to be a bit more burst tolerant. Also, with something like file transfers of images, the queuing of a shaper isn't as advantageous.


PPS:

You might also consider, instead of trying to shape or police the image class, just provide it its own class but with the minimal bandwidth allowance. This will then permit it to transfer using all available bandwidth, but yield bandwidth to other more important traffic.

jkeeffe Tue, 05/27/2008 - 06:48
User Badges:

If I understand you correctly and provide a class with a minimum bandwidth of 2MB, then this class can use the entire bandwidth unless there is congestions, at which time it will be limited to the 2MB?

Joseph W. Doherty Tue, 05/27/2008 - 10:15
User Badges:
  • Super Bronze, 10000 points or more

"unless there is congestions, at which time it will be limited to the 2MB?"


It depends. For non-LLQ CBWFQ classes, if you configure the bandwidth to 2 Mbps, it should obtain that as a minimum. It would only be limited to 2 Mbps if all other classes allocated, with their bandwidth statements, all the possible bandwidth (i.e. totals 100%) and they all wanted their bandwidth (or more). If all other class demand isn't 100%, they divvy the bandwidth in ratios of their bandwidth statements. For instance, given:


policy-map example


class a

bandwidth 2 mbps


class b

bandwidth 6 mbps


class c

bandwidth 2 mbps


and a 10 Mbps path, if all classes wanted their bandwidth (or more), they would get 2, 6, and 2 Mbps. If, however, there was no class "b" traffic, but classes "a" and "c" wanted all they could obtain, each would obtain 5 Mbps. If there was just traffic for classes "a" and "b", again they wanted all they could obtain, class "a" would obtain 2.5 Mbps and class "b" 7.5 Mbps. If classes "b" and "c" only wanted 1 Mbps, class "a" should be able to obtain 8 Mbps.


If you still truly wanted to cap the bandwidth at 2 Mbps, even when more is available, I believe you could set the child class's bandwidth to 2 Mbps, to guarantee the minimum, and police it at 2 Mbps. (I think a policer is available within a child class when a shaper isn't.) Personally, I believe in allowing traffic to use available bandwidth as long as it moves aside for more important traffic.

Correct Answer
johgill Tue, 05/27/2008 - 07:00
User Badges:
  • Bronze, 100 points or more

I couldn't agree more with this post. He would have 2Mb/s for imaging and then an additional 10Mb/s for the other traffic.


I was checking earlier to make sure this wasn't a switch. I see this is a router, so that error message is letting you know that generic traffic shaping is not supported in child policies. The idea of hierarchical shaping is to apply relative weights and bandwidth statements all within a sub-line rate pipe.


A shaper is absolutely a policer with a big buffer, that's all - good point.


The final point here is also a good one; why not give a lower bandwidth to this imaging class within the 10Mb/s shaped class? This way you can have the minimum required bandwidth of whatever you choose but not restrict it when you have more bandwidth available.


Does that make sense?


For what it's worth, shaping within a shaper is on the roadmap. Likely in 12.4T/12.5 code. I work with switching and don't deal with much above 12.2 most days so I am not 100% on this one.


Regards,

John Gill

johgill Sat, 05/24/2008 - 06:06
User Badges:
  • Bronze, 100 points or more

What router/switch is this?


Thanks!

John Gill

jkeeffe Tue, 05/27/2008 - 06:42
User Badges:

I was testing this on a 2821 IOS 12.3(16a), but it also complains on a 7604 IOS 122-33.SRB2.



Actions

This Discussion