How Does the Internet Actually Work?

Updated

Backend4Dummies is a series of articles breaking down fundamental concepts in Backend Development in the simplest terms possible. It is both a tool for my own understanding, which I reference when I'm at my most confused, and my attempt to teach those who are new to these concepts.

With software concepts, I generally find high-strung theory clarifying after I understand its application. Meaning that in these articles, I'll take an “example first, theory later” approach.

The first question I'd like to begin with is:

How does the internet actually work? As in, what is actually going on when I type in a website URL and I'm magically transported to a new website? I think even the most “shallow” explanation of the client-server model will pay dividends in your understanding of the internet, so let's begin!

The client-server model

Source: MDN, How the web works

I want you to imagine a web, and on this web there are nodes and connections between them. The Internet is this entire web, and computers and other networked devices are the nodes.

For a web request, it is useful to talk about two roles: client and server. These names describe what the programs are doing in that interaction; they are not permanent labels for every computer connected to the internet.

When you (through a browser acting as the client) try to connect to another website, the browser sends requests to a server. Servers are programs running on computers that respond with resources such as HTML, CSS, JavaScript, images, or data. The browser uses those resources to render the page displayed to you.

For websites, much of this communication happens through HTTP requests and responses. (The internet also carries plenty of traffic that is not HTTP.)

The client initiates the request. It's you googling “free flights” at 12 a.m.

The server receives that request and sends a response.

To be clear, the same machine or program can act as a client in one interaction and a server in another. The distinction is about who initiates a particular request and who responds to it.