wiki:RecursorTaskBreakdown

Task List for Non-DNSSEC Query Processing

The logic is explained here and is fairly complex. To assist the implementation within a sprint, an attempt has been made to break it down into task.

The task list here covers just the basic logic to get things started. Excluded from the task list are:

  • TSIG handling
  • ACL processing
  • DNSSEC validation

However, implementors must be aware of these features and must not code in such a way that their subsequent addition will be made difficult.

In the following sections, each top-level bullet point represents a separate task; sub-bullets indicate the scope of the task. For more details, refer to the overview of the recursive query logic.

Basic Server Framework

  • Basic recursor skeleton
    • any modifications of current recursor code
  • Configuration option processing
    • Define initial set of configuration options
      • Basic options: Forwarder/Resolver?
      • options controlling operation (e.g. size of CNAME/DNAME loop detection)
    • Process configuration options with program
  • Setting up server framework. (Uses the UDPServer and TCPServer framework provided in asio.)
    • Listen for query
      • Creation of query context
      • Starting query execution
  • Define Query Context data structure. This represents an incoming query and holds:
    • details of an incoming query
    • space to build up the outgoing response
    • space for handling intermediate fetches/responses
    • data structures for tracking query process
    • space for tracking/detecting CNAME/DNAME loops
  • General logic to control the query process
    • search authoritative records
    • iterate over search cache/issue queries
    • recognise when answer is found/absent and return response
    • keep track of overall time to process and handle timeouts

Query Reception

Essentially the "Initial Preparation" section in the overview of the overview of the recursive query logic.

  • Initialization
    • packet parsing
      • General validity check
      • EDNS0 Opt Processing
      • Handle format errors
    • other required initialization

Authoritative Query

Part of "LOOKUP" section in the overview of the overview of the recursive query logic.

This depends on how we will handle authoritative queries (e.g. permanently cache authoritative entries, authoritative server running on another port etc.) and so has been deferred until a decision is made.

Cache Search for Answer

Part of "LOOKUP" section in the overview of the overview of the recursive query logic.

  • Cache Search for general RR
    • search cache for exact QNAME/QTYPE
    • handle TTL expiration
  • Cache Search for NS
    • search for NS of closest enclosing name
    • handle TTL expiration
    • query NSAS for NS address

Issuing Queries

Part of "RESQUERY" section in the overview of the overview of the recursive query logic.

  • Send Query
    • send query to NS identified by address
    • direct answer to response code

Process Fetch Response

Essentially the "RESQUERY" and "ANSWER" sections in the overview of the overview of the recursive query logic.

  • Basic Housekeeping
    • handle response received and update of RTT
    • handle timeout and update of RTT
    • handle re-query on timeout/SRVFAIL
  • Cache information received
    • unpick information from response
    • handle different sources of NS and address data
  • Detect answer
    • identify if incoming packet contains answer (positive or negative)
    • handle failure cases (e.g. queries to all nameservers of a domain timeout)
  • Handle CNAME/DNAME
    • check for excessive redirection
    • check for loop
    • add to loop detection, replace QNAME & re-enter main query processing
  • Handle referral
    • identify nameservers
    • issue search for nameservers
Last modified 7 years ago Last modified on Dec 21, 2010, 5:47:49 PM