OLD | NEW |
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 <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "net/quic/core/congestion_control/rtt_stats.h" | 10 #include "net/quic/core/congestion_control/rtt_stats.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 case CONSERVATION: | 509 case CONSERVATION: |
510 if (is_round_start) { | 510 if (is_round_start) { |
511 recovery_state_ = GROWTH; | 511 recovery_state_ = GROWTH; |
512 } | 512 } |
513 | 513 |
514 case GROWTH: | 514 case GROWTH: |
515 // Exit recovery if appropriate. | 515 // Exit recovery if appropriate. |
516 if (!has_losses && last_acked_packet > end_recovery_at_) { | 516 if (!has_losses && last_acked_packet > end_recovery_at_) { |
517 recovery_state_ = NOT_IN_RECOVERY; | 517 recovery_state_ = NOT_IN_RECOVERY; |
| 518 return; |
| 519 } |
| 520 |
| 521 if (!FLAGS_quic_reloadable_flag_quic_bbr_extra_conservation) { |
| 522 return; |
| 523 } |
| 524 |
| 525 // Use "single round in conservation" approach outside of PROBE_BW. |
| 526 if (mode_ != PROBE_BW) { |
| 527 return; |
| 528 } |
| 529 |
| 530 // Switch between conservation and growth depending on position in the |
| 531 // gain cycle. |
| 532 if (cycle_current_offset_ == 0 || |
| 533 cycle_current_offset_ == kGainCycleLength - 1) { |
| 534 recovery_state_ = GROWTH; |
| 535 } else { |
| 536 recovery_state_ = CONSERVATION; |
518 } | 537 } |
519 break; | 538 break; |
520 } | 539 } |
521 } | 540 } |
522 | 541 |
523 void BbrSender::UpdateAckAggregationBytes(QuicTime ack_time, | 542 void BbrSender::UpdateAckAggregationBytes(QuicTime ack_time, |
524 QuicByteCount newly_acked_bytes) { | 543 QuicByteCount newly_acked_bytes) { |
525 // Compute how many bytes are expected to be delivered, assuming max bandwidth | 544 // Compute how many bytes are expected to be delivered, assuming max bandwidth |
526 // is correct. | 545 // is correct. |
527 QuicByteCount expected_bytes_acked = | 546 QuicByteCount expected_bytes_acked = |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 os << "Minimum RTT timestamp: " << state.min_rtt_timestamp.ToDebuggingValue() | 708 os << "Minimum RTT timestamp: " << state.min_rtt_timestamp.ToDebuggingValue() |
690 << std::endl; | 709 << std::endl; |
691 | 710 |
692 os << "Last sample is app-limited: " | 711 os << "Last sample is app-limited: " |
693 << (state.last_sample_is_app_limited ? "yes" : "no"); | 712 << (state.last_sample_is_app_limited ? "yes" : "no"); |
694 | 713 |
695 return os; | 714 return os; |
696 } | 715 } |
697 | 716 |
698 } // namespace net | 717 } // namespace net |
OLD | NEW |