Application Layer
Application Layer
• The application layer provides services to the user.
• Communication is provided using a logical connection, which means
  that the two application layers assume that there is an imaginary direct
  connection through which they can send and receive messages.
• The application layer in the OSI model is the closest layer to the end user
  which means that the application layer and end user can interact
  directly with the software application. The application layer programs
  are based on client and servers.
Services of Application Layers
• Network Virtual terminal: An application layer allows a user to log on to a
  remote host.
• File Transfer, Access, and Management (FTAM): An application allows a user
  to access files in a remote computer, to retrieve files from a computer and to
  manage files in a remote computer.
• Addressing: To obtain communication between client and server, there is a
  need for addressing. DNS is used.
• Mail Services: An application layer provides Email forwarding and storage.
• Directory Services: An application contains a distributed database that
  provides access for global information about various objects and services.
• Authentication: It authenticates the sender or receiver's message or both.
 Domain Name System(DNS)
• It is a directory service that provides a mapping between the name of a host
  on the network and its numerical address.
• DNS is required for the functioning of the internet.
• Each node in a tree has a domain name, and a full domain name is a sequence
  of symbols specified by dots.
• DNS is a service that translates the domain name into IP addresses. This
  allows the users of networks to utilize user-friendly names when looking for
  other hosts instead of remembering the IP addresses.
• For example, suppose the FTP site at EduSoft had an IP address of
  132.147.165.50, most people would reach this site by specifying
  ftp.EduSoft.com. Therefore, the domain name is more reliable than IP
  address.
Example of using the DNS service
                    the binding between the names and IP addresses.
Name Space
• A name space that maps each address to a unique name
• A name in this space is a sequence of characters without structure
• It can be organized in two ways: flat name space or hierarchical name space .
• Flat : a name is assigned to an address. A name in this space is a Sequence of
  characters without structure.
• hierarchical name space : each name is made of several parts.
1. The first part can define the nature of the organization
2. the second part can define the name of an organization
3. the third part can define departments in the organization
Domain Name Space
• DNS is broken up into domains, a logical organization of computers
  that exist in a larger network.
• 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.
• The domain name space is divided into three different sections:
  generic domains, country domains, and inverse domain.
Domain name space
  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).
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).
• If a label is terminated by a null string, it is called a fully qualified domain name
  (FQDN). The name must end with a null label, but because null means nothing, the
  label ends with a dot.
• 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.
 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 store such a
huge amount of information.
    Topics discussed in this section:
         Hierarchy of Name Servers
         Zone
         Root Server
         Primary and Secondary Servers
Figure 25.6 Hierarchy of name servers
hierarchical name space
• In hierarchical name space, each name consists of several parts.
• First part defines the nature of the organization, second part defines
  the name of an organization, third part defines department of the
  organization, and so on.
• In hierarchical name space, the authority to assign and control the
  name spaces can be decentralized.
• Authority for names in each partition is passed to each designated
  agent.
Zone
 • the complete domain name hierarchy cannot be stored on a single
   server, it is divided among many servers. What a server is responsible
   for or has authority over is called a zone.
Root Server
• A root server usually does not store any information about domains
  but delegates its authority to other servers, keeping references to
  those servers.
• There are several root servers, each covering the whole domain name
  space. The root servers are distributed all around the world.
   DNS defines two types of servers
1. primary server and
2. Secondary server.
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.
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.
      Generic Domains
      Country Domains
      Inverse Domain
Generic Domains
 • It defines the registered hosts according to their generic behavior.
 • Each node in a tree defines the domain name, which is an index to the
   DNS database.
 • It uses three-character labels, and these labels describe the organization
   type.       Label Description
             aero     Airlines and aerospace companies
             biz      Businesses or firms
             com      Commercial Organizations
             coop     Cooperative business Organizations
             edu      Educational institutions
             gov      Government institutions
             info     Information service providers
             int      International Organizations
             mil      Military groups
             museum   Museum & other nonprofit organizations
             name     Personal names
             net      Network Support centers
             org      Nonprofit Organizations
             pro      Professional individual Organizations
Country Domain
• The format of country domain is same as a generic domain, but it uses two-
  character country abbreviations (e.g., us for the United States) in place of
  three character organizational abbreviations.
 Inverse Domain
• The inverse domain is used for mapping an address to a name. When the
  server has received a request from the client, and the server contains the files
  of only authorized clients.
• To determine whether the client is on the authorized list or not, it sends a
  query to the DNS server and ask for mapping an address to the name.
RESOLUTION
Mapping a name to an address or an address to a name is called
name-address resolution.
    Resolver
    Mapping Names to Addresses
    Mapping Addresses to Names
    Recursive Resolution
    Caching
Resolution
• A host that needs to map an address to a name or a name to an address calls a
  DNS client called a resolver
• Recursive Resolution
Recursive resolution
Iterative Resolution
   • In iterative resolution, each server that does not know the mapping
     sends the IP address of the next server back to the one that
     requested it.
Iterative resolution
    Caching
• Each time a server receives a query for a name that is not in its domain, it
  needs to search its database for a server IP address.
• Reduction of this search time would increase efficiency. DNS handles this with
  a mechanism called caching.
• First, the authoritative server always adds information to the mapping called
  time to live (TTL). It defines the time in seconds that the receiving server can
  cache the information.
• Second, DNS requires that each server keep a TTL counter for each mapping it
  caches.
   Resource Records
• The zone information associated with a server is implemented as a set of
  resource records.
• In other words, a name server stores a database of resource records.
• A resource record is a 5-tuple structure
            (Domain Name, Type, Class, TTL, Value)
• The domain name field is what identifies the resource record.
• The value defines the information kept about the domain name.
• The TTL defines the number of Iterative resolution seconds for which the
  information is valid.