4028 uint16_t m_nStations = 2;
4032 int64_t streamNumber = 100;
4035 wifiApNode.Create(1);
4038 wifiStaNodes.Create(m_nStations);
4042 spectrumChannel->AddPropagationLossModel(lossModel);
4045 spectrumChannel->SetPropagationDelayModel(delayModel);
4048 phy.SetChannel(spectrumChannel);
4053 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
4056 mac.SetType(
"ns3::StaWifiMac",
4063 m_staDevices.
Add(wifi.Install(phy, mac, wifiStaNodes.Get(0)));
4065 m_staDevices.
Add(wifi.Install(phy, mac, wifiStaNodes.Get(1)));
4068 mac.SetType(
"ns3::ApWifiMac",
4075 "EnableBeaconJitter",
4078 m_apDevices = wifi.Install(phy, mac, wifiApNode);
4084 for (uint16_t i = 0; i < m_nStations; i++)
4090 Ssid(
"wifi-backoff-ssid"));
4099 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
4100 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
4101 positionAlloc->Add(Vector(0.0, 1.0, 0.0));
4102 positionAlloc->Add(Vector(-1.0, 0.0, 0.0));
4103 mobility.SetPositionAllocator(positionAlloc);
4105 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
4106 mobility.Install(wifiApNode);
4107 mobility.Install(wifiStaNodes);
4112 dev->GetMac()->GetAttribute(
"BE_Txop", ptr);
4115 packetSocket.
Install(wifiApNode);
4116 packetSocket.
Install(wifiStaNodes);
4119 for (uint16_t i = 0; i < m_nStations; i++)
4129 client->SetRemote(socket);
4130 wifiStaNodes.Get(i)->AddApplication(client);
4132 client->SetStopTime(
Seconds(1));
4134 legacyStaClient->SetAttribute(
"PacketSize",
UintegerValue(1500));
4135 legacyStaClient->SetAttribute(
"MaxPackets",
UintegerValue(200));
4137 legacyStaClient->SetRemote(socket);
4138 wifiStaNodes.Get(i)->AddApplication(legacyStaClient);
4140 legacyStaClient->SetStopTime(
Seconds(1));
4142 server->SetLocal(socket);
4143 wifiApNode.Get(0)->AddApplication(server);
4144 server->SetStartTime(
Seconds(0));
4145 server->SetStopTime(
Seconds(1));
4149 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxDrop",
4334 std::optional<Time> expectedLastRxSucceeded,
4335 std::optional<Time> expectedLastRxFailed,
4336 std::optional<Time> expectedLastRxDropped)
4339 expectedCountRxSuccess,
4340 "Didn't receive right number of successful packets");
4343 expectedCountRxFailure,
4344 "Didn't receive right number of unsuccessful packets");
4347 expectedCountRxDropped,
4348 "Didn't receive right number of dropped packets");
4350 if (expectedCountRxSuccess > 0)
4353 NS_ASSERT(expectedLastRxSucceeded.has_value());
4355 expectedLastRxSucceeded.value(),
4356 "Didn't receive the last successful packet at the expected time");
4359 if (expectedCountRxFailure > 0)
4362 NS_ASSERT(expectedLastRxFailed.has_value());
4364 expectedLastRxFailed.value(),
4365 "Didn't receive the last unsuccessful packet at the expected time");
4368 if (expectedCountRxDropped > 0)
4371 NS_ASSERT(expectedLastRxDropped.has_value());
4373 expectedLastRxDropped.value(),
4374 "Didn't drop the last filtered packet at the expected time");
4576 MHz_u phyCenterFreq,
4578 MHz_u ppduCenterFreq,
4579 bool expectedP20Overlap,
4580 bool expectedP20Covered)
4590 auto p20CenterFreq =
m_rxPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(
MHz_u{20});
4591 auto p20MinFreq = p20CenterFreq -
MHz_u{10};
4592 auto p20MaxFreq = p20CenterFreq +
MHz_u{10};
4596 auto p20Overlap = ppdu->DoesOverlapChannel(p20MinFreq, p20MaxFreq);
4599 "PPDU is " << (expectedP20Overlap ?
"expected" :
"not expected")
4600 <<
" to overlap with the P20");
4606 "PPDU is " << (expectedP20Covered ?
"expected" :
"not expected")
4607 <<
" to cover the whole P20");