Calculating burst size for class-of-service

31 10 2014

Burst sizes need to be calculated if you are implementing policers or shapers on Junos devices so that the policer or shaper can control the flow of traffic appropriately.  Too small a burst size and TCP applications will have terrible throughput.  Too large a burst size and the policer won’t be very effective – the bursts are so large they cancel out the effect of the policing because as one burst ends another one is just about to begin.

The situation is described reasonably well on the Juniper site here, and also in O’Reilly’s excellent MX book.  But in both places the mathematics of the calculation is hidden in a paragraph of text – not written out properly and showing the workings.  That makes for confusion in my mind.

It’s actually a fairly easy calculation, but isn’t presented well.  I finally sat down to work out what it meant.

The easy way to calculate burst size for low bandwidth (i.e. T1/E1 etc) interfaces is 10 times the MTU of the interface.   The problem with this is (as you see in figure 3 in the Juniper link above) that on 1500-byte Ethernet this results in the same result, whether you’re considering a 100Mbps or a 10Gbps link.  Obviously not satisfactory.

So the recommended way to calculate it is to work out the amount of BYTES of data the link would send in 5 milliseconds.   (I capitalised the word bytes because Junos expects it to be entered in bytes per second – rather than the ‘bandwidth-limit’ which Junos expects in bits per second).

Let’s run though this for a 1Gbps link.  First, what is a gigabit per second in bits per second?

1Gbps = 1000Mbps = 1,000,000,000bps (bits per second)

What is a second in milliseconds?

1 second = 1000ms

How many bits can a 1Gig link send in 1 millisecond?

1,000,000,000 ÷ 1000ms = 1,000,000 bits in 1 millisecond

Multiply that by the recommended 5 to get the number of bits sent in 5 milliseconds:

1,000,000 x 5 = 5,000,000 bits in 5 milliseconds

There are 8 bits in a byte.  We need a figure in BYTES to put into Junos:

5,000,000 ÷ 8 = 625,000 Bytes = 625KB

All nice and easy.  Suppose we had a sub-rated logical interface we wanted to police to 75Mbps?  Let’s run through that again:

Let’s run though this for a 1Gbps link.  First, what is a gigabit per second in bits per second?

75Mbps = 75,000,000bps (bits per second)

What is a second in milliseconds?

1 second = 1000ms

How many bits can a 75Mbps link send in 1 millisecond?

75,000,000 ÷ 1000ms = 75,000 bits in 1 millisecond

Multiply that by the recommended 5 to get the number of bits sent in 5 milliseconds:

75,000 x 5 = 375,000 bits in 5 milliseconds

There are 8 bits in a byte.  We need a figure in BYTES to put into Junos:

375,000 ÷ 8 = 46,875 Bytes = 46.9KByte

Advertisements

Actions

Information

2 responses

1 01 2015
Bobby

The burst value should always be based on the physical interface speed.

27 10 2016
Zunga Lele

Thank you Bobby.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: