Junos OS

Expand all | Collapse all

Policers; token bucket algorithm - how quickly does the bucket refill?

Jump to Best Answer
  • 1.  Policers; token bucket algorithm - how quickly does the bucket refill?

    Posted 05-28-2017 09:47

    Hey guys,

     

    Reading over some old JNCIA material and trying to get my head around policers.

     

    Everything makes sense except for how often and how quickly the token bucket refills itself.

     

    My theory is that the bandwidth-limit parameter, as well as defining the allowed rate limit before the policer is activated, also defines how often and how fast the token bucket refills. For example, if you define 10m as the bandwidth-limit, the bucket will refill at 10Mb/s up to whatever you define the burst-size-limit as.

     

    This is somewhat backed up by this post here: http://forums.juniper.net/t5/Routing/Asking-about-the-burst-size-limit-parameter/m-p/223681/highlight/true#M10592 

     

    I just wanted to be sure my understanding of this topic is accurate. It's kinda difficult to comprehend as we're talking in milliseconds and examples of burst-size are always ~5ms of the interface wire speed - which in human terms is useless, because that's less than .5 of a second, but I'm thinking in terms of file transfers and I'm sure the construction of policers is very situation-specific.

     

    Anyway, I digress, the question is as above.

     

    Thanks in advance,

     

    Kindest Regards, 

     

    Andrey



  • 2.  RE: Policers; token bucket algorithm - how quickly does the bucket refill?

    Posted 05-28-2017 10:37

    Oh, one more addition to this question.

    Say we define 10mb/s as the bandwidth-limit and the interface is transmitting at 100Mb/s. Every second, the interface will successfully send 10Mb/s and drop the remaining 90Mb/s (Excluding whatever burst-size you define) or, will the interface simply drop traffic until the rate falls below 10Mb/s?

     

    I'm assuming the former behaviour is correct.

     

    Thanks in advance,

     

    Kindest Regards

     

    Andrey



  • 3.  RE: Policers; token bucket algorithm - how quickly does the bucket refill?
    Best Answer

     
    Posted 05-29-2017 06:57

    Not sure the best conceptual way to think about this, but the interface will pass the allowed bandwidth plus burst each time cycle with the overage only being dropped.

     

    Maybe these descriptions will help.

     

    http://www.juniper.net/documentation/en_US/junos11.3/topics/concept/policer-algorithm-single-token-bucket.html

     

    http://www.juniper.net/documentation/en_US/junos11.3/topics/concept/policer-algorithm-dual-token-bucket.html



  • 4.  RE: Policers; token bucket algorithm - how quickly does the bucket refill?

    Posted 05-30-2017 07:53

    Nope, that was perfect, thank you.

     

    By what you've said, my understanding is that the bucket technically completely refills every time cycle. Therefore, you don't actually define the refill rate; it's implied.

     

    In addition to this, the overage per cycle is dropped.

     

    So all of my confusion has been dispelled.

     

    Thanks again 🙂