OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/congestion_control/hybrid_slow_start.h" | 5 #include "net/quic/congestion_control/hybrid_slow_start.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 using std::max; | 9 using std::max; |
10 using std::min; | 10 using std::min; |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
14 // Note(pwestin): the magic clamping numbers come from the original code in | 14 // Note(pwestin): the magic clamping numbers come from the original code in |
15 // tcp_cubic.c. | 15 // tcp_cubic.c. |
16 const int64 kHybridStartLowWindow = 16; | 16 const int64 kHybridStartLowWindow = 16; |
17 // Number of delay samples for detecting the increase of delay. | 17 // Number of delay samples for detecting the increase of delay. |
18 const uint32 kHybridStartMinSamples = 8; | 18 const uint32 kHybridStartMinSamples = 8; |
19 const int kHybridStartDelayFactorExp = 4; // 2^4 = 16 | 19 // Exit slow start if the min rtt has increased by more than 1/8th. |
| 20 const int kHybridStartDelayFactorExp = 3; // 2^3 = 8 |
20 // The original paper specifies 2 and 8ms, but those have changed over time. | 21 // The original paper specifies 2 and 8ms, but those have changed over time. |
21 const int64 kHybridStartDelayMinThresholdUs = 4000; | 22 const int64 kHybridStartDelayMinThresholdUs = 4000; |
22 const int64 kHybridStartDelayMaxThresholdUs = 16000; | 23 const int64 kHybridStartDelayMaxThresholdUs = 16000; |
23 | 24 |
24 HybridSlowStart::HybridSlowStart(const QuicClock* clock) | 25 HybridSlowStart::HybridSlowStart(const QuicClock* clock) |
25 : clock_(clock), | 26 : clock_(clock), |
26 ack_train_detection_(true), | 27 ack_train_detection_(true), |
27 started_(false), | 28 started_(false), |
28 hystart_found_(NOT_FOUND), | 29 hystart_found_(NOT_FOUND), |
29 last_sent_sequence_number_(0), | 30 last_sent_sequence_number_(0), |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 hystart_found_= DELAY; | 127 hystart_found_= DELAY; |
127 } | 128 } |
128 } | 129 } |
129 // Exit from slow start if the cwnd is greater than 16 and an ack train or | 130 // Exit from slow start if the cwnd is greater than 16 and an ack train or |
130 // increasing delay are found. | 131 // increasing delay are found. |
131 return congestion_window >= kHybridStartLowWindow && | 132 return congestion_window >= kHybridStartLowWindow && |
132 hystart_found_ != NOT_FOUND; | 133 hystart_found_ != NOT_FOUND; |
133 } | 134 } |
134 | 135 |
135 } // namespace net | 136 } // namespace net |
OLD | NEW |