Re: Why allow empty STREAM frames when offset is zero?

Martin Thomson <martin.thomson@gmail.com> Fri, 11 May 2018 00:37 UTC

Return-Path: <martin.thomson@gmail.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 C456912EBC2 for <quic@ietfa.amsl.com>; Thu, 10 May 2018 17:37:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 3co7MHfUsjOW for <quic@ietfa.amsl.com>; Thu, 10 May 2018 17:37:30 -0700 (PDT)
Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (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 AE8B612EBB9 for <quic@ietf.org>; Thu, 10 May 2018 17:37:30 -0700 (PDT)
Received: by mail-oi0-x233.google.com with SMTP id n65-v6so3367206oig.6 for <quic@ietf.org>; Thu, 10 May 2018 17:37:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xaaRbHgAbZBpseQyvV6AT07Io4q412CCNJM53NZibZk=; b=iyCKF7B/ImcwBePN6LWKTfm9OszHypXDmdk88Fq623bfhoylwf5+gQ53cXQ5qO1Ory IjYfiQNy6n03rquHwZnDxDhJ7+CJB4xB3B+OgVRqb20+hH6Z412yY/EsmUJEzUFld+rN a2zEk0quSq4Ft93pWeTIfjJP27B389u4BPmnOZMsdCAXrgBy7mZvCT2JLiov0EnVzjWP zjXz2FaTsIvqoexuEQPLOOXtcZ1cLqMnNwEVQfRF3gcLnHQereAVaJkN/ofKPHnlBLCb h7GRhz1ew0PrVDEFB6nKVJsNXlycZFlSLrnu2YfmIIeluIeWe6WEB0qHmaRfEfucJZ2a bzRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xaaRbHgAbZBpseQyvV6AT07Io4q412CCNJM53NZibZk=; b=TezesuM1/Csixf60a/B7G4vQEvGK+cTD7veEL90ys/NsYcTavA94pXUV49WrmFom8V +CPachGDnY8NdEMtKsgTVJCe5Gexhu68pinDU5NHjI6TGqV74xP3SunQSZofYd4PkhQ1 wScBqChlEfD/k0pNzX0jc3femsNl27pEQmOSk7Dd4BPpG+nJR6GIufyM74K4bfvodp/X aL7pDq/XIWQdluYkVyVNqRvNczoUdmjozwZssObgrr4wt4B1614mGMeBZrKgTcJYjXCq TUp/5OYkW6wwj6hpmJtTOsfIHQPJscMrWC3ee0nnUI0NJDvUcdPyEMjhPCeAuDMdrY+N ZTiQ==
X-Gm-Message-State: ALKqPwcAX7/9E8nxzz+kiKoMno7Um7MFy5wbXNCw1q6wj3wI9W3l3K69 9wTLToLLrtw3QmuXouir61bwKTjYudKMlJa4KVGsSw==
X-Google-Smtp-Source: AB8JxZr8E1PC6ZpZreYIkRIUd4hOeVWHxBSmsPerZeh6eExeUuFjMlI4NtgKFT+EqfzPRe94EFsbJ0jTtMvg0MKbK8k=
X-Received: by 2002:aca:1218:: with SMTP id 24-v6mr1992521ois.144.1525999049929; Thu, 10 May 2018 17:37:29 -0700 (PDT)
MIME-Version: 1.0
References: <20180510180509.GA2505@ubuntu-dmitri> <SN1PR08MB18543D4C234CC672616E37BFDA980@SN1PR08MB1854.namprd08.prod.outlook.com> <20180510184505.GA23837@ubuntu-dmitri> <DM5PR2101MB090184FC657942BD294E555DB3980@DM5PR2101MB0901.namprd21.prod.outlook.com> <BY2PR15MB0775E5FA5E6869C85AB98933CD980@BY2PR15MB0775.namprd15.prod.outlook.com> <c0b4cd48aa5f491f91828d529a7d2c68@usma1ex-dag1mb5.msg.corp.akamai.com> <CAKcm_gNgYUhvu6g_TVqP-gVwA0e__hqK7bGbNs_JnumvyaQeqQ@mail.gmail.com>
In-Reply-To: <CAKcm_gNgYUhvu6g_TVqP-gVwA0e__hqK7bGbNs_JnumvyaQeqQ@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Fri, 11 May 2018 10:37:23 +1000
Message-ID: <CABkgnnWZHcVaRzEmG5QwZCFUOXE8khyHbf8Hav=RZQHiDdsOfQ@mail.gmail.com>
Subject: Re: Why allow empty STREAM frames when offset is zero?
To: Ian Swett <ianswett=40google.com@dmarc.ietf.org>
Cc: "Lubashev, Igor" <ilubashe=40akamai.com@dmarc.ietf.org>, Nick Banks <nibanks=40microsoft.com@dmarc.ietf.org>, Mike Bishop <mbishop@evequefou.be>, Roberto Peon <fenix@fb.com>, QUIC WG <quic@ietf.org>, Dmitri Tikhonov <dtikhonov@litespeedtech.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/VJ-WC-xP6YsTKlp1o4h36Rl94qU>
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, 11 May 2018 00:37:33 -0000

That's possible, if someone wants to open a PR.

To be clear, I don't think that there is a valid use case for an empty
STREAM frame (other than at the start or end) that isn't satisfied better
by other frames.  But we're not necessarily in the business of policing
these things and allowing empty STREAM frames is actually easier than
creating the exclusions.

Here's a use case: steganography.  A covert channel to the peer that won't
manifest as observable activity outside of the QUIC stack.  An empty STREAM
frame can carry a surprising amount of entropy if you are clever.

We would then put empty STREAM frames in the same bucket as other frames
that could be pointless and wasteful when used excessively.  There's
already a bunch of those.
On Fri, May 11, 2018 at 10:11 AM Ian Swett <ianswett=
40google.com@dmarc.ietf.org> wrote:

> I would agree that the restriction here seem unnecessary and I tend to
think we'd be better off removing it.

> On Thu, May 10, 2018 at 5:58 PM Lubashev, Igor <ilubashe=
40akamai.com@dmarc.ietf.org> wrote:

>> Actually, I’ll take an issue with:



>> [draft-ietf-quic-transport-11] says the following:
>>      A stream frame's Stream Data MUST NOT be empty, unless the offset is
>>      0 or the FIN bit is set.

>> Why disallow this?  This may be a signal to the receiver about where in
the stream the sender is, even if the sender does not have any new data to
send.  This signal may be useful in cases of packet loss, when the sender
is not ready to declare a packet with stream data lost and retransmit lots
of stream data (has not been long enough), but it is very important for the
application to know where the sender is in the stream.  Of course, there
are workarounds – you can send a STREAM frame, retransmitting a single
byte.  But it still seems like an unnecessary restriction.



>> Igor





>> From: Roberto Peon [mailto:fenix@fb.com]
>> Sent: Thursday, May 10, 2018 3:12 PM
>> To: Nick Banks <nibanks=40microsoft.com@dmarc.ietf.org>; Dmitri Tikhonov
<dtikhonov@litespeedtech.com>; Mike Bishop <mbishop@evequefou.be>
>> Cc: IETF QUIC WG <quic@ietf.org>
>> Subject: Re: Why allow empty STREAM frames when offset is zero?



>> It can be used to establish the mapping of the stream
(src-conn-id:streamid <-> dst-conn-id:streamid) through the stack of
proxies, etc, especially for usecases where there is an early response.



>> -=R







>> Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone





>> -------- Original message --------

>> From: Nick Banks <nibanks=40microsoft.com@dmarc.ietf.org>

>> Date: 5/10/18 12:02 PM (GMT-08:00)

>> To: Dmitri Tikhonov <dtikhonov@litespeedtech.com>, Mike Bishop <
mbishop@evequefou.be>

>> Cc: IETF QUIC WG <quic@ietf.org>

>> Subject: RE: Why allow empty STREAM frames when offset is zero?



>> In WinQuic, the resulting frame just results in the NEW_STREAM event to
the application layer. They can start reading from it, but we just won't
have anything to read yet. That NEW_STREAM event can be used for a number
of things. If you are moving from multiple TCP connections to a single QUIC
connection, it could be seen as the equivalent of a single TCP connect
event.

>> - Nick

>> -----Original Message-----
>> From: QUIC <quic-bounces@ietf.org> On Behalf Of Dmitri Tikhonov
>> Sent: Thursday, May 10, 2018 11:45 AM
>> To: Mike Bishop <mbishop@evequefou.be>
>> Cc: IETF QUIC WG <quic@ietf.org>
>> Subject: Re: Why allow empty STREAM frames when offset is zero?

>> Is there a real-life use case that is implied here?  I can't see why it
would be useful.

>> On the other hand, it creates an odd situation for an implementation:
>> a frame has arrived, yet the higher layer cannot read from it yet, so an
incoming stream is unreadable.

>> On Thu, May 10, 2018 at 06:25:55PM +0000, Mike Bishop wrote:
>> > If you want to open a stream (e.g. permit data to be sent in the
opposite direction of a bidirectional stream), but don't actually have data
ready to send yet.
>> >
>> > -----Original Message-----
>> > From: QUIC [mailto:quic-bounces@ietf.org] On Behalf Of Dmitri Tikhonov
>> > Sent: Thursday, May 10, 2018 11:05 AM
>> > To: IETF QUIC WG <quic@ietf.org>
>> > Subject: Why allow empty STREAM frames when offset is zero?
>> >
>> > [draft-ietf-quic-transport-11] says the following:
>> >
>> >    A stream frame's Stream Data MUST NOT be empty, unless the offset is
>> >    0 or the FIN bit is set.
>> >
>> > Why allow empty STREAM frames when the offset is zero?  What is the
purpose?
>> >
>> >   - Dmitri.
>> >