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 20 matching lines...) Expand all Loading... |
31 // a multiplicative decrease of our current window. | 31 // a multiplicative decrease of our current window. |
32 QuicPacketCount CongestionWindowAfterPacketLoss(QuicPacketCount current); | 32 QuicPacketCount CongestionWindowAfterPacketLoss(QuicPacketCount current); |
33 | 33 |
34 // Compute a new congestion window to use after a received ACK. | 34 // Compute a new congestion window to use after a received ACK. |
35 // Returns the new congestion window in packets. The new congestion window | 35 // Returns the new congestion window in packets. The new congestion window |
36 // follows a cubic function that depends on the time passed since last | 36 // follows a cubic function that depends on the time passed since last |
37 // packet loss. | 37 // packet loss. |
38 QuicPacketCount CongestionWindowAfterAck(QuicPacketCount current, | 38 QuicPacketCount CongestionWindowAfterAck(QuicPacketCount current, |
39 QuicTime::Delta delay_min); | 39 QuicTime::Delta delay_min); |
40 | 40 |
| 41 // Call on ack arrival when sender is unable to use the available congestion |
| 42 // window. Resets Cubic state during quiescence. |
| 43 void OnApplicationLimited(); |
| 44 |
41 private: | 45 private: |
42 static const QuicTime::Delta MaxCubicTimeInterval() { | 46 static const QuicTime::Delta MaxCubicTimeInterval() { |
43 return QuicTime::Delta::FromMilliseconds(30); | 47 return QuicTime::Delta::FromMilliseconds(30); |
44 } | 48 } |
45 | 49 |
46 // Compute the TCP Cubic alpha and beta based on the current number of | 50 // Compute the TCP Cubic alpha and beta based on the current number of |
47 // connections. | 51 // connections. |
48 float Alpha() const; | 52 float Alpha() const; |
49 float Beta() const; | 53 float Beta() const; |
50 | 54 |
(...skipping 30 matching lines...) Expand all Loading... |
81 | 85 |
82 // Last congestion window in packets computed by cubic function. | 86 // Last congestion window in packets computed by cubic function. |
83 QuicPacketCount last_target_congestion_window_; | 87 QuicPacketCount last_target_congestion_window_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(Cubic); | 89 DISALLOW_COPY_AND_ASSIGN(Cubic); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace net | 92 } // namespace net |
89 | 93 |
90 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ | 94 #endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_H_ |
OLD | NEW |