CUBIC TCP explained

CUBIC is a network congestion avoidance algorithm for TCP which can achieve high bandwidth connections over networks more quickly and reliably in the face of high latency than earlier algorithms. It helps optimize long fat networks.

In 2006, the first CUBIC implementation was released in Linux kernel 2.6.13.[1] Since kernel version 2.6.19,[2] CUBIC replaces BIC-TCP as the default TCP congestion control algorithm in the Linux kernel.

MacOS adopted TCP CUBIC with the OS X Yosemite release in 2014,[3] [4] while the previous release OS X Mavericks still used TCP New Reno.[5] [6]

Microsoft adopted it by default in Windows 10.1709 Fall Creators Update (2017), and Windows Server 2016 1709 update.

Characteristics

CUBIC is a less aggressive and more systematic derivative of BIC TCP, in which the window size is a cubic function of time since the last congestion event, with the inflection point set to the window size prior to the event. Because it is a cubic function, there are two components to window growth. The first is a concave portion where the window size quickly ramps up to the size before the last congestion event. Next is the convex growth where CUBIC probes for more bandwidth, slowly at first then very rapidly. CUBIC spends a lot of time at a plateau between the concave and convex growth region which allows the network to stabilize before CUBIC begins looking for more bandwidth.

Another major difference between CUBIC and many earlier TCP algorithms is that it does not rely on the cadence of RTTs to increase the window size. CUBIC's window size is dependent only on the last congestion event. With earlier algorithms like TCP New Reno, flows with very short round-trip delay times (RTTs) will receive ACKs faster and therefore have their congestion windows grow faster than other flows with longer RTTs. CUBIC allows for more fairness between flows since the window growth is independent of RTT.

Algorithm

CUBIC increases its window to be real-time dependent, not RTT dependent like BIC. The calculation for cwnd (congestion window) is simpler than BIC, too.

Define the following variables:

RFC 8312 indicates the following:

Then cwnd can be modeled by:

\begincwnd \ = \ C(T-K)^3 + w_ \\\textrm \ K = \sqrt[3]\end

See also

Apart from window based algorithms like Cubic, there are rate based algorithms (including BBR from Google) that works differently using "sending rate" instead of the window[7]

External links

Notes and References

  1. Ha. Sangtae. Rhee. Injong. Xu. Lisong. 2008. 2008. CUBIC: A New TCP-Friendly High-Speed TCP Variant. ACM SIGOPS Operating Systems Review. ACM New York, NY, USA. 42. 11. 10.1145/1400097.1400105. 9391153.
  2. Web site: [TCP]: Make cubic the default · torvalds/Linux@597811e . .
  3. Web site: apple-oss-distributions/distribution-macOS at os-x-1010. GitHub. TCP Congestion Control is implemented in the XNU Kernel, this commit references the XNU Kernel used in Mac OS X Yosemite
  4. Web site: xnu/tcp_cc.h at a3bb9fcc43a00154884a30c9080595284c26cec9 · apple-oss-distributions/xnu. GitHub. April 29, 2022. Header file of the TCP congestion control implementation of the XNU Kernel used in Mac OS X Yosemite stating CUBIC as default
  5. Web site: apple-oss-distributions/distribution-macOS at os-x-1095. GitHub. References XNU Kernel used in Mac OS X Mavericks
  6. Web site: xnu/tcp_cc.h at d2a0abf2ede8152c5a107fe51e032c1193d2015b · apple-oss-distributions/xnu. GitHub. April 29, 2022. Header file of the TCP congestion control implementation of the XNU Kernel used in Mac OS X Mavericks stating New Reno as default
  7. Web site: Congestion control, PK3C Kernel Module rate based for video streaming and data servers. GitHub. 1 Aug 2021.