Re: [tcpm] On Sender Control of Delayed Acks in TCP

Neal Cardwell <ncardwell@google.com> Sat, 02 May 2020 14:11 UTC

Return-Path: <ncardwell@google.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 66FA83A1280 for <tcpm@ietfa.amsl.com>; Sat, 2 May 2020 07:11:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.6
X-Spam-Level:
X-Spam-Status: No, score=-17.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 Pt2WXtiHmicD for <tcpm@ietfa.amsl.com>; Sat, 2 May 2020 07:11:09 -0700 (PDT)
Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) (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 894123A127E for <tcpm@ietf.org>; Sat, 2 May 2020 07:11:09 -0700 (PDT)
Received: by mail-vs1-xe43.google.com with SMTP id y185so8077758vsy.8 for <tcpm@ietf.org>; Sat, 02 May 2020 07:11:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JhjWoqc81oVGyvIcoPNH0YZHMJBY6HLL/X9huCXO8NQ=; b=ipeNhGYUbtP2a6G1/yEtgGHlEYg+FpQjYz+Weq+Fq3hakl1Mz9URNHOU3cnPm7o54I eYvVBPuyqyeut6y15kAxowvTz478+/ABT40I88Rcn1UpmgXhRjQnalvrj9dMVUxzluRU xtM0ap0kPXg4Sc6AE0MgKdjNWKTXOVSxXFByYbMkRIikzAg8P9oG6uNa+3HUunaNeyo/ h1Q87FTUo6Ifp+44vKd+0AdiZvDz/Z6v/8YUNjPtRdVtjYz1CPgRUuhCGW0uPcuWnNEE FakrNdy3H4xyUdp85CcLNRexwDerRM2Ud3To4cqj3XoZuaAjEXCZ7D1LOXnQKB9kw6IQ zfEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JhjWoqc81oVGyvIcoPNH0YZHMJBY6HLL/X9huCXO8NQ=; b=CnzESftCBtcAlIsFNZnWWcCIYzkjqxPBcpyAvW2tE+xZxacx/QtkhnXplqvknT6JqO z1lcPXzHsLyq7cZtMk8NmkF5BM8UbrUlQR55Kcp+Yc6xfaUytWrbN03YRyZzkbjUhGCy 2lpCLIz3PLI/w/kFg2l7SWM1Dcw1YMtFG6i9oI7LGeyxAn2BV+ChRzTaWY6X5NVyils2 9Ol+w4L1LW5ODrYsThyAkqAT08/CjxYnXqr09/AFe/pnIy9X0sljkVm92FcLoChAKXS1 DOV25A2yc/VDQAR0Fs0owjidEnYBU5rlpMtQl2SjNlE5wcPxldr/V87zCdinVWCvPJqC jGng==
X-Gm-Message-State: AGi0Pub+/aELQxaBIFvT77XUTZMl0DXox+LztLYI3iitpL3hLjNs+9/v NJMcg2NMtg3CvXxoG5w2obkJh8p77k14SFJb9tf8vg==
X-Google-Smtp-Source: APiQypLY1U0LVv/ng294HH20mk5LGyxaKF0g3TT5avI5FtaEgR0De02IzKM+A+axu6l0vO4p06n2de8sW8P/fQayEwI=
X-Received: by 2002:a67:8704:: with SMTP id j4mr6607015vsd.219.1588428668093; Sat, 02 May 2020 07:11:08 -0700 (PDT)
MIME-Version: 1.0
References: <683902e8-a2af-cfb7-ffd0-c5c5742e5bd5@gmx.at> <CADVnQykY3OqXy=RcEfa-OpfK2x=W5_FTrdrx7PvKuqgEt92uNw@mail.gmail.com> <7d145f1203f6344b92f6f8aa11a78239.squirrel@webmail.entel.upc.edu> <CADVnQy=wPUx62y7VNqjSPP+snKX4vVvK5q=qqYb1j+0nGrtezQ@mail.gmail.com> <c6da08f4-03d7-da46-26b1-168f5953329f@bobbriscoe.net> <909de4172e46712f543f723d0ae2d638.squirrel@webmail.entel.upc.edu>
In-Reply-To: <909de4172e46712f543f723d0ae2d638.squirrel@webmail.entel.upc.edu>
From: Neal Cardwell <ncardwell@google.com>
Date: Sat, 02 May 2020 10:10:49 -0400
Message-ID: <CADVnQynE3EMh-9qX7TkxifNvaKke7=PpWW2nB3Z6t1q7CYQXbg@mail.gmail.com>
To: Carles Gomez Montenegro <carlesgo@entel.upc.edu>
Cc: Bob Briscoe <ietf@bobbriscoe.net>, "Scheffenegger, Richard" <rs.ietf@gmx.at>, "tcpm@ietf.org" <tcpm@ietf.org>, Gorry Fairhurst <gorry@erg.abdn.ac.uk>, jon.crowcroft@cl.cam.ac.uk
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/9Z5oT5QOA9Ho9zbiqzaYFmfxVZ0>
Subject: Re: [tcpm] On Sender Control of Delayed Acks in TCP
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 02 May 2020 14:11:15 -0000

On Sat, May 2, 2020 at 5:40 AM Carles Gomez Montenegro
<carlesgo@entel.upc.edu> wrote:
>
> Hi Bob,
>
> (Chiming in...)
>
> > Neal,
> >
> > On 01/05/2020 13:19, Neal Cardwell wrote:
> >> On Fri, May 1, 2020 at 6:23 AM Carles Gomez Montenegro
> >> <carlesgo@entel.upc.edu> wrote:
> >>> Hi Neil,
> >>>
> >>> Thanks a lot for your comments!
> >>>
> >>> Please find below my inline responses:
> >>>
> >>>> On Wed, Apr 29, 2020 at 1:03 PM Scheffenegger, Richard
> >>>> <rs.ietf@gmx.at>
> >>>> wrote:
> >>>>> Eliciting an ACK under certain circumstances, for a timely
> >>>>> continuation
> >>>>> of the data transmission / growth of the congestion window is a known
> >>>>> method to reduce network delay.
> >>>>>
> >>>>> E.g. Linux has been using the CWR flag for the purpose of sending out
> >>>>> an
> >>>>> immediate ACK by the receiver, since there is an increased chance of
> >>>>> a
> >>>>> very small cwnd when the sender had just reduced it's congestion
> >>>>> window.
> >>>>>
> >>>>> https://lore.kernel.org/patchwork/patch/970486/
> >>>>>
> >>>>> and we also found latency improvements doing this when running
> >>>>> ECN-enabled sessions
> >>>>>
> >>>>> https://reviews.freebsd.org/D22670
> >>>> Yes, agreed.
> >>>>
> >>>> IMHO an explicit ACK-pull mechanism would be very nice for the cwnd<=1
> >>>> case.
> >>> (While this question is about the solution space, I'm anyway
> >>> curious...)
> >>> In the context of datacenter networks, would you have any suggestion or
> >>> preference regarding the solutions that have been mentioned so far?
> >>>
> >>> Or perhaps any particular requirement for a potential solution?
> >> Among the solutions outlined in
> >>    https://tools.ietf.org/html/draft-gomez-tcpm-delack-suppr-reqs-00
> >> my first preference would be the AKP option, since that approach
> >> avoids burning a precious flag bit.
> >
> > [BB] Eh? AKP does burn a flag bit (and you say it does below). Quoting
> > the draft:
> >
> >     TCP ACK Pull defines the AKP flag as bit number 6 of the 13th byte of
> >     the TCP header.
>
> [CG] I think that Neal referred to section 5.4 of the requirements draft
>  ("A new 'ACK Pull' TCP option").

Yes, as Carles says, when I mentioned "AKP option" I was referring to
the alternative discussed in section 5.4, "A new 'ACK Pull' TCP
option", which does not burn a flag bit:

  https://tools.ietf.org/html/draft-gomez-tcpm-delack-suppr-reqs-00#section-5.4

When I mentioned "flag bit" I was referring to section 5.3, "TCP ACK
Pull (AKP) flag", which does burn a flag bit:

  https://tools.ietf.org/html/draft-gomez-tcpm-delack-suppr-reqs-00#section-5.3

> > (BTW, Carles, in this quoted sentence, you ought to call it "the TCP ACK
> > Pull /proposal/" otherwise sounds like it's an official part of TCP
> > already.)
>
> [CG] Well noted, thanks!  (Nevertheless, if that other document went
> ahead, I guess that "proposal" would need to be eventually removed.)
>
> >> The AKP option may be stripped by some middleboxes, but (a) as a
> >> performance optimization, that should be acceptable, and (b) for the
> >> datacenter case (where cwnd=1 is a motivating use case) this should
> >> not be a concern.
> >>
> >> IMHO a flag bit makes sense for a small signal that a sender might
> >> want to send frequently or at a high rate, but senders should not be
> >> trying to force immediate ACKs frequently.
> >
> > [BB] For me, the problem with the AKP approach is that it's /only/
> > really good in environments where you've got a small window. When you
> > have a large window and you can cope with a certain ACK ratio (say
> > 1:16), you would have to set AKP on every 16th packet, which doesn't
> > really express what the sender wants (and if the receiver had just sent
> > an ACK of its own accord just before it got one of these regular AKP
> > requests, should it send another?). The sender in this case really wants
> > to say "I don't particularly mind which packets you ACK, but there's no
> > need to do it more often than 1:16".
> >
> > I think there's some mileage in a TCP Option that aggregates a few
> > behaviours together under one new TCP Option. I reckon 3 bits would be
> > enough for a good delayed ACK option, but a whole TCP Option for that
> > could be overkill. There was going to be a talk about a low latency TCP
> > Option in netdev0x14 before it was postponed (sorry I don't remember who
> > by). That might be a good excuse to collect together a few related
> > functions. It could also improve the deployment incentives.
>
> [CG] Thanks for the comments!
>
> [CG] It seems that there are two different areas where avoiding the
> typical Delayed ACKs approach may be of particular interest: i) scenarios
> where very small window sizes are used (cwnd=1), and ii) scenarios where
> large window sizes, and high ACK ratios, can be used. We will reflect
> these considerations in the next draft update.

Yes, I wholeheartedly agree with Bob's point that it's also extremely
useful for TCP senders to be able to say things like: "I don't
particularly mind which packets you ACK, but there's no need to do it
more often than 1:16". QUIC has a mechanism like this, and it seems to
allow significant CPU savings, even allowing QUIC to run faster than
TCP in some cases, AFAICT due to the reduced overhead for handling
ACKs:
  https://www.fastly.com/blog/measuring-quic-vs-tcp-computational-efficiency
  https://tools.ietf.org/html/draft-iyengar-quic-delayed-ack-00

So I agree with the usefulness of the two-use-case taxonomy Carles has outlined:

1: "please ACK now"; because sender's cwnd is low

2: "ACK at frequency K"; because sender's cwnd is high

It seems those could both be addressed cleanly with one or two TCP
option kinds. A single TCP option kind might suffice if the ACK
frequency of 0 or 1 is taken to mean "please ACK now".

best,
neal