Automatic repeat query (ARQ)

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

Automatic repeat query (ARQ)

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does ARQ stand for?
A Automatic repeat query
B Automatic receive question
2. In ARQ, who checks the received data for errors?
A The receiver, using a check such as parity or a checksum
B The sender, before it has even sent the data
3. Data arrives and the error check fails. What does the receiver do in ARQ?
A Sends a positive acknowledgement and keeps the bad data
B Sends a negative acknowledgement so the data is resent
4. The sender sends a packet and no reply comes back before the timeout ends. What does ARQ do?
A The sender automatically resends the packet
B The sender assumes it arrived and moves on
5. Which statement about ARQ is correct?
A The sender sends each packet once and never resends it
B The sender resends until the data is received correctly

Match the Pairs

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

Left columnRight column
1ARQ AIn ARQ the receiver must reply. If no reply arrives before the timeout, the sender resends rather than assuming success
2IF error_found THEN SEND NAK BWHILE reply <> ACK SEND data ENDWHILE
3The sender waits for a reply after sending, and resends automatically if no reply arrives before the timeout CThe receiver checks the data (e.g. with parity or a checksum) and, if it finds an error, replies with a negative acknowledgement so the sender resends
4The sender keeps resending until the receiver confirms the data was received correctly with a positive acknowledgement DREPEAT SEND data WAIT timeout UNTIL reply_received
5Receiver gets bad data -> receiver says nothing -> sender assumes it was fine and stops EAutomatic repeat query: the receiver replies to say if data arrived without error, and the sender automatically resends data that did not
6Receiver detects an error -> receiver fixes the data itself -> no resend needed FARQ does not correct errors at the receiver. The receiver only detects the error and replies, and the sender resends the data

Definitions

ARQ

Fill in the Blanks

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

1.
SEND packet ____ FOR reply IF reply = NAK THEN SEND packet
2.
REPEAT SEND packet UNTIL reply = ___
3.
IF errorFound = TRUE THEN SEND ___ ELSE SEND ACK
4.
SEND packet IF no reply within _______ THEN SEND packet
5.
SEND packet WHILE reply __ ACK RESEND packet

Spot the Error

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

Question 1
A WHILE
B SEND packet
C WAIT for reply
D UNTIL reply = ACK
Question 2
A SEND packet
B WAIT for reply
C IF reply = NAK THEN
D DISCARD packet
Question 3
A RECEIVE packet
B IF parity is wrong THEN
C SEND ACK
D ELSE SEND NAK
Question 4
A SEND packet
B START timer
C IF ACK received THEN
D SEND packet again
Question 5
A RECEIVE data and checksum
B CALCULATE new parity bit
C IF new = received THEN
D SEND ACK

Answer Key

Automatic repeat query (ARQ)
Section A: Quick Questions
Q1
A — Automatic repeat query
Q2
A — The receiver, using a check such as parity or a checksum
Q3
B — Sends a negative acknowledgement so the data is resent
Q4
A — The sender automatically resends the packet
Q5
B — The sender resends until the data is received correctly
Section B: Match the Pairs
Q1
ARQ → Automatic repeat query: the receiver replies to say if data arrived without error, and the sender automatically resends data that did not
Q2
IF error_found THEN SEND NAK → The receiver checks the data (e.g. with parity or a checksum) and, if it finds an error, replies with a negative acknowledgement so the sender resends
Q3
The sender waits for a reply after sending, and resends automatically if no reply arrives before the timeout → REPEAT SEND data WAIT timeout UNTIL reply_received
Q4
The sender keeps resending until the receiver confirms the data was received correctly with a positive acknowledgement → WHILE reply <> ACK SEND data ENDWHILE
Q5
Receiver gets bad data -> receiver says nothing -> sender assumes it was fine and stops → In ARQ the receiver must reply. If no reply arrives before the timeout, the sender resends rather than assuming success
Q6
Receiver detects an error -> receiver fixes the data itself -> no resend needed → ARQ does not correct errors at the receiver. The receiver only detects the error and replies, and the sender resends the data
Section C: Definitions
Q1
ARQ — Automatic repeat query: the receiver checks data for errors and replies. If the data is bad or no reply arrives, the sender automatically resends it until it is received correctly.
Section D: Fill in the Blanks
Q1
SEND packet WAIT FOR reply IF reply = NAK THEN SEND packet
Q2
REPEAT SEND packet UNTIL reply = ACK
Q3
IF errorFound = TRUE THEN SEND NAK ELSE SEND ACK
Q4
SEND packet IF no reply within timeout THEN SEND packet
Q5
SEND packet WHILE reply <> ACK RESEND packet
Section E: Spot the Error
Q1
A — The loop ends with UNTIL, so it must start with REPEAT. The sender keeps resending until an ACK arrives. Line 1 should be REPEAT.
Q2
D — A NAK tells the sender the data arrived with an error. ARQ means the sender automatically resends it, so line 4 should be SEND packet again.
Q3
B — The receiver should send an ACK only when the parity check passes. Line 2 should be IF parity is correct THEN. As written, bad data would be acknowledged.
Q4
C — The packet should be resent when no reply arrives before the timeout. Resending after an ACK is pointless. Line 3 should be IF no reply by timeout THEN.
Q5
B — The receiver must recalculate the checksum using the same method as the sender, so it can compare the two values. Line 2 should be CALCULATE new checksum.