Re: [hybi] Intermediaries and idle connections (was Re: Technical feedback.)

Maciej Stachowiak <mjs@apple.com> Sat, 30 January 2010 07:36 UTC

Return-Path: <mjs@apple.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 80FCE3A67AF for <hybi@core3.amsl.com>; Fri, 29 Jan 2010 23:36:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.184
X-Spam-Level:
X-Spam-Status: No, score=-106.184 tagged_above=-999 required=5 tests=[AWL=0.285, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, SARE_RMML_Stock10=0.13, USER_IN_WHITELIST=-100]
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 MHY9EQM6og4A for <hybi@core3.amsl.com>; Fri, 29 Jan 2010 23:36:15 -0800 (PST)
Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by core3.amsl.com (Postfix) with ESMTP id 862073A6405 for <hybi@ietf.org>; Fri, 29 Jan 2010 23:36:15 -0800 (PST)
Received: from relay14.apple.com (relay14.apple.com [17.128.113.52]) by mail-out3.apple.com (Postfix) with ESMTP id 0AAC782B4216 for <hybi@ietf.org>; Fri, 29 Jan 2010 23:36:41 -0800 (PST)
X-AuditID: 11807134-b7cd9ae000001002-2a-4b63e18820b3
Received: from elliott.apple.com (elliott.apple.com [17.151.62.13]) by relay14.apple.com (Apple SCV relay) with SMTP id 15.01.04098.881E36B4; Fri, 29 Jan 2010 23:36:40 -0800 (PST)
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; charset="us-ascii"
Received: from [17.151.93.115] by elliott.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KX1001E3UH4W950@elliott.apple.com> for hybi@ietf.org; Fri, 29 Jan 2010 23:36:40 -0800 (PST)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <4B63DD6B.5030803@webtide.com>
Date: Fri, 29 Jan 2010 23:36:40 -0800
Message-id: <E765982E-06B5-48BC-B75D-02E3F9555018@apple.com>
References: <de17d48e1001280012i2657b587i83cda30f50013e6b@mail.gmail.com> <4B620B8F.6030706@gmx.de> <Pine.LNX.4.64.1001282217320.22053@ps20323.dreamhostps.com> <bbeaa26f1001281449q1a6e1813q3f537fe15a5a9d60@mail.gmail.com> <4B625733.2020907@webtide.com> <6.2.5.6.2.20100128225542.06fa8d68@resistor.net> <Pine.LNX.4.64.1001290817520.22020@ps20323.dreamhostps.com> <4B62C5FE.8090904@it.aoyama.ac.jp> <Pine.LNX.4.64.1001291134350.22020@ps20323.dreamhostps.com> <4B62E516.2010003@webtide.com> <5c902b9e1001290756r3f585204h32cacd6e64fbebaa@mail.gmail.com> <4B636757.3040307@webtide.com> <E379EA13-D58A-4BFB-A62D-2B931A54E276@apple.com> <4B63DD6B.5030803@webtide.com>
To: Greg Wilkins <gregw@webtide.com>
X-Mailer: Apple Mail (2.1077)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Intermediaries and idle connections (was Re: Technical feedback.)
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, 30 Jan 2010 07:36:17 -0000

On Jan 29, 2010, at 11:19 PM, Greg Wilkins wrote:

>> That is a valid concern. I think it would be a problem to design a
>> protocol where buy-in from intermediaries is required to deploy at all,
>> because that would greatly delay the deployment timeline. However, you
>> have pointed out a real problem with not knowing how intermediaries will
>> react, namely that you don't know if you need to take special measures
>> to hold the connection open.
>> 
>> I think the right way to approach this, and issues of intermediary
>> participation, is to have optional opt-in from intermediaries. I would
>> like to see a design where at least the SSL version of the WebSocket
>> protocol can operate with no need to change proxies or other
>> intermediaries, but where if proxies or other intermediaries are updated
>> to opt in, there's a way for both the client and server to know that,
>> and to be able to make certain default assumptions, for instance how
>> long the connection is held open even if completely idle. Do you have a
>> concrete proposal?
> 
> I've made many many concrete proposals.... so many that I've lost
> track as they've all been rebuffed.   I don't really care how the
> issue is solved... it just needs to be solved.
> 
> But for starters... let's make the upgrade request not just look like
> a HTTP request, let's make it a real HTTP request.  Then intermediaries
> and servers would be free to add new headers and do funky HTTP stuff
> without needing to involve the browsers.

I don't have anything against this suggestion per se, but it doesn't seem to solve either of the problems raised above:

- Letting intermediaries indicate that they are aware of WebSocket (perhaps allowing you to assume a default minimum timeout, and maybe with other benefits.)
- Knowing a lower bound on your idle timeout so you can avoid sending excessive messages just to keep the connection alive.

It might help provide a mechanism for this, but it's not even totally clear to me how it would.

> 
> Then for the timeout problem, we actually need the same solution for
> long polling as for websockets.   We need a standard header that expresses
> the idle timeouts, which can be checked by all intermediaries and either
> respected or adjusted by them.

It seems like we need a mechanism for that which is robust in the face of unaware intermediaries. One way I can think of to do that is to encode the information in a hop-by-hop header. Unaware intermediaries would (I hope) just drop it, while aware intermediaries could read it and update the information. Thus, you only get a header indicating WebSocket awareness if both the origin server (or client) and all intermediaries are aware, and your idle timeout lower bound would be based on the minimum of all participating endpoints and intermediaries.

Some set of headers is defined to be hop-by-hop: <http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.1>. The Connection header can also be used to cause additional headers to be treated as hop-by-hop headers: <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10>. One thing I don't know is whether deployed intermediaries respect this. Do they respect the fixed list of hop-by-hop headers? Do they treat headers listed in the Connection header field as hop-by-hop?


> Ideally there could be some non 101 return codes that could be sent
> so that a websocket client and a websocket server could have several
> rounds of negotiation for things like credentials, timeouts and maybe
> even redirections!

That might help with the origin server, but does it help with intermediaries? If intermediaries would normally just pass through a 101, then you cannot tell if an intermediary would time you out faster than your origin server.

Regards,
Maciej