0% found this document useful (0 votes)
6 views

Application Layer

.

Uploaded by

Milan Soni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Application Layer

.

Uploaded by

Milan Soni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Application Layer

The application layer is the topmost layer of the OSI model and the TCP/IP model. In TCP/IP
model, the application layer is formed by combining the top three layers, i.e., the application
layer, the presentation layer, and the session layer. An application layer is an abstraction layer
that specifies the shared communications protocols and interface methods used by hosts in a
communications network. It is the layer closest to the end-user, implying that the application
layer and the end-user can interact directly with the software application.
It does not provide service to other layers because it is the topmost layer. The
Application layer uses Transport and any levels below it to communicate with or transfer data
to a remote host.
Consumers frequently require protocols from the Application Layer. One of the most often
used application protocols is HTTP (Hypertext Transfer Protocol), the foundation for the World
Wide Web. Domain Name System (DNS), Simple Mail Transfer Protocol (SMTP), File
Transfer Protocol (FTP), Trivial File Transfer Protocol (TFTP), and TELNET are some of the
protocols used in the application layer.
Functions of the Application Layer
The application layer provides the following functions.
1. The Application Layer provides protocols that allow the software to communicate and
receive data and finally present it to users in a meaningful way.
2. This layer allows users to log on as a remote host.
3. The Application Layer provides various facilities for users to forward multiple emails
and a storage facility.
4. This layer acts as a window via which users and application processes can access
network resources.
5. This layer provides services such as email, file transfer, results distribution, directory
services, network resources, etc.
6. The application layer communicates with the operating system and guarantees that data
is properly saved.
7. This layer allows users to interact with other software applications.
8. This application layer generally performs host initialization followed by remote login
to hosts.
9. This layer visualizes data, allowing individuals to grasp it rather than memorize it or
see it in binary format (1s or 0s).
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.

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.

DNS Resolution-

DNS Resolution is a process of resolving a domain name onto an IP Address.

DNS contains various servers that coverts the alphabetic domains to its numeric IP. The
resolution process of the DNS can either be iterative or recursive.
1. Recursive DNS Service
In this type, if the DNS resolver only communicates to the root servers and the remaining
servers were communicated recursively by the root server. The root server sends the output
(IP in this case) to the DNS resolver.
2. Iterative DNS Service
In this type, the DNS resolver can directly communicate and receive input from the
servers at different levels.

Hypertext Transfer Protocol (HTTP)


What is HTTP Protocol?
Have you thought about what happens when we enter a URL (Uniform Resource Locator) in
the browser to visit a website? The browser fetches the IP address corresponding to the entered
URL using DNS (Domain Name System). Once the browser gets the IP address
corresponding to the entered URL, the browser sends a request to the server at the backend
(along with the IP address of the website) to fetch the webpage of the website. In return, the
browser receives a response from the server and this response contains the HTML (Hypertext
Markup Language) information of the webpage.
These requests and responses that are sent follow a protocol which is
called HTTP (Hypertext Transfer Protocol) . Nowadays, everything that we do in our day-
to-day life is directly or indirectly related to the internet and the web. For example today, you
were in a mood to read about the Hypertext Transfer Protocol (HTTP),
These requests and responses that are sent by the browser and the web server follows a
protocol called HTTP.
Hence, HTTP is a protocol which is used to transfer hypertext data (example HTML data),
plain text data, audio data, video data etc. over the internet.
HTTP relies on the TCP (Transmission Control Protocol) and it works on the PORT
number 80. Hence, a connection is first established (TCP connection) and then the data is
transferred over this connection.
How Does Hypertext Transfer Protocol Work?
Below is the step by steps discussion of how the Hypertext transfer protocol works.
1. Extracting the IP address of a URL (Uniform Resource Locator)
In our browser, we enter the URL address of the website we want to visit. Once we enter
the URL address of the website, the browser with the help of the DNS extracts the IP address
corresponding to the URL address that is entered.
The DNS contains the mapping of the URLs along with their corresponding IP addresses.
2. Sending request to the server to access webpage and receiving response
Once we get the IP address of the website, the browser sends an HTTP request to the server
to extract the HTML webpage corresponding to the IP address. This request is sent over
PORT 80 using TCP. Once the server receives this HTTP request, it responds back with
an HTTP response. This HTTP response consists of the information related to the HTML
page corresponding to the IP address of the website.
3. Receiving HTTP response and displaying the webpage
The browser receives the HTML information for the website along with the response and
hence, it processes and displays the HTML page on the browser. Finally, the users can see a
HTML page for the URL that they entered.
What is in an HTTP Request?
In order to fetch the webpage corresponding to a given IP address, the browser sends a
request (called as HTTP request) to the web server.
An HTTP request consists of 3 parts i.e. a request line, request headers, and request body.
Given below is the structure of an HTTP request.

Request Line
An HTTP request-line consists of 3 parts which are discussed below.
1. Request Method A request method defines what type of request is needed to send to
the web server. For example if we want to fetch something from the web server, we
use a GET request method. If we want to send something from the client to the web
server, we use POST request method.
2. Request URI It it the the URI of the website / destination we want to reach.
3. HTTP Version It states the version of the HTTP we are using. For example HTTP
1.0, HTTP 1.1.
Request Headers
Request headers contain additional information about the resource/data that is to be fetched
from the web server.
For example, if we want the data in the plaintext format, we can specify that information in
the HTTP headers.
We can also specify the information related to the client using headers like the browser it is
using etc.
We can send more than one HTTP headers along with an HTTP request to specify the
additional information which is to be sent along with an HTTP request.
Request Body
It is an optional part of an HTTP request. If there is a requirement of sending some data along
with an HTTP request, we send that data along with the HTTP Body. For example: If we
want to send the details of a user which is taken through a form at the client side to the web
server, we can send this data in the HTTP body.
An HTTP response consists of 3 parts:
1. Response Status Line
2. Response Headers
3. Response Body
Response Status Line
An HTTP request-line consists of 3 parts which are discussed below.
1. HTTP Version It states the version of the HTTP we are using. For example HTTP
1.0, HTTP 1.1.
2. Status Code It is a three-digit code that tells the status of the HTTP response. For
example code 200 stands for a successful HTTP response.
3. Status Phrase It is a short description of the status code.
Response Headers
The response headers are used to specify the additional information related to the response
data and the server.
Response Body
It is an optional part of the HTTP response. The data which is requested by the client using
the HTTP request is sent from server to client by keeping it inside the response body.
What is an HTTP Status Code?
An HTTP status code is a three-digit code that specifies the status of the HTTP response.
Some of the commonly seen HTTP status codes along with their description are given below.

Status Code Phrase Description

200 OK A successful request.

404 Page not found The requested document is not present.

500 Internal server error An error such as a server crash has occurred.

400 Bad request There is some syntax error in the code.

What are HTTP Response Headers?


As discussed in the above section as well, HTTP response headers are used to specify the
information related to the data that is to be sent to the client through the HTTP response.
We can also specify the information related to the server like server's local clock time, server
name etc. using the response headers.
Features of HTTP
1. HTTP is a stateless protocol HTTP does not store the state/information of the client
as well as the server and hence, is a stateless protocol. But with the help of cookies,
we can make HTTP protocol as a stateful protocol.
2. Connection Oriented Protocol Since HTTP relies on the TCP (Transmission Control
Protocol), it is a connection-oriented protocol. Hence, the connection
is established and the data is sent over the connection only after the establishment of
the connection.
3. Compatible with multiple file-formats HTTP can be used to transfer data in various
file formats such as HTML, plaintext file, audio file, video file
4. HTTP vs. HTTPS

Hypertext Transfer Protocol (HTTP) Hypertext Transfer Protocol Secure (HTTPS)


1. HTTP is a protocol used to transfer 1. HTTPS is also used to transfer data over the internet
data over the internet. but it is more secure than HTTP.
2. It does not use a cryptographic 2. It uses cryptographic algorithms like SSL (Secure
algorithms to encrypt the transmitted Socket Layer) and TLS (Transport Layer Security) which
data. makes it more secure than HTTP
3. The connection of HTTP takes place
3. The connection of HTTP takes place on PORT 443.
on PORT 80.
4. HTTP is faster than HTTPS since it
4. HTTPS is slower than HTTP since it includes
does not include any additional steps for
additional steps for the cryptographic algorithms
the cryptographic algorithms.
Simple Mail Transfer Protocol-
1. SMTP is short for Simple Mail Transfer Protocol.
2. It is an application layer protocol.
3. 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.
While sending the mail, SMTP is used two times-
1. Between the sender and the sender’s mail server
2. 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.

Characteristics of SMTP-

 SMTP is a push protocol.


 SMTP uses TCP at the transport layer.
 SMTP uses port number 25.
 SMTP uses persistent TCP connections, so it can send multiple emails at once.
 SMTP is a connection oriented protocol.
 SMTP is an in-band protocol.
 SMTP is a stateless protocol.
MIME extends the limited capabilities of email.

As the name suggests,


 Multipurpose Internet Email Extension (MIME) is an extension to the internet email
protocol.
 It extends the limited capabilities of email by enabling the users to send and receive
graphics, audio files, video files etc in the message.
 MIME was specially designed for SMTP.

Post Office Protocol-

 POP is short for Post Office Protocol.


 It is an application layer 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.
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.

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.

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.
File Transfer Protocol (FTP)- FTP is an acronym for File Transfer Protocol. It is a
protocol used to transfer a file from one location to another, i.e., from one host to another.
It is a standard mechanism that TCP/IP provides. Transferring files from one system to
another appears to be very simple.

 FTP, a networking protocol that connects client and server, allows users to download
web pages, data, and programs from other services. FTP is used when a user wants to
download information to their own computer.
 The end user's machine is commonly referred to as the local host in an FTP transaction.
The second computer involved in FTP is a remote host, which is usually a server.
 Individuals and businesses can share electronic files with others via the file transfer
protocol without needing to be in the same space. This can be accomplished via an FTP
client or the cloud.
 FTP clients come with most online browsers, allowing users to transfer files from their
computer to a server and vice versa. Some users may prefer to utilize a third-party FTP
client because many of them often come with additional features. Some FTP clients that
are available for free to download are FileZilla Client, FTP Voyager, WinSCP,
CoffeeCup Free FTP, and Core FTP.
 Many people have utilized FTP without even knowing it. You've used FTP if you've
ever downloaded a file from a website. The starting step is to log in, which can be done
automatically or by manually entering a username and password. FTP requires a
specific port number to access an FTP server. You can transfer files using your FTP
client after connecting to the FTP server. Some public FTP servers do not require you
to sign in because you can access them anonymously.
A typical FTP transfer works like this:
Firstly, a user must log in to the FTP server. There are some servers that make some or all
of their content available without requiring a login; they are referred to as anonymous
FTP.When a user raises a request to download a file, the client starts a discussion with the
server. A client can use FTP to download, move, delete, upload, rename, and copy files on
a server.
Objectives of FTP
 To encourage file sharing (computer programs and/or data).
 To encourage the indirect or implicit use of remote computers (via programs).
 To protect a user from variations in file storage systems between hosts.
 To reliably and efficiently transfer data (designed mainly for use by programs).

What is the World Wide Web?


The World Wide Web popularly known as WWW, W3, or the Web is an interconnected
system of public webpages accessible through the Internet.
The Web is not the same as the Internet : the Web is one of many applications built on top
of the Internet.

History of the World Wide Web


The history of the world wide web is associated with Tim Berners Lee. After getting
graduated from Oxford University, the English computer scientist started working
with CERN (Conseil Européen pour la Recherche Nucléaire or European Council for
Nuclear Research), the large particle physics laboratory near Geneva, Switzerland, as a
software engineer. While his term at CERN he discovered that there was a problem in data
sharing among different scientists due to the unavailability of a common network.
 In March 1989, a proposal was laid out by Tim laid, known as *' Information
Management : A Proposal, proposing the existence of a common network to share data.
This was rejected by the CERN.
 In September 1990, the initial work on the web started.
 In October 1990 : The three fundamental technologies of the web were written. These
included HTML, URI and HTTP.
 By the end of 1990, the first web page was available on the open internet.
 In 1991, the web community was opened to people outside CERN.
 In 1994, the World wide web consortium was founded, it is an international community
devoted to developing open web standards.
 At present most of the users are using the Web 2.0 version. Web 3.0 has been proposed
that focuses on using a machine-based understanding of data to provide a data-driven
and Semantic Web.
How Does the World Wide Web Work?
Now that we have an understanding of what the world wide web is, in this section, we will
see the working of the world wide web.
The working of the World Wide Web is based on the client-server model. A web server is
a software and hardware that uses HTTP (Hypertext Transfer Protocol) and other protocols
to respond to client requests made over the World Wide Web.
A web server is used to store data or information and this data is transferred to the
computer of the user when a user on the same network requests data or information. The
computer system of the user that is requesting this data is known as a client. This exchange
of data is usually carried out by the browser present on our computer systems. It allows us
to access the retrieved data in the form of documents from the web.

You might also like