# Traffic Shaping. Understanding auto generation of Tc/Bc values

Mar 16th, 2009
• Silver, 250 points or more

Hi All

My question relates to the auto generation of the Tc / Be value when using traffic shaping

within IOS and class based shaping. I am using the command :-

Shape average x

The formula is as below :-

Tc = Bc / CIR

Bc = Tc * CIR

I came across some Cisco documentation that says that the Bc will be 1/8 of the CIR by default therefore giving a Tc value of 125. I also understand that the minimum value for Tc must be =>10 (unless using DTS on the 7500) and <=125.

The majority of my testing has been on a 7206 VXR running 12.4, on Ethernet/Fastethernet/Serial interfaces and none of the above seems to be true.

Ethernet and Fast Ethernet seem to use a Tc value of either 25ms or sometimes 24ms no matter what I set the CIR value to, and the serial Tc value is all over the place.

I can force a Tc value by specifying the Bc as an argument in the shape average command, but should I be doing this?

I guess my questions are as followg :

1. Can I calculate the Bc and Tc values using a formula before I enter the shape average command, or do I need to enter the command then type show policy-map interface x

2. How is IOS calculating the values by default?

Correct Answer by Joseph W. Doherty about 8 years 4 months ago

#2 I believe it varies per platform and IOS. I believe I've noticed the latest 12.4T default is 4ms(?).

(NB: Also on the latest IOSs, believe there are new options for specification of parameters. One, I believe, now supports a specification in milliseconds.)

#1 Yes, you can precalculate. If I remember correctly, if you divide the second or third parameter (Bx in bits) by the first paramter (CIR in bps), it will provide the Tc (i.e. Tc = Bx/CIR - your first formula).

Assuming you want a desired Tc (and the IOS doesn't support the parameter is ms), use your 2nd formula, Bc = Tc * CIR.

e.g.

given a desire for 15 milliseconds and 2.5 Mbps

Bc = .015 * 2500000 = 37500

PS:

I'm not at a Cisco device, at the moment, to confirm #1 answer. If I'm incorrect, let me know. (I might be missing some bits vs. bytes or confusing what parameter represents what, but you can precalculate.)

Overall Rating: 5 (1 ratings)

## Replies

Joseph W. Doherty Mon, 03/16/2009 - 05:09
• Super Bronze, 10000 points or more

#2 I believe it varies per platform and IOS. I believe I've noticed the latest 12.4T default is 4ms(?).

(NB: Also on the latest IOSs, believe there are new options for specification of parameters. One, I believe, now supports a specification in milliseconds.)

#1 Yes, you can precalculate. If I remember correctly, if you divide the second or third parameter (Bx in bits) by the first paramter (CIR in bps), it will provide the Tc (i.e. Tc = Bx/CIR - your first formula).

Assuming you want a desired Tc (and the IOS doesn't support the parameter is ms), use your 2nd formula, Bc = Tc * CIR.

e.g.

given a desire for 15 milliseconds and 2.5 Mbps

Bc = .015 * 2500000 = 37500

PS:

I'm not at a Cisco device, at the moment, to confirm #1 answer. If I'm incorrect, let me know. (I might be missing some bits vs. bytes or confusing what parameter represents what, but you can precalculate.)

adamclarkuk_2 Mon, 03/16/2009 - 07:05