From 17954bc114599974a4a45de78a2fcff088491a13 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 31 Jan 2024 14:27:05 +0100 Subject: [PATCH] wifi: Fix rate used to send BlockAckReq frames Fixes a regression introduced with 1a8b3718 --- RELEASE_NOTES.md | 1 + examples/wireless/wifi-simple-ht-hidden-stations.cc | 4 ++++ src/wifi/model/ht/ht-frame-exchange-manager.cc | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cdc95b503..fd124b0ad 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -41,6 +41,7 @@ Release 3-dev - (wifi) - Stop A-MSDU aggregation when an A-MSDU is found in the queue - (lr-wpan) !1769 - `DoDispose` SIGSEGV and beacon fixes - (wifi) - ReportAmpduTxStatus called twice when sending explicit BAR upon missed BlockAck +- (wifi) - Fix regression causing BlockAckReq frames to be sent with data rates instead of control rates Release 3.40 ------------ diff --git a/examples/wireless/wifi-simple-ht-hidden-stations.cc b/examples/wireless/wifi-simple-ht-hidden-stations.cc index 19fb3b5e7..7e177c463 100644 --- a/examples/wireless/wifi-simple-ht-hidden-stations.cc +++ b/examples/wireless/wifi-simple-ht-hidden-stations.cc @@ -25,6 +25,7 @@ #include "ns3/ipv4-address-helper.h" #include "ns3/log.h" #include "ns3/mobility-helper.h" +#include "ns3/rng-seed-manager.h" #include "ns3/ssid.h" #include "ns3/string.h" #include "ns3/udp-client-server-helper.h" @@ -64,6 +65,9 @@ main(int argc, char* argv[]) double minExpectedThroughput = 0; double maxExpectedThroughput = 0; + RngSeedManager::SetSeed(1); + RngSeedManager::SetRun(5); + CommandLine cmd(__FILE__); cmd.AddValue("nMpdus", "Number of aggregated MPDUs", nMpdus); cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize); diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index a9dbb3b53..fbb22eb7c 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -570,6 +570,12 @@ HtFrameExchangeManager::SendMpduFromBaManager(Ptr mpdu, return false; } + NS_ABORT_IF(txParams.m_acknowledgment->method != WifiAcknowledgment::BLOCK_ACK); + + // the BlockAckReq frame is sent using the same TXVECTOR as the BlockAck frame + auto blockAcknowledgment = static_cast(txParams.m_acknowledgment.get()); + txParams.m_txVector = blockAcknowledgment->blockAckTxVector; + // we can transmit the BlockAckReq frame SendPsduWithProtection(GetWifiPsdu(mpdu, txParams.m_txVector), txParams); return true;