redzilla
All tools
Performance

Token Bucket (Shaping)

Enter the CIR and Bc (or the interval Tc) and I compute the token-bucket model: interval Tc, tokens per interval, sustainable maximum burst and whether an X-byte burst passes. The basis of shaping/policing QoS.

Mbps
Define the bucket by
bits

Bits added to the bucket on each Tc interval. The bucket never exceeds Bc.

bytes

An S-byte burst passes if S × 8 ≤ Bc (worst case: bucket full with Bc tokens).

Examples
redzilla.cl — shape
 
Interval Tc
Max sustainable burst
Verified CIR (Bc/Tc)
tokens per second
Tc
Bc
Max burst

Does the burst pass?

How it's computed · token bucket

1. The interval Tc = Bc / CIR × 1000 (ms). On each Tc, Bc bits of tokens are added to the bucket, which is capped at Bc.

2. There are 1000 / Tc intervals per second; multiplied by Bc they yield CIR bits/s. Hence CIR = Bc / Tc holds.

3. The sustainable max burst in one shot is Bc bits (= Bc / 8 bytes): whatever fits in the full bucket.

4. An S-byte burst passes if S × 8 ≤ Bc. Under shaping the excess is queued and sent later; under policing it is dropped or remarked. To admit larger bursts, raise Bc (or use Be, excess burst, in dual-bucket models).

Runs locally in your browser · no sign-up · nothing leaves your browser

Was this tool useful?
Disclaimer We take great care to keep every tool accurate and review it thoroughly; even so, we can't guarantee it is free of errors or take responsibility for how the results are used. We recommend double-checking anything critical.
Found an error? Let us know →