Deep dive into HTTP

Hypertext Transfer Protocol (HTTP) is an application layer protocol meant for transferring hypermedia documents between web browsers and web servers. Web Browsers acts as a client, there can be other clients like mobile applications that can make use of HTTP too. Before we move forward let's understand few basic terms-

Hypertext- Text displayed on a Computer Screen.

Protocol – Set of rules, in this case, rules that govern the transfer or communication of data between entities in a system.

URL- Uniform resource locator that tells the address of a web resource and ways to locate it.

DNS- The Domain Name System (DNS) is the hierarchical and decentralized naming system used to identify computers, services, and other resources reachable through the Internet or other Internet Protocol (IP) networks. It can also be called a phonebook of the internet.

TCP/IP- TCP provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network. An IP network is a group of computers connected via their unique internet protocol (IP) addresses. The Internet Protocol (IP) is the network layer communications protocol in the Internet protocol suite for relaying datagrams across network boundaries. Its routing function enables internetworking and essentially establishes the Internet.

Web Resource-A web resource is any identifiable resource (digital, physical, or abstract) present on or connected to the World Wide Web.

Now that we are familiar with some basic terms let's talk about some of the important HTTP properties

It is stateless i.e it has no memory, it cannot track your actions to give you a sense of continuity. This does make sense because there are billions of HTTP requests made every minute and it would be super cumbersome if the protocol is stateful. .....Something seems wrong!! Doesn’t it? You might remember the browser logging you in on particular sites, or even taking you to your last known web resource that you accessed, so how does it do that, any guesses? Yes, you probably guessed it right, it maintains some sort of statefulness by allowing sessions and cookies that help us to maintain a sequence but HTTP in itself is stateless.

HTTP works on the request-response pair – Pretty simple to understand, you send a request and receive a response in HTTP, the network section of the Developers tools of your browser helps you understand what constitutes these two better.

Screenshot (8).png

Like any technology HTTP has evolved a lot over the years and is constantly evolving, by understanding a few major versions, it will help us understand HTTP better

HTTP/1.0 • First Browser friendly version • Headers that have rich metadata was included • Response not limited to only HTML content but CSS, Scripts also allowed • It terminated immediately after a response.

HTTP/1.1 • The standardized protocol • Can have multiple request-response pairs in one connection • Introduced critical performance optimizations and feature enhancements • Most widely used version and the version browser uses when the newer versions don’t work

HTTP/2 • Uses compressed binary representation of metadata instead of textual one to save space • Has much less latency and provides a better speed for communication • extended the usage of persistent connections by multiplexing many concurrent requests/responses through a single TCP/IP connection. Reduces TCP/IP connection on the server-side to process more clients at once by servers.

HTTP/3 • In 2020 HTTP/3 first drafts have been published and major web browsers and web servers started to adopt it, built on top of a UDP-based transport called QUIC (rather than the TCP-based protocol that HTTP/1.1 and HTTP/2 are based on top of). • it is used by more than 20% of websites.

Now that we have gained a basic understanding of HTTP I would end with a question that often bugs me.

What is HTTPS? • Hyper Text Transfer Protocol Secure (HTTPS) is the secure version of HTTP. It uses SSL/TLS for secure encrypted communications. • An HTTPS connection can protect the data transfer from man-in-the-middle attacks and common security threats by providing bidirectional encryption for communications between a client and server.

Works in the transport layer. HTTPS is not a separate protocol but refers to the use of ordinary HTTP over an encrypted SSL/TLS connection.

Hope the article was helpful to you all and gave you some new info about the widely used HTTP.