QoS Traffic Shaping Explained

Hi Chris,

Before IOS 12.4(20)T you can use the shape max-buffers command to define the size of the queue. On newer IOS versions, you need to use the queue-limit command to set the buffer size that the shaper uses.

Rene

Thanks - another question, doesn’t each token represent one BYTE rather than one BIT?

Hello Chris

Each token does indeed represent one bit.

I hope this has been helpful!

Laz

Thanks Laz, is it different for Policing then? As in this article, Rene says 1 token is a byte:

When a packet arrives the policer will check if it has enough tokens in the token bucket, if so the packet will be forwarded and the policer will take the tokens out of the token bucket. So what is a ‘token’ anyway? When it comes to policing each token represents a single byte.

Hello Chris

Yes. Take a look at this Cisco documentation that compares Traffic Shaping to Traffic Policing:


The link shows a table that indicates what the Token values are, among other things. For shaping it is configured in bits per second while for policing it is in bytes.

I hope this has been helpful!

Laz

Hi Rane, I want design QOS for Enterprise network (sites &DC) connected over ISP network…how to start ,what should be my approach

Hello Vinod

A good place to start would probably be Rene’s lessons on QoS:


Now from here you can get into the specifics as far as how to implement QoS. But one of the things that you should look at before you even go over the technical stuff, is what do you want to achieve? What traffic do you want to provide QoS for? What kinds of speeds will be available on the enterprise network? Do you want to implement it for the WAN link or for the internal network or both? Will you be running voice and video over your network?

These are the kinds of questions you need to answer which will then lead you to the appropriate implementation of QoS. This will give you a good starting point from which to determine what to implement and how.

I hope this has been helpful!

Laz

Shouldn’t the vertical axis specify only Kb, not Kbps? So that you send some equal portions of traffic during the time intervals in milliseconds. Your picture could be read as if user sends at 128 Kbps during those time intervals. But does he really do that if we shape the rate to 64 Kbps? Thanks.

I mean technically we’re sending at 128Kbps during those 62.5ms intervals, but it’s easier to comprehend if you say that we are sending 16Kb of traffic during the 62.5ms interval.
Anyhow, I really enjoy the level of detail and simplicity you’re bringing in the course!

Hello Dimiry

It’s great to hear that you’re enjoying the content! As for your question, the X axis does indeed specify Kbps. The physical maximum throughput that you can achieve on this link is 128Kbps. For the time period specified, the traffic that is going through is being transmitted at a rate of 128Kbps and for the time period where nothing goes through it is being transmitted at a rate of 0 Kbps.

Think about it on a scale that we as humans are more use to. Imagine the time periods for maximum throughput weren’t 62.5ms but 5 seconds each. This means that the link would transmit data at 128Kbps for 5 seconds and then transmit nothing for 5 seconds. Over a period of 60 seconds, the result of the traffic would be the same, albeit not very practical for networking purposes. :stuck_out_tongue: . But you still need to use units of Kbps, that is, throughput, not Kb. I hope this makes it clearer. If not, feel free to ask for clarification!!

I hope this has been helpful!

Laz

Hi all,
I’m wondering if the use of BE in shaping policy can be in conflict with a inbound policer in the ISP. I mean in a 100Mbps link with 50Mbps of CIR, I set the shaping to that CIR and something more for BE (10%), in a bursty periods that BC + BE can be dropped by the strict policer (50Mbps) in the ISP?

Hello Jose

Yes indeed this can be the case. You must coordinate with the ISP so that your shaping policy on the edge of your network doesn’t send more traffic than the ISP is configured to handle especially if the ISP implements a more strict policy than your edge router. Otherwise, as you describe in your post, traffic can and will be dropped by the ISP.

I hope this has been helpful!

Laz

1 Like

Thank you Laz!
Sorry I have another question; I’m confused about what is the value I should use for BC, what exactly has to be in consideration to decide this value? In some documentation I found BC=(CIR/8)*1,5 but I guess that it can’t be a static rule, I think it should be diferent for UDP voice than TCP for example. Could you help me to clear this doubt?

Hello Jose

There’s no single answer to your question. You are correct in that the Bc that you will use will depend on the traffic that you want to shape. As mentioned in the lesson, Bc depends upon the Tc and upon the actual Committed Information Rate or the required shaped speed of the link, like so:

Bc = Tc * CIR

And Tc will depend on the kind of traffic that will be shaped. If you’re shaping voice, Tc should be around 10 ms. So Bc = 10 ms * CIR. Now if your CIR is very large like 5Mbps, then Bc will be 50 kilobits, but if your CIR is relatively small like 128kbps, then Bc = 10 ms * 128kbps = 1280 bits (remember to convert your units when calculating these values).

If you’re going to make your Tc larger because you’re only forwarding non-time-sensitive traffic, then Bc changes accordingly based on the CIR as well.

So really, you have to calculate each situation and determine which value is best.

I hope this has been helpful!

Laz

1 Like

Thank you Laz!
There is a risk if I reduce the Bc to less than 1500 bytes, right? as in that scenario the router will drop or fragment the packets with higher size than Bc.

*considering 1500 bytes the MTU

Hi Jose,

You would think so but it’s not the case. Fragmentation only occurs when the packet exceeds the MTU of the outgoing interface.

If you configure a shaper with a Bc that is lower than your packet size then the packet will still be forwarded. What probably happens behind the scenes (I don’t have there are any good debug commands to see this) is that the router probably waits multiple Tcs until the packet can be forwarded. Meanwhile, it’s stored in the buffer.

Rene

Hi,

Can you please clarify if CIR is same as CAR?

Hi Dan,

CIR and CAR basically refer to the same thing. The CAR (Committed Access Rate) terminology was used with the older rate-limit command for policing. Nowadays we use CIR (Committed Information Rate) for both policing and shaping.

Rene

Hi Rene! Thanks for your answer, it means that if we have BC=1000bytes could I take 1000bytes from the first Tc and then 500 bytes of the sencond one, to transmit my 1500Bytes packet?

Hello Jose

In this case the most likely scenario is that it waits for a total number of Tcs that are greater than or equal to the size of the MTU. So if 1 Tc can transmit a BC of 1000 bytes, then 2 Tc is >= 1500 bytes, so it transmits it then. The actual frame would not be separated between Tcs.

I hope this has been helpful!

Laz