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

Greg Wilkins <gregw@intalio.com> Wed, 01 December 2010 13:02 UTC

Return-Path: <gregw@intalio.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 BEEF428C45C for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 05:02:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.243
X-Spam-Level:
X-Spam-Status: No, score=-2.243 tagged_above=-999 required=5 tests=[AWL=0.734, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
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 pEecgEbeYgTc for <hybi@core3.amsl.com>; Wed, 1 Dec 2010 05:02:37 -0800 (PST)
Received: from mail-qy0-f179.google.com (mail-qy0-f179.google.com [209.85.216.179]) by core3.amsl.com (Postfix) with ESMTP id 08FDA28C27A for <hybi@ietf.org>; Wed, 1 Dec 2010 05:01:47 -0800 (PST)
Received: by qyk11 with SMTP id 11so7421469qyk.10 for <hybi@ietf.org>; Wed, 01 Dec 2010 05:03:01 -0800 (PST)
MIME-Version: 1.0
Received: by 10.229.219.212 with SMTP id hv20mr7374143qcb.223.1291208580792; Wed, 01 Dec 2010 05:03:00 -0800 (PST)
Received: by 10.220.167.203 with HTTP; Wed, 1 Dec 2010 05:03:00 -0800 (PST)
In-Reply-To: <20101201105939.GK22787@shareable.org>
References: <AANLkTi=UpWdjqU0Lkh11wSGtHVDO71_CvjWJyH4mPyQi@mail.gmail.com> <4590EC7E9324CF43A2B37F81AFD6357007BB59B9@BANMLVEM07.e2k.ad.ge.com> <20101201105939.GK22787@shareable.org>
Date: Wed, 01 Dec 2010 14:03:00 +0100
Message-ID: <AANLkTinSRhb2N6_hfcXbfB5uM3pU+xubNN1kJcT5w3E4@mail.gmail.com>
From: Greg Wilkins <gregw@intalio.com>
To: Jamie Lokier <jamie@shareable.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
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 13:02:38 -0000

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 is pretty poor success rate and any real world application is
going to have to have a fallback to some long polling like solution if
it is going to see wide deployment.

This long polling fallback could be part of a framework over
websockets (eg cometd) or we could make it part of the protocol
itself.   Eitherway, once we accept that a fallback will exist, then
success rate becomes less of a factor when picking how websockets
should work.

So just ask for a new port for ws and accept that only 70% of
connections will succeed.   It looks like if we go through all the
effort to use upgrade and/or connect, we are still looking at only
<80%.


> 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.
Besides, I doubt we can give full service to the last 20% anyway
because of data density issues etc.



> 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.

cheers