Re: [hybi] New port and Tunneling?

Greg Wilkins <gregw@webtide.com> Mon, 16 August 2010 07:42 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 AE0DA3A6819 for <hybi@core3.amsl.com>; Mon, 16 Aug 2010 00:42:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.756
X-Spam-Level:
X-Spam-Status: No, score=-1.756 tagged_above=-999 required=5 tests=[AWL=0.221, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 vhvW6Hbn0YpN for <hybi@core3.amsl.com>; Mon, 16 Aug 2010 00:42:37 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id 9019A3A6981 for <hybi@ietf.org>; Mon, 16 Aug 2010 00:42:37 -0700 (PDT)
Received: by fxm18 with SMTP id 18so3232722fxm.31 for <hybi@ietf.org>; Mon, 16 Aug 2010 00:43:13 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.121.16 with SMTP id f16mr4745637far.72.1281944593046; Mon, 16 Aug 2010 00:43:13 -0700 (PDT)
Received: by 10.223.57.12 with HTTP; Mon, 16 Aug 2010 00:43:13 -0700 (PDT)
In-Reply-To: <20100816060333.GP27614@1wt.eu>
References: <b13c89a75303a5d97edcb78926b385be.squirrel@sm.webmail.pair.com> <20100815234010.GM27614@1wt.eu> <52530df7491f03990cbfffd3eb49bcb6.squirrel@sm.webmail.pair.com> <AANLkTi==qsBWRDhxten+fV91bYiBhJ_vhSoqPNpsp3Pb@mail.gmail.com> <28d4e6c08e65e43899d59478e332a8aa.squirrel@sm.webmail.pair.com> <AANLkTikCKFCCWue5xqGhNssUSCuf_uEQyuCoW9GGH2N5@mail.gmail.com> <f5eacee9dece3b4feb6ebcd017bd5977.squirrel@sm.webmail.pair.com> <AANLkTikMY0CHSqvQU9uRHiDrmotQDP1dtWwkiLAOYr=9@mail.gmail.com> <20100816051831.GN27614@1wt.eu> <AANLkTi==Tf2zzNeP9jaRzuw7P+dnbsqhkVF046rk0k3S@mail.gmail.com> <20100816060333.GP27614@1wt.eu>
Date: Mon, 16 Aug 2010 17:43:13 +1000
Message-ID: <AANLkTin8mv9dsjmamd3OLJRY96oPMC_sLTLtgEbmWfT-@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: Willy Tarreau <w@1wt.eu>
Content-Type: text/plain; charset="UTF-8"
Cc: hybi@ietf.org
Subject: Re: [hybi] New port and Tunneling?
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: Mon, 16 Aug 2010 07:42:38 -0000

On 16 August 2010 16:03, Willy Tarreau <w@1wt.eu> wrote:
> On Mon, Aug 16, 2010 at 03:51:26PM +1000, Greg Wilkins wrote:
>> Willy,
>>
>> I agree with your analysis of the problem, but I remain hopeful that a
>> better solution than Connection:close may be found, as this prevents
>> the HTTP connection being used after a failed upgrade (by a BOSH/comet
>> fallback).
>
> To be honnest, I have very little hope of being able to reuse a connection
> after a handshake failure, because this failure will not come from the
> server itself (otherwise the application would not have proposed WS at all)
> but from client-side intermediaries (proxy or transparent proxies). And it's
> hard to guess the state the connection will be in.


I don't think you can assume that just because the javascript is most
likely to connect to the server that served it, that it will know that
server supports websocket or not.  Frameworks and applications may be
deployed in servers independently of the author of the javascript. So
the javascript author does not know if websockets will be supported by
that server unless they try. Conceivably the javascript could be
dynamically generated on the serverside, with websocket support, but
the server will still not know if websockets is supported by the
network infrastructure or not.

Thus it is likely that websocket handshake will be tried and if it is
not supported by the network infrastructure, then the upgrade header
will not be passed on or the server will not send a 101.  This leaves
a perfectly valid HTTP connection that could be used for BOSH/Comet.



> Now that you're talking about it, I now remember why we suggested the close
> on the server side too. Last week I told Ian I forgot the reason. It was
> precisely for that : ensure the proxy won't process the next request without
> blocking it at the request level. Basically, if the server sends a close but
> not the client, then the proxy will not try to process the second request,
> even if it does not understand the Upgrade. This will result in a faster
> fail.

I'm not following exactly.  However I find it unlikely that an
intermediary that does not correctly handle the connection header for
upgrades would correctly handle it for close.



>> Having the server send a ws message after the handshake should be a
>> good way to quickly detect this problem.
>
> In my opinion, the data at the end of the handshake should be put in a WS
> message. In fact it could be a "pong". That would probably mean less work
> for the client as all it would have to do is call the same code on the data
> block that comes after the 101.

+1


>> Adding a simple checksum to
>> the framing would also quickly detect most varieties of intermediaries
>> not acting as pure tunnels.
>
> Possibly, but if we're worried about them, then we should as well support
> acknowledgements, because when connections are cut on timeout, you never
> know what part has correctly been forwarded. But doing all this will result
> in a more complex protocol. Probably that the checksum could be added later
> as an extension in the frames if needed.

If you have ping/pong, then you effectively can have acknowledged delivery.
Send a message, send a ping, when you get the pong you know the
message has been delivered.