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

Unified Diff: net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc

Issue 2351963005: Limit QUIC's Cubic CWND increases to 1/2 the bytes acked when in (Closed)
Patch Set: Created 4 years, 3 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/core/congestion_control/tcp_cubic_sender_bytes_test.cc
diff --git a/net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc b/net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc
index 975ed05a5b42f480dd450be0d078a10a992e4cb4..414999d74f4ca1312ea4c13af2ac0be6754a0213 100644
--- a/net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc
+++ b/net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc
@@ -889,5 +889,42 @@ TEST_F(TcpCubicSenderBytesTest, DefaultMaxCwnd) {
sender->GetCongestionWindow() / kDefaultTCPMSS);
}
+TEST_F(TcpCubicSenderBytesTest, LimitCwndIncreaseInCongestionAvoidance) {
+ FLAGS_quic_limit_cubic_cwnd_increase = true;
+ // Enable Cubic.
+ sender_.reset(new TcpCubicSenderBytesPeer(&clock_, false));
+
+ int num_sent = SendAvailableSendWindow();
+
+ // Make sure we fall out of slow start.
+ QuicByteCount saved_cwnd = sender_->GetCongestionWindow();
+ LoseNPackets(1);
+ EXPECT_GT(saved_cwnd, sender_->GetCongestionWindow());
+
+ // Ack the rest of the outstanding packets to get out of recovery.
+ for (int i = 1; i < num_sent; ++i) {
+ AckNPackets(1);
+ }
+ EXPECT_EQ(0u, bytes_in_flight_);
+ // Send a new window of data and ack all; cubic growth should occur.
+ saved_cwnd = sender_->GetCongestionWindow();
+ num_sent = SendAvailableSendWindow();
+
+ // Ack packets until the CWND increases.
+ while (sender_->GetCongestionWindow() == saved_cwnd) {
+ AckNPackets(1);
+ SendAvailableSendWindow();
+ }
+ EXPECT_EQ(bytes_in_flight_, sender_->GetCongestionWindow());
+ saved_cwnd = sender_->GetCongestionWindow();
+
+ // Advance time 2 seconds waiting for an ack.
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(2000));
+
+ // Ack two packets. The CWND should increase by only one packet.
+ AckNPackets(2);
+ EXPECT_EQ(saved_cwnd + kDefaultTCPMSS, sender_->GetCongestionWindow());
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/core/congestion_control/cubic_test.cc ('k') | net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698