Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1004)

Unified Diff: net/quic/congestion_control/tcp_cubic_sender_base.cc

Issue 2002103002: Implement a QUIC No PRR connection option, NPRR. Protected by FLAGS_quic_allow_no_prr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122422703
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/congestion_control/tcp_cubic_sender_base.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender_base.cc b/net/quic/congestion_control/tcp_cubic_sender_base.cc
index 5d8478a43c8eb1d8bc66ac608cba23b04d237aba..3fd7253f1d994c817c86db10f2132e937dbc3fea 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_base.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_base.cc
@@ -41,7 +41,8 @@ TcpCubicSenderBase::TcpCubicSenderBase(const QuicClock* clock,
largest_sent_at_last_cutback_(0),
min4_mode_(false),
last_cutback_exited_slowstart_(false),
- slow_start_large_reduction_(false) {}
+ slow_start_large_reduction_(false),
+ no_prr_(false) {}
TcpCubicSenderBase::~TcpCubicSenderBase() {}
@@ -84,6 +85,11 @@ void TcpCubicSenderBase::SetFromConfig(const QuicConfig& config,
// Slow Start Fast Exit experiment.
slow_start_large_reduction_ = true;
}
+ if (FLAGS_quic_allow_noprr && config.HasReceivedConnectionOptions() &&
+ ContainsQuicTag(config.ReceivedConnectionOptions(), kNPRR)) {
+ // Use unity pacing instead of PRR.
+ no_prr_ = true;
+ }
}
}
@@ -139,8 +145,10 @@ void TcpCubicSenderBase::OnPacketAcked(QuicPacketNumber acked_packet_number,
largest_acked_packet_number_ =
max(acked_packet_number, largest_acked_packet_number_);
if (InRecovery()) {
- // PRR is used when in recovery.
- prr_.OnPacketAcked(acked_bytes);
+ if (!no_prr_) {
+ // PRR is used when in recovery.
+ prr_.OnPacketAcked(acked_bytes);
+ }
return;
}
MaybeIncreaseCwnd(acked_packet_number, acked_bytes, bytes_in_flight);
@@ -176,7 +184,7 @@ bool TcpCubicSenderBase::OnPacketSent(
QuicTime::Delta TcpCubicSenderBase::TimeUntilSend(
QuicTime /* now */,
QuicByteCount bytes_in_flight) const {
- if (InRecovery()) {
+ if (!no_prr_ && InRecovery()) {
// PRR is used when in recovery.
return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight,
GetSlowStartThreshold());
@@ -200,7 +208,8 @@ QuicBandwidth TcpCubicSenderBase::PacingRate() const {
}
const QuicBandwidth bandwidth =
QuicBandwidth::FromBytesAndTimeDelta(GetCongestionWindow(), srtt);
- return bandwidth.Scale(InSlowStart() ? 2 : 1.25);
+ return bandwidth.Scale(InSlowStart() ? 2
+ : (no_prr_ && InRecovery() ? 1 : 1.25));
}
QuicBandwidth TcpCubicSenderBase::BandwidthEstimate() const {
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_base.h ('k') | net/quic/congestion_control/tcp_cubic_sender_bytes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698