MikeBishop / http-layering

Start of an Internet draft on the separation between HTTP's semantic layer, framing layer(s), and the underlying transport layer.
15 stars 0 forks source link

Wenbo's comments #1

Open wenbozhu opened 8 years ago

wenbozhu commented 8 years ago

Very nice work! Did a first pass, on this long-overdue subject ...

////////////

  1. The Semantic Layer

Maybe mention the RPC semantics: any part of the response message causally happens-after the request data. E.g. no unsolicited response (true for spdy or http2 push too?), no success completion of the response before the request is completed ....

Also, this doc would be more useful if all the HTTP semantics that require transport support/mapping are listed, for completeness.

////////////

  1. Transport Services Required (ordered)

== Addressing / Session

The transport needs support URLs in locating a server, whose network address may change during a single request/response exchange between the client and server.

The concept of "session" needs be understood by the transport to correlate and deliver a request and response message.

== Reliable Delivery

"Weakened guarantees": seem to be that we should not be concerned about those extended semantics, for now.

== In-order Delivery

"The body is typically exposed as a bytestream": Use of metadata to decode the body in segments etc is not the concern of the core transport support, IMO.

== Partial Delivery

Maybe mention the two different scenario: headers v.s. body; partial body delivery.

Also, IMO framing should be considered the responsibilities of the transport service. E.g. if we were to layer HTTP/1.1 properly, then its transport service (non-multiplexed TCP) should include the elements of transfer-encoding, connection: keep-alive etc.

== Half-close or EOF

The transport (or the mapping semantics thereof) needs signal the completion of the request or response message.

== Abort

The transport needs be able to abort the request or response delivery when an error occurs.

== Keep alive or failure detection

The transport may be able to detect when a peer is gone (during a request/response). The failure detection may not be reliable or timely.

== Full-duplex

The transport needs be able to deliver request/response message at the same time, as data gets generated by the application.

== Flow control and throttling

Seems to me that the role of transport service is merely to propagate flow-control events of the peer (or the network) to the application. App to App (process to process) flow-control is beyond the scope of transport service. And flow control affects both the client and server process, equally.

=== Priority or fairness ..

////////////

  1. The Transport Adaptation Layer

If QUIC is considered a transport, then the framing part of HTTP/2 should be considered as a separate transport, IMO. Things like HOL blocking, priorities are the properties of such a transport.

So, it would be more clear to have a comparison table for the following "transport services":

HTTP/1.1 over TCP HTTP/2 over TCP QUIC HTTP over SCTP HTTPU & CoAP

MikeBishop commented 8 years ago

Just pushed a commit that addresses some of this. There are also items here that I disagree with a little bit, and I welcome discussion:

A whole world of discussion lies in your last point. Fundamentally, is QUIC a new HTTP-over-UDP mapping, or is it a new transport? That's the question I'm trying to capture in the title of 4.5. Depending on the context, QUIC may be "equivalent to HTTP/2," or it may be "a modern general-purpose transport." In fact, the I-D submitted in Prague calls it both, in the same paragraph.

You're entirely correct that the HTTP/2 framing layer could be used independently of HTTP. That was a low-priority design goal of the working group, and part of why the spec is so delineated between the framing layer itself and how HTTP semantics get mapped onto a stream. At the same time, some very HTTP-grounded concepts (primarily headers) made it into the framing layer, because we ultimately concluded that there was no negotiation mechanism for selecting something other than HTTP over the framing layer. ALPN permitted you to select "h2," which defined both layers at once. Selecting something different, while perhaps startlingly similar, would be a different protocol and a different RFC.

QUIC seems to have the option to go the other direction. Seen as a transport, it's very SCTP-like. By submitting it to the TSV WG and describing it as a "general-purpose transport," it seems clear that there's again an eye toward reusing this beyond HTTP. In that case, we should talk about it like a transport, with a (very thin) mapping defined. (HPACK frames on a dedicated stream, for example.) However, it has so far been used exclusively for HTTP transactions, and it may ultimately go the same path as HTTP/2 -- in which case it gets dropped from the transport table, and it's a rich mapping rather than a transport.

wenbozhu commented 8 years ago

Added a few comments to your changes. Thanks.

I will start a separate issue to suggest how we may enumerate semantic-layer features (that require transport support).

Full duplex: similar to how you position "push support", how about stating that it is a useful optimization, e.g. speech recognition, voice translation etc? Also see my comment to your changes.

Also, on whatwg Fetch, we recently fixed the Fetch API to allow early responses (non-error) too.

Flow-control: HTTP/2 does have changed how flow-control works, due to multiplexing of HTTP sessions. Section 4.2 actually looks good, after I read it again ;)

My earlier comment is mostly tied to partial delivery, which requires the application to signal to the transport flow-control conditions. Maybe you could add a few words there.

wenbozhu commented 8 years ago

Re: the definition of the transport and QUIC etc.

IMHO, this document should aim to break down, conceptually, all the existing HTTP protocols into two different layers, however they were implemented or specified.

For HTTP/1.1, SPDY/HTTP/2, QUIC, there are three distinct "extended transports" involved:

  1. TCP (port is an application-level concept, == sessions) with keep-alive (reusable), ignore pipelined request (which may be considered as another minor transport revision of its own)
  2. Multiplexed TCP (port is shared by concurrent sessions)
  3. Multiplexed UDP based "byte stream" transport (for what HTTP is concerned, i.e. in-order, reliable delivery with flow-control/congestion-control).

I.e. all of them have extended the traditional definition of L4 transport (OSI)

Then there is the mapping you are defining now on how to map the "standard" HTTP semantics to the underlying transport.

As new HTTP wire protocols are being proposed, this document will help to add some clarity (and sanity) to the process.