next up previous contents
Next: DNS Protocol Implementation Up: The Redirector as an Previous: Replica Database   Contents


Redirection Policy Implementation

Apart from standard initializing routines, the redirection policy component provides a special policy function, which is called for each DNS request. The function takes four parameters:
  1. The DNS name the request refers to;
  2. The client IP address;
  3. The current configuration of the redirector;
  4. An empty table where it should store the resulting replica IP addresses and TTL values.
In general, the duty of the policy function is to fill in the table with a set of IP addresses of the replicas and their associated TTL values. It first retrieves all the information about the domain name from the database, including the list of replicas. Then, it passes this list to the actual implementation of the desired policy, indicated in the domain name description. In this way all the policies have an uniform interface, and do not have to know anything about the database. The fact of switching between different policies remains invisible to the other components of the redirector.

Many instances of the policy function can be ran simultaneously (in separate threads) without interfering with each other. They are serialized only during operations on the replica database by the internal mechanisms described above.

Since implementing the policy function is a complex problem, we return to its detailed description in Chapter 4.


next up previous contents
Next: DNS Protocol Implementation Up: The Redirector as an Previous: Replica Database   Contents
root 2002-08-27