QoS Traffic Shaping Explained

This topic is to discuss the following lesson:

Excellent post, good explanation. Both terms, shaping and policing are complex to understand.

Hi Rene, Great explanation of shaping, its quite hard to find this sort of detail in an easy to understand format. One question regarding rate-limiting vs shaping. Although rate-limiting does not buffer/queue packets, is it capable of slowing the rate to the contracted bandwidth? For example, if I have a 1GB fibre to a provider switch but only have say 50mb contracted, can I use rate-limiting to prevent the router transmitting at a 1GB clock rate or is shaping the only method of achieving this?

Hi Brendan, glad to hear you like it. Do you refer to rate-limiting on a router or switch?

On routers you have the “rate-limit” command but it’s the “legacy QoS” method of configuring policing, it can be applied inbound or outbound.

On the Catalyst Switches (eg 3560) you can use the "srr-queue bandwidth limit " to limit outgoing traffic but I believe this is a shaper.

This is one awesome posts about QoS policing and shaping .U don’t find like this many out there.And I should thank U for this.
BTW, I have few questions reg this,

1.In this example that you have demonstrated on what basis the Tc (Time Interval) value was chosen. i,e 62.5 in this case ? (62.5 + 62.5 =125).Is there any logic behind it?

Expecting the earliest reply…

Thanks in Advance,
SVP

Hi Sai,

I’m glad to hear that you like it. Cisco routers have a default Tc of 125 ms so that there are 8 intervals, not sure why they decided to go with this value. You can change it if you like it to a lower value (10 ms on most Cisco routers) which is a good idea for VoIP traffic…

Rene

Hi Rene,

Excellent Article. As far as I know, no one has explained QoS this simply and nicely. Great Job!

My only question is, if the Tc is reduced to 10 ms as you mentioned, will the data packets be fragmented? I always thought fragmentation happens only when the MTU is lesser than the packet size. Could you please throw more light on that.

Thank you again for the great post.

Mohan

Hi Mohan,

Thank you! I’m glad to hear you enjoy it. When you configure your shaper like this, it won’t automatically do fragmentation for you. On fast links (like Ethernet) setting the Tc to a low value will be enough because they are able to send packets at a very fast rate. If your Tc is too high (like 125ms default) then it will cause delay because your packets have to wait too long until the Tc expires.

On slower links you might need fragmentation (and interleaving) but it’s still something you have to configure yourself. You can use Multilink PPP for this or Frame-relay FRF.12 fragmentation for this. I’ll see if i can create some tutorials for these in the future. Here’s an example of LFI that I wrote:

I’ll see if I can write something about FRF.12 in the future.

Rene

Hi !
I have a question for you. suppose shaping occur. a packet with 1000 byte (8000 bit) come into router but router have only 2000 bit for Bc and 2000 bit for Be. what happen with router ? Please help to understand about it. Thank you

Hi Rene!

Thank you for your article it realy helps! But I have the same question as DuyLinh. Does router fragment IP packet if the packet’s size is more then Bc+Be value?

Hi Dmitriy,

No it won’t, if the packet is larger than whatever you have in your token bucket than it will be dropped.

Rene

May i know, at which cases Policer will be usefull ? At which situation we can use both Policer & shaping ?

Good question. A shaper will “buffer” your exceeding traffic while the policer will “drop” all exceeding traffic.

Anything that is time-sensitive like VoIP or realtime video should not be shaped because it adds delay. You could shape FTP traffic for example since it’s not delay-sensitive and could consume most of your bandwidth.

An ISP might use policing to enforce your contract, anything that exceeds what you pay for will be dropped by them.

Rene

1 Like

Hi Rene.Thanks for your Perfect article. Lets say traffic is passing from R1 to R2 and I configured shaping (avarage shaping 1mbps).

show policy-map interface 
 GigabitEthernet1.45 

  Service-policy output: TEST

    Class-map: class-default (match-any)  
      13774 packets, 1089848 bytes
      30 second offered rate 0000 bps, drop rate 0000 bps
      Match: any 
      Queueing
      queue limit 64 packets
      (queue depth/total drops/no-buffer drops) 0/0/0
      (pkts output/bytes output) 358/43444
      shape (average) cir 1000000, bc 4000, be 4000
      target shape rate 1000000

This is a CSR1000V and default Tc value is 4 ms

it means we have 250 section. From each section during the 4 ms , 4000 token(bit) can pass. On condition that more bits pass through the R1 druring the 4 ms , (not 4000 bit lets say 6000 bit) they wil drop. Can you explain me please, when the fragmentation will occur in this case?

Hi Kamil,

Glad to hear you like it! Fragmentation is typically only done when the IP Packet doesn’t fit in the MTU of the data link layer, it doesn’t have anything to do with shaping. When you shape and it doesn’t fit…the packet will be dropped, no fragmentation will occur.

Rene

Hi Rene,

Your explanation is really easy to understand. Do you have configuration example for policing and shaping happening at the same time ?

Thank you

BR
Taslim

Hi Taslim,

Anything in particular you are looking for? You could use policing for one traffic class and shaping for another. With policy-maps you can get pretty creative :slight_smile:

Rene

Hi Rene,

Would you be able to provide some topics to configure the shaping in Cisco router

Thank you

BR
Taslim

Hi Taslim,

I will, just added it to my list.

Rene

You are the greatest perfectionist I have ever seen :slight_smile: This site is a jewel, thx.!