Index: net/quic/core/congestion_control/bbr_sender_test.cc |
diff --git a/net/quic/core/congestion_control/bbr_sender_test.cc b/net/quic/core/congestion_control/bbr_sender_test.cc |
index 64c0a15a906c5c959d9129a301d5f69e093cbdd0..f3aa680a36dff25b3bec605ba37c814300eb6f0a 100644 |
--- a/net/quic/core/congestion_control/bbr_sender_test.cc |
+++ b/net/quic/core/congestion_control/bbr_sender_test.cc |
@@ -232,7 +232,7 @@ TEST_F(BbrSenderTest, SimpleTransferSmallBuffer) { |
} |
// Test a simple long data transfer with 2 rtts of aggregation. |
-TEST_F(BbrSenderTest, DISABLED_SimpleTransfer2RTTAggregation) { |
+TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregation) { |
QuicFlagSaver flags; |
FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = true; |
CreateDefaultSetup(); |
@@ -242,16 +242,83 @@ TEST_F(BbrSenderTest, DISABLED_SimpleTransfer2RTTAggregation) { |
// Transfer 12MB. |
DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); |
EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); |
- // It's possible to read a bandwidth as much as 25% too high with aggregation. |
+ // It's possible to read a bandwidth as much as 50% too high with aggregation. |
EXPECT_LE(kTestLinkBandwidth * 0.99f, |
sender_->ExportDebugState().max_bandwidth); |
// TODO(ianswett): Tighten this bound once we understand why BBR is |
// overestimating bandwidth with aggregation. b/36022633 |
- EXPECT_GE(kTestLinkBandwidth * 1.25f, |
+ EXPECT_GE(kTestLinkBandwidth * 1.5f, |
+ sender_->ExportDebugState().max_bandwidth); |
+ // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures |
+ // bandwidth higher than the link rate. |
+ // The margin here is high, because the aggregation greatly increases |
+ // smoothed rtt. |
+ EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); |
+ ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); |
+} |
+ |
+// Test a simple long data transfer with 2 rtts of aggregation. |
+TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes) { |
+ FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false; |
+ FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; |
+ CreateDefaultSetup(); |
+ // 2 RTTs of aggregation, with a max of 10kb. |
+ EnableAggregation(10 * 1024, 2 * kTestRtt); |
+ |
+ // Transfer 12MB. |
+ DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); |
+ EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); |
+ // It's possible to read a bandwidth as much as 50% too high with aggregation. |
+ EXPECT_LE(kTestLinkBandwidth * 0.99f, |
+ sender_->ExportDebugState().max_bandwidth); |
+ // TODO(ianswett): Tighten this bound once we understand why BBR is |
+ // overestimating bandwidth with aggregation. b/36022633 |
+ EXPECT_GE(kTestLinkBandwidth * 1.5f, |
+ sender_->ExportDebugState().max_bandwidth); |
+ // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures |
+ // bandwidth higher than the link rate. |
+ EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); |
+ // The margin here is high, because the aggregation greatly increases |
+ // smoothed rtt. |
+ EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); |
+ ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); |
+} |
+ |
+// Test a simple long data transfer with 2 rtts of aggregation. |
+TEST_F(BbrSenderTest, SimpleTransferAckDecimation) { |
+ FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false; |
+ FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; |
+ // Decrease the CWND gain so extra CWND is required with stretch acks. |
+ base::SetFlag(&FLAGS_quic_bbr_cwnd_gain, 1.0); |
+ sender_ = new BbrSender( |
+ rtt_stats_, |
+ QuicSentPacketManagerPeer::GetUnackedPacketMap( |
+ QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())), |
+ kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets, |
+ &random_); |
+ QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), sender_); |
+ // Enable Ack Decimation on the receiver. |
+ QuicConnectionPeer::SetAckMode(receiver_.connection(), |
+ QuicConnection::AckMode::ACK_DECIMATION); |
+ CreateDefaultSetup(); |
+ |
+ // Transfer 12MB. |
+ DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); |
+ EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); |
+ // It's possible to read a bandwidth as much as 50% too high with aggregation. |
+ EXPECT_LE(kTestLinkBandwidth * 0.99f, |
+ sender_->ExportDebugState().max_bandwidth); |
+ // TODO(ianswett): Tighten this bound once we understand why BBR is |
+ // overestimating bandwidth with aggregation. b/36022633 |
+ EXPECT_GE(kTestLinkBandwidth * 1.5f, |
sender_->ExportDebugState().max_bandwidth); |
// TODO(ianswett): Expect 0 packets are lost once BBR no longer measures |
// bandwidth higher than the link rate. |
EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); |
+ // The margin here is high, because the aggregation greatly increases |
+ // smoothed rtt. |
+ EXPECT_GE(kTestRtt * 2, rtt_stats_->smoothed_rtt()); |
+ ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); |
} |
// Test the number of losses incurred by the startup phase in a situation when |