From fd3ef84b6e2c03ff9356f3f4fe6f7b1c9904303a Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 9 Apr 2019 14:06:02 +0300 Subject: [PATCH] wifi: shift BA window when sequence is next to the window end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the 802.11-2016 standard, 10.24.7.8, the originator may send the packet with SN > WinStart + WinSize – 1 and the recipient should move the window forward. If SN is equal to WinStart + WinSize + 1 == WinEnd, delta is equal to 0, and window is not moved. This commit makes recipient shift the window in this case. --- src/wifi/model/mac-low.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index fc7d87015..86e5a6899 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -2174,13 +2174,11 @@ MacLow::ReceiveMpdu (Ptr packet, WifiMacHeader hdr) if (!IsInWindow (hdr.GetSequenceNumber (), (*it).second.first.GetStartingSequence (), (*it).second.first.GetBufferSize ())) { uint16_t delta = (seqNumber - (*it).second.first.GetWinEnd () + 4096) % 4096; - if (delta > 1) - { - uint16_t bufferSize = (*it).second.first.GetBufferSize (); - uint16_t startingSeq = (seqNumber - bufferSize + 1 + 4096) % 4096; - (*it).second.first.SetStartingSequence (startingSeq); - RxCompleteBufferedPacketsWithSmallerSequence ((*it).second.first.GetStartingSequenceControl (), originator, tid); - } + NS_ASSERT (delta > 0); + uint16_t bufferSize = (*it).second.first.GetBufferSize (); + uint16_t startingSeq = (seqNumber - bufferSize + 1 + 4096) % 4096; + (*it).second.first.SetStartingSequence (startingSeq); + RxCompleteBufferedPacketsWithSmallerSequence ((*it).second.first.GetStartingSequenceControl (), originator, tid); } RxCompleteBufferedPacketsUntilFirstLost (originator, tid); //forwards up packets starting from winstart and set winstart to last +1 }