gfe-relnote: For better experimentation, add QUIC connection option ELDT to enable loss detection tuning. No behavior change, not protected.
Loss detection tuning is only enabled if ELDT is set and SetLossDetectionTuner is called. GFE does not call SetLossDetectionTuner, so it has no behavior change.
PiperOrigin-RevId: 305263247
Change-Id: If65144a52f4f483303877a6ffede37e4e2ea22b6
diff --git a/quic/core/congestion_control/general_loss_algorithm.h b/quic/core/congestion_control/general_loss_algorithm.h
index 7ab0d53..046a01d 100644
--- a/quic/core/congestion_control/general_loss_algorithm.h
+++ b/quic/core/congestion_control/general_loss_algorithm.h
@@ -29,6 +29,9 @@
GeneralLossAlgorithm& operator=(const GeneralLossAlgorithm&) = delete;
~GeneralLossAlgorithm() override {}
+ void SetFromConfig(const QuicConfig& /*config*/,
+ Perspective /*perspective*/) override {}
+
// Uses |largest_acked| and time to decide when packets are lost.
void DetectLosses(const QuicUnackedPacketMap& unacked_packets,
QuicTime time,
diff --git a/quic/core/congestion_control/loss_detection_interface.h b/quic/core/congestion_control/loss_detection_interface.h
index 729cbad..2ed7952 100644
--- a/quic/core/congestion_control/loss_detection_interface.h
+++ b/quic/core/congestion_control/loss_detection_interface.h
@@ -8,8 +8,10 @@
#define QUICHE_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
+#include "net/third_party/quiche/src/quic/core/quic_config.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
namespace quic {
@@ -20,6 +22,10 @@
class QUIC_EXPORT_PRIVATE LossDetectionInterface {
public:
virtual ~LossDetectionInterface() {}
+
+ virtual void SetFromConfig(const QuicConfig& config,
+ Perspective perspective) = 0;
+
// Called when a new ack arrives or the loss alarm fires.
virtual void DetectLosses(const QuicUnackedPacketMap& unacked_packets,
QuicTime time,
diff --git a/quic/core/congestion_control/uber_loss_algorithm.cc b/quic/core/congestion_control/uber_loss_algorithm.cc
index 73b26f5..0bbc2b1 100644
--- a/quic/core/congestion_control/uber_loss_algorithm.cc
+++ b/quic/core/congestion_control/uber_loss_algorithm.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
namespace quic {
@@ -17,6 +18,15 @@
}
}
+void UberLossAlgorithm::SetFromConfig(const QuicConfig& config,
+ Perspective perspective) {
+ if (config.HasClientRequestedIndependentOption(kELDT, perspective) &&
+ tuner_ != nullptr) {
+ tuning_enabled_ = true;
+ MaybeStartTuning();
+ }
+}
+
void UberLossAlgorithm::DetectLosses(
const QuicUnackedPacketMap& unacked_packets,
QuicTime time,
@@ -78,7 +88,7 @@
}
void UberLossAlgorithm::MaybeStartTuning() {
- if (tuner_ == nullptr || tuner_started_) {
+ if (tuner_started_ || !tuning_enabled_ || !min_rtt_available_) {
return;
}
@@ -88,6 +98,7 @@
void UberLossAlgorithm::OnConfigNegotiated() {}
void UberLossAlgorithm::OnMinRttAvailable() {
+ min_rtt_available_ = true;
MaybeStartTuning();
}
diff --git a/quic/core/congestion_control/uber_loss_algorithm.h b/quic/core/congestion_control/uber_loss_algorithm.h
index ff1ac81..29d68ae 100644
--- a/quic/core/congestion_control/uber_loss_algorithm.h
+++ b/quic/core/congestion_control/uber_loss_algorithm.h
@@ -46,6 +46,9 @@
UberLossAlgorithm& operator=(const UberLossAlgorithm&) = delete;
~UberLossAlgorithm() override {}
+ void SetFromConfig(const QuicConfig& config,
+ Perspective perspective) override;
+
// Detects lost packets.
void DetectLosses(const QuicUnackedPacketMap& unacked_packets,
QuicTime time,
@@ -103,6 +106,8 @@
std::unique_ptr<LossDetectionTunerInterface> tuner_;
LossDetectionParameters tuned_parameters_;
bool tuner_started_ = false;
+ bool min_rtt_available_ = false;
+ bool tuning_enabled_ = false; // Whether tuning is enabled by config.
};
} // namespace quic
diff --git a/quic/core/crypto/crypto_protocol.h b/quic/core/crypto/crypto_protocol.h
index 8af8a04..aaa2d6f 100644
--- a/quic/core/crypto/crypto_protocol.h
+++ b/quic/core/crypto/crypto_protocol.h
@@ -226,6 +226,8 @@
// and at least 1.5*srtt from
// last sent packet.
+const QuicTag kELDT = TAG('E', 'L', 'D', 'T'); // Enable Loss Detection Tuning
+
// Optional support of truncated Connection IDs. If sent by a peer, the value
// is the minimum number of bytes allowed for the connection ID sent to the
// peer.
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index 22fe8cc..b5c15db 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -299,6 +299,7 @@
conservative_handshake_retransmits_ = true;
}
send_algorithm_->SetFromConfig(config, perspective);
+ loss_algorithm_->SetFromConfig(config, perspective);
if (network_change_visitor_ != nullptr) {
network_change_visitor_->OnCongestionChange();
diff --git a/quic/test_tools/quic_test_utils.h b/quic/test_tools/quic_test_utils.h
index e30f484..8414d7b 100644
--- a/quic/test_tools/quic_test_utils.h
+++ b/quic/test_tools/quic_test_utils.h
@@ -1019,6 +1019,9 @@
MockLossAlgorithm& operator=(const MockLossAlgorithm&) = delete;
~MockLossAlgorithm() override;
+ MOCK_METHOD2(SetFromConfig,
+ void(const QuicConfig& config, Perspective perspective));
+
MOCK_METHOD6(DetectLosses,
void(const QuicUnackedPacketMap& unacked_packets,
QuicTime time,