Re: HTTP2 server-side stream creation

Cory Benfield <cory@lukasa.co.uk> Fri, 10 July 2015 08:51 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A455A1A89F9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 10 Jul 2015 01:51:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.29
X-Spam-Level:
X-Spam-Status: No, score=-6.29 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 8kk4LmD2UvCk for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 10 Jul 2015 01:51:14 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C9C0C1A89D3 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 10 Jul 2015 01:51:14 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ZDTyR-0002y7-R8 for ietf-http-wg-dist@listhub.w3.org; Fri, 10 Jul 2015 08:47:59 +0000
Resent-Date: Fri, 10 Jul 2015 08:47:59 +0000
Resent-Message-Id: <E1ZDTyR-0002y7-R8@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <cory@lukasa.co.uk>) id 1ZDTyN-0002xL-FS for ietf-http-wg@listhub.w3.org; Fri, 10 Jul 2015 08:47:55 +0000
Received: from mail-pd0-f181.google.com ([209.85.192.181]) by lisa.w3.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <cory@lukasa.co.uk>) id 1ZDTyL-0000fr-Os for ietf-http-wg@w3.org; Fri, 10 Jul 2015 08:47:54 +0000
Received: by pdrg1 with SMTP id g1so48936949pdr.2 for <ietf-http-wg@w3.org>; Fri, 10 Jul 2015 01:47:27 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fRGdfda9vQsLg2IJDSMTugcQXeqsI+nWvt4CiUlyGIY=; b=nAxako5MkLI4K9vVkF1k82e+w/06bwbR1PG1cE9For/sJ34Xl1Nm33wDwisDM6c1dZ OvwCUzn2KBYYkNqLv+Aghc0t8ZnzAleu1qFrQCXgbvh51BZ5mkYrJvd33zccPpcb/wzl u2TGnVSi/28GdZSVYsfNQJmpeW2LE6si0iPvwn0ncdfoN+ntR8N+o1bCm1B1VKQbxame cHya1Nk0+7Z2Q40I1AK5PNaWsABbQC5bQDSTQR8IDgbdCzd3wVD8Z38qvF0ZzA/DGYHR aPTL2ccVxtOW9obPAwWRckABIrF9MPi/ksgU3akPOUOi1VYXLIO4IQxzVx3dwX1CEbVp fUww==
X-Gm-Message-State: ALoCoQlEz9T+IM+jL9iQcUyErbbAj0DOPIVN2+NE7rpZ2p3jS/uQgIbD9wq3ZITS13sfNIgB+Li6
MIME-Version: 1.0
X-Received: by 10.70.129.73 with SMTP id nu9mr39587925pdb.166.1436518047259; Fri, 10 Jul 2015 01:47:27 -0700 (PDT)
Received: by 10.66.152.164 with HTTP; Fri, 10 Jul 2015 01:47:27 -0700 (PDT)
X-Originating-IP: [2620:104:4001:72:195b:f470:5d7d:fc80]
In-Reply-To: <2B54CD64-BD75-4EEC-9F19-D3B8887BCA3E@greenbytes.de>
References: <CAEfxk=uOpnU5Q_XXNZTw_Rr8VAD86dqWYDhRJW2mg5+E1jmvRw@mail.gmail.com> <39FF53D5-25BE-4418-B7BD-C1E512166660@lukasa.co.uk> <2B54CD64-BD75-4EEC-9F19-D3B8887BCA3E@greenbytes.de>
Date: Fri, 10 Jul 2015 09:47:27 +0100
Message-ID: <CAH_hAJFGJUAnyHpprRFAhJaw=ePVCCBQpxv3DzQNUdKGRnKKpA@mail.gmail.com>
From: Cory Benfield <cory@lukasa.co.uk>
To: Stefan Eissing <stefan.eissing@greenbytes.de>
Cc: Juan Benet <juan@benet.ai>, Fedor Indutny <fedor@indutny.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>, daviddias@ipfs.io, Jeromy Johnson <why@ipfs.io>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=209.85.192.181; envelope-from=cory@lukasa.co.uk; helo=mail-pd0-f181.google.com
X-W3C-Hub-Spam-Status: No, score=-5.3
X-W3C-Hub-Spam-Report: AWL=-0.675, BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1ZDTyL-0000fr-Os d086a768cd2ffd0662e7e41e93243655
X-Original-To: ietf-http-wg@w3.org
Subject: Re: HTTP2 server-side stream creation
Archived-At: <http://www.w3.org/mid/CAH_hAJFGJUAnyHpprRFAhJaw=ePVCCBQpxv3DzQNUdKGRnKKpA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29918
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 10 July 2015 at 09:13, Stefan Eissing <stefan.eissing@greenbytes.de> wrote:
> What would be the minimal behavior a conforming endpoint needs to exhibit? Say a client talks h2 with just this extension. Is there anything the server can assume about the nature of the streams it can open against the client? Does the client need to answer incoming HTTP requests? Against which authority? If left unspecified, how is this extension then used?

I think this is the critical question to answer. I think the server
can assume that the client would answer incoming HTTP requests, but we
definitely have to decide how to signal the client authority.

This cannot be negotiated in the SETTINGS frame because with only 32
bits available for the settings value a client would be pretty limited
in what it can offer. That really leaves us with either using a HTTP
header field, piggybacking on a different frame type, or introducing a
new frame type. I think using a header field for this is a bit
unpleasant (it smacks of the weirdness of Reverse HTTP[0] which I
don't particularly love), though it could work. I don't think there's
a good frame type to piggyback on, so the other option would be to
have a new frame type that is used in this case. That feels like the
best option: the client essentially emits a frame that says "I am
happy to receive requests for authority X".

> Assuming a client would want to implement a "HTTP server" in its side, this would then be an additional extensions with its own settings? That setting would then imply the exact same spec clarifications that this generic one does? How is peer-to-peer then used?
>
> Let's say there are two extensions "HTTP" and "NTP". "HTTP = 1" is implied in RFC 7540 for the server endpoint. Client announces "NTP = 1" in its SETTINGS. Both enable SETTINGS_PEER_TO_PEER. What is the impact?
>
> If I read 2.3, the "server" now needs to expose some sort of behavior to the NTP extension. Basically both endpoints somehow need to mirror each other?

Yeah, this is a good question. I think it depends on what kind of
extension NTP is.

Extensions like HTTP/2 Encoded Data[1], which advertise a capability
possessed by one of the peers, are unaffected by HTTP/2 P2P. If the
client advertises SETTINGS_ACCEPT_GZIPPED_DATA and
SETTINGS_PEER_TO_PEER, the server may send a request to the client and
use a GZIPPED_DATA frame in the body of that request.

For types of extensions like Alt Svc[2], which talk about 'client' and
'server', the terms vary on a stream-by-stream basis. That means that
if the server peer sends a request to the client in a HTTP/2 P2P
dialog, the client may emit an ALTSVC frame if it so chooses (because
it's technically the server for that stream).

The other type of extension that might exist is one that applies to
the connection as a whole, rather than to individual streams.
Currently Section 2.3. says that both peers should be considered both
servers and clients, but I'm now thinking that that's a bad idea. How
about the following:

> When this extension is deployed with other extensions to HTTP/2, the
> behaviour of this extension does not change. All other extensions
> that refer to 'client' or 'server' MUST be treated as though those
> terms apply on a per-stream basis.
>
> For stream 0, the connecting peer is the 'client', and the accepting peer
> is the 'server'.
>
> If a setting is defined as valid only for servers or only for clients (e.g.
> SETTINGS_ENABLE_PUSH can only be sent by clients), the peer that
> could not normally emit that setting MAY emit it after HTTP/2 P2P has
> been negotiated. Before HTTP/2 P2P has been negotiated, peers MUST
> NOT emit a setting they could not normally emit.

How does that seem?

[0]: http://tools.ietf.org/html/draft-lentczner-rhttp-00
[1]: https://datatracker.ietf.org/doc/draft-kerwin-http2-encoded-data/
[2]: https://datatracker.ietf.org/doc/draft-ietf-httpbis-alt-svc