[hybi] Bayeux / Jetty perspective.

Greg Wilkins <gregw@webtide.com> Tue, 31 March 2009 05:45 UTC

Return-Path: <gregw@webtide.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 E57983A688B for <hybi@core3.amsl.com>; Mon, 30 Mar 2009 22:45:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 vjCg6jDXw2Al for <hybi@core3.amsl.com>; Mon, 30 Mar 2009 22:45:22 -0700 (PDT)
Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.191]) by core3.amsl.com (Postfix) with ESMTP id 5BAB13A68C7 for <hybi@ietf.org>; Mon, 30 Mar 2009 22:45:21 -0700 (PDT)
Received: by ti-out-0910.google.com with SMTP id j3so1767931tid.25 for <hybi@ietf.org>; Mon, 30 Mar 2009 22:46:20 -0700 (PDT)
Received: by 10.110.47.9 with SMTP id u9mr782537tiu.54.1238478379271; Mon, 30 Mar 2009 22:46:19 -0700 (PDT)
Received: from ?10.10.1.9? (60-242-119-126.tpgi.com.au [60.242.119.126]) by mx.google.com with ESMTPS id 14sm174033tim.9.2009.03.30.22.46.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Mar 2009 22:46:18 -0700 (PDT)
Message-ID: <49D1AE22.1080409@webtide.com>
Date: Tue, 31 Mar 2009 16:46:10 +1100
From: Greg Wilkins <gregw@webtide.com>
User-Agent: Thunderbird 2.0.0.21 (X11/20090318)
MIME-Version: 1.0
To: hybi@ietf.org
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Subject: [hybi] Bayeux / Jetty perspective.
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: Tue, 31 Mar 2009 06:11:07 -0000

Hi all,

firstly I'd like to thank the IETF for the opportunity to speak at
last weeks APPAREA meeting and to give the Bayeux/Jetty perspective
on bidirectional HTTP.


For those that were not there, here is a rough summary of what I
said:

Bayeux is a JSON based protocol for publish/subscribe style
messaging over HTTP.

Cometd is a project at the dojo foundation to implement the
Bayeux protocol for javascript, java, perl, python, etc.
see http://cometd.org


Bayeux is negotiated multi-transport.

Preferred transport is long-polling over POSTs for same-domain
or GET's for cross-domain.

Fall back transport is normal polling.

We used to have a streaming transport, but dropped it as it
was not legal HTTP (proxies or clients can buffer until end
of response).


We are pretty happy with long-polling as a technique
and the latencies and the overheads that it entails are
pretty reasonable.

Most of our pain points are with the browser:

2 connection limit is a problem.      But we DO NOT
LIKE the current "solution" from the browsers of
increasing the limit to 6 or 8.   That just defers the
problem and puts extra stress on the servers and is
problematic for TCP/IP flow control.

The IETF recommended for the 2 connection limit for HTTP
clients for reasons and it does not appear that any
due diligence has been done by the browsers to address
those reasons.  Microsoft lifted the limit and everybody
else if following!

The IETF should investigate if this is going to be
a problem.  I can imagine web pages with many widgets
in iframes opening 10s of connections to a server and
starting long polling requests on each!


The problem of 2 connection limit is not a communications
problem - 2 HTTP connections is sufficient for good bi directional
communications.   It is a browser security problem, because
those 2 connections cannot be shared between frames, tabs or
windows of the same browser.   So they are trying to avoid
this issue by breaking RFC2616's recommendation!!!!



Another browser pain point is the inability to control
pipelining.  Normal requests can be pipelined behind a
long poll, and are thus delayed until the long poll
completes!.   The probability of this will increase with
more that 2 long polling connections!



The websocket proposal is both good and bad.
The Unicode datagram API is probably very good
for javascript programming.   But the zero terminated
wire protocol is horrible.   We see no reason why the
wire protocol should deviate so far from normal HTTP
style framing.   More over, normal HTTP framing would
allow binary data to be sent to non-javascript clients!


The rHTTP proposal is more attractive as a wire protocl
as it uses normal HTTP framing and should be trivial
to implement with existing code bases.


However, rHTTP would not significantly change bayuex
long polling other than to make long-poll responses into
real requests and long-poll requests into real responses.
The same data framing and latency would go over the wire.


The semantic that is missing from HTTP that would
improve Bayeux/cometd is the ability to send multiple
responses to a single request.   If for example,
a 1xx response could be sent with headers and content
without terminating the current request, then bayeux
long-polling would avoid the need to issue another
long-polling request.   This would reduce data overhead
and avoid protocol induced worst case latency.



regards