Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Determining Proper Burst Size for Traffic Policers

A policer burst-size limit controls the number of bytes of traffic that can pass unrestricted through a policed interface when a burst of traffic pushes the average transmit or receive rate above the configured bandwidth limit. The actual number of bytes of bursty traffic allowed to pass through a policed interface can vary from zero to the configured burst-size limit, depending on the overall traffic load.

By configuring a proper burst size, the effect of a lower shaped rate is alleviated. Use the burst-size-limit statement to configure the burst size.

Note: If you set the burst-size limit too low, too many packets will be subjected to rate limiting. If you set the burst-size limit too high, too few packets will be rate-limited.

Consider these two main factors when determining the burst size to use:

  • The allowed duration of a blast of traffic on the line.
  • The burst size is large enough to handle the maximum transmission unit (MTU) size of the packets.

The following general guidelines apply to choosing a policer burst-size limit:

  • A burst-size limit should not be set lower than 10 times the MTU of the traffic on the interface to be policed.
  • The amount of time to allow a burst of traffic at the full line rate of a policed interface should not be lower than 5 ms.
  • The minimum and maximum values you can specify for a policer burst-size limit depends on the policer type (two-color or three-color).

Best Practice: The preferred method for choosing a burst-size limit is based on the line rate of the interface on which you apply the policer and the amount of time you want to allow a burst of traffic at the full line rate.

Bursty traffic requires a relatively large burst size so that extra tokens can be allocated into the token bucket for upcoming traffic to use. Figure 1 shows an extreme case of bursty traffic where the opportunity to allocate tokens is missed, and the bandwidth goes unused because a large burst size is not configured.

Figure 1: Bursty Traffic Without Configured Burst Size (Excessive Unused Bandwidth)

Bursty Traffic Without
Configured Burst Size (Excessive Unused Bandwidth)

Figure 2 depicts how bandwidth usage changes when a large burst size is configured to handle bursty traffic. The large burst size minimizes the amount of unused bandwidth because tokens are being allocated in between the bursts of traffic that can be used during traffic peaks. The burst size determines the depth of the token bucket.

Figure 2: Bursty Traffic With Configured Burst Size (Less Unused Bandwidth)

Bursty Traffic With Configured
Burst Size (Less Unused Bandwidth)

Configuring a large burst size for the unused tokens creates another issue. If the burst size is set to a very large value, the burst of traffic can be transmitted from the interface at line rate until all the accumulated tokens in the token bucket are used up. This means that configuring a large burst size can allow too many packets to avoid rate limiting, which can lead to a traffic rate that exceeds the bandwidth limit for an extended period of time.

If the average rate is considered within 1 second, the rate is still below the configured bandwidth limit. However, the downstream device might not be able to handle bursty traffic, so some packets might be dropped. As a result, the way to determine the best burst size configuration is to perform experimental configurations, since one burst size is not suitable for every traffic pattern.

To program the burst size on the MX Series, M120, M320 routers, and EX Series switches, the user-configured burst size value is restricted to 1 ms through 600 ms of the policer rate (configured bandwidth limit).

Before performing burst size test configurations, select the initial burst size value using one of the following:

  • The recommended formula for calculating burst size for bandwidth described as bits per second is: burst size = bandwidth x allowable time for burst traffic / 8 (5 ms of the policer rate)
  • For policers where the interface bandwidth is unknown, use the MTU method of calculating burst size: burst size = interface MTU x 10

Figure 3 depicts a comparison between the two methods.

Figure 3: Comparing Burst Size Configuration Methods: 5 ms V.S. 10 MTU

Comparing Burst
Size Configuration Methods: 5 ms V.S. 10 MTU

In Figure 3, with the 5 ms method, the burst size decreases with the policer rate (the configured bandwidth limit). As a result, the burst size can become so small that it might not be able to hold 2 MTU packets. This can severely affect the policer performance, which makes the 10 MTU method appear to be a better choice.

For example, with a 100 Kbps bandwidth limit configured on a Gigabit Ethernet interface and a burst size configured to 100 ms, the burst size becomes 100 Kbps x 100 ms = 1250 bytes. This burst size is smaller than one standard MTU payload size on an Ethernet-type interface. A 10 MTU burst size provides a burst size of 1500 bytes x 10 = 15000 bytes. However, since the maximum burst size is 600 ms of the bandwidth limit, the maximum configured burst size is 100 Kbps x 600 ms = 7500 bytes. On the Gigabit Ethernet interface, the burst duration is 7500 bytes / 1 Gbps = 60 μs at Gigabit Ethernet line rate. If the burst size is too large for the downstream device, the burst size can be further reduced until the result is acceptable.

However, if the bandwidth limit is very high, the 10 MTU method might not be able to create a token bucket large enough to accommodate the unused credits. As a result, the average bandwidth limit is lower than what you configured. In this case, the 5 ms method is the better choice for configuring the burst size.

If a 200 Mbps bandwidth limit is configured with a 5 ms burst size, the calculation becomes 200 Mbps x 5 ms = 125 Kbytes, which is approximately 83 1500-byte packets. If the 200 Mbps bandwidth limit is configured on a Gigabit Ethernet interface, the burst duration is 125000 bytes / 1 Gbps = 1 ms at the Gigabit Ethernet line rate.

If a large burst size is configured at 600 ms with the bandwidth limit configured at 200 Mbps, the calculation becomes 200 Mbps x 600 ms = 15 Mbytes. This creates a burst duration of 120 ms at the Gigabit Ethernet line rate. The average bandwidth rate in 1 second becomes 200 Mbps + 15 Mbytes = 320 Mbps, which is much higher than the configured bandwidth limit at 200 Mbps. This example shows that a larger burst size can affect the measured bandwidth rate.

Published: 2013-04-10