Re: [L4s-discuss] [EXTERNAL] Accurate ECN & TCP_CONGESTION & connect()

Neal Cardwell <ncardwell@google.com> Sun, 07 January 2024 17:00 UTC

Return-Path: <ncardwell@google.com>
X-Original-To: l4s-discuss@ietfa.amsl.com
Delivered-To: l4s-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F2C1BC14F5F5 for <l4s-discuss@ietfa.amsl.com>; Sun, 7 Jan 2024 09:00:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.606
X-Spam-Level:
X-Spam-Status: No, score=-17.606 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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 uZ8ZCSN5sr5Y for <l4s-discuss@ietfa.amsl.com>; Sun, 7 Jan 2024 09:00:43 -0800 (PST)
Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) (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 212CDC14F5FD for <l4s-discuss@ietf.org>; Sun, 7 Jan 2024 09:00:43 -0800 (PST)
Received: by mail-ua1-x933.google.com with SMTP id a1e0cc1a2514c-7cc4647543aso195209241.0 for <l4s-discuss@ietf.org>; Sun, 07 Jan 2024 09:00:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704646842; x=1705251642; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iXUK5dyyKZJeoGRU/zftSk4eSqJHX+eiGvgPon7NY8k=; b=Kr9GB2VAz210bHKeIVix40VwPCihzjaGO6kW2Fwhn0camtUy288IXDNXMOjP5TSDJK fht9xVbFq/1UNAvXQRyF4gxik9BrDfxL1np9rFf+9F3z98mHvmeZuHrIazmF9ETtXeQi B2hlcWFbyD6NFC2uFPc77Ff/u8ZTnruxJdWTHgf0QPajDkYnRSed0xZYqSsj2lPYBKJd r1lqJ7YU5k7xOpi+2WhBJwtpeAzUWv/m+LeyUaRWV9tHssU9gRbF2uKMrNZuunRvhbAD A9AC+U77Ls+l7hqTP37FewgDabvwpWgF8CtBpK85/K39XmTyNzJ+1NEwBcZtVzbwiK/Z 9Fig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704646842; x=1705251642; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iXUK5dyyKZJeoGRU/zftSk4eSqJHX+eiGvgPon7NY8k=; b=ktkKOZW3Hvm1KSn0tOG1PKIklpsnNsuf6oJNxQmx+NM0rJP6hLUgF8nqhvmewpyzcT EV84izIVrXINuQeh4Ss/ESrdAQBBiFhq/OSvr8GVA7ABlzf2fA4wZufIY1WXjc6bfk9d t6uvAqW6647rotFszl0GA/SZg9eOGL0Hdl5+ymmFBLf6wbW29Cypurs7itMOst89bdrX D0XDA12XKHdFMBYb0sVp8wNsbNeAIV3YpXCx3z64NyKftx6IEZCDMqJc/dujsAxziYFo u9K2CSKK7sP0P24V/jcS6hk2vwSKa4lW8T63QBQkDBf3W87Vq4ED0zEc4nUUcV/zkbOs hvrQ==
X-Gm-Message-State: AOJu0YyNI9FOC/fY6qQ9O/qeHMMVozBOOGO+jsaeD81G5FewovUI/ERy fv++Y3rhP1QP8bKF7I1xvD8yK/fhcE7HvWt32k+E+fgzBotoSviuJdQTs0sgi+8QBA0=
X-Google-Smtp-Source: AGHT+IGl+TRFdi9xaEE/oJx7kwKrR+PloNeBmac8rSg3NdIMHF8uQUQQcTONaMQ40KOxPksxMmxKB1W0lkYlNuYSfdI=
X-Received: by 2002:a05:6122:1067:b0:4b7:1b5d:511d with SMTP id k7-20020a056122106700b004b71b5d511dmr528456vko.23.1704646841622; Sun, 07 Jan 2024 09:00:41 -0800 (PST)
MIME-Version: 1.0
References: <26857481574d7771ef64cfd3756582fd@rjmcmahon.com> <LV2PR01MB7622F169624727FB9D3E12069F662@LV2PR01MB7622.prod.exchangelabs.com> <243b7bfa1276926295339654071fb648@rjmcmahon.com>
In-Reply-To: <243b7bfa1276926295339654071fb648@rjmcmahon.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Sun, 07 Jan 2024 12:00:24 -0500
Message-ID: <CADVnQymO0vea8eVSgdzkp=t=n+Z=XhMPiqs0w=UmwXWtzraQTQ@mail.gmail.com>
To: rjmcmahon <rjmcmahon=40rjmcmahon.com@dmarc.ietf.org>
Cc: "Overcash, Michael (CCI-Atlanta)" <michael.overcash=40cox.com@dmarc.ietf.org>, l4s-discuss@ietf.org
Content-Type: multipart/alternative; boundary="00000000000076c8c7060e5e05c4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/l4s-discuss/8H9mwxuDNRgrLMazMnuQ_wvWRNU>
Subject: Re: [L4s-discuss] [EXTERNAL] Accurate ECN & TCP_CONGESTION & connect()
X-BeenThere: l4s-discuss@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Low Latency, Low Loss, Scalable Throughput \(L4S\) " <l4s-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/l4s-discuss>, <mailto:l4s-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/l4s-discuss/>
List-Post: <mailto:l4s-discuss@ietf.org>
List-Help: <mailto:l4s-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/l4s-discuss>, <mailto:l4s-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Jan 2024 17:00:47 -0000

Hi Bob,

You should be able to enable use of Accurate ECN, regardless of the current
congestion control algorithm, using:
  sysctl net.ipv4.tcp_ecn=3

That should cause new connections to negotiate (in the SYN/SYN-ACK
handshake) Accurate ECN, whether the CC is prague, cubic, bbr, etc. Then
when you use TCP_CONGESTION after connection establishment you should be
able to select prague as the connection's CC even if the connection was
started with cubic CC.

See:
https://github.com/L4STeam/linux/blob/testing/Documentation/networking/ip-sysctl.rst
tcp_ecn - INTEGER

Control use of Explicit Congestion Notification (ECN) by TCP. ECN is used
only when both ends of the TCP connection indicate support for it. This
feature is useful in avoiding losses due to congestion by allowing
supporting routers to signal congestion before having to drop packets. A
host that supports ECN both sends ECN at the IP layer and feeds back ECN at
the TCP layer. The highest variant of ECN feedback that both peers support
is chosen by the ECN negotiation (Accurate ECN, ECN, or no ECN).

The highest negotiated variant for incoming connection requests and the
highest variant requested by outgoing connection attempts:
ValueIncoming connectionsOutgoing connections
0 No ECN No ECN
1 ECN ECN
2 ECN No ECN
3 AccECN AccECN
4 AccECN ECN
5 AccECN No ECN

Default: 2


best regards,
neal


On Fri, Jan 5, 2024 at 3:20 PM rjmcmahon <rjmcmahon=
40rjmcmahon.com@dmarc.ietf.org> wrote:

> On 2024-01-05 06:45, Overcash, Michael (CCI-Atlanta) wrote:
> > The ECR bits are part of the IP header and are not concerned with the
> > TCP 3-way handshake. This is also why UDP protocols can utilize L4S.
> >
> > If L4S is enabled after the TCP session is established, then the TCP
> > handshake packets will end up in the Classic Queue but subsequent
> > packets will go to the AQM queue.
> >
> What about accurate ECN? I assume this can only be enabled per the 3WHS.
>
> https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-accurate-ecn
>
> During the TCP handshake at the start of a connection, to request more
> accurate ECN feedback the TCP Client (host A) MUST set the TCP flags
> (AE,CWR,ECE) = (1,1,1) in the initial SYN segment.
>
> If a TCP Server (B) that is AccECN-enabled receives a SYN with the above
> three flags set, it MUST set both its half connections into AccECN mode.
> Then it MUST set the AE, CWR and ECE TCP flags on the SYN/ACK to the
> combination in the top block of Table 2 that feeds back the IP-ECN field
> that arrived on the SYN. This applies whether or not the Server itself
> supports setting the IP-ECN field on a SYN or SYN/ACK (see Section 2.5
> for rationale).
>
> When the TCP Server returns any of the 4 combinations in the top block
> of Table 2, it confirms that it supports AccECN. The TCP Server MUST NOT
> set one of these 4 combination of flags on the SYN/ACK unless the
> preceding SYN requested support for AccECN as above.
>
> Once a TCP Client (A) has sent the above SYN to declare that it supports
> AccECN, and once it has received the above SYN/ACK segment that confirms
> that the TCP Server supports AccECN, the TCP Client MUST set both its
> half connections into AccECN mode. The TCP Client MUST NOT enter AccECN
> mode (or any feedback mode) before it has received the first SYN/ACK.
>
> Bob
>
> --
> L4s-discuss mailing list
> L4s-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/l4s-discuss
>