| Index: net/quic/congestion_control/general_loss_algorithm.cc
|
| diff --git a/net/quic/congestion_control/general_loss_algorithm.cc b/net/quic/congestion_control/general_loss_algorithm.cc
|
| index 69623b0362a32de3abdbbc68d891b774f07ef7d3..685ad2f9a1fa66c5ffffbe9180a06ad505d241be 100644
|
| --- a/net/quic/congestion_control/general_loss_algorithm.cc
|
| +++ b/net/quic/congestion_control/general_loss_algorithm.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "net/quic/congestion_control/rtt_stats.h"
|
| #include "net/quic/quic_bug_tracker.h"
|
| +#include "net/quic/quic_flags.h"
|
| #include "net/quic/quic_protocol.h"
|
|
|
| namespace net {
|
| @@ -54,8 +55,23 @@ void GeneralLossAlgorithm::DetectLosses(
|
| continue;
|
| }
|
|
|
| - // TODO(ianswett): Combine this and the time based detection for FACK.
|
| - if (loss_type_ == kTime) {
|
| + if (FLAGS_quic_simplify_loss_detection && loss_type_ == kNack) {
|
| + // FACK based loss detection.
|
| + // TODO(ianswett): Pass in largest_newly_acked for FACK.
|
| + if (largest_observed - packet_number >=
|
| + kNumberOfNacksBeforeRetransmission) {
|
| + packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent));
|
| + continue;
|
| + }
|
| + }
|
| +
|
| + // Only early retransmit(RFC5827) when the last packet gets acked and
|
| + // there are retransmittable packets in flight.
|
| + // This also implements a timer-protected variant of FACK.
|
| + if ((FLAGS_quic_simplify_loss_detection &&
|
| + !it->retransmittable_frames.empty() &&
|
| + unacked_packets.largest_sent_packet() == largest_observed) ||
|
| + loss_type_ == kTime) {
|
| QuicTime when_lost = it->sent_time.Add(loss_delay);
|
| if (time < when_lost) {
|
| loss_detection_timeout_ = when_lost;
|
| @@ -64,15 +80,16 @@ void GeneralLossAlgorithm::DetectLosses(
|
| packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent));
|
| continue;
|
| }
|
| -
|
| - // FACK based loss detection.
|
| - QUIC_BUG_IF(it->nack_count == 0 && it->sent_time.IsInitialized())
|
| - << "All packets less than largest observed should have been nacked."
|
| - << " packet_number:" << packet_number
|
| - << " largest_observed:" << largest_observed;
|
| - if (it->nack_count >= kNumberOfNacksBeforeRetransmission) {
|
| - packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent));
|
| - continue;
|
| + if (!FLAGS_quic_simplify_loss_detection) {
|
| + // FACK based loss detection.
|
| + QUIC_BUG_IF(it->nack_count == 0 && it->sent_time.IsInitialized())
|
| + << "All packets less than largest observed should have been nacked."
|
| + << " packet_number:" << packet_number
|
| + << " largest_observed:" << largest_observed;
|
| + if (it->nack_count >= kNumberOfNacksBeforeRetransmission) {
|
| + packets_lost->push_back(std::make_pair(packet_number, it->bytes_sent));
|
| + continue;
|
| + }
|
| }
|
|
|
| // NACK-based loss detection allows for a max reordering window of 1 RTT.
|
| @@ -82,10 +99,8 @@ void GeneralLossAlgorithm::DetectLosses(
|
| continue;
|
| }
|
|
|
| - // Only early retransmit(RFC5827) when the last packet gets acked and
|
| - // there are retransmittable packets in flight.
|
| - // This also implements a timer-protected variant of FACK.
|
| - if (!it->retransmittable_frames.empty() &&
|
| + if (!FLAGS_quic_simplify_loss_detection &&
|
| + !it->retransmittable_frames.empty() &&
|
| unacked_packets.largest_sent_packet() == largest_observed) {
|
| // Early retransmit marks the packet as lost once 1.25RTTs have passed
|
| // since the packet was sent and otherwise sets an alarm.
|
|
|