Bufferbloat Explained

Bufferbloat is a cause of high latency and jitter in packet-switched networks caused by excess buffering of packets. Bufferbloat can also cause packet delay variation (also known as jitter), as well as reduce the overall network throughput. When a router or switch is configured to use excessively large buffers, even very high-speed networks can become practically unusable for many interactive applications like voice over IP (VoIP), audio streaming, online gaming, and even ordinary web browsing.

Some communications equipment manufacturers designed unnecessarily large buffers into some of their network products. In such equipment, bufferbloat occurs when a network link becomes congested, causing packets to become queued for long periods in these oversized buffers. In a first-in first-out queuing system, overly large buffers result in longer queues and higher latency, and do not improve network throughput. It can also be induced by specific slow-speed connections hindering the on-time delivery of other packets.

The bufferbloat phenomenon was described as early as 1985.[1] It gained more widespread attention starting in 2009.[2]

According to some sources the most frequent cause of high latency ("lag") in online video games is local home network bufferbloat. High latency can render modern online gaming impossible.[3]

Buffering

An established rule of thumb for the network equipment manufacturers was to provide buffers large enough to accommodate at least 250 ms of buffering for a stream of traffic passing through a device. For example, a router's Gigabit Ethernet interface would require a relatively large 32 MB buffer.[4] Such sizing of the buffers can lead to failure of the TCP congestion control algorithm. The buffers then take some time to drain, before congestion control resets and the TCP connection ramps back up to speed and fills the buffers again.[5] Bufferbloat thus causes problems such as high and variable latency, and choking network bottlenecks for all other flows as the buffer becomes full of the packets of one TCP stream and other packets are then dropped.

A bloated buffer has an effect only when this buffer is actually used. In other words, oversized buffers have a damaging effect only when the link they buffer becomes a bottleneck. The size of the buffer serving a bottleneck can be measured using the ping utility provided by most operating systems. First, the other host should be pinged continuously; then, a several-seconds-long download from it should be started and stopped a few times. By design, the TCP congestion avoidance algorithm will rapidly fill up the bottleneck on the route. If downloading (and uploading, respectively) correlates with a direct and important increase of the round trip time reported by ping, then it demonstrates that the buffer of the current bottleneck in the download (and upload, respectively) direction is bloated. Since the increase of the round trip time is caused by the buffer on the bottleneck, the maximum increase gives a rough estimation of its size in milliseconds.

In the previous example, using an advanced traceroute tool instead of the simple pinging (for example, MTR) will not only demonstrate the existence of a bloated buffer on the bottleneck, but will also pinpoint its location in the network. Traceroute achieves this by displaying the route (path) and measuring transit delays of packets across the network. The history of the route is recorded as round-trip times of the packets received from each successive host (remote node) in the route (path).[6]

Mechanism

Most TCP congestion control algorithms rely on measuring the occurrence of packet drops to determine the available bandwidth between two ends of a connection. The algorithms speed up the data transfer until packets start to drop, then slow down the transmission rate. Ideally, they keep adjusting the transmission rate until it reaches an equilibrium speed of the link. So that the algorithms can select a suitable transfer speed, the feedback about packet drops must occur in a timely manner. With a large buffer that has been filled, the packets will arrive at their destination, but with a higher latency. The packets were not dropped, so TCP does not slow down once the uplink has been saturated, further filling the buffer. Newly arriving packets are dropped only when the buffer is fully saturated. Once this happens TCP may even decide that the path of the connection has changed, and again go into the more aggressive search for a new operating point.[7]

Packets are queued within a network buffer before being transmitted; in problematic situations, packets are dropped only if the buffer is full. On older routers, buffers were fairly small so they filled quickly and therefore packets began to drop shortly after the link became saturated, so the TCP protocol could adjust and the issue would not become apparent. On newer routers, buffers have become large enough to hold several seconds of buffered data. To TCP, a congested link can appear to be operating normally as the buffer fills. The TCP algorithm is unaware the link is congested and does not start to take corrective action until the buffer finally overflows and packets are dropped.

All packets passing through a simple buffer implemented as a single queue will experience similar delay, so the latency of any connection that passes through a filled buffer will be affected. Available channel bandwidth can also end up being unused, as some fast destinations may not be promptly reached due to buffers clogged with data awaiting delivery to slow destinations. These effects impair interactivity of applications using other network protocols, including UDP used in latency-sensitive applications like VoIP and online gaming.[8]

Impact on applications

Regardless of bandwidth requirements, any type of a service which requires consistently low latency or jitter-free transmission can be affected by bufferbloat. Such services include digital voice calls (VOIP), online gaming, video chat, and other interactive applications such as radio streaming, video on demand, and remote login.

When the bufferbloat phenomenon is present and the network is under load, even normal web page loads can take many seconds to complete, or simple DNS queries can fail due to timeouts.[9] Actually any TCP connection can timeout and disconnect, and UDP packets can get discarded. Since the continuation of a TCP download stream depends on acknowledgement (ACK) packets in the upload stream, a bufferbloat problem in the upload can cause failure of other non-related download applications, because the client ACK packets do not timely reach the internet server.

Detection

The DSL Reports Speedtest[10] is an easy-to-use test that includes a score for bufferbloat. The ICSI Netalyzr[11] was another on-line tool that could be used for checking networks for the presence of bufferbloat, together with checking for many other common configuration problems.[12] The service was shut down in March 2019. The bufferbloat.net web site lists tools and procedures for determining whether a connection has excess buffering that will slow it down.[13] [14]

Solutions and mitigations

Several technical solutions exist which can be broadly grouped into two categories: solutions that target the network and solutions that target the endpoints. The two types of solutions are often complementary. The problem sometimes arrives with a combination of fast and slow network paths.

Network solutions generally take the form of queue management algorithms. This type of solution has been the focus of the IETF AQM working group.[15] Notable examples include:

Notable examples of solutions targeting the endpoints are:

The problem may also be mitigated by reducing the buffer size on the OS and network hardware; however, this is often not configurable and optimal buffer size is dependent on line rate which may differ for different destinations.

Utilizing DiffServ (and employing multiple priority-based queues) helps in prioritizing transmission of low-latency traffic (such as VoIP, videoconferencing, gaming), relegating dealing with congestion and bufferbloat onto non-prioritized traffic. [20]

Optimal buffer size

For the longest delay TCP connections to still get their fair share of the bandwidth, the buffer size should be at least the bandwidth-delay product divided by the square root of the number of simultaneous streams.[21] A typical rule of thumb is 50 ms of line rate data,[22] but some popular consumer grade switches only have 1 ms,[23] which may result in extra bandwidth loss on the longer delay connections in case of local contention with others.

See also

External links

Notes and References

  1. Web site: 1985-12-31 . On Packet Switches with Infinite Storage .
  2. Web site: Understanding Bufferbloat and the Network Buffer Arms Race . 2011-01-07 . 2011-11-12 . . Iljitsch . van Beijnum .
  3. Queue . Bufferbloat: Dark Buffers in the Internet: Networks without effective AQM may again be vulnerable to congestion collapse . 10.1145/2063166.2071893. 18820360 . free .
  4. Web site: Sizing Router Buffers . 2004 . 2013-10-15 . Guido Appenzeller . Isaac Keslassy . Nick McKeown . ACM SIGCOMM . ACM.
  5. Web site: Controlling Queue Delay . Kathleen Nichols . Nichols . Kathleen . Van Jacobson . Jacobson . Van . ACM Queue . ACM Publishing . 2012-05-06 . 2013-09-27.
  6. Web site: traceroute(8) – Linux man page . 2013-09-27 . die.net.
  7. Congestion avoidance and control . ACM SIGCOMM Computer Communication Review . Jacobson, Van . Karels, MJ . 1988 . 18 . 4 . 314–329 . 10.1145/52325.52356 . dead . https://web.archive.org/web/20040622215331/http://www.cord.edu/faculty/zhang/cs345/assignments/researchPapers/congavoid.pdf . 2004-06-22 .
  8. Web site: Technical Introduction to Bufferbloat . 2013-09-27 . Bufferbloat.net.
  9. Bufferbloat: Dark Buffers in the Internet . Gettys . Jim . Nichols . Kathleen . ACM . January 2012 . Communications of the ACM . 57–65 . 55 . 1 . 10.1145/2063176.2063196 . free .
  10. Web site: Speed test - how fast is your internet?. dslreports.com. 26 October 2017.
  11. Web site: ICSI Netalyzr. berkeley.edu. 30 January 2015. https://web.archive.org/web/20190407211303/http://netalyzr.icsi.berkeley.edu/. April 7, 2019. dead.
  12. Web site: Understanding your Netalyzr results. 26 October 2017.
  13. Web site: Tests for Bufferbloat. bufferbloat.net. 26 October 2017.
  14. Web site: Introduction to Bufferbloat. bufferbloat.net. 8 May 2023.
  15. Web site: IETF AQM working group. ietf.org. 26 October 2017.
  16. Pan. Rong. Natarajan. Preethi. Piglione. Chiara. Prabhu. Mythili. Subramanian. Vijay. Baker. Fred. VerSteeg. Bill. 2013 IEEE 14th International Conference on High Performance Switching and Routing (HPSR). PIE: A Lightweight Control Scheme To Address the Bufferbloat Problem. 2013. 2013 IEEE 14th International Conference on High Performance Switching and Routing (HPSR) . 148–155. IEEE. 10.1109/HPSR.2013.6602305. 978-1-4673-4620-7.
  17. Høiland-Jørgensen. Toke. McKenney. Paul. Taht. Dave. Gettys. Jim. Dumazet. Eric. The FlowQueue-CoDel Packet Scheduler and Active Queue Management Algorithm. 8290 .
  18. Web site: DOCSIS "Upstream Buffer Control" feature. CableLabs. 554–556. 2012-08-09.
  19. USENIX - The Advanced Computing Systems Association. 978-1-931971-38-6. 2017 USENIX Annual Technical Conference (USENIX ATC 17). 139–151. Høiland-Jørgensen. Toke. Kazior. Michał. Täht. Dave. Hurtig. Per. Brunstrom. Anna. Ending the Anomaly: Achieving Low Latency and Airtime Fairness in WiFi. 2017-09-28. 2017. source code.
  20. Web site: Hein. Mathias. Bufferbloat » ADMIN Magazine. 2020-06-11. ADMIN Magazine. en-US.
  21. Web site: Huston . Geoff . 2019-12-12 . Sizing the buffer . 2022-10-16 . APNIC Blog . en-US.
  22. Web site: Router/Switch Buffer Size Issues . 2022-10-16 . fasterdata.es.net.
  23. Web site: BCM53115 . 2022-10-16 . www.broadcom.com . en.