Page MenuHomeFreeBSD

cc_cubic: use newreno to emulate AIMD in TCP-friendly region
ClosedPublic

Authored by cc on Sep 5 2024, 6:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 1, 5:23 AM
Unknown Object (File)
Sun, Dec 1, 5:21 AM
Unknown Object (File)
Nov 25 2024, 5:51 AM
Unknown Object (File)
Nov 24 2024, 3:08 AM
Unknown Object (File)
Nov 21 2024, 7:41 AM
Unknown Object (File)
Nov 13 2024, 12:35 PM
Unknown Object (File)
Nov 7 2024, 7:48 AM
Unknown Object (File)
Nov 4 2024, 1:11 PM

Details

Summary

TCP CUBIC keeps a TCP-friendly window that guarantees inline performance with the standard AIMD TCP congestion control (TCP-SACK, TCP NewReno) on the bottom line. It means CUBIC should have the same performance with NewReno in LAN or short latency network. This is in theory covered in the mathematic model of Eq. 4 in RFC8312 Section 4.2. TCP-Friendly Region. However, the equation requires a reliable and accurate timer to help approximate the TCP-friendly Window with exclusive CUBIC alpha/beta parameters. When the timer granularity is coarse, for example kern.hz==100 on some Virtual Machine platforms, the performance suffers due to loose precision on TCP-friendly window approximation in LAN. In WAN with much higher latency, this seems acceptable because the 10ms granularity does not crush the dominant CUBIC-window (not TCP-friendly window) estimation.

Secondly, find an accurate and reliable timer(timers) is a challenge if we pursue a general solution across all environments. Therefore, re-use the NewReno AIMD functionalities and accurately get the window seems to be efficient and economical.

Pros:
(1) it calculates exact TCP-friendly window (NewReno window) in congestion avoidance without losing precision.
(2) it boosts performance in LAN where packet loss is serious.
(3) it does not require an accurate timer, which means less dependent on ticks (expensive kern.hz on different platforms).
(4) it has little impact on traffic in WAN where RTT > 10ms and CUBIC's concave/convex approach dominates.

Note:
It does not follow the RFC8312 Eq. 4 in Section 4.2. TCP-Friendly Region, which reveals the weakness of timer accuracy in previous implementation.

W_est(t) = W_max*beta_cubic + [3*(1-beta_cubic)/(1+beta_cubic)] * (t/RTT) (Eq. 4)

This change shows better performance than a finer timer approach. For example, we can compare below with the results from 10k or 100k kern.hz value in testTCPCCinVM#test_result.

kern.hz valueTCP congestion control algoiperf result from 1% data packet drop rateiperf result from 2% data packet drop rate
100000 (100k)stock cubic719 Mbits/sec547 Mbits/sec
10000 (10k)stock cubic923 Mbits/sec683 Mbits/sec
1000 (1k)stock cubic917 Mbits/sec527 Mbits/sec
100stock newreno915 Mbits/sec767 Mbits/sec
100stock cubic168 Mbits/sec83.8 Mbits/sec
100this cubic patch921 Mbits/sec (+4.5X)876 Mbits/sec (+9.5X)
Test Plan

Performance boost from this change can be found in testD46046, where improvement ranges between +%0.5 to +9.5X.
No regression found in TCP-friendly tests too from the above link.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cc requested review of this revision.Sep 5 2024, 6:56 PM
cc edited the test plan for this revision. (Show Details)

Looks good, the intended change is clear to follow and in line with the spirit of RFC9438.

This revision is now accepted and ready to land.Sep 6 2024, 7:24 AM
This revision now requires review to proceed.Sep 17 2024, 2:04 PM
This revision is now accepted and ready to land.Sep 17 2024, 2:05 PM
This revision now requires review to proceed.Sep 17 2024, 2:08 PM
This revision is now accepted and ready to land.Sep 17 2024, 2:11 PM