Available on crate feature
std only.Expand description
Token Bucket Pacer
Smooths out traffic bursts by enforcing a uniform send rate.
Instead of socket.send() dumping N packets at once (causing router queue buildups),
the pacer spreads packets uniformly over the RTT interval.
§Design
Uses a Token Bucket algorithm:
- Tokens replenish at
ratebytes per second - Each send consumes
packet_sizetokens - If no tokens are available, the send is delayed
The pacer operates in conjunction with the BandwidthEstimator which feeds
the target rate. When BBR says “send at X MB/s”, the pacer enforces that rate.
Structs§
- Pacer
- Token Bucket Pacer