HTTP

ONE


Hypertext Transfer Protocol (HTTP) is the protocol that enables the connection between a web server and a client. Hypertext Transfer Protocol (HTTP) is an application layer protocol for distributing information in the World Wide Web (WWW). Hypertext Transfer Protocol (HTTP) is based on the client–server architecture. An Hypertext Transfer Protocol (HTTP) server (commonly called as a web server) uses the well-known port number 80. Examples of Hypertext Transfer Protocol (HTTP) Server or web server are Internet Information Server (IIS), Apache Web Server etc. A Hypertext Transfer Protocol (HTTP) client is also called a web browser (Mozilla FireFox, Internet Explorer, Google chrome etc). Hypertext Transfer Protocol (HTTP) operates on a request-response model. A browser sends a request to a server for a file, and the server responds with the requested file if it is available.

In WWW, information is typically provided as Hypertext Markup Language (HTML) files (called web pages). WWW resources are specified by Uniform Resource Locators (URL). Uniform Resource Locator identifies where a resource is available and the mechanism for retrieving it.

An example for Uniform Resource Locator is http://www.omnisecu.com/tcpip/index.php. The first part of a URL is the protocol part, which is identified by “http://”. When we use any other protocol like File Transfer Protocol (FTP), this part can be replaced by “ftp://”. The protocol pat is followed by a server domain name or server IP address, and path to a resource (an.HTML file or a PHP server side program).

Hypertext Transfer Protocol (HTTP) messages are English-based and flexible.  Format of Hypertext Transfer Protocol (HTTP) headers are given below.

A Hypertext Transfer Protocol (HTTP) client request.

GET / HTTP/1.1
Host: http://www.google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)
Accept: text.html,application/.html+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

A Hypertext Transfer Protocol (HTTP) Server Response

HTTP/1.x 200 OK
Cache-Control: private, max-age=0
Date: Sat, 21 Mar 2009 04:09:39 GMT
Expires: -1
Content-Type: text.html; charset=UTF-8
Content-Encoding: gzip
Server: gws
Content-Length: 2671

Since HTTP/1.0, the first line of the HTTP response is called the status line and includes a numeric status code (As in example 200) and the reason in text (“OK”).

TWO


The operation of Hypertext Transfer Protocol (HTTP) involves the communication between a Hypertext Transfer Protocol (HTTP) client application (Usually web browser) and a Hypertext Transfer Protocol (HTTP) server application (Web servers like IIS). Hypertext Transfer Protocol (HTTP) uses Transmission Control Protocol (TCP) as the Transport Layer Protocol at Well Known port number 80. Once the TCP connection is established, the two steps in Hypertext Transfer Protocol (HTTP) communication are

1) HTTP Client Request: Hypertext Transfer Protocol (HTTP) client sends an Hypertext Transfer Protocol (HTTP) Request to the Hypertext Transfer Protocol (HTTP) Server according to the HTTP standard, specifying the information the client like to retrieve from the Hypertext Transfer Protocol (HTTP) Server.

2) HTTP Server Response: Once the Hypertext Transfer Protocol (HTTP) Request arrived at the Hypertext Transfer Protocol (HTTP) server, it will process the request and creates an Hypertext Transfer Protocol (HTTP) Response message. The Hypertext Transfer Protocol (HTTP) response message may contain the resource the Hypertext Transfer Protocol (HTTP) Client requested or information why the Hypertext Transfer Protocol (HTTP) request failed.

HTTP Request and Response

Hypertext Transfer Protocol (HTTP) Request and Response.

Improvements in HTTP/1.1

Multiple Host Name Support: HTTP/1.1 supports specifying a Hostname in header. This allows running multiple websites using a single IP address helps preventing the depletion of IPv4 addresses. Any combination of IP address, Port number and Hostname can be used to identify a website.

Persistant Connections: In HTTP/0.9 and 1.0, the TCP connection is closed after a single HTTP Request/HTTP Response pair. In HTTP/1.1 a keep-alive-mechanism was introduced, where a TCP connection could be reused for more than one request. The defualt working principle of HTTP was not changed and the difference is that the TCP connection is kept open after each HTTP Request/HTTP Response pair. Persistent connections reduce delay remarkably, because the client does not need to re-negotiate the TCP connection if it want to retrieve any resource immediately.

Partial Resource Selection: In HTTP/1.1 the client can request for a partial resource. This feature can reduce the workload of the server and save the available bandwidth.

Cited from:

http://www.omnisecu.com/tcpip/http-hypertext-transfer-protocol-request-response.php

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s