DNS behaviour should be specified (the principled & forward-thinking case for SRV)

Josh Goodall <joshua@qutonic.com> Sat, 10 August 2013 00:48 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3753E11E816B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 9 Aug 2013 17:48:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T1P75onis4ak for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 9 Aug 2013 17:48:14 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 00DF121F9D1B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 9 Aug 2013 17:42:36 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1V7xEp-0000BS-DQ for ietf-http-wg-dist@listhub.w3.org; Sat, 10 Aug 2013 00:40:59 +0000
Resent-Date: Sat, 10 Aug 2013 00:40:59 +0000
Resent-Message-Id: <E1V7xEp-0000BS-DQ@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <joshua@qutonic.com>) id 1V7xEf-0000AP-Aa for ietf-http-wg@listhub.w3.org; Sat, 10 Aug 2013 00:40:49 +0000
Received: from mail-pd0-f177.google.com ([209.85.192.177]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <joshua@qutonic.com>) id 1V7xEe-0005Qu-9W for ietf-http-wg@w3.org; Sat, 10 Aug 2013 00:40:49 +0000
Received: by mail-pd0-f177.google.com with SMTP id y10so1177031pdj.36 for <ietf-http-wg@w3.org>; Fri, 09 Aug 2013 17:40:21 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; bh=IpJ6x/OIh0WNbDWAT29YRrUl9N5/MMoPhbyFsCP0dKE=; b=DTZwgsEOLhXPVTYWAN3CLCCORRww+NA/QE9XiwDAY9fdMvqUMupBhaQWSA0OdOImfu IZjCQDSDZMVum/1gAJ404iz+UgYzVVICUy0ZRpPkQcjtNfGGPofpJj1Z0gNUDc1fkS9u lLKWZ3ZBCj5WjQDmiupaLRJXXeDQjAXmbWKzy/Y1olQIgTXpRZc/+JmHHiSYCh3EmUYR UTe3m8q4UO9stt1Wtc6upHkSOlbOOGZSLHHLhh7+XKbZ7MUrIGhK2Xkq7Aa6eI/7okYN 0JZA8hIwctDVmG6/HlMzl5okQUf6oUpDubFtRsm2eWIK/1dCP8XmCnIiRemUGlCLkxxb Te8g==
X-Gm-Message-State: ALoCoQnycuXIZf7pNALBwrMl5+DlBDVqv28kZ8JMclc43zJJKeQ3sql3zEkgVDeMC7Y/r5FxKaSQ
X-Received: by 10.68.230.106 with SMTP id sx10mr13851710pbc.170.1376095221644; Fri, 09 Aug 2013 17:40:21 -0700 (PDT)
Received: from [192.168.1.113] ([59.167.119.3]) by mx.google.com with ESMTPSA id aj3sm25064199pad.8.2013.08.09.17.40.19 for <ietf-http-wg@w3.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 17:40:21 -0700 (PDT)
From: Josh Goodall <joshua@qutonic.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Message-Id: <75C35DC0-1612-470C-9A88-8E5C49A80BAC@qutonic.com>
Date: Sat, 10 Aug 2013 10:40:16 +1000
To: ietf-http-wg@w3.org
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
X-Mailer: Apple Mail (2.1508)
Received-SPF: none client-ip=209.85.192.177; envelope-from=joshua@qutonic.com; helo=mail-pd0-f177.google.com
X-W3C-Hub-Spam-Status: No, score=0.0
X-W3C-Hub-Spam-Report: RCVD_IN_DNSWL_NONE=-0.0001
X-W3C-Scan-Sig: lisa.w3.org 1V7xEe-0005Qu-9W 814834e7de8d3fe4ffd6b8e873bac7d4
X-Original-To: ietf-http-wg@w3.org
Subject: DNS behaviour should be specified (the principled & forward-thinking case for SRV)
Archived-At: <http://www.w3.org/mid/75C35DC0-1612-470C-9A88-8E5C49A80BAC@qutonic.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/19120
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

It is quite, no, very surprising that a protocol of the complexity,
importance and universality of HTTP does not fully specify how to
locate the service endpoint.  There are two major issues caused by
the current absence of DNS resolution behaviour specification:

#1 IPv4 and IPv6 require separate lookups, resulting in a DNS race
   for some browsers.[1]
#2 Apex records must be configured specially (read: hackishly).

The underlying assumption is that all address records are valid
for HTTP.  This is, of course, quite wrong.


Discussion

Issue #1 is very well discussed in [1]. Suffice to say that the
recommendation is not to have a DNS race at all but a TCP SYN race.
Supporting IPv6 adoption should be a part of this protocol revision,
because IPv6 is no longer coming; it is here, and failure to consider
it will look like a mistake later on.

Issue #2. It is unfortunate that almost every destination of
significance configures an address record for the apex.
So every other protocol that might respond to an A/AAAA record ends
up finding it too.  Ever seen inbound SMTP for your web server?
This is part of the reason.  Apex records are an enemy of availability,
since they must be changed manually where aliases do not.

But we can't use CNAMEs at the apex. How can we resolve this?


The SRV proposal

My suggestion is that standardising on SRV (RFC 2782)[2] records is
an easy and appropriate remediation, due to widespread support,
fitness for purpose and standards readiness.

It solves both problems above:

#1: both A and AAAA are included in Additional Information in SRV
    replies, at least by BIND9, so a SRV query is one round-trip.
#2: SRV works at the apex.

and adds additional benefits in behaviour and deployment flexibility.

I can't stress how valuable it is to have widespread support in DNS
servers today; that is why other DNS RR proposals don't have legs.
BIND9, NSD and Windows DNS Server all support authoritative service
of SRV. It can be deployed today.

Essentially, SRV is what CNAME should've been.  BCP 17 (RFC 2219)[6]
foresees this; section 5 of RFC 6335 (aka BCP 165 - the governing
document for the IANA service registry)[7] even has explicit
clarification for how "http" is to be used in SRV records, firmly
deprecating "www".

Moreover, as the browser becomes ever more the general client,
support for non-HTTP services can deploy in future without conflicting
with the traditional role. For example, SRV would've been a superb
choice for the Mozilla project's "Persona" protocol.


On the history

This has been proposed many times in various forms; see for example
[3][4][9][10].  The history shows that if we don't take action in the
protocol standard itself, improvement won't happen.

A fully worked example of including SRV lookup in the TCP binding
of a significant protocol standard can be found in section 3.2 of
RFC 6120 (XMPP) [5]


On the counterarguments

The common reason quoted not to use SRV is that it means an extra
DNS round-trip, since everything is using CNAME/A/AAAA records
today.  Indeed if we don't include it in the standard up front,
then it will always require an extra round-trip.  But settling on
SRV right now means that browser behaviour will be SRV-first. Not
only does this get everyone on board sooner or later, it'll mean
faster lookups for IPv6 in future.

There is a conflict with URI explicit ports; this was resolved by
Andrews in [4] by having an explicit URI port take priority;
conversely, in XMPP is resolved by prohibition of explicit port
numbers in URIs. (s5.2 of RFC 5122 [8])


References

[1] https://ripe64.ripe.net/presentations/78-2012-04-16-ripe64.pdf
[2] http://tools.ietf.org/html/rfc2782
[3] http://tools.ietf.org/html/draft-jennings-http-srv-05
[4] http://tools.ietf.org/html/draft-andrews-http-srv-01
[5] http://tools.ietf.org/html/rfc6120
[6] http://www.rfc-editor.org/bcp/bcp17.txt
[7] http://tools.ietf.org/html/bcp165
[8] http://tools.ietf.org/html/rfc5122
[9] http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/dns-srv-record-use-by-clients.html
[10] http://dns.vanrein.org/srv/