diff --git a/src/aodv/test/bug-772.cc b/src/aodv/test/bug-772.cc index 4517ec656..5c8858d4a 100644 --- a/src/aodv/test/bug-772.cc +++ b/src/aodv/test/bug-772.cc @@ -146,9 +146,7 @@ Bug772ChainTest::CreateDevices() "DataMode", StringValue("OfdmRate6Mbps"), "RtsCtsThreshold", - StringValue("2200"), - "MaxSlrc", - UintegerValue(7)); + StringValue("2200")); NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, *m_nodes); // Assign fixed stream numbers to wifi and channel random variables diff --git a/src/wifi/examples/wifi-bianchi.cc b/src/wifi/examples/wifi-bianchi.cc index ee7be0488..2fd167bd9 100644 --- a/src/wifi/examples/wifi-bianchi.cc +++ b/src/wifi/examples/wifi-bianchi.cc @@ -2713,11 +2713,8 @@ main(int argc, char* argv[]) Config::SetDefault("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue("22000")); Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue("22000")); - // Disable short retransmission failure (make retransmissions persistent) - Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", - UintegerValue(std::numeric_limits::max())); - Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", - UintegerValue(std::numeric_limits::max())); + // Make CW stay equal to CWmax until a packet is acknowledged + Config::SetDefault("ns3::WifiMac::FrameRetryLimit", UintegerValue(65535)); // Set maximum queue size to the largest value and set maximum queue delay to be larger than the // simulation time Config::SetDefault( diff --git a/src/wifi/examples/wifi-manager-example.cc b/src/wifi/examples/wifi-manager-example.cc index cece422c2..2d02b12c0 100644 --- a/src/wifi/examples/wifi-manager-example.cc +++ b/src/wifi/examples/wifi-manager-example.cc @@ -217,19 +217,15 @@ main(int argc, char* argv[]) StandardInfo serverSelectedStandard; StandardInfo clientSelectedStandard; bool infrastructure = false; - uint32_t maxSlrc = 7; - uint32_t maxSsrc = 7; + uint32_t maxRetryCount = 7; RngSeedManager::SetSeed(1); RngSeedManager::SetRun(2); CommandLine cmd(__FILE__); - cmd.AddValue("maxSsrc", - "The maximum number of retransmission attempts for a RTS packet", - maxSsrc); - cmd.AddValue("maxSlrc", + cmd.AddValue("maxRetryCount", "The maximum number of retransmission attempts for a Data packet", - maxSlrc); + maxRetryCount); cmd.AddValue("rtsThreshold", "RTS threshold", rtsThreshold); cmd.AddValue("maxAmpduSize", "Max A-MPDU size", maxAmpduSize); cmd.AddValue("stepSize", "Power between steps (dBm)", stepSize); @@ -588,8 +584,7 @@ main(int argc, char* argv[]) std::ofstream outfile(dataName); Gnuplot gnuplot = Gnuplot(plotName); - Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(maxSlrc)); - Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(maxSsrc)); + Config::SetDefault("ns3::WifiMac::FrameRetryLimit", UintegerValue(maxRetryCount)); Config::SetDefault("ns3::MinstrelWifiManager::PrintStats", BooleanValue(true)); Config::SetDefault("ns3::MinstrelWifiManager::PrintSamples", BooleanValue(true)); Config::SetDefault("ns3::MinstrelHtWifiManager::PrintStats", BooleanValue(true)); diff --git a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h index cfbb2c669..42755073a 100644 --- a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h @@ -274,9 +274,19 @@ class MinstrelHtWifiManager : public WifiRemoteStationManager uint8_t dataNss) override; std::list> DoGetMpdusToDropOnTxFailure(WifiRemoteStation* station, Ptr psdu) override; - bool DoNeedRetransmission(WifiRemoteStation* st, - Ptr packet, - bool normally) override; + + /** + * @param st the station that we need to communicate + * @param packet the packet to send + * @param normally indicates whether the normal 802.11 data retransmission mechanism + * would request that the data is retransmitted or not. + * @return true if we want to resend a packet after a failed transmission attempt, + * false otherwise. + * + * Note: This method is called after any unicast packet transmission (control, management, + * or data) has been attempted and has failed. + */ + bool DoNeedRetransmission(WifiRemoteStation* st, Ptr packet, bool normally); /** * Check the validity of a combination of number of streams, chWidth and mode. diff --git a/src/wifi/model/rate-control/minstrel-wifi-manager.h b/src/wifi/model/rate-control/minstrel-wifi-manager.h index b07cdfd63..1ed3536c5 100644 --- a/src/wifi/model/rate-control/minstrel-wifi-manager.h +++ b/src/wifi/model/rate-control/minstrel-wifi-manager.h @@ -254,9 +254,19 @@ class MinstrelWifiManager : public WifiRemoteStationManager WifiTxVector DoGetRtsTxVector(WifiRemoteStation* station) override; std::list> DoGetMpdusToDropOnTxFailure(WifiRemoteStation* station, Ptr psdu) override; - bool DoNeedRetransmission(WifiRemoteStation* st, - Ptr packet, - bool normally) override; + + /** + * @param st the station that we need to communicate + * @param packet the packet to send + * @param normally indicates whether the normal 802.11 data retransmission mechanism + * would request that the data is retransmitted or not. + * @return true if we want to resend a packet after a failed transmission attempt, + * false otherwise. + * + * Note: This method is called after any unicast packet transmission (control, management, + * or data) has been attempted and has failed. + */ + bool DoNeedRetransmission(WifiRemoteStation* st, Ptr packet, bool normally); /** * Estimate the TxTime of a packet with a given mode. diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 8af3363c3..3b27ba387 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -50,14 +50,18 @@ WifiRemoteStationManager::GetTypeId() "This value will not have any effect on some rate control algorithms.", UintegerValue(7), MakeUintegerAccessor(&WifiRemoteStationManager::SetMaxSsrc), - MakeUintegerChecker()) + MakeUintegerChecker(), + TypeId::OBSOLETE, + "Use WifiMac::FrameRetryLimit instead") .AddAttribute("MaxSlrc", "The maximum number of retransmission attempts for any packet with size " "> RtsCtsThreshold. " "This value will not have any effect on some rate control algorithms.", UintegerValue(4), MakeUintegerAccessor(&WifiRemoteStationManager::SetMaxSlrc), - MakeUintegerChecker()) + MakeUintegerChecker(), + TypeId::OBSOLETE, + "Use WifiMac::FrameRetryLimit instead") .AddAttribute( "IncrementRetryCountUnderBa", "The 802.11-2020 standard states that the retry count for frames that are part of " @@ -1297,32 +1301,6 @@ WifiRemoteStationManager::GetUseNonHtProtection() const return m_useNonHtProtection; } -bool -WifiRemoteStationManager::NeedRetransmission(Ptr mpdu) -{ - NS_LOG_FUNCTION(this << *mpdu); - NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup()); - AcIndex ac = - QosUtilsMapTidToAc((mpdu->GetHeader().IsQosData()) ? mpdu->GetHeader().GetQosTid() : 0); - bool longMpdu = (mpdu->GetSize() > m_rtsCtsThreshold); - uint32_t retryCount; - uint32_t maxRetryCount; - if (longMpdu) - { - retryCount = m_slrc[ac]; - maxRetryCount = m_maxSlrc; - } - else - { - retryCount = m_ssrc[ac]; - maxRetryCount = m_maxSsrc; - } - bool normally = retryCount < maxRetryCount; - NS_LOG_DEBUG("WifiRemoteStationManager::NeedRetransmission count: " - << retryCount << " result: " << std::boolalpha << normally); - return DoNeedRetransmission(Lookup(mpdu->GetHeader().GetAddr1()), mpdu->GetPacket(), normally); -} - bool WifiRemoteStationManager::NeedFragmentation(Ptr mpdu) { @@ -1955,14 +1933,6 @@ WifiRemoteStationManager::DoNeedRts(WifiRemoteStation* station, uint32_t size, b return normally; } -bool -WifiRemoteStationManager::DoNeedRetransmission(WifiRemoteStation* station, - Ptr packet, - bool normally) -{ - return normally; -} - bool WifiRemoteStationManager::DoNeedFragmentation(WifiRemoteStation* station, Ptr packet, diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index d2a4d5328..a2f8ce059 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -936,15 +936,13 @@ class WifiRemoteStationManager : public Object double dataSnr, WifiTxVector dataTxVector); /** - * Should be invoked after calling ReportRtsFailed if - * NeedRetransmission returns false + * Should be invoked after calling ReportRtsFailed if frames are dropped * * @param header MAC header of the DATA packet */ void ReportFinalRtsFailed(const WifiMacHeader& header); /** - * Should be invoked after calling ReportDataFailed if - * NeedRetransmission returns false + * Should be invoked after calling ReportDataFailed if frames are dropped * * @param mpdu the MPDU which was discarded */ @@ -1004,13 +1002,6 @@ class WifiRemoteStationManager : public Object */ bool NeedCtsToSelf(WifiTxVector txVector); - /** - * @param mpdu the MPDU to send - * - * @return true if we want to resend a packet after a failed transmission attempt, - * false otherwise. - */ - bool NeedRetransmission(Ptr mpdu); /** * @param mpdu the MPDU to send * @@ -1335,20 +1326,6 @@ class WifiRemoteStationManager : public Object * Note: This method is called before a unicast packet is sent on the medium. */ virtual bool DoNeedRts(WifiRemoteStation* station, uint32_t size, bool normally); - /** - * @param station the station that we need to communicate - * @param packet the packet to send - * @param normally indicates whether the normal 802.11 data retransmission mechanism - * would request that the data is retransmitted or not. - * @return true if we want to resend a packet after a failed transmission attempt, - * false otherwise. - * - * Note: This method is called after any unicast packet transmission (control, management, - * or data) has been attempted and has failed. - */ - virtual bool DoNeedRetransmission(WifiRemoteStation* station, - Ptr packet, - bool normally); /** * @param station the station that we need to communicate * @param packet the packet to send diff --git a/src/wifi/test/examples-to-run.py b/src/wifi/test/examples-to-run.py index 93b279cf2..bd3151548 100644 --- a/src/wifi/test/examples-to-run.py +++ b/src/wifi/test/examples-to-run.py @@ -35,7 +35,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Aarf --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Aarf --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -62,7 +62,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Aarfcd --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Aarfcd --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -93,7 +93,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Amrr --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Amrr --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -120,7 +120,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Arf --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Arf --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -147,7 +147,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Cara --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Cara --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -174,7 +174,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Onoe --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Onoe --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -201,7 +201,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Rraa --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Rraa --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ), @@ -232,7 +232,7 @@ cpp_examples = [ "True", ), ( - "wifi-manager-example --wifiManager=Minstrel --standard=802.11a --maxSlrc=1 --stepTime=0.1", + "wifi-manager-example --wifiManager=Minstrel --standard=802.11a --maxRetryCount=1 --stepTime=0.1", "True", "True", ),