Http is Hyper Text Transfer Protocol. This is a protocol that everyone uses to send and receive a variety of things in the world wide web. We can even say that the whole world is being connected through this protocol. So in this article lets take a look into http, the different versions of it and also the model that that controls the data transmission through the world.
Before we start talking about http we need to talk about how that protocol is sent and received through the network. For this lets take a look into ISO OSI 7 layers.
ISO OSI 7 layers
During the early days of networking there were a lot of different types of networking standards. So different hardware components were supported by different architectures and protocols. Because of this the top tier companies decided that they needed to have a standard model for all networking devices. That is where the Open Systems Interconnection model (OSI) was created by the International Organization of Standards(ISO). The following diagram shows the 7 layers in this model.
Starting from the bottom, the Physical Layer is the layer 1 up to Application layer which is layer 7. For a data to be sent and received through a network it must pass through all of this seven layers. Now lets take a look into each of these layers individually.
Note: If anyone wants to remember the 7 layers easily, remember this phrase. Please Do Not Throw Sausage Pizza Away. The first letter in the words of these sentences will represent the 7 layers of the ISO OSI model.
Application Layer (Layer 7)
Application layer is the layer that stands at the top of the OSI model. This is the layer that end users are directly interacting with the most. Web browsers and mail systems are examples of applications that are in application layer. This layer is responsible for creating and displaying the data that is sent through the network.
Common protocols that are used in the application layer are Hyper Text Transfer Protocol (HTTP), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and Domain Name System (DNS).
Presentation Layer (Layer 6)
Presentation layer is known by names such as ‘Syntax Layer’ and ‘Translation Layer’. As these names imply this layer is responsible for converting the presentation format from one format to another format. This layer has 3 major responsibilities.
- Translation : Different computers use different encoding to represent characters. The presentation layer is responsible for translating the message into the encoding method the receiver system uses. When receiving the data it will convert it into a common format and then convert that into the encoding type that the system supports.
- Encryption : This layer is also responsible for encrypting the message to increase security.
- Compression : It will compress the data into a smaller size if sending, and decompresses the data when receiving.
TLS (Transport Layer Security) , Apple Filing Protocol (AFP) and SSL (Secure Socket Layer) are some of the protocols that are used by the Presentation Layer.
Session Layer (Layer 5)
Session Layer is responsible for creating sessions between two systems. This layer is responsible for connectivity, synchronization and communication control.
- Connectivity : Session Layer is responsible for two systems to establish a connection and also terminate the connection after communication is done.
- Synchronization : Session layer will add checkpoints to the data that is sent to the network. Lets say during transmission a data is failed to be received, then it will send the data pack again through checkpoint. So the data will be sent in the correct order.
- Control : Session layer will decide if the connection is full duplex or half duplex.
Sockets Direct Protocol (SDP), Remote Procedure Call (ASP) protocols are some protocols that are used in this layer.
Note: These 3 layers are known as the Software Layer of the OSI 7 layers.
Transport Layer (Layer 4)
Transport Layer is also known as the heart of the OSI layer. Transport layer is responsible for the submission and resubmission of data. If it finds any type of error in transmission so with that we can say the main responsibility of this layer is to transport the data successfully.
The main functionalities of this layer are;
- Segmentation and reassembly : When transport layer receives data from the session layer it will break the data into separate parts. These are known as segments and each segments will have an header which will have the sequence number, source port address, destination port address. When the data is received from the network layer it will reassemble the segments with the sequence number and send it to the session layer.
- Connection control : It provides two different types of connection services which are connection oriented (TCP/IP) and connection less (UDP)service.
- Flow and Error Control : This layer is responsible for sending the data in the correct order and handles if there are any errors at the end point.
The two major protocols that are used in this layer are TCP (Transmission Control Protocol )and UDP (User Datagram Protocol)protocol.
Note: The data is called segments in this layer.
Network Layer (Layer 3)
Network layer takes care of the connection between different devices. The network layers functionality can be broken up into;
- Addressing : The network layer will add the address to uniquely identify the sender and the receiver on the network. For that it will assign the sender’s IP address and the receiver’s IP address on the header of the packet. (This address is known as logical address)
- Routing : Routing is another major component of the network layer. Routing decides the best possible path (shortest) for the data packet to travel through the network.
IP (Internet Protocol) is used in this layer. Routers are layer 3 devices.
Note: The data is called as a Packet in this Layer
Data Link Layer (Layer 2)
The major responsibility of the data link layer is to make sure, the data sent between the physical layer is error free. The packets that are received from the network layer is further divided into frames. Data link layer will add another header on top and then send it to physical layer for transmission.
Note: In this header the hardware address of the device (MAC address which is also known as the physical address) and a trailer is also added.
To do that this layer has two smaller layers within it.
- LLC (Logical Link Control) : This is responsible for transferring the frame received from the physical layer to the Network Layer. LLC identifies the IP address of the data it receives.
- MAC (Media Access Control) : This layer links the LLC and the physical layer to send data. MAC will be adding the header and trailer for transmission.
Other than sending and receiving data through the physical layer, data link layer also does flow control, error control and access control.
Flow control : It makes sure that data is sent and received on a correct manner. When one side has higher processing and the other has slower processing.
Error control : Error control is done by the CRC (Cyclic Redundancy Check) which is added on the trailer of the frame.
Access control : Decides which device has control over the link at a given time when more than one are connected.
Point to Point Protocol(PPP) and (HDLC) High Level Datalink Control are some protocols that are used in this layer.
Physical Layer (Layer 1)
Physical Layer is the lowest layer in the OSI model. As the name implies it deals with physically connecting devices through out the network. The main functionality of this layer is the transferring of data bit by bit. The physical topology of the network is decided based on the physical layer. The physical layer will also do synchronizing to keep track of the bits sent and received.
Telephone moderns, and USB are example of physical layer devices.
Now that we have looked into the model that works for data transmission lets come back to the main topic at hand which is the HTTP protocol. Lets see the history and the evolution of HTTP.
Hubs and repeaters are physical layer devices.
What is HTTP?
HTTP (Hyper Text Transfer Protocol) is a protocol that works in the application layer to send requests to web severs and getting a response from them (Client Server Architecture). Basically it is the protocol that makes the world wide web (www) work. Lets look at a scenario to see how it works.
If you want to load a website, you will first open up your browser and then enter the URL for the website that you want to access. The HTTP protocol will then travel to the specific server and sends a request for a connection. If the server accepts, it will send a response as a file back to the browser. Browser will reconstruct the webpage with the file (html document) so the users can view them. This is for simplest of files, if that specific web page has other elements such as videos, images and other content separate web servers might contain them. So html requests will be sent to the servers that contain them and after receiving the files browser will reconstruct it.
Note: HTTP simply doesn’t directly send the request to the server it will be going through multiple moderns , routers and proxy servers before it reaches its destination. For more information click here.
Now that we have a basic understanding of HTTP lets take a look at the history and the evolution of this protocol.
History of HTTP?
HTTP was created by Tim Berners-Lee and his team while they were working on creating the world wide web. (Called mesh at that time). The initial idea of this protocol was to send simple HTML documents to be displayed on a client.
The first version of the HTTP protocol were later called as HTTP/0.9 which is also known as the one line protocol.
This is the first version of HTTP, this version initially had no version number. For naming purposes this was later dubbed as the HTTP/0.9. This is the simplest version of HTTP. It contained only one single line with one single method which is the GET for the requests. And the response will be coming in the form of html file. If there was an error, an HTML file with the error message will be sent back to the client.
HTTP 0.9 had a lot of drawbacks and was limited. So this version was implemented. This update was made to extend the amount of files that can be sent with the server. HTTP/1.0 protocol has a header content and a body unlike HTTP/0.9. Now the client will be contacting the server with the designated port number, then the client will send the request to the server with the appropriate method and will also mention the file type in the header. The new features of 1.0 are
- Versioning information is now sent with each line. (HTTP/1.0)
- New methods;
HEADwere released in this version.
- Unlike sending a file for a failed response, a status code is sent at the beginning of each response. This in turn will allow the browser to know whether the sent request is a success or not.
As this version included the header for http the protocol had become more flexible in usage. With the header it was possible to transfer other files besides html documents due to the
content-type header. Ex: image files.
Even though the newer version of HTTP introduced a lot of new possibilities. It had a major drawback of opening and closing a connection for every request that is sent to the server. The reason for this is that HTTP was built on top of the TCP Protocol.
To address the problems of http 1.0 a minor version update was released. This is the first standardized and documented version of HTTP. This version is still being used to this date.
The major change that came with this update is that there was no need to create new connections for every message (Persistent Connection). Simply put the connection will only close after server responds with a termination response. If the persistent connection is created there is an option to create an http pipeline as well.
The http pipeline the user will be sending requests without the need of a response. And the server will be sending the results back one by one after they are processed. The below diagram shows the pipeline in action
As you can see from the above diagram. The results will be sent back in the exact same order as it was received. Lets say for example that the server has multi threading capabilities, and that our green request takes the least amount time to process. Even if the green request is processed first it will not be sent before sending out the other requests. Thus this pipelining will be Synchronous communication.
Note: It is done by adding the
Connection: Keep-Aliveheader. This will not close the connection instead it will keep it open.
HTTP/1.1 added new methods in this version, which are
HTTP even though was widely used, it was not safe enough to send secure confidential information. For that in the mid 90’s Netscape Technologies integrated a new layer on top of the existing TCP layer. That was SSL1.0. SSL 1.0 was used only within their company but later versions were released for public E-Commerce operations.
Note : For more information regarding SSL click this link.
HTTP 2.0 and Further
After HTTPS in the early 2000’s a new word was creating all the buzz. Representational State Transfer which in short form is REST. HTTP was starting to implement the REST architecture which paved the way to create new applications. (REST is a topic for another day that will be coming soon👀).
Today in this day and age web pages have become so complex that they can be called their own applications. They have so much content packed into one page which includes both static content and dynamic content. So because of this HTTP should be sending and receiving multiple different requests and responses. This in turn can be fixed by pipeline and parallel executions but because of the complexity these solutions look kind of outdated.
That's why Google developed a new protocol SPDY (Saying speedy in a simplistic way). This new protocol increased responsiveness. So this protocol was used as a baseline for the creation of the HTTP/2 protocol.
The key changes in this protocol are;
- Instead of being text based, HTTP/2 is a complete binary protocol.
- Parallel requests were able to be completed through this protocol.
- This protocol compresses headers and thus remove duplicate data (multiple requests will have the same headers).
This version is being used a lot nowadays and older applications are also adapting to this.
These are not the only updates to be happened to HTTP. Even till this date HTTP is being updated and even a newer version HTTP/3 is in development. And it is being developed on a new transport layer protocol QUIC. Click here to find more information.
Layers of OSI Model - GeeksforGeeks
Prerequisite : Basics of Computer Networking OSI stands for Open Systems Interconnection. It has been developed by ISO…
OSI Model: Layers, Characteristics, Functions - javatpoint
Computer Network | OSI Model with Layers with computer network tutorial, introduction, features, types of computer…
Hypertext Transfer Protocol -- HTTP/1.0
HTTP Working Group T. Berners-Lee, MIT/LCS INTERNET-DRAFT R. Fielding, UC Irvine H. Frystyk, MIT/LCS Expires August 19…