OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // BBR (Bottleneck Bandwidth and RTT) congestion control algorithm. | 5 // BBR (Bottleneck Bandwidth and RTT) congestion control algorithm. |
6 | 6 |
7 #ifndef NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ | 7 #ifndef NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ |
8 #define NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ | 8 #define NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ |
9 | 9 |
10 #include <cstdint> | 10 #include <cstdint> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 QuicRoundTripCount, | 140 QuicRoundTripCount, |
141 QuicRoundTripCount> | 141 QuicRoundTripCount> |
142 MaxBandwidthFilter; | 142 MaxBandwidthFilter; |
143 | 143 |
144 typedef WindowedFilter<QuicTime::Delta, | 144 typedef WindowedFilter<QuicTime::Delta, |
145 MaxFilter<QuicTime::Delta>, | 145 MaxFilter<QuicTime::Delta>, |
146 QuicRoundTripCount, | 146 QuicRoundTripCount, |
147 QuicRoundTripCount> | 147 QuicRoundTripCount> |
148 MaxAckDelayFilter; | 148 MaxAckDelayFilter; |
149 | 149 |
| 150 typedef WindowedFilter<QuicByteCount, |
| 151 MaxFilter<QuicByteCount>, |
| 152 QuicRoundTripCount, |
| 153 QuicRoundTripCount> |
| 154 MaxAckHeightFilter; |
| 155 |
150 // Returns the current estimate of the RTT of the connection. Outside of the | 156 // Returns the current estimate of the RTT of the connection. Outside of the |
151 // edge cases, this is minimum RTT. | 157 // edge cases, this is minimum RTT. |
152 QuicTime::Delta GetMinRtt() const; | 158 QuicTime::Delta GetMinRtt() const; |
153 // Returns whether the connection has achieved full bandwidth required to exit | 159 // Returns whether the connection has achieved full bandwidth required to exit |
154 // the slow start. | 160 // the slow start. |
155 bool IsAtFullBandwidth() const; | 161 bool IsAtFullBandwidth() const; |
156 // Computes the target congestion window using the specified gain. | 162 // Computes the target congestion window using the specified gain. |
157 QuicByteCount GetTargetCongestionWindow(float gain) const; | 163 QuicByteCount GetTargetCongestionWindow(float gain) const; |
158 | 164 |
159 // Enters the STARTUP mode. | 165 // Enters the STARTUP mode. |
(...skipping 28 matching lines...) Expand all Loading... |
188 // recovery. | 194 // recovery. |
189 void UpdateRecoveryState(QuicPacketNumber last_acked_packet, | 195 void UpdateRecoveryState(QuicPacketNumber last_acked_packet, |
190 bool has_losses, | 196 bool has_losses, |
191 bool is_round_start); | 197 bool is_round_start); |
192 | 198 |
193 // Updates the ack spacing max filter if a larger value is observed. | 199 // Updates the ack spacing max filter if a larger value is observed. |
194 void UpdateAckSpacing(QuicTime ack_time, | 200 void UpdateAckSpacing(QuicTime ack_time, |
195 QuicPacketNumber largest_newly_acked, | 201 QuicPacketNumber largest_newly_acked, |
196 const CongestionVector& acked_packets); | 202 const CongestionVector& acked_packets); |
197 | 203 |
| 204 // Updates the ack aggregation max filter in bytes. |
| 205 void UpdateAckAggregationBytes(QuicTime ack_time, |
| 206 QuicByteCount newly_acked_bytes); |
| 207 |
198 // Determines the appropriate pacing rate for the connection. | 208 // Determines the appropriate pacing rate for the connection. |
199 void CalculatePacingRate(); | 209 void CalculatePacingRate(); |
200 // Determines the appropriate congestion window for the connection. | 210 // Determines the appropriate congestion window for the connection. |
201 void CalculateCongestionWindow(QuicByteCount bytes_acked); | 211 void CalculateCongestionWindow(QuicByteCount bytes_acked); |
202 // Determines the approriate window that constrains the in-flight during | 212 // Determines the approriate window that constrains the in-flight during |
203 // recovery. | 213 // recovery. |
204 void CalculateRecoveryWindow(QuicByteCount bytes_acked); | 214 void CalculateRecoveryWindow(QuicByteCount bytes_acked); |
205 | 215 |
206 const RttStats* rtt_stats_; | 216 const RttStats* rtt_stats_; |
207 const QuicUnackedPacketMap* unacked_packets_; | 217 const QuicUnackedPacketMap* unacked_packets_; |
(...skipping 18 matching lines...) Expand all Loading... |
226 // round-trips. | 236 // round-trips. |
227 MaxBandwidthFilter max_bandwidth_; | 237 MaxBandwidthFilter max_bandwidth_; |
228 | 238 |
229 // Tracks the maximum spacing between two acks acknowledging in order packets. | 239 // Tracks the maximum spacing between two acks acknowledging in order packets. |
230 MaxAckDelayFilter max_ack_spacing_; | 240 MaxAckDelayFilter max_ack_spacing_; |
231 | 241 |
232 // The time the largest acked packet was acked and when it was sent. | 242 // The time the largest acked packet was acked and when it was sent. |
233 QuicTime largest_acked_time_; | 243 QuicTime largest_acked_time_; |
234 QuicTime largest_acked_sent_time_; | 244 QuicTime largest_acked_sent_time_; |
235 | 245 |
| 246 // Tracks the maximum number of bytes acked faster than the sending rate. |
| 247 MaxAckHeightFilter max_ack_height_; |
| 248 |
| 249 // The time this aggregation started and the number of bytes acked during it. |
| 250 QuicTime aggregation_epoch_start_time_; |
| 251 QuicByteCount aggregation_epoch_bytes_; |
| 252 |
236 // Minimum RTT estimate. Automatically expires within 10 seconds (and | 253 // Minimum RTT estimate. Automatically expires within 10 seconds (and |
237 // triggers PROBE_RTT mode) if no new value is sampled during that period. | 254 // triggers PROBE_RTT mode) if no new value is sampled during that period. |
238 QuicTime::Delta min_rtt_; | 255 QuicTime::Delta min_rtt_; |
239 // The time at which the current value of |min_rtt_| was assigned. | 256 // The time at which the current value of |min_rtt_| was assigned. |
240 QuicTime min_rtt_timestamp_; | 257 QuicTime min_rtt_timestamp_; |
241 | 258 |
242 // The maximum allowed number of bytes in flight. | 259 // The maximum allowed number of bytes in flight. |
243 QuicByteCount congestion_window_; | 260 QuicByteCount congestion_window_; |
244 | 261 |
245 // The initial value of the |congestion_window_|. | 262 // The initial value of the |congestion_window_|. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 322 |
306 QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 323 QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
307 const BbrSender::Mode& mode); | 324 const BbrSender::Mode& mode); |
308 QUIC_EXPORT_PRIVATE std::ostream& operator<<( | 325 QUIC_EXPORT_PRIVATE std::ostream& operator<<( |
309 std::ostream& os, | 326 std::ostream& os, |
310 const BbrSender::DebugState& state); | 327 const BbrSender::DebugState& state); |
311 | 328 |
312 } // namespace net | 329 } // namespace net |
313 | 330 |
314 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ | 331 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_BBR_SENDER_H_ |
OLD | NEW |