From eea2800438301283d51fd0b87a16e1d021c9d717 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 2 May 2024 16:07:20 +0200 Subject: [PATCH] wifi: Fix starting SeqNo when ADDBA Response arrives after timeout --- src/wifi/model/qos-txop.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 8d91e8156..004ed976e 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -664,16 +664,16 @@ QosTxop::GotAddBaResponse(const MgtAddBaResponseHeader& respHdr, Mac48Address re if (respHdr.GetStatusCode().IsSuccess()) { NS_LOG_DEBUG("block ack agreement established with " << recipient << " tid " << +tid); - // A (destination, TID) pair is "blocked" (i.e., no more packets are sent) - // when an Add BA Request is sent to the destination. However, when the - // Add BA Request timer expires, the (destination, TID) pair is "unblocked" - // and packets to the destination are sent again (under normal ack policy). - // Thus, there may be a packet needing to be retransmitted when the - // Add BA Response is received. In this case, the starting sequence number - // shall be set equal to the sequence number of such packet. + // A (destination, TID) pair is "blocked" (i.e., no more packets are sent) when an + // Add BA Request is sent to the destination. However, when the Add BA Request timer + // expires, the (destination, TID) pair is "unblocked" and packets to the destination are + // sent again (under normal ack policy). Thus, there may be a packet with a sequence number + // already assigned waiting to be retransmitted (or being transmitted on another link) + // when the Add BA Response is received. In this case, the starting sequence number shall + // be set equal to the sequence number of such packet. uint16_t startingSeq = m_txMiddle->GetNextSeqNumberByTidAndAddress(tid, recipient); auto peekedItem = m_queue->PeekByTidAndAddress(tid, recipient); - if (peekedItem && peekedItem->GetHeader().IsRetry()) + if (peekedItem && peekedItem->HasSeqNoAssigned()) { startingSeq = peekedItem->GetHeader().GetSequenceNumber(); }