[quicwg/base-drafts] Unidirectional Streams (#643)

Martin Thomson <notifications@github.com> Tue, 20 June 2017 06:24 UTC

Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6EBCD128AB0 for <quic-issues@ietfa.amsl.com>; Mon, 19 Jun 2017 23:24:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.801
X-Spam-Level:
X-Spam-Status: No, score=-4.801 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-2.8, RP_MATCHES_RCVD=-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=github.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 ZKmQMAxDgyYB for <quic-issues@ietfa.amsl.com>; Mon, 19 Jun 2017 23:24:27 -0700 (PDT)
Received: from o9.sgmail.github.com (o9.sgmail.github.com [167.89.101.2]) (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 3D4D5127B5A for <quic-issues@ietf.org>; Mon, 19 Jun 2017 23:24:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=yc8liBye4mM6R4eYeoS/sTtTw+E=; b=OTFUyNqkpcYFRFdR xubC+AMfkD1QbNmGPjNv6m2BjkxmSsJVB+Y2t0qcOKrTNYxuki3SIq75lH/6jA1c XGFGSeq3QLr0aT+HsZI+7U+SQfOm6J0Dy2o87hAZ749aLEik3Wg6ZdCTY2XHJ9nl CN6vBYdun3vPyLGEqPQKEzh1P5o=
Received: by filter0828p1mdw1.sendgrid.net with SMTP id filter0828p1mdw1-21201-5948BF7C-5C 2017-06-20 06:23:56.91609143 +0000 UTC
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2b-ext-cp1-prd.iad.github.net [192.30.253.17]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id lsAcKLNfSxq1IxDmFKuEoQ for <quic-issues@ietf.org>; Tue, 20 Jun 2017 06:23:56.868 +0000 (UTC)
Date: Mon, 19 Jun 2017 23:23:56 -0700
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4abc941cac8b9580333350729f22fbafcd7827484a492cf000000011560817c92a169ce0e21ecbf@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/643@github.com>
Subject: [quicwg/base-drafts] Unidirectional Streams (#643)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5948bf7cb279c_19a93f7fa401fc3025085"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinthomson
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak1bdZpoKUxU1Xuv319I7q57Q6DzDtSg2K5Gnu VT8gVo6B/D5YhZIcngOkqK7mvOq35F0s9xxqmTFS0ZTOzyYGWkQUblbXOikl6UP9LFYA6aCpSJOuCO hjohwE5qdsp3l7/rbvEnt61WTkVtFXWEd86bi9qMCiVMnXzZDvFYE/QWtYlkucs/lMl6xqBhCzYuiC Q=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/S0v4aN9T6v2JFp054dGTAwy_dTM>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.22
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 20 Jun 2017 06:24:30 -0000

This is a fairly fundamental change.  Let me try to describe what this does, and what it doesn't do.

## Transport Changes

Streams are unidirectional.  Each has three states: idle, open, and closed.  I separated the transitions for sending and receiving because that turned out to be easier to explain.  The reordering thing makes them different in subtle ways.

That's all.  The changes in transport are relatively small and they simplify streams a lot.  That it also makes the transport more generic is a nice bonus.

## HTTP Changes

This is where the bulk of the changes are.

### Stream Correlation

Previously request and response were implicitly correlated, as was the data correlated with the request or response headers.  With this change, that correlation each stream has a header that explicitly correlates these.

There are 5 types of stream: connection control, request, response, data, and push.  The first two have a simple header that has a type.  The next two reference another stream in their header, which ties request to response and data to request or response.  Push references a response stream and a PUSH_PROMISE on that stream.

I chose backward references rather than forward references for two reasons.  First, request and response correlation can't use forward references because that would mean the client would be exerting (uncoordinated) control over server streams.  Second, that gives the server the most flexibility in terms of how it answers requests (see #281).  The cost of using backward references is that endpoints have to check that the backward references aren't bad, either referencing the wrong type of stream, or with multiple references to the same stream.

The presence or absence of a message body is signaled after the initial header block using a HAS_BODY frame.  This empty frame indicates that another stream will include the body of the message - or a promise for a body.  I would like to eliminate this stream split.  See #245 and #557 for more details on that, though we need to fix #176 first, which brings us back to QPACK/QCRAM again.

### Prioritization

This changes prioritization so that it identifies requests.  I only made the minimal changes here, which means that this doesn't fix #441 at the same time, I've left that for later (see below).

### Cancelling Pushes

Because server push doesn't create streams with PUSH_PROMISE, I had to create a way to cancel them between the time that the PUSH_PROMISE is sent and when the push stream is created.  That's called RST_PUSH.

## Things That Need Improvement

I haven't based this on #171.  I think that functionality is good, but the last time I looked at the PR I didn't like some of the changes Mike made there.  (That's a taste thing.)  This really assumes that we accept something very much like #171.

This really needs QPACK/QCRAM.  Right now, it is impossible to cancel some types of request using RST_STREAM because not all messages will have a body (#176 again).  On balance, given that bodies are what you really want to kill, it's not disastrous, but it's a problem nonetheless.  I think that we all agree that this is something that we need to fix, but we haven't reached the point where we agree on the details of the fix.

## Things That Want Improvement

This also really wants headers and data on the same stream .  It doesn't exactly need that, but merging the streams would make things a lot easy, both conceptually and structurally.

I chose the simplest possible encoding for all of the fields that I touched.  That means that stream IDs are all 32 bits in size and the HAS_BODY frame takes an entire 9 octets.  For things that are that common, there are many ways in which byte efficiency could be improved.

I chose to use stream ID (and PUSH_PROMISE indexes) to correlate things rather than mint a new identifier.  It's tempting to move to an explicit identifier for correlation, which might contribute to fixing other issues (see discussion on priority and #441 above).  This would simplify RST_PUSH as well.

# Fixes

Closes #515, #240, #281, #175.
You can view, comment on, or merge this pull request online at:

  https://github.com/quicwg/base-drafts/pull/643

-- Commit Summary --

  * WIP
  * Initial cut at unidirectional streams
  * Fix PRIORITY to refer to requests
  * RST_PUSH frame for early cancellation of pushes
  * This was a common misunderstanding with h2
  * Lazy

-- File Changes --

    M draft-ietf-quic-http.md (493)
    M draft-ietf-quic-transport.md (290)

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/643.patch
https://github.com/quicwg/base-drafts/pull/643.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/643