20 #include "ns3/ap-wifi-mac.h"
21 #include "ns3/boolean.h"
22 #include "ns3/double.h"
23 #include "ns3/he-configuration.h"
24 #include "ns3/he-phy.h"
25 #include "ns3/interference-helper.h"
27 #include "ns3/multi-model-spectrum-channel.h"
28 #include "ns3/nist-error-rate-model.h"
30 #include "ns3/pointer.h"
31 #include "ns3/rng-seed-manager.h"
32 #include "ns3/simulator.h"
33 #include "ns3/spectrum-wifi-helper.h"
34 #include "ns3/spectrum-wifi-phy.h"
36 #include "ns3/uinteger.h"
37 #include "ns3/wifi-mac-header.h"
38 #include "ns3/wifi-net-device.h"
39 #include "ns3/wifi-psdu.h"
40 #include "ns3/wifi-spectrum-value-helper.h"
41 #include "ns3/wifi-utils.h"
65 void DoRun()
override;
75 static WifiTxVector BuildTxVector(uint16_t bw,
const std::list<HeMuUserInfo>& userInfos);
79 :
TestCase(
"Check for valid combinations of MU TX-VECTOR")
89 std::list<uint16_t> staIds;
91 for (
const auto& userInfo : userInfos)
94 staIds.push_back(staId++);
103 std::list<HeMuUserInfo> userInfos;
104 userInfos.push_back({{HeRu::RU_106_TONE, 1,
true}, 11, 1});
105 userInfos.push_back({{HeRu::RU_106_TONE, 2,
true}, 10, 2});
109 "TX-VECTOR should indicate an OFDMA transmission");
112 "TX-VECTOR should not indicate a MU-MIMO transmission");
115 "TX-VECTOR should not indicate a SIG-B compression");
118 "TX-VECTOR should indicate all checks are passed");
122 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 11, 1});
123 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 10, 2});
127 "TX-VECTOR should indicate a MU-MIMO transmission");
130 "TX-VECTOR should not indicate an OFDMA transmission");
133 "TX-VECTOR should indicate a SIG-B compression");
136 "TX-VECTOR should indicate all checks are passed");
140 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 11, 1});
141 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 10, 1});
142 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 9, 1});
143 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 8, 1});
144 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 7, 1});
145 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 6, 1});
146 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 5, 1});
147 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 4, 1});
148 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 3, 1});
152 "TX-VECTOR should indicate a MU-MIMO transmission");
155 "TX-VECTOR should not indicate an OFDMA transmission");
158 "TX-VECTOR should indicate a SIG-B compression");
161 "TX-VECTOR should not indicate all checks are passed");
164 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 11, 2});
165 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 10, 2});
166 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 9, 3});
167 userInfos.push_back({{HeRu::RU_242_TONE, 1,
true}, 8, 3});
171 "TX-VECTOR should indicate a MU-MIMO transmission");
174 "TX-VECTOR should not indicate an OFDMA transmission");
177 "TX-VECTOR should indicate a SIG-B compression");
180 "TX-VECTOR should not indicate all checks are passed");
230 return HePhy::GetStaId(ppdu);
308 SpectrumWifiPhy::DoInitialize();
315 SpectrumWifiPhy::DoDispose();
351 void DoRun()
override;
363 std::vector<bool> statusPerMpdu);
374 std::vector<bool> statusPerMpdu);
385 std::vector<bool> statusPerMpdu);
410 uint32_t expectedRxFailure,
411 uint32_t expectedRxBytes);
419 uint32_t expectedRxFailure,
420 uint32_t expectedRxBytes);
428 uint32_t expectedRxFailure,
429 uint32_t expectedRxBytes);
449 void SendMuPpdu(
const std::vector<StaInfo>& staInfos);
503 m_countRxSuccessSta1{0},
504 m_countRxSuccessSta2{0},
505 m_countRxSuccessSta3{0},
506 m_countRxFailureSta1{0},
507 m_countRxFailureSta2{0},
508 m_countRxFailureSta3{0},
509 m_countRxBytesSta1{0},
510 m_countRxBytesSta2{0},
511 m_countRxBytesSta3{0},
552 for (
const auto& staInfo : staInfos)
554 txVector.
SetRu(ru, staInfo.staId);
555 txVector.
SetMode(HePhy::GetHeMcs7(), staInfo.staId);
556 txVector.
SetNss(staInfo.staNss, staInfo.staId);
558 Ptr<Packet> pkt = Create<Packet>(1000 + (8 * staInfo.staId));
562 std::ostringstream addr;
563 addr <<
"00:00:00:00:00:0" << staInfo.staId;
567 psdus.insert(std::make_pair(staInfo.staId, psdu));
634 uint32_t expectedRxFailure,
635 uint32_t expectedRxBytes)
639 "The number of successfully received packets by STA 1 is not correct!");
642 "The number of unsuccessfully received packets by STA 1 is not correct!");
645 "The number of bytes received by STA 1 is not correct!");
650 uint32_t expectedRxFailure,
651 uint32_t expectedRxBytes)
655 "The number of successfully received packets by STA 2 is not correct!");
658 "The number of unsuccessfully received packets by STA 2 is not correct!");
661 "The number of bytes received by STA 2 is not correct!");
666 uint32_t expectedRxFailure,
667 uint32_t expectedRxBytes)
671 "The number of successfully received packets by STA 3 is not correct!");
674 "The number of unsuccessfully received packets by STA 3 is not correct!");
677 "The number of bytes received by STA 3 is not correct!");
695 phy->GetAttribute(
"State", ptr);
697 currentState = state->GetState();
701 "PHY State " << currentState <<
" does not match expected state "
710 CreateObject<ConstantSpeedPropagationDelayModel>();
711 spectrumChannel->SetPropagationDelayModel(delayModel);
715 m_phyAp = CreateObject<SpectrumWifiPhy>();
726 Ptr<Node> sta1Node = CreateObject<Node>();
728 m_phySta1 = CreateObject<MuMimoSpectrumWifiPhy>(1);
743 Ptr<Node> sta2Node = CreateObject<Node>();
745 m_phySta2 = CreateObject<MuMimoSpectrumWifiPhy>(2);
760 Ptr<Node> sta3Node = CreateObject<Node>();
762 m_phySta3 = CreateObject<MuMimoSpectrumWifiPhy>(3);
794 RngSeedManager::SetSeed(1);
795 RngSeedManager::SetRun(1);
796 int64_t streamNumber = 0;
801 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
823 Simulator::Schedule(
Seconds(1.0),
826 std::vector<StaInfo>{{1,
m_nss}, {2,
m_nss}});
863 Simulator::Schedule(
Seconds(1.1),
870 Simulator::Schedule(
Seconds(1.1),
877 Simulator::Schedule(
Seconds(1.1),
890 Simulator::Schedule(
Seconds(2.0),
893 std::vector<StaInfo>{{1,
m_nss}, {3,
m_nss}});
930 Simulator::Schedule(
Seconds(2.1),
937 Simulator::Schedule(
Seconds(2.1),
944 Simulator::Schedule(
Seconds(2.1),
957 Simulator::Schedule(
Seconds(3.0),
960 std::vector<StaInfo>{{2,
m_nss}, {3,
m_nss}});
997 Simulator::Schedule(
Seconds(3.1),
1004 Simulator::Schedule(
Seconds(3.1),
1011 Simulator::Schedule(
Seconds(3.1),
1023 Simulator::Schedule(
Seconds(4.0),
1062 Simulator::Schedule(
Seconds(4.1),
1069 Simulator::Schedule(
Seconds(4.1),
1076 Simulator::Schedule(
Seconds(4.1),
1091 std::vector<uint8_t> nssToTest{1, 2};
1092 for (
auto nss : nssToTest)
1118 Simulator::Destroy();
1135 void DoRun()
override;
1151 void SetTrigVector(
const std::vector<uint16_t>& staIds, uint8_t bssColor);
1162 std::size_t payloadSize,
1173 void SendHeSuPpdu(uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor);
1195 uint32_t expectedSuccess,
1196 uint32_t expectedFailures,
1197 uint32_t expectedBytes);
1228 std::vector<bool> statusPerMpdu);
1247 const std::vector<uint16_t>& txStaIds,
1249 const std::vector<std::tuple<uint32_t, uint32_t, uint32_t>>& expectedCountersPerSta);
1273 m_countRxSuccessFromStas{},
1274 m_countRxFailureFromStas{},
1275 m_countRxBytesFromStas{},
1285 std::size_t payloadSize,
1310 std::ostringstream addr;
1311 addr <<
"00:00:00:00:00:0" << txStaId;
1315 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
1318 phy->SetPpduUid(uid);
1319 phy->Send(psdus, txVector);
1325 uint8_t bssColor)
const
1341 txVector.
SetRu(ru, txStaId);
1342 txVector.
SetMode(HePhy::GetHeMcs7(), txStaId);
1343 txVector.
SetNss(nss, txStaId);
1365 for (
auto staId : staIds)
1367 txVector.
SetRu(ru, staId);
1368 txVector.
SetMode(HePhy::GetHeMcs7(), staId);
1369 txVector.
SetNss(1, staId);
1385 std::size_t payloadSize,
1389 NS_LOG_FUNCTION(
this << txStaId << +nss << payloadSize << uid << +bssColor);
1398 std::ostringstream addr;
1399 addr <<
"00:00:00:00:00:0" << txStaId;
1403 psdus.insert(std::make_pair(txStaId, psdu));
1407 phy->CalculateTxDuration(psdu->
GetSize(), txVector,
phy->GetPhyBand(), txStaId);
1409 HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector,
phy->GetPhyBand()).first);
1411 phy->SetPpduUid(uid);
1412 phy->Send(psdus, txVector);
1425 std::ostringstream addr;
1426 addr <<
"00:00:00:00:00:0" << index + 1;
1442 std::ostringstream addr;
1443 addr <<
"00:00:00:00:00:0" << index + 1;
1454 uint32_t expectedSuccess,
1455 uint32_t expectedFailures,
1456 uint32_t expectedBytes)
1458 NS_LOG_FUNCTION(
this << staId << expectedSuccess << expectedFailures << expectedBytes);
1461 "The number of successfully received packets from STA "
1462 << staId <<
" is not correct!");
1465 "The number of unsuccessfully received packets from STA "
1466 << staId <<
" is not correct!");
1469 "The number of bytes received from STA " << staId <<
" is not correct!");
1477 "m_currentEvent for AP was not cleared");
1478 std::size_t sta = 1;
1483 "m_currentEvent for STA " << sta <<
" was not cleared");
1503 phy->GetAttribute(
"State", ptr);
1505 currentState = state->GetState();
1509 "PHY State " << currentState <<
" does not match expected state "
1531 phy->SetTriggerFrameUid(0);
1541 heConfiguration->SetAttribute(
"BssColor",
UintegerValue(bssColor));
1552 CreateObject<ConstantSpeedPropagationDelayModel>();
1553 spectrumChannel->SetPropagationDelayModel(delayModel);
1555 Ptr<Node> apNode = CreateObject<Node>();
1561 m_phyAp = CreateObject<MuMimoSpectrumWifiPhy>(0);
1576 for (std::size_t i = 1; i <= 4; ++i)
1578 Ptr<Node> staNode = CreateObject<Node>();
1584 phy->SetInterferenceHelper(staInterferenceHelper);
1586 phy->SetErrorRateModel(staErrorModel);
1587 phy->SetDevice(staDev);
1588 phy->AddChannel(spectrumChannel);
1623 const std::vector<uint16_t>& txStaIds,
1625 const std::vector<std::tuple<uint32_t, uint32_t, uint32_t>>& expectedCountersPerSta)
1627 static uint64_t uid = 0;
1641 uint16_t payloadSize = 1000;
1642 std::size_t index = 0;
1643 for (
auto txStaId : txStaIds)
1668 expectedStateAtEnd);
1673 for (
const auto& expectedCounters : expectedCountersPerSta)
1675 uint16_t expectedSuccessFromSta = std::get<0>(expectedCounters);
1676 uint16_t expectedFailuresFromSta = std::get<1>(expectedCounters);
1677 uint16_t expectedBytesFromSta = std::get<2>(expectedCounters);
1678 Simulator::Schedule(delay + (
m_delayStart * (staId - 1)),
1682 expectedSuccessFromSta,
1683 expectedFailuresFromSta,
1684 expectedBytesFromSta);
1698 RngSeedManager::SetSeed(1);
1699 RngSeedManager::SetRun(1);
1700 int64_t streamNumber = 0;
1704 phy->AssignStreams(streamNumber);
1707 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
1717 phy->SetOperatingChannel(
1727 Simulator::Schedule(delay,
1730 "Reception of HE TB PPDUs using full BW MU-MIMO");
1735 std::make_tuple(1, 0, 1000),
1737 std::make_tuple(1, 0, 1001),
1739 std::make_tuple(1, 0, 1002)
1747 Simulator::Schedule(delay,
1750 "Reception of HE TB PPDUs HE TB PPDUs using full BW MU-MIMO with an HE SU "
1751 "PPDU arriving during the 400 ns window");
1764 std::make_tuple(0, 1, 0),
1766 std::make_tuple(0, 1, 0),
1768 std::make_tuple(0, 1, 0)
1776 Simulator::Schedule(delay,
1779 "Reception of HE TB PPDUs using full BW MU-MIMO with an HE SU PPDU "
1780 "arriving during the HE portion");
1793 std::make_tuple(0, 1, 0),
1795 std::make_tuple(0, 1, 0),
1797 std::make_tuple(0, 1, 0)
1810 for (
const auto& delayStart : startDelays)
1817 NS_LOG_DEBUG(
"Run UL MU-MIMO PHY transmission test for "
1818 <<
m_channelWidth <<
" MHz with delay between each HE TB PPDUs of "
1825 NS_LOG_DEBUG(
"Run UL MU-MIMO PHY transmission test for "
1826 <<
m_channelWidth <<
" MHz with delay between each HE TB PPDUs of "
1833 NS_LOG_DEBUG(
"Run UL MU-MIMO PHY transmission test for "
1834 <<
m_channelWidth <<
" MHz with delay between each HE TB PPDUs of "
1841 NS_LOG_DEBUG(
"Run UL MU-MIMO PHY transmission test for "
1842 <<
m_channelWidth <<
" MHz with delay between each HE TB PPDUs of "
1847 Simulator::Destroy();
SpectrumWifiPhy used for testing MU-MIMO.
void SetTriggerFrameUid(uint64_t uid)
Since we assume trigger frame was previously received from AP, this is used to set its UID.
MuMimoSpectrumWifiPhy(uint16_t staId)
Constructor.
void DoInitialize() override
Initialize() implementation.
~MuMimoSpectrumWifiPhy() override
static TypeId GetTypeId()
Get the type ID.
void SetPpduUid(uint64_t uid)
Set the global PPDU UID counter.
void DoDispose() override
Destructor implementation.
Ptr< Event > GetCurrentEvent()
Ptr< MuMimoTestHePhy > m_ofdmTestHePhy
Pointer to HE PHY instance used for MU-MIMO test.
HE PHY slightly modified so as to return a given STA-ID in case of DL MU for MuMimoSpectrumWifiPhy.
MuMimoTestHePhy(uint16_t staId)
Constructor.
void SetGlobalPpduUid(uint64_t uid)
Set the global PPDU UID counter.
uint16_t m_staId
ID of the STA to which this PHY belongs to.
uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const override
Return the STA ID that has been assigned to the station this PHY belongs to.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Time m_expectedPpduDuration
expected duration to send MU PPDU
void RxFailureSta2(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 2.
void RxFailureSta1(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 1.
Ptr< SpectrumWifiPhy > m_phyAp
PHY of AP.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
TestDlMuMimoPhyTransmission()
Ptr< MuMimoSpectrumWifiPhy > m_phySta1
PHY of STA 1.
uint32_t m_countRxFailureSta3
count RX failure for STA 3
uint32_t m_countRxFailureSta1
count RX failure for STA 1
void GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
uint16_t m_frequency
frequency in MHz
void CheckPhyState(Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState)
Schedule now to check the PHY state.
uint32_t m_countRxSuccessSta2
count RX success for STA 2
void CheckResultsSta3(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 3.
void ResetResults()
Reset the results.
uint8_t m_nss
number of spatial streams per STA
uint16_t m_channelWidth
channel width in MHz
void RxSuccessSta3(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 3.
Ptr< MuMimoSpectrumWifiPhy > m_phySta3
PHY of STA 3.
void RxSuccessSta2(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 2.
void RxFailureSta3(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 3.
uint32_t m_countRxBytesSta2
count RX bytes for STA 2
void RunOne()
Run one function.
uint32_t m_countRxSuccessSta3
count RX success for STA 3
void SendMuPpdu(const std::vector< StaInfo > &staInfos)
Send DL MU-MIMO PPDU function.
void DoCheckPhyState(Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state now.
uint32_t m_countRxBytesSta1
count RX bytes for STA 1
uint32_t m_countRxFailureSta2
count RX failure for STA 2
void RxSuccessSta1(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 1.
void CheckResultsSta1(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 1.
Ptr< MuMimoSpectrumWifiPhy > m_phySta2
PHY of STA 2.
void DoRun() override
Implementation to actually run this TestCase.
void StopInterference()
Stop interference function.
uint32_t m_countRxBytesSta3
count RX bytes for STA 3
void CheckResultsSta2(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 2.
uint32_t m_countRxSuccessSta1
count RX success for STA 1
void DoRun() override
Implementation to actually run this TestCase.
static WifiTxVector BuildTxVector(uint16_t bw, const std::list< HeMuUserInfo > &userInfos)
Build a TXVECTOR for DL MU with the given bandwidth and user information.
void RxFailure(Ptr< const WifiPsdu > psdu)
Receive failure function.
void VerifyEventsCleared()
Verify all events are cleared at end of TX or RX.
void DoRun() override
Implementation to actually run this TestCase.
TestUlMuMimoPhyTransmission()
void LogScenario(const std::string &log) const
Log scenario description.
std::vector< uint32_t > m_countRxFailureFromStas
count RX failure from STAs
void SendHeSuPpdu(uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor)
Send HE SU PPDU function.
void SendHeTbPpdu(uint16_t txStaId, uint8_t nss, std::size_t payloadSize, uint64_t uid, uint8_t bssColor)
Send HE TB PPDU function.
void ScheduleTest(Time delay, const std::vector< uint16_t > &txStaIds, WifiPhyState expectedStateAtEnd, const std::vector< std::tuple< uint32_t, uint32_t, uint32_t >> &expectedCountersPerSta)
Schedule test to perform.
std::vector< uint32_t > m_countRxSuccessFromStas
count RX success from STAs
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::vector< uint32_t > m_countRxBytesFromStas
count RX bytes from STAs
void CheckRxFromSta(uint16_t staId, uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from a given STA.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
uint16_t m_channelWidth
channel width in MHz
void DoCheckPhyState(Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
void SetBssColor(Ptr< WifiPhy > phy, uint8_t bssColor)
Set the BSS color.
void Reset()
Reset function.
void CheckPhyState(Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
void RunOne()
Run one function.
Time m_expectedPpduDuration
expected duration to send MU PPDU
Ptr< MuMimoSpectrumWifiPhy > m_phyAp
PHY of AP.
void SetTrigVector(const std::vector< uint16_t > &staIds, uint8_t bssColor)
Set TRIGVECTOR for HE TB PPDU.
std::vector< Ptr< MuMimoSpectrumWifiPhy > > m_phyStas
PHYs of STAs.
void RxSuccess(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function.
uint16_t m_frequency
frequency in MHz
Time m_delayStart
delay between the start of each HE TB PPDUs
WifiTxVector GetTxVectorForHeTbPpdu(uint16_t txStaId, uint8_t nss, uint8_t bssColor) const
Get TXVECTOR for HE TB PPDU.
wifi PHY MU-MIMO Test Suite
This class can be used to hold variables of floating point type such as 'double' or 'float'.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void Dispose()
Dispose of this Object.
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
Hold objects of type Ptr<T>.
Smart pointer class similar to boost::intrusive_ptr.
void SetDevice(const Ptr< WifiNetDevice > device) override
Sets the device this PHY is associated with.
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
Attach a SpectrumChannel to use for a given frequency range.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
void SetMac(const Ptr< WifiMac > mac)
void SetHeConfiguration(Ptr< HeConfiguration > heConfiguration)
Ptr< HeConfiguration > GetHeConfiguration() const
void SetStandard(WifiStandard standard)
Set the Wifi standard.
void SetPhy(const Ptr< WifiPhy > phy)
void SetNumberOfAntennas(uint8_t antennas)
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
void SetReceiveErrorCallback(RxErrorCallback callback)
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
Ptr< Event > m_currentEvent
Hold the current event.
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
std::tuple< uint8_t, uint16_t, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying an operating channel.
void SetReceiveOkCallback(RxOkCallback callback)
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
This objects implements the PHY state machine of the Wifi device.
Mac48Address GetAddr2() const
Get the Transmitter Address (TA), which is common to all the MPDUs.
uint32_t GetSize() const
Return the size of the PSDU in bytes.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
bool IsSigBCompression() const
Indicate whether the Common field is present in the HE-SIG-B field.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
bool IsValid(WifiPhyBand band=WIFI_PHY_BAND_UNSPECIFIED) const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
bool IsDlOfdma() const
Return true if this TX vector is used for a downlink multi-user transmission using OFDMA.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
bool IsDlMuMimo() const
Return true if this TX vector is used for a downlink multi-user transmission using MU-MIMO.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double RatioToDb(double ratio)
Convert from ratio to dB.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
uint8_t staNss
Number of spatial streams used for the STA.
RxSignalInfo structure containing info on the received signal.
double snr
SNR in linear scale.
constexpr uint16_t DEFAULT_CHANNEL_WIDTH
static WifiPhyMuMimoTestSuite WifiPhyMuMimoTestSuite
the test suite
constexpr uint32_t DEFAULT_FREQUENCY
WifiPhyState
The state of the PHY layer.
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
@ RX
The PHY layer is receiving a packet.
@ IDLE
The PHY layer is IDLE.