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.3
Packets: how information travels
Big messages are cut into small labelled pieces that travel separately and are put back together.
In one line
Information on the Internet travels as packets: small pieces, each with a label saying where it is going, that are put back together at the other end.
Real-life analogy
Imagine the restaurant needs to send a big order of 300 meals across town. One giant van would block the road, and if it broke down, everything would be lost.
So instead, the meals are packed into many small boxes. Each box gets a label: to this address, from this restaurant, box 17 of 30. The boxes go out on many bikes, maybe along different streets. At the other end, someone checks the numbers and puts the order back together. If box 17 never arrives, they ask for just box 17 again.
That is exactly how packets work.
Where the comparison stops working: real boxes travel at the speed of traffic. Packets travel extremely fast, and a router passes on huge numbers of them every second. Also, unlike a box, a lost packet does not leave a hungry customer: it is usually just sent again automatically.
Diagram
Step by step
You send a photo to a friend. It feels like the photo just jumps from your phone to theirs. What really happens on the way?
Step 1: cut into pieces
Your phone does not send the photo as one big lump. It cuts it into many small chunks, called packets.
Step 2: label every piece
Each packet has two parts:
- a header: the label. It says where the packet is going, where it came from, and which piece it is (for example, piece 2 of 3).
- a payload: the actual piece of your photo.
Step 3: travel, maybe by different roads
The packets head out onto the Internet. At every router, the router reads the header and sends the packet one step closer to its destination.
Here is the surprising part: packets from the same photo might take different routes. If one road is busy, a router can send the next packet a different way.
Step 4: arrive, maybe out of order
Because they can take different roads, packets can arrive in any order: piece 3, then piece 1, then piece 2.
Step 5: put back together
Your friend’s phone uses the numbers in the headers to put the pieces back in the right order, rebuilding the photo exactly as it was.
What if a packet gets lost?
Sometimes a packet is lost or damaged on the way. The receiving computer notices a piece is missing (or broken) and asks for just that piece to be sent again. No need to resend the whole photo.
Why bother with packets?
- Sharing: many people’s packets can share the same roads at the same time, so no one blocks the network.
- Flexibility: if one route is busy or broken, packets can go around it.
- Reliability: a lost piece can be resent on its own.
Key takeaways
- Messages are cut into small pieces called packets.
- Each packet has a header (the label: to, from, which piece) and a payload (the content).
- Packets can take different routes and arrive in any order.
- The receiver reassembles them and asks again for any piece that went missing.
Recap: one huge order becomes many small numbered boxes, sent on many bikes, checked and rebuilt at the other end.
Now you understand how information really travels across the Internet. Next, we will put everything together and follow what happens when you open a website.
Quick check
Pick an answer, then press Check answer. Nothing is recorded.
Sources
This lesson was checked against these pages.
- Packet (glossary) · MDN Web Docs
- How the web works · MDN Web Docs