[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #15104] DNS: Support look-up of other RR types
From: |
Craig McQueen |
Subject: |
[lwip-devel] [task #15104] DNS: Support look-up of other RR types |
Date: |
Tue, 4 Dec 2018 21:33:57 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 |
Follow-up Comment #1, task #15104 (project lwip):
Here are some design notes I've made while contemplating this feature
(MarkDown format):
## What lwIP dns.c provides
* Encoding of DNS queries
* Decoding of DNS responses, including name compression
* DNS table stores lookups in-progress
* DNS table is also a cache for A and AAAA records
* Multiple simultaneous requests
* Callback on result (called once only for each request)
* Randomised source port for each request (optional)
* Retries
* Try multiple DNS servers
* mDNS lookups instead, for `.local.` domain
* Lookup A record, and fallback to AAAA record (and vice-versa) (according to
`addrtype`)
## What is different for other RRs
* Other RRs can have bigger responses (CNAME, MX, PTR, SRV and especially
TXT).
* TXT records can potentially be large and unbounded (according to [DNS-SD
TXT records](http://www.zeroconf.org/Rendezvous/txtrecords.html), max 100...
or 400... or 1300), but each character-string within is a max of 256 bytes.
* We care about multiple answers in the DNS response.
* e.g. for DNS SRV or NAPTR queries, multiple responses are
possible/likely.
* Note that for A or AAAA queries, multiple responses are also possible
for load sharing. lwIP only saves one response in the cache.
* We care about additional answers.
* e.g. SRV or MX responses might have target's A record in additional
answers.
* Should such an A record IP address be stored in the cache?
* For mDNS DNS-SD queries, we care about multiple responses. There can be an
unbounded number of multiple responses.
* Call the callback function multiple times.
* How does lwIP know when it's done? Hard to say for mDNS DNS-SD PTR query
of a service name; need a timeout)
* How does user know when it's done? Hard to say unless lwIP calls it with
a NULL parameter when it's done.
* Responses being more than a simple IP address response, don't fit in
existing DNS table. Caching would require larger table(s) and more complex
structures.
* No fallback to a different RR type, according to `addrtype` mechanism.
* Callback function has different type for 2nd parameter.
* The data is different depending on the RR type.
* Several records contain a target name, which makes the data much larger
than A or AAAA records. But the target name would be expected to be max
`DNS_MAX_NAME_LENGTH`.
* TXT records can potentially be large and unbounded, but each
character-string within is a max of 256 bytes, so it may be worth calling the
callback once for each character-string in the record.
* For reverse DNS query (look up IP address a.b.c.d to get host name), look up
is of form `d.c.b.a.in-addr.arpa` (for IPv4).
* It's worth adding a new function to facilitate this reverse look-up.
* Need a flag to select between DNS or mDNS, since there's no `.local` in
the host name to indicate it in the mDNS case.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/task/?15104>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/