Lecture 2 CS 3311 An example of a middleware service: DNS Domain Name System
The problem Networked computers have names and IP addresses. Applications use names; IP uses for routing purposes IP addresses. The role of DNS is to handle the mapping between host names and IP addresses the amount of information is huge and distributed. Names belong to a name space - set of well-defined names. Example 1: george.cs.ucc.ie 143.239.201.145 Example 2: connect to www.cs.ucc.ie 1. The browser will contact the local DNS with the name to lookup the IP address. 2. TCP connection is established. 17/09/2013 2
Resolvers Resolvers are clients (on the applications side) that access name servers. They and their cache memories are part of the host operating system. The resolver handles: Querying a name server; Interpreting responses (can be resource records or an error); Returning information to the programs that requested it. Usually, the resolver is a set of library routines (i.e. gethostbyname) that are compiled into applications. 17/09/2013 3
Name Servers Each ISP has a local name server to which the query is sent (the IP address of the local DNS is configured by hand in each host). Name servers store information about the domain name space a part of it, called zone the name server has authority for that zone. A zone contains domain names and data, except those delegated elsewhere. There are two types of name servers: Primary master: gets data for the zone it s authoritative for from files on the host it runs on; Secondary master: gets its zone data from a primary master. A root name server knows where NS authoritative for all the top-level domains are. 17/09/2013 4
The DNS protocol the chain of events: 1. The resolver sends the query to the local DNS server. 2. If not solved, the local DNS relays it to a root server. If the root name server has a record for the hostname, it ll send the reply. Otherwise, it will relay the query to an authoritative server for that domain which should have a record of the hostname. 3. The reply message goes to the root and then to the local name server. 4. Queries can be recursive (A sends to B and B acts on behalf of A) or iterative (if B can not solve the query, A will send it to another name server). Generally local name servers use the iterative strategy for root servers. 17/09/2013 5
Organisation of the name space root com edu gov mil ie ucc 17/09/2013 6
Name Convention A domain has a domain name (up to 63 characters in length). The full domain name is the sequence of labels from the domain to the root, with. separating the labels. Sibling nodes (children of the same parent) are named uniquely. The depth of the tree is limited to 127 levels. While domain names are just indexes into the DNS database, the hosts are the domain names that point to information about individual hosts. 17/09/2013 7
Name conventions cnt d Domains at the leaves of the tree generally represent individual hosts point to IPs, HW information and mail routing information. Domain names in the interior of the tree can name a host and can point to structural information about sub-domains. Example: blue.com is both the name of the Blue company domain and the domain name of a host that forwards mail between Blue and Internet. 17/09/2013 8
DNS records DNS: distributed db storing resource records (RR) Type = A name is hostname RR format: (name, value, type, ttl) value is IP address Type = NS name is domain (e.g. foo.com) value is hostname of an authoritative name server for this domain. Type = CNAME name is alias name for some canonical (the real) name www.ibm.com is really servereast.backup2.ibm.com value is canonical name Type = MX value is the canonical name of mail server associated with name. 17/09/2013 9
DNS features The system is implemented by many computers that run the service it is a multi-server distributed architecture. The core component is a distributed database: local control of data; data is available across the entire network; Robustness and adequate performance are achieved through replication and caching. 17/09/2013 10
Speeding up the lookup process Delegation: assigns responsibility for a subdomain to another organisation; the parent domain contains only pointers to sources of the sub-domain s data. Caching: store data for future reference there is negative caching as well. 17/09/2013 11
DNS messages DNS protocol : query and reply messages, both with same message format msg header identification: 16 bit id for query, reply to query uses same id flags: query or reply recursion desired recursion available reply is authoritative 17/09/2013 12
DNS messages Name, type fields for a query RRs in response to query records for authoritative servers additional helpful info that may be used 17/09/2013 13
Exercises Create the DNS model for the host sean.cs.ucc.ie which needs the IP address of christine.lab3.lifl.fr, using either the recursive or the iterative strategy. What records does an authoritative server store about a sub-domain authoritative server? The concept of name space and name service extends beyond DNS to distributed systems and mobile computing. Try to find out more about it. Hint: URN (Universal Resource Name) 17/09/2013 14
Conclusions DNS is a seamless service provided in the Internet that allows distributed applications to use names. It is also a protocol supported by an Internet architecture. The supporting architecture is distributed and relies on a set of root servers. The protocol uses a message with the same format for requests/replies. The application s interface to DNS is the resolver. The performance is very important. How is it achieved? See how other systems, e.g. Bluetooth, solve this problem. 17/09/2013 15