Can any one please explain what is the difference between shape average and shape peak in QOS.
From my understanding shape average is CIR and shape peak is max BW of link.
so is it possible if link bandwith is 64K then we can allocate shape average 256k.
peak rate is having higer capabilty to send data.
Well, shape peak allows you to continuously send data in excess of configured CIR by utilizing both Bc and Be burst sizes when scheduling the transmission. Whether that is acceptable by your provider is another issue - he may police you on the level of the CIR and the excess traffic you send will be dropped. You always have to think about the fact that not only you are pacing your packets, also your provider is, and if you exceed the contract with your provider, the packets may get remarked or dropped.
So if i have link of 64k then can i configure 256k of shape average.
If the link is 64k then you'll never get more than 64k out of it. Configuring the shaping to 256k would exceed that link's capacity by four times.
Regardless of the shape average or shape peak, the link must provide an equal or higher transmission capacity than the resulting rate of these commands.
If the link is having bw of 64K then how can it provide bw of 256k.
It can not It is just the changed algorithm of shape peak that allows to send data at a rate higher than the configured CIR but whether the link can carry that much data is up to you to verify.
and if i have a link of 256 K then how can i calculate bc and be value
These values are usually determined by a contract with your provider and are configured, not computed. In fact, you configure the CIR and you may configure the Bc and Be.
The shape peak replenishes both Bc and Be tokens every Tc seconds, and allows for sending at higher sustained rate that depends both on the size of Bc and Be. If only the Bc tokens were replenished, the sustained rate would be
CIR = Bc/Tc
With both Bc and Be tokens being replenished in shape peak, the sustained rate is
CIR' = (Bc+Be)/Tc
Expressing Tc from the first equation yields Tc=Bc/CIR, and using it in the second equation yields:
CIR' = (Bc+Be) / (Bc / CIR)=(Bc+Be) * CIR / Bc = CIR * (1 + Be/Bc)
This is the speed as indicated in the Command Reference for the shape peak command:
The shape average replenishes only the Bc tokens every Tc seconds, and hence the sustained rate is simply CIR=Bc/Tc. After periods of longer inactivity, the burst may grow up to Bc+Be bytes but it is not sustainable.
- The sustained rate in shape average is equal to CIR=Bc/Tc (the CIR is a part of the configuration command)
- The sustained rate in shape peak is equal to CIR'=CIR * (1 + Be/Bc) (the CIR is a part of the configuration command)
- Both models allow for bursting up to Bc+Be
In default configuration, Be=Bc, therefore with shape peak, the CIR'=CIR*(1+Bc/Bc)=CIR*(1+1)=2*CIR, i.e. the shape peak would result into shaping on a doubled sustained rate than the shape average command.