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/03/30 01:53:12 UTC

[trafficserver] branch quic-latest updated: Update packet recovery logic to draft-10

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

maskit 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 b7c07e5  Update packet recovery logic to draft-10
b7c07e5 is described below

commit b7c07e5b45c7ec0cc2eb6f2a8e0f47ccdb1401bb
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Fri Mar 30 10:52:37 2018 +0900

    Update packet recovery logic to draft-10
---
 iocore/net/quic/QUICCongestionController.cc | 10 ++++++++--
 iocore/net/quic/QUICLossDetector.cc         |  4 ++--
 iocore/net/quic/QUICLossDetector.h          |  2 ++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/iocore/net/quic/QUICCongestionController.cc b/iocore/net/quic/QUICCongestionController.cc
index d06c090..44f4de9 100644
--- a/iocore/net/quic/QUICCongestionController.cc
+++ b/iocore/net/quic/QUICCongestionController.cc
@@ -41,12 +41,18 @@ QUICCongestionController::on_packet_sent(size_t bytes_sent)
   this->_bytes_in_flight += bytes_sent;
 }
 
+bool
+QUICCongestionController::_in_recovery(QUICPacketNumber packet_number)
+{
+  return packet_number <= this->_end_of_recovery;
+}
+
 void
 QUICCongestionController::on_packet_acked(QUICPacketNumber acked_packet_number, size_t acked_packet_size)
 {
   // Remove from bytes_in_flight.
   this->_bytes_in_flight -= acked_packet_size;
-  if (acked_packet_number < this->_end_of_recovery) {
+  if (this->_in_recovery(acked_packet_number)) {
     // Do not increase congestion window in recovery period.
     return;
   }
@@ -69,7 +75,7 @@ QUICCongestionController::on_packets_lost(std::map<QUICPacketNumber, PacketInfo
   QUICPacketNumber largest_lost_packet = lost_packets.rbegin()->first;
   // Start a new recovery epoch if the lost packet is larger
   // than the end of the previous recovery epoch.
-  if (this->_end_of_recovery < largest_lost_packet) {
+  if (!this->_in_recovery(largest_lost_packet)) {
     this->_end_of_recovery = largest_lost_packet;
     this->_congestion_window *= LOSS_REDUCTION_FACTOR;
     this->_congestion_window = std::max(this->_congestion_window, MINIMUM_WINDOW);
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index 015d061..68a0ba1 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -299,7 +299,7 @@ QUICLossDetector::_set_loss_detection_alarm()
     } else {
       alarm_duration = 2 * this->_smoothed_rtt;
     }
-    alarm_duration = std::max(alarm_duration, MIN_TLP_TIMEOUT);
+    alarm_duration = std::max(alarm_duration + this->_max_ack_delay, MIN_TLP_TIMEOUT);
     alarm_duration = alarm_duration * (1 << this->_handshake_count);
     QUICLDDebug("Handshake retransmission alarm will be set");
   } else if (this->_loss_time != 0) {
@@ -312,7 +312,7 @@ QUICLossDetector::_set_loss_detection_alarm()
     QUICLDDebug("TLP alarm will be set");
   } else {
     // RTO alarm
-    alarm_duration = this->_smoothed_rtt + 4 * this->_rttvar;
+    alarm_duration = this->_smoothed_rtt + 4 * this->_rttvar + this->_max_ack_delay;
     alarm_duration = std::max(alarm_duration, MIN_RTO_TIMEOUT);
     alarm_duration = alarm_duration * (1 << this->_rto_count);
     QUICLDDebug("RTO alarm will be set");
diff --git a/iocore/net/quic/QUICLossDetector.h b/iocore/net/quic/QUICLossDetector.h
index 7a34d89..d6e21e7 100644
--- a/iocore/net/quic/QUICLossDetector.h
+++ b/iocore/net/quic/QUICLossDetector.h
@@ -63,6 +63,8 @@ private:
   uint32_t _congestion_window       = 0;
   QUICPacketNumber _end_of_recovery = 0;
   uint32_t _ssthresh                = UINT32_MAX;
+
+  bool _in_recovery(QUICPacketNumber packet_number);
 };
 
 class QUICLossDetector : public Continuation, public QUICFrameHandler

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