Timely delivery

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

Timely delivery

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A live video call is running. Which approach suits it better?
A Timely delivery: skip lost packets and keep going
B Guaranteed delivery: pause until every lost packet is resent
2. What does timely delivery mean?
A Data arrives quickly enough to be useful, even if some packets are lost
B Every packet is guaranteed to arrive, no matter how long it takes
3. In an online game, a packet showing where a player was 2 seconds ago arrives late. What should happen?
A The game freezes until the packet is processed
B It is skipped, because the game has moved on
4. What is the trade-off when you choose timely delivery?
A You gain speed but may lose some packets
B You gain a guarantee that every packet arrives but lose speed
5. Which activity needs guaranteed delivery more than timely delivery?
A Talking to a friend on a live voice call
B Downloading a file where every byte must be correct

Match the Pairs

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

Left columnRight column
1timely delivery ALate or missing packets are skipped rather than resent, so the call keeps running in real time
2UDP for a live video call BThis applies guaranteed delivery to a live call. Waiting for resends makes the audio late and useless. Timely delivery skips lost packets to keep up.
3In an online game, a packet arriving late is worthless, so it is better to skip it than wait for a resend Cif packet.arrivedLate: discard(packet)
4Guaranteed delivery resends lost packets, which adds delay, so timely delivery trades it away for speed Dresend_lost_packets = False
5Live call: pause audio until every lost packet is resent so nothing is missed EData arrives quickly enough to still be useful, even if some packets are lost along the way
6Timely delivery means every single packet must arrive, however long it takes FThis describes guaranteed delivery. Timely delivery means data arrives quickly enough to be useful, even if some packets are lost.

Definitions

timely delivery

Fill in the Blanks

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

1.
_____ callActive: packet = receive() play(packet)
2.
for packet in callStream: if packet.late: ________
3.
gameMode = "live" resendLost = _____
4.
if mode == "live": protocol = "___"
5.
if arrivalTime _ deadline: drop(packet)

Spot the Error

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

Question 1
A deadline_ms = 150
B delay_ms = 200
C if delay_ms < deadline_ms:
D skip_packet()
Question 2
A protocol = "FTP"
B call_type = "live"
C if call_type == "live":
D use(protocol)
Question 3
A for packet in stream:
B if packet.on_time:
C continue
D play(packet)
Question 4
A lost = 3
B total = 100
C loss_pct = total / lost * 100
D print(loss_pct)
Question 5
A def handle(packet):
B if packet.late:
C resend(packet)
D else:
E play(packet)

Answer Key

Timely delivery
Section A: Quick Questions
Q1
A — Timely delivery: skip lost packets and keep going
Q2
A — Data arrives quickly enough to be useful, even if some packets are lost
Q3
B — It is skipped, because the game has moved on
Q4
A — You gain speed but may lose some packets
Q5
B — Downloading a file where every byte must be correct
Section B: Match the Pairs
Q1
timely delivery → Data arrives quickly enough to still be useful, even if some packets are lost along the way
Q2
UDP for a live video call → Late or missing packets are skipped rather than resent, so the call keeps running in real time
Q3
In an online game, a packet arriving late is worthless, so it is better to skip it than wait for a resend → if packet.arrivedLate: discard(packet)
Q4
Guaranteed delivery resends lost packets, which adds delay, so timely delivery trades it away for speed → resend_lost_packets = False
Q5
Live call: pause audio until every lost packet is resent so nothing is missed → This applies guaranteed delivery to a live call. Waiting for resends makes the audio late and useless. Timely delivery skips lost packets to keep up.
Q6
Timely delivery means every single packet must arrive, however long it takes → This describes guaranteed delivery. Timely delivery means data arrives quickly enough to be useful, even if some packets are lost.
Section C: Definitions
Q1
timely delivery — Data arrives quickly enough to be useful, even if some packets are lost. Live calls and games favour speed over guaranteed delivery, so late or missing packets are skipped, not resent.
Section D: Fill in the Blanks
Q1
while callActive: packet = receive() play(packet)
Q2
for packet in callStream: if packet.late: continue
Q3
gameMode = "live" resendLost = False
Q4
if mode == "live": protocol = "UDP"
Q5
if arrivalTime > deadline: drop(packet)
Section E: Spot the Error
Q1
C — The comparison is the wrong way round. It would skip packets that arrive on time. A packet is skipped when its delay is greater than the deadline: if delay_ms > deadline_ms:
Q2
A — FTP is for transferring files and guarantees delivery. Live calls need timely delivery, so they use a fast protocol such as UDP. It should be protocol = "UDP".
Q3
B — The condition checks for on-time packets, so the loop would skip good packets and play late ones. It should check packet.late so that late packets are skipped.
Q4
C — The division is upside down. Packet loss is lost divided by total, then multiplied by 100. It should be loss_pct = lost / total * 100.
Q5
C — In timely delivery a late packet is skipped, not resent. A resent packet would arrive even later and be useless in a live call. It should be drop(packet).