Tuesday 13 October 2015

HTTP

Hyper Text Transfer Protocol (HTTP)

Now after Discussing all the basic concepts of the Application Layer, we should now look at its different protocols. There are various protocols in the Application Layer such as HTTP, FTP, DNS, SMTP. Each protocol is used for the purpose of using different Application.  First, we should start with the HTTP protocol.


Internet and HTTP:

Before the early 1990s, the Internet was not common to every human being , as it is now. The Internet was only used by researchers and some universities. These researchers and university students use to Internet to log in to remote hosts , to transfer files from client host to remote hosts and vice-versa. Internet was used by them to receive and send mails and news. But as in early 1990s , a new application arrived in the market that was known as World Wide Web (www). The Web changed the course of the computer networks. It changed the thinking of the people , that how the people interact and communicate , inside and outside their work environment. The most promising feature of the WEB , that attracted lot of users towards is that Web works on Demand. Any user can get anything at any-time of the day he wants. There were certain other very amazing feature that people love and admire. Anyone can become the member of the Web, Anyone can publish his/her thoughts and much more. And finally after 2000,  the Web serves as a base or a platform for many superb applications such as Gmail, Facebook and YouTube.

Now before directly coming to the explanation of HTTP. I want to make you familiar with some very basic terms.

  • A Web Page
  • A HTML file
  • A Web Browser or a Client
  • A Web Server
i) A Web page consists of objects. These objects can be images or an HTML file etc. An HTML file is the reference to the other objects in the web page. It refers the object with the object URL. The URL has two things in it. 1. The host name and 2. The object address or the path name. For example:

Suppose this is the site name http://imraan-prrec.blogspot.com/computer-networks/LAN.png

Here, imraan-prrec.blogspot.com is the host address and the computer-networks/LAN.png is the path of the image where the image is present.


ii) Web browser or the client is the host that sends a HTTP request message.

iii) Web Server is the host that services that request and sends HTTP response to it.


  • Default Port Number of HTTP is 80.

Let me try to clear you by drawing a figure. Look at the figure to understand the HTTP request response mechanism..

HTTP request response messages, hyper text transfer protocol, computer networks, client server architecture, browser, suggestions, comments
*******Before moving on, I should clarify you with 2 things and then will get further:
(a) Web uses a Client-Server Architecture where there is a server that is always on with a fixed or static IP address and responds to thousands of request from different clients or browser.
(b) And I am using Browser and Client Interchangeably. When you requests a Web Page from your Laptop, you always use your Browser. So don't get confuse by client or browser. They are same.  *******
HTTP defines everything for a Browser (Client) and a Server. How a Client should send a request message for a Web Page to the server,  what should be the format of that message and how the server responds to that request by sending the Web Pages to the Client and what is the format of the response message. All these aspects are defined by the HTTP protocol.
The underlying protocol that HTTP uses is TCP(Transmission Control Protocol). The HTTP client or the browser initiates a TCP connection with the sever. After the connection is established, the browser and the sever access TCP through their socket interfaces. 
As I have told you in the previous posts that Socket is the door between the Client Process and the TCP on the Client Side and on the sever side it is the door between the server process and the TCP. 
The Client sends its HTTP request message into its socket and receives the response message from the socket interface. In the same way, the server receives the HTTP request from the socket and sends HTTP response into the socket interface. Once the Client sends the message into its socket, the control over the message is out of his hands and TCP take its control now. 
TCP possesses  a property that it guarantees a Reliable Delivery of Data. That means if a message is hand over to TCP , it will surely reach to its destination.(No guarantee of , how much time taken). So the HTTP request message sent by the client must reach the server and the server HTTP response message must reach the client. 
  • We will discuss about TCP in Detail in the later posts of Transport Layer. Till now, you should remember that it provides a Reliable Data Delivery Service.

Here you see a big advantage of Layered Architecture. That HTTP should not worry about the transfer of the message. HTTP need not worry about the lost data. Its the job of Transport and the lower lying layers.
One more thing that I should bring to you is that server doesn't make any record of the client. It just sends the requested file without making any record of the client. For example, if you request the same file thrice in spam of 2 seconds, the server will resend you the same file 3 times. It will not alert you that you have just requested that file because server has forgotten everything what it did before. Because of this, HTTP is said to be as STATELESS PROTOCOL. As it is not storing any state of the client. 

This is all with the basics of HTTP. In the further posts, I am going to tell you about the Types of HTTP connections and message format of HTTP protocol.

No comments:

Post a Comment