0% found this document useful (0 votes)
21 views55 pages

5.2 Application Layer

Uploaded by

dhwanisaboo710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views55 pages

5.2 Application Layer

Uploaded by

dhwanisaboo710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

UNIT-V

Presentation layer: Data conversion, Character code translation, Presentation


layer protocol. Application Layer: WWW Architectural Overview, URL-Static and
Dynamic Web, FTP, SSH, Email- Architecture and Services, SMTP, DNS-Name System,
Resource Records, Name Servers, Network Management (SNMP).

Prepared By:
Bhupendra Panchal
Asst. Professor, CSE
Prepared and compiled by
Bhupendra Panchal, Asst. Professor, CSE
DNS: Domain Name System

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS -

DNS in Networking-

• DNS is short for Domain Name Service or Domain Name System.


• It is an application layer protocol.

Purpose-

• DNS is a host name to IP Address translation service.


• It converts the names we type in our web browser address bar to the IP
Address of web servers hosting those sites.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS -

Need-

The need for Domain Name Service arises due to the following reasons-

Point-01:

• IP Addresses are not static and may change dynamically.


• So, a mapping is required which maps the domain names to the IP
Addresses of their web servers.

Point-02:

• IP Addresses are a complex series of numbers.


• So, it is difficult to remember IP Addresses directly while it is easy to
remember names.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Domain name space

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Domain names and labels

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS Resolution-

DNS Resolution- DNS Resolution is a process of resolving a domain name


into an IP Address. The following diagram illustrates the process of DNS
resolution-

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS Resolution-

Step-01:
• A user program sends a name query to a library procedure called the
resolver.

Step-02: Resolver looks up the local domain name cache for a match.
• If a match is found, it sends the corresponding IP Address back.
• If no match is found, it sends a query to the local DNS server.

Step-03: DNS server looks up the name.


• If a match is found, it returns the corresponding IP Address to the
resolver.
• If no match is found, the local DNS server sends a query to a higher level
DNS server.
• This process is continued until a result is returned.

Step-04:
• After receiving a response, the DNS client returns the resolution result to
the application.
Prepared and compiled by
Bhupendra Panchal, Asst. Professor, CSE
Example of using the DNS service

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS Features-

Features-

• DNS uses UDP (port 53) at the transport layer.


• DNS is a connection less protocol.
• DNS is non-persistent.
• DNS is a stateless protocol.
• Mapping an IP Address onto a domain name is referred to as Inverse
domain.
• There is more delay in translating the domain name onto an IP Address.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS IN THE INTERNET

In the Internet, the domain name space (tree) is divided into three different
sections: generic domains, country domains, and the inverse domain.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Generic domains

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Country domains

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Inverse domain

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
DNS MESSAGES

DNS has two types of messages: query and response.. Both types have the same
format. The query message consists of a header and question records; the
response message consists of a header, question records, answer records,
authoritative records, and additional records.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Hyper Text Transfer Protocol

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Hyper Text Transfer Protocol-

• HTTP is short for Hyper Text Transfer Protocol.


• It is an application layer protocol.

Purpose-

• It is mainly used for the retrieval of data from websites throughout the
internet.
• It works on the top of TCP/IP suite of protocols.

Working-

HTTP uses a client-server model where-


• Web browser is the client.
• Client communicates with the web server hosting the website.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Hyper Text Transfer Protocol-

Whenever a client requests some information (say clicks on a hyperlink) to


the website server. The browser sends a request message to the HTTP
server for the requested objects.

Then-
• HTTP opens a connection between the client and server through TCP.
• HTTP sends a request to the server which collects the requested data.
• HTTP sends the response with the objects back to the client.
• HTTP closes the connection.

HTTP Connections-

HTTP connections can be of two types-

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Hyper Text Transfer Protocol-

Non-persistent HTTP connection Persistent HTTP connection

Non-persistent HTTP connection that is used for Persistent HTTP connection is one that can be used
serving exactly one request and one response. for serving multiple requests.

HTTP server closes the TCP connection only when


HTTP server closes the TCP connection
it is not used for a certain configurable amount of
automatically after sending a HTTP response.
time.
A new separate TCP connection is used for each A single TCP connection is used for sending
object. multiple objects one after the other.
HTTP 1.0 supports non-persistent connections by HTTP 1.1 supports persistent connections by
default. default.
Example- Example-

Suppose a request has been made for a HTML Suppose a request has been made for a HTML
page that contains 10 images (called objects). page that contains 10 images (called objects).
Then, Then,
With non-persistent connection, all the 11 objects With persistent connection, all the 11 objects (1
(1 page + 10 images) will be sent one by one. page + 10 images) will be sent one after the other
For getting each object, a new separate connection using a single TCP connection.
will be opened and used. Prepared and compiled by
Bhupendra Panchal, Asst. Professor, CSE
Hyper Text Transfer Protocol- Features

• HTTP uses TCP at the transport layer. This is because-


• Unlike UDP, it guarantees the delivery of data via a Three-way
handshake.
• It ensures the re transmission of lost packets.
• So, if HTTP uses UDP, then it will have to maintain or handle the
session on its own.
• For example- If a packet gets lost, then HTTP will have to re-transmit
the packet.

• Any service which does not use TCP should have the inbuilt facility for
providing reliability.

• HTTP clients uses port 80 to send and receive requested web pages from
a HTTP server. Similarly, HTTP server responds to all the requests at port
80.

• HTTP is a stateless protocol. This is because-


• HTTP server does not maintain any state.
• It forgets about the client afterandsending
Prepared compiled by the response.
Bhupendra Panchal, Asst. Professor, CSE
• It treats every new request independently.
ELECTRONIC MAIL:
SMTP, POP, IMAP

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
ELECTRONIC MAIL

• One of the most popular Internet services is electronic mail (e-


mail).

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
First scenario in electronic mail

When the sender and the receiver of an e-mail are on the same
system, we need only two user agents.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Second scenario in electronic mail

When the sender and the receiver of an e-mail are on different systems,
we need two UAs and a pair of MTAs (client and server).

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Third scenario in electronic mail

When the sender is connected to


the mail server via a LAN or
a WAN, we need two UAs
and two pairs of MTAs
(client and server).

26.26 Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Fourth scenario in electronic mail

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
E-mail address

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Simple Mail Transfer Protocol-

• SMTP is short for Simple Mail Transfer Protocol.


• It is an application layer protocol.
• It is used for sending the emails efficiently and reliably over the internet.

Working-

• SMTP server is always on a listening mode.


• Client initiates a TCP connection with the SMTP server.
• SMTP server listens for a connection and initiates a connection on that
port.
• The connection is established.
• Client informs the SMTP server that it would like to send a mail.
• Assuming the server is OK, client sends the mail to its mail server.
• Client’s mail server use DNS to get the IP Address of receiver’s mail
server.
• Then, SMTP transfers the mail from sender’s mail server to the receiver’s
mail server.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Simple Mail Transfer Protocol-

While sending the mail, SMTP is used two times-

• Between the sender and the sender’s mail server


• Between the sender’s mail server and the receiver’s mail server

To receive or download the email,


• Another protocol is needed between the receiver’s mail server and the
receiver.
• The most commonly used protocols are POP3 and IMAP.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SMTP range

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Characteristics of SMTP-

• SMTP is a pure text based protocol.


• SMTP can only handle the messages containing 7 bit ASCII text.
• SMTP can not transfer other types of data like images, video, audio
etc.
• SMTP can not transfer executable files and binary objects.

• SMTP is a push protocol. We can not use SMTP at the receiver’s side. At
receiver’s side, a pull protocol like POP3, IMAP is needed.

• SMTP uses TCP at the transport layer. SMTP is a connection oriented


protocol.

• SMTP uses port number 25.

• SMTP is not suitable for client authentication. It allows anyone on the


Internet to send emails to anyone or even to a large group of people.

• SMTP is a stateless protocol. This is because-


• It does not maintain thePrepared
state andof compiled
its clients.
by
• If an email is askedBhupendra Panchal, Asst. Professor, CSE
to be sent twice, then SMTP server resends it
Post Office Protocol-

Purpose-
• It is a message access protocol.
• It enables the clients to receive or download the emails from their remote
mail server.
• POP version 3 (POP3) is the most popularly used version.

Working-
• To retrieve a message from the mail server-
• Client establishes a TCP connection using port 110.
• Client identifies itself to the server.
• Client issues a series of POP3 commands

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Characteristics of POP-

• POP is a pull protocol.


• POP uses TCP at the transport layer.
• POP uses port number 110.
• POP uses persistent TCP connections.
• POP is a connection oriented protocol.
• POP is an in-band protocol.
• POP is a stateful protocol until the mail is downloaded as well as stateless
across sessions.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Internet Message Access Protocol-

• IMAP is short for Internet Message Access Protocol.


• It is an application layer protocol.
• It also enables the clients to receive or download the emails from their
remote mail server.
• POP has been largely superseded by Internet Message Access Protocol
(IMAP).

Characteristics of IMAP-

• IMAP is a pull protocol.


• IMAP uses TCP at the transport layer.
• IMAP uses port number 143.
• IMAP uses persistent TCP connections.
• IMAP is a connection oriented protocol.
• IMAP is an in-band protocol.
• IMAP is a stateful protocol.
• IMAP distributes mail boxes across multiple servers.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
POP3 and IMAP4

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
POP Vs IMAP
Post Office Protocol Internet Message Access Protocol
IMAP allows you to check the mail content before
POP allows you to read the mail only after
downloading. So, with IMAP you can choose to
downloading it.
download your messages or just delete them.
The email message is downloaded to the local
The email message is stored on the mail server itself.
computer and the copy at the server is deleted.
The user can not organize mails in the mail box of the
The user can organize mails on the server.
mail server.
Mails can be accessed from multiple devices which is
Mails can only be accessed from a single device.
the biggest advantage.
In POP, the mail server and client’s mail account are
In IMAP, the mail server and the client’s mail account
not synced. So, changes made in the client’s mail
are synced. So, changes made in the client’s mail
account are not visible on the web mail inbox.
account are instantly visible on the web mail inbox.
Example-
Example-
If you are using POP and marks a mail as read, it does
If you are using IMAP and marks a mail as read, it gets
not get marked as read in the web mail inbox because
marked as read in the web mail inbox too because the
the mails are downloaded to the computer and so the
changes are taking place on the server.
changes won’t be visible on the server.
POP is a stateful protocol until the mail is downloaded IMAP is a stateful protocol because the IMAP server
as well as stateless across sessions. has to maintain a folder hierarchy for each of its users.
POP is a better choice for those who hardly checks
Prepared and IMAP
compiledisbya better choice for those who frequently
their mail on any other computer. Bhupendra Panchal, Asst.
check Professor,
theirCSEmails on other computers.
File Transfer Protocol

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
File Transfer Protocol-

Purpose-
• It is used for exchanging files over the internet.
• It enables the users to upload and download the files from the internet.
• Transferring files from one computer to another is one of the most
common tasks expected from a networking or internetworking
environment. As a matter of fact, the greatest volume of data exchange in
the Internet today is due to file transfer..

Working-

FTP establishes two TCP connections between the client and the server.
• One connection is used for transferring data.
• Other connection is used for transferring control information.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Note

FTP uses the services of TCP. It needs


two TCP connections.

The well-known port 21 is used for the


control connection and the well-known
port 20 for the data connection.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
FTP

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Characteristics of FTP-

• FTP uses TCP at the transport layer. Thus, FTP is a connection oriented
protocol.
• FTP uses port number 21 for control connection and 20 for data
connection
• FTP uses persistent TCP connections for control connection and non-
persistent connections for data connection.
• Emails can’t be sent using FTP. This is because-
• FTP requires the connection establishment between the client and
server before transferring the files. So, both have to be online at the
same time.
• FTP can transfer one file at a time.
• FTP is a stateful protocol.
Prepared and compiled by
Bhupendra Panchal, Asst. Professor, CSE
Remote Logging: Telnet

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
REMOTE LOGGING

TELNET is a general-purpose client/server application program.

Local and remote log-in

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Concept of NVT

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Network Management:
SNMP

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SNMP concept

SNMP defines a manager, usually a host, that controls and monitors a set
of agents, usually routers.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SNMP MANAGEMENT COMPONENTS

SNMP requires the use of two other protocols:


• Structure of Management Information (SMI) and
• Management Information Base (MIB).

Network management on the Internet is done through the cooperation of SNMP,


SMI, and MIB.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Management overview

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
MIB

MIB creates a collection of named objects, their types, and


their relationships to each other in an entity to be managed.

MIB is a component used in network management. Each agent has its own MIB, a
collection of all the objects that the manager can manage.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SMI

SMI is a component used in network management. It names objects,


defines the type of data that can be stored in an object, and shows how
data can be encoded for transmission over the network

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
Object identifier

All objects managed by SNMP are


given an object identifier.

The object identifier always starts


with 1.3.6.1.2.1.

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SNMP

SNMP defines the format of packets exchanged between a


manager and an agent. It reads and changes the status
(values) of objects (variables) in SNMP packets.

SNMP is an application program that allows-


1) a manager to retrieve the value of an object defined in an agent;
2) a manager to store a value in an object defined in an agent; and
3) an agent to send an alarm message about an abnormal situation to the manager

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SNMP PDU

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE
SNMP message

• A message in SNMP is made


of four elements: version,
header, security parameters,
and data (which includes the
encoded PDU).

• SNMP uses the services of


UDP on two well-known
ports, 161 and 162. The
well-known port 161 is used
by the server (agent), and
the well-known port 162 is
used by the client
(manager).

Prepared and compiled by


Bhupendra Panchal, Asst. Professor, CSE

You might also like