NACK (NAK, negative acknowledgment, not acknowledged)
What is NACK (NAK, negative acknowledgment or not acknowledged)?
NACK, or NAK, an abbreviation for negative acknowledgment or not acknowledged, is a signal used by computers or other devices to indicate that data transmitted over a network was received with errors or was otherwise unreadable.
NACK is sometimes conflated with automatic repeat request (ARQ) or with the rejected (REJ) message, though the terms differ.
An ARQ is usually implemented in a protocol as a way to automatically trigger a retransmission of data that was not received in the time expected.
For example, in Transmission Control Protocol (TCP), an ARQ can be initiated based on the expected network latency -- how long it takes for a message to arrive at the destination plus the time for an acknowledgement to be received. If a signal is not ACKed (acknowledged) in the expected time, the signal is re-sent.
A NACK is an explicit protocol message sent by a recipient to report that a specific, expected signal must be re-sent for some reason. Protocols that use NACK messages often include the ability to report on the reason the message is being NACKed.
A REJ is a protocol message sent by a recipient to indicate that a signal was received but that the signal is not being accepted for a variety of reasons, such as the following:
- checksum failure;
- incomplete data;
- improperly formatted data;
- invalid or malformed headers; or
- signal was not expected or not part of an ongoing circuit.
In some protocols, a REJ has the same function as a NACK.
How do NAKs work?
In data communications protocols, a NACK or REJ message can be sent by the recipient of a signal back to the sender to indicate that the signal was not received or not valid and should be retransmitted.
NACK messages can be a part of any type of communication protocol. Examples of protocols that use NACKs are the following:
- Data link layer protocols. For example, High-level Data Link Control uses REJ messages as NACKs.
IBM's Binary Synchronous Communication, also known as BSC or BISYNC, link protocol uses a NAK message for negative acknowledgement. BSC was introduced in the 1960s and may still be in use on legacy systems.
Point-to-Point Protocol uses forms of both NACK and REJ messages. The Configure-Nak message indicates that a request for specific configuration options includes unacceptable options; the Configure-Rej message indicates that some options are not recognized as options.
NACKs can also be used for detecting errors and packet loss. For example, in reliable multicast, a NACK is sent only when the receiver identifies a lost packet.
- Application layer protocols. For example, the protocol for the Society for Worldwide Interbank Financial Telecommunication includes ACK and NACK messages for explicitly acknowledging that a message was -- or was not -- received. Dynamic Host Configuration Protocol uses a negative acknowledgement message -- DHCPNAK -- when a client request for a network address uses an incorrect network subnet or an expired Internet Protocol address.
- Physical layer protocols. For example, the Inter-Integrated Circuit serial communication bus designed by Philips Semiconductors, uses a NACK bit to indicate negative acknowledgement.
- Transport layer protocols. For example, Microsoft's DirectPlay network communication library for game development includes a NACK message for flow control.
Windows Deployment Services Multicast Transport Protocol, which is used to send content to multiple recipients, using Multicast User Datagram Protocol, also includes a NACK message.
When a sender receives a NACK message, the response from the sender is usually to re-send the signal, but the actual response depends on the protocol specification. Many protocols apply checksums to messages to enable recipients to verify the integrity of the message header and payload. If a message has been corrupted in transit, the recipient may reply with a NACK message.
When the sender receives a NACK or REJ signal in response to its transmission, it repeats the block of data until the destination device recognizes the data and responds with an ACK signal, unless the sender stops transmitting entirely.
There are special American Standard Code for Information Interchange, or ASCII, characters reserved for signals for NAK, REJ and ARQ so they are not confused with data characters. However, these characters may or may not be used in protocols to signify a NACK message.
Acknowledgements in TCP
TCP does not ordinarily use an explicit NACK message to initiate a retransmission of a dropped or damaged message. TCP has four different congestion control mechanisms, which are used in TCP to cope with changing network conditions that might cause a segment to be dropped or not received.
If a TCP frame -- the basic unit of TCP-transmitted data -- is not received, rather than depending on the recipient requesting retransmission of the dropped message, the sender keeps track of which messages have been received, and if there are any that have not been ACKed within the expected round-trip time, the sender just re-sends them.
A negative acknowledgement protocol message was defined for TCP, but it was intended for special cases, such as communicating with satellites -- high latency, potentially low bandwidth -- and is now obsolete.