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

    Calculation of Policer Burst-Size Limit

    This topic covers the following information:

    Guidelines for Choosing a Burst-Size Limit

    A policer burst-size limit controls the number of bytes of traffic that can pass through a policed interface unrestricted 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.

    Junos OS implements two-color policers using a single token bucket algorithm and implements three-color policers using a dual token bucket algorithm. In both of these models, the bits-per-second rate configured as a bandwidth limit is conceptualized the token arrival rate for a token bucket, and the number of bytes configured as a policer burst-size limit is conceptualized as the bucket depth for the corresponding bucket. The number of tokens remaining in the bucket at any given time is a function of the token bucket depth and the overall traffic load. The token bucket is initially filled to capacity, and so the policer allows an initial traffic burst (back-to-back traffic at average rates that exceed the token arrival rate) up to the size of the token bucket depth. During periods of relatively low traffic (traffic that arrives at or departs from the interface at average rates below the token arrival rate), unused tokens accumulate in the bucket, but only up to the configured token bucket depth.

    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.

    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 maximum transmission unit (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 milliseconds.
    • The minimum and maximum values you can specify for a policer burst-size limit depends on the policer type (two-color, three-color, or hierarchical). For more information, see Policer Bandwidth and Burst-Size Limits.

    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.

    In cases where the line rate of the target interface is unknown, you can choose a burst-size limit based on the MTU of the traffic on the target interface.

    Burst-Size Limit Based on the Line Rate of the Interface

    To calculate the burst-size limit based on the line rate of the interface:

    • Multiply the interface line rate (in bits per second) by the amount of time (in seconds) to allow a burst of traffic at the full line rate, and then divide by 8 bits to convert from bits to bytes.

      burst-size limit in bytes  =  interface media rate  x  allowable time for bursty traffic  /  8 bits

    We recommend that you use a value of 5 ms (0.005 seconds) as the starting point for the allowable amount of time for a burst of traffic.

    Table 1 shows example calculations of burst-size limits for various physical interface types.

    Table 1: Example Calculations of Policer Burst-Size Limit

    Target Interface

    Allowed Burst Period

    Calculation of Policer Burst-Size Limit
    Based on a Target Interface Line Rate
    and an Allowed Burst Period

    Type

    Line Rate

    DS3

    45 Mbps

    5 ms

    45,000,000 bps  x  0.005 seconds  x  1 byte  /  8 bits
    =  28,125 bytes

    Fast Ethernet

    100 Mbps

    5 ms

    100,000,000 bps  x  0.005 seconds  x  1 byte  /  8 bits
    =  62,500 bytes

    Gigabit Ethernet

    1000 Mbps

    5 ms

    1,000,000,000 bps  x  0.005 seconds  x  1 byte  /  8 bits
    =  625,000 bytes

    10-Gigabit Ethernet

    10,000 Mbps

    5 ms

    10,000,000,000 bpsm   x  0.005 seconds  x  1 byte  /  8 bits
    =  6,250,000 bytes

    Burst-Size Limit Based on the MTU of Traffic on the Interface

    To calculate the burst-size limit based on the MTU of traffic on the interface:

    • Multiply the interface traffic MTU by a factor of 10 or greater. At the minimum, the burst size should be at least one interface MTU.

      burst-size limit in bytes  =  interface traffic MTU  x  10

    For example, suppose that you are configuring a policer for an interface that carries traffic with an MTU of 4700 bytes. The recommended burst-size limit is 47,000 bytes or greater.

    Published: 2012-06-18