Time to Empty a Token Bucket in Policing Environment

There are various types of methods to manage bandwidth including Traffic Shaping and Traffic Policing. In this blog I will be discussing the time it takes to empty a Token Bucket in a Traffic Policing environment.Knowing the time to empty the token bucket in a traffic policing environment is important when measuring bandwidth capacity as it tells you the minimum amount of time required to run a bandwidth capacity measurement test.  And that means you can minimize the impact to users and applications on the network or run your tests more frequently.

The time to empty a bucket in a policing environment is dependant on the ratio of Bucket Size (aka Burst) to Policing Bandwidth divided by the Sending Bandwidth minus one.


t is Time to empty bucket (seconds) SP is the ratio of Sending Bandwidth to Policing Bandwidth BP is the ratio of Bucket Size (aka Token Bucket or Burst) to Policing Bandwidth




You have enabled bandwidth management on your router using traffic policing with the following configuration:

- Policing Bandwidth of 3Mbps (375 kBps)

- Bucket size (aka burst) of 512kB

The data is being sent at a:

- Sending Bandwidth rate of 10Mbps (1,250 kBps).


BP = 512 kB / 375 kBps = 1.365

SP = 1250 kBps / 375 kBps = 3.333

and Time to Empty bucket (t) is:



t=0.585 seconds

Further Reading

Token Bucket: http://en.wikipedia.org/wiki/Token_bucket Bandwidth Management: http://en.wikipedia.org/wiki/Bandwidth_management Shaping vs Policing: http://blog.internetworkexpert.com/2008/07/03/at-a-glance-the-difference-between-shaping-and-policing/ Comparing Shaping vs Policing: http://www.cisco.com/en/US/tech/tk543/tk545/technologies_tech_note09186a00800a3a25.shtml Technical guide with sample configurations: http://mynetworkingwiki.com/index.php/Traffic_Policing_and_Shaping

JavaScript (node.js) Software Engineers

Sinefa Demo Now Available on All Accounts