wifi: Use new WifiHelper methods in some examples/tests

This commit is contained in:
Stefano Avallone
2022-06-27 22:03:36 +02:00
committed by Stefano Avallone
parent 2cea008b33
commit 7c11a1d012
5 changed files with 19 additions and 27 deletions

View File

@@ -19,6 +19,7 @@ Changes from ns-3.36 to ns-3.37
### New API
* Added a new attribute **MaxTbPpduDelay** in HeConfiguration for configuring the maximum delay with which a TB PPDU can arrive at the AP after the first TB PPDU in order to be decoded properly. If the delay is higher than **MaxTbPpduDelay**, the TB PPDU is discarded and treated as interference.
* Added new methods (**ConfigHtOptions**, **ConfigVhtOptions**, **ConfigHeOptions** and **ConfigEhtOptions**) to `WifiHelper` to configure HT/VHT/HE/EHT options listed as attributes of the respective Configuration classes through the wifi helper.
* Added new attributes (**AccessReqInterval**, **AccessReqAc** and **DelayAccessReqUponAccess**) to the MultiUserScheduler to allow a wifi AP to coordinate UL MU transmissions even without DL traffic.
* `WifiNetDevice` has a new **Phys** attribute, which is primarily intended to select a specific PHY object of an 11be multi-link device when using path names.

View File

@@ -205,6 +205,9 @@ int main (int argc, char *argv[])
oss << "HeMcs" << mcs;
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", StringValue (oss.str ()),
"ControlMode", StringValue (oss.str ()));
// Set guard interval and MPDU buffer size
wifi.ConfigHeOptions ("GuardInterval", TimeValue (NanoSeconds (gi)),
"MpduBufferSize", UintegerValue (useExtendedBlockAck ? 256 : 64));
Ssid ssid = Ssid ("ns3-80211ax");
@@ -262,10 +265,6 @@ int main (int argc, char *argv[])
streamNumber += wifi.AssignStreams (apDevice, streamNumber);
streamNumber += wifi.AssignStreams (staDevices, streamNumber);
// Set guard interval and MPDU buffer size
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/GuardInterval", TimeValue (NanoSeconds (gi)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/MpduBufferSize", UintegerValue (useExtendedBlockAck ? 256 : 64));
// mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();

View File

@@ -150,6 +150,8 @@ int main (int argc, char *argv[])
oss << "HtMcs" << mcs;
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", StringValue (oss.str ()),
"ControlMode", StringValue (oss.str ()));
// Set guard interval
wifi.ConfigHtOptions ("ShortGuardIntervalSupported", BooleanValue (sgi));
Ssid ssid = Ssid ("ns3-80211n");
TupleValue<UintegerValue, UintegerValue, EnumValue, UintegerValue> channelValue;
@@ -170,9 +172,6 @@ int main (int argc, char *argv[])
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
// Set guard interval
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));
// mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();

View File

@@ -139,6 +139,8 @@ int main (int argc, char *argv[])
oss << "VhtMcs" << mcs;
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", StringValue (oss.str ()),
"ControlMode", StringValue (oss.str ()));
// Set guard interval
wifi.ConfigHtOptions ("ShortGuardIntervalSupported", BooleanValue (sgi));
Ssid ssid = Ssid ("ns3-80211ac");
@@ -155,9 +157,6 @@ int main (int argc, char *argv[])
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
// Set guard interval
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));
// mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();

View File

@@ -384,6 +384,8 @@ public:
private:
void DoRun (void) override;
static constexpr uint16_t m_muTimerRes = 8192; ///< MU timer resolution in usec
/// Information about transmitted frames
struct FrameInfo
{
@@ -1046,7 +1048,7 @@ OfdmaAckSequenceTest::CheckResults (Time sifs, Time slotTime, uint8_t aifsn)
{
NS_TEST_EXPECT_MSG_GT_OR_EQ (m_txPsdus[i].startTx.GetMicroSeconds (),
m_edcaDisabledStartTime.GetMicroSeconds ()
+ m_muEdcaParameterSet.muTimer * 8192,
+ m_muEdcaParameterSet.muTimer * m_muTimerRes,
"A station transmitted before the MU EDCA timer expired");
break;
}
@@ -1106,28 +1108,20 @@ OfdmaAckSequenceTest::DoRun (void)
NS_ABORT_MSG ("Invalid channel bandwidth (must be 20, 40, 80 or 160)");
}
Config::SetDefault ("ns3::HeConfiguration::MuBeAifsn",
UintegerValue (m_muEdcaParameterSet.muAifsn));
Config::SetDefault ("ns3::HeConfiguration::MuBeCwMin",
UintegerValue (m_muEdcaParameterSet.muCwMin));
Config::SetDefault ("ns3::HeConfiguration::MuBeCwMax",
UintegerValue (m_muEdcaParameterSet.muCwMax));
Config::SetDefault ("ns3::HeConfiguration::BeMuEdcaTimer",
TimeValue (MicroSeconds (8192 * m_muEdcaParameterSet.muTimer)));
// MU EDCA timers must be either all null or all non-null
Config::SetDefault ("ns3::HeConfiguration::BkMuEdcaTimer",
TimeValue (MicroSeconds (8192 * m_muEdcaParameterSet.muTimer)));
Config::SetDefault ("ns3::HeConfiguration::ViMuEdcaTimer",
TimeValue (MicroSeconds (8192 * m_muEdcaParameterSet.muTimer)));
Config::SetDefault ("ns3::HeConfiguration::VoMuEdcaTimer",
TimeValue (MicroSeconds (8192 * m_muEdcaParameterSet.muTimer)));
// increase MSDU lifetime so that it does not expire before the MU EDCA timer ends
Config::SetDefault ("ns3::WifiMacQueue::MaxDelay", TimeValue (Seconds (2)));
WifiHelper wifi;
wifi.SetStandard (WIFI_STANDARD_80211ax);
wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
wifi.ConfigHeOptions ("MuBeAifsn", UintegerValue (m_muEdcaParameterSet.muAifsn),
"MuBeCwMin", UintegerValue (m_muEdcaParameterSet.muCwMin),
"MuBeCwMax", UintegerValue (m_muEdcaParameterSet.muCwMax),
"BeMuEdcaTimer", TimeValue (MicroSeconds (m_muTimerRes * m_muEdcaParameterSet.muTimer)),
// MU EDCA timers must be either all null or all non-null
"BkMuEdcaTimer", TimeValue (MicroSeconds (m_muTimerRes * m_muEdcaParameterSet.muTimer)),
"ViMuEdcaTimer", TimeValue (MicroSeconds (m_muTimerRes * m_muEdcaParameterSet.muTimer)),
"VoMuEdcaTimer", TimeValue (MicroSeconds (m_muTimerRes * m_muEdcaParameterSet.muTimer)));
WifiMacHelper mac;
Ssid ssid = Ssid ("ns-3-ssid");