Explaining traffic shaping
Limiting outbound network bandwidth per client IP-address
Apr. 1, 2020 - Willem L. Middelkoop
Last month I received an automated alert indicating excessive bandwidth usage, usually a sign of trouble. When this happens, you should follow a standard incident procedure, trying to isolate the source of the traffic before shutting it down. The cause of this incident was not what I expected however... requiring a different kind of mitigation than a simple blockade.
Continue reading![Using tokens to control traffic - only passengers (or data packets) with a valid token are allowed. Tokens are returned as traffic reaches its destination.](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_04_Using-tokens-to-control-traffic-only-passengers-or-data-packets-with-a-valid-token-are-allowed-Token_500px.png)
![Bandwidth graph of AMS-IX shows a predictable pattern - notice the wave-like pattern](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_00_Bandwidth-graph-of-AMS-IX-shows-a-predictable-pattern-notice-the-wave-like-pattern_500px.png)
![Bandwidth graph with unusual spike indicating that something is wrong - you don't need to be Sherlock Holmes to find it](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_01_Bandwidth-graph-with-unusual-spike-indicating-that-something-is-wrong-you-don-t-need-to-be-Sherlock-_500px.png)
![Using the iftop tool to see bandwidth usage per connected IP-address](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_02_Using-the-iftop-tool-to-see-bandwidth-usage-per-connected-IP-address_500px.png)
![Bugs in Microsoft Outlook cause it to keep synchronising IMAP folders, a problem experienced by many people (see the number of views!)](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_03_Bugs-in-Microsoft-Outlook-cause-it-to-keep-synchronising-IMAP-folders-a-problem-experienced-by-many-_500px.png)
![Traffic must wait for tokens to become available when the maximum number of tokens is given away, enforcing the maximum concurrent traffic](/blog/2020-04-01_traffic-shaping-using-iptables-and-tc/images/i_05_Traffic-must-wait-for-tokens-to-become-available-when-the-maximum-number-of-tokens-is-given-away-enf_500px.png)