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

Unified Diff: net/quic/core/quic_sent_packet_manager.cc

Issue 2392093002: Add a QUIC connection option to use a more conservative handshake retransmission timer. Protected … (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_sent_packet_manager.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_sent_packet_manager.cc
diff --git a/net/quic/core/quic_sent_packet_manager.cc b/net/quic/core/quic_sent_packet_manager.cc
index 7738e34381d960a0033f8bb186034d746ee93a45..89a1dc5ffa23bff721d4264aed7cb9ed18a9b8b5 100644
--- a/net/quic/core/quic_sent_packet_manager.cc
+++ b/net/quic/core/quic_sent_packet_manager.cc
@@ -38,6 +38,9 @@ const size_t kMinTimeoutsBeforePathDegrading = 2;
// This limits the tenth retransmitted packet to 10s after the initial CHLO.
static const int64_t kMinHandshakeTimeoutMs = 10;
+// Ensure the handshake timer isnt't faster than 25ms.
+static const int64_t kConservativeMinHandshakeTimeoutMs = kMaxDelayedAckTimeMs;
+
// Sends up to two tail loss probes before firing an RTO,
// per draft RFC draft-dukkipati-tcpm-tcp-loss-probe.
static const size_t kDefaultMaxTailLossProbes = 2;
@@ -85,6 +88,7 @@ QuicSentPacketManager::QuicSentPacketManager(
using_pacing_(false),
use_new_rto_(false),
undo_pending_retransmits_(false),
+ conservative_handshake_retransmits_(false),
largest_newly_acked_(0),
largest_mtu_acked_(0),
handshake_confirmed_(false) {
@@ -151,6 +155,10 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
if (config.HasClientSentConnectionOption(kUNDO, perspective_)) {
undo_pending_retransmits_ = true;
}
+ if (FLAGS_quic_conservative_handshake_retransmits &&
+ config.HasClientSentConnectionOption(kCONH, perspective_)) {
+ conservative_handshake_retransmits_ = true;
+ }
send_algorithm_->SetFromConfig(config, perspective_);
if (network_change_visitor_ != nullptr) {
@@ -816,11 +824,17 @@ const QuicTime::Delta QuicSentPacketManager::GetCryptoRetransmissionDelay()
// This is equivalent to the TailLossProbeDelay, but slightly more aggressive
// because crypto handshake messages don't incur a delayed ack time.
QuicTime::Delta srtt = rtt_stats_.smoothed_rtt();
+ int64_t delay_ms;
if (srtt.IsZero()) {
srtt = QuicTime::Delta::FromMicroseconds(rtt_stats_.initial_rtt_us());
}
- int64_t delay_ms = max(kMinHandshakeTimeoutMs,
- static_cast<int64_t>(1.5 * srtt.ToMilliseconds()));
+ if (conservative_handshake_retransmits_) {
+ delay_ms = max(kConservativeMinHandshakeTimeoutMs,
+ static_cast<int64_t>(2 * srtt.ToMilliseconds()));
+ } else {
+ delay_ms = max(kMinHandshakeTimeoutMs,
+ static_cast<int64_t>(1.5 * srtt.ToMilliseconds()));
+ }
return QuicTime::Delta::FromMilliseconds(
delay_ms << consecutive_crypto_retransmission_count_);
}
« no previous file with comments | « net/quic/core/quic_sent_packet_manager.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698