# Shape Peak vs Shape Average

Member Posts: 2,111 ■■■■□□□□□□
It's been a while since i've studied Qos but getting back on the horse.

Lets say CIR = 64,000 , Tc= 125 ms => Bc = 8000

"Shape average 64000 8000 0" which means 8000 bits are allowed to be sent every 125ms

Next we add a Be = 8000

"Shape average 64000 8000 8000" which means 8000 bits are allowed every 125ms and when we send less than 8000 bits per interval, Be can accumulate tokens to allow us in the future to send 8000 bits + Be accumulated bits per Tc.

Now if we use the peak command, Bc = Be , Tc = 125ms
PIR = CIR(1+Be/Bc) => PIR = 2CIR

"Shape Peak 32000 4000 4000" this means we can send Be + Bc every Tc i.e. 4000 + 4000 = 8000 bits every Tc.

A little long winded, but my question is what is the difference between
"Shape Peak 32000 4000 4000" and "Shape Average 64000".As far as i can see there is no difference as with the peak command you guarantee Bc+Be every Tc and no marking occurs to differentiate between Bc and Be traffic.

I've looked at the following link:
Understanding the “shape peak” command - CCIE Blog

But using "shape average 128000 12800 0" " instead of the shape peak 64000 6400 6400" would yeild exactly the same result.

:edit: I'm thinking that maybe the behavior is different between these commands if congestion is detected on the egress tx-ring, under congestion maybe peak will only guaranteee Bc and not Be.
Networking, sometimes i love it, mostly i hate it.Its all about the \$\$\$\$

• Mod Posts: 11,962 Mod
This is one of the things that is confusing for me also. From what information I can find I don't see how it would behave any differently.

I haven't found a source that say that the shape peak will slow down in times of congestion, but that would be my only guess as the difference also. If anyone has any links with more info I would definitely be interested.
An expert is a man who has made all the mistakes which can be made.
• Banned Posts: 6,308 ■■■■■■■■■□
It's been a while since i've studied Qos but getting back on the horse.

Lets say CIR = 64,000 , Tc= 125 ms => Bc = 8000

"Shape average 64000 8000 0" which means 8000 bits are allowed to be sent every 125ms

Next we add a Be = 8000

"Shape average 64000 8000 8000" which means 8000 bits are allowed every 125ms and when we send less than 8000 bits per interval, Be can accumulate tokens to allow us in the future to send 8000 bits + Be accumulated bits per Tc.

Now if we use the peak command, Bc = Be , Tc = 125ms
PIR = CIR(1+Be/Bc) => PIR = 2CIR

"Shape Peak 32000 4000 4000" this means we can send Be + Bc every Tc i.e. 4000 + 4000 = 8000 bits every Tc.

A little long winded, but my question is what is the difference between
"Shape Peak 32000 4000 4000" and "Shape Average 64000".As far as i can see there is no difference as with the peak command you guarantee Bc+Be every Tc and no marking occurs to differentiate between Bc and Be traffic.

I've looked at the following link:
Understanding the “shape peak” command - CCIE Blog

But using "shape average 128000 12800 0" " instead of the shape peak 64000 6400 6400" would yeild exactly the same result.

:edit: I'm thinking that maybe the behavior is different between these commands if congestion is detected on the egress tx-ring, under congestion maybe peak will only guaranteee Bc and not Be.

Seems you yield the same result there although the operation is different. Here's some background for those interested.

Here's the skinny from Odom page 379

With peak, CB shaping changes how it decides if a packet conforms to or exceeds the traffic contract. With shape peak the shaper allows bc and be bits to be sent in each Tc interval even if there has not been a period of little or no activity.

shape average 64000

This assumes a Bc of 8000, a Be of the same value and calculates Tc of .125 seconds. Token bucket = Bc + Be or 16000 bits. Under high load 8000 bits can be sent each Tc.

shape peak 64000

Bc of 8000 bits, be of 8000 bits, Tc .125 seconds. Token bucket = Bc + Be.

However instead of replenishing the token bucket with Bc bits each Tc, shape peak tells CB shaping to replenish Bc + Be tokens per Tc. This means the shaper has the right to send the committed burst and the excess burst every time period.

shape peak 64000 actually shapes packets at a rate higher than 64Kbps.

Shaping rate = configured_rate (1+Be/Bc)

So actual shaping rate is 128 Kbps

64(1+8000/8000) = 128

I suppose the moral is that if you use either approach and use the appropriate parameters the same result is yielded.
• Registered Users Posts: 1 ■□□□□□□□□□
I think if you read the post again carefully you will find the answer.

Understanding the “shape peak” command | CCIE Blog

Read the questions at the bottom of the page

"Like i mentioned in the post, there is no real different in the maximum sending rate achieve with either of the commands. The only real benefit of “shape peak” command is to allow you better see you CIR/PIR value relation and effectively visualize traffic contract in the “show” commands output."

The difference between using shape peak and shape average command with the figures you mentioned is purely cosmetic. But it makes it easier to see the targeted rate and the average rate in show output without having to calculate them manually.

HTH
• Member Posts: 101
Turgon wrote: »
Seems you yield the same result there although the operation is different. Here's some background for those interested.

Here's the skinny from Odom page 379

With peak, CB shaping changes how it decides if a packet conforms to or exceeds the traffic contract. With shape peak the shaper allows bc and be bits to be sent in each Tc interval even if there has not been a period of little or no activity.

shape average 64000

This assumes a Bc of 8000, a Be of the same value and calculates Tc of .125 seconds. Token bucket = Bc + Be or 16000 bits. Under high load 8000 bits can be sent each Tc.

shape peak 64000

Bc of 8000 bits, be of 8000 bits, Tc .125 seconds. Token bucket = Bc + Be.

However instead of replenishing the token bucket with Bc bits each Tc, shape peak tells CB shaping to replenish Bc + Be tokens per Tc. This means the shaper has the right to send the committed burst and the excess burst every time period.

shape peak 64000 actually shapes packets at a rate higher than 64Kbps.

Shaping rate = configured_rate (1+Be/Bc)

So actual shaping rate is 128 Kbps

64(1+8000/8000) = 128

I suppose the moral is that if you use either approach and use the appropriate parameters the same result is yielded.
Turgon, this was a great explanation. I actually setup shape peak a few weeks ago on a 2811 router that was maxing it's T1 line. I set the traffic that I wanted shaped to the peak of 512000 but I couldn't figure out why it was still going at around 1mbps. I finally just replaced the shape peak with shape average, even bumped it down further to 384000 and now that traffic is being shaped at 384k max.

Thanks for your explanation that cleared it up big time!
Progress: CCIE RS Lab scheduled for Jan. 2012
Equipment: Cisco 360 program racks