Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The "message compression" used in DNS messages is also quite unusual, compared to other protocols. It serves as a reminder that the DNS protocol was created at a time when it was desirable to minimize as much as possible the amount of bandwidth used (as opposed to today), e.g.:

    a domain name represented as a sequence of labels, where
    each label consists of a length octet followed by that
    number of octets.  The domain name terminates with the
    zero length octet for the null label of the root.  Note
    that this field may be an odd number of octets; no
    padding is used.


DNS compression is actually described in section 4.1.4 of IETF RFC 1035:

  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.


Even now it's worth doing all compressions possible, with as little CPU use as possible. With something like a DNS server a difference of one byte in the packet size can result in twice as much bandwidth used. At the lowest levels, it's packets, not bytes. Cross the limit for one packet, get two packets, twice as much of bandwidth.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: