Why data is broken down into packets

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Why data is broken down into packets

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Why is a large file split into packets before it is sent across a network?
A So it can be sent in small, manageable pieces
B So it can be sent as one single block
2. A 20 MB video is sent over a network. What happens to the video?
A It is sent whole as a single packet
B It is split into many numbered packets
3. Which statement about packets and the network is correct?
A Small packets from many users can share the network at the same time
B One large file must use the whole network until it has finished
4. One packet of a file is lost on the way. What needs to be resent?
A Only the lost packet
B The whole file from the start
5. Why is each packet given a number?
A So the packet travels faster than the others
B So the pieces can be put back in order and a missing one can be spotted

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1packet ANumbers a piece of the file so the pieces can be put back in order at the destination
2packet_number = 3 Bpacket 7 lost -> resend packet 7
3A large file is split into numbered pieces before it is sent CA small piece of a larger file, sent across the network on its own
4If one packet is lost, only that packet is resent, not the whole file Dfile (12 MB) -> packet 1, packet 2, packet 3 ... packet 12
5packet 5 lost -> resend whole file EOnly the lost packet needs to be resent. Resending the whole file wastes time and network capacity.
6One 500 MB file sent as one piece, so it takes over the network until it is done FA large file sent as a single piece blocks other users. Packets let many users share the network.

Definitions

packet

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
packets ← _____(file, 100)
2.
FOR number ← 1 TO 5 SEND(packets[______]) NEXT number
3.
IF packetLost = TRUE THEN ______(packetNumber) ENDIF
4.
totalPackets ← fileSize ___ packetSize
5.
WHILE packetNumber <= totalPackets SEND(packets[packetNumber]) packetNumber ← packetNumber _ 1

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A total ← 1200
B size ← 100
C packets ← total * size
D OUTPUT packets
Question 2
A FOR n ← 1 TO 5
B packet.number ← n
C packet.data ← piece[n]
D SEND file
E NEXT n
Question 3
A FOR n ← 1 TO 10
B IF ack[n] = FALSE THEN
C lostCount ← lostCount + 1
D RESEND file
E ENDIF
F NEXT n
Question 4
A IF fileSize < packetSize THEN
B SPLIT file INTO packets
C SEND each packet
D ENDIF
Question 5
A FOR n ← 1 TO count
B packet[n].number ← 1
C SEND packet[n]
D NEXT n

Answer Key

Why data is broken down into packets
Section A: Quick Questions
Q1
A — So it can be sent in small, manageable pieces
Q2
B — It is split into many numbered packets
Q3
A — Small packets from many users can share the network at the same time
Q4
A — Only the lost packet
Q5
B — So the pieces can be put back in order and a missing one can be spotted
Section B: Match the Pairs
Q1
packet → A small piece of a larger file, sent across the network on its own
Q2
packet_number = 3 → Numbers a piece of the file so the pieces can be put back in order at the destination
Q3
A large file is split into numbered pieces before it is sent → file (12 MB) -> packet 1, packet 2, packet 3 ... packet 12
Q4
If one packet is lost, only that packet is resent, not the whole file → packet 7 lost -> resend packet 7
Q5
packet 5 lost -> resend whole file → Only the lost packet needs to be resent. Resending the whole file wastes time and network capacity.
Q6
One 500 MB file sent as one piece, so it takes over the network until it is done → A large file sent as a single piece blocks other users. Packets let many users share the network.
Section C: Definitions
Q1
packet — A small piece of a larger file. Data is split into numbered packets so they share the network and a lost packet can be resent instead of the whole file.
Section D: Fill in the Blanks
Q1
packets ← SPLIT(file, 100)
Q2
FOR number ← 1 TO 5 SEND(packets[number]) NEXT number
Q3
IF packetLost = TRUE THEN RESEND(packetNumber) ENDIF
Q4
totalPackets ← fileSize DIV packetSize
Q5
WHILE packetNumber <= totalPackets SEND(packets[packetNumber]) packetNumber ← packetNumber + 1
Section E: Spot the Error
Q1
C — The number of packets is the file size divided by the packet size, so it needs DIV (1200 DIV 100 = 12). Multiplying gives a meaningless number.
Q2
D — Each loop should send one small numbered packet, not the whole file. The line should be SEND packet.
Q3
D — Only the lost packet needs to be sent again, which is the benefit of using packets. It should be RESEND packet[n], not the whole file.
Q4
A — A file only needs splitting when it is larger than the packet size, so the comparison should be >, not <.
Q5
B — Each packet needs its own number so the pieces can be put back in order. The number should be n, not 1 for every packet.