90 if (item->
mcsValue == 9 && channelWidth == 20 && nss != 3)
94 if (item->
mcsValue == 6 && channelWidth == 80 && nss == 3)
113 uint64_t dataRate, phyRate;
114 dataRate =
GetDataRate (channelWidth, guardInterval, nss);
118 phyRate = dataRate * 6 / 5;
121 phyRate = dataRate * 4 / 3;
124 phyRate = dataRate * 3 / 2;
127 phyRate = dataRate * 2 / 1;
161 uint64_t dataRate = 0;
162 uint16_t usableSubCarriers = 0;
163 double symbolRate = 0;
164 double codingRate = 0;
168 dataRate = ((11000000 / 11) * numberOfBitsPerSubcarrier);
172 dataRate = ((11000000 / 8) * numberOfBitsPerSubcarrier);
176 usableSubCarriers = 48;
177 switch (channelWidth)
181 symbolRate = (1 / 4.0) * 1e6;
184 symbolRate = (1 / 8.0) * 1e6;
187 symbolRate = (1 / 16.0) * 1e6;
194 codingRate = (3.0 / 4.0);
197 codingRate = (2.0 / 3.0);
200 codingRate = (1.0 / 2.0);
204 NS_FATAL_ERROR (
"trying to get datarate for a mcs without any coding rate defined");
208 dataRate = lrint (ceil (symbolRate * usableSubCarriers * numberOfBitsPerSubcarrier * codingRate));
217 NS_ASSERT (guardInterval == 800 || guardInterval == 400);
218 symbolRate = (1 / (3.2 + (
static_cast<double> (guardInterval) / 1000))) * 1e6;
222 switch (channelWidth)
226 usableSubCarriers = 52;
231 usableSubCarriers = 108;
237 switch (channelWidth)
241 usableSubCarriers = 52;
244 usableSubCarriers = 108;
247 usableSubCarriers = 234;
250 usableSubCarriers = 468;
258 codingRate = (5.0 / 6.0);
261 codingRate = (3.0 / 4.0);
264 codingRate = (2.0 / 3.0);
267 codingRate = (1.0 / 2.0);
271 NS_FATAL_ERROR (
"trying to get datarate for a mcs without any coding rate defined with nss: " << +nss);
275 dataRate = lrint (ceil (symbolRate * usableSubCarriers * numberOfBitsPerSubcarrier * codingRate));
279 NS_ASSERT (guardInterval == 800 || guardInterval == 1600 || guardInterval == 3200);
280 symbolRate = (1 / (12.8 + (
static_cast<double> (guardInterval) / 1000))) * 1e6;
282 switch (channelWidth)
286 usableSubCarriers = 234;
289 usableSubCarriers = 468;
292 usableSubCarriers = 980;
295 usableSubCarriers = 1960;
302 codingRate = (5.0 / 6.0);
305 codingRate = (3.0 / 4.0);
308 codingRate = (2.0 / 3.0);
311 codingRate = (1.0 / 2.0);
315 NS_FATAL_ERROR (
"trying to get datarate for a mcs without any coding rate defined with nss: " << +nss);
319 dataRate = lrint (ceil (symbolRate * usableSubCarriers * numberOfBitsPerSubcarrier * codingRate));
323 NS_ASSERT (
"undefined datarate for the modulation class!");
527 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
541 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
555 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
569 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
580 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
589 NS_FATAL_ERROR (
"Trying to get reference rate for a non-HT rate");
698 uint16_t constellationSize)
717 NS_FATAL_ERROR (
"Error in creation of WifiMode named " << uniqueName << std::endl
718 <<
"Code rate must be WIFI_CODE_RATE_UNDEFINED iff Modulation Class is WIFI_MOD_CLASS_DSSS or WIFI_MOD_CLASS_HR_DSSS");
757 WifiModeItemList::const_iterator i;
761 if (i->uniqueUid == name)
772 << name <<
"\". Valid options are:");
793 for (WifiModeItemList::const_iterator i =
m_itemList.begin ();
796 if (i->uniqueUid == uniqueUid)
802 uint32_t uid =
static_cast<uint32_t
> (
m_itemList.size ());
817 static bool isFirstTime =
true;
821 uint32_t uid = factory.
AllocateUid (
"Invalid-WifiMode");
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
WifiMode()
Create an invalid WifiMode.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiCodeRate
This enumeration defines the various convolutional coding rates used for the OFDM transmission modes ...
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
#define ATTRIBUTE_HELPER_CPP(type)
Define the attribute value, accessor and checkers for class type.
uint8_t mcsValue
MCS value.
bool IsAllowed(uint16_t channelWidth, uint8_t nss) const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
WifiCodeRate codingRate
coding rate
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
uint16_t GetGuardInterval(void) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
uint32_t GetUid(void) const
Modulation class unknown or unspecified.
bool IsMandatory(void) const
bool operator<(const EventId &a, const EventId &b)
WifiMode Search(std::string name) const
Search and return WifiMode from a given name.
static WifiMode CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, WifiCodeRate codingRate, uint16_t constellationSize)
WifiModeItemList m_itemList
item list
WifiModulationClass GetModulationClass() const
std::string GetUniqueName(void) const
WifiModulationClass modClass
modulation class
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsHigherCodeRate(WifiMode mode) const
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
uint16_t constellationSize
constellation size
friend class WifiMode
allow WifiMode class access
uint16_t GetConstellationSize(void) const
uint64_t GetNonHtReferenceRate(void) const
No explicit coding (e.g., DSSS rates)
create WifiMode class instances and keep track of them.
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
bool operator==(const EventId &a, const EventId &b)
uint64_t GetPhyRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
static WifiModeFactory * GetFactory()
Return a WifiModeFactory.
uint32_t AllocateUid(std::string uniqueUid)
Allocate a WifiModeItem from a given uniqueUid.
uint16_t GetChannelWidth(void) const
WifiCodeRate GetCodeRate(void) const
WifiModeItem * Get(uint32_t uid)
Return a WifiModeItem at the given uid index.
uint8_t GetMcsValue(void) const
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass)
bool isMandatory
flag to indicate whether this mode is mandatory
bool IsHigherDataRate(WifiMode mode) const
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
This is the data associated to a unique WifiMode.
uint8_t GetNss(void) const
std::string uniqueUid
unique UID