Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ When you type a web address (which is technically part of a [URL](#components_of

1. The browser goes to the DNS server and finds the real address of the server that the website lives on (you look up the address of the shop).
2. The browser sends an HTTP request message to the server, asking it to send a copy of the website to the client (you go to the shop and order your goods). This message, and all other data sent between the client and the server, is sent across your internet connection using TCP/IP.
3. If the server approves the client's request, the server sends the client a "200 OK" message, which means "Of course you can look at that website! Here it is", and then starts sending the website's files to the browser as a series of small chunks called [data packets](#packets_explained) (the shop gives you your goods, and you bring them back to your house).
3. If the server approves the client's request, the server sends the client a "200 OK" message, which means "Of course you can look at that website! Here it is", and then starts sending the website's files to the browser as a series of small chunks called [packets](#packets_explained) (the shop gives you your goods, and you bring them back to your house).
4. The browser assembles the small chunks into a complete web page and displays it to you (you get the goods home — new shiny stuff, awesome!).

## DNS explained
Expand All @@ -93,12 +93,18 @@ Let's look up the MDN IP address now, and prove that it points to the same place

## Packets explained

Earlier we used the term "packets" to describe the format in which the data is transferred between the client and server. What do we mean here?
Earlier, we used the term "packets" to describe the format in which the data is transferred between the client and server. What do we mean here?

Basically, when data is sent across the web, it is sent in thousands of small chunks. There are multiple reasons why data is sent in small packets, but most significantly:
When data is sent across the web, it is sent in several small chunks called packets. Each packet contains:

- They are sometimes dropped or corrupted and, when this happens, it's quicker and easier to replace small chunks than entire files.
- Additionally, the packets can be routed along different paths, making the exchange faster and allowing many different users to download the same website at the same time. If each website was sent as a single big chunk, only one user could download it at a time, which would make the web very inefficient and not much fun to use.
- A **header**, which includes details such as the server and client IP address, the packet number, the total number of packets in the transmission, and details of the protocols used in the transmission.
- A **payload**, which contains the actual data sent in the packet.

There are multiple reasons why data is sent in small packets, but most significantly:

- They are sometimes dropped or corrupted, and when this happens, it's quicker and easier for the client to request the missing packets rather than an entire file.
- The packets can be routed along different paths, making the transmission as efficient as possible and reducing the possibility of slowing down the network, especially when many users are requesting the same resource simultaneously. The packets may arrive out of sequence, but the client can use the information in the packet headers to make sure they are assembled in the correct order.
- It is harder to steal user data when transmitted in packets, as each packet contains minimal data and is transmitted separately.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unlikely to me. Hard to imagine an attack that steals one packet but not more.

Copy link
Contributor Author

@chrisdavidmills chrisdavidmills Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed kinda unlikely to me as well, but I read quite a few packet definitions elsewhere that mentioned something along these lines.

I mean, it sounds vaguely plausible from the outset, but knowing what I know about how web security breaches occur, it probably isn't worth bringing up. I put it here in case anyone else had any thoughts. Happy to delete.


## HTTP basics

Expand Down