Re: [quicwg/base-drafts] Fix time loss detection and early retransmit (#394)

janaiyengar <notifications@github.com> Mon, 13 March 2017 17:51 UTC

Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BB4E312944A for <quic-issues@ietfa.amsl.com>; Mon, 13 Mar 2017 10:51:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xL39Cextd-SK for <quic-issues@ietfa.amsl.com>; Mon, 13 Mar 2017 10:51:56 -0700 (PDT)
Received: from o8.sgmail.github.com (o8.sgmail.github.com [167.89.101.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EEE3F12941E for <quic-issues@ietf.org>; Mon, 13 Mar 2017 10:51:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=io3hVS+6p83iyxCtND3sxhknRhE=; b=sLmvnCrzZSaZap1S DWIhofcnRuI7zldn48ni2G6l+b13pBAIZq0H8y7h4gkgMr36RHnldaFVMRn9ahe0 EDfsfCcQPnU1LHKyBRs27Un/x5j2mAoujhabJ4+sRbqUXtG6elVc6ixRlrNqGpU/ IZBxObB8ihZi02hwhtMn42vkEeI=
Received: by filter0642p1mdw1.sendgrid.net with SMTP id filter0642p1mdw1-15004-58C6DC39-17 2017-03-13 17:51:53.231978317 +0000 UTC
Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2a-ext-cp1-prd.iad.github.net [192.30.253.16]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id _J8QRWpuSLujRkfM6Qu5Qw for <quic-issues@ietf.org>; Mon, 13 Mar 2017 17:51:53.224 +0000 (UTC)
Date: Mon, 13 Mar 2017 10:51:53 -0700
From: janaiyengar <notifications@github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/394/review/26611754@github.com>
In-Reply-To: <quicwg/base-drafts/pull/394@github.com>
References: <quicwg/base-drafts/pull/394@github.com>
Subject: Re: [quicwg/base-drafts] Fix time loss detection and early retransmit (#394)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_58c6dc391252f_2f5b3febc648bc2c1814b2"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: janaiyengar
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak0oMlHIXjWzZ4uH2ZklN1B8uJ1qoSyq/4RF/+ Sa4vpQDRuk9OtEfnMBz79udqKLelorNb6qGLdZT4xN2+OM2ktPtrHRIewX8oeq8S/D7zuaojPGN53i 6/VgvqblLf7QmUQQz8N36fkfhmUYSmdc5xSeazPOTMi0/IPsYFSsmyuRFa1GiKwGkj11MdOLdSCU4a M=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/ks_SDLzD7PbZQE0vGMojWZiYEAs>
Cc: Subscribed <subscribed@noreply.github.com>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.17
Reply-To: quic@ietf.org
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Mar 2017 17:51:59 -0000

janaiyengar commented on this pull request.

Thanks Ian, a few comments

>  
-use_time_loss:
-: When true, loss detection operates solely based on reordering
-  threshold in time, rather than in packet number gaps.
+loss_time:
+: The time at which the next packet will be considered lost based on early
+transmit or exceeding the reordering window in time.

early transmit --> early retransmit

>  
 sent_packets:
-: An association of packet numbers to information about them, including a time
-  field indicating the time a packet was sent and a bytes field indicating the
-  packet's size.
+: An association of packet numbers to information about them, including a number
+  field indicating the packet number, a time field indicating the time a packet
+  was sent and a bytes field indicating the packet's size.  sent_packets is

oxford comma nit: "... was sent, and a bytes field ..."

>  
 sent_packets:
-: An association of packet numbers to information about them, including a time
-  field indicating the time a packet was sent and a bytes field indicating the
-  packet's size.
+: An association of packet numbers to information about them, including a number
+  field indicating the packet number, a time field indicating the time a packet
+  was sent and a bytes field indicating the packet's size.  sent_packets is
+  ordered by packet number, and packets remain in sent_packets until
+  acknowledged or lost.

nit: "until they are acknowledged or lost"

> @@ -258,8 +258,13 @@ follows:
    handshake_count = 0
    tlp_count = 0
    rto_count = 0
-   reordering_threshold = kReorderingThreshold
-   use_time_loss = false
+   if (UsingTimeLossDetection())
+     reordering_threshold = infinite
+     time_reordering_fraction = kTimeReorderingFraction
+   else:
+     reordering_threshold = kReorderingThreshold
+     time_reordering_fraction = infinite
+   lost_time = 0

loss_time = 0

> @@ -406,10 +410,9 @@ Pseudocode for SetLossDetectionAlarm follows:
         alarm_duration = 2 * smoothed_rtt
       alarm_duration = max(alarm_duration, kMinTLPTimeout)
       alarm_duration = alarm_duration << handshake_count
-    else if (largest sent packet is acked):
-      // Early retransmit
-      // with an alarm to reduce spurious retransmits.

I think this comment can fit in a line

> @@ -442,9 +445,9 @@ Pseudocode for OnLossDetectionAlarm follows:
        RetransmitAllHandshakePackets();
        handshake_count++;
      // TODO: Clarify early retransmit and time loss.
-     else if ():
+     else if (lost_time != 0):

loss_time

> @@ -463,9 +466,9 @@ Pseudocode for OnLossDetectionAlarm follows:
 ## Detecting Lost Packets
 
 Packets in QUIC are only considered lost once a larger packet number is
-acknowledged.  DetectLostPackets is called every time there is a new largest
-packet or if the loss detection alarm fires the previous largest acked packet is
-supplied.
+acknowledged.  DetectLostPackets is called every time an ack is received.
+If the loss detection alarm fires and the lost_time is set, the previous

Make loss_time or lost_time consistent. Either works. How about "reordering_threshold_in_time" and "reordering_threshold_in_packets" (or remove the "in" if you want more succinct) instead of loss_time and reordering_threshold ?

> @@ -463,9 +466,9 @@ Pseudocode for OnLossDetectionAlarm follows:
 ## Detecting Lost Packets
 
 Packets in QUIC are only considered lost once a larger packet number is
-acknowledged.  DetectLostPackets is called every time there is a new largest
-packet or if the loss detection alarm fires the previous largest acked packet is
-supplied.
+acknowledged.  DetectLostPackets is called every time an ack is received.
+If the loss detection alarm fires and the lost_time is set, the previous
+largest acked packet is supplied.

This paragraph is a little discontinuous. Let's submit it and we can fix it up later

> @@ -481,19 +484,31 @@ DetectLostPackets takes one parameter, acked, which is the largest acked packet.
 Pseudocode for DetectLostPackets follows:
 
 ~~~
-   DetectLostPackets(acked):
+   DetectLostPackets(largest_acked):

nit: "largest_acked" --> "largest_acked_number" ?

>       lost_packets = {}
-     foreach (unacked less than acked):
-       time_delta = acked.time_sent - unacked.time_sent
-       packet_delta = acked.packet_number - unacked.packet_number
-       if (time_delta > kTimeReorderThreshold * smoothed_rtt):
+     time_when_lost = 0;

This isn't the time but a wait period... suggestion: reordering_period ? or "short_timeout"? you could just call it short_timeout_period... up to you

>       lost_packets = {}
-     foreach (unacked less than acked):
-       time_delta = acked.time_sent - unacked.time_sent
-       packet_delta = acked.packet_number - unacked.packet_number
-       if (time_delta > kTimeReorderThreshold * smoothed_rtt):
+     time_when_lost = 0;
+     if (time_reordering_fraction == infinite):

This should be !=

>       lost_packets = {}
-     foreach (unacked less than acked):
-       time_delta = acked.time_sent - unacked.time_sent
-       packet_delta = acked.packet_number - unacked.packet_number
-       if (time_delta > kTimeReorderThreshold * smoothed_rtt):
+     time_when_lost = 0;
+     if (time_reordering_fraction == infinite):
+       time_when_lost =
+         (1 + time_reordering_fraction) * max(latest_rtt, smoothed_rtt)
+     else if (largest_acked.packet_number == largest_sent_packet):
+       // Early retransmit alarm.
+       time_when_lost = 9/8 * max(latest_rtt, smoothed_rtt)
+     foreach (unacked less than largest_acked.packet_number):
+       time_since_sent = now() - unacked.time_sent
+       packet_delta = largest_acked.packet_number - unacked.packet_number
+       if (time_since_sent > time_when_lost):

if time loss detection is disabled, won't time_when_lost be 0?

>           lost_packets.insert(unacked)
        else if (packet_delta > reordering_threshold)
          lost_packets.insert(unacked)
+       else if (loss_time == 0 && time_when_lost != 0):
+         loss_time = time_when_lost - time_since_sent

add a comment here saying something like "loss_time is used for setting the loss detection alarm later."

>       OnPacketsLost(lost_packets)
-     MaybeRetransmit(lost_packets)
+     foreach (packet in lost_packets)
+       sent_packets.remove(packet.packet_number)

does it make sense, for editorializing, to move these packets to a "lost_packets" structure? doesn't need to be done here, but thinking aloud

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/394#pullrequestreview-26611754