Re: HTTP2 server-side stream creation

Amos Jeffries <squid3@treenet.co.nz> Wed, 08 July 2015 10:33 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 CCCC11B342E for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 8 Jul 2015 03:33:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Level:
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 AMm9fonwPe_D for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 8 Jul 2015 03:33:25 -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 8407C1B342C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 8 Jul 2015 03:33:25 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ZCmd0-000791-52 for ietf-http-wg-dist@listhub.w3.org; Wed, 08 Jul 2015 10:30:58 +0000
Resent-Date: Wed, 08 Jul 2015 10:30:58 +0000
Resent-Message-Id: <E1ZCmd0-000791-52@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 <squid3@treenet.co.nz>) id 1ZCmcy-000779-6R for ietf-http-wg@listhub.w3.org; Wed, 08 Jul 2015 10:30:56 +0000
Received: from 121-99-228-82.static.orcon.net.nz ([121.99.228.82] helo=treenet.co.nz) by lisa.w3.org with esmtp (Exim 4.80) (envelope-from <squid3@treenet.co.nz>) id 1ZCmcu-0000iN-Nm for ietf-http-wg@w3.org; Wed, 08 Jul 2015 10:30:55 +0000
Received: from [192.168.20.251] (60-234-32-170.bng1.nct.orcon.net.nz [60.234.32.170]) by treenet.co.nz (Postfix) with ESMTP id 6E49AE6D7F for <ietf-http-wg@w3.org>; Wed, 8 Jul 2015 22:30:20 +1200 (NZST)
Message-ID: <559CFBB3.1040908@treenet.co.nz>
Date: Wed, 08 Jul 2015 22:30:11 +1200
From: Amos Jeffries <squid3@treenet.co.nz>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: ietf-http-wg@w3.org
References: <CAEv2VfJKzwAA98hqVAnEDAfP4ixF3YSJ3TLMmA=b1zf2O8GpwQ@mail.gmail.com> <CAH_hAJE+9Y5rZeHPHNpDYW6p4jQEC1yN5C3Jd96M-YiZrY0mFw@mail.gmail.com>
In-Reply-To: <CAH_hAJE+9Y5rZeHPHNpDYW6p4jQEC1yN5C3Jd96M-YiZrY0mFw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=121.99.228.82; envelope-from=squid3@treenet.co.nz; helo=treenet.co.nz
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1ZCmcu-0000iN-Nm e7e8e67abe9773d1505c2c5b07c62c7b
X-Original-To: ietf-http-wg@w3.org
Subject: Re: HTTP2 server-side stream creation
Archived-At: <http://www.w3.org/mid/559CFBB3.1040908@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29875
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 8/07/2015 7:49 p.m., Cory Benfield wrote:
> On 7 July 2015 at 23:43, Fedor Indutny wrote:
>> Obviously, the most straightforward way is to do a PUSH_PROMISE on
>> existing client-initiated stream, but it appears to me that the
>> server-initiated streams created using HEADERS frame are valid
>> too.
> 
>>From section 8.1 of RFC 7540[0]:
> 
>> A client sends an HTTP request on a new stream, using a previously
>> unused stream identifier (Section 5.1.1).  A server sends an HTTP
>> response on the same stream as the request.
> 
> My reading is that this forbids a 'server' from sending a HEADERS
> frame first, because servers send responses on already-opened streams.
> 
> You could pretty easily construct a semantic for this that essentially
> turns HTTP/2 into a peer-to-peer communication stream, with both sides
> of the connection being free to issue requests. This could plausibly
> be very valuable in systems that use HTTP/2 as an RPC transport. I
> suspect most clients will currently not allow that behaviour, however,
> so if you wanted it it might be best to propose it as a negotiated
> HTTP/2 extension, per section 5.5 of RFC 7540[1]. If you (or anyone
> else on the list) think this is interesting I'd be happy to co-author
> a draft to propose it.

Technically.

However, HTTP/1.x currently still exists in the world. A surprisingly
large number of connections one way or another pass over at least one
HTTP/1.x transit hop. So for now any implementations will have to cope
with translation to HTTP/1.x where server requests are not possible.

HTTP/2 was designed with that in mind, thus it does not define
server-initiated semantics. But also does not forbid them outright,
since extensions or HTTP/3 may one day have a need to define it.

If you have a strong use case for it I suggest writing up a SETTINGS
extension which can be negotiated between two endpoints. That way 2->1.1
gateway devices can negotiate its absence for the 1.1 hops and things
still work.

HTH
Amos