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
[email protected]
https://www.ietf.org/mailman/listinfo/dnsop

Reply via email to