Concepts / Quality of service

Quality of service

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.

A shaper delays the excess, a policer drops it
A shaper delays the excess, a policer drops it

The same burst goes into both. The shaper holds what is over the rate and sends it later, so everything arrives. The policer lets through what the bucket allows and drops the tail, which TCP must resend.

Shaping and policing both hold traffic to a rate, measured with a token bucket: a rate plus an allowed burst. A shaper queues the excess: nothing is lost, but everything behind it gets delay. A policer drops it: no delay but loss, so TCP cuts its window and resends. Providers police what enters their network; facing one, shape just under its rate so nothing reaches it to be dropped.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab