Is HTTP A Network Protocol?

Is HTTP A Network Protocol?

What is the difference between the web and the internet, or isn't it just two interchangeable names for the same thing? What is the difference between HTTP and HTTPS? What happens when I visit a website?

In this article, we're going to talk about:

  • What happens with your browser when you visit a website
  • What HTTP is, and how it was developed
  • How HTTP works
  • HTTP Methods
  • HTTP Status Codes
  • What is meant by HTTP Semantics
  • The differences between different versions of HTTP
  • HTTP vs HTTPS
  • HTTP Protocol Stack & Packet Structure
  • The QUIC Protocol

When you type "linkedin.com" in your browser, a lot of things happen. But basically, you just sent a message to a computer (server) somewhere on the internet and asked it to give you a file (or files). When the file is sent over to you, your browser renders it and produces a beautiful webpage for you, allowing you to read my articles and be happy.

The files could be HTML files, CSS files, JSON files, images, videos, animations, or anything that is needed to render the webpage. The collection of these files in different web hosts/servers all over the world, connected to the internet, is called the world wide web, also known as the web, and the protocol used to send them over the internet is the Hypertext Transfer Protocol (HTTP).

A hypertext is any text that allows you to link to other parts of the text or other related texts using links.

History

Tim Berners-Lee, also known as TimBL, was working at CERN when he had the idea that there should be a faster and more accessible way for scientists to share and update information over already existing networks. He proposed his idea to his manager; by 1991, he had built the first web browser, built the first web server, and published his first website.

Along with that, he created the first version of HTTP which was called version 0.9. He used TCP, which was available at the time, DNS, which was also available at the time, and some other technologies. When he put them together, the world wide web was born.

The Internet Engineering Task Force (IETF) took it up from there and published the first finalized and fully documented version in 1996. HTTP /1.0. It continued that way; HTTP/1.1 in 1997, HTTP/2.0 in 2015, and HTTP/3.0 in 2022.

Working Principle

HTTP operates on the client/server model and is a stateless protocol, meaning that every interaction between the client and server ends there and none?of them remembers that interaction in the future. Whatever happened in the previous interaction does not affect the current interaction or change the state of the system.

Before there's any communication between an HTTP client and server, the client has to initiate a TCP connection with the server. They go through the TCP 3-way handshake and then the channel is open for both of them to communicate. The HTTP client then sends an HTTP Request to the server and gets an HTTP Response with the file it's looking for.

HTTP Methods

When a client sends an HTTP Request, it also has to tell the server what it wants the server to do. It achieves that using HTTP methods. HTTP has about 8 methods, but we'll talk about only 4 of them: GET, POST, PUT and DELETE, the ones that carry out the CRUD (CREATE, READ, UPDATE, DELETE) operations.

An HTTP request with a GET request method or HTTP verb is also known as a GET request. And the same goes for the other methods. The target of HTTP requests to a server is known as resources. They could be documents, images, or different types of files. The resources are identified with a URI (Uniform Resource Identifier) which could go something like this:

file:example.com/pathtofile/thefile.html

OR

https://example.com/pathtofile/thefile.js

Here are the four basic methods...

GET Method: The GET method is used to send a request to retrieve certain data from the server. It is a request for a representation of a particular resource on the server. It is a READ operation. For a get request, the payload of the request is carried in the URL.

POST Method: A POST request is used to add information to the server. If I have an API that handles the student records on a database, sending it a POST request would add a new student record. This corresponds to the CREATE operation.

PUT Method: The PUT method is used to change information on the server. Sending a PUT request will replace the information on the server with the data carried in the HTTP request. It is an UPDATE operation.

DELETE Method: The DELETE method is used to delete information from the server. Sending a DELETE request deletes the specified resource on the server.

HTTP Status Codes

We've talked about how the client communicates its intentions with the server. How about when the server wants to communicate with the client? Sometimes, the client may request a resource that does not exist on the server, or the request may be invalid. For the server to communicate such information with the client, we have something called status codes.

Status codes are different numbers or codes that HTTP servers use to communicate the state of things to the client. There are more than 25 of them, but we'll just deal with the most basic ones.

The codes are divided into 5 categories:

  • 1XX - Information codes
  • 2XX - Success codes
  • 3XX - Redirect codes
  • 4XX - Client error codes
  • 5XX - Server error codes

Some common codes are:

  • 100 - Continue
  • 200 - OK
  • 204 - No Content
  • 301 - Moved Permanently
  • 403 - Forbidden
  • 404 - Not Found
  • 503 - Service Unavailable

These codes tell you what is happening in the server with respect to the request. Now, HTTP has evolved over the years, and the later versions came with their own solutions and problems. In the next article, we will dive into those differences as well as explain the structure and protocol stack of the HTTP protocol. We would see what a HTTP frame looks like, see examples of HTTP request & response messages, and look at the new (but not new) protocol that caused a buzz this year.

Don't forget to subscribe to the newsletter, like the article and share it with others.

Oluwabunmi Nathan Alabi

Systems Network Administrator at Aztec Microfinance Bank

2 年

Great content!

回复
Chiamaka Ugwu

Electronics and Computer Engineering Graduate| Frontend Engineer| Ex-lead Blockchain Uniport

2 年

A good read, well done ????

Oyindobra Agberebi

Frontend Developer | Flutter Developer | Team Lead Go'cipe

2 年

This is a very useful resource. Thank you

Claire Gbobie

Brand and Product Designer | Exploring Control Engineering Innovations | Creative Problem Solver | MTN Foundation Scholar

2 年

Interesting content??, worth the read

要查看或添加评论,请登录

Chidiadi Anyanwu的更多文章

  • Route Tables: Cloud & Networking

    Route Tables: Cloud & Networking

    One of the major mechanisms through which routing works is the route table. Route tables exist both in traditional…

  • How Domain Name System (DNS) Works

    How Domain Name System (DNS) Works

    DNS is something the internet lives and breathes on. It is one of the fundamental technologies that makes our present…

    1 条评论
  • Is HTTP A Networking Protocol (Pt 2) - The Evolution of HTTP

    Is HTTP A Networking Protocol (Pt 2) - The Evolution of HTTP

    In the last article, we introduced HTTP, talked about its working principle, methods and status codes. Now, we want to…

  • The Point-to-Point Protocol

    The Point-to-Point Protocol

    The Point-to-Point Protocol (PPP) is one of many protocols used in Wide Area Network (WAN) connections. It is a…

    6 条评论
  • VPN Technologies - IPSec

    VPN Technologies - IPSec

    In my last article, we talked about GRE, its features and principles, its configuration and why it is usually used with…

  • VPN Technologies - Generic Routing Encapsulation (GRE)

    VPN Technologies - Generic Routing Encapsulation (GRE)

    Virtual Private Networks (VPN) are private networks built on top of public networks. These networks are called logical…

  • The Common, But Nameless Network Protocol

    The Common, But Nameless Network Protocol

    Unlike other protocols I’ve encountered in networking, there is one that people know but can't really tell you the…

    1 条评论
  • Virtual Local Area Network (VLAN)

    Virtual Local Area Network (VLAN)

    The concept of VLANs can be explained from two viewpoints; the viewpoint of scaling and that of isolation. I’ll explain.

  • The Dynamic Host Configuration Protocol (DHCP)

    The Dynamic Host Configuration Protocol (DHCP)

    Using the internet shouldn’t be so easy. You have to obtain an IP Address, configure it, configure your network…

    2 条评论
  • IP Addressing

    IP Addressing

    For hosts to communicate in a network, there are a couple of considerations. They need to identify who they want to…

    2 条评论

社区洞察

其他会员也浏览了