Fixing bufferbloat on your home network with OpenBSD 6.2 or newer
It&#x27;s discouraging to me that, 33 years after I first identified this problem [1], there are no good solutions in wide use.<p>Informally, the basic problem is that pure datagram networks with no backpressure, which describes the Internet, handle congestion badly. A big first-in, first-out queue at a choke point works especially badly. That&#x27;s &quot;bufferbloat&quot;.<p>Back in 1985, I proposed &quot;fair queuing&quot; (a term I coined) as a step to a solution.
Fair queuing is simply identifying &quot;flows&quot; (packets with the same endpoints, which may be 
IP addresses or TCP&#x2F;UDP ports), giving them individual queues, and servicing the queues fairly.  I also proposed making TCP congestion-aware, a new idea at the time.[2] That was enough to deal with the problems of the 1980s and 1990s.  I did not forsee a future where people would be trying to run Netflix, Fortnite, and VoIP on the same cable modem connection at the same time.<p>The Internet works only because most of the congestion is at the edges, where the user&#x27;s LAN feeds an ISP connection with less bandwidth than LAN. Most packets are lost there. If they&#x27;re lost further upstream (say at the cable headend), the problems are much worse. We still can&#x27;t deal with congestion in the middle of the network. Fortunately, fiber optic bulk bandwidth is cheap enough to prevent that from being the big bottleneck.<p>Most of the &quot;bufferbloat&quot; aftermarket fixes work by assuming the ISP connection has a fixed data capacity. So the user-side gear does rate-limiting, reordering, and dropping packets to handle congestion locally, to prevent the dumb FIFO queue in the ISP&#x27;s edge router from building up. This can work if the ISP connection has constant outgoing bandwidth. If that varies, as on an overloaded cable segment, there&#x27;s going to be trouble. And, of course, the ISP connection doesn&#x27;t tell the user side nodes it&#x27;s congested. So there&#x27;s a lot of guessing and tweaking involved, which is why none of these fixes Just Work.<p>There are two levels of troublesome FIFO queue - within each host on the LAN, and at the router that connects to the ISP link. Each host has to decide what to send first. The default is FIFO, which, as noted, sucks. Then the router has to decide which packets from which local nodes to send up the ISP link first.  Most ISP-provided routers are still FIFO, although some are more intelligent. A basic property of FIFO queues is that the one who sends the most wins. The nice guys who aren&#x27;t blasting stuff up the pipe get squeezed out. This is why your VoIP stutters.<p>So there&#x27;s a trend towards front-ending the ISP&#x27;s router with another box to do traffic-shaping, which means reordering and dropping packets. That&#x27;s what this article is about. 
There are commercial &quot;gamer routers&quot; which do this, and firmware for various routers.<p>Now, with the ability to shape the traffic, the question is what to do.  Basic fair queuing prevents a big stream from squeezing out a small stream. That&#x27;s step one, and that&#x27;s what the parent article is talking about. He&#x27;s stopped Speed Test from squeezing out his pings.<p>But that may not be enough.  If one node is frantically making large numbers of short HTTP connections, the usual case for an ad-heavy and tracker heavy web page, those may all look like separate flows to the router and get a big fraction of the bandwidth. That&#x27;s no good. 
Now you have to start defining policy rules, which is a huge pain.<p>Some of the &quot;gamer routers&quot; come with policy rules that know too much about specific games. Move and shoot packets get priority over texture updates.  It&#x27;s often enough to prioritize UDP packets over TCP until a UDP flow hits some relatively low bandwidth limit.  If you can give a game low latency for the most important 5% of its traffic, it will often play well.<p>Arguably, each host on the local network should prioritize its own outgoing traffic, leaving the next router upstream to deal with prioritization between nodes. But that requires each node to know something about what the next router upstream is doing. There&#x27;s no mechanism for this. All players are guessing what the other players are doing by observing round trip time and latency.
They don&#x27;t talk to each other about this.<p>And that is why this area is still a mess.<p>John Nagle<p>[1] <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc970" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc970</a>
[2] <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc896" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc896</a>