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.
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