What is HTTP?

2 minutes, 36 seconds Read

The Hyper Text Transfer Protocol (HTTP) is a web application layer protocol that is at the heart of the web. HTTP is implemented in two programs:

  • Client Program
  • Server Program

The client and server programs communicates with each other by exchanging HTTP messages. HTTP defines the structure of these messages and how client and server exchanges these messages.

HTTP uses TCP (Transport Control Protocol) as its transport protocol. The client initiates a TCP connection with the server. Once the connection gets established then the browser and server processes the access TCP through their socket interfaces. The client sends request messages into its socket interface and receives response messages through its socket interface. On the other hand, the server receives request messages from its socket interface and sends response messages through its socket interface. In between the client and server conversation, TCP provides reliable communication. Once the client sends its request message, it is handed over to TCP which makes sure that this message is delivered to the server.

The servers sends requested files to client without storing any state information about the client. This means that if the same client resends a request to access the same files again. The server does not turns its request down by saying that it has already sent that file a while back. Instead the server resends the requested file just like it did in the first place. An HTTP server does not keep state information about the HTTP client therefore it is also known as stateless protocol.

Persistent and Non Persistent HTTP Connection

The request / response message pair is either sent over a separate TCP connection or all the requests and their respective responses are sent over the same TCP connection.The first type is called non-persistent connection and the second type is called persistent connection.

Non-Persistent Connection

To better understand this, one must know about Round Trip Time (RTT), which is the time it takes by a small packet to travel from client to server and then back to the client. RTT includes packet propagation delays, packet queuing delays at intermediate routers and switches and packet processing delays.

Now lets say you click on some link. This will cause the browser to initiate a TCP connection between the browser and the web server. This involves a three-way handshake, the client sends a small TCP segment to the server and then the server acknowledges and responds with a small TCP segment and then the client acknowledges back to the server. The first two parts of the three-way handshake takes one RTT. After the first two steps completion, the client sends a HTTP request message combined with the third part of the handshake into the TCP connection. This request / response also takes up one RTT. So it takes two RTTs plus the transmission time at the server.

Persistent Connection

With persistent connection the server leaves the TCP connection open after sending the response. Requests and responses between client and server can be sent over the same TCP connection. The requests for objects can be made back to back without waiting for the replies to the pending responses.



I am an individual with 5+ years of experience in IT. I have started this website inorder to share informations on upcoming jobs and informative content. Looking forward to your kind responses on my posts and I will do my best to make this site helpfull for everyone

Similar Posts



Your Cart is Empty

Back To Shop
Skip to content