wiki:ResolverRefactorNotes

Introduction

Although originally for notes and suggestions about the refactoring of the resolver, the page has been extended to cover all refactoring issues for the start of year 3.

General

  • We should have a "lib/utils" directory to hold utility code that can be used by more than one component. The following are suggested for inclusion in the library:
    • The "buffer" objects in lib/dns.
    • The "string utilities" functions in lib/log.
    • Random number generators for the NSAS and QID.
  • Changes to APIs that handle names to use a Name object instead of taking a string (see #488).
  • Putting together all message-related utility methods (see comments in #493).

Resolver

  • Randomising UDP ports
  • Allowing a single UDP port to be used for simultaneous queries.
  • The handling of TCP connections for the resolver needs to be reviewed. At present a connection is opened for each TCP transaction and closed immediately.
    • If a TCP connection is opened to a server the open connection should be retained for a few seconds: if another transaction is made to that server it should bypass UDP and use the existing connection.
    • The TCP connection should be capable of handling multiple queries simultaneously (and must be able to cope with the replies returning in any order).
  • Modifications to the "buffer" objects used to handle wire-format messages to provide an accessible two-byte scratch area preceding the data. (This allows the TCP I/Os - which include a two-byte count field - to read from and write to the buffer objects directly, eliminating the need for data copying or additional I/Os in the TCP code.)
  • Elimination of the stackless coroutine model. This is proving to be limiting in the way code is structured.
Last modified 7 years ago Last modified on Mar 11, 2011, 11:26:45 AM