Re: [hybi] WebSocket handshake (HTTP and SSO)

Scott Ferguson <ferg@caucho.com> Sat, 04 September 2010 18:07 UTC

Return-Path: <ferg@caucho.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 E2D603A67DF for <hybi@core3.amsl.com>; Sat, 4 Sep 2010 11:07:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.194
X-Spam-Level:
X-Spam-Status: No, score=-2.194 tagged_above=-999 required=5 tests=[AWL=0.071, BAYES_00=-2.599, IP_NOT_FRIENDLY=0.334]
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 6-ufbPwI3j6C for <hybi@core3.amsl.com>; Sat, 4 Sep 2010 11:07:46 -0700 (PDT)
Received: from smtp114.biz.mail.sp1.yahoo.com (smtp114.biz.mail.sp1.yahoo.com [69.147.92.227]) by core3.amsl.com (Postfix) with SMTP id DDA9F3A67AC for <hybi@ietf.org>; Sat, 4 Sep 2010 11:07:46 -0700 (PDT)
Received: (qmail 16698 invoked from network); 4 Sep 2010 18:08:13 -0000
Received: from [192.168.1.11] (ferg@66.92.8.203 with plain) by smtp114.biz.mail.sp1.yahoo.com with SMTP; 04 Sep 2010 11:08:13 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: 2RqssqcVM1kX82tGl0DaGYvS4qWKglDyrc_C2aa6_VLRGhZ cAor9GjshQiJvj8gIGGnFFZwmcFsuPWNkfhuyFJ.lqtfa4XuJvXtF8MTxTXQ zmmMyAQeSce7hf4tcRSC6t80F1J2xYA8zDeOKo6XI2Uy8Hj39gH9Q.jEKCkQ z.CO5mBWSftL1H9XQIMqwHEJwM.pUxI.pojKioN67G.CxX20.BrrbFufhsLm 39xnO45b8_7OAAai42I6bxbLQJBnglVhHvoQD3yNB9DMXQABnNeUwZ3_A8GC OxesGMutihJ3IywpDYKqJey8QLOT3PvI406vwXCi9PtYdXqGc9tY-
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4C828B03.4010803@caucho.com>
Date: Sat, 04 Sep 2010 11:08:03 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100411)
MIME-Version: 1.0
To: Benjamin Black <b@b3k.us>
References: <AANLkTinxTLuDEiS=XuyVHG1W+aizKHWk2Z4=LLqEHvC4@mail.gmail.com>
In-Reply-To: <AANLkTinxTLuDEiS=XuyVHG1W+aizKHWk2Z4=LLqEHvC4@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: hybi@ietf.org
Subject: Re: [hybi] WebSocket handshake (HTTP and SSO)
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, 04 Sep 2010 18:07:48 -0000

Benjamin Black wrote:
> The focus of the argument in favor of re-implementing authn in
> Websockets mechanisms that already exist in HTTP is that the authn
> process sometimes requires an extra round trip.  One.  Round.  Trip.
> Sometimes.  The phrase you seek is "premature optimization".
>
> Instead of talking about it in the abstract of a single, extra round
> trip, I ask when this is relevant.  In cases where connections are
> short-lived, intended for a single request/response, and credentials
> can't be retained, this concern seems quite important.  Since the
> entire process is one round trip, adding another could add
> considerable latency.
>
> Are Websockets intended for short-lived, request/reply applications?
> If so, they are pointless as HTTP can handle these applications all on
> its own.
>
> Are they intended for applications in which:
>   1) a user is not already authenticated
> OR
>   2) the credentials can't be passed to the Websocket system to use in
> authentication?
>   

It's for non-browser applications, which have different latency and 
security requirements than browser-based applications. The 
authenticating "user" is a remote program. Thinking of cookies as 
authentication credentials is meaningless in this context.

Consider a messaging application which primarily sends single messages, 
but can either batch in short bursts or has a related event notification 
system for reading messages. Or think of the requirements of something 
like memcache or a query-based service like a database. A majority of 
the calls might be short request/response, and those might be the 
critical ones from a performance perspective. You might only have the 
WebSocket open for a short burst (1 sec) since connections are not 
always poolable for a long time in non-browser applications.  So you 
can't always just amortize extra handshake cost away.

If the WebSockets handshake overhead is sufficiently low, it can be used 
for the entire application. If it was identical to HTTP performance, it 
would always be a win. But if it's too high for the RPC, it may not be 
usable, and if the WebSockets performance is significantly worse than 
HTTP/RPC, it won't be a viable upgrade.

Suggesting a mix of HTTP and WebSockets a single application isn't 
really viable. You want the performance to be reasonable across a wide 
range of connection times.  It's not as simple as saying HTTP should be 
used for request/response and WebSockets used for long lived connections 
because both requirements may exist in the same application, or the 
burst rate may blur the distinction between the two..

If we follow your suggestion, non-browser applications would likely just 
use BASIC auth to avoid the handshake penalty. It wouldn't be a crisis 
since that's what many HTTP/webservice applications do today.  But it 
seems a shame to discourage the stronger challenge/response 
authentication and settle for sending passwords in the clear when we can 
enable challenge/response with zero extra overhead.

-- Scott
> Or, instead, are Websockets intended for long-running connections with
> numerous round trips, often from applications that can collect
> credentials and send them directly in the HTTP request that begins the
> Websocket negotiation?  And, if this is so, why are we obsessing over
> a single round trip adding all of 50ms to initial connection setup
> instead of recognizing the existing mechanisms are perfectly workable
> _as is_?  If, in the fullness of time and experience, we discover the
> extra round trip is a serious impediment, we are free to design and
> implement new mechanisms.
>
> File under: another confusing example of hybi efforts eschewing HTTP
> mechanisms and HTTP compliance.  If someone could elucidate that, I
> would be grateful.
>
>
> b
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>
>
>
>