Token Bucket Calculator

avatar

MIKROTIK TOKEN BUCKET CALCULATOR + SIMULATOR

Bucket Capacity (BC): 250.00 Mbps
Fill Time (Time): 5.56 seconds

Formulas Used

The following formulas are used in the calculation:

1. Bucket Capacity (BC)

BC = bucket-size × max-limit (Parent)

Calculates the maximum amount of data (in Mbps) that can be burst.

2. Fill Time (Time)

Time = BC / (Parent Max-limit - Token Rate)

Calculates how long (in seconds) it takes for the bucket to refill completely.

Token Bucket Behavior Simulation

This simulation visualizes the bucket filling up to its capacity and then resetting, demonstrating the calculated fill time.

Token Bucket

Current Tokens: 87.10 Mbps (Max: 250.00 Mbps)
Elapsed Time: 3.26 seconds (Emptying Time: 5.00 seconds)
Remaining Emptying Time: 1.74 seconds
Phase: Emptying

Bandwidth Usage


50.00 Mbps
Current: 50.00 Mbps
Guaranteed: 5.00 Mbps
Max Burst: 50.00 Mbps

How the Balls Represent Tokens:


  • Every **ball** is a "token" representing available bandwidth.
  • The **green balls** represent your guaranteed speed at 5.0 Mbps (Child queue Max-Limit (Mbps)).
  • The **yellow/orange balls** are extra tokens for temporary speed boosts, up to 50.0 Mbps (Parent queue Max-Limit (Mbps)). These are "burst" tokens.
  • The bucket can hold a total of **Bucket Capacity (250.00 Mbps)** tokens.
  • When you send data, tokens are "used" (balls disappear from the top of the bucket).
  • The **Token Bucket** simulation shows the bucket first **filling up** with new tokens (green balls appear from the bottom) at your 5.0 Mbps (Child queue Max-Limit (Mbps)) speed, up to its total capacity.
  • Then, it will **empty**, representing a period of high bandwidth usage at the maximum speed allowed by 50.0 Mbps (Parent queue Max-Limit (Mbps)).
  • If you need more speed than your guaranteed limit, you use yellow/orange "burst" tokens. Once they are gone, your speed returns to your guaranteed limit until more tokens accumulate.
  • The **Bandwidth Usage** bar shows your current data transfer speed, which is 5.0 Mbps (Child queue Max-Limit (Mbps)) when the bucket is filling, and 50.0 Mbps (Parent queue Max-Limit (Mbps)) when it is emptying.

Mikrotik Simple Queue With Token Bucket Script Example

# Example Mikrotik Simple Queue Script for Token Bucket
# Replace 'Global-Connection', '192.168.88.0/24', 'Client-1', and '192.168.88.10' as needed.

/queue simple add name="Global-Connection" target="192.168.88.0/24" max-limit=50M/50M bucket-size=0.1/0.1 
/queue simple add name="Client-1" target="192.168.88.10" parent="Global-Connection" max-limit=5M/5M bucket-size=5/5
PLEASE ACTIVATE YOUR EMAIL
GET FULL ACCESS
PLEASE SUBSCRIBE