RE: Idea for packet numbers

"Swindells, Thomas (Nokia - GB/Cambridge, UK)" <thomas.swindells@nokia.com> Wed, 26 July 2017 09:27 UTC

Return-Path: <thomas.swindells@nokia.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 66FA3131FE5 for <quic@ietfa.amsl.com>; Wed, 26 Jul 2017 02:27:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.702
X-Spam-Level:
X-Spam-Status: No, score=-4.702 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.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 TPgCHm7T41Ca for <quic@ietfa.amsl.com>; Wed, 26 Jul 2017 02:27:25 -0700 (PDT)
Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30117.outbound.protection.outlook.com [40.107.3.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4EAED131FDC for <quic@ietf.org>; Wed, 26 Jul 2017 02:27:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fRhY2IX934tVczhzrdRANgw3uQ7/wjBmp0L0osVG3Bw=; b=KabihteXdwtqEdm5fn7mgzN6DjsvVzjku0mn3l9HxWUe1az9neq/GVZr0HiCryEJnVLw4bRClyD3pFLBTDIm8szgOiz32n+AWbsCc1q6MU1/drMZpt3jxuAMvX+ZLCY2c+DNoW6bI5PtAX59+3P1A8QMmKYEiI5eQEJSG/xeauQ=
Received: from DB5PR07MB1237.eurprd07.prod.outlook.com (10.164.41.139) by DB5PR07MB0935.eurprd07.prod.outlook.com (10.161.200.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.4; Wed, 26 Jul 2017 09:27:20 +0000
Received: from DB5PR07MB1237.eurprd07.prod.outlook.com ([fe80::400b:454d:9821:a354]) by DB5PR07MB1237.eurprd07.prod.outlook.com ([fe80::400b:454d:9821:a354%13]) with mapi id 15.01.1304.014; Wed, 26 Jul 2017 09:27:20 +0000
From: "Swindells, Thomas (Nokia - GB/Cambridge, UK)" <thomas.swindells@nokia.com>
To: Dmitri Tikhonov <dtikhonov@litespeedtech.com>
CC: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>, Magnus Westerlund <magnus.westerlund@ericsson.com>, IETF QUIC WG <quic@ietf.org>
Subject: RE: Idea for packet numbers
Thread-Topic: Idea for packet numbers
Thread-Index: AQHTAT74Pm6HB4E+oUyHojrh9ct+26JcjwOAgAF4cgCAA8bLAIACtdaAgAAAveCAAD5egIAAAIvg
Date: Wed, 26 Jul 2017 09:27:19 +0000
Message-ID: <DB5PR07MB12375F358A6DEE98A92D271984B90@DB5PR07MB1237.eurprd07.prod.outlook.com>
References: <c7941a67-6eaa-cd58-d0e2-a764478aa5b0@ericsson.com> <CAN1APdfwCoEieon8H98TOXBmsiwoHQfpsknfMB4hteU5gi9sMg@mail.gmail.com> <20170721093732.GA31705@ubuntu-dmitri> <DB5PR07MB1237B7C130AE23585EFF4CB084B80@DB5PR07MB1237.eurprd07.prod.outlook.com> <20170725124109.GA1764@ubuntu-dmitri> <DB5PR07MB1237128AE49E9EC81EC0A43984B80@DB5PR07MB1237.eurprd07.prod.outlook.com> <20170725162701.GA4414@ubuntu-dmitri>
In-Reply-To: <20170725162701.GA4414@ubuntu-dmitri>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=thomas.swindells@nokia.com;
x-originating-ip: [81.134.152.4]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DB5PR07MB0935; 7:Xvk2Xve+8SvzA9yad4fIjvUiDlJy/pHLFgNEruvnq93L5tqPU9z1oEf4MbaAbEZfikX7e81AIIq0a2HewcSxkDXJhBq1/2B6ZB2pkA4UYfHLUNfGNqx+LhdGLnBpEVh6+F4E1yz5J7KFlHF3b7zNygyNQuj1dKd+1VTF0pA3oCcHLEd3i0s3L14laPLSbyVdlgsRhSfHQl6c1Ja2szolNkMj4KyGhRtoPjzds9kaGrOhYKRdUxPDXmcCf+orSXoje+UVJAkNiN14+YbO5DIz09ECCclJ30kR1NKoTb9Ic0L0rutuFHK08dY61dI4AUAWHUx+Qbj6inWbmYEZK4q9nlXuvR5aAQ81Eqpvw6XbW1c+nx1fbm9brop0FYhXLw7OHLi31J+ah3eumbYGByG1mfiSFnv9uhsv0wkbZYNL6Jb5dR5xeh9GMFfi7dCuKt+5/q6Pms/V7gR96fOgd/5QxtNhEUKfJ0rMUYkoipu1KjXvZ19+ZZkfYjr9Yjtm9rDqbju7PEse11KqtUyXQY2mZl+ecbeSmfhNI2DHDuN2Akov7UPbZW9VJawGW7xdKi0f3WzZgWwN8w34NzXVb5dAaG9gIaMsgInWXs4NyZWMAMYQU5dsWJ1EIWuQqK8beq5FObhL20FOlE0IytLZUlBrTD0ylJFVHNZsfFeTAAi7jK3rYTgo3epXHtqgMgBsarOCUuC4KQ1gE2F7euY20TTtuRAIqLxNTxUs6qDbP+yybXEQxsTFMqGKOYfzYdYs2DIP3VVTIifYnsqtO5SqXgffFWqZzOnilxdroUhVqTkMa1c=
x-ms-office365-filtering-correlation-id: 5f4376a8-75af-494e-68bf-08d4d40883c1
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB5PR07MB0935;
x-ms-traffictypediagnostic: DB5PR07MB0935:
x-exchange-antispam-report-test: UriScan:(37575265505322)(82608151540597);
x-microsoft-antispam-prvs: <DB5PR07MB09350EFF1E1F26B5922258B884B90@DB5PR07MB0935.eurprd07.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR07MB0935; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR07MB0935;
x-forefront-prvs: 038002787A
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39450400003)(39860400002)(39400400002)(39410400002)(39850400002)(24454002)(199003)(13464003)(189002)(305945005)(53546010)(86362001)(189998001)(66066001)(97736004)(2900100001)(8676002)(4326008)(81166006)(81156014)(25786009)(68736007)(101416001)(33656002)(99286003)(8936002)(53936002)(6506006)(3480700004)(110136004)(7696004)(6246003)(54906002)(229853002)(74316002)(6436002)(93886004)(38730400002)(478600001)(106356001)(14454004)(105586002)(55016002)(39060400002)(5660300001)(2950100002)(5250100002)(50986999)(7736002)(6916009)(6116002)(54356999)(76176999)(102836003)(3846002)(3280700002)(2906002)(9686003)(3660700001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB0935; H:DB5PR07MB1237.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2017 09:27:19.9067 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB0935
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/-NEAP_Vnl0WmdONPBwYq2WaDACo>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Jul 2017 09:27:27 -0000


> -----Original Message-----
> From: Dmitri Tikhonov [mailto:dtikhonov@litespeedtech.com]
> Sent: 25 July 2017 17:27
> To: Swindells, Thomas (Nokia - GB/Cambridge, UK)
> <thomas.swindells@nokia.com>
> Cc: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>; Magnus Westerlund
> <magnus.westerlund@ericsson.com>; IETF QUIC WG <quic@ietf.org>
> Subject: Re: Idea for packet numbers
> 
> On Tue, Jul 25, 2017 at 02:28:52PM +0000, Swindells, Thomas (Nokia -
> GB/Cambridge, UK) wrote:
> > 4 wasn't meant to imply how you queue the packet on the NIC - I was
> > assuming via a kernel API call into normal udp send buffers, but both
> > methods are valid.  You are right though there is the potential for
> > the queuing operation to be blocked/rejected.
> 
> Since we were talking about implementation, I wanted to point out that packet
> number allocation is more complicated in practice.  I realize this is not what
> you meant. :)
> 
> > As I understand it the packet number is used in the encryption
> > process, so changing a packets number is a non-trivial operation.  A
> > fast path route for queuing acks makes sense, again however the only
> > real way
>                                                         ^^^^^^^^^^^^^
> 
> By this, do you mean "without encrypting data twice?"
Yes - re-encrypting can't really be considered a 'trivial' operation
 
> > to do that would be to give the ack packet a higher packet number but
> > then send it before lower marked packets - even potentially if they do
> > also contain ack frames.
> 
> That is a good approach if it does not break packet number derivation.
> I am not sure whether it can...  The draft says:
> 
>   " A packet number is decoded by finding the packet number
>   " value that is closest to the next expected packet.
> 
> Thus, after receiving ACK packet with large gap, which is the next expected
> packet number from the point of view of the peer?
The spec says that you should give plenty of room in the number space, so as long as you haven't reached half your number space across that period this should be extremely rare or perhaps impossible. 
The worst case is that if you do violate it then either you may be requested to retransmit some packets, or you just send the original packets first and then the ack.
 
> > For RST_STREAM I think it is permitted that currently queued packets
> > are still sent, but if they only contain that streams packets then it
> > is a beneficial optimization if they weren't sent (leaving packet
> > number gaps).
> 
> Current draft says:
> 
>   " An endpoint that receives a RST_STREAM frame (and which
>   " has not sent a FIN or a RST_STREAM) MUST immediately
>   " respond with a RST_STREAM frame, and MUST NOT send any
>   " more data on the stream.
> 
> I suppose one could interpret "send" to mean "enqueue," but I would err on
> the side of caution.
With a basic integration between an application and quic stack the api would likely just be the application writing a load of data onto a stream which then gets multiplexed into a quic connection.
In this case the application view would be once it has written it to the stream it is being 'sent' - in the same way the assumption is held for TCP transmission. 
Packetization and enqueuing for transmission would therefore be considered part of the sending process and with that API it would seem to be fair to send queued data but not allow new writes from the application.
Assuming no re-encryption/packetization, that is pretty much all you can do if packets contain data from multiple stream frames anyway. 
The "immediately respond with a RST_STREAM" perhaps then needs to be read as: "immediately, after any pending packets have been transmitted, such that no new packets with data from that stream are generated with a higher packet number than the RST_STREAM response frame."?

Thomas