Concepts / TCP performance

TCP performance

Shaping and policing

Also called traffic shaping, policing, policer, token bucket, tbf, rate limit, htb

Two ways to hold traffic to a rate: a shaper queues the excess, a policer drops it.

Both measure traffic against a token bucket: a rate plus an allowed burst. A shaper delays what exceeds it, so TCP sees a slower path and loses nothing. A policer drops the excess at once, so TCP halves its window, resends, and runs in a saw-tooth. Policing needs no queue, so providers police what enters their network; shaping suits traffic you send, and shaping just under a line's rate moves the queue to a router that can prioritise. The price of each shows on other packets: a shaper's queue adds delay to everything behind it, a policer adds none but loss. Facing a provider's policer, shape a little under its rate so nothing reaches it to be dropped.

See it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab