Re: IDNA and getnameinfo() and getaddrinfo()

Nicolas Williams <Nicolas.Williams@oracle.com> Tue, 15 June 2010 16:52 UTC

Return-Path: <Nicolas.Williams@oracle.com>
X-Original-To: idna-update@alvestrand.no
Delivered-To: idna-update@alvestrand.no
Received: from localhost (localhost [127.0.0.1]) by eikenes.alvestrand.no (Postfix) with ESMTP id 6978239E0FC for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:52:12 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at eikenes.alvestrand.no
Received: from eikenes.alvestrand.no ([127.0.0.1]) by localhost (eikenes.alvestrand.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sD52SChLQoEG for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:52:06 +0200 (CEST)
X-Greylist: from auto-whitelisted by SQLgrey-1.6.8
Received: from rcsinet10.oracle.com (rcsinet10.oracle.com [148.87.113.121]) by eikenes.alvestrand.no (Postfix) with ESMTPS id 0F38B39E02D for <idna-update@alvestrand.no>; Tue, 15 Jun 2010 18:52:05 +0200 (CEST)
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o5FGq0PS029084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Jun 2010 16:52:02 GMT
Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o5FGY7eS009442; Tue, 15 Jun 2010 16:51:59 GMT
Received: from abhmt006.oracle.com by acsmt353.oracle.com with ESMTP id 347382821276620680; Tue, 15 Jun 2010 09:51:20 -0700
Received: from oracle.com (/129.153.128.104) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 Jun 2010 09:51:19 -0700
Date: Tue, 15 Jun 2010 11:51:15 -0500
From: Nicolas Williams <Nicolas.Williams@oracle.com>
To: Shawn Steele <Shawn.Steele@microsoft.com>
Subject: Re: IDNA and getnameinfo() and getaddrinfo()
Message-ID: <20100615165113.GH24077@oracle.com>
References: <E14011F8737B524BB564B05FF748464A0D9F834C@TK5EX14MBXC139.redmond.corp.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <E14011F8737B524BB564B05FF748464A0D9F834C@TK5EX14MBXC139.redmond.corp.microsoft.com>
User-Agent: Mutt/1.5.20 (2010-03-02)
X-Auth-Type: Internal IP
X-Source-IP: acsinet15.oracle.com [141.146.126.227]
X-CT-RefId: str=0001.0A090204.4C17AFB3.01BC:SCFMA922111,ss=1,fgs=0
Cc: "idna-update@alvestrand.no" <idna-update@alvestrand.no>
X-BeenThere: idna-update@alvestrand.no
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: IDNA update work <idna-update.alvestrand.no>
List-Unsubscribe: <http://www.alvestrand.no/mailman/options/idna-update>, <mailto:idna-update-request@alvestrand.no?subject=unsubscribe>
List-Archive: <http://www.alvestrand.no/pipermail/idna-update>
List-Post: <mailto:idna-update@alvestrand.no>
List-Help: <mailto:idna-update-request@alvestrand.no?subject=help>
List-Subscribe: <http://www.alvestrand.no/mailman/listinfo/idna-update>, <mailto:idna-update-request@alvestrand.no?subject=subscribe>
X-List-Received-Date: Tue, 15 Jun 2010 16:52:12 -0000

On Tue, Jun 15, 2010 at 04:09:13PM +0000, Shawn Steele wrote:
> FWIW: I don't think that applications should need to understand how
> DNS works.  (Something of a seperation of business logic concept as
> probably taught in, like, CS101 - "Don't make your app know more than
> it has to.")  IMO it'd be nice if app developers that need to open a
> connection to a server had all the Punycode ugliness layered away by
> some nice set of DNS APIs, or even higher level at the open connection
> APIs or whatever.

Simon's extensions for getname/addrinfo() are the kind of APIs I'm
looking for.  I'm not sure if that's what you have in mind, but I'd love
to hear about it.

> Unforunately, Punycode means that some apps will want to decode the
> string anyway because they'd like pretty names.  Some sort of
> getcanonicalname() or something could help there.  I realize there's
> an "A" in "IDNA", but if every app has to do punycode conversion
> themselves there's going to be tons of odd inconsistencies in what
> they're doing.  It could also mean "tweaking" thousands of apps if the
> IDNA20xx rules change a little.  (Eg: like the bidi rules did this go
> around).

If an application is just dealing with hostnames then it's easy:
ToUnicode().  If the application needs hostname<->IP address resolution
then it needs something more like getname/addrinfo() with suitable
enhancements.  If the application needs to deal with e-mail addresses,
IRIs, etcetera, then the application is going to need APIs that are
specific to those.  The alternative is that the application must
implement all the relevant rules, all the time, and as draft-iab-idn-
encoding explains, that isn't always possible (the example being the
name service switch in typical operating systems).  It will be better to
have context-specific APIs.

> The good thing about Punycode/IDN is that it enabled DNS.  The bad
> thing is that suddenly any network app needs to become a DNS expert.

To some degree that's unavoidable, but with context-specific APIs we can
minimize the burden on applications.  We should do just that if we want
IDNA to succeed beyond the web browser (do we?).

Nico
--