Index: net/quic/congestion_control/tcp_cubic_bytes_sender.cc |
diff --git a/net/quic/congestion_control/tcp_cubic_bytes_sender.cc b/net/quic/congestion_control/tcp_cubic_bytes_sender.cc |
index a5b2f68a25d4e5fed4b7037e37d37168bb509f79..b2489c89c6e0dc5c3f0cbbb661b38e5e04f37991 100644 |
--- a/net/quic/congestion_control/tcp_cubic_bytes_sender.cc |
+++ b/net/quic/congestion_control/tcp_cubic_bytes_sender.cc |
@@ -19,7 +19,7 @@ namespace { |
// Constants based on TCP defaults. |
// The minimum cwnd based on RFC 3782 (TCP NewReno) for cwnd reductions on a |
// fast retransmission. |
-const QuicByteCount kMinimumCongestionWindow = 2 * kDefaultTCPMSS; |
+const QuicByteCount kDefaultMinimumCongestionWindow = 2 * kDefaultTCPMSS; |
const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS; |
const int kMaxBurstLength = 3; |
const float kRenoBeta = 0.7f; // Reno backoff factor. |
@@ -43,6 +43,7 @@ TcpCubicBytesSender::TcpCubicBytesSender( |
largest_acked_sequence_number_(0), |
largest_sent_at_last_cutback_(0), |
congestion_window_(initial_tcp_congestion_window * kMaxSegmentSize), |
+ min_congestion_window_(kDefaultMinimumCongestionWindow), |
slowstart_threshold_(std::numeric_limits<uint64>::max()), |
last_cutback_exited_slowstart_(false), |
clock_(clock) { |
@@ -60,6 +61,11 @@ void TcpCubicBytesSender::SetFromConfig(const QuicConfig& config, |
// Initial window experiment. |
congestion_window_ = 10 * kMaxSegmentSize; |
} |
+ if (config.HasReceivedConnectionOptions() && |
+ ContainsQuicTag(config.ReceivedConnectionOptions(), kMIN1)) { |
+ // Min CWND experiment. |
+ min_congestion_window_ = kMaxSegmentSize; |
+ } |
if (using_pacing) { |
// Disable the ack train mode in hystart when pacing is enabled, since it |
// may be falsely triggered. |
@@ -173,8 +179,8 @@ void TcpCubicBytesSender::OnPacketLost(QuicPacketSequenceNumber sequence_number, |
} |
slowstart_threshold_ = congestion_window_; |
// Enforce TCP's minimum congestion window of 2*MSS. |
- if (congestion_window_ < kMinimumCongestionWindow) { |
- congestion_window_ = kMinimumCongestionWindow; |
+ if (congestion_window_ < min_congestion_window_) { |
+ congestion_window_ = min_congestion_window_; |
} |
largest_sent_at_last_cutback_ = largest_sent_sequence_number_; |
// Reset packet count from congestion avoidance mode. We start counting again |
@@ -336,7 +342,7 @@ void TcpCubicBytesSender::OnRetransmissionTimeout(bool packets_retransmitted) { |
cubic_.Reset(); |
hybrid_slow_start_.Restart(); |
slowstart_threshold_ = congestion_window_ / 2; |
- congestion_window_ = kMinimumCongestionWindow; |
+ congestion_window_ = min_congestion_window_; |
} |
CongestionControlType TcpCubicBytesSender::GetCongestionControlType() const { |