[bug #56052] change the DNS server query strategy from sequential to Round Robin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[bug #56052] change the DNS server query strategy from sequential to Round Robin

Wilfred
URL:
  <https://savannah.nongnu.org/bugs/?56052>

                 Summary: change the DNS server query strategy from sequential
to Round Robin
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: kevingao
            Submitted on: 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
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 02 Apr 2019 09:18:07 AM UTC  Name:
lwip-dns-change-to-Round-Robin-Query-Strategy.patch  Size: 6KiB   By: kevingao

<http://savannah.nongnu.org/bugs/download.php?file_id=46695>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56052>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel