You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/04/02 04:35:12 UTC

[trafficserver] branch quic-latest updated: QUIC: Change QUIC closing period dynamically

This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new b49f6c8  QUIC: Change QUIC closing period dynamically
b49f6c8 is described below

commit b49f6c8784458d5b60762ffe6a2d113495126c32
Author: scw00 <sc...@apache.org>
AuthorDate: Sat Mar 31 10:55:42 2018 +0800

    QUIC: Change QUIC closing period dynamically
---
 iocore/net/QUICNetVConnection.cc    | 16 ++++++++--------
 iocore/net/quic/QUICLossDetector.cc | 10 ++++++++++
 iocore/net/quic/QUICLossDetector.h  |  1 +
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 21bbcc1..1f74784 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -1522,16 +1522,16 @@ QUICNetVConnection::_switch_to_closing_state(QUICConnectionErrorUPtr error)
   this->remove_from_active_queue();
   this->set_inactivity_timeout(0);
 
-  QUICConDebug("Enter state_connection_closing");
+  ink_hrtime rto = this->_loss_detector->current_rto_period();
+
+  QUICConDebug("Enter state_connection_closing %" PRIu64 "ms", 3 * rto / HRTIME_MSECOND);
   SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closing);
 
   // This states SHOULD persist for three times the
   // current Retransmission Timeout (RTO) interval as defined in
   // [QUIC-RECOVERY].
 
-  // TODO The closing period should be obtained from QUICLossDetector since it is the only component that knows the RTO interval.
-  // Use 3 times kkMinRTOTimeout(200ms) for now.
-  this->_schedule_closing_timeout(HRTIME_MSECONDS(3 * 200));
+  this->_schedule_closing_timeout(3 * rto);
 }
 
 void
@@ -1549,16 +1549,16 @@ QUICNetVConnection::_switch_to_draining_state(QUICConnectionErrorUPtr error)
   this->remove_from_active_queue();
   this->set_inactivity_timeout(0);
 
-  QUICConDebug("Enter state_connection_draining");
+  ink_hrtime rto = this->_loss_detector->current_rto_period();
+
+  QUICConDebug("Enter state_connection_draining %" PRIu64 "ms", 3 * rto / HRTIME_MSECOND);
   SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_draining);
 
   // This states SHOULD persist for three times the
   // current Retransmission Timeout (RTO) interval as defined in
   // [QUIC-RECOVERY].
 
-  // TODO The draining period should be obtained from QUICLossDetector since it is the only component that knows the RTO interval.
-  // Use 3 times kkMinRTOTimeout(200ms) for now.
-  this->_schedule_closing_timeout(HRTIME_MSECONDS(3 * 200));
+  this->_schedule_closing_timeout(3 * rto);
 }
 
 void
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index ddeaf21..c94935c 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -540,3 +540,13 @@ QUICLossDetector::_remove_from_sent_packet_list(QUICPacketNumber packet_number)
   // Remove from the list
   this->_sent_packets.erase(packet_number);
 }
+
+ink_hrtime
+QUICLossDetector::current_rto_period()
+{
+  ink_hrtime alarm_duration;
+  alarm_duration = this->_smoothed_rtt + 4 * this->_rttvar + this->_max_ack_delay;
+  alarm_duration = std::max(alarm_duration, this->_k_min_rto_timeout);
+  alarm_duration = alarm_duration * (1 << this->_rto_count);
+  return alarm_duration;
+}
diff --git a/iocore/net/quic/QUICLossDetector.h b/iocore/net/quic/QUICLossDetector.h
index b129b4a..3fd79fa 100644
--- a/iocore/net/quic/QUICLossDetector.h
+++ b/iocore/net/quic/QUICLossDetector.h
@@ -80,6 +80,7 @@ public:
   void on_packet_sent(QUICPacketUPtr packet);
   QUICPacketNumber largest_acked_packet_number();
   void reset();
+  ink_hrtime current_rto_period();
 
 private:
   Ptr<ProxyMutex> _loss_detection_mutex;

-- 
To stop receiving notification emails like this one, please contact
masaori@apache.org.