| 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 #include "net/quic/core/congestion_control/bbr_sender.h" | 5 #include "net/quic/core/congestion_control/bbr_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "net/quic/core/congestion_control/rtt_stats.h" | 10 #include "net/quic/core/congestion_control/rtt_stats.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 326 } |
| 327 | 327 |
| 328 QuicTime::Delta BbrSender::GetMinRtt() const { | 328 QuicTime::Delta BbrSender::GetMinRtt() const { |
| 329 return !min_rtt_.IsZero() | 329 return !min_rtt_.IsZero() |
| 330 ? min_rtt_ | 330 ? min_rtt_ |
| 331 : QuicTime::Delta::FromMicroseconds(rtt_stats_->initial_rtt_us()); | 331 : QuicTime::Delta::FromMicroseconds(rtt_stats_->initial_rtt_us()); |
| 332 } | 332 } |
| 333 | 333 |
| 334 QuicByteCount BbrSender::GetTargetCongestionWindow(float gain) const { | 334 QuicByteCount BbrSender::GetTargetCongestionWindow(float gain) const { |
| 335 QuicByteCount bdp = GetMinRtt() * BandwidthEstimate(); | 335 QuicByteCount bdp = GetMinRtt() * BandwidthEstimate(); |
| 336 if (FLAGS_quic_reloadable_flag_quic_bbr_base_cwnd_on_srtt && | |
| 337 mode_ == PROBE_BW && gain >= 1 && !rtt_stats_->smoothed_rtt().IsZero()) { | |
| 338 bdp = rtt_stats_->smoothed_rtt() * BandwidthEstimate(); | |
| 339 } | |
| 340 QuicByteCount congestion_window = gain * bdp; | 336 QuicByteCount congestion_window = gain * bdp; |
| 341 | 337 |
| 342 // BDP estimate will be zero if no bandwidth samples are available yet. | 338 // BDP estimate will be zero if no bandwidth samples are available yet. |
| 343 if (congestion_window == 0) { | 339 if (congestion_window == 0) { |
| 344 congestion_window = gain * initial_congestion_window_; | 340 congestion_window = gain * initial_congestion_window_; |
| 345 } | 341 } |
| 346 | 342 |
| 347 return std::max(congestion_window, kMinimumCongestionWindow); | 343 return std::max(congestion_window, kMinimumCongestionWindow); |
| 348 } | 344 } |
| 349 | 345 |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 os << "Minimum RTT timestamp: " << state.min_rtt_timestamp.ToDebuggingValue() | 826 os << "Minimum RTT timestamp: " << state.min_rtt_timestamp.ToDebuggingValue() |
| 831 << std::endl; | 827 << std::endl; |
| 832 | 828 |
| 833 os << "Last sample is app-limited: " | 829 os << "Last sample is app-limited: " |
| 834 << (state.last_sample_is_app_limited ? "yes" : "no"); | 830 << (state.last_sample_is_app_limited ? "yes" : "no"); |
| 835 | 831 |
| 836 return os; | 832 return os; |
| 837 } | 833 } |
| 838 | 834 |
| 839 } // namespace net | 835 } // namespace net |
| OLD | NEW |