Course outline
- 01How a computer works
- 02How the Internet works
- 03Introducing the GPU
- 04Tensors and models
- 4.1What is a tensor?soon
- 4.2What is an AI model?soon
- 4.3Training vs inferencesoon
- 05Splitting work across GPUs
- 5.1Why split work across GPUs?soon
- 5.2Data parallelismsoon
- 5.3Tensor parallelismsoon
- 5.4Pipeline parallelismsoon
- 5.5Expert parallelismsoon
- 5.6Which to use whensoon
- 06Serving LLMs with vLLM
- 6.1What is LLM serving?soon
- 6.2Meet vLLMsoon
- 6.3Serving a model with vLLMsoon
Lesson 2.4
Client and server: opening a website
What happens, step by step, between typing a web address and seeing the page.
In one line
When you open a website, your browser (the client) finds the website’s computer (the server), asks it for the page, and the server sends it back.
Real-life analogy
A customer walks into our restaurant and orders from the menu. The kitchen prepares the order and sends out the plate.
On the web, your browser is the customer: it asks. The server is the kitchen: it prepares and sends. The order is called a request, and the plate is called a response.
Where the comparison stops working: a customer has to wait for a table. A busy web server can serve a huge number of customers at the same time, and it never gets tired. And in a restaurant you usually get one plate per order, but one web page often needs dozens of separate requests: one for the text, others for each picture, font and style.
Diagram
Step by step
You now know about IP addresses, DNS and packets. Let’s put them all together. What really happens when you type example.com and press Enter?
Meet the client and the server
- A client is the computer (and program) that asks for something. Your browser on your phone or laptop is a client.
- A server is a computer that stores the website and answers requests. It usually sits in a data centre and runs all day and night.
Step 1: look up the name
Your browser asks DNS for the IP address of example.com (lesson 2.2). Now it knows which computer to talk to.
Step 2: connect and send a request
Your browser opens a connection to the server at that address. Then it sends a request that says, in effect, “please give me your home page”.
This request is written in a language called HTTP (or HTTPS, the secure, encrypted version you see in most addresses). A simple request starts like this:
GET / HTTP/1.1
Host: example.com
GET means “give me”, and / means “the home page”.
Step 3: the server sends a response
The server works out what you asked for and sends back a response. It starts with a status code, a short number that says how it went:
| Code | Meaning in plain words |
|---|---|
| 200 | OK, here it is |
| 404 | Not found: there is nothing at that address |
| 503 | Sorry, too busy (or closed for maintenance), try again later |
After the status code comes the page itself. All of this travels back to you as packets (lesson 2.3).
Step 4: the browser draws the page
The first response is usually the page’s main text and layout. It tells your browser it also needs pictures, styles and other files. So the browser sends more requests for those, and the server answers each one.
Finally, the browser puts everything together and draws the page on your screen.
Key takeaways
- The client (your browser) asks; the server (the website’s computer) answers.
- The steps are: DNS lookup, connect, request, response, draw the page.
- Requests and responses use HTTP (HTTPS when encrypted).
- A status code like 200, 404 or 503 tells you how the request went.
Recap: a customer orders, the kitchen cooks, the plate comes out. A browser requests, a server responds, the page appears.
Now you understand what happens when you open a website. Next, we will step inside the server and see what its CPU and memory do when many people arrive at once.
Quick check
Pick an answer, then press Check answer. Nothing is recorded.
Sources
This lesson was checked against these pages.
- How the web works · MDN Web Docs
- DNS (glossary) · MDN Web Docs
- Packet (glossary) · MDN Web Docs