Internal QUICHE change PiperOrigin-RevId: 263225274 Change-Id: Ice0f7386553a73fd42d1a9ca6ee017126b25629b
diff --git a/quic/core/congestion_control/bbr2_sender.cc b/quic/core/congestion_control/bbr2_sender.cc index 66aa123..9cd40b9 100644 --- a/quic/core/congestion_control/bbr2_sender.cc +++ b/quic/core/congestion_control/bbr2_sender.cc
@@ -69,8 +69,9 @@ rtt_stats->last_update_time(), /*cwnd_gain=*/1.0, /*pacing_gain=*/kInitialPacingGain), - cwnd_( + initial_cwnd_( cwnd_limits().ApplyLimits(initial_cwnd_in_packets * kDefaultTCPMSS)), + cwnd_(initial_cwnd_), pacing_rate_(kInitialPacingGain * QuicBandwidth::FromBytesAndTimeDelta( cwnd_, rtt_stats->SmoothedOrInitialRtt())), @@ -240,7 +241,7 @@ if (startup_.FullBandwidthReached()) { target_cwnd += model_.MaxAckHeight(); cwnd_ = std::min(prior_cwnd + bytes_acked, target_cwnd); - } else if (prior_cwnd < target_cwnd || prior_cwnd < 2 * cwnd_limits().Min()) { + } else if (prior_cwnd < target_cwnd || prior_cwnd < 2 * initial_cwnd_) { cwnd_ = prior_cwnd + bytes_acked; } const QuicByteCount desired_cwnd = cwnd_;
diff --git a/quic/core/congestion_control/bbr2_sender.h b/quic/core/congestion_control/bbr2_sender.h index 64f6347..b58dd93 100644 --- a/quic/core/congestion_control/bbr2_sender.h +++ b/quic/core/congestion_control/bbr2_sender.h
@@ -161,6 +161,8 @@ Bbr2NetworkModel model_; + const QuicByteCount initial_cwnd_; + // Current cwnd and pacing rate. QuicByteCount cwnd_; QuicBandwidth pacing_rate_;
diff --git a/quic/core/congestion_control/bbr2_simulator_test.cc b/quic/core/congestion_control/bbr2_simulator_test.cc index 736327f..ab4b67b 100644 --- a/quic/core/congestion_control/bbr2_simulator_test.cc +++ b/quic/core/congestion_control/bbr2_simulator_test.cc
@@ -426,13 +426,13 @@ sender_endpoint_.AddBytesToTransfer(20 * 1024 * 1024); - simulator_.RunFor(QuicTime::Delta::FromSeconds(10)); + simulator_.RunFor(QuicTime::Delta::FromSeconds(15)); EXPECT_TRUE(Bbr2ModeIsOneOf({Bbr2Mode::PROBE_BW, Bbr2Mode::PROBE_RTT})); QUIC_LOG(INFO) << "Bandwidth increasing at time " << SimulatedNow(); EXPECT_APPROX_EQ(params.test_link.bandwidth, sender_->ExportDebugState().bandwidth_est, 0.1f); - EXPECT_LE(sender_loss_rate_in_packets(), 0.20); + EXPECT_LE(sender_loss_rate_in_packets(), 0.30); // Now increase the bottleneck bandwidth from 100Kbps to 10Mbps. params.test_link.bandwidth = QuicBandwidth::FromKBitsPerSecond(10000);