| 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/core/congestion_control/hybrid_slow_start.h" | 5 #include "net/quic/core/congestion_control/hybrid_slow_start.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 | |
| 10 namespace net { | 9 namespace net { |
| 11 | 10 |
| 12 // Note(pwestin): the magic clamping numbers come from the original code in | 11 // Note(pwestin): the magic clamping numbers come from the original code in |
| 13 // tcp_cubic.c. | 12 // tcp_cubic.c. |
| 14 const int64_t kHybridStartLowWindow = 16; | 13 const int64_t kHybridStartLowWindow = 16; |
| 15 // Number of delay samples for detecting the increase of delay. | 14 // Number of delay samples for detecting the increase of delay. |
| 16 const uint32_t kHybridStartMinSamples = 8; | 15 const uint32_t kHybridStartMinSamples = 8; |
| 17 // Exit slow start if the min rtt has increased by more than 1/8th. | 16 // Exit slow start if the min rtt has increased by more than 1/8th. |
| 18 const int kHybridStartDelayFactorExp = 3; // 2^3 = 8 | 17 const int kHybridStartDelayFactorExp = 3; // 2^3 = 8 |
| 19 // The original paper specifies 2 and 8ms, but those have changed over time. | 18 // The original paper specifies 2 and 8ms, but those have changed over time. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 hystart_found_ = DELAY; | 95 hystart_found_ = DELAY; |
| 97 } | 96 } |
| 98 } | 97 } |
| 99 // Exit from slow start if the cwnd is greater than 16 and | 98 // Exit from slow start if the cwnd is greater than 16 and |
| 100 // increasing delay is found. | 99 // increasing delay is found. |
| 101 return congestion_window >= kHybridStartLowWindow && | 100 return congestion_window >= kHybridStartLowWindow && |
| 102 hystart_found_ != NOT_FOUND; | 101 hystart_found_ != NOT_FOUND; |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace net | 104 } // namespace net |
| OLD | NEW |