[TLS] Efficiency of ACKing scheme

Hanno Becker <Hanno.Becker@arm.com> Fri, 03 April 2020 16:35 UTC

Return-Path: <Hanno.Becker@arm.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 71D9D3A1B36 for <tls@ietfa.amsl.com>; Fri, 3 Apr 2020 09:35:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.b=FCvJq5e1; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.b=FCvJq5e1
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 NxRyp8bPmupH for <tls@ietfa.amsl.com>; Fri, 3 Apr 2020 09:35:36 -0700 (PDT)
Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0629.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::629]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 416C23A1B38 for <tls@ietf.org>; Fri, 3 Apr 2020 09:35:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=743t75m2/DajIOXom8e1k/rdZBmgW6vuJApIuhgHMVQ=; b=FCvJq5e1wJhHddTtc7QVojRjMydtF4opM4e/yuY4TL0n2b+GUDVYkSalC4shxyBjI292Inr+KvwzFeUhAc0M1tuuR0eZrKFVAmOSBQVqmQDK5tVprkRFWtR18++AmDkQ1LbAQCfpHO0ABu7qS79JfuaLTjj2AECuq1KfZTjP5fE=
Received: from DB3PR0102CA0030.eurprd01.prod.exchangelabs.com (2603:10a6:8::43) by AM5PR0802MB2593.eurprd08.prod.outlook.com (2603:10a6:203:94::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16; Fri, 3 Apr 2020 16:35:30 +0000
Received: from DB5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::83) by DB3PR0102CA0030.outlook.office365.com (2603:10a6:8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16 via Frontend Transport; Fri, 3 Apr 2020 16:35:30 +0000
Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; ietf.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;ietf.org; dmarc=bestguesspass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT016.mail.protection.outlook.com (10.152.20.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Fri, 3 Apr 2020 16:35:30 +0000
Received: ("Tessian outbound eadf07c3b4bb:v50"); Fri, 03 Apr 2020 16:35:30 +0000
X-CheckRecipientChecked: true
X-CR-MTA-CID: c6706894008c0688
X-CR-MTA-TID: 64aa7808
Received: from cb8e20d6c1a8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D16BC64C-FFC0-4932-B0C4-6284080091D4.1; Fri, 03 Apr 2020 16:35:25 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cb8e20d6c1a8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Apr 2020 16:35:25 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O954zfjaRDZceTU3J0Z0A8dfA4cobfvHnn8Fq+4UCzCjFeb6+dmvOUvu9cDKs03fon8IPQI3frtCmdGRqYwcgiXB3u455J5tviivqhua0Gdbr7tUFoYE2suaiV/GhzH78jvQllAH98LsUDYR+V7ramPh5JT8JRXCgPYM1PhYbYotzrsps6uCSc0czr4P1mXm7F79cXNQ5ZVRZYIS2uj9It6gSVN1MP1wGx6JstGqgTu/miFV69DmGUqO0NLu3GKqbfXyqvsViedZiO1xu2kD9WQ6GUCul9T+pC7sE0QcEIHl+MPF9hlev05ynbl6Slu2dS0MLNYlhIh9iYBbWLm+zA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=743t75m2/DajIOXom8e1k/rdZBmgW6vuJApIuhgHMVQ=; b=Hh86kRjjYaxSaHLxutVI/YbLB7YH5AJsvDKkXvUHwOzPdOD42mhGdhC279xfCi8+5H9PC7vLOgb3L3YcDSgKl6HptCMJXubfZGfiXsMk/rXKRwywN1A2XbnypbHqPpyp0tS59BEoMNDONWEDM9mkDkILZfkenriH2RKL/eV7PTkcJ4CqhZ91XIr7lNgvOKY5KrjlvsNhkXl/3a+lk5FpVdqW9Q3Snp7SqH0SBt13KPg6nU8EYKyhYNxZ8GKknB5Eh/3Mw206DyhZRkTvJ6mYyBCkwgEvE7AN3nvKrk/AaGJB8Ke5sOerTLbtp5OoRgXzuH+YMpmsrEI3V0rVPSdflg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=743t75m2/DajIOXom8e1k/rdZBmgW6vuJApIuhgHMVQ=; b=FCvJq5e1wJhHddTtc7QVojRjMydtF4opM4e/yuY4TL0n2b+GUDVYkSalC4shxyBjI292Inr+KvwzFeUhAc0M1tuuR0eZrKFVAmOSBQVqmQDK5tVprkRFWtR18++AmDkQ1LbAQCfpHO0ABu7qS79JfuaLTjj2AECuq1KfZTjP5fE=
Received: from AM6PR08MB3318.eurprd08.prod.outlook.com (52.135.163.143) by AM6PR08MB5048.eurprd08.prod.outlook.com (10.255.123.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16; Fri, 3 Apr 2020 16:35:23 +0000
Received: from AM6PR08MB3318.eurprd08.prod.outlook.com ([fe80::1579:b7d9:f543:200d]) by AM6PR08MB3318.eurprd08.prod.outlook.com ([fe80::1579:b7d9:f543:200d%5]) with mapi id 15.20.2856.019; Fri, 3 Apr 2020 16:35:23 +0000
From: Hanno Becker <Hanno.Becker@arm.com>
To: "tls@ietf.org" <tls@ietf.org>
Thread-Topic: [TLS] Efficiency of ACKing scheme
Thread-Index: AQHWCdUmcw6BnTFxZ0GrZHianQcZlQ==
Date: Fri, 03 Apr 2020 16:35:23 +0000
Message-ID: <AM6PR08MB331820C710440F07055382739BC70@AM6PR08MB3318.eurprd08.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Hanno.Becker@arm.com;
x-originating-ip: [86.181.127.140]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: c97e4ef3-4ec4-4d00-8507-08d7d7ed0606
x-ms-traffictypediagnostic: AM6PR08MB5048:|AM5PR0802MB2593:
X-Microsoft-Antispam-PRVS: <AM5PR0802MB25933930B019C9A68087D7789BC70@AM5PR0802MB2593.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
nodisclaimer: true
x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000;
x-forefront-prvs: 0362BF9FDB
X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3318.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(39860400002)(396003)(136003)(346002)(376002)(366004)(66476007)(2906002)(81156014)(81166006)(55016002)(5660300002)(26005)(76116006)(66946007)(66446008)(9686003)(66556008)(316002)(71200400001)(7696005)(8936002)(64756008)(186003)(86362001)(8676002)(478600001)(6506007)(33656002)(6916009)(52536014)(19627405001); DIR:OUT; SFP:1101;
received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: dv7KhW5gg31WHWhnrKbPxjdTUW1cmpjoQ8o9VrO78hhmtKju/Lrg8VN4QRCKHnq697hX5eMGPpRvWTw81E6W6YiYJrUv0sXQXRCsQV4ooJuf9N12cKWO0k2sl8X9CC2lYV2MKmwt7dco84GPifDESjayclzrub7u9hkSrW2OzFtj0tiKctnAuSfXld2nI40ZKKaqyyK1y3wH8kTmFHymizZadTO3T1stzFevWsXjdzYX118QWgI45RZHdJDmRhsg6/rjW6ESaiPwlHZ2i9vcnPrF8FKhii26Wn8wPzjuiio5hORH9DeQiKiRJiso8+J/cQth8vp+SbyzKDhhbCWX0OhOh5gGwxciUiVt8UymqWYVIuFX/aeTl8CxFG5OTgK9R+F7sVVyUrAiU04rEsOMZyCPPhrwvnzkqDABhV6S1xAcT/Dq6tWghETjraoaPJZS
x-ms-exchange-antispam-messagedata: hmAuap2jq0C2E/Oq+83P1Ruy2S+TYRKXGaltNZ/1dbSrp7+AZzywfRZ9rVdTQJI8XFcXec5G3MZ5qa9/Ck30GChDwnIAvdbUBggGhJ2qhuCYomND9kjFidiE+QymfJ9DWxXUCWC4wcUW0b1VQ9T00g==
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_AM6PR08MB331820C710440F07055382739BC70AM6PR08MB3318eurp_"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5048
Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Hanno.Becker@arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT016.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(136003)(346002)(376002)(396003)(39860400002)(46966005)(336012)(316002)(356004)(186003)(33656002)(82740400003)(6916009)(2906002)(86362001)(26005)(47076004)(55016002)(19627405001)(9686003)(478600001)(30864003)(26826003)(70206006)(70586007)(52536014)(5660300002)(8676002)(81166006)(7696005)(6506007)(8936002)(81156014); DIR:OUT; SFP:1101;
X-MS-Office365-Filtering-Correlation-Id-Prvs: 936f869c-db30-46e5-ddce-08d7d7ed01c1
X-Forefront-PRVS: 0362BF9FDB
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: TVEw+DQTvOPj6g1tKvOWw1Hm21xQbCEIa9MMhXcd3D7Rshl+V1wif8tI7M0MXym36d//DxGboESdn9w5JYSmFeFTGzE8zxaS/cG7/U0P4Fs0q8PouyQ7xUuI3PMeYKntamOyv4GVZZxajEe5aX1pv2cp008m9TrP+O1oMvZLZvJ5MqB4fVAXh1oqCZ1bZPyE2tXV7LM1pJL8FJG1vuJgYd68nNQff76bpfQtC2XtbGJnnqefIw51XMd6qOOUHB00ZNYqtrJjRaLD29t4ncJMCIIsgp2dTTm92//b0KJgubwo/P7eEkpTYReLRz/XNg8hRkWQir2MxXAV6CDSZ6FV//zKEkyZqF+OKWTYwRi9USILIm+aU8Fltadwb4LEqM9DBxx2OJT4kogNy8uoUzEye8NZFIvUr9Z/LCtxJ34oPWjffRwgNN//m1qgyMKQFRNUSOEDlzq99KTV7FNmB4G91UwDnpnubj0milsHHnh/gOdgMrKFQcsYAGLDK63IgF7eFmsujuquA5dGgcvm7IFynw==
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2020 16:35:30.4446 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c97e4ef3-4ec4-4d00-8507-08d7d7ed0606
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2593
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/JMF-JhmdGRvE9ZBM4X3xgTeDmXU>
Subject: [TLS] Efficiency of ACKing scheme
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 03 Apr 2020 16:35:39 -0000

Hi again,

The DTLS 1.3 ACKing scheme seems to be quite inefficient as it is written,
and I wonder if the current spec matches the authors' intentions.

Example:

Consider a flight broken down as sequence of records 1, 2, .., N.
Assume record 2 gets dropped, while all other records go through
without reordering, corruption or loss; hence, the record sequence
observed on the receiver is 1, 3, 4, ..., N.

Then, according to the spec, the following SHOULD happen:

On the receiver-side, we have the following from Section 7.1:

```
   When an implementation receives a partial flight, it SHOULD generate
   an ACK that covers the messages from that flight which it has
   received so far.  Implementations have some discretion about when to
   generate ACKs, but it is RECOMMENDED that they do so under two
   circumstances:
   *  When they receive a message or fragment which is out of order,
      either because it is not the next expected message or because it
      is not the next piece of the current message.
```

So, when the receiver receives records 1 and 3, it notices that 2 is missing
and immediately sends an ACK for { 1, 3 }.

On the sender-side, we have the following from Section 7.2:

```
7.2.  Receiving ACKs
   When an implementation receives an ACK, it SHOULD record that the
   messages or message fragments sent in the records being ACKed were
   received and omit them from any future retransmissions.  Upon receipt
   of an ACK for only some messages from a flight, an implementation
   SHOULD retransmit the remaining messages or fragments.
```

So, when the receiver receives the ACK for { 1, 3 }, it resends records
2, 4, 5, .., N.

That's obviously not optimal, and probably not what was intended, but what
unambiguously appears to be the recommended behavior according to the spec.

How should this be resolved?

I see two similar and comparably unintrusive options:

1) Send ACKs only after period of inactivity

   Instead of sending ACKs straight away when something hints at
   something going wrong (such as an out-of-order receipt), as
   currently stated in Section 7.1, only send ACKs after a period
   of time where no further messages has been received.

   That is, replace the current version

```
   When an implementation receives a partial flight, it SHOULD generate
   an ACK that covers the messages from that flight which it has
   received so far.  Implementations have some discretion about when to
   generate ACKs, but it is RECOMMENDED that they do so under two
   circumstances:
   *  When they receive a message or fragment which is out of order,
      either because it is not the next expected message or because it
      is not the next piece of the current message.  Implementations
      MUST NOT send ACKs for handshake messages which they discard as
      out-of-order, because otherwise those messages will not be
      retransmitted.
   *  When they have received part of a flight and do not immediately
      receive the rest of the flight (which may be in the same UDP
      datagram).  A reasonable approach here is to set a timer for 1/4
      the current retransmit timer value when the first record in the
      flight is received and then send an ACK when that timer expires.
   In addition, implementations MUST send ACKs upon receiving all of any
   flight which they do not respond to with their own messages.
```

   by something along the following lines:

```
   As long as implementation has received some but not all of the next incoming
   flight, it SHOULD send an ACK message after an implementation-defined period
   a time during which no further messages are received. A reasonable approach
   here is to reset a timer to 1/4 the current retransmission timer with every
   record received in the current flight, and send an ACK when that timer expires.
```

   In the above example, this would mean that as long as records 3,4,..,N arrive
   in close succession, it will only once send an ACK for {1,3,4,...,N} in the end,
   triggering retransmission of record 2 only, which is optimal.

   The drawback of this is that the receiver of a flight does not inform a peer
   about a gap in a flight as soon as it notices it. For this to work, the content
   of an ACK would need to be what's missing instead of what's present, which
   appears to be a too intrusive change to be considered at this stage. The
   benefit of this approach is that it leads to very good retransmission bandwidth.

2. Essentially same as option 1., but 'mirrored': Allow the receiver of a flight
   to send ACKs recurringly (though preferably still bunched, i.e. using some timer
   for the bunching), and replace the part of Section 7.2:

```
7.2.  Receiving ACKs
   When an implementation receives an ACK, it SHOULD record that the
   messages or message fragments sent in the records being ACKed were
   received and omit them from any future retransmissions.  Upon receipt
   of an ACK for only some messages from a flight, an implementation
   SHOULD retransmit the remaining messages or fragments.
```

   by something along the lines of

```
7.2.  Receiving ACKs
   If an implementation receives an ACK for parts of a flight, but doesn't
   immediately receive ACKs for the rest of the flight, it SHOULD retransmit
   the messages that have not been ACKed. A reasonable approach here is to
   reset a timer to 1/4 the current retransmission timer with every ACK record
   received, and retransmit the last outgoing flight when that timer expires.
```

Let me know what you think and which option (if not a completely different one)
you'd prefer.

Cheers,
Hanno
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.