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 2017/12/18 02:50:50 UTC

[trafficserver] branch quic-latest updated: Implement TLP and RTO

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 e317a52  Implement TLP and RTO
e317a52 is described below

commit e317a528e028c0fdf3076d2b75d7e02de6efdbbc
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Dec 18 11:48:45 2017 +0900

    Implement TLP and RTO
---
 iocore/net/QUICNetVConnection.cc    | 10 ++++++----
 iocore/net/quic/QUICLossDetector.cc | 32 ++++++++++++++++++++++++++++++--
 iocore/net/quic/QUICLossDetector.h  |  2 ++
 3 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 587ba71..68fb459 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -218,10 +218,12 @@ QUICNetVConnection::_transmit_packet(QUICPacketUPtr packet)
 {
   SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread());
 
-  QUICConDebug("Packet Number=%" PRIu64 " Type=%s Size=%hu", packet->packet_number(), QUICDebugNames::packet_type(packet->type()),
-               packet->size());
-  // TODO Remove const_cast
-  this->_packet_send_queue.enqueue(const_cast<QUICPacket *>(packet.release()));
+  if (packet) {
+    QUICConDebug("Packet Number=%" PRIu64 " Type=%s Size=%hu", packet->packet_number(), QUICDebugNames::packet_type(packet->type()),
+                 packet->size());
+    // TODO Remove const_cast
+    this->_packet_send_queue.enqueue(const_cast<QUICPacket *>(packet.release()));
+  }
   return this->_packet_send_queue.size;
 }
 
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index b90b0d4..405e2d6 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -263,14 +263,16 @@ QUICLossDetector::_on_loss_detection_alarm()
     this->_detect_lost_packets(this->_largest_acked_packet);
   } else if (this->_tlp_count < this->_MAX_TLPS) {
     // Tail Loss Probe.
-    // this->_send_one_packet();
+    QUICLDDebug("TLP");
+    this->_send_one_packet();
     this->_tlp_count++;
   } else {
     // RTO.
     if (this->_rto_count == 0) {
       this->_largest_sent_before_rto = this->_largest_sent_packet;
     }
-    // this->_send_two_packets();
+    QUICLDDebug("RTO");
+    this->_send_two_packets();
     this->_rto_count++;
   }
   QUICLDDebug("Unacked packets %lu (retransmittable %u, includes %u handshake packets)", this->_sent_packets.size(),
@@ -386,3 +388,29 @@ QUICLossDetector::_retransmit_handshake_packets()
     --this->_retransmittable_outstanding;
   }
 }
+
+void
+QUICLossDetector::_send_one_packet()
+{
+  if (this->_transmitter->transmit_packet() < 1) {
+    auto ite = this->_sent_packets.rbegin();
+    if (ite != this->_sent_packets.rend()) {
+      this->_transmitter->retransmit_packet(*ite->second->packet);
+    }
+  }
+}
+
+void
+QUICLossDetector::_send_two_packets()
+{
+  auto ite = this->_sent_packets.rbegin();
+  if (ite != this->_sent_packets.rend()) {
+    this->_transmitter->retransmit_packet(*ite->second->packet);
+    ite++;
+    if (ite != this->_sent_packets.rend()) {
+      this->_transmitter->retransmit_packet(*ite->second->packet);
+    }
+  } else {
+    this->_transmitter->transmit_packet();
+  }
+}
diff --git a/iocore/net/quic/QUICLossDetector.h b/iocore/net/quic/QUICLossDetector.h
index d72785c..ce2c629 100644
--- a/iocore/net/quic/QUICLossDetector.h
+++ b/iocore/net/quic/QUICLossDetector.h
@@ -115,6 +115,8 @@ private:
   std::set<QUICPacketNumber> _determine_newly_acked_packets(const QUICAckFrame &ack_frame);
 
   void _retransmit_handshake_packets();
+  void _send_one_packet();
+  void _send_two_packets();
 
   QUICPacketTransmitter *_transmitter = nullptr;
   QUICCongestionController *_cc       = nullptr;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].