Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1packet_number = 3 | AThe packet number and the total number of packets, so the receiver knows this is the third of ten and how many to expect | |
| 2packet 3 of 10 | BThis packet is the third packet in the message, so it goes after packets 1 and 2 when the message is rebuilt | |
| 3Packets can arrive out of order, so the packet number is used to put them back in the correct order | CThe message must not be read in arrival order. The packet numbers should be used to reorder the packets as 1, 2, 3, 4 first. | |
| 4The packet number is stored in the packet header, not in the payload | Dheader = {"packet_number": 3} payload = "data" | |
| 5Packets arrive 4, 2, 1, 3, so the message is read in the order they arrived | EThe packet number shows the packet's position in the message, not the size of its data. It means this is the third packet. | |
| 6Packet number = 3 means the packet contains 3 bytes of data | Farrived = [3, 1, 2] sorted(arrived) # [1, 2, 3] |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
packet number — A number in the packet header showing the packet's position in the whole message (e.g. packet 3 of 10), so packets that arrive out of order can be put back in the right order.packetNumber ← 3
totalPackets ← 10OUTPUT packetNumber, "of", totalPacketspackets ← [3, 1, 2]
SORT packets BY packetNumber ASCENDINGIF packetNumber = 3 THEN
OUTPUT "Packet 3 arrived"
ENDIFtotalPackets ← 10
FOR packetNumber ← 1 TO totalPackets
NEXT packetNumber