Search
Course outline
  1. 01How a computer works
    1. 1.1What is a computer?(completed)
    2. 1.2The CPU: the brain(completed)
    3. 1.3Memory: RAM vs storage(completed)
    4. 1.4How the CPU and memory work together(completed)
    5. 1.5What happens when you turn on a computer(completed)
  2. 02How the Internet works
    1. 2.1What is the Internet?(completed)
    2. 2.2Addresses and names: IP and DNS(completed)
    3. 2.3Packets: how information travels(completed)
    4. 2.4Client and server: opening a website(completed)
    5. 2.5Inside a busy server(completed)
    6. 2.6Why this matters for AI(completed)
  3. 03Introducing the GPU
    1. 3.1What is a GPU?(completed)
    2. 3.2CPU vs GPU(completed)
    3. 3.3The GPU's own memory: VRAM(completed)
    4. 3.4How the CPU and GPU work together(completed)
    5. 3.5Why GPUs suit AI(completed)
  4. 04Tensors and models
    1. 4.1What is a tensor?soon
    2. 4.2What is an AI model?soon
    3. 4.3Training vs inferencesoon
  5. 05Splitting work across GPUs
    1. 5.1Why split work across GPUs?soon
    2. 5.2Data parallelismsoon
    3. 5.3Tensor parallelismsoon
    4. 5.4Pipeline parallelismsoon
    5. 5.5Expert parallelismsoon
    6. 5.6Which to use whensoon
  6. 06Serving LLMs with vLLM
    1. 6.1What is LLM serving?soon
    2. 6.2Meet vLLMsoon
    3. 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.

beginner 3 min readChecked

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

Client(your browser)DNSServer(the website)1. look up the name2. connect, then request: GET /3. response: 200 OK + the page4. browser drawsthe pageLike a customer (client) ordering from akitchen (server): ask, wait, get served.
The client asks, the server answers. DNS lookup, request, response, then the browser draws the page.

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.

  1. In client and server, which one is your web browser?
  2. What does the status code 404 mean?
  3. What is the right order?

Sources

This lesson was checked against these pages.

  1. How the web works · MDN Web Docs
  2. DNS (glossary) · MDN Web Docs
  3. Packet (glossary) · MDN Web Docs