openscreenprotocol icon indicating copy to clipboard operation
openscreenprotocol copied to clipboard

[mDNS] Minimum TXT record length limit

Open markafoltz opened this issue 6 years ago • 1 comments

The DNS-SD spec discusses various length options for DNS-SD TXT records. The current Open Screen spec for mDNS discovery suggests the limit is 252 bytes. However, we may need more than that to advertise additional information like public key fingerprints; a SHA-256 fingerprint hex encodes to 64 bytes, or base64 encodes to 43 bytes.

On the implementation side, if we are only advertising these records on the LAN, the record size is limited by Ethernet and IP framing, which leads to the 1,300 byte maximum. If we need to publish these records on the Internet, which might be useful for off-LAN discovery, that puts us at 400 bytes.

In the Open Screen Library, we've found that there's a 256 byte maximum implied by the open source mDNSResponder library, but that can be modified upward by patching the implementation.

To resolve this we will need to answer the following questions:

  • What is all the information we need to advertise (including room for possible vendor extensions)?
  • Do we require forward compatibility with public DNS in the future?

markafoltz avatar Sep 06 '18 18:09 markafoltz

CC @btolsch

markafoltz avatar Sep 06 '18 18:09 markafoltz

We have moved away from mDNSResponder and onto our own mDNS stack, so the earlier length limits are no longer an issue. Still, should keep an eye on overall TXT record length so we can fit inside a datagram.

markafoltz avatar Sep 07 '23 00:09 markafoltz