Re: [hybi] WS port with BOSH-like fallback?

Jamie Lokier <jamie@shareable.org> Wed, 01 December 2010 15:25 UTC

Return-Path: <jamie@shareable.org>
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 B605D28C174 for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 07:25:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.17
X-Spam-Level:
X-Spam-Status: No, score=-3.17 tagged_above=-999 required=5 tests=[AWL=-0.571, 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 ECDiVHTxrtDQ for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 07:25:21 -0800 (PST)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 7B5F93A6C78 for <hybi@ietf.org>; Wed, 1 Dec 2010 07:25:14 -0800 (PST)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1PNoZa-0004ih-S1; Wed, 01 Dec 2010 15:26:22 +0000
Date: Wed, 01 Dec 2010 15:26:22 +0000
From: Jamie Lokier <jamie@shareable.org>
To: Greg Wilkins <gregw@intalio.com>
Message-ID: <20101201152622.GL22787@shareable.org>
References: <AANLkTi=UpWdjqU0Lkh11wSGtHVDO71_CvjWJyH4mPyQi@mail.gmail.com> <4590EC7E9324CF43A2B37F81AFD6357007BB59B9@BANMLVEM07.e2k.ad.ge.com> <20101201105939.GK22787@shareable.org> <AANLkTinSRhb2N6_hfcXbfB5uM3pU+xubNN1kJcT5w3E4@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <AANLkTinSRhb2N6_hfcXbfB5uM3pU+xubNN1kJcT5w3E4@mail.gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: Hybi <hybi@ietf.org>, "Alakkad, Achuth (GE Healthcare)" <Achuth.Alakkad@ge.com>
Subject: Re: [hybi] WS port with BOSH-like fallback?
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: Wed, 01 Dec 2010 15:25:39 -0000

Greg Wilkins wrote:
> On 1 December 2010 11:59, Jamie Lokier <jamie@shareable.org> wrote:
> > Alakkad, Achuth (GE Healthcare) wrote:
> >>
> >>    To me the main advantage of websocket is that, it makes use of
> >>    exisiting accepted port (80). Thus not affecting any intermediatory
> >>    devices, such as firewal configuration. If we are going to go with an
> >>    independent port for websockets, then will it start of a monotonous
> >>    rework for those devices ( like firewall, proxy etc..).
> >
> > I think Greg's idea is that if the other port fails, then it will use
> > BOSH-like over port 80, which is real HTTP tunnelling the data, so
> > your WebSocket application will work fine over firewalls and proxies.
> 
> That's a correct paraphrasing.
> 
> Looking at the numbers, it appears that no matter what handshake we
> use, we are looking at only a <80% success rate for websocket
> connections.

That's quite interesting.  I hadn't expected it to be so bad for every
method equally.

> > The only problem I see with Greg's idea is how long to wait after
> > trying the other port, before deciding that it isn't working.  Latency
> > is poor.
> 
> Indeed - but at least that would be a driver to motivate people to
> advocate for opening the WS port.

Well, a reasonable timeout might be 20 seconds, which is rather a long
time for a page to become interactive - especially if it's every time
you load the page or follow a link.

A shorter timeout is likely to give lots of false negatives - on
exactly the connections where data/packet/connection density matters
the most.

> Besides, I doubt we can give full service to the last 20% anyway
> because of data density issues etc.

Do you have any measurements to support the intuition that WS has
better data density than HTTP?

Inuitively it ought to, but most modern networks measure data density
in moderately sized packets not bytes.  Also, when large numbers of
bytes are involved in a short time, HTTP methods can aggregate many
bytes into fewer HTTP requests, so amortising away the HTTP headers.

So I wonder if you have any measurements to support the idea of users
failing to get useful service due to WS data density differences or
other WS factors?

I suspect the variation in what type of network access users have is
so great, that a difference of data density, if there is one, won't
make a "full service or not" difference to the majority of users -
only those whose bandwidth on a particular day happens to be close to
a particular threshold.

> > Application writers won't care about the workings - they'll just use a
> > WebSocket object which magically works - and it'll work in all places
> > where BOSH-like works at the moment.
> >
> > By the way, that's currently possible in Javascript in some current
> > browsers, using WebSocket to another port in parallel with BOSH-like
> > HTTP using XHR, and wrapping it up in a "MyWebSocket" object.
> 
> Indeed - I've not yet convinced myself that a BOSH-like long poll
> should exist as part of a the protocol or as part of the framework.
> But I do think that the success rate of WS over 80 is not going to be
> significantly higher than WS over dedicated port, so I'm really
> wondering why we are putting ourselves through this pain.

Maybe we're doing it so that we actually get the necessary
measurements to confirm that the success rate is similar in both
cases, with a variety of handshake methods.

Has anyone tried measuring the connection success rate - and
messages/packets/data/latencies - of "valid" HTTP port 80 techniques:
such as single-connection bidirectional chunked POST, and various
dual-connection pipelined-POST/GET (one upstream, one downstream)?

-- Jamie