cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6230
Views
13
Helpful
8
Replies

Peak vs Average Shaping

kondratev
Level 1
Level 1

Hello,

 

Am I correctly understand that 2 commands

 

shape peak 64000

and

shape average 128000

 

have the same meaning?

 

Do anybody know for what purpose Cisco implemented Peak Shaping?

1 Accepted Solution

Accepted Solutions

Hello,

 

Personally, I would not say that

shape peak 64000

and

shape average 128000

yield the same results. It has been correctly explained that the

shape peak

shapes at a higher rate because every Tc, there are Bc+Be tokens replenished into the token bucket, and thus, the overall traffic rate is

 

Real Shaping Rate = Configured Rate x (1 + Be/Bc)

 

This Real Shaping Rate of the

shape peak

can never be exceeded because you can never send more than Bc+Be bytes in an interval of Tc. Indeed, with default settings, Bc=Be, and thus the Real Shaping Rate is doubled. The

shape peak

essentially allows you to use both the committed and excess rate every Tc interval, and you therefore get sustained CIR+EIR rate.

 

The

shape average

replenishes only Bc tokens per Tc interval. Thus, the

shape average 128000

allows you for sustained rate of 128 kbps. However, after a longer period of low activity, when you accumulate enough excess tokens, you can actually burst up to the Bc+Be rate. Again, with the default settings, Bc=Be and thus the bursting would go up to 256 kbps.

 

Therefore, the

shape peak 64000

and

shape average 128000

are not equal. The

peak

will shape consistently to 128 kbps, never more, and it will allow to consistently send traffic in excess of the CIR. The

average

will shape the traffic to 128 kbps, along with allowing bursts up to 256 kbps after periods of no or low activity. Clearly, the bursting in

average

would in this case exceed even the PIR configured by your provider.

 

Best regards,

Peter

View solution in original post

8 Replies 8

IAN WHITMORE
Level 4
Level 4

Sorry for not answering your question directly but google is your friend here. There are lots of link with exmaples and explanations.

Regards,

Ian

Hi Kondratev,

 

Yes technically they yield the same..

 

shape peak 64000

actually has a sending rate of 128000 because the Bc=Be.  so

shape average 128000

is the same as

shape peak 64000

 

Now, to answer why and where

shape peak

can be used

 

For eg:

 

If the SP sells you a link with PIR=128000 and CIR=64000, then you cannot use the

shape average 128000

You have to use

shape peak 64000

If the SP sells you a link with PIR=CIR=128000 then you can use either

shape average 128000

or

shape peak 64000

however i recommend

shape average

in this case.

 

 

 

HTH,

 

Regards,

 

Please rate if helpful

Hi Kishore,

 

I don't understand why I can't use average shaping if SP sells me a link with PIR=128000 and CIR=64000?

I think I can use

shape average 128000

in this case. Am I right?

Hi Kondratev,

kondratev wrote:

Hi Kishore,

I don't understand why I can't use average shaping if SP sells me a link with PIR=128000 and CIR=64000?

I think I can use 'shape average 128000' in this case. Am I right?

you can use it but remember that the CIR is still 64000 and SP will police it at their end and start dropping packets during congestion and limit your traffic to 64000 and you will have retransmissions and latency. They will let you burst up to the PIR once you accumulate enough tokens when using the shape average

Please see the below link which will provide you some good info about how the SP's sell PIR etc.

http://blog.ine.com/2008/08/26/understanding-the-shape-peak-command/

HTH

Regards,

Please rate if helpful

Hello,

 

Personally, I would not say that

shape peak 64000

and

shape average 128000

yield the same results. It has been correctly explained that the

shape peak

shapes at a higher rate because every Tc, there are Bc+Be tokens replenished into the token bucket, and thus, the overall traffic rate is

 

Real Shaping Rate = Configured Rate x (1 + Be/Bc)

 

This Real Shaping Rate of the

shape peak

can never be exceeded because you can never send more than Bc+Be bytes in an interval of Tc. Indeed, with default settings, Bc=Be, and thus the Real Shaping Rate is doubled. The

shape peak

essentially allows you to use both the committed and excess rate every Tc interval, and you therefore get sustained CIR+EIR rate.

 

The

shape average

replenishes only Bc tokens per Tc interval. Thus, the

shape average 128000

allows you for sustained rate of 128 kbps. However, after a longer period of low activity, when you accumulate enough excess tokens, you can actually burst up to the Bc+Be rate. Again, with the default settings, Bc=Be and thus the bursting would go up to 256 kbps.

 

Therefore, the

shape peak 64000

and

shape average 128000

are not equal. The

peak

will shape consistently to 128 kbps, never more, and it will allow to consistently send traffic in excess of the CIR. The

average

will shape the traffic to 128 kbps, along with allowing bursts up to 256 kbps after periods of no or low activity. Clearly, the bursting in

average

would in this case exceed even the PIR configured by your provider.

 

Best regards,

Peter

Thank you, Peter!

You explanation is very clear!

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose.  Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind.  Usage of this posting's information is solely at reader's own risk.

 

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

 

Posting

Therefore, the shape peak 64000 and shape average 128000 are not equal. The peak will shape consistently to 128 kbps, never more, and it will allow to consistently send traffic in excess of the CIR. The average will shape the traffic to 128 kbps, along with allowing bursts up to 256 kbps after periods of no or low activity. Clearly, the bursting in average would in this case exceed even the PIR configured by your provider.

 

Shape peak 64000

will shape consistently to 128 Kbps? 

Shape average 128000

will allow bursts up to 256000?

 

My understanding, for most shapers (or policers) was peak allowed bursting (using Be) but sustained would still be what's provided by Bc.  Researched this a bit and found http://www.cisco.com/en/US/tech/tk543/tk545/technologies_tech_note09186a00800a3a25.shtml#tokenrefreshrate, which notes Bc tokens replenishment per Tc.  Similar info here: http://www.cisco.com/en/US/docs/ios/12_0/qos/configuration/guide/qcpolts.html#wp6991.

 

This is something that would be interesting to try in a lab; one method I've found to fully confirm how a Cisco feature works (at least for a specific IOS version and platform).

west33637
Level 1
Level 1

Hello Kondratev.

 

They do not have the same meaning.

 

shape peak 64000

simply means you are shaping around a CIR of 64000. If you leave this command as is, then you will have a

peak

information rate of 128kbps, but this is best effort and will only be available when there is no congestion in the ISP cloud.

 

the command is

shape peak 

bc be In the above case 64000 is the CIR.

 

Based on an agreement with your service provider, the CIR provides you with how many bits you can send per 1 second.

 

By default this 1 second is divided into 8 intervals. That is .125 seconds per interval. The bc is simply how much traffic you can send per interval based on the CIR. The bc in this case is simply the CIR divided by the number of intervals (8). You can change the bc value if you want.

 

be is equal to bc if you dont configure it. be is the excess burst used to calculate the

peak 

information rate.

 

PIR = CIR x [1 + (be/bc)]  --- Since by default bc is equal to be that means by default PIR = CIR x 2

 

So in the above scenario, the

peak

information rate would be 128kbps (CIR x 2)

 

sometimes a service provider offers you 2 rates for sending traffic. In this case, they will offer you a

peak

information rate (PIR) and a committed information rate (CIR). The CIR is a guaranteed traffic rate under the agreement. The PIR is best effort, no guarantee. The service provider will allow you to send traffic at rates up to PIR, but only guarantees CIR rate in case of network congestion.

 

so

shape peak 64000

guarantees a CIR of 64000 and offers best effort PIR of 128000 when there is no congestion in the ISP cloud.

while

shape average 128000

offers a guarantee of 128000bps.

 

Of course if the ISP guarantees you 128000bps in your agreement and they honor their agreement, then

shape peak 64000

would work with no issue because you will be able to send traffic at

peak

rate all the time. But if the ISP is not honoring their agreement of 128000, your router will drop its rate to 64000bps when there is congestion and in this case the misconfiguration will be costly.

 

pls rate if it helps!

Review Cisco Networking for a $25 gift card