wifi: Implementation of ACK timeout
The IEEE 802.11-2016 standard defines the ACK timeout in 10.22.2.2 (page 1379) as
The STA shall wait for a timeout interval of duration aSIFSTime + aSlotTime + aRxPHYStartDelay, starting when the MAC receives a PHY-TXEND.confirm primitive. If a PHY-RXSTART.indication primitive does not occur during the timeout interval, the transmission of the MPDU has failed.
For 802.11a (OFDM), these parameters are defined in Table 17-21 (page 2321) as follows:
- aSIFSTime = 16 us
- aSlotTime = 9 us
- aRxPHYStartDelay = 20 us
These add up to 45 us. However, the default value in ns-3 is 75 us (documentation of WifiMac). Looking at the code, we see that the timeout is calculated as the sum of aSIFSTime, the TX time of an ACK at the lowest rate (44 us), aSlotTime and twice the maximum propagation delay:
void
WifiMac::Configure80211a (void)
{
/* ... */
SetAckTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
}
I checked as far back as 802.11-2007 and the timeout has always been calculated as aSIFSTime + aSlotTime + aRxPHYStartDelay. However, reading this related issue I come to understand that it's an ns-3 design choice: since PHY-RXSTART is not supported, WifiMac waits for the whole ACK to arrive before the timeout expires. However, this means that it is 75-45=30 us "late" in returning to the contention for the channel. This seems unintentional.