lwIP - A Lightweight TCP/IP stack - Bugs: bug #56052, change the DNS server query...
You are not allowed to post comments on this tracker with your current authentication level.
bug #56052: change the DNS server query strategy from sequential to Round Robin
Submitter: | Gao Qingshui <kevingao> | ||
Submitted: | Tue 02 Apr 2019 09:18:07 AM UTC | ||
Category: | DNS | Severity: | 3 - Normal |
Item Group: | Change Request | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open | Planned Release: | None |
lwIP version: | git head |
Attached Files
file #46695: lwip-dns-change-to-Round-Robin-Query-Strategy.patch added by kevingao (6KiB - application/octet-stream)
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2019-04-02 | kevingao | Attached File | - | Added lwip-dns-change-to-Round-Robin-Query-Strategy.patch, #46695 |
Powered by Savane 3.13-caa5.
Corresponding source code
currently the DNS server query strategy was sequential, it means that lwip would query the 1st server DNS_MAX_RETRIES times before switching to the backup one. In the scenario that the main DNS server was unavailable, but the backup was available, this query stratedy would cusume much time to complete one successful domain name resolution.
I suggest the DNS query stradegy changed to Round Robin. so the query procedure was changed from "A->A->A->A->B->B->B->B" to "A->B->A->B->A->B->A->B", A and B was the main and backup DNS server. In current settings, this change could make the domain name resolution time from 6s to 1s in above scenario.
The attached file was my modification, pls have a review. There was four changes:
1, change the DNS query strategy from sequential to Round Robin;
2, for one successful DNS query, record the current server index to make the next DNS query start from this index, this would save more time if many domain name resolution happened in above case.
3, reset the current server index to the 1st valid one if servers changed.
4, change the initail DNS timeout from 1s to 2s. This could make the 1st timeout value was [1s, 2s]. If the initial timeout was set to 1s, the actually timeout value was [0, 1s], this could incur some unnecessary DNS query retransmission.