From 75ba5cdc94b591bcca4897854bc87a8f3646f401 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 2 Aug 2023 16:26:58 +0200 Subject: [PATCH] wifi: Use bitmaps of 64 and 128 octets depending on buffer size --- src/wifi/model/block-ack-agreement.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/wifi/model/block-ack-agreement.cc b/src/wifi/model/block-ack-agreement.cc index c01337a69..bdc716678 100644 --- a/src/wifi/model/block-ack-agreement.cc +++ b/src/wifi/model/block-ack-agreement.cc @@ -23,6 +23,8 @@ #include "ns3/log.h" +#include + namespace ns3 { @@ -174,12 +176,13 @@ BlockAckAgreement::GetBlockAckType() const { return BlockAckType::BASIC; } + + std::set lengths{64, 256, 512, 1024}; // bitmap lengths in bits + // first bitmap length that is greater than or equal to the buffer size + auto it = lengths.lower_bound(m_bufferSize); + NS_ASSERT_MSG(it != lengths.cend(), "Buffer size too large: " << m_bufferSize); // Multi-TID Block Ack is not currently supported - if (m_bufferSize > 64) - { - return {BlockAckType::COMPRESSED, {32}}; - } - return {BlockAckType::COMPRESSED, {8}}; + return {BlockAckType::COMPRESSED, {static_cast(*it / 8)}}; } BlockAckReqType