Re: [tcpm] draft-ietf-tcpm-prr-rfc6937bis-03: set cwnd to ssthresh exiting fast recovery?

Randall Stewart <rrs@netflix.com> Mon, 01 May 2023 11:17 UTC

Return-Path: <rrs@netflix.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 A7763C151B25 for <tcpm@ietfa.amsl.com>; Mon, 1 May 2023 04:17:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.995
X-Spam-Level:
X-Spam-Status: No, score=-1.995 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=netflix.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16NwxystS0WF for <tcpm@ietfa.amsl.com>; Mon, 1 May 2023 04:17:11 -0700 (PDT)
Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EAA81C151B38 for <tcpm@ietf.org>; Mon, 1 May 2023 04:17:11 -0700 (PDT)
Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-51f1b6e8179so1508994a12.3 for <tcpm@ietf.org>; Mon, 01 May 2023 04:17:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; t=1682939831; x=1685531831; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=xuhndQlsYK5yxEHHBIViQS5sMqxqVsPuURUlhEOb41g=; b=CI8Me/NW+318uioUxyTlbOnu07aifauYCNcZT44dN/TZDMjdLGT8GK0fOt4FZiCXMc kNmpedgMpS6JVxoSRolA5H/crvRTpNIEmtGUTNmJO/WdTHgjgN6m1poSZcvR6n0awP3M hxtOxlOPdJIFlEMubhiNbcGZdXOf3tGFPaaJE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682939831; x=1685531831; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xuhndQlsYK5yxEHHBIViQS5sMqxqVsPuURUlhEOb41g=; b=ac/Lc/IAh3LJHAkDWcOAKZJwRCk2rqH0uoGn/gK033pQTTQ7wSEdaK656KMRh51ZVS tOSvq79XFd+WJyxlfOf3fnC+vXI9goSJYP/cZuodYG9abQywl8o5cxmLFl3E5x8hubMf bNKVPB/KZa2llxS/HRNcE5urwmh12g11ryciATAne9ypyP1k3N9VXfuZks1wSJplcJH0 5Za2LDmHr7l5+Bza86z1lzDzbB4voztNxgfHIv1IJEyUVFE+DGG4/6PSHjEDG2pgWuhP yfBbaNHi0Pc1j+L/PFbX7ZQsvN1IqY0EzKCnKzMJQXEM7Cg78PhBrrv4WEvQvD97BltQ vfsQ==
X-Gm-Message-State: AC+VfDzCPchFw+H07aXGALLJIQm4tm4FbbbOionq+TH9eoCXrM7inXah 7JweAEtpzS5jQ7shjDiFQaIMjQ==
X-Google-Smtp-Source: ACHHUZ4UJler59SNh3uaTZcePRlG/mDVJQJXuFf2Sgtjj9nth5fBgZ29PiFTdfEV8lHefiWb23QXuw==
X-Received: by 2002:a17:903:230c:b0:1a1:ee8c:eef5 with SMTP id d12-20020a170903230c00b001a1ee8ceef5mr16699947plh.7.1682939830880; Mon, 01 May 2023 04:17:10 -0700 (PDT)
Received: from smtpclient.apple (072-239-139-254.res.spectrum.com. [72.239.139.254]) by smtp.gmail.com with ESMTPSA id e12-20020a170902d38c00b001a686578b44sm17685315pld.110.2023.05.01.04.17.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2023 04:17:10 -0700 (PDT)
From: Randall Stewart <rrs@netflix.com>
Message-Id: <F24D815E-4932-4A84-B6C6-ECBCEB487199@netflix.com>
Content-Type: multipart/signed; boundary="Apple-Mail=_9166EBA7-B37E-4DE1-8D96-EC9284C7C070"; protocol="application/pkcs7-signature"; micalg="sha-256"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\))
Date: Mon, 01 May 2023 07:17:07 -0400
In-Reply-To: <CAAK044QCh_KyFugteUo1eaez_6LipCXtJKW1rxaHqhidfRRGmQ@mail.gmail.com>
Cc: Neal Cardwell <ncardwell=40google.com@dmarc.ietf.org>, tcpm <tcpm@ietf.org>, Matt Mathis <mattmathis@measurementlab.net>
To: Yoshifumi Nishida <nsd.ietf@gmail.com>
References: <CADVnQy=rbTc1rb5PKA1mvSJm61UTb=T5xzOkMBBB2Yadoe691A@mail.gmail.com> <CAK6E8=ckFHoiRTmLEy6ZH8z2ovv9+7S_UzUqnO3W4xcumyA1Gg@mail.gmail.com> <CADVnQyk7nxmaoTHh5qo9XvhrWojoB2R78FK0zX5CcwoZq6c=hg@mail.gmail.com> <CAK6E8=cXXWfHd+T3GkDEhJ6TmbstygL=qD4nns3w50DTe2eaZw@mail.gmail.com> <CADVnQy=Q5cvN_+Fa0rbNc2a_Aqe=haROOd4SNpk9TbvE1MXVvQ@mail.gmail.com> <CADVnQymCZkqRw6f8JTuFXhNXEo1KJx4S48gXaBaOPRasOVCg+Q@mail.gmail.com> <CAAK044QCh_KyFugteUo1eaez_6LipCXtJKW1rxaHqhidfRRGmQ@mail.gmail.com>
X-Mailer: Apple Mail (2.3696.120.41.1.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/GDWumCryMSdCepXvhFPaGwLJYcA>
Subject: Re: [tcpm] draft-ietf-tcpm-prr-rfc6937bis-03: set cwnd to ssthresh exiting fast recovery?
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 01 May 2023 11:17:15 -0000

Hi Neal and Yoshi:

Neal: So the FreeBSD implementation in rack, like linux, does the same exact thing set cwnd to ssthresh at
exit from recovery. 

Yoshi: I don’t see how this would cause cwnd to be larger, since at the entry to recovery you set ssthresh = cwnd *  Beta. But
          maybe I am missing something, can you give an example like Neal did below?


Thanks

R

> On May 1, 2023, at 5:32 AM, Yoshifumi Nishida <nsd.ietf@gmail.com> wrote:
> 
> Hi Neal,
> 
> If we always set cwnd to ssthresh at the end of recovery, I am guessing there will be some cases where cwnd jumps up drastically at the end of the recovery. For example, many packets were lost before entering recovery.  Or, am I missing something?
> --
> Yoshi
> 
> On Wed, Apr 19, 2023 at 7:37 PM Neal Cardwell <ncardwell=40google.com@dmarc.ietf.org <mailto:40google.com@dmarc.ietf.org>> wrote:
> Working through examples for the "draft-ietf-tcpm-prr-rfc6937bis-03 and RecoverFS initialization" thread this evening, I ran into another potential issue.
> 
> The Linux TCP implementation of PRR explicitly/directly sets cwnd to ssthresh at the end of fast recovery (in tcp_end_cwnd_reduction()). But this behavior is not in the algorithm in the PRR RFC or draft, at least in the figures in section 6, Algorithms. Maybe it is in the prose somewhere and I missed it; but in that case I'd argue strongly to put this in the figures in section 6, Algorithms.
> 
> AFAICT in some cases this is strictly necessary to get cwnd to grow to reach ssthresh. Without such a direct step, cwnd could end up far below ssthresh at the end of recovery. Here's an example to illustrate:
> 
> CC = CUBIC
> 
> cwnd = 10
> 
> The reordering degree was estimated to be large, so the connection will wait for more than 3 packets to be SACKed before entering fast recovery.
> 
> --- Application writes 10*MSS.
> 
> TCP sends packets P1 .. P10.
> pipe = 10 packets in flight (P1 .. P10)
> 
> --- P2..P9 SACKed  -> do nothing
> 
> (Because the reordering degree was previously estimated to be large.)
> 
> --- P10 SACKed -> mark P1 as lost and enter fast recovery
> 
> PRR:
> ssthresh = CongCtrlAlg() = 7 packets // CUBIC
> prr_delivered = 0
> prr_out = 0
> RecoverFS = snd.nxt - snd.una = 10 packets (P1..P10)
> 
> DeliveredData = 1  (P10 was SACKed)
> 
> prr_delivered += DeliveredData   ==> prr_delivered = 1
> 
> pipe =  0  (all packets are SACKed or lost; P1 is lost, rest are SACKed)
> 
> safeACK = false (snd.una did not advance)
> 
> if (pipe > ssthresh) => if (0 > 7) => false
> else
>   // PRR-CRB by default
>   sndcnt = MAX(prr_delivered - prr_out, DeliveredData)
>          = MAX(1 - 0, 1)
>          = 1
> 
>   sndcnt = MIN(ssthresh - pipe, sndcnt)
>          = MIN(7 - 0, 1)
>          = 1
> 
> cwnd = pipe + sndcnt
>      = 0    + 1
>      = 1
> 
> retransmit P1
> 
> prr_out += 1   ==> prr_out = 1
> 
> --- P1 retransmit plugs hole; receive cumulative ACK for P1..P10
> 
> DeliveredData = 1  (P1 was newly ACKed)
> 
> prr_delivered += DeliveredData   ==> prr_delivered = 2
> 
> pipe =  0  (all packets are cumuatively ACKed)
> 
> safeACK = (snd.una advances and no further loss indicated)
> safeACK = true
> 
> if (pipe > ssthresh) => if (0 > 7) => false
> else
>   // PRR-CRB by default
>   sndcnt = MAX(prr_delivered - prr_out, DeliveredData)
>          = MAX(2 - 1, 1)
>          = 1
>   if (safeACK) => true
>     // PRR-SSRB when recovery is in good progress
>     sndcnt += 1   ==> sndcnt = 2
> 
>   sndcnt = MIN(ssthresh - pipe, sndcnt)
>          = MIN(7 - 0, 2)
>          = 2
> 
> cwnd = pipe + sndcnt
>      = 0    + 2
>      = 2
> 
> So we exit fast recovery with cwnd=2 even though ssthresh is 7.
> 
> As noted above, the Linux TCP implementation does not suffer this problem because it explicitly/directly sets cwnd to ssthresh at the end of fast recovery.
> 
> I would recommend including this cwnd=ssthresh step at the end of recovery in the draft, to ensure that cwnd reaches ssthresh at the end of fast recovery, even in cases like this where there will be insufficient delivered data in fast recovery to allow pipe to incrementally grow to reach ssthresh using PRR-SSRB.
> 
> Best regards,
> neal
> 
> _______________________________________________
> tcpm mailing list
> tcpm@ietf.org <mailto:tcpm@ietf.org>
> https://www.ietf.org/mailman/listinfo/tcpm <https://www.google.com/url?q=https://www.ietf.org/mailman/listinfo/tcpm&source=gmail-imap&ust=1683538345000000&usg=AOvVaw2cOITQpYcuP_M95396rEmw>
> _______________________________________________
> tcpm mailing list
> tcpm@ietf.org
> https://www.google.com/url?q=https://www.ietf.org/mailman/listinfo/tcpm&source=gmail-imap&ust=1683538345000000&usg=AOvVaw2cOITQpYcuP_M95396rEmw

------
Randall Stewart
rrs@netflix.com