Re: [DNSOP] New draft on representing DNS messages in JSON

Paul Hoffman <paul.hoffman@vpnc.org> Thu, 21 August 2014 14:01 UTC

Return-Path: <paul.hoffman@vpnc.org>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C126A1A0300 for <dnsop@ietfa.amsl.com>; Thu, 21 Aug 2014 07:01:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.647
X-Spam-Level:
X-Spam-Status: No, score=-3.647 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_MISMATCH_COM=0.553, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VvxIgn5vqcGE for <dnsop@ietfa.amsl.com>; Thu, 21 Aug 2014 07:01:04 -0700 (PDT)
Received: from proper.com (Hoffman.Proper.COM [207.182.41.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B0B9D1A02FF for <dnsop@ietf.org>; Thu, 21 Aug 2014 07:01:04 -0700 (PDT)
Received: from [10.20.30.90] (50-0-66-181.dsl.dynamic.sonic.net [50.0.66.181]) (authenticated bits=0) by proper.com (8.14.9/8.14.7) with ESMTP id s7LE12lM063766 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 21 Aug 2014 07:01:03 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
X-Authentication-Warning: proper.com: Host 50-0-66-181.dsl.dynamic.sonic.net [50.0.66.181] claimed to be [10.20.30.90]
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <20140821102232.73071610@vulcan>
Date: Thu, 21 Aug 2014 07:01:01 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <586AEB36-C10F-4E6E-AC55-BAADE7C00FD4@vpnc.org>
References: <B4ACD73A-25EF-4063-81D4-DCFE6DB78AB1@vpnc.org> <20140821102232.73071610@vulcan>
To: Shane Kerr <shane@time-travellers.org>
X-Mailer: Apple Mail (2.1878.6)
Archived-At: http://mailarchive.ietf.org/arch/msg/dnsop/uL_2RSw7_rdpA5eqfHijd6tVpnA
Cc: dnsop <dnsop@ietf.org>
Subject: Re: [DNSOP] New draft on representing DNS messages in JSON
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Aug 2014 14:01:09 -0000

Thanks for the comments!

On Aug 21, 2014, at 1:22 AM, Shane Kerr <shane@time-travellers.org> wrote:

> * I don't like the treatment of QNAME*/hostQNAME, NAME*/hostNAME, and
>  so on. Since JSON includes encoded strings, wouldn't it make more
>  sense just to always put the QNAME in there? (Especially since you'll
>  end up with SRV queries always being encoded as they have underscore
>  characters...)

JSON requires its strings to be encoded in a particular character set. Given that the labels in a QNAME/NAME can be an binary cruft, you can't assume that every QNAME will be representable.

I could reverse the logic and say QNAME/NAME are hostnames, and thus plain JSON strings in ASCII (which is by far the most common thing), and then have a different field for nonHostQNAME* and nonHostNAME* for when the QNAME/NAME. However, there would then need to be a way to indicate that the QNAME/NAME was not representable as a hostname. "" is OK, but then we would have to say that the root would always have to be represented as ".", which is not true now. To avoid that, I went with QNAME/NAME being as 1035 defined them, but I'm willing to think about other possibilities. 

> * In general I'm not super enthusiastic about the mixing of binary and
>  formatted data - I tend to think an application will want one or the
>  other. Perhaps it makes more sense to define two formats, one binary
>  and one formatted? Or...

All fields are optional, so a profile could say "don't include these" or "always include those". Further, and more importantly, most RDATA are binary. I did not want to force implementations to use the presentation format for RDATA.

> * Maybe it makes sense to define a meta-record so consumers can know
>  what to expect? Something that lists which names will (or may) appear.

That would be a JSON schema. Just using that phrase will cause screaming in the Apps Area. Having said that, it's perfectly reasonable for a profile to insist that each record have a profile indicator such as "Profile": "Private DNS interchange v3.1".

> I'd be mildly curious to see a comparison of the compressed sizes of
> JSON-formatted data (without data duplicated as binary stuff) versus
> non-JSON-formatted data. My intuition is that compression will remove
> most of the horrible redundancy that is involved in JSON, but there's
> only one way to be sure. ;)

Sure. It's pretty trivial to do, for example, a CBOR format that follows this; there are now CBOR libraries for most popular modern languages (see http://cbor.io/) If folks here want that, I can add it as an appendix. To be clear, however, I haven't heard anyone saying they want compression so badly they are willing to lose readability of the data.

--Paul Hoffman