Re: [TLS] DTLS 1.3 sequence number lengths and lack of ACKs

David Benjamin <davidben@chromium.org> Tue, 16 April 2024 13:19 UTC

Return-Path: <davidben@google.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ABE07C14F5F4 for <tls@ietfa.amsl.com>; Tue, 16 Apr 2024 06:19:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -11.196
X-Spam-Level:
X-Spam-Status: No, score=-11.196 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, HTML_MESSAGE=0.001, MIME_BOUND_DIGITS_15=0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 066pLNE29HUo for <tls@ietfa.amsl.com>; Tue, 16 Apr 2024 06:19:07 -0700 (PDT)
Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (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 4A263C14F702 for <tls@ietf.org>; Tue, 16 Apr 2024 06:18:41 -0700 (PDT)
Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-6150670d372so39541787b3.1 for <tls@ietf.org>; Tue, 16 Apr 2024 06:18:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713273520; x=1713878320; 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=tv9tep6QvzLDoJs6bOtJXAdqTXSbJejASucmVEUuEoU=; b=WDN/A3fMooMNV/KWyiS6Ci3ddEQOhIO5unh2JTl2aNf5jbvyJLk+QZPPjwlPuHw462 rSVjxo9XZ69+8bgiMcQleNqUnVtsQAe2wLvstFWMZY9HjCb59LRRci6Str73tUqpAKuJ xu0qINZ7eXoRR8KPC18Gj6P/w1h9Tq3lSST3g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713273520; x=1713878320; 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=tv9tep6QvzLDoJs6bOtJXAdqTXSbJejASucmVEUuEoU=; b=UEG1FkkZAdtFGfsswFQoqALs7Y4PguhiT8Q74UUYBnxKIPEORJEAE94x717nwO9OBP IOooxjpiq2s/dWY6BMVgnwZN2TjdkEV2tBvSBPImjkSIlvmfS/2Pg5zBlcUW0beNAXEi 7x5jboxlL5fYEUiMGaoyr7Cv/WUkbDWXikXzxsYFR5/pFcmKAC3fMB/nVx2cig/51kqx Rkz7s+9aGgwpQ6fm6PKOPfeDoyV90D9Fu/+8MfKXjyeozqW9Lf/WBLq9tMFY1mdKIiW1 rJwMUEemC/CKHkMvM3xA1tTA+b7jaiKp7v1iXZh674yAYVPoSrnh93XOW+90MFU2jaEZ gjUA==
X-Gm-Message-State: AOJu0YyqT75LF+OzV4paZCkaZqCxyuj9kzdB6ZXlbGKy8RYjjsJj5OZ0 yrYWbsoV0ChMGYJGafktH/XRHsDKOvGSOAMy8PzTX272vrp1YDmtmGldvmVbqkSid5b/FKyp06J InKTdJxRZ0ri2UU3YMyKkcKaUWZesZKp54aA=
X-Google-Smtp-Source: AGHT+IGP5R3jkkGMIIhuZHuSlPMO3ymR/HXhY/Grlk8exKNCNK32O8sEqivMEaGbZv0hSH+sJOngFjZTSDJcDq0Tv40=
X-Received: by 2002:a05:690c:6505:b0:615:4700:94d4 with SMTP id hw5-20020a05690c650500b00615470094d4mr12312069ywb.36.1713273519950; Tue, 16 Apr 2024 06:18:39 -0700 (PDT)
MIME-Version: 1.0
References: <CAF8qwaAyDTwdT12zdo=PfRH=zwVU5rJGnsrSgWrk4F1JHyZtDg@mail.gmail.com> <AS8PR10MB742794893207672B7C0F4079EE082@AS8PR10MB7427.EURPRD10.PROD.OUTLOOK.COM>
In-Reply-To: <AS8PR10MB742794893207672B7C0F4079EE082@AS8PR10MB7427.EURPRD10.PROD.OUTLOOK.COM>
From: David Benjamin <davidben@chromium.org>
Date: Tue, 16 Apr 2024 09:18:28 -0400
Message-ID: <CAF8qwaDRnAp=nUXqi1C2kRtMSvF2W+F9rD5aK+vU4M1+tfoOwg@mail.gmail.com>
To: "Tschofenig, Hannes" <hannes.tschofenig@siemens.com>
Cc: "<tls@ietf.org>" <tls@ietf.org>, Nick Harper <nharper@chromium.org>
Content-Type: multipart/alternative; boundary="0000000000009026120616369341"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/GS0m5abm6B8EJ2WN4XDQnlrkb0k>
Subject: Re: [TLS] DTLS 1.3 sequence number lengths and lack of ACKs
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Apr 2024 13:19:11 -0000

Regarding UTA or elsewhere, let's see how the buffered KeyUpdates issue
pans out. If I haven't missed something, that one seems severe enough to
warrants an rfc9147bis, or at least a slew of significant errata, in which
case we may as well put the fixups into the main document where they'll be
easier for an implementator to find.

Certainly, as someone reading the document now to plan an implementation, I
would have found it much, much less helpful to put crucial information like
this in a separate UTA document instead of the main one, as these details
influence how and whether to expose the 8- vs 16-bit choice to Applications
Using TLS at all.

David



On Tue, Apr 16, 2024, 05:17 Tschofenig, Hannes <
hannes.tschofenig@siemens.com> wrote:

> Hi David,
>
>
>
> thanks again for these comments.
>
>
>
> Speaking for myself, this exchange was not designed based on QUIC. I
> believe it pre-dated the corresponding work in QUIC.
>
>
>
> Anyway, there are different usage environments and, as you said, there is
> a difference in the amount of messages that may be lost. For some
> environments the loss 255 messages amounts to losing the message exchanges
> of several days, potentially weeks. As such, for those use cases the
> shorter sequence number space is perfectly fine. For other environments
> this is obviously an issue and you have to select the bigger sequence
> number space.
>
>
>
> More explanation about this aspect never hurts. Of course, nobody raised
> the need for such text so far and hence we didn’t add anything. As a way
> forward, we could add text to the UTA document. In the UTA document(s) we
> already talk about other configurable parameters, such as the timeout.
>
>
>
> Ciao
>
> Hannes
>
>
>
> *From:* TLS <tls-bounces@ietf.org> *On Behalf Of *David Benjamin
> *Sent:* Friday, April 12, 2024 11:36 PM
> *To:* <tls@ietf.org> <tls@ietf.org>
> *Cc:* Nick Harper <nharper@chromium.org>
> *Subject:* [TLS] DTLS 1.3 sequence number lengths and lack of ACKs
>
>
>
> Hi all,
>
>
>
> Here's another issue we noticed with RFC 9147: (There's going to be a few
> of these emails. :-) )
>
>
>
> DTLS 1.3 allows senders to pick an 8-bit or 16-bit sequence number. But,
> unless I missed it, there isn't any discussion or guidance on which to use.
> The draft simply says:
>
>
>
> > Implementations MAY mix sequence numbers of different lengths on the
> same connection
>
>
>
> I assume this was patterned after QUIC, but looking at QUIC suggests an
> issue with the DTLS 1.3 formulation. QUIC uses ACKs to pick the minimum
> number of bytes needed for the peer to recover the sequence number:
>
> https://www.rfc-editor.org/rfc/rfc9000.html#packet-encoding
>
>
>
> But the bulk of DTLS records, app data, are unreliable and not ACKed. DTLS
> leaves all that to application. This means a DTLS implementation does not
> have enough information to make this decision. It would need to be
> integrated into the application-protocol-specific reliability story, if the
> application protocol even maintains that information.
>
>
>
> Without ACK feedback, it is hard to size the sequence number safely.
> Suppose a DTLS 1.3 stack unconditionally picked the 1-byte sequence number
> because it's smaller, and the draft didn't say not to do it. That means
> after getting out of sync by 256 records, either via reordering or loss,
> the connection breaks. For example, if there was a blip in connectivity and
> you happened to lose 256 records, your connection is stuck and cannot
> recover. All future records will be at higher and higher sequence numbers.
> A burst of 256 lost packets seems within the range of situations one would
> expect an application to handle.
>
>
>
> (The 2-byte sequence number fails at 65K losses, which is hopefully high
> enough to be fine?  Though it's far far less than what QUIC's 1-4-byte
> sequence number can accommodate. It was also odd to see no discussion of
> this anywhere.)
>
>
>
> David
>