Re: [DNSOP] Clarification question: compression pointers always to names earlier in the packet?

Ted Lemon <mellon@fugue.com> Wed, 24 October 2018 20:27 UTC

Return-Path: <mellon@fugue.com>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 580BB130E13 for <dnsop@ietfa.amsl.com>; Wed, 24 Oct 2018 13:27:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fugue-com.20150623.gappssmtp.com
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 TZUUCT6UzPjO for <dnsop@ietfa.amsl.com>; Wed, 24 Oct 2018 13:27:15 -0700 (PDT)
Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8F87E130E18 for <dnsop@ietf.org>; Wed, 24 Oct 2018 13:27:15 -0700 (PDT)
Received: by mail-qt1-x829.google.com with SMTP id l9-v6so7185817qtj.12 for <dnsop@ietf.org>; Wed, 24 Oct 2018 13:27:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fugue-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bUhDXXmJEjdqeTXe8X0ur2LWtPmkiI5trPyQUtsJNNM=; b=PEcL03TD7GjcWAtD2Spc9hLmWXdeoRSycipT1wwZTGcHzn/Vx4dt3hlM9ZJVG5Ktmf BxXWTV9uieSQERA100Vm84t/YQzxwxiEtvllhjVJh2auwtrRRgrHfEAIIKCGgTTlleBY AYepFHr1PLc7bH+6h67uUutKDP2iGMuRVHu30LZiGy+P2Li1eJF+W3Q9qHjBxDZpRoSx cd/G/xH5isW9+8wQ7lGUc3XIKbcv5qRr9xRAp8hXTgxUfafdhrCO8ZtEDXdv/c6kegGN ny2Ca0L7I2elHWwby++D7i3cmDqrjqkWCpniuwp7fBGP2tv3dKEOSK0++uIxL2SiX7JZ h6EA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bUhDXXmJEjdqeTXe8X0ur2LWtPmkiI5trPyQUtsJNNM=; b=uUSPkHrE9F8Wtn06oovtFPansqK/CjKnzJypV2jpM1bzELR+EPDRW1f7mDc5jT2VuD dYSbzb+Cu8J2JkIh0LqbgQtagzAN0aqRlxhCL+0aIkIZ2h5+HSPecqEtIwaTbcIe179x HC4NG6DskX8xlOvKjmO8g/B7owzEUeZifmvi2opZnTVWEljtSXNtyEQckXVMm/5uUUwj csTE/kWcxPUsPyRNxpXRQ2/UEfxtdDGzEBL+aGu8Bdf8o2gfmcQoq37azGjGhTPZI6vt vagwTfX1Pr68Q8GC07GsFkSnVhzPSjuICQ1wZ1loRTei4wjJnsiBiaTszz/S0rb2Mr1g MsqA==
X-Gm-Message-State: AGRZ1gIJcjWYJ9yLm0LDj0hxnlcJygajlLOOHHr7qD5np7TvA3tuSdrg bcaMiSKEbo1YLrMnU4Wxk59ViuEsbTBg9HOLpOSbemj5AwM=
X-Google-Smtp-Source: AJdET5el9lbU9uP8St0wgWr7cwRvjumPPTlqlcXzgpGWBZaMX/NOhSXFLXeWf50NWa6A9MC1c5Reqe4QL4Jl3oF0cE8=
X-Received: by 2002:ac8:24e3:: with SMTP id t32-v6mr3944336qtt.43.1540412834705; Wed, 24 Oct 2018 13:27:14 -0700 (PDT)
MIME-Version: 1.0
References: <BC2CDF40-4FF0-4111-88B7-04969491D2E0@dukhovni.org> <EC514300-F235-41DB-A413-2F9F8F8B04C8@sinodun.com> <f3c89916-6622-c153-f662-9ac42b61d81c@time-travellers.org>
In-Reply-To: <f3c89916-6622-c153-f662-9ac42b61d81c@time-travellers.org>
From: Ted Lemon <mellon@fugue.com>
Date: Wed, 24 Oct 2018 16:26:37 -0400
Message-ID: <CAPt1N1nq2-9NxoGSg3M+XHehAeT47A5T1w54vvmG=83j-hRoUw@mail.gmail.com>
To: Shane Kerr <shane@time-travellers.org>
Cc: dnsop WG <dnsop@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000d2035a0578ff4f6d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/4r5AwkBlQrIxfxlJVJr0oWNH9Qs>
Subject: Re: [DNSOP] Clarification question: compression pointers always to names earlier in the packet?
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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: Wed, 24 Oct 2018 20:27:18 -0000

The good news is that in a typical DNS message, N is pretty small.
 Although I suppose in an internet-facing name server, pretty small is
still pretty big...

On Wed, Oct 24, 2018 at 4:25 PM Shane Kerr <shane@time-travellers.org>
wrote:

> John,
>
> On 24/10/2018 15.38, John Dickinson wrote:
> > On 24 Oct 2018, at 10:01, Viktor Dukhovni wrote:
> >
> >> My reading of RFC 1035 is that DNS name "compression"
> >> via "pointers" is restricted to name strictly earlier
> >> in the DNS message:
> >>
> >>    4.1.4. Message compression
> >>
> >>    In order to reduce the size of messages, the domain system utilizes a
> >>    compression scheme which eliminates the repetition of domain names
> >> in a
> >>    message.  In this scheme, an entire domain name or a list of labels
> at
> >>    the end of a domain name is replaced with a pointer to a prior
> >> occurance
> >>
> >> ---------------
> >>    of the same name.
> >>
> >
> > Not strictly to do with loops but we noticed that not all nameservers
> > use the same compression algorithm. See section 9.1 and appendix B of
> > https://datatracker.ietf.org/doc/draft-ietf-dnsop-dns-capture-format
>
> It's not too surprising. I am pretty sure that producing optimal name
> compression (by size) is the same as one of packing problems, which are
> either NP-complete or NP-hard depending on the particulars:
>
> https://en.wikipedia.org/wiki/Packing_problems
>
> I think that this is only true if you allow re-ordering of RRset as well
> as RR within a set, but still.
>
> If you don't allow re-ordering then I think the overall complexity of
> compressing a message is the same as sorting, O(NlgN), which while a lot
> better is still not great, because you need to search through all prior
> labels to find the longest match when compressing each name.
>
> I think it's due to these fundamentally expensive costs that different
> name servers use the various heuristics you mention in the C-DNS draft
> to try to get a good balance of speed & size.
>
> Cheers,
>
> --
> Shane
>
> _______________________________________________
> DNSOP mailing list
> DNSOP@ietf.org
> https://www.ietf.org/mailman/listinfo/dnsop
>