Re: Idea for packet numbers

Dmitri Tikhonov <dtikhonov@litespeedtech.com> Fri, 28 July 2017 12:32 UTC

Return-Path: <dtikhonov@litespeedtech.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 83C3A131FF0 for <quic@ietfa.amsl.com>; Fri, 28 Jul 2017 05:32:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.89
X-Spam-Level:
X-Spam-Status: No, score=-1.89 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=litespeedtech-com.20150623.gappssmtp.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 gxP841FPVQag for <quic@ietfa.amsl.com>; Fri, 28 Jul 2017 05:32:16 -0700 (PDT)
Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E664131C28 for <quic@ietf.org>; Fri, 28 Jul 2017 05:32:16 -0700 (PDT)
Received: by mail-qt0-x236.google.com with SMTP id p3so76104107qtg.2 for <quic@ietf.org>; Fri, 28 Jul 2017 05:32:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=litespeedtech-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EYXPCGxURtoU019aAo9a3nsydQNHha2HytP0C1Z9L7w=; b=xqb4b7ehDngUyXh1qFI1kuCyavNFNTFo/AKW82QJq8dO/a4N+Tbt9fKgPJ4SQzAZo8 sh2WITMmtrgJR55zhewlFdxND5nm5Hoy+G58zjIWJ6thAgcH2D0wGkBsTtbCAcHzslrx Xnr3a83Mu2f8UqrS0Mz/Rd1ep98HX2mBl6WMXHBMZjdifgtAJtiDfa+d/ZxtqeRIpdud ILCXIbsILLMxYD2QwD9ZKI50l3I1tgHEdSWvnvZCNJEOVFsVuXpEl0dwm6Sb/rAIiH6W EbFhrCHuFvbPwbzwEgoXhTgHFc/9S8KOuBm1lqlhB6Rh8mmezZb8FCw+zFY+Bwa6yFHe 46cg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EYXPCGxURtoU019aAo9a3nsydQNHha2HytP0C1Z9L7w=; b=C3Q136goSu8M0mBGXD0OHqukiazXwjvOLNqaFe+PENiUVxWEEo81h95R7GQSM8mLsI 9nmb2hXebWdnjpd0J/xFVDPUG022DyL6gKj3LFIQIDpu/MQF984Rmk4gEaI9hQilxlHW LnbzJ6iT6947uJv1i4nhg2THgMr8rpAnGjJF9L2/VFhzlaD/xUT+tjY+irHXP486hjYR OvKFcmzv4AiJt2gx7Gyh4riRPDMwxlRN/o+wRav7GUTP9aXb5F/Axct2czqZICXTDX4i NtiNF5D+RvgTXgbtBeIXTmreF84oGqJc6dflwOlcGjyY2boU8qFyqCkH9Gq5oDJODm/Q fGAQ==
X-Gm-Message-State: AIVw113dqI2jPeqMgOCfk2dk/RWhO/S1pkrkIZa9P1nf2KoeLFm7yW5R /8n2yHWACuALwRt8
X-Received: by 10.200.13.130 with SMTP id s2mr10017737qti.287.1501245135595; Fri, 28 Jul 2017 05:32:15 -0700 (PDT)
Received: from ubuntu-dmitri (ool-2f1636b6.static.optonline.net. [47.22.54.182]) by smtp.gmail.com with ESMTPSA id u3sm15956031qth.95.2017.07.28.05.32.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 05:32:15 -0700 (PDT)
Date: Fri, 28 Jul 2017 08:32:08 -0400
From: Dmitri Tikhonov <dtikhonov@litespeedtech.com>
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
Message-ID: <20170728123208.GA2686@ubuntu-dmitri>
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> <DB5PR07MB12375F358A6DEE98A92D271984B90@DB5PR07MB1237.eurprd07.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <DB5PR07MB12375F358A6DEE98A92D271984B90@DB5PR07MB1237.eurprd07.prod.outlook.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/sz_Z9hXeqmOEMmIyOPKuXKJi9M4>
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: Fri, 28 Jul 2017 12:32:18 -0000

On Wed, Jul 26, 2017 at 09:27:19AM +0000, Swindells, Thomas (Nokia - GB/Cambridge, UK) wrote:
> > > 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.

OK -- this should work.  I'd have to work out the math to prove it to
myself, though. :)

> > > 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.

Sure, I agree -- I was not talking about the application level at all,
just the QUIC layer.  The application should not be in the business of
sending RST_STREAM frames.

> Assuming no re-encryption/packetization, that is pretty much all you
> can do if packets contain data from multiple stream frames anyway.

If one assumes that, then yes.

> 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."?

Not unless the "MUST NOT" in the quoted draft paragraph above be changed
to "SHOULD NOT:"  An eager implementation may check whether its peer has
sent stream data after receiving RST_STREAM (which it would know by the]
ACK frame) and terminate the connection.

  - Dmitri.