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 | |
|---|---|---|
| 1timeout = 5 | Asend(packet) start_timer() | |
| 2IF no ACK within timeout THEN resend | BA timeout also happens when the acknowledgement is lost. The sender cannot tell the difference, so it resends. | |
| 3The timer starts at the moment the data is sent | CIf no reply arrives in time, the sender sends the data again | |
| 4The sender can stop resending after a set number of tries | DIF tries = 3 THEN stop | |
| 5The sender resends the data as soon as it has sent it, without waiting for the timeout | EThe sender will wait 5 seconds for an acknowledgement before it assumes the data was lost | |
| 6A timeout only happens when the data is lost, never when an acknowledgement is lost | FThe sender must wait for the whole timeout period first. It only resends if no acknowledgement arrives in that time. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
timeout — The set time a sender waits for an acknowledgement after sending data. If none arrives in time, it assumes the data was lost and resends it.SEND packet
START timerIF timer > timeout THEN
RESEND packet
ENDIFIF ack = FALSE AND timer > timeout THEN
RESEND packet
ENDIFtries ← tries + 1
IF tries = max_tries THEN
STOPWAIT timeout seconds
IF ack = FALSE THEN
RESEND packet