wifi: MAC configuration requires the PHY to be setup
This should be expected because some MAC parameters depend on PHY. Also, for 11be multi-link devices, the number of FEMs to create depend on the number of PHY objects.
This commit is contained in:
@@ -182,14 +182,19 @@ MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uin
|
||||
// this is a const method, but we need to force the correct QoS setting
|
||||
ObjectFactory macObjectFactory = m_mac;
|
||||
macObjectFactory.Set ("QosSupported", BooleanValue (true)); // a mesh station is a QoS station
|
||||
Ptr<WifiPhy> phy = phyHelper.Create (node, device);
|
||||
node->AddDevice (device);
|
||||
phy->ConfigureStandard (m_standard);
|
||||
device->SetPhy (phy);
|
||||
Ptr<MeshWifiInterfaceMac> mac = macObjectFactory.Create<MeshWifiInterfaceMac> ();
|
||||
NS_ASSERT (mac != 0);
|
||||
mac->SetSsid (Ssid ());
|
||||
mac->SetDevice (device);
|
||||
Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
|
||||
NS_ASSERT (manager != 0);
|
||||
Ptr<WifiPhy> phy = phyHelper.Create (node, device);
|
||||
device->SetRemoteStationManager (manager);
|
||||
mac->SetAddress (Mac48Address::Allocate ());
|
||||
device->SetMac (mac);
|
||||
mac->ConfigureStandard (m_standard);
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
if (fem != nullptr)
|
||||
@@ -202,11 +207,6 @@ MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uin
|
||||
ackManager->SetWifiMac (mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
}
|
||||
phy->ConfigureStandard (m_standard);
|
||||
device->SetMac (mac);
|
||||
device->SetPhy (phy);
|
||||
device->SetRemoteStationManager (manager);
|
||||
node->AddDevice (device);
|
||||
mac->SwitchFrequencyChannel (channelId);
|
||||
|
||||
return device;
|
||||
|
||||
@@ -380,6 +380,20 @@ OcbWifiMac::ConfigureEdca (uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OcbWifiMac::SetWifiPhy (Ptr<WifiPhy> phy)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << phy);
|
||||
WifiMac::SetWifiPhy (phy);
|
||||
NS_ABORT_MSG_IF (!phy->GetOperatingChannel ().IsSet (),
|
||||
"PHY operating channel must have been set");
|
||||
m_channelAccessManager->SetupPhyListener (phy);
|
||||
if (m_feManager != nullptr)
|
||||
{
|
||||
m_feManager->SetWifiPhy (phy);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OcbWifiMac::ConfigureStandard (enum WifiStandard standard)
|
||||
{
|
||||
@@ -413,6 +427,10 @@ OcbWifiMac::ConfigureStandard (enum WifiStandard standard)
|
||||
m_feManager->SetMacRxMiddle (m_rxMiddle);
|
||||
m_feManager->SetAddress (GetAddress ());
|
||||
m_channelAccessManager->SetupFrameExchangeManager (m_feManager);
|
||||
if (auto phy = GetWifiPhy (); phy != nullptr)
|
||||
{
|
||||
m_feManager->SetWifiPhy (phy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@ public:
|
||||
|
||||
// Inherited from base class
|
||||
virtual void ConfigureStandard (enum WifiStandard standard);
|
||||
virtual void SetWifiPhy (Ptr<WifiPhy> phy);
|
||||
protected:
|
||||
virtual void DoDispose (void);
|
||||
private:
|
||||
|
||||
@@ -722,6 +722,7 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper,
|
||||
{
|
||||
Ptr<Node> node = *i;
|
||||
Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
|
||||
node->AddDevice (device);
|
||||
device->SetStandard (m_standard);
|
||||
if (m_standard == WIFI_STANDARD_UNSPECIFIED)
|
||||
{
|
||||
@@ -754,13 +755,11 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper,
|
||||
device->SetEhtConfiguration (ehtConfiguration);
|
||||
}
|
||||
Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
|
||||
device->SetRemoteStationManager (manager);
|
||||
Ptr<WifiPhy> phy = phyHelper.Create (node, device);
|
||||
device->SetPhy (phy);
|
||||
phy->ConfigureStandard (m_standard);
|
||||
Ptr<WifiMac> mac = macHelper.Create (device, m_standard);
|
||||
device->SetMac (mac);
|
||||
device->SetRemoteStationManager (manager);
|
||||
node->AddDevice (device);
|
||||
if ((m_standard >= WIFI_STANDARD_80211ax) && (m_obssPdAlgorithm.IsTypeIdSet ()))
|
||||
{
|
||||
Ptr<ObssPdAlgorithm> obssPdAlgorithm = m_obssPdAlgorithm.Create<ObssPdAlgorithm> ();
|
||||
|
||||
@@ -56,6 +56,7 @@ WifiMacHelper::Create (Ptr<WifiNetDevice> device, WifiStandard standard) const
|
||||
Ptr<WifiMac> mac = macObjectFactory.Create<WifiMac> ();
|
||||
mac->SetDevice (device);
|
||||
mac->SetAddress (Mac48Address::Allocate ());
|
||||
device->SetMac (mac);
|
||||
mac->ConfigureStandard (standard);
|
||||
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
|
||||
@@ -655,10 +655,14 @@ void
|
||||
WifiMac::ConfigureStandard (WifiStandard standard)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << standard);
|
||||
|
||||
NS_ABORT_IF (standard >= WIFI_STANDARD_80211n && !m_qosSupported);
|
||||
NS_ABORT_MSG_IF (m_phy == nullptr || !m_phy->GetOperatingChannel ().IsSet (),
|
||||
"PHY must have been set and an operating channel must have been set");
|
||||
|
||||
ConfigurePhyDependentParameters ();
|
||||
m_channelAccessManager->SetupPhyListener (m_phy);
|
||||
SetupFrameExchangeManager (standard);
|
||||
m_feManager->SetWifiPhy (m_phy);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -768,12 +772,6 @@ WifiMac::SetWifiPhy (const Ptr<WifiPhy> phy)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << phy);
|
||||
m_phy = phy;
|
||||
NS_ABORT_MSG_IF (!m_phy->GetOperatingChannel ().IsSet (),
|
||||
"PHY operating channel must have been set");
|
||||
ConfigurePhyDependentParameters ();
|
||||
m_channelAccessManager->SetupPhyListener (phy);
|
||||
NS_ASSERT (m_feManager != 0);
|
||||
m_feManager->SetWifiPhy (phy);
|
||||
}
|
||||
|
||||
Ptr<WifiPhy>
|
||||
|
||||
@@ -69,28 +69,18 @@ PowerRateAdaptationTest::PowerRateAdaptationTest ()
|
||||
Ptr<Node>
|
||||
PowerRateAdaptationTest::ConfigureNode ()
|
||||
{
|
||||
/*
|
||||
* Create and configure node.
|
||||
*/
|
||||
Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
node->AddDevice (dev);
|
||||
|
||||
/*
|
||||
* Create channel model. Is is necessary to configure correctly the phy layer.
|
||||
*/
|
||||
Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
|
||||
|
||||
/*
|
||||
* Create mac layer. We use Adhoc because association is not needed to get supported rates.
|
||||
*/
|
||||
Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
|
||||
Ptr<AdhocWifiMac> mac = CreateObject<AdhocWifiMac> ();
|
||||
mac->SetDevice (dev);
|
||||
mac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
protectionManager->SetWifiMac (mac);
|
||||
fem->SetProtectionManager (protectionManager);
|
||||
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
/*
|
||||
* Create mobility model. Is needed by the phy layer for transmission.
|
||||
*/
|
||||
@@ -102,6 +92,7 @@ PowerRateAdaptationTest::ConfigureNode ()
|
||||
Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> interferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
phy->SetInterferenceHelper (interferenceHelper);
|
||||
dev->SetPhy (phy);
|
||||
phy->SetChannel (channel);
|
||||
phy->SetDevice (dev);
|
||||
phy->SetMobility (mobility);
|
||||
@@ -118,16 +109,25 @@ PowerRateAdaptationTest::ConfigureNode ()
|
||||
* Create manager.
|
||||
*/
|
||||
Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
|
||||
dev->SetRemoteStationManager (manager);
|
||||
|
||||
/*
|
||||
* Create and configure node. Add mac and phy layer and the manager.
|
||||
* Create mac layer. We use Adhoc because association is not needed to get supported rates.
|
||||
*/
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
Ptr<AdhocWifiMac> mac = CreateObject<AdhocWifiMac> ();
|
||||
mac->SetDevice (dev);
|
||||
mac->SetAddress (Mac48Address::Allocate ());
|
||||
dev->SetMac (mac);
|
||||
dev->SetPhy (phy);
|
||||
dev->SetRemoteStationManager (manager);
|
||||
node->AddDevice (dev);
|
||||
mac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
protectionManager->SetWifiMac (mac);
|
||||
fem->SetProtectionManager (protectionManager);
|
||||
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ AmpduAggregationTest::DoRun (void)
|
||||
m_mac->SetDevice (m_device);
|
||||
m_mac->SetWifiRemoteStationManager (m_manager);
|
||||
m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01"));
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_mac->ConfigureStandard (WIFI_STANDARD_80211n);
|
||||
Ptr<FrameExchangeManager> fem = m_mac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -134,7 +135,6 @@ AmpduAggregationTest::DoRun (void)
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (m_mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_device->SetMac (m_mac);
|
||||
m_mac->SetState (StaWifiMac::ASSOCIATED);
|
||||
|
||||
@@ -377,6 +377,7 @@ TwoLevelAggregationTest::DoRun (void)
|
||||
m_mac->SetDevice (m_device);
|
||||
m_mac->SetWifiRemoteStationManager (m_manager);
|
||||
m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01"));
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_mac->ConfigureStandard (WIFI_STANDARD_80211n);
|
||||
Ptr<FrameExchangeManager> fem = m_mac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -385,7 +386,6 @@ TwoLevelAggregationTest::DoRun (void)
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (m_mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_device->SetMac (m_mac);
|
||||
m_mac->SetState (StaWifiMac::ASSOCIATED);
|
||||
|
||||
@@ -613,6 +613,7 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize)
|
||||
m_mac->SetDevice (m_device);
|
||||
m_mac->SetWifiRemoteStationManager (m_manager);
|
||||
m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01"));
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_mac->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
Ptr<FrameExchangeManager> fem = m_mac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -621,7 +622,6 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize)
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (m_mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
m_mac->SetWifiPhy (m_phy);
|
||||
m_device->SetMac (m_mac);
|
||||
m_mac->SetState (StaWifiMac::ASSOCIATED);
|
||||
|
||||
|
||||
@@ -140,10 +140,25 @@ WifiTest::CreateOne (Vector pos, Ptr<YansWifiChannel> channel)
|
||||
{
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
|
||||
node->AddDevice (dev);
|
||||
|
||||
auto mobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
auto phy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> interferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
phy->SetInterferenceHelper (interferenceHelper);
|
||||
auto error = CreateObject<YansErrorRateModel> ();
|
||||
phy->SetErrorRateModel (error);
|
||||
phy->SetChannel (channel);
|
||||
phy->SetDevice (dev);
|
||||
phy->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
dev->SetPhy (phy);
|
||||
auto manager = m_manager.Create<WifiRemoteStationManager> ();
|
||||
dev->SetRemoteStationManager (manager);
|
||||
|
||||
Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
|
||||
mac->SetDevice (dev);
|
||||
mac->SetAddress (Mac48Address::Allocate ());
|
||||
dev->SetMac (mac);
|
||||
mac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -153,23 +168,8 @@ WifiTest::CreateOne (Vector pos, Ptr<YansWifiChannel> channel)
|
||||
ackManager->SetWifiMac (mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> interferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
phy->SetInterferenceHelper (interferenceHelper);
|
||||
Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
|
||||
phy->SetErrorRateModel (error);
|
||||
phy->SetChannel (channel);
|
||||
phy->SetDevice (dev);
|
||||
phy->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
|
||||
|
||||
mobility->SetPosition (pos);
|
||||
node->AggregateObject (mobility);
|
||||
dev->SetMac (mac);
|
||||
dev->SetPhy (phy);
|
||||
dev->SetRemoteStationManager (manager);
|
||||
node->AddDevice (dev);
|
||||
|
||||
Simulator::Schedule (Seconds (1.0), &WifiTest::SendOnePacket, this, dev);
|
||||
}
|
||||
@@ -318,10 +318,26 @@ InterferenceHelperSequenceTest::CreateOne (Vector pos, Ptr<YansWifiChannel> chan
|
||||
{
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
|
||||
node->AddDevice (dev);
|
||||
|
||||
auto mobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
auto phy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> interferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
phy->SetInterferenceHelper (interferenceHelper);
|
||||
auto error = CreateObject<YansErrorRateModel> ();
|
||||
phy->SetErrorRateModel (error);
|
||||
phy->SetChannel (channel);
|
||||
phy->SetDevice (dev);
|
||||
phy->SetMobility (mobility);
|
||||
phy->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
dev->SetPhy (phy);
|
||||
auto manager = m_manager.Create<WifiRemoteStationManager> ();
|
||||
dev->SetRemoteStationManager (manager);
|
||||
|
||||
Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
|
||||
mac->SetDevice (dev);
|
||||
mac->SetAddress (Mac48Address::Allocate ());
|
||||
dev->SetMac (mac);
|
||||
mac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<FrameExchangeManager> fem = mac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -331,24 +347,8 @@ InterferenceHelperSequenceTest::CreateOne (Vector pos, Ptr<YansWifiChannel> chan
|
||||
ackManager->SetWifiMac (mac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> interferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
phy->SetInterferenceHelper (interferenceHelper);
|
||||
Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
|
||||
phy->SetErrorRateModel (error);
|
||||
phy->SetChannel (channel);
|
||||
phy->SetDevice (dev);
|
||||
phy->SetMobility (mobility);
|
||||
phy->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
|
||||
|
||||
mobility->SetPosition (pos);
|
||||
node->AggregateObject (mobility);
|
||||
dev->SetMac (mac);
|
||||
dev->SetPhy (phy);
|
||||
dev->SetRemoteStationManager (manager);
|
||||
node->AddDevice (dev);
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -523,23 +523,6 @@ DcfImmediateAccessBroadcastTestCase::DoRun (void)
|
||||
|
||||
Ptr<Node> txNode = CreateObject<Node> ();
|
||||
Ptr<WifiNetDevice> txDev = CreateObject<WifiNetDevice> ();
|
||||
Ptr<WifiMac> txMac = m_mac.Create<WifiMac> ();
|
||||
txMac->SetDevice (txDev);
|
||||
txMac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
Ptr<FrameExchangeManager> fem = txMac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
protectionManager->SetWifiMac (txMac);
|
||||
fem->SetProtectionManager (protectionManager);
|
||||
Ptr<WifiAckManager> ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (txMac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
|
||||
//Fix the stream assignment to the Dcf Txop objects (backoffs)
|
||||
//The below stream assignment will result in the Txop object
|
||||
//using a backoff value of zero for this test when the
|
||||
//Txop::EndTxNoAck() calls to StartBackoffNow()
|
||||
AssignWifiRandomStreams (txMac, 23);
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> txMobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
Ptr<YansWifiPhy> txPhy = CreateObject<YansWifiPhy> ();
|
||||
@@ -556,12 +539,29 @@ DcfImmediateAccessBroadcastTestCase::DoRun (void)
|
||||
|
||||
txMobility->SetPosition (Vector (0.0, 0.0, 0.0));
|
||||
txNode->AggregateObject (txMobility);
|
||||
txMac->SetAddress (Mac48Address::Allocate ());
|
||||
txDev->SetMac (txMac);
|
||||
txDev->SetPhy (txPhy);
|
||||
txDev->SetRemoteStationManager (m_manager.Create<WifiRemoteStationManager> ());
|
||||
txNode->AddDevice (txDev);
|
||||
|
||||
auto txMac = m_mac.Create<WifiMac> ();
|
||||
txMac->SetDevice (txDev);
|
||||
txMac->SetAddress (Mac48Address::Allocate ());
|
||||
txDev->SetMac (txMac);
|
||||
txMac->ConfigureStandard (WIFI_STANDARD_80211a);
|
||||
auto fem = txMac->GetFrameExchangeManager ();
|
||||
auto protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
protectionManager->SetWifiMac (txMac);
|
||||
fem->SetProtectionManager (protectionManager);
|
||||
auto ackManager = CreateObject<WifiDefaultAckManager> ();
|
||||
ackManager->SetWifiMac (txMac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
//Fix the stream assignment to the Dcf Txop objects (backoffs)
|
||||
//The below stream assignment will result in the Txop object
|
||||
//using a backoff value of zero for this test when the
|
||||
//Txop::EndTxNoAck() calls to StartBackoffNow()
|
||||
AssignWifiRandomStreams (txMac, 23);
|
||||
|
||||
m_firstTransmissionTime = Seconds (0.0);
|
||||
m_secondTransmissionTime = Seconds (0.0);
|
||||
m_numSentPackets = 0;
|
||||
@@ -1731,9 +1731,30 @@ Bug2831TestCase::DoRun (void)
|
||||
|
||||
Ptr<Node> apNode = CreateObject<Node> ();
|
||||
Ptr<WifiNetDevice> apDev = CreateObject<WifiNetDevice> ();
|
||||
apNode->AddDevice (apDev);
|
||||
apDev->SetStandard (WIFI_STANDARD_80211ax);
|
||||
Ptr<HtConfiguration> apHtConfiguration = CreateObject<HtConfiguration> ();
|
||||
apDev->SetHtConfiguration (apHtConfiguration);
|
||||
ObjectFactory manager;
|
||||
manager.SetTypeId ("ns3::ConstantRateWifiManager");
|
||||
apDev->SetRemoteStationManager (manager.Create<WifiRemoteStationManager> ());
|
||||
|
||||
auto apMobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
apMobility->SetPosition (Vector (0.0, 0.0, 0.0));
|
||||
apNode->AggregateObject (apMobility);
|
||||
|
||||
auto error = CreateObject<YansErrorRateModel> ();
|
||||
m_apPhy = CreateObject<YansWifiPhy> ();
|
||||
apDev->SetPhy (m_apPhy);
|
||||
Ptr<InterferenceHelper> apInterferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
m_apPhy->SetInterferenceHelper (apInterferenceHelper);
|
||||
m_apPhy->SetErrorRateModel (error);
|
||||
m_apPhy->SetChannel (channel);
|
||||
m_apPhy->SetMobility (apMobility);
|
||||
m_apPhy->SetDevice (apDev);
|
||||
m_apPhy->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
m_apPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0});
|
||||
|
||||
ObjectFactory mac;
|
||||
mac.SetTypeId ("ns3::ApWifiMac");
|
||||
mac.Set ("EnableBeaconJitter", BooleanValue (false));
|
||||
@@ -1741,6 +1762,7 @@ Bug2831TestCase::DoRun (void)
|
||||
Ptr<WifiMac> apMac = mac.Create<WifiMac> ();
|
||||
apMac->SetDevice (apDev);
|
||||
apMac->SetAddress (Mac48Address::Allocate ());
|
||||
apDev->SetMac (apMac);
|
||||
apMac->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
Ptr<FrameExchangeManager> fem = apMac->GetFrameExchangeManager ();
|
||||
Ptr<WifiProtectionManager> protectionManager = CreateObject<WifiDefaultProtectionManager> ();
|
||||
@@ -1752,11 +1774,30 @@ Bug2831TestCase::DoRun (void)
|
||||
|
||||
Ptr<Node> staNode = CreateObject<Node> ();
|
||||
Ptr<WifiNetDevice> staDev = CreateObject<WifiNetDevice> ();
|
||||
staNode->AddDevice (staDev);
|
||||
staDev->SetStandard (WIFI_STANDARD_80211ax);
|
||||
Ptr<HtConfiguration> staHtConfiguration = CreateObject<HtConfiguration> ();
|
||||
staDev->SetHtConfiguration (staHtConfiguration);
|
||||
staDev->SetRemoteStationManager (manager.Create<WifiRemoteStationManager> ());
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> staMobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
staMobility->SetPosition (Vector (1.0, 0.0, 0.0));
|
||||
staNode->AggregateObject (staMobility);
|
||||
|
||||
m_staPhy = CreateObject<YansWifiPhy> ();
|
||||
staDev->SetPhy (m_staPhy);
|
||||
Ptr<InterferenceHelper> staInterferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
m_staPhy->SetInterferenceHelper (staInterferenceHelper);
|
||||
m_staPhy->SetErrorRateModel (error);
|
||||
m_staPhy->SetChannel (channel);
|
||||
m_staPhy->SetMobility (staMobility);
|
||||
m_staPhy->SetDevice (apDev);
|
||||
m_staPhy->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
m_staPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0});
|
||||
|
||||
mac.SetTypeId ("ns3::StaWifiMac");
|
||||
Ptr<WifiMac> staMac = mac.Create<WifiMac> ();
|
||||
auto staMac = mac.Create<WifiMac> ();
|
||||
staDev->SetMac (staMac);
|
||||
staMac->SetDevice (staDev);
|
||||
staMac->SetAddress (Mac48Address::Allocate ());
|
||||
staMac->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
@@ -1768,48 +1809,6 @@ Bug2831TestCase::DoRun (void)
|
||||
ackManager->SetWifiMac (staMac);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> apMobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
apMobility->SetPosition (Vector (0.0, 0.0, 0.0));
|
||||
apNode->AggregateObject (apMobility);
|
||||
|
||||
m_apPhy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> apInterferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
m_apPhy->SetInterferenceHelper (apInterferenceHelper);
|
||||
Ptr<ErrorRateModel> apErrorModel = CreateObject<YansErrorRateModel> ();
|
||||
m_apPhy->SetErrorRateModel (apErrorModel);
|
||||
m_apPhy->SetChannel (channel);
|
||||
m_apPhy->SetMobility (apMobility);
|
||||
m_apPhy->SetDevice (apDev);
|
||||
apDev->SetPhy (m_apPhy);
|
||||
m_apPhy->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
m_apPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0});
|
||||
|
||||
Ptr<ConstantPositionMobilityModel> staMobility = CreateObject<ConstantPositionMobilityModel> ();
|
||||
staMobility->SetPosition (Vector (1.0, 0.0, 0.0));
|
||||
staNode->AggregateObject (staMobility);
|
||||
|
||||
m_staPhy = CreateObject<YansWifiPhy> ();
|
||||
Ptr<InterferenceHelper> staInterferenceHelper = CreateObject<InterferenceHelper> ();
|
||||
m_staPhy->SetInterferenceHelper (staInterferenceHelper);
|
||||
Ptr<ErrorRateModel> staErrorModel = CreateObject<YansErrorRateModel> ();
|
||||
m_staPhy->SetErrorRateModel (staErrorModel);
|
||||
m_staPhy->SetChannel (channel);
|
||||
m_staPhy->SetMobility (staMobility);
|
||||
m_staPhy->SetDevice (apDev);
|
||||
staDev->SetPhy (m_staPhy);
|
||||
m_staPhy->ConfigureStandard (WIFI_STANDARD_80211ax);
|
||||
m_staPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0});
|
||||
|
||||
apDev->SetMac (apMac);
|
||||
ObjectFactory manager;
|
||||
manager.SetTypeId ("ns3::ConstantRateWifiManager");
|
||||
apDev->SetRemoteStationManager (manager.Create<WifiRemoteStationManager> ());
|
||||
apNode->AddDevice (apDev);
|
||||
|
||||
staDev->SetMac (staMac);
|
||||
staDev->SetRemoteStationManager (manager.Create<WifiRemoteStationManager> ());
|
||||
staNode->AddDevice (staDev);
|
||||
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyRxBegin", MakeCallback (&Bug2831TestCase::RxCallback, this));
|
||||
|
||||
Simulator::Schedule (Seconds (1.0), &Bug2831TestCase::ChangeSupportedChannelWidth, this);
|
||||
|
||||
Reference in New Issue
Block a user