2. TCP/IP Protocol Suite 2
19-1 NEED FOR DNS
To identify an entity, TCP/IP protocols use the IP
address, which uniquely identifies the connection of a
host to the Internet. However, people prefer to use
names instead of numeric addresses. Therefore, we
need a system that can map a name to an address or
an address to a name.
3. TCP/IP Protocol Suite 3
A central directory system cannot hold all the mapping.
In addition, if the central computer fails, the whole
communication network will collapse.
A better solution is to distribute the information among
many computers in the world.
In this method, the host that needs mapping can
contact the closest computer holding the needed
information. This method is used by the Domain Name
System (DNS)
4. TCP/IP Protocol Suite 4
Figure 19.1 Purpose of DNS
User
Host
name
1
Host
name
2
Query
3
Response 4
IP address
5
Transport layer
IP address
6
5. TCP/IP Protocol Suite 5
TCP/IP uses a DNS client and a DNS server to map a name to an address.
A user wants to use a file transfer client to access the corresponding file
transfer server running on a remote host.
The user knows only the file transfer server name, such as
afilesource.com. However, the TCP/IP suite needs the IP address of the file
transfer server to make the connection
1. The user passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS client.
3. Each computer, after being booted, knows the address of one DNS
server. The DNS client sends a message to a DNS server with a query that
gives the file transfer server name using the known IP address of the DNS
server.
4. The DNS server responds with the IP address of the desired file transfer
server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the
file transfer server.
6. TCP/IP Protocol Suite 6
19-2 NAME SPACE
To be unambiguous, the names assigned to machines
must be carefully selected from a name space with
complete control over the binding between the names
and IP addresses. In other words, the names must be
unique because the addresses are unique. A name
space that maps each address to a unique name can
be organized in two ways: flat or hierarchical.
7. TCP/IP Protocol Suite 7
Topics Discussed in the Section
Flat Name Space
Hierarchical Name Space
Domain Name Space
Domain
Distribution of Name Space
8. TCP/IP Protocol Suite 8
NAME SPACE
A name space that maps each address to a unique name can be organized
in two ways: fiat or hierarchical.
Flat Name Space
In a flat name space, a name is assigned to an address. A name in this
space is a sequence of characters without structure.
Hierarchical Name Space
In a hierarchical name space, each name is made of several parts. The first
part can define the nature of the organization, the second part can define
the name of an organization, the third part can define departments in the
organization, and so on.
Example:
challenger.jhda.edu, challenger.berkeley.edu, and
challenger.smart.com
11. TCP/IP Protocol Suite 11
Label
Each node in the tree has a label, which is a string with
a maximum of 63 characters.
The root label is a null string (empty string).
DNS requires that children of a node (nodes that branch
from the same node) have different labels, which
guarantees the uniqueness of the domain names.
14. TCP/IP Protocol Suite 14
19-3 DNS IN THE INTERNET
DNS is a protocol that can be used in different
platforms. In the Internet, the domain name space
(tree) is divided into three different sections: generic
domains, country domains, and the inverse domain (see
Figure 19.8).
15. TCP/IP Protocol Suite 15
Topics Discussed in the Section
Generic Domains
Country Domains
Inverse Domain
21. TCP/IP Protocol Suite 21
19-4 RESOLUTION
Mapping a name to an address or an address to a name
is called name-address resolution.
22. TCP/IP Protocol Suite 22
Topics Discussed in the Section
Resolver
Mapping Names to Addresses
Mapping Addresses to Names
Recursive Resolution
Iterative Resolution
Caching
23. TCP/IP Protocol Suite 23
1 Resolver
DNS is designed as a client/server application.
A host that needs to map an address to a name or a name
to an address calls a DNS client called a resolver.
The resolver accesses the closest DNS server with a
mapping request.
If the server has the information, it satisfies the resolver;
otherwise, it either refers the resolver to other servers or
asks other servers to provide the information.
24. TCP/IP Protocol Suite 24
Recursive Resolution
The client (resolver) can ask for a recursive answer from
a name server.
This means that the resolver expects the server to
supply the final answer.
When the query is finally resolved, the response travels
back until it finally reaches the requesting client. This is
called recursive resolution
25. TCP/IP Protocol Suite 25
We assume that an application program running on a host
named some.anet.com needs to find the IP address of
another host named engineering.mcgraw-hill.com to
send a message to.
The source host is connected to the Anet ISP; the
destination host is connected to the McGraw-Hill network.
26. TCP/IP Protocol Suite 26
The application program on the source host calls the DNS
resolver (client) to find the IP address of the destination host.
The resolver, which does not know this address, sends the
query to the local DNS server (for example, dns.anet.com)
running at the Anet ISP site (event 1).
We assume that this server does not know the IP address of the
destination host either. It sends the query to a root DNS server,
whose IP address is supposed to be known to this local DNS
server (event 2).
Root servers do not normally keep the mapping between
names and IP addresses, but a root server should at least know
about one server at each top level domain (in this case, a server
responsible for com domain).
The query is sent to this top-level-domain server (event 3).
27. TCP/IP Protocol Suite 27
We assume that this server does not know the name-
address mapping of this specific destination, but it knows
the IP address of the local DNS server in the McGraw-Hill
company (for example, dns.mcgraw-hill.com).
The query is sent to this server (event 4), which knows
the IP address of the destination host.
The IP address is now sent back to the top-level DNS
server (event 5), then back to the root server (event 6),
then back to the ISP DNS server, which may cache it for
the future queries (event 7), and finally back to the source
host (event 8).
29. TCP/IP Protocol Suite 29
The main difference between iterative and recursive
resolution is that here each server that does not know the
mapping sends the IP Address of the next server to the
one requested it.
Here, the client allows the server to return the best
answer it can give as a match or as a referral.
A DNS Query is generated by the application program to
the resolver to fetch the destination IP Address.
The Query is then forward to the local DNS Server.
Assuming, it does not know the IP Address, it sends the
query to the root name server.
30. TCP/IP Protocol Suite 30
The root name server returns the IP Address of the Top-
Level Domain Server to the Local Server.
The Top-Level Domain server is contacted by the Local
Server and it returns either the IP of the destination host
or its local DNS Server.
If it returns the server’s address, then by contacting the
destination’s Local DNS Server, we get the IP Address of
the destination host.
The response/mapping is then passed from the host’s
local DNS server to the resolver and then finally to the
host.
31. TCP/IP Protocol Suite 31
Which is best:
Recursive DNS queries generally tend to resolve faster than
iterative queries. This is due to caching.
A recursive DNS server caches the final answer to every query it
performs and saves that final answer for a certain amount of time
(known as the Time-To-Live).