←back to thread

360 points pjf | 2 comments | | HN request time: 0.4s | source
Show context
notacoward ◴[] No.14299101[source]
It's almost irresponsible to write an article on this topic in 2017 without explicitly mentioning bufferbloat or network-scheduling algorithms like CoDel designed to address it. If you really want to understand this article, read up on those first.

https://en.wikipedia.org/wiki/CoDel

replies(5): >>14299422 #>>14299475 #>>14299613 #>>14301482 #>>14304236 #
throwasehasdwi ◴[] No.14299422[source]
CoDel is different from the packet scheduling algorithm even though both fight bufferbloat in different ways. CoDel is a congestion control algorithm for controlling what happens when outgoing buffers start overflowing. This is on a lower level than TCP and happens to any type of packet. The scheduling algorithm, like VEGAS or BBR, controls the transmit rate of only the TCP protocol.

When packets are being sent over the wires, the TCP scheduling algorithm (usually CUBIC, VEGAS, RENO, or now BBR) will send out packets until the parameters they monitor indicate the downstream device is about to overload. Then they will back off slightly to prevent packets from being lost. These TCP transmit strategies tend to either monitor packet loss rate or round trip time, sometimes both. What they do with these two parameters determines the biggest differences between the packet sending algorithms.

CODEL comes into affect when the scheduling algorithm decides it can't send out packets quickly enough without losing them, and they build up on local buffers. This can happen with TCP but also other internet protocols.

Something most people don't know is that without a scheduling algorithm like BBR,VEGAS, or RENO, you can send out packets at interface speed. In simpler protocols like UDP you need to do your own packet scheduling. Otherwise your machine will send out packets at interface speed until they are mostly dropped by the first slower link. This is why TCP has scheduling algorithms, they're all an attempt to monitoring the end to end link speed from A to B you can achieve without losing data.

Edit: BBR is a new TCP scheduling algorithm to fight buffer-bloat at the TCP level. Since the majority of internet traffic is TCP, wide adoption would cause a big improvement. TCP scheduling only affects outgoing packets, so its important to get this into Windows and Linux so we can get the full benefit of having buffer-bloat reduction on both ends. I'm looking at MS here because they're the last major OS running an aggressive and buffer-bloat causing TCP algorithm.

replies(4): >>14299445 #>>14299669 #>>14303111 #>>14310578 #
1. notacoward ◴[] No.14299445[source]
> CoDel is different from the packet scheduling algorithm

I didn't say they were the same. However, these two classes of algorithms interact in such complex and significant ways that it's practically impossible to understand one without understanding the other. An article about the history of one must IMO address how it has co-evolved with the other to be useful.

replies(1): >>14299529 #
2. throwasehasdwi ◴[] No.14299529[source]
They are different beasts :), and yes it's very important to understand both because they work in different ways.

Most people that know of CoDel think it's a panacea for buffer-bloat on their LAN but BBR is actually much more likely to be effective. The important distinction is that CoDel only prevents buffer-bloat on the hop where it's running. CoDel manipulates packet order in outgoing local buffers to signal the congestion control protocols at higher levels such as TCP that buffers are overflowing. The drawback of CoDel is that it only works if your router is the slowest link.

If the bottleneck link is on your modem (most are), CoDel will only help if you artificially make your router the slowest link by limiting outgoing bandwidth to slightly lower than your modem upload speed. In practice most people don't know to do this.

BBR in comparison reduces buffer-bloat along the entire path of the packet, but has its own disadvantages. First, it only works on TCP connections. Second, it helps the most if machines on both ends are using it. Each end of the TCP connection uses its own congestion control. Thirdly, it can only be applied at a machine level. If you put CoDel on your slowest link it will help all the traffic going through it, but only if the bottleneck is at that link. BBR will help prevent bufferbloat from end-to-end through all links a TCP connection flows, but only prevents TCP buffer-bloat completely on your router if every machine on the LAN is using it.

Ideally you want to use both in every place you can.