Negative acknowledgement

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

Negative acknowledgement

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a receiver send when the error check on a packet fails?
A A negative acknowledgement (NAK)
B A positive acknowledgement (ACK)
2. Which statement about a negative acknowledgement is correct?
A It tells the sender the data must be sent again
B It tells the sender the data was received correctly
3. Who sends a negative acknowledgement?
A The receiver
B The sender
4. A receiver finds a parity error in a byte. What should it do?
A Send an ACK and keep the byte
B Send a NAK so the data is resent
5. When the sender gets a NAK, which data does it send?
A New, different data
B The same data again

Match the Pairs

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

Left columnRight column
1NAK AIF message = NAK THEN resend same packet
2IF check fails THEN send NAK BWhen the receiver's error check fails, it sends a negative acknowledgement back to the sender
3A NAK tells the sender to resend the same data because the received data had an error CAfter a NAK the sender must resend the same data, not move on to the next packet, because the first copy arrived with an error.
4The receiver sends a NAK back to the sender only when the error check fails DIF parity check fails THEN send NAK
5IF check passes THEN send NAK EA NAK is sent when the check fails, not when it passes. A pass means the data is fine, so no NAK is needed.
6IF message = NAK THEN send next packet FThe short name for a negative acknowledgement, a message from the receiver saying the data arrived with an error

Definitions

negative acknowledgement

Fill in the Blanks

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

1.
IF errorFound THEN SEND "___" ENDIF
2.
IF errorFound THEN ____ "NAK" ENDIF
3.
IF reply _ "NAK" THEN SEND sameData ENDIF
4.
IF checkOK THEN SEND "ACK" ____ SEND "NAK" ENDIF
5.
IF errorFound = ____ THEN SEND "NAK" ENDIF

Spot the Error

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

Question 1
A receive packet
B check parity of packet
C IF check fails THEN send ACK
D ELSE send ACK
Question 2
A receive packet
B IF error check passes THEN
C send NAK to sender
D ENDIF
Question 3
A receiver gets packet
B error check fails
C sender sends NAK to receiver
D sender resends the same data
Question 4
A sender sends packet 5
B receiver check fails
C receiver sends NAK
D sender sends packet 6
Question 5
A WHILE ACK is received
B resend the same packet
C ENDWHILE

Answer Key

Negative acknowledgement
Section A: Quick Questions
Q1
A — A negative acknowledgement (NAK)
Q2
A — It tells the sender the data must be sent again
Q3
A — The receiver
Q4
B — Send a NAK so the data is resent
Q5
B — The same data again
Section B: Match the Pairs
Q1
NAK → The short name for a negative acknowledgement, a message from the receiver saying the data arrived with an error
Q2
IF check fails THEN send NAK → When the receiver's error check fails, it sends a negative acknowledgement back to the sender
Q3
A NAK tells the sender to resend the same data because the received data had an error → IF message = NAK THEN resend same packet
Q4
The receiver sends a NAK back to the sender only when the error check fails → IF parity check fails THEN send NAK
Q5
IF check passes THEN send NAK → A NAK is sent when the check fails, not when it passes. A pass means the data is fine, so no NAK is needed.
Q6
IF message = NAK THEN send next packet → After a NAK the sender must resend the same data, not move on to the next packet, because the first copy arrived with an error.
Section C: Definitions
Q1
negative acknowledgement — A message (NAK) the receiver sends to the sender when the error check fails, telling it the data arrived with an error so the sender must resend the same data.
Section D: Fill in the Blanks
Q1
IF errorFound THEN SEND "NAK" ENDIF
Q2
IF errorFound THEN SEND "NAK" ENDIF
Q3
IF reply = "NAK" THEN SEND sameData ENDIF
Q4
IF checkOK THEN SEND "ACK" ELSE SEND "NAK" ENDIF
Q5
IF errorFound = TRUE THEN SEND "NAK" ENDIF
Section E: Spot the Error
Q1
C — When the error check fails the receiver must send a negative acknowledgement (NAK), not a positive one (ACK). It should be: IF check fails THEN send NAK.
Q2
B — A NAK is only sent when the error check fails. The condition should be: IF error check fails THEN.
Q3
C — The receiver sends the NAK to the sender, not the other way round. It should be: receiver sends NAK to sender.
Q4
D — After a NAK the sender must resend the same data, which is packet 5. Sending packet 6 would skip the damaged packet. It should be: sender resends packet 5.
Q5
A — The packet is resent only while a NAK keeps coming back, meaning the data arrived with an error. The loop should test for NAK, not ACK.