Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Determining Proper Burst Size for Traffic Policers

    This topic covers the following information:

    Policer Burst Size Limit Overview

    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.

    Effect of Burst-Size Limit

    Bursty traffic requires a relatively large burst size so that extra tokens can be allocated into the token bucket for upcoming traffic to use.

    Bursty Traffic Policed Without a Burst-Size Limit

    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)

    Burst-Size Limit Configured to Match Bandwidth Limit and Flow Burstiness

    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)

    Burst-Size Limit That Depletes All Accumulated Tokens

    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.

    Two Methods for Calculating Burst-Size Limit

    For policers configured on MX Series, M120, and M320 routers, and EX Series switches, configurable burst-size limit values range from 1 ms through 600 ms of traffic at the policer rate (the configured bandwidth limit).

    Because one burst size is not suitable for every traffic pattern, select the best burst size for an interface by performing experimental configurations. For your first test configuration, select the burst-size limit by using one of the calculation methods described in the next two sections.

    Calculation Based on Interface Bandwidth and Allowable Burst Time

    If the bandwidth of the policed interface is known, the preferred method for calculating the policer burst-size limit is based on the following values:

    • bandwidth—Line rate of the policed interface (in bps units)
    • burst-period—Allowable traffic-burst time (5 ms or longer)

    To calculate policer bandwidth in bytes:

    bandwidth  X  burst-period  /  8

    Calculation Based on Interface Traffic MTU

    If the bandwidth of the policed interface is unknown, calculate the policer burst-size limit based on the following value:

    • interface MTU—Maximum transmission unit (in bytes) for the policed interface.

    To calculate policer bandwidth in bytes:

    interface MTU  Χ  10

    Comparison of the Two Methods

    Figure 3 illustrates the relationship between the policer rate (the configured bandwidth limit) and the effective burst-size limit for the two methods of calculating the best policer burst-size limit. For the method based on interface bandwidth and allowable burst time, the correlation is labeled 5 ms. For the method based on MTU size, the correlation is labeled 10 MTU.

    Figure 3: Comparing Burst Size Calculation Methods

    Comparing Burst
Size Calculation Methods

    For a policer burst-size limit calculated using the 5 ms method, the effective burst-size limit is proportional to the configured bandwidth limit. With a very low bandwidth limit, the effective burst-size limit might be so small that the policer rate-limits traffic more aggressively than desired. For example, a traffic “burst” consisting of two MTU-sized packets might be rate-limited. In this scenario, a policer burst-size limit calculated using the 10 MTU method appears to be a better choice.

    Example: 100 Kbps Bandwidth, 100 ms Burst Duration, Gigabit Ethernet Interface

    As an example, consider a policer configured with a 100 Kbps bandwidth limit and a burst duration of 100 ms, attached to a Gigabit Ethernet interface.

    • With the 5 ms method, the burst-size limit bytes are calculated as follows:

      100 Kbps  X  100 ms  =  100,000 bps  X  0.1 sec  =  10,000 bits  =  1250 bytes

      Because the maximum configurable burst- size limit is 600 ms of the bandwidth limit, the maximum configured burst size is calculated as follows:

      100 Kbps  x  600 ms  =  100,000 bps  X  0.6 msx  =  60,000 bits  =  7500 bytes
    • With the 10 MTU method the burst-size limit bytes are calculated as follows:

      1500 bytes  X  10  =  15,000 bytes

    On the Gigabit Ethernet interface, the burst duration at line rate is calculated as follows:

    7500 bytes  /  1 Gbps  =  (7500 bytes  /  125,000,000 bytes)  X  1 sec  =  0.00006 sec  =  60 μs

    If the burst size is too large for the downstream device, the burst size can be further reduced until the result is acceptable.

    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.

    Example: 200 Mbps Bandwidth Limit, 5 ms Burst Duration

    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.

    Example: 200 Mbps Bandwidth Limit and 600 ms Burst Duration

    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-10-07