0% found this document useful (0 votes)
15 views4 pages

The Hypertext Transfer Protocol-1

HTP

Uploaded by

piyushshaily1918
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)
15 views4 pages

The Hypertext Transfer Protocol-1

HTP

Uploaded by

piyushshaily1918
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/ 4

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed,

collaborative, hypermedia information systems. This is the foundation for data


communication for the World Wide Web (i.e. internet) since 1990. HTTP is a generic
and stateless protocol which can be used for other purposes as well using extensions
of its request methods, error codes, and headers.
Basically, HTTP is a TCP/IP based communication protocol, that is used to deliver data
(HTML files, image files, query results, etc.) on the World Wide Web. The default port
is TCP 80, but other ports can be used as well. It provides a standardized way for
computers to communicate with each other. HTTP specification specifies how clients'
request data will be constructed and sent to the server, and how the servers respond to
these requests.

Basic Features
There are three basic features that make HTTP a simple but powerful protocol:
• HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP
request and after a request is made, the client waits for the response. The
server processes the request and sends a response back after which client
disconnect the connection. So client and server knows about each other during
current request and response only. Further requests are made on new
connection like client and server are new to each other.
• HTTP is media independent: It means, any type of data can be sent by HTTP
as long as both the client and the server know how to handle the data content. It
is required for the client as well as the server to specify the content type using
appropriate MIME-type.
• HTTP is stateless: As mentioned above, HTTP is connectionless and it is a
direct result of HTTP being a stateless protocol. The server and client are aware
of each other only during a current request. Afterwards, both of them forget
about each other. Due to this nature of the protocol, neither the client nor the
browser can retain information between different requests across the web
pages.
HTTP/1.0 uses a new connection for each request/response exchange, where as
HTTP/1.1 connection may be used for one or more request/response exchanges.

Basic Architecture
The following diagram shows a very basic architecture of a web application and depicts
where HTTP sits:
The HTTP protocol is a request/response protocol based on the client/server based
architecture where web browsers, robots and search engines, etc. act like HTTP
clients, and the Web server acts as a server.

Client

The HTTP client sends a request to the server in the form of a request method, URI,
and protocol version, followed by a MIME-like message containing request modifiers,
client information, and possible body content over a TCP/IP connection.

Server

The HTTP server responds with a status line, including the message's protocol version
and a success or error code, followed by a MIME-like message containing server
information, entity meta information, and possible entity-body content.
File Transfer Protocol (FTP) in Application Layer
File Transfer Protocol (FTP) is an application layer protocol which moves files between local and
remote file systems. It runs on the top of TCP, like HTTP. To transfer a file, 2 TCP connections are
used by FTP in parallel: control connection and data connection.

What is control connection?


For sending control information like user identification, password, commands to change the remote
directory, commands to retrieve and store files, etc., FTP makes use of control connection. The
control connection is initiated on port number 21.
What is data connection?
For sending the actual file, FTP makes use of data connection. A data connection is initiated on
port number 20.
FTP sends the control information out-of-band as it uses a separate control connection. Some
protocols send their request and response header lines and the data in the same TCP connection.
For this reason, they are said to send their control information in-band. HTTP and SMTP are such
examples.

FTP Session :
When a FTP session is started between a client and a server, the client initiates a control TCP
connection with the server side. The client sends control information over this. When the server
receives this, it initiates a data connection to the client side. Only one file can be sent over one data
connection. But the control connection remains active throughout the user session. As we know
HTTP is stateless i.e. it does not have to keep track of any user state. But FTP needs to maintain a
state about its user throughout the session.
Data Structures : FTP allows three types of data structures :
1. File Structure – In file-structure there is no internal structure and the file is considered to be a
continuous sequence of data bytes.
2. Record Structure – In record-structure the file is made up of sequential records.
3. Page Structure – In page-structure the file is made up of independent indexed pages.

You might also like