Application Layer
DNS (Domain Name System)
Application Layer
• Objectives: The application layer enables the user, whether human
or software, to access the network.
• It provides user interfaces and support for services such as
electronic mail, file access and transfer, access to system resources,
surfing the world wide web, and network management.
• The application layer is responsible for providing services to the
user.
• Application Layer examples:
- Domain Name System (DNS)
- Simple Mail Transfer Protocol (SMTP)
- File Transfer Protocol (FTP)
- Hypertext Transfer Protocol (HTTP)
- Simple Network Management Protocol (SNMP)
- Teletype Network Protocol (TELNET)
Client-Server Model
• Client-Server model is standard model for developing network
applications.
• A server is a process that is offering some service.
• A client is a process that is requesting the service.
• Server or client may be running on different machines.
• Server waits for requests from client(s).
• The server process starts on some computer system. It Initializes itself,
then goes to sleep, waiting for a client request.
• A client process starts, either on the same system or on some other
system. A client sends a request to the server.
• When the server process has finished providing its service to the client,
the server goes back to sleep, waiting for the next client request to arrive.
The process repeats.
• Roles of the client and the server processes are asymmetric.
• Two types of servers:
• Iterative servers: These are used when the server process knows in
advance how long it takes to handle each request and it handles each
request itself.
• – Single copy of server runs at all times.
• – A client may have to wait if the server is busy.
Continue…
• Concurrent servers: These are used when the amount of work required to
handle a request is unknown; the server starts another process to handle
each request.
• – A copy of the server provides to a client’s request in a dedicated fashion.
• – As many copies of server as there are client requests.
DNS (Domain Name System)
• There are several applications in the application layer of the
Internet model that follow the client/server pattern.
• The client/server programs can be divided into two categories:
those that can be directly used by the user, such as e-mail, and
those that support other application programs.
• The Domain Name System (DNS) is a supporting program that is
used by other programs such as e-mail.
• A user of an e-mail program may know the e-mail address of the
recipient; however, the IP protocol needs the IP address.
• The DNS client program sends a request to a DNS server to map the
e-mail address to the corresponding IP address.
• 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.
Top Level Domains
Domain Name Space
• To have a hierarchical name space, a domain name space was designed. In
this design the names are defined in an inverted-tree structure with the
root at the top. The tree can have only 128 levels: level 0 (root) to level
127.
Domain name space
Continue…
• 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.
• Domain Name: Each node in the tree has a domain
name. A full domain name is a sequence of labels
separated by dots (.).
• The domain names are always read from the node up to
the root. The last label is the label of the root (null). This
means that a full domain name always ends in a null
label, which means that the last character is a dot
because the null string is nothing.
Continue…
Domain names and labels
Continue…
• Fully Qualified Domain Name: If a label is terminated by a null string, it is called a fully
qualified domain name (FQDN). An FQDN is a domain name that contains the full name of a
host.
• It contains all labels, from the most specific to the most general, that uniquely define the
name of the host. For example, the domain name
challenger.atc.tbda.edu.
• is the FQDN of a computer named challenger installed at the Advanced Technology Center
(ATC) at De Anza College.
• A DNS server can only match an FQDN to an address. Note that the name must end with a
null label, but because null means nothing, the label ends with a dot (.).
• Partially Qualified Domain Name: If a label is not terminated by a null string, it is called a
partially qualified domain name (PQDN). A PQDN starts from a node, but it does not reach
the root.
• It is used when the name to be resolved belongs to the same site as the client. Here the
resolver can supply the missing part, called the suffix, to create an FQDN.
FQDN and PQDN
Domain
• A domain is a subtree of the domain name space. The name of the
domain is the domain name of the node at the top of the subtree. Note
that a domain may itself be divided into domains (or subdomains as they
are sometimes called).
Domain Name Structure
• Domain names are arranged in a hierarchical
tree-like structure.
Distribution of Name Space
• The information contained in the domain name space must be
stored. However, it is very inefficient and also unreliable to have
just one computer to store such a huge amount of information.
• It is inefficient because responding to requests from all over the
world places a heavy load on the system. It is not unreliable
because any failure makes the data inaccessible.
• Hierarchy of Name Servers: The solution to these problems is to
distribute the information among many computers called DNS
servers. One way to do this is to divide the whole space into many
domains based on the first level.
• In other words, we let the root stand alone and create as many
domains (subtrees) as there are first-level nodes. Because a domain
created in this way could be very large, DNS allows domains to be
divided further into smaller domains (subdomains).
• Each server can be responsible (authoritative) for either a large or a
small domain. In other words, we have a hierarchy of servers in the
same way that we have a hierarchy of names.
Continue…
Hierarchy of name servers
Continue…
• Zone: Since the complete domain name hierarchy cannot be stored
on a single server, it is divided among many servers. When a server
is responsible for or has authority over is called a zone. Domains are
broken into zones for which individual DNS servers are responsible.
• We can define a zone as a contiguous part of the entire tree. If a
server accepts responsibility for a domain and does not divide the
domain into smaller domains, the domain and the zone refer to the
same thing.
• The server makes a database called a zone file and keeps all the
information for every node under that domain. However, if a server
divides its domain into subdomains and delegates part of its
authority to other servers, domain and zone refer to different
things.
• The detailed information about the nodes in the subdomains is
stored in the servers at the lower levels, with the original server
keeping some sort of reference to these lower-level servers.
Continue…
Zones and domains
Continue…
• Root Server: A root server is a server whose zone consists of the whole tree. A
root server usually does not store any information about domains but delegates its
authority to other servers, keeping references to those servers.
• Primary and Secondary Servers: DNS defines two types of servers: primary and
secondary. A primary server is a server that stores a file about the zone for which it
is an authority. It is responsible for creating, maintaining, and updating the zone
file. It stores the zone file on a local disk.
• A secondary server is a server that transfers the complete information about a
zone from another server (primary or secondary) and stores the file on its local
disk. The secondary server neither creates nor updates the zone files. If updating is
required, it must be done by the primary server, which sends the updated version
to the secondary.
• The primary and secondary servers are both authoritative for the zones they serve.
The idea is not to put the secondary server at a lower level of authority but to
create redundancy for the data so that if one server fails, the other can continue
serving clients.
• Note also that a server can be a primary server for a specific zone and a secondary
server for another zone. Therefore, when we refer to a server as a primary or
secondary server, we should be careful to which zone we refer.
• A primary server loads all information from the disk file; the secondary server
loads all information from the primary server. When the secondary server
downloads information from the primary server, it is called zone transfer.
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.
Continue…
• Generic Domains: The generic domains define registered hosts according
to their generic behaviour. Each node in the tree defines a domain, which
is an index to the domain name space database.
• The top-level names are called the generic top-level domains and can be
three characters or more in length.
Continue…
• These names are registered with and maintained by the Internet
Corporation for Assigned Names and Numbers (ICANN).
http://www.icann.org
Generic TLDs examples
Continue…
• Country Domains: Top-level domains are named for two character country codes.
These are called the country domains or the geographical domains.
• The country domains section uses two-character country abbreviations (e.g., us for
United States). Second labels can be organizational, or they can be more specific,
national designations. The United States, for example, uses state abbreviations as
a subdivision of us (e.g., ca.us.). The address anza.cup.ca.us can be translated to
De Anza College in Cupertino, California, in the United States.
Continue…
• Inverse Domain: The inverse domain is used to map an address to a name. This
may happen, for example, when a server has received a request from a client to do
a task.
• Although the server has a file that contains a list of authorized clients, only the IP
address of the client (extracted from the received IP packet) is listed.
• The server asks its resolver to send a query to the DNS server to map an address to
a name to determine if the client is on the authorized list.
• This type of query is called an inverse or pointer (PTR) query. To handle a pointer
query, the inverse domain is added to the domain name space with the first-level
node called arpa (Address and Routing Parameter Area).
• The second level is also one single node named in-addr (for inverse address). The
rest of the domain defines IP addresses.
• The servers that handle the inverse domain are also hierarchical. This means that
the net id part of the address should be at a higher level than the subnet id part,
and the subnet id part higher than the host id part. In this way, a server serving the
whole site is at a higher level than the servers serving each subnet.
• This configuration makes the domain look inverted when compared to a generic or
country domain.
Continue…
• To follow the convention of reading the domain labels from the bottom to
the top, an IP address such as 132.34.45.121 (a class B address with net id
132.34) is read as 121.45.34.132.in-addr.arpa.