CUBIC TCP
CUBIC is a loss-based congestion control algorithm for the Transmission Control Protocol (TCP) that uses a cubic function to adjust the congestion window, enabling better scalability and stability in high-bandwidth, long-distance networks compared to the linear increase of traditional TCP Reno.[1] Developed by researchers Sangtae Ha, Injong Rhee, and Lisong Xu, CUBIC was first proposed in 2005 and published in 2008 as an improvement over earlier high-speed TCP variants like BIC-TCP, aiming to balance aggressive window growth for large bandwidth-delay products (BDPs) with TCP-friendliness in standard networks.[2] Its core mechanism involves a cubic window growth function, W(t) = C (t - K)^3 + W_{\max}, where C = 0.4, K is derived from the last congestion window W_{\max}, and t is the time since the last loss event, allowing rapid increase in the convex region far from congestion and conservative growth in the concave region near it.[1] Upon detecting packet loss via duplicate acknowledgments, Explicit Congestion Notification (ECN), or timeouts, CUBIC reduces the window by a factor of \beta = 0.7, promoting faster convergence to fairness among competing flows.[1] To ensure compatibility with legacy TCP, CUBIC operates in distinct phases: a Reno-friendly region for small windows matching Reno's additive increase/multiplicative decrease (AIMD), followed by the cubic profile for larger windows, and incorporates hybrid slow-start (HyStart++) to accelerate initial ramp-up in high-BDP scenarios.[1] This design achieves RTT-fairness, where throughput scales inversely with round-trip time (RTT), and provides better utilization in networks with BDPs exceeding 80,000 packets, such as 10 Gbps links with 100 ms RTT, without excessive aggressiveness toward standard TCP flows.[1] CUBIC has been the default TCP congestion control in the Linux kernel since version 2.6.19 in 2006 and is widely deployed across operating systems, including Windows and macOS, making it one of the most prevalent TCP variants on the internet.[3][1] It was initially documented as an informational RFC 8312 in 2018 and advanced to standards track in RFC 9438 in 2023, updating TCP specifications in RFC 5681.[1]Introduction
Overview and Purpose
CUBIC TCP is a loss-based congestion avoidance algorithm for the Transmission Control Protocol (TCP) that adjusts the congestion window (cwnd)—the limit on the number of unacknowledged packets in flight—using a cubic function based on the time elapsed since the last congestion event.[4] In standard TCP congestion control, the cwnd regulates data transmission rates to prevent network overload, primarily through phases like slow start and congestion avoidance, where the latter employs an additive increase/multiplicative decrease (AIMD) strategy to probe for available bandwidth while responding to packet losses as congestion signals.[5] The primary purpose of CUBIC is to enable high throughput in networks with large bandwidth-delay products (BDP), such as high-speed internet backbones, where traditional TCP variants struggle to utilize available capacity efficiently.[5] For instance, in environments with 10 Gbps links and 100 ms round-trip times, standard Reno TCP may take over an hour to ramp up to full utilization due to its linear cwnd growth of one packet per round-trip time.[4] CUBIC addresses this by accelerating cwnd growth post-congestion, allowing faster convergence to high sending rates while preserving compatibility with legacy TCP flows through its AIMD foundation and a multiplicative decrease factor of 0.7.[5] By design, CUBIC mitigates the aggressiveness of prior high-speed TCP proposals, which often unfairly compete with standard flows or exhibit RTT-dependent biases, ensuring equitable bandwidth sharing across diverse network conditions without excessive oscillations.[4] This evolution from variants like BIC-TCP simplifies complex growth phases into a single cubic curve, enhancing both scalability and fairness.[4]Development History
CUBIC TCP was first presented in February 2005 at the PFLDnet workshop by researchers Sangtae Ha and Injong Rhee from North Carolina State University, along with Lisong Xu from the University of Nebraska–Lincoln, and formally published in 2008 in their seminal paper titled "CUBIC: A New TCP-Friendly High-Speed TCP Variant," published in ACM SIGOPS Operating Systems Review.[2][4] The proposal aimed to address key limitations in prior high-speed TCP variants, particularly BIC-TCP, whose binary search-based window growth function often caused persistent oscillations and suboptimal performance in high-bandwidth delay product (BDP) networks.[2] By introducing a cubic function for congestion window adjustment, CUBIC sought to enhance stability, TCP-friendliness, and fairness among competing flows while maintaining compatibility with standard TCP Reno in high-BDP scenarios.[2] An early version of CUBIC was implemented experimentally in the Linux kernel starting with version 2.6.13 in 2006 as a high-speed TCP variant, with its adoption as the default congestion control algorithm occurring in kernel version 2.6.19, released in November 2006.[6] This integration replaced BIC-TCP, which had been the default in prior kernels, and marked CUBIC's initial deployment in production environments despite the paper's later release.[2] Over subsequent years, the algorithm underwent refinements in the Linux kernel, including fixes for scaling issues in the original implementation and enhancements to its behavior under varied network conditions.[2] Following its Linux adoption, CUBIC saw broader integration into other major operating system stacks after 2008, becoming the default in Windows starting with version 10's Fall Creators Update in 2017 and in macOS starting with OS X Yosemite in 2014.[7][8] A significant milestone came in August 2023 with the publication of RFC 9438 by the Internet Engineering Task Force (IETF), which formally standardized CUBIC for fast and long-distance networks, obsoleting the earlier RFC 8312 and affirming its widespread use across Linux, Windows, and Apple ecosystems.[7]Algorithm Description
Congestion Window Adjustment
CUBIC TCP operates through distinct phases to manage the congestion window (cwnd), including slow start for initial growth, congestion avoidance for steady-state probing, and loss detection with recovery for handling congestion signals.[5] In slow start, cwnd increases exponentially by one full-sized segment per acknowledged segment until it reaches the slow start threshold (ssthresh), at which point the algorithm transitions to congestion avoidance; this phase leverages either HyStart++ or traditional Reno slow start mechanisms to quickly probe available bandwidth without prior loss information.[5] During congestion avoidance, following the slow start phase or after recovery from loss, cwnd grows according to a function of the elapsed time (t) since the last congestion event, designed to provide smooth and aggressive increases that approach and plateau near the previous maximum window size (W_max).[5] This time-based adjustment allows CUBIC to scale effectively in high-bandwidth-delay product networks by accelerating growth when below W_max and slowing it as it nears this target, ensuring the window probes capacity without excessive oscillations.[5] The cubic function underlying this growth contributes to TCP-friendliness by balancing responsiveness with fairness to standard TCP flows.[5] Packet loss is detected through standard signals such as three duplicate acknowledgments, explicit congestion notification (ECN) echoes, or recent acknowledgment with recent congestion (RACK-TLP) timeouts, triggering a multiplicative decrease in cwnd.[5] Upon such a signal, cwnd and ssthresh are both reduced to β times the current cwnd, where β is set to 0.7 to retain 70% of the pre-loss window for quicker recovery while mitigating further congestion.[5] Additionally, a virtual target W_max is established based on the reduced window to guide subsequent growth, and if fast convergence is enabled, this virtual W_max is further adjusted downward if it exceeds the prior maximum to accelerate convergence among multiple CUBIC flows.[5] CUBIC integrates seamlessly with core TCP recovery mechanisms, including Reno-style fast recovery and fast retransmit, where lost packets are retransmitted upon receiving three duplicate ACKs, and the window is temporarily inflated during recovery to maintain throughput.[5] It also supports selective acknowledgments (SACK) to enable more precise loss recovery by identifying and retransmitting only lost segments within a window, reducing unnecessary retransmissions.[5] Round-trip time (RTT) samples play a crucial role in CUBIC's adjustments by providing estimates of network conditions; the smoothed RTT, as per RFC 6298, is used to normalize the time-based growth function and compute the target cwnd after each RTT, ensuring that window increases remain responsive to varying delays.[5] This RTT dependency helps CUBIC adapt its aggression level, slowing increases in high-latency environments to avoid over-probing while leveraging low-latency feedback for faster utilization.[5]Key Parameters and Formulas
The core congestion avoidance mechanism in CUBIC TCP is defined by the cubic window growth function, which determines the target congestion window size based on the elapsed time since the last congestion event. The formula is given by W_{\text{cubic}}(t) = W_{\max} + C (t - K)^3, where t is the elapsed time in seconds since the start of the current congestion avoidance epoch (excluding idle periods), W_{\max} is the congestion window size immediately before the most recent window reduction, C is a scaling constant that controls the aggressiveness of the growth (default value 0.4), and K is the time in seconds at which the function reaches W_{\max}, calculated as K = \sqrt{{grok:render&&&type=render_inline_citation&&&citation_id=3&&&citation_type=wikipedia}}{\frac{W_{\max} (1 - \beta)}{C}}. Here, \beta is the multiplicative decrease factor applied upon congestion detection (default 0.7), ensuring the window starts at \beta W_{\max} when t = 0. This cubic form provides a concave growth curve approaching W_{\max} (for t < K), promoting stability by slowing the increase rate near the previous maximum, followed by convex growth beyond W_{\max} (for t > K) to support high-bandwidth utilization.[9] The derivation of the cubic function approximates the throughput equation of TCP Reno, W / \text{RTT}, to ensure TCP-friendliness by matching Reno's equilibrium response function around the operating point W_{\max}. Specifically, the constant C = 0.4 is empirically tuned such that the average window increase rate near W_{\max} aligns with Reno's linear increase of approximately 1 per round-trip time (RTT), assuming a reference RTT; this allows CUBIC flows to coexist fairly with Reno flows under similar conditions. Upon congestion, W_{\max} is updated to the current window size before applying the reduction \text{cwnd} \leftarrow \beta \cdot \text{cwnd}, and a new epoch begins with the recalculated K.[9] To adapt to varying network delays and maintain TCP-friendliness, the parameter C is effectively scaled in implementation by incorporating the current smoothed RTT when projecting the target window over the next RTT interval: the target is computed as W_{\text{cubic}}(t + \text{RTT}), where RTT is the measured round-trip time in seconds. This dynamic adjustment ensures the growth rate remains proportional to the inverse of RTT, mirroring Reno's behavior across different delay profiles without altering the base constant C. In cases following idle periods, CUBIC employs an additive increase factor \alpha (default 1.0) to restart window growth conservatively, applying a linear increase of \alpha / \text{cwnd} per acknowledgment until the cubic function takes over, preventing excessive probing after inactivity. This \alpha value is selected to align with standard TCP restart behavior while preserving responsiveness.Characteristics and Design Principles
TCP-Friendliness and Fairness
CUBIC TCP is designed to be TCP-friendly, meaning its throughput approximates that of standard TCP Reno under similar packet loss rates, as demonstrated through analysis of their response functions, which show equivalent average congestion window sizes in networks with small bandwidth-delay products (BDPs).[1] In particular, CUBIC employs a "Reno-friendly region" in its window growth function, where it emulates Reno's linear increase to ensure comparable performance and prevent excessive bandwidth consumption in lossy environments.[4] The fairness mechanisms in CUBIC leverage the shape of its cubic congestion window curve, which begins with a slow, Reno-like growth phase immediately after a congestion event, only accelerating after the window surpasses the previous maximum to avoid starving short flows or legacy TCP Reno flows.[4] This initial conservative phase promotes equitable resource sharing by allowing competing flows to establish themselves before CUBIC ramps up aggressively in high-bandwidth, low-loss scenarios.[1] Intra-protocol fairness among multiple CUBIC flows is achieved through the symmetric nature of the cubic growth function, enabling flows with the same round-trip time (RTT) to converge to equal bandwidth shares regardless of statistical variations in packet scheduling.[1] Simulations confirm that such flows stabilize at fair allocations within a reasonable timeframe in controlled tests.[4] Inter-protocol fairness with legacy TCP Reno is supported by experimental results showing that CUBIC flows claim no more than a modest excess of bandwidth in mixed environments, utilizing spare capacity without severely impacting Reno performance.[4] A key design trade-off involves the multiplicative decrease factor β, set to 0.7 in CUBIC compared to Reno's 0.5, which reduces window oscillations and enhances stability but necessitates precise tuning of the cubic scaling parameter to mitigate potential over-aggressiveness in convergence during low-multiplexing conditions.[1] This higher β slows recovery after losses, promoting better coexistence with Reno but requiring careful parameter selection to balance responsiveness and fairness.[4]Behavior in Different Network Conditions
CUBIC TCP is designed to adapt effectively to high bandwidth-delay product (BDP) networks, where traditional linear window growth struggles to utilize available capacity efficiently. In such environments, the cubic window growth function enables rapid congestion window (cwnd) ramp-up through its convex profile when far from the last congestion point, allowing CUBIC to probe and exploit bandwidth aggressively without excessive overshoot. This approach outperforms the slow linear increases of standard TCP variants in long-fat networks, achieving high link utilization while maintaining stability by transitioning to a concave increase near the maximum window size (W_max), thus avoiding buffer overflow.[4][10] In low-latency or short-distance networks, such as local area networks with small BDPs, CUBIC falls back to behavior resembling TCP Reno. When the current cwnd is close to W_max, the cubic function approximates Reno's linear increase, ensuring compatibility and preventing over-aggressiveness that could disrupt short RTT environments. This TCP-friendly mode limits the additive increase parameter (α) to match standard TCP throughput, typically achieving similar performance without fairness issues in low-delay settings.[4][5] CUBIC demonstrates robustness in lossy environments, such as wireless links prone to random packet losses unrelated to congestion. The multiplicative decrease factor β = 0.7 reduces the cwnd to 70% upon loss detection—less severe than Reno's 50% halving—enabling faster recovery and sustained throughput compared to more conservative variants. However, in scenarios with frequent losses, this can lead to potential underutilization, as CUBIC interprets all losses as congestion signals.[10][5] To handle idle network periods effectively, CUBIC employs an adjustable α parameter in its TCP-friendly region, set using the formula [3 × (1 - β) / (1 + β)] ≈ 0.53 for β = 0.7, which boosts the initial window increase after inactivity. This aggressive ramp-up quickly probes available capacity once transmission resumes, excluding idle time from the congestion epoch calculation to avoid inflated growth estimates. Such adaptation ensures rapid convergence post-idle without relying on RTT measurements.[10][5] In buffer bloat scenarios with large drop-tail queues, CUBIC's concave growth phase near W_max contributes to reduced queue buildup relative to exponential-growth variants like HighSpeed TCP. By slowing the window increase as it approaches saturation, CUBIC minimizes overshoot and induced losses, thereby lowering latency spikes during convergence, though it may still fill buffers in unmanaged networks without active queue management.[4][5]Comparisons and Alternatives
Relation to Other TCP Variants
CUBIC TCP evolved directly from BIC-TCP, refining its predecessor's binary search increase mechanism by replacing it with a smoother cubic probing function that approximates BIC's behavior while reducing window size oscillations and enhancing overall stability.[4] This evolution simplifies BIC's complex probing phases—such as slow start, fast probing, and max probing—into a single cubic equation for congestion avoidance, eliminating the need for window clamping and improving convergence speed without sacrificing TCP-friendliness.[5] As a result, CUBIC addresses BIC's limitations in RTT fairness and deployment complexity, making it more suitable as a default algorithm in diverse network environments.[4] In comparison to earlier loss-based variants like Reno and NewReno, CUBIC retains the core packet loss detection and multiplicative decrease upon congestion but introduces a more aggressive window growth during the avoidance phase, particularly beneficial for high-speed, long-distance networks with large bandwidth-delay products.[4] At low congestion window sizes and short round-trip times, CUBIC closely mimics Reno's linear increase to ensure fairness with legacy flows, preventing it from dominating bandwidth in mixed deployments.[5] This design balances compatibility with traditional TCP implementations while scaling more effectively in modern high-bandwidth scenarios where Reno's slow recovery proves insufficient.[4] Relative to High-Speed TCP (HSTCP), CUBIC adopts a less aggressive concave increase function, which reduces its tendency to unfairly starve standard Reno flows in shared links, thereby promoting better coexistence in heterogeneous networks.[4] HSTCP's steeper response function leads to higher throughput in isolation but exacerbates intra-protocol unfairness and RTT bias; CUBIC mitigates these issues through its cubic curve, which plateaus near the congestion point for smoother adjustments and improved TCP-friendliness across varying RTTs.[4] More recent alternatives include TCP BBR, a model-based algorithm that uses delay and bandwidth estimates for congestion control, often outperforming CUBIC in varying loss conditions but requiring more complex implementation. As of 2023, BBR is deployed in Google services and some Linux kernels.[11]Performance Evaluations
The original evaluation of CUBIC TCP, conducted through ns-2 simulations and Linux kernel implementations, demonstrated significant throughput improvements over TCP Reno in high bandwidth-delay product (BDP) networks. In ns-2 simulations on a 500 Mbps link with 100 ms round-trip time (RTT), CUBIC achieved significantly higher utilization than Reno (e.g., reaching full utilization in minutes versus hours for Reno) while maintaining TCP-friendliness.[4] Linux tests on a dumbbell topology with a 400 Mbps bottleneck link showed low RTT variance, with four CUBIC flows utilizing 72% of the bandwidth and four Reno flows utilizing 23%, resulting in 95% overall link utilization. These results highlighted CUBIC's ability to converge to high utilization within 200 seconds for two flows on a 400 Mbps link. Real-world benchmarks using Linux testbeds confirmed CUBIC's robustness to loss rates of 1-10%, with intra-protocol fairness measured by Jain's fairness index approaching 1.0 across RTTs from 16 ms to 324 ms, outperforming variants like HSTCP and BIC. Inter-protocol fairness with Reno flows exhibited less than 10% bandwidth imbalance in short-RTT (10 ms) scenarios, where CUBIC matched Reno's throughput. Further simulations and testbed evaluations validated these findings, showing convergence times under 300 seconds and stable performance under varying loss patterns, though initial unfairness persisted in high-BDP settings due to aggressive window growth. Post-2010 studies in data centers highlighted CUBIC's limitations, such as vulnerability to TCP incast collapse in scenarios with many-to-one traffic, leading to throughput drops and timeouts due to buffer pressure.[12] It performs well for short flows but may require modifications in shallow-buffered environments without active queue management. Slower startup occurs in low-BDP networks (<5000 packets), reverting to Reno-like linear growth.[1]Implementation and Deployment
In Operating Systems
CUBIC has been the default TCP congestion control algorithm in the Linux kernel since version 2.6.19, released in 2006, replacing the previous BIC-TCP implementation to better handle high-bandwidth, long-distance networks.[4] In Linux distributions, it can be configured or switched to alternatives like BBR using the sysctl interface, for example, by settingnet.ipv4.tcp_congestion_control=cubic to explicitly select CUBIC or =bbr for the BBR algorithm, allowing dynamic adjustment without kernel recompilation. This modularity supports experimentation and optimization in various network environments, with available algorithms listed via sysctl net.ipv4.tcp_available_congestion_control.
Microsoft adopted CUBIC as the default congestion control in Windows 10 with the Fall Creators Update (version 1709) in 2017 and in Windows Server 2019, enhancing throughput for high-performance scenarios while falling back to NewReno for compatibility in lossier or lower-bandwidth conditions.[13][14] This integration improves scalability over fast networks compared to prior defaults like Compound TCP. CUBIC was added experimentally to Windows Server 2016 with the 1709 update.
In Apple's ecosystem, CUBIC is implemented in the XNU kernel and widely used across macOS and iOS for optimizing bandwidth utilization in diverse device scenarios, supporting seamless performance across mobile and desktop environments without user-level configuration changes.
CUBIC is available in other systems, including as a loadable kernel module (cc_cubic) in FreeBSD, which has been the default since FreeBSD 14.0 (2023), and in Android via its Linux kernel base, where it serves as the default for mobile data transfers.[15] In embedded devices for IoT applications, CUBIC enables high-throughput needs over constrained networks, benefiting from its fairness and responsiveness in resource-limited hardware.[16] For fine-tuning parameters like the multiplicative decrease factor β (default 0.7 in Linux implementations), administrators can adjust values directly via the proc filesystem, such as echo 0.7 > /proc/sys/net/ipv4/tcp_cubic_beta, to adapt to specific latency or loss profiles without broader system changes.[17]