HYPER TEXT TRANSFER PROTOCOL
Hyper text means clickable text in a webpage.
HTTP is used to access webpage from web server.
It is mainly used to access data on www (world wide web).
HTTP is based on client-server model and uses TCP as transport layer protocol
with port number = 80.
HTTP doesn’t have flow and error control mechanism so it depends on TCP for that.
HTTP is “in-band” protocol i.e. there is no separate connection is made for
commands (from only one connection for both commands and data transferred).
HTTP is “state-less” protocol i.e. it treats each request as an independent transaction
which is unrelated to any previous request so here communication consists of
independent pair of request and response.
Server doesn’t maintain any info about clients i.e. when did clients were logged-in last
time, which pages they have visited etc. (millions of users may visit website so
maintaining information needs lots of memory).
Problem: If server doesn’t maintain any information about client, then how it will
display data according to client’s interest.
Solution: Server creates a special text file called “cookie” and drop it on client’s
computer. So, whenever client visit the same server then it shows the same cookie and
hence server shows the content related to you.
COOKIE:
Cookie is small text file (not piece of code).
It has certain life span and after that it is deleted automatically.
It stores information about content viewed by client on website.
VERSIONS OF HTTP:
HTTP 1.0 (Non-Persistent Connection):
Non-persistent connections are used i.e. if webpage has 4 objects, then to download
each object a separate TCP connection is opened and after downloading it is closed.
Hence, if webpage has ‘n’ images the ‘(n+1)’ connections are established (1 for
webpage and ‘n’ for images).
Simply remember, for each object 1 connection is required.
These connections are established parallelly hence between same client and server, we
can have multiple connections.
It is slow but load on server is less.
HTTP 1.1 (Persistent Connection):
Persistent connection is used i.e. only one connection is established between client and
server which will fetch all the data.
It is fast but load on server is high.
Client Site:
When a user clicks on a hyperlink, the browser carries out a series of steps in order to fetch
the page. Suppose that a user is browsing a web that points to ITU’s home page, which is
[Link] Let us trace the steps that occurs when this link is
opened.
1. The browser determines the URL (by seeing what was selected).
2. The browser asks DNS for the IP address of [Link].
3. DNS replies with [Link].
4. The browser makes a TCP connection to port 80 on [Link].
5. It then sends a request asking for file /home/[Link].
6. The [Link] server sends the file /home/[Link].
7. The TCP connection is released.
8. The browser displays all the text in /home/[Link].
9. The browser fetches and displays all images in this file.
Summary: Identify URL → DNS Query → TCP Connection → Webpage → Display.
Server Site:
1. Accept a TCP connection from a client (a browser).
2. Get the name of the file requested.
3. Get the file (from disk).
4. Return the file to the client.
5. Release the TCP connection.
Properties of Application Layer Protocols
DNS HTTP SMTP POP FTP IMAP
Stateful/
Stateless Stateless Stateful Stateful Stateful Stateful
Stateless
Connectionless/
Connection- Connection- Connection Connection Connection Connection
Connection less less Oriented Oriented Oriented Oriented
Oriented
Transport
UDP/ TCP TCP TCP TCP TCP TCP
Protocol Used
HTTP 1.0 Control-
is Non- Connection
is Persistent
Persistent
Persistent/ Non- and
and Persistent Persistent Data-
Persistent
Non-Persistent Persistent
HTTP 1.1 Connection
is is Non-
Persistent Persistent
20 for Data-
Connection
and
Port Number 53 80 25 110 21 for
143
Control-
Connection
In-Band/ Out- Out-of-
In-band In-band In-band In-band In-band
Band band
Port Numbers of Application Layer Protocols