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

Unified Diff: net/quic/core/congestion_control/tcp_cubic_sender_packets_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
« no previous file with comments | « net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc
diff --git a/net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc b/net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc
index 2e3d54479d6e492addd0db2bb0e0a1f7900e22ff..d03dda895e1d7f310f7abd88d478d4f45f7ae767 100644
--- a/net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc
+++ b/net/quic/core/congestion_control/tcp_cubic_sender_packets_test.cc
@@ -998,5 +998,43 @@ TEST_F(TcpCubicSenderPacketsTest, DefaultMaxCwnd) {
sender->GetCongestionWindow() / kDefaultTCPMSS);
}
+TEST_F(TcpCubicSenderPacketsTest, LimitCwndIncreaseInCongestionAvoidance) {
+ FLAGS_quic_limit_cubic_cwnd_increase = true;
+ // Enable Cubic.
+ sender_.reset(new TcpCubicSenderPacketsPeer(
+ &clock_, false, kDefaultMaxCongestionWindowPackets));
+
+ 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 one packet. The CWND should increase by only one packet.
+ AckNPackets(1);
+ EXPECT_EQ(saved_cwnd + kDefaultTCPMSS, sender_->GetCongestionWindow());
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698