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

Side by Side Diff: net/quic/core/congestion_control/bbr_sender_test.cc

Issue 2828523003: Deprecate FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 in the disabled position because it neve… (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « net/quic/core/congestion_control/bbr_sender.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/core/congestion_control/bbr_sender.h" 5 #include "net/quic/core/congestion_control/bbr_sender.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(30)); 285 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(30));
286 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); 286 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode);
287 ExpectApproxEq(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 287 ExpectApproxEq(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth,
288 0.01f); 288 0.01f);
289 EXPECT_GE(bbr_sender_.connection()->GetStats().packets_lost, 0u); 289 EXPECT_GE(bbr_sender_.connection()->GetStats().packets_lost, 0u);
290 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); 290 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
291 } 291 }
292 292
293 // Test a simple long data transfer with 2 rtts of aggregation. 293 // Test a simple long data transfer with 2 rtts of aggregation.
294 TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregation) {
295 QuicFlagSaver flags;
296 FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = true;
297 FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false;
298 CreateDefaultSetup();
299 // 2 RTTs of aggregation, with a max of 10kb.
300 EnableAggregation(10 * 1024, 2 * kTestRtt);
301
302 // Transfer 12MB.
303 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35));
304 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode);
305 // It's possible to read a bandwidth as much as 50% too high with aggregation.
306 EXPECT_LE(kTestLinkBandwidth * 0.99f,
307 sender_->ExportDebugState().max_bandwidth);
308 // TODO(ianswett): Tighten this bound once we understand why BBR is
309 // overestimating bandwidth with aggregation. b/36022633
310 EXPECT_GE(kTestLinkBandwidth * 1.5f,
311 sender_->ExportDebugState().max_bandwidth);
312 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures
313 // bandwidth higher than the link rate.
314 // The margin here is high, because the aggregation greatly increases
315 // smoothed rtt.
316 EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt());
317 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f);
318 }
319
320 // Test a simple long data transfer with 2 rtts of aggregation.
321 TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes) { 294 TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes) {
322 FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false;
323 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; 295 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true;
324 FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false; 296 FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false;
325 CreateDefaultSetup(); 297 CreateDefaultSetup();
326 // 2 RTTs of aggregation, with a max of 10kb. 298 // 2 RTTs of aggregation, with a max of 10kb.
327 EnableAggregation(10 * 1024, 2 * kTestRtt); 299 EnableAggregation(10 * 1024, 2 * kTestRtt);
328 300
329 // Transfer 12MB. 301 // Transfer 12MB.
330 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); 302 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35));
331 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); 303 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode);
332 // It's possible to read a bandwidth as much as 50% too high with aggregation. 304 // It's possible to read a bandwidth as much as 50% too high with aggregation.
333 EXPECT_LE(kTestLinkBandwidth * 0.99f, 305 EXPECT_LE(kTestLinkBandwidth * 0.99f,
334 sender_->ExportDebugState().max_bandwidth); 306 sender_->ExportDebugState().max_bandwidth);
335 // TODO(ianswett): Tighten this bound once we understand why BBR is 307 // TODO(ianswett): Tighten this bound once we understand why BBR is
336 // overestimating bandwidth with aggregation. b/36022633 308 // overestimating bandwidth with aggregation. b/36022633
337 EXPECT_GE(kTestLinkBandwidth * 1.5f, 309 EXPECT_GE(kTestLinkBandwidth * 1.5f,
338 sender_->ExportDebugState().max_bandwidth); 310 sender_->ExportDebugState().max_bandwidth);
339 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures 311 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures
340 // bandwidth higher than the link rate. 312 // bandwidth higher than the link rate.
341 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); 313 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
342 // The margin here is high, because the aggregation greatly increases 314 // The margin here is high, because the aggregation greatly increases
343 // smoothed rtt. 315 // smoothed rtt.
344 EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); 316 EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt());
345 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); 317 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f);
346 } 318 }
347 319
348 TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationKeepSending) { 320 TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationKeepSending) {
349 FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false;
350 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = false; 321 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = false;
351 FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false; 322 FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd = false;
352 FLAGS_quic_reloadable_flag_quic_bbr_keep_sending_at_recent_rate = true; 323 FLAGS_quic_reloadable_flag_quic_bbr_keep_sending_at_recent_rate = true;
353 CreateDefaultSetup(); 324 CreateDefaultSetup();
354 // 2 RTTs of aggregation, with a max of 10kb. 325 // 2 RTTs of aggregation, with a max of 10kb.
355 EnableAggregation(10 * 1024, 2 * kTestRtt); 326 EnableAggregation(10 * 1024, 2 * kTestRtt);
356 327
357 // Transfer 12MB. 328 // Transfer 12MB.
358 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); 329 DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35));
359 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); 330 EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode);
360 // It's possible to read a bandwidth as much as 50% too high with aggregation. 331 // It's possible to read a bandwidth as much as 50% too high with aggregation.
361 EXPECT_LE(kTestLinkBandwidth * 0.95f, 332 EXPECT_LE(kTestLinkBandwidth * 0.95f,
362 sender_->ExportDebugState().max_bandwidth); 333 sender_->ExportDebugState().max_bandwidth);
363 // TODO(ianswett): Tighten this bound once we understand why BBR is 334 // TODO(ianswett): Tighten this bound once we understand why BBR is
364 // overestimating bandwidth with aggregation. b/36022633 335 // overestimating bandwidth with aggregation. b/36022633
365 EXPECT_GE(kTestLinkBandwidth * 1.5f, 336 EXPECT_GE(kTestLinkBandwidth * 1.5f,
366 sender_->ExportDebugState().max_bandwidth); 337 sender_->ExportDebugState().max_bandwidth);
367 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures 338 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures
368 // bandwidth higher than the link rate. 339 // bandwidth higher than the link rate.
369 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); 340 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
370 // The margin here is high, because the aggregation greatly increases 341 // The margin here is high, because the aggregation greatly increases
371 // smoothed rtt. 342 // smoothed rtt.
372 EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); 343 EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt());
373 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); 344 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f);
374 } 345 }
375 346
376 // Test a simple long data transfer with 2 rtts of aggregation. 347 // Test a simple long data transfer with 2 rtts of aggregation.
377 TEST_F(BbrSenderTest, SimpleTransferAckDecimation) { 348 TEST_F(BbrSenderTest, SimpleTransferAckDecimation) {
378 FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false;
379 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true; 349 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = true;
380 // Decrease the CWND gain so extra CWND is required with stretch acks. 350 // Decrease the CWND gain so extra CWND is required with stretch acks.
381 base::SetFlag(&FLAGS_quic_bbr_cwnd_gain, 1.0); 351 base::SetFlag(&FLAGS_quic_bbr_cwnd_gain, 1.0);
382 sender_ = new BbrSender( 352 sender_ = new BbrSender(
383 rtt_stats_, 353 rtt_stats_,
384 QuicSentPacketManagerPeer::GetUnackedPacketMap( 354 QuicSentPacketManagerPeer::GetUnackedPacketMap(
385 QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())), 355 QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())),
386 kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets, 356 kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets,
387 &random_); 357 &random_);
388 QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), sender_); 358 QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), sender_);
(...skipping 15 matching lines...) Expand all
404 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures 374 // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures
405 // bandwidth higher than the link rate. 375 // bandwidth higher than the link rate.
406 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); 376 EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
407 // The margin here is high, because the aggregation greatly increases 377 // The margin here is high, because the aggregation greatly increases
408 // smoothed rtt. 378 // smoothed rtt.
409 EXPECT_GE(kTestRtt * 2, rtt_stats_->smoothed_rtt()); 379 EXPECT_GE(kTestRtt * 2, rtt_stats_->smoothed_rtt());
410 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f); 380 ExpectApproxEq(kTestRtt, rtt_stats_->min_rtt(), 0.1f);
411 } 381 }
412 382
413 TEST_F(BbrSenderTest, SimpleTransferAckDecimationKeepSending) { 383 TEST_F(BbrSenderTest, SimpleTransferAckDecimationKeepSending) {
414 FLAGS_quic_reloadable_flag_quic_bbr_ack_spacing2 = false;
415 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = false; 384 FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes = false;
416 FLAGS_quic_reloadable_flag_quic_bbr_keep_sending_at_recent_rate = true; 385 FLAGS_quic_reloadable_flag_quic_bbr_keep_sending_at_recent_rate = true;
417 // Decrease the CWND gain so extra CWND is required with stretch acks. 386 // Decrease the CWND gain so extra CWND is required with stretch acks.
418 base::SetFlag(&FLAGS_quic_bbr_cwnd_gain, 1.0); 387 base::SetFlag(&FLAGS_quic_bbr_cwnd_gain, 1.0);
419 sender_ = new BbrSender( 388 sender_ = new BbrSender(
420 rtt_stats_, 389 rtt_stats_,
421 QuicSentPacketManagerPeer::GetUnackedPacketMap( 390 QuicSentPacketManagerPeer::GetUnackedPacketMap(
422 QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())), 391 QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())),
423 kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets, 392 kInitialCongestionWindowPackets, kDefaultMaxCongestionWindowPackets,
424 &random_); 393 &random_);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 sender_->ResumeConnectionState(params, false); 760 sender_->ResumeConnectionState(params, false);
792 EXPECT_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth); 761 EXPECT_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth);
793 EXPECT_EQ(kTestLinkBandwidth, sender_->BandwidthEstimate()); 762 EXPECT_EQ(kTestLinkBandwidth, sender_->BandwidthEstimate());
794 ExpectApproxEq(kTestRtt, sender_->ExportDebugState().min_rtt, 0.01f); 763 ExpectApproxEq(kTestRtt, sender_->ExportDebugState().min_rtt, 0.01f);
795 764
796 DriveOutOfStartup(); 765 DriveOutOfStartup();
797 } 766 }
798 767
799 } // namespace test 768 } // namespace test
800 } // namespace net 769 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/congestion_control/bbr_sender.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698