Modern TCP on Linux
Summary
At the Chemnitz Linux Days 2016, Jörg Rödel, a kernel developer at SUSE, explained the structure and functioning of modern TCP in the Linux kernel. The talk covered methods for detecting and recovering from packet loss and algorithms for congestion avoidance. Questions such as “Why does Linux use CUBIC instead of Reno?” and “What is TCP Fast Open?” were at the centre.
What congestion control means
TCP ensures that data arrives completely and in the right order. To do so, it has to estimate how fast it may send without overloading the network. Congestion control algorithms take on this task. The classic Reno method halves the sending rate at every packet loss and then only increases it slowly, which wastes a lot of bandwidth on fast links over long distances.
Since 2006 Linux has used CUBIC as the default, which raises the sending rate again more quickly after a loss. Proportional Rate Reduction improves recovery after losses, and TCP Fast Open allows data to be sent during connection setup, which speeds up repeated connections.
What came next
At the end of 2016, a few months after the talk, BBR, a method developed by Google, entered the kernel with Linux 4.9. BBR does not go by packet losses but measures the bandwidth and round-trip time of the connection. On links with occasional losses, such as mobile networks, this can be considerably faster.
Ideas
- Congestion control decides how fast TCP may send.
- Classic methods use packet loss as a signal of overload.
- TCP Fast Open saves one round trip of waiting for repeated connections.
Insights
- A protocol from the 1970s is still being developed constantly today.
- The choice of congestion control algorithm can strongly influence the speed of a connection.
Facts
- CUBIC has been the default congestion control algorithm in Linux since 2006.
- BBR entered the kernel with Linux 4.9 at the end of 2016.
- The speaker was Jörg Rödel from SUSE.
References
Remarks
- Jörg Rödel, then at AMD, had spoken about KVM at the Chemnitz Linux Days in 2007.
Recommendations
- Use sysctl net.ipv4.tcp_congestion_control to check which method your system uses.
- Test BBR on servers with many remote clients before enabling it permanently.
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.