Chromium Code Reviews| 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 // 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_H_ | 8 #ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ |
| 9 #define NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ | 9 #define NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 // Call after a timeout to reset the cubic state. | 28 // Call after a timeout to reset the cubic state. |
| 29 void Reset(); | 29 void Reset(); |
| 30 | 30 |
| 31 // Compute a new congestion window to use after a loss event. | 31 // Compute a new congestion window to use after a loss event. |
| 32 // Returns the new congestion window in packets. The new congestion window is | 32 // Returns the new congestion window in packets. The new congestion window is |
| 33 // a multiplicative decrease of our current window. | 33 // a multiplicative decrease of our current window. |
| 34 QuicPacketCount CongestionWindowAfterPacketLoss(QuicPacketCount current); | 34 QuicPacketCount CongestionWindowAfterPacketLoss(QuicPacketCount current); |
| 35 | 35 |
| 36 // Compute a new congestion window to use after a received ACK. | 36 // Compute a new congestion window to use after a received ACK. |
| 37 // Returns the new congestion window in packets. The new congestion window | 37 // Returns the new congestion window in packets. The new congestion |
| 38 // follows a cubic function that depends on the time passed since last | 38 // window follows a cubic function that depends on the time passed |
| 39 // packet loss. | 39 // since last packet loss. |
| 40 QuicPacketCount CongestionWindowAfterAck(QuicPacketCount current, | 40 QuicPacketCount CongestionWindowAfterAck(QuicPacketCount current, |
| 41 QuicTime::Delta delay_min); | 41 QuicTime::Delta delay_min); |
| 42 | 42 |
| 43 // Call on ack arrival when sender is unable to use the available congestion | 43 // Call on ack arrival when sender is unable to use the available congestion |
| 44 // window. Resets Cubic state during quiescence. | 44 // window. Resets Cubic state during quiescence. |
| 45 void OnApplicationLimited(); | 45 void OnApplicationLimited(); |
| 46 | 46 |
| 47 // If true, enable the fix for the convex-mode signing bug. See | |
| 48 // b/32170105 for more information about the bug. | |
|
Zhongyi Shi
2016/12/01 22:15:23
nit: you might want to remove this link here.
| |
| 49 // TODO(jokulik): Remove once the fix is enabled by default. | |
| 50 void SetFixConvexMode(bool fix_convex_mode); | |
| 51 | |
| 47 private: | 52 private: |
| 48 static const QuicTime::Delta MaxCubicTimeInterval() { | 53 static const QuicTime::Delta MaxCubicTimeInterval() { |
| 49 return QuicTime::Delta::FromMilliseconds(30); | 54 return QuicTime::Delta::FromMilliseconds(30); |
| 50 } | 55 } |
| 51 | 56 |
| 52 // Compute the TCP Cubic alpha and beta based on the current number of | 57 // Compute the TCP Cubic alpha and beta based on the current number of |
| 53 // connections. | 58 // connections. |
| 54 float Alpha() const; | 59 float Alpha() const; |
| 55 float Beta() const; | 60 float Beta() const; |
| 56 | 61 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 | 95 |
| 91 // Origin point of cubic function. | 96 // Origin point of cubic function. |
| 92 QuicPacketCount origin_point_congestion_window_; | 97 QuicPacketCount origin_point_congestion_window_; |
| 93 | 98 |
| 94 // Time to origin point of cubic function in 2^10 fractions of a second. | 99 // Time to origin point of cubic function in 2^10 fractions of a second. |
| 95 uint32_t time_to_origin_point_; | 100 uint32_t time_to_origin_point_; |
| 96 | 101 |
| 97 // Last congestion window in packets computed by cubic function. | 102 // Last congestion window in packets computed by cubic function. |
| 98 QuicPacketCount last_target_congestion_window_; | 103 QuicPacketCount last_target_congestion_window_; |
| 99 | 104 |
| 105 // Fix convex mode for cubic. | |
| 106 // TODO(jokulik): Remove once the cubic convex experiment is done. | |
| 107 bool fix_convex_mode_; | |
| 108 | |
| 100 DISALLOW_COPY_AND_ASSIGN(Cubic); | 109 DISALLOW_COPY_AND_ASSIGN(Cubic); |
| 101 }; | 110 }; |
| 102 | 111 |
| 103 } // namespace net | 112 } // namespace net |
| 104 | 113 |
| 105 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ | 114 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ |
| OLD | NEW |