Re: [hybi] DNS SRV for WebSocket

Bruce Atherton <bruce@callenish.com> Mon, 28 March 2011 16:56 UTC

Return-Path: <bruce@callenish.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 5036728C0FC for <hybi@core3.amsl.com>; Mon, 28 Mar 2011 09:56:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.449
X-Spam-Level:
X-Spam-Status: No, score=-2.449 tagged_above=-999 required=5 tests=[AWL=-0.150, BAYES_00=-2.599, MIME_8BIT_HEADER=0.3]
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 PI+eTsAEphXa for <hybi@core3.amsl.com>; Mon, 28 Mar 2011 09:56:16 -0700 (PDT)
Received: from biz82.inmotionhosting.com (biz82.inmotionhosting.com [74.124.202.87]) by core3.amsl.com (Postfix) with ESMTP id 7B8E13A6A1E for <hybi@ietf.org>; Mon, 28 Mar 2011 09:56:16 -0700 (PDT)
Received: from [24.108.133.142] (helo=[192.168.145.101]) by biz82.inmotionhosting.com with esmtpa (Exim 4.69) (envelope-from <bruce@callenish.com>) id 1Q4FlJ-000594-8n; Mon, 28 Mar 2011 09:57:53 -0700
Message-ID: <4D90BE10.8050801@callenish.com>
Date: Mon, 28 Mar 2011 09:57:52 -0700
From: Bruce Atherton <bruce@callenish.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: Iñaki Baz Castillo <ibc@aliax.net>
References: <BANLkTi=G6bc=FquLM8agKWojmDkD9FohxA@mail.gmail.com>
In-Reply-To: <BANLkTi=G6bc=FquLM8agKWojmDkD9FohxA@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - biz82.inmotionhosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - callenish.com
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] DNS SRV for WebSocket
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, 28 Mar 2011 16:56:17 -0000

Is there any reason that the interaction of Websockets and DNS SRV could 
not be handled in a separate draft? That is how it is done in the SIP 
world between RFC3261 and RFC3263.

Also, my interpretation of the SIP RFC is that it allows for DNS lookups 
that do not use DNS SRV (via a "local policy"). I'm not sure that using 
DNS SRV lookups should be a mandatory part of every websockets 
implementation. Recommended, sure, but not required.

On 27/03/2011 10:23 AM, Iñaki Baz Castillo wrote:
> Hi, DNS SRV [*] is a mechanism for providing load-balancing and
> failover at client side. It's very common in modern communication
> protocols as SIP or XMPP. It's not used in HTTP, most probably because
> HTTP was created before SRV records, and when SRV was specified it was
> too late for including it into HTTP protocol. However WebSocket is a
> new protocol and could take advantage of it.
>
> For now, WebSocket draft just provide a host (hostname or IP) and port
> for the client to communicate with a WS server. Now that WS is still a
> draft it would be a good moment to include DNS SRV into WebSocket.
> Please consider it.
>
> Usage example:
>
> - A web page includes a WS connection to some-domain.org.
>
> - The web browser performs a DNS SRV query for
> _ws._tcp.some-domain.org and gets the following SRV records:
>
>      _ws._tcp.some-domain.org. IN SRV 1 60 80 ws1.some-domain.org.
>      _ws._tcp.some-domain.org. IN SRV 1 40 80 ws2.some-domain.org.
>      _ws._tcp.some-domain.org. IN SRV 2 0 8080 ws3.some-domain.org.
>
> - The client would then choose between the two records with best
> priority (1) taking into account their weight (60 and 40), so for
> example ws1.some-domain.org:80.
>
> - In case such destination is unreachable the client would take the
> second one (ws2.some-domain.org:80).
>
> - If also unreachable, then the third option (with less priority)
> would be chosen (ws3.some-domain.org:8080).
>
> NOTE: In case of WS over SSL/TLS, the SRV query would be
> _wss._tcp.some-domain.org.
>
> In this way, WS gets load balancing (based on SRV records weitgh) and
> failover (based on SRV records priority). Of course, in case there is
> not SRV record for _ws._tcp.some-domain.org, the client would then
> perform a common DNS A query for some-domain.org as usual. So SRV
> records are not mandatory (this is also true in SIP and XMPP).
>
> IMHO, this is very useful and should be part of any new communication
> protocol in Internet. But it should be defined as part of the
> WebSocket specification from the beginning rather than being a future
> addition (after WS is widely implemented it will be hard to introduce
> it).
>
> Best regards.
>
>
> [*] DNS SRV: http://tools.ietf.org/html/rfc2782
>
>