Re: [hybi] asychronous HTTP [was:Apples and Orangutans]

rektide <rektide@voodoowarez.com> Sat, 11 April 2009 07:59 UTC

Return-Path: <rektide@voodoowarez.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 0BAA93A6E15 for <hybi@core3.amsl.com>; Sat, 11 Apr 2009 00:59:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.416
X-Spam-Level:
X-Spam-Status: No, score=-2.416 tagged_above=-999 required=5 tests=[AWL=0.139, BAYES_00=-2.599, DATE_IN_PAST_03_06=0.044]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24HLdQ7xe8qe for <hybi@core3.amsl.com>; Sat, 11 Apr 2009 00:59:09 -0700 (PDT)
Received: from voodoowarez.com (eldergods.com [72.9.228.236]) by core3.amsl.com (Postfix) with ESMTP id CD2883A6C7D for <hybi@ietf.org>; Sat, 11 Apr 2009 00:59:09 -0700 (PDT)
Received: by deneb.voodoowarez.com (Postfix, from userid 1000) id EBB10B2191; Fri, 10 Apr 2009 23:23:24 -0400 (EDT)
Date: Fri, 10 Apr 2009 23:23:24 -0400
From: rektide <rektide@voodoowarez.com>
To: Mark Lentczner <markl@lindenlab.com>
Message-ID: <20090411032324.GB9817@voodoowarez.com>
References: <1E5B078C-3C9F-4934-A96E-56E57879A31D@lindenlab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <1E5B078C-3C9F-4934-A96E-56E57879A31D@lindenlab.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Cc: hybi@ietf.org
Subject: Re: [hybi] asychronous HTTP [was:Apples and Orangutans]
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Apr 2009 07:59:11 -0000

On Wed, Apr 08, 2009 at 08:47:29AM -0700, Mark Lentczner wrote:
> From the point of view of our customers, the application level authors 
> (both client and server side), I think there are two major questions they 
> would ask to characterize any potential protocol:
>
> 1) What is the data model?
> 	Minimal (binary blob and/or UTF-8 string)
> 	Structured (JSON object or XML stanza)
> 	Message (data and meta-data)
>
> 2) What is interaction model?
> 	Event (datagram at the senders whim)
> 	Request/Response (request at senders whim, with response from the  
> receiver)

A messaging protocol ought be able to meet all of the interaction & data models above, 
ought be designed to convey any content, and potentially ails one of the greatest pitfalls 
of the web: the two/multiple connection limit[1].  

If the web ecosystem evolves towards w3c widgets and integrative software networks ala 
OpenSocial, the connection limit must be addressed.  And not by juvenile hacks to permit 
more connections (eg by creating subdomains); the real answer is that the web needs a 
multiplexed communication channel.  I can think of nothing more suitable for holding multiple 
conversations over a single wire than a messaging protocol.

Recently in #persevere (April 7), reflecting on HyBi:
<rektide> i really love greg wilkins constant chime ins that, http is a great model, why
break complete from it

HTTP already meets many of the critereon for being a suitable messaging protocol, and I
think this is of capital importance.  HTTP pipelining allows asychronous data sending, Kris
Zyp has developed HTTP Channels[2] to permit decoupled asychornous data recieving, and if
these are leveraged together, it leaves only the outstanding issue of proxies and multiplexing:
adapting HTTP to be a multichannel bidirectional messaging system supporting meta-data. 

Kris' model in HTTP Channels introduces a client-id and a sequence-id that can be used to
maintain conversations while clients are hurling a stream of pipelined HTTP requests and a
server is sending data to the clients in an out of order manner.  These tokens are sent as
HTTP headers, and although not presently a part of the server response in Kris' HTTP Channels 
spec, I believe ought be adapted as the primary multiplexing mechanism.

The one issue I think isnt particularly well addressed is broadcast messaging; can the
server send events to multiple or all client-id's, and how do these broadcast messages get
serialized?

Assuming the proxy issue can be adapted to be non terminal, assuming a persistent TCP
connection is not a deal breaker (i.e. a non connection oriented transport such as UDP is not
required), it ought be possible to fully extend HTTP to be a asychronous bidirectional
multiplexed communication channel, and further, I believe it would be possible to implement
a client side implementation on top of existing web browsers entirely client side (although
browser code for strictly enforcing multiplexing constraints would be "a good thing").

[1] http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue
[2] http://cometdaily.com/2008/05/13/http-channels-2/


> While issues of data framing, efficient use of TCP, and ease of  
> implementation, will influence their view, I don't think they will be  
> nearly as important as these first two questions[*].
>
> The protocols we're discussing can be characterized by these two  
> questions:
> 	WebSockets: Minimal, Event
> 	BOSH, Bayeaux: Structured, Event
> 	rHTTP:  Message, Req/Resp
>
> Other protocols can be fit into this framework, with perhaps some  
> extension:
> 	XMPP: Structured , Event
> 	TCP: Minimal, Stream
> 	SMTP: Message, Event
> 	HTTP: Message, Req/Resp

To emphasize, we already have the tooling to make HTTP sending and (most of the tools for
making) HTTP recieving asychronous.  This Event model HTTP still supports Req/Resp http
communication as well.


> Now, while clearly any of these be used to implement the others, there  
> is a cost. Where simpler models are implemented with more complex, then 
> there is overhead on the wire and processing. Where more complex models 
> are implemented on simpler, then the burden falls to the application 
> developer.

The cost savings I'd like to see most is being able to leverage HTTP, by simply removing
its fault of being so sychronous & undirectional.  If anyone believes a fully duplex multiplexed
communication channel is of itself insufficient or ill suited for your needs, please speak 
as to why.  If you find the HTTP framing unsuitable, eg a header & a payload, that too would
be intesting to hear.


Good day all, 
rektide