A big file in many boxes
An analyst downloads a file of sales records. The server does not send it in one go. It cuts the file into small numbered pieces. Each piece has a label. The pieces go by different routes and arrive in a mixed order.
Your computer uses the numbers to put the file back together.
Key words
| Word | What it means |
|---|---|
| Packet | a small piece of a message, with its own labels |
| Header | the labels at the front of a packet |
| Payload | the piece of the message a packet carries |
| Trailer | the part at the end of a packet, with a check value |
| Packet switching | sending packets by whatever route is free, then rebuilding the message |
| Sequence number | a number that says where a packet fits in the message |
| TTL | time to live: a count that stops a packet travelling for ever |
| Router | a device that joins networks and passes packets on |
| IP address | a number that names a device on a network |
| Ethernet | the usual wired way to join devices in a building |
| Network | devices joined so they can share things |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can describe what a packet holds and how packet switching sends a message.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Small packets are easier to send
A big message is cut into many small packets. Each packet is sent on its own. If one is lost, only that small piece is sent again.
Small packets also let many people share one line. Each person's packets take turns, so no one waits for a huge file to finish.
What is inside a packet
| Part | What it holds | What it is for |
|---|---|---|
| Header: source address | The IP address of the sender | So the reply knows where to go |
| Header: destination address | The IP address of the receiver | So routers know where to send it |
| Header: sequence number | The place of this packet in the message | So the message can be put back in order |
| Header: TTL | A count that goes down at each router | So a lost packet does not travel for ever |
| Payload | A piece of the message | The data you actually want |
| Trailer | A check value | So the receiver can spot damage |
The cells students fill in are left blank in this preview.
A note about the trailer
Note
Strictly, an IP packet has no trailer. The check value sits in the trailer of the Ethernet frame that carries the packet. This course treats a packet as a header, a payload and a trailer, as the specification does. The sequence number is really in the TCP header.
Try it: cut a file into packets
message = "ORDERS-2026"
size = 4
start = 0
number = 1
while start < len(message):
print(str(number) + ":" + message[start:start + size])
number = number + 1
start = start + size
# Change size to 3 and press Run.
# How many packets do you get now?Check
Have a go
Check
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.