diff options
author | Sangtae Ha <sha2@ncsu.edu> | 2008-03-04 17:17:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-04 17:17:41 -0500 |
commit | 6b3d626321c1d4ce9138a86b047dfafc6a403016 (patch) | |
tree | 0708e10ff8c603c014fa3c4ca88f7b51a2c0eb16 /net | |
parent | 7019b78e1483fa724dcba56e8465376b8fd03ea8 (diff) |
[TCP]: TCP cubic v2.2
We have updated CUBIC to fix some issues with slow increase in large
BDP networks. We also improved its convergence speed. The fix is in
fact very simple -- the window increase limit of smax during the
window probing phase (i.e., convex growth phase) is removed. We found
that this does not affect TCP friendliness, but only improves its
scalability. We have run some tests in our lab and also over the
Internet path from NCSU to Japan. These results can be seen from the
following page:
http://netsrv.csc.ncsu.edu/wiki/index.php/Intra_protocol_fairness_testing_with_linux-2.6.23.9
http://netsrv.csc.ncsu.edu/wiki/index.php/RTT_fairness_testing_with_linux-2.6.23.9
http://netsrv.csc.ncsu.edu/wiki/index.php/TCP_friendliness_testing_with_linux-2.6.23.9
Signed-off-by: Sangtae Ha <sha2@ncsu.edu>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_cubic.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 3aa0b23c1ea0..eb5b9854c8c7 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c | |||
@@ -1,12 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * TCP CUBIC: Binary Increase Congestion control for TCP v2.1 | 2 | * TCP CUBIC: Binary Increase Congestion control for TCP v2.2 |
3 | * | 3 | * Home page: |
4 | * http://netsrv.csc.ncsu.edu/twiki/bin/view/Main/BIC | ||
4 | * This is from the implementation of CUBIC TCP in | 5 | * This is from the implementation of CUBIC TCP in |
5 | * Injong Rhee, Lisong Xu. | 6 | * Injong Rhee, Lisong Xu. |
6 | * "CUBIC: A New TCP-Friendly High-Speed TCP Variant | 7 | * "CUBIC: A New TCP-Friendly High-Speed TCP Variant |
7 | * in PFLDnet 2005 | 8 | * in PFLDnet 2005 |
8 | * Available from: | 9 | * Available from: |
9 | * http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/cubic-paper.pdf | 10 | * http://netsrv.csc.ncsu.edu/export/cubic-paper.pdf |
10 | * | 11 | * |
11 | * Unless CUBIC is enabled and congestion window is large | 12 | * Unless CUBIC is enabled and congestion window is large |
12 | * this behaves the same as the original Reno. | 13 | * this behaves the same as the original Reno. |
@@ -20,15 +21,10 @@ | |||
20 | #define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation | 21 | #define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation |
21 | * max_cwnd = snd_cwnd * beta | 22 | * max_cwnd = snd_cwnd * beta |
22 | */ | 23 | */ |
23 | #define BICTCP_B 4 /* | ||
24 | * In binary search, | ||
25 | * go to point (max+min)/N | ||
26 | */ | ||
27 | #define BICTCP_HZ 10 /* BIC HZ 2^10 = 1024 */ | 24 | #define BICTCP_HZ 10 /* BIC HZ 2^10 = 1024 */ |
28 | 25 | ||
29 | static int fast_convergence __read_mostly = 1; | 26 | static int fast_convergence __read_mostly = 1; |
30 | static int max_increment __read_mostly = 16; | 27 | static int beta __read_mostly = 717; /* = 717/1024 (BICTCP_BETA_SCALE) */ |
31 | static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ | ||
32 | static int initial_ssthresh __read_mostly; | 28 | static int initial_ssthresh __read_mostly; |
33 | static int bic_scale __read_mostly = 41; | 29 | static int bic_scale __read_mostly = 41; |
34 | static int tcp_friendliness __read_mostly = 1; | 30 | static int tcp_friendliness __read_mostly = 1; |
@@ -40,9 +36,7 @@ static u64 cube_factor __read_mostly; | |||
40 | /* Note parameters that are used for precomputing scale factors are read-only */ | 36 | /* Note parameters that are used for precomputing scale factors are read-only */ |
41 | module_param(fast_convergence, int, 0644); | 37 | module_param(fast_convergence, int, 0644); |
42 | MODULE_PARM_DESC(fast_convergence, "turn on/off fast convergence"); | 38 | MODULE_PARM_DESC(fast_convergence, "turn on/off fast convergence"); |
43 | module_param(max_increment, int, 0644); | 39 | module_param(beta, int, 0644); |
44 | MODULE_PARM_DESC(max_increment, "Limit on increment allowed during binary search"); | ||
45 | module_param(beta, int, 0444); | ||
46 | MODULE_PARM_DESC(beta, "beta for multiplicative increase"); | 40 | MODULE_PARM_DESC(beta, "beta for multiplicative increase"); |
47 | module_param(initial_ssthresh, int, 0644); | 41 | module_param(initial_ssthresh, int, 0644); |
48 | MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold"); | 42 | MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold"); |
@@ -145,7 +139,7 @@ static u32 cubic_root(u64 a) | |||
145 | static inline void bictcp_update(struct bictcp *ca, u32 cwnd) | 139 | static inline void bictcp_update(struct bictcp *ca, u32 cwnd) |
146 | { | 140 | { |
147 | u64 offs; | 141 | u64 offs; |
148 | u32 delta, t, bic_target, min_cnt, max_cnt; | 142 | u32 delta, t, bic_target, max_cnt; |
149 | 143 | ||
150 | ca->ack_cnt++; /* count the number of ACKs */ | 144 | ca->ack_cnt++; /* count the number of ACKs */ |
151 | 145 | ||
@@ -211,19 +205,6 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd) | |||
211 | ca->cnt = 100 * cwnd; /* very small increment*/ | 205 | ca->cnt = 100 * cwnd; /* very small increment*/ |
212 | } | 206 | } |
213 | 207 | ||
214 | if (ca->delay_min > 0) { | ||
215 | /* max increment = Smax * rtt / 0.1 */ | ||
216 | min_cnt = (cwnd * HZ * 8)/(10 * max_increment * ca->delay_min); | ||
217 | |||
218 | /* use concave growth when the target is above the origin */ | ||
219 | if (ca->cnt < min_cnt && t >= ca->bic_K) | ||
220 | ca->cnt = min_cnt; | ||
221 | } | ||
222 | |||
223 | /* slow start and low utilization */ | ||
224 | if (ca->loss_cwnd == 0) /* could be aggressive in slow start */ | ||
225 | ca->cnt = 50; | ||
226 | |||
227 | /* TCP Friendly */ | 208 | /* TCP Friendly */ |
228 | if (tcp_friendliness) { | 209 | if (tcp_friendliness) { |
229 | u32 scale = beta_scale; | 210 | u32 scale = beta_scale; |
@@ -391,4 +372,4 @@ module_exit(cubictcp_unregister); | |||
391 | MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger"); | 372 | MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger"); |
392 | MODULE_LICENSE("GPL"); | 373 | MODULE_LICENSE("GPL"); |
393 | MODULE_DESCRIPTION("CUBIC TCP"); | 374 | MODULE_DESCRIPTION("CUBIC TCP"); |
394 | MODULE_VERSION("2.1"); | 375 | MODULE_VERSION("2.2"); |