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

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

Issue 1014433002: Land Recent QUIC Changes until 03/09/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replaces_Perspective_enun_88006458
Patch Set: Rebase - added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 5b24a1f25281a8ba952373c262e5ef38bb25de39..e8541daccd4dcc5043739b891c214bb49625bba2 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -20,7 +20,7 @@ namespace {
// Constants based on TCP defaults.
// The minimum cwnd based on RFC 3782 (TCP NewReno) for cwnd reductions on a
// fast retransmission. The cwnd after a timeout is still 1.
-const QuicPacketCount kMinimumCongestionWindow = 2;
+const QuicPacketCount kDefaultMinimumCongestionWindow = 2;
const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS;
const int kMaxBurstLength = 3;
const float kRenoBeta = 0.7f; // Reno backoff factor.
@@ -43,6 +43,7 @@ TcpCubicSender::TcpCubicSender(const QuicClock* clock,
largest_acked_sequence_number_(0),
largest_sent_at_last_cutback_(0),
congestion_window_(initial_tcp_congestion_window),
+ min_congestion_window_(kDefaultMinimumCongestionWindow),
slowstart_threshold_(std::numeric_limits<uint64>::max()),
last_cutback_exited_slowstart_(false),
clock_(clock) {
@@ -61,6 +62,11 @@ void TcpCubicSender::SetFromConfig(const QuicConfig& config,
// Initial window experiment.
congestion_window_ = 10;
}
+ if (config.HasReceivedConnectionOptions() &&
+ ContainsQuicTag(config.ReceivedConnectionOptions(), kMIN1)) {
+ // Min CWND experiment.
+ min_congestion_window_ = 1;
+ }
if (using_pacing) {
// Disable the ack train mode in hystart when pacing is enabled, since it
// may be falsely triggered.
@@ -173,9 +179,9 @@ void TcpCubicSender::OnPacketLost(QuicPacketSequenceNumber sequence_number,
cubic_.CongestionWindowAfterPacketLoss(congestion_window_);
}
slowstart_threshold_ = congestion_window_;
- // Enforce TCP's minimum congestion window of 2*MSS.
- if (congestion_window_ < kMinimumCongestionWindow) {
- congestion_window_ = kMinimumCongestionWindow;
+ // Enforce a minimum congestion window.
+ 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
@@ -337,7 +343,7 @@ void TcpCubicSender::OnRetransmissionTimeout(bool packets_retransmitted) {
cubic_.Reset();
hybrid_slow_start_.Restart();
slowstart_threshold_ = congestion_window_ / 2;
- congestion_window_ = kMinimumCongestionWindow;
+ congestion_window_ = min_congestion_window_;
}
CongestionControlType TcpCubicSender::GetCongestionControlType() const {
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.h ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698