| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 // Cubic algorithm, helper class to TCP cubic. | 5 // Cubic algorithm, helper class to TCP cubic. |
| 6 // For details see http://netsrv.csc.ncsu.edu/export/cubic_a_new_tcp_2008.pdf. | 6 // For details see http://netsrv.csc.ncsu.edu/export/cubic_a_new_tcp_2008.pdf. |
| 7 | 7 |
| 8 #ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ | 8 #ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ |
| 9 #define NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ | 9 #define NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // follows a cubic function that depends on the time passed since last packet | 38 // follows a cubic function that depends on the time passed since last packet |
| 39 // loss. | 39 // loss. |
| 40 QuicByteCount CongestionWindowAfterAck(QuicByteCount acked_bytes, | 40 QuicByteCount CongestionWindowAfterAck(QuicByteCount acked_bytes, |
| 41 QuicByteCount current, | 41 QuicByteCount current, |
| 42 QuicTime::Delta delay_min); | 42 QuicTime::Delta delay_min); |
| 43 | 43 |
| 44 // Call on ack arrival when sender is unable to use the available congestion | 44 // Call on ack arrival when sender is unable to use the available congestion |
| 45 // window. Resets Cubic state during quiescence. | 45 // window. Resets Cubic state during quiescence. |
| 46 void OnApplicationLimited(); | 46 void OnApplicationLimited(); |
| 47 | 47 |
| 48 void SetFixConvexMode(bool fix_convex_mode); |
| 49 |
| 48 private: | 50 private: |
| 49 static const QuicTime::Delta MaxCubicTimeInterval() { | 51 static const QuicTime::Delta MaxCubicTimeInterval() { |
| 50 return QuicTime::Delta::FromMilliseconds(30); | 52 return QuicTime::Delta::FromMilliseconds(30); |
| 51 } | 53 } |
| 52 | 54 |
| 53 // Compute the TCP Cubic alpha and beta based on the current number of | 55 // Compute the TCP Cubic alpha and beta based on the current number of |
| 54 // connections. | 56 // connections. |
| 55 float Alpha() const; | 57 float Alpha() const; |
| 56 float Beta() const; | 58 float Beta() const; |
| 57 | 59 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 82 | 84 |
| 83 // Origin point of cubic function. | 85 // Origin point of cubic function. |
| 84 QuicByteCount origin_point_congestion_window_; | 86 QuicByteCount origin_point_congestion_window_; |
| 85 | 87 |
| 86 // Time to origin point of cubic function in 2^10 fractions of a second. | 88 // Time to origin point of cubic function in 2^10 fractions of a second. |
| 87 uint32_t time_to_origin_point_; | 89 uint32_t time_to_origin_point_; |
| 88 | 90 |
| 89 // Last congestion window in packets computed by cubic function. | 91 // Last congestion window in packets computed by cubic function. |
| 90 QuicByteCount last_target_congestion_window_; | 92 QuicByteCount last_target_congestion_window_; |
| 91 | 93 |
| 94 // Fix convex mode for cubic. |
| 95 // TODO(jokulik): Remove once the cubic convex experiment is done. |
| 96 bool fix_convex_mode_; |
| 97 |
| 92 DISALLOW_COPY_AND_ASSIGN(CubicBytes); | 98 DISALLOW_COPY_AND_ASSIGN(CubicBytes); |
| 93 }; | 99 }; |
| 94 | 100 |
| 95 } // namespace net | 101 } // namespace net |
| 96 | 102 |
| 97 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ | 103 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_ |
| OLD | NEW |