Every time you stream a video, load a web page, or send a message, your data travels as a shower of small packets. Networks are shared resources: if everyone sends at full speed at once, routers overflow and packets are dropped. Rate limiting is the discipline of shaping that chaos into something manageable.
The token bucket algorithm is the most widely deployed solution. Picture a bucket that slowly fills with tokens — one token arriving every fixed interval, up to some maximum capacity. To send a packet, you must first claim a token from the bucket. If the bucket is empty, you wait (or the packet is dropped). The result is elegant: bursts are allowed as long as saved-up tokens cover them, but the long-term average rate is strictly capped by how fast tokens refill.
Invented in the early 1980s and standardized in networking RFCs throughout the 1990s, the token bucket is not a theoretical curiosity. It lives inside every home router, cloud load balancer, API gateway, and quality-of-service policy engine on the planet. Understanding it means understanding how the internet stays usable even when everyone is on it at the same time.
Comments
Loading comments...