NACK (Negative Acknowledgement) is an important error resiliency mechanism in WebRTC, where the receiving endpoint explicitly requests the retransmission of a missing packet from the sender to recover from packet loss and ensure high-quality real-time media. This improves video and audio quality on unreliable networks.
It is one of the error resiliency mechanisms in WebRTC, serving as a way for the receiving end to indicate it hasn’t received a specific packet.
A NACK message is sent over RTCP to the sender of the media, which in turn needs to decide if it will retransmit the lost packet based on its availability in its cache and its estimate to the usefulness of the retransmission (will it be possible to use it once received).
What is NACK? Mechanism of NACK
The mechanism of NACK is straightforward yet crucial for maintaining the quality of the communication link. When a receiver detects the absence of a specific packet, e.g. by observing a gap in the RTP sequence number of the packets received, it forms a NACK message with a list of sequence numbers it considered missing and would like to have retransmitted.
This message is then transmitted over RTCP to the sender of the media. The responsibility now lies on the sender to evaluate the request for retransmission.
Decision on Retransmission
Upon receiving a NACK message, the sender has to make a calculated decision regarding the retransmission of the lost packets.
This decision hinges on two primary factors:
- The availability of the packet in its cache
- The estimated usefulness of the retransmission
The sender evaluates whether the retransmitted packet, once received, will still hold value for the ongoing communication. For example, the lost packet could be part of a video frame that is discardable on the receiver due to temporal scalability. If the sender decides this is most likely not important won’t retransmit the packet.
This evaluation minimizes network bandwidth waste by preventing the retransmission of packets that would arrive too late to be useful for decoding and playback, such as those belonging to frames that have already been superseded or discarded by the receiver.
Importance in WebRTC
The implementation of NACK in WebRTC directly impacts the quality and reliability of real-time communication. It is focused on video streams where the encoding of frames depends on receiving the complete sequence of frames and a lot less on audio streams where codecs such as Opus deal well with the loss of a single frame.
By providing a mechanism to request for lost packet retransmission, NACK plays a vital role in mitigating the effects of packet loss, thereby enhancing the overall user experience in a WebRTC environment.


