NUTAN MAHARASHTRA VIDYA PRASARAK MANDAL’S
NUTAN COLLEGE OF ENGINEERING & RESEARCH (NCER)
Department of Computer Science and Engineering
Application Layer Protocols: DNS, SMTP, POP, FTP, HTTP.
UNIT – 5
APPLICATION LAYER
Application Layer
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.
The Application layer includes the following functions:
Identifying communication partners: The application layer identifies the availability of
communication partners for an application with data to transmit.
Determining resource availability: The application layer determines whether sufficient network
resources are available for the requested communication.
Synchronizing communication: All the communications occur between the applications requires
cooperation which is managed by an application layer.
OR
Services of Application Layers
Network Virtual terminal: An application layer allows a user to log on to a remote host. To do so,
the application creates a software emulation of a terminal at the remote host. The user's computer
talks to the software terminal, which in turn, talks to the host. The remote host thinks that it is
communicating with one of its own terminals, so it allows the user to log on.
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.
FTAM defines a hierarchical virtual file in terms of file structure, file attributes and the kind of
operations performed on the files and their attributes.
Addressing: To obtain communication between client and server, there is a need for addressing.
When a client made a request to the server, the request contains the server address and its own
address. The server response to the client request, the request contains the destination address, i.e.,
client address. To achieve this kind of addressing, DNS is used.
Application Layer Protocols:-
1. DNS
An application layer protocol defines how the application processes running on different systems,
pass the messages to each other.
o DNS stands for Domain Name System.
o DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of symbols
specified by dots.
o 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.
o For example, suppose the FTP site at EduSoft had an IP address of [Link], most
people would reach this site by specifying [Link]. Therefore, the domain name
is more reliable than IP address.
DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.
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.
Working of DNS
o DNS is a client/server network communication protocol. DNS clients send requests to the.
server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known as a forward
DNS lookups while requests containing an IP address which is converted into a name
known as reverse DNS lookups.
2. FTP
o FTP stands for File transfer protocol.
o FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from
one host to another.
o It is mainly used for transferring the web page files from their creator to the computer that
acts as a server for other computers on the internet.
o It is also used for downloading the files to computer from other servers.
Objectives of FTP
o It provides the sharing of files.
o It is used to encourage the use of remote computers.
o It transfers the data more reliably and efficiently.
Working of FTP
The above figure shows the basic model of the FTP. The FTP client has three components: the
user interface, control process, and data transfer process. The server has two components: the
server control process and the server data transfer process.
There are two types of connections in FTP:
o Control Connection: The control connection uses very simple rules for communication.
Through control connection, we can transfer a line of command or line of response at a
time. The control connection is made between the control processes. The control
connection remains connected during the entire interactive FTP session.
o Data Connection: The Data Connection uses very complex rules as data types may vary.
The data connection is made between data transfer processes. The data connection opens
when a command comes for transferring the files and closes when the file is transferred.
3. Telnet:-
o The main task of the internet is to provide services to users. For example, users want to
run different application programs at the remote site and transfers a result to the local site.
This requires a client-server program such as FTP, SMTP. But this would not allow us to
create a specific program for each demand.
o The better solution is to provide a general client-server program that lets the user access
any application program on a remote computer. Therefore, a program that allows a user to
log on to a remote computer. A popular client-server program Telnet is used to meet such
demands. Telnet is an abbreviation for Terminal Network.
o Telnet provides a connection to the remote computer in such a way that a local terminal
appears to be at the remote side.
There are two types of login: [Link] Login 2. Remote login
o When a user logs into a local computer, then it is known as local login.
o When the workstation running terminal emulator, the keystrokes entered by the
user are accepted by the terminal driver. The terminal driver then passes these
characters to the operating system which in turn, invokes the desired application
program.
o However, the operating system has special meaning to special characters. For
example, in UNIX some combination of characters have special meanings such as
control character with "z" means suspend. Such situations do not create any
problem as the terminal driver knows the meaning of such characters. But, it can
cause the problems in remote login.
[Link] login
o When the user wants to access an application program on a remote computer, then the
user must perform remote login.
Network Virtual Terminal (NVT)
The network virtual terminal is an interface that defines how data and commands
are sent across the network.
o In today's world, systems are heterogeneous. For example, the operating
system accepts a special combination of characters such as end-of-file token
running a DOS operating system ctrl+z while the token running a UNIX
operating system is ctrl+d.
o TELNET solves this issue by defining a universal interface known as network
virtual interface.
o The TELNET client translates the characters that come from the local terminal
into NVT form and then delivers them to the network. The Telnet server then
translates the data from NVT form into a form which can be understandable
by a remote computer.
SMTP:-
o SMTP stands for Simple Mail Transfer Protocol.
o SMTP is a set of communication guidelines that allow software to transmit an
electronic mail over the internet is called Simple Mail Transfer Protocol.
o It is a program used for sending messages to other computer users based on e-mail
addresses.
o It provides a mail exchange between users on the same or different computers, and it
also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the internet.
o The main purpose of SMTP is used to set up communication rules between servers.
The servers have a way of identifying themselves and announcing what kind of
communication they are trying to perform. They also have a way of handling the
errors such as incorrect email address.
For example, if the recipient address is wrong, then receiving server reply with an error
message of some kind.
Components of SMTP
o First, we will break the SMTP client and SMTP server into two components such as
user agent (UA) and mail transfer agent (MTA). The user agent (UA) prepares the
message, creates the envelope and then puts the message in the envelope. The mail
transfer agent (MTA) transfers this mail across the internet.
o SMTP allows a more complex system by adding a relaying system. Instead of just
having one MTA at sending side and one at receiving side, more MTAs can be added,
acting either as a client or server to relay the email.
MIME
Multipurpose Internet Mail extensions
SNMP:-
o SNMP stands for Simple Network Management Protocol.
o SNMP is a framework used for managing devices on the internet.
o It provides a set of operations for monitoring and managing the internet.
SNMP Concept
o SNMP has two components Manager and agent.
o The manager is a host that controls and monitors a set of agents such as routers.
o It is an application layer protocol in which a few manager stations can handle a set of
agents.
o The protocol designed at the application level can monitor the devices made by
different manufacturers and installed on different physical networks.
o It is used in a heterogeneous network made of different LANs and WANs connected
by routers or gateways.
Managers & Agents
o A manager is a host that runs the SNMP client program while the agent is a router
that runs the SNMP server program.
o Management of the internet is achieved through simple interaction between a manager
and agent.
o The agent is used to keep the information in a database while the manager is used to
access the values in the database. For example, a router can store the appropriate
variables such as a number of packets received and forwarded while the manager can
compare these variables to determine whether the router is congested or not.
o Agents can also contribute to the management process. A server program on the agent
checks the environment, if something goes wrong, the agent sends a warning message
to the manager.
SNMP:-
o SNMP defines five types of messages: GetRequest, GetNextRequest, SetRequest,
GetResponse, and Trap.
GetRequest: The GetRequest message is sent from a manager (client) to the agent (server) to
retrieve the value of a variable.
GetNextRequest: The GetNextRequest message is sent from the manager to agent to retrieve
the value of a variable. This type of message is used to retrieve the values of the entries in a
table. If the manager does not know the indexes of the entries, then it will not be able to
retrieve the values. In such situations, GetNextRequest message is used to define an object.
GetResponse: The GetResponse message is sent from an agent to the manager in response to
the GetRequest and GetNextRequest message. This message contains the value of a variable
requested by the manager.
SetRequest: The SetRequest message is sent from a manager to the agent to set a value in a
variable.
Trap: The Trap message is sent from an agent to the manager to report an event. For
example, if the agent is rebooted, then it informs the manager as well as sends the time of
rebooting.
HTTP(HyperText Transfer Protocol.)
o HTTP stands for HyperText Transfer Protocol.
o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that
allows us to use in a hypertext environment where there are rapid jumps from one
document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another host.
But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control
connection to transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to the
server and from server to the client. SMTP messages are stored and forwarded while
HTTP messages are delivered immediately.
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a
request and waits for a response from the server. When the server receives the request,
the server processes the request and sends back the response to the HTTP client after
which the client disconnects the connection. The connection between client and server
exist only during the current request and response time only.
o Media independent: HTTP protocol is a media independent as data can be sent as
long as both the client and server
o know how to handle the data content. It is required for both the client and server to
specify the content type in MIME-type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each other
only during the current request. Due to this nature of the protocol, both the client and
server do not retain the information between various requests of the web pages.
HTTP Transactions
The above figure shows the HTTP transaction between client and server. The client initiates a
transaction by sending a request message to the server. The server replies to the request
message by sending a response message.
HTTP messages are of two types: request and response. Both the message types follow the
same message format.
Request Message: The request message is sent by the client that consists of a request line,
headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that consists of
a status line, headers, and sometimes a body.
Uniform Resource Locator (URL):-
o A client that wants to access the document in an internet needs an address and to
facilitate the access of documents, the HTTP uses the concept of Uniform Resource
Locator (URL).
o The Uniform Resource Locator (URL) is a standard way of specifying any kind of
information on the internet.
o The URL defines four parts: method, host computer, port, and path.
o Method: The method is the protocol used to retrieve the document from a server. For
example, HTTP.
o Host: The host is the computer where the information is stored, and the computer is
given an alias name. Web pages are mainly stored in the computers and the computers
are given an alias name that begins with the characters "www". This field is not
mandatory.
o Port: The URL can also contain the port number of the server, but it's an optional field.
If the port number is included, then it must come between the host and path and it
should be separated from the host by a colon.
o Path: Path is the pathname of the file where the information is stored. The path itself
contain slashes that separate the directories from the subdirectories and files.
IMAP and POP3
IMAP and POP3 are the most widely used standard protocol for email retrieval. Both these
protocols are supported by almost all current email clients and servers.
What is POP3?
POP3 (or Post Office Protocol Version 3) is an application layer protocol used by email clients
to retrieve email messages from mail servers over TCP/IP network. POP was designed to move
the messages from server to local disk but version 3 has the option of leaving a copy on the
server
POP3 is a very simple protocol to implement but that limits its usage. For example, POP3
supports only one mail server for each mailbox. It has now has been made obsolete by modern
protocols like IMAP.
What is IMAP?
The Internet Message Access Protocol (IMAP) is an Internet standard protocol for retrieving
email messages from a mail server via a TCP/IP connection by email clients. RFC 3501 is the
standard that defines IMAP.
Because IMAP was created with the purpose of allowing many email clients to handle an email
box simultaneously, clients typically leave messages on the server until the user explicitly deletes
them. The port number 143 is usually used by an IMAP server. The port number 993 is given to
IMAP via SSL/TLS.
IMAP is designed to retrieve messages from multiple mail servers and consolidate them all in the
user’s mailbox. A typical example is a corporate client handling multiple corporate accounts
through a local mailbox located on her system.
IMAP version 4 is using
All modern email clients and servers like Gmail, Outlook and Yahoo Mail support IMAP or
POP3 protocol. Following are some of the advantages that IMAP offers over POP3 −
Faster response time than POP3
Multiple mail clients connected to a single mailbox simultaneously
Keep track of message state like read, deleted, starred, replied, etc.
Search for messages on the server
POP3 Vs IMAP
Read through this section to understand the way POP3 and IMPAP function so that you can
easily differentiate these two protocols.
Modes of Connection and Disconnection
In POP, clients connect to the e-mail server briefly, only for as long as it takes to download fresh
messages. On the other hand, clients who utilize IMAP4 frequently keep connected as long as
the user interface is open and download message content as needed. This IMAP4 use pattern
might result in quicker response times for users with a large number of messages.
Several Clients at the Same Time
The POP protocol requires that a client who is connected to the mailbox is the only client
connected at that time. The IMAP protocol, on the other hand, allows many clients to access the
mailbox at the same time and includes methods for clients to detect changes made to the mailbox
by other, concurrently connected clients.
Partial Fetch and Access to MIME Message Components
Typically, all Internet e-mail is sent in MIME format, which allows messages to have a tree
structure with leaf nodes representing single part content types and non-leaf nodes representing
multipart content types. Clients can obtain any of the various MIME pieces independently, as
well as sections of individual parts or the full message, using the IMAP4 protocol.
These techniques enable clients to obtain the text component of a message without retrieving any
associated files, as well as to stream content while it is being retrieved.
Information about the Current Status of the Message
Clients can maintain a track of message state using flags specified in the IMAP4 protocol, such
as whether the message has been read, replied to, or deleted. These flags are kept on the server,
allowing many clients to use the same mailbox at various times to identify state changes made by
other clients.
POP does not provide a method for clients to save such state information on the server. State
information such as whether a message has been accessed cannot be synchronized across clients
if a single user visits a mailbox with two separate POP clients (at different times).
Both pre-set system flags and client-defined keywords are supported by the IMAP4 protocol.
System flags give information about the current condition of the system, such as whether a
message has been read. Keywords allow messages to be tagged with one or more tags, the
meaning of which is defined by the client. Keywords aren't supported by all IMAP servers.
Multiple Mailbox
When using IMAP4, clients may create mailboxes on the server (which are frequently displayed
to the user as folders), change them, remove them, and copy messages between them. Servers
may now give access to shared and public files, thanks to the capability for numerous mailboxes
on the server. In order to control access privileges, IMAP4's Access Control List (ACL)
Extension can be utilized (RFC 4314).
Searches on the server
IMAP4 allows a client to request that the server looks for messages that satisfy a set of criteria.
This technique prevents clients from having to download every message in their inbox in order to
do these searches.
Built-in Extension Mechanism
IMAP4 offers an explicit method for extension, emulating the experience of earlier Internet
protocols. Many IMAP4 protocol modifications have been developed and are in widespread
usage. IMAP2bis lacked an extension mechanism, although RFC 2449 now defines one for POP.
IMAP is Complex
In spite of the fact that IMAP fixes many of the problems with POP, it brings a new level of
complexity. When several clients access the same mailbox at the same time, server-side solutions
such as Mail directory or database backends compensate for most of this complexity.
Critics have criticized the IMAP specification for not being rigorous enough, and for enabling
behaviors that essentially invalidate its utility. When a server stores a message, it assigns each
message an "id" that allows clients to recognize messages they've seen before
Difference between POP3 and IMAP
The following table highlights the key differences between POP3 and IMAP.
Key POP3 IMAP
Full Form POP3 stands for Post Office Protocol 3 IMAP stands for Internet Message
Access Protocol.
Complexity POP3 is simple and only mails can be IMAP is complex and allows to see
downloaded from your inbox to local all the folders on the mail server.
computer.
Ports POP3 listens on 110 and POP with SSL, IMAP listens on 143 and IMAP
POP3DS listens on 995 port. with SSL, IMAPDS listens on 993
port
Multiaccess POP3 supports single device to access the IMAP supports multiple devices
mail at a time. which can access the mail at a
time.
Download In POP3, mail to be downloaded first then In IMAP, mail can be partially read
can be read. before complete download.
Mail Mails cannot be organized on mail server IMAP allows to organize mails on
Organize using POP3. mail server.
Update Mails cannot be created/updated/deleted IMAP allows to
Email on mail server using POP3. create/update/delete mails on mail
server.
Search Mail content cannot be searched on mail Mail content can be searched on
Content server using POP3. To search, mail to be mail server using IMAP.
downloaded first.
Download All message are downloaded at once. Mail message header can be
previewed before a message is to
be downloaded.
Change Using local email software, a mail can be A mail can be updated via a web
updated. interface or email software.
Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol (DHCP) is a network management protocol
used to dynamically assign an IP address to nay device, or node, on a network so
they can communicate using IP (Internet Protocol). DHCP automates and centrally
manages these configurations. There is no need to manually assign IP addresses to
new devices. Therefore, there is no requirement for any user configuration to
connect to a DHCP based network.
DHCP can be implemented on local networks as well as large enterprise networks.
DHCP is the default protocol used by the most routers and networking equipment.
DHCP is also called RFC (Request for comments) 2131.
DHCP does the following:
o DHCP manages the provision of all the nodes or devices added or dropped
from the network.
o DHCP maintains the unique IP address of the host using a DHCP server.
o It sends a request to the DHCP server whenever a client/node/device, which
is configured to work with DHCP, connects to a network. The server
acknowledges by providing an IP address to the client/node/device.
DHCP is also used to configure the proper subnet mask, default gateway and DNS
server information on the node or device.
There are many versions of DCHP are available for use in IPV4 (Internet Protocol
Version 4) and IPV6 (Internet Protocol Version 6).
How DHCP works
DHCP runs at the application layer of the TCP/IP protocol stack to dynamically
assign IP addresses to DHCP clients/nodes and to allocate TCP/IP configuration
information to the DHCP clients. Information includes subnet mask information,
default gateway, IP addresses and domain name system addresses.
DHCP is based on client-server protocol in which servers manage a pool of unique
IP addresses, as well as information about client configuration parameters, and
assign addresses out of those address pools.
The DHCP lease process works as follows:
o First of all, a client (network device) must be connected to the internet.
o DHCP clients request an IP address. Typically, client broadcasts a query for
this information.
o DHCP server responds to the client request by providing IP server address
and other configuration information. This configuration information also
includes time period, called a lease, for which the allocation is valid.
o When refreshing an assignment, a DHCP clients request the same
parameters, but the DHCP server may assign a new IP address. This is based
on the policies set by the administrator.
Components of DHCP
When working with DHCP, it is important to understand all of the components.
Following are the list of components:
o DHCP Server: DHCP server is a networked device running the DCHP
service that holds IP addresses and related configuration information. This is
typically a server or a router but could be anything that acts as a host, such
as an SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives configuration
information from a DHCP server. This can be any device like computer,
laptop, IoT endpoint or anything else that requires connectivity to the
network. Most of the devices are configured to receive DHCP information
by default.
o IP address pool: IP address pool is the range of addresses that are available
to DHCP clients. IP addresses are typically handed out sequentially from
lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP networks. Subnet is
used to keep networks manageable.
o Lease: Lease is the length of time for which a DHCP client holds the IP
address information. When a lease expires, the client has to renew it.
o DHCP relay: A host or router that listens for client messages being
broadcast on that network and then forwards them to a configured server.
The server then sends responses back to the relay agent that passes them
along to the client. DHCP relay can be used to centralize DHCP servers
instead of having a server on each subnet.
Benefits of DHCP
There are following benefits of DHCP:
Centralized administration of IP configuration: DHCP IP configuration
information can be stored in a single location and enables that administrator to
centrally manage all IP address configuration information.
Dynamic host configuration: DHCP automates the host configuration process and
eliminates the need to manually configure individual host. When TCP/IP
(Transmission control protocol/Internet protocol) is first deployed or when IP
infrastructure changes are required.
Seamless IP host configuration: The use of DHCP ensures that DHCP clients get
accurate and timely IP configuration IP configuration parameter such as IP
address, subnet mask, default gateway, IP address of DND server and so on
without user intervention.
Flexibility and scalability: Using DHCP gives the administrator increased
flexibility, allowing the administrator to move easily change IP configuration when
the infrastructure changes.