47 const std::vector<std::uint32_t> UnicastDataRateIndexTable
48 { 0, 1000, 2000, 5500, 11000, 6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000 };
51 const std::vector<std::uint32_t> BroadcastDataRateIndexTable
52 { 0, 1000, 2000, 5500, 11000, 6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000 };
54 const char * pzLayerName {
"MACConfig"};
72 logServiceProvider_(logServiceProvider),
93 "Defines whether promiscuous mode is enabled or not. If promiscuous" 94 " mode is enabled, all received packets (intended for the given" 95 " node or not) that pass the probability of reception check are" 96 " sent upstream to the transport.");
101 "Defines if wireless multimedia mode (WMM) is enabled.");
106 "Defines the 802.11abg mode of operation. 0|2 = 802.11b" 107 " (DSS), 1 = 802.11a/g (OFDM), and 3 = 802.11b/g" 113 ConfigurationProperties::DEFAULT |
116 "Defines the data rate to be used when transmitting unicast" 117 " packets. The index (1 through 12) to rate (Mbps) mapping is as" 118 " follows: [1 2 5.5 11 6 9 12 18 24 36 48 54]. DSS rates [1 2" 119 " 5.5 11] Mbps are valid when mode is set to 802.11b or 802.11b/g." 120 " OFDM rates [6 9 12 18 24 36 48 54] Mbps are valid when mode is" 121 " set to 802.11a/g or 802.11b/g.",
126 ConfigurationProperties::DEFAULT |
129 "Defines the data rate to be used when transmitting" 130 " broadcast/multicast packets. The index (1 through 12) to rate" 131 " (Mbps) mapping is as follows: [1 2 5.5 11 6 9 12 18 24 36 48" 132 " 54]. DSS rates [1 2 5.5 11] Mbps are valid when mode is set to" 133 " 802.11b or 802.11b/g. OFDM rates [6 9 12 18 24 36 48 54] Mbps" 134 " are valid when mode is set to 802.11a/g or 802.11b/g.",
141 "Defines a threshold in bytes for when RTS/CTS is used as part of" 142 " the carrier sensing channel access protocol when transmitting" 150 "Defines whether flow control is enabled. Flow control only" 151 " works with the virtual transport and the setting must" 152 " match the setting within the virtual transport" 158 "Defines the maximum number of flow control tokens" 159 " (packet transmission units) that can be processed" 160 " from the virtual transport without being refreshed." 161 " The number of available tokens at any given time is" 162 " coordinated with the virtual transport and when the" 163 " token count reaches zero, no further packets are" 164 " transmitted causing application socket queues to backup.",
170 "Defines the max propagation distance in meters used" 171 " to compute slot size.");
176 "Defines the URI of the Packet Completion Rate (PCR)" 177 " curve file. The PCR curve file contains probability of" 178 " reception curves as a function of Signal to Interference" 179 " plus Noise Ratio (SINR) for each data rate.");
184 "Defines the queue size for category 0.");
189 "Defines the queue size for category 1.");
194 "Defines the queue size for category 2.");
199 "Defines the queue size for category 3.");
222 ConfigurationProperties::DEFAULT |
225 "Defines the minimum contention window size in slots" 231 ConfigurationProperties::DEFAULT |
234 "Defines the minimum contention window size in slots" 240 ConfigurationProperties::DEFAULT |
243 "Defines the minimum contention window size in slots" 249 ConfigurationProperties::DEFAULT |
252 "Defines the minimum contention window size in slots" 258 ConfigurationProperties::DEFAULT |
261 "Defines the maximum contention window size in slots" 267 ConfigurationProperties::DEFAULT |
270 "Defines the maximum contention window size in slots" 276 ConfigurationProperties::DEFAULT |
279 "Defines the maximum contention window size in slots" 285 ConfigurationProperties::DEFAULT |
288 "Defines the maximum contention window size in slots" 296 "Defines the arbitration inter frame spacing time for category 0" 297 " and contributes to the calculation of channel access overhead" 298 " when transmitting category 0 packets. If WMM is disabled," 299 " aifs0 is used for all traffic.",
307 "Defines the arbitration inter frame spacing time for category 1" 308 " and contributes to the calculation of channel access overhead" 309 " when transmitting category 1 packets.",
317 "Defines the arbitration inter frame spacing time for category 2" 318 " and contributes to the calculation of channel access overhead" 319 " when transmitting category 2 packets.",
327 "Defines the arbitration inter frame spacing time for category 3" 328 " and contributes to the calculation of channel access overhead" 329 " when transmitting category 3 packets.",
336 "Defines the transmit opportunity time for category 0.",
343 "Defines the transmit opportunity time for category 1.",
350 "Defines the transmit opportunity time for category 2.",
357 "Defines the transmit opportunity time for category 3.",
364 "Defines the maximum number of retries attempted for" 370 "Defines the maximum number of retries attempted for" 376 "Defines the maximum number of retries attempted for" 382 "Defines the maximum number of retries attempted for" 385 configRegistrar.
registerNumeric<
float>(
"channelactivityestimationtimer",
388 "Defines the channel activity estimation timer in seconds. The" 389 " timer determines the lag associated with the statistical" 390 " model used to estimate number of transmitting common and" 391 " hidden neighbors based on channel activity.",
399 "Defines the neighbor timeout in seconds for the neighbor" 400 " estimation algorithm.",
407 "Defines if radio metrics will be reported up via the Radio to" 408 " Router Interface (R2RI).");
415 "Defines the metric report interval in seconds in support of" 416 " the R2RI feature.",
423 "Defines the time in seconds of no RF receptions from a given" 424 " neighbor before it is removed from the neighbor table.",
563 return UnicastDataRateIndexTable[u8Index];
577 return BroadcastDataRateIndexTable[u8Index];
733 setCWMinRatioVector(0);
742 setCWMinRatioVector(1);
751 setCWMinRatioVector(2);
760 setCWMinRatioVector(3);
981 EMANE::Models::IEEE80211ABG::MACConfig::setCWMinRatioVector(std::uint8_t u8Category)
983 const std::uint16_t cw{
getCWMin(u8Category)};
987 const float fRatio{
static_cast<float>(cw) /
getCWMin(u8Index)};
989 configItems_.
CWMinRatioTable_[u8Category][u8Index] = fRatio > 1.0f ? 1.0f : fRatio;
995 EMANE::Models::IEEE80211ABG::MACConfig::initCWMinRatioTable()
1003 setCWMinRatioVector(u8Category);
1010 for(
const auto & item : update)
1012 if(!configureStaticItems(item) && !configureDynamicItems(item))
1016 "MACI %03hu %s::%s invalid config item %s",
1020 item.first.c_str());
1026 initCWMinRatioTable();
1035 for(
const auto & item : update)
1037 if(!configureDynamicItems(item))
1043 initCWMinRatioTable();
1052 if(item.first ==
"mode")
1058 "MACI %03hu %s::%s %s = %hhu",
1065 else if(item.first ==
"distance")
1071 "MACI %03hu %s::%s %s = %u",
1078 else if(item.first ==
"rtsthreshold")
1084 "MACI %03hu %s::%s %s = %hu",
1091 else if(item.first ==
"wmmenable")
1093 configItems_.
bWmmEnable_ = item.second[0].asBool();
1097 "MACI %03hu %s::%s %s = %s",
1104 else if(item.first ==
"queuesize0")
1110 "MACI %03hu %s::%s %s = %hhu",
1117 else if(item.first ==
"queuesize1")
1123 "MACI %03hu %s::%s %s = %hhu",
1130 else if(item.first ==
"queuesize2")
1136 "MACI %03hu %s::%s %s = %hhu",
1143 else if(item.first ==
"queuesize3")
1149 "MACI %03hu %s::%s %s = %hhu",
1156 else if(item.first ==
"aifs0")
1163 "MACI %03hu %s::%s %s = %ju",
1170 else if(item.first ==
"aifs1")
1177 "MACI %03hu %s::%s %s = %ju",
1184 else if(item.first ==
"aifs2")
1191 "MACI %03hu %s::%s %s = %ju",
1198 else if(item.first ==
"aifs3")
1205 "MACI %03hu %s::%s %s = %ju",
1212 else if(item.first ==
"msdu0")
1214 configItems_.
u16MSDU0_ = item.second[0].asUINT16();
1218 "MACI %03hu %s::%s %s = %hu",
1225 else if(item.first ==
"msdu1")
1227 configItems_.
u16MSDU1_ = item.second[0].asUINT16();
1231 "MACI %03hu %s::%s %s = %hu",
1238 else if(item.first ==
"msdu2")
1240 configItems_.
u16MSDU2_ = item.second[0].asUINT16();
1244 "MACI %03hu %s::%s %s = %hu",
1251 else if(item.first ==
"msdu3")
1253 configItems_.
u16MSDU3_ = item.second[0].asUINT16();
1257 "MACI %03hu %s::%s %s = %hu",
1264 else if(item.first ==
"txop0")
1271 "MACI %03hu %s::%s %s = %ju",
1278 else if(item.first ==
"txop1")
1285 "MACI %03hu %s::%s %s = %ju",
1292 else if(item.first ==
"txop2")
1299 "MACI %03hu %s::%s %s = %ju",
1306 else if(item.first ==
"txop3")
1313 "MACI %03hu %s::%s %s = %ju",
1321 else if(item.first ==
"retrylimit0")
1327 "MACI %03hu %s::%s %s = %hhu",
1334 else if(item.first ==
"retrylimit1")
1340 "MACI %03hu %s::%s %s = %hhu",
1347 else if(item.first ==
"retrylimit2")
1353 "MACI %03hu %s::%s %s = %hhu",
1360 else if(item.first ==
"retrylimit3")
1366 "MACI %03hu %s::%s %s = %hhu",
1373 else if(item.first ==
"flowcontrolenable")
1379 "MACI %03hu %s::%s %s = %s",
1386 else if(item.first ==
"flowcontroltokens")
1392 "MACI %03hu %s::%s %s = %hhu",
1399 else if(item.first ==
"pcrcurveuri")
1401 configItems_.
sPcrUri_ = item.second[0].asString();
1405 "MACI %03hu %s::%s %s = %s",
1412 else if(item.first ==
"neighbortimeout")
1414 float fValue{item.second[0].asFloat()};
1421 "MACI %03hu %s::%s %s = %f sec",
1428 else if(item.first ==
"channelactivityestimationtimer")
1430 float fValue{item.second[0].asFloat()};
1437 "MACI %03hu %s::%s %s = %f sec",
1444 else if(item.first ==
"radiometricenable")
1450 "MACI %03hu %s::%s %s = %s",
1457 else if(item.first ==
"radiometricreportinterval")
1459 float fValue{item.second[0].asFloat()};
1466 "MACI %03hu %s::%s %s = %f sec",
1473 else if(item.first ==
"neighbormetricdeletetime")
1475 float fValue{item.second[0].asFloat()};
1482 "MACI %03hu %s::%s %s = %f sec",
1501 if(item.first ==
"unicastrate")
1507 "MACI %03hu %s::%s %s = %hhu",
1514 else if(item.first ==
"multicastrate")
1520 "MACI %03hu %s::%s %s = %hhu",
1527 else if(item.first ==
"cwmin0")
1529 configItems_.
u16CWMin0_ = item.second[0].asUINT16();
1533 "MACI %03hu %s::%s %s = %hu",
1540 else if(item.first ==
"cwmin1")
1542 configItems_.
u16CWMin1_ = item.second[0].asUINT16();
1546 "MACI %03hu %s::%s %s = %hu",
1553 else if(item.first ==
"cwmin2")
1555 configItems_.
u16CWMin2_ = item.second[0].asUINT16();
1559 "MACI %03hu %s::%s %s = %hu",
1566 else if(item.first ==
"cwmin3")
1568 configItems_.
u16CWMin3_ = item.second[0].asUINT16();
1572 "MACI %03hu %s::%s %s = %hu",
1579 else if(item.first ==
"cwmax0")
1581 configItems_.
u16CWMax0_ = item.second[0].asUINT16();
1585 "MACI %03hu %s::%s %s = %hu",
1592 else if(item.first ==
"cwmax1")
1594 configItems_.
u16CWMax1_ = item.second[0].asUINT16();
1598 "MACI %03hu %s::%s %s = %hu",
1605 else if(item.first ==
"cwmax2")
1607 configItems_.
u16CWMax2_ = item.second[0].asUINT16();
1611 "MACI %03hu %s::%s %s = %hu",
1618 else if(item.first ==
"cwmax3")
1620 configItems_.
u16CWMax3_ = item.second[0].asUINT16();
1624 "MACI %03hu %s::%s %s = %hu",
1631 else if(item.first ==
"enablepromiscuousmode")
1637 "MACI %03hu %s::%s %s = %s",
bool configure(const ConfigurationUpdate &update)
Microseconds aifsMicroseconds0_
Microseconds txopMicroseconds2_
std::uint8_t getQueueSize(std::uint8_t) const
get the queue size for a given queue index
std::uint8_t u8QueueSize3_
std::uint16_t getRtsThreshold() const
void setCWMax3(std::uint16_t u16Value)
std::uint32_t getBroadcastDataRateKbps() const
get the broadcast datarate
Microseconds getNeighborTimeoutMicroseconds() const
std::uint8_t getNumAccessCategories() const
get the number of access categories (queues)
void setCWMax0(std::uint16_t u16Value)
Microseconds neighborMetricDeleteTimeMicroseconds_
void registerNonNumeric(const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
std::uint8_t u8RetryLimit1_
std::uint8_t getBroadcastDataRateIndex() const
get the broadcast datarate index
Microseconds getAifsMicroseconds(std::uint8_t) const
get the aifs for a given queue index
CWRatioTable CWMinRatioTable_
void setCWMin3(std::uint16_t u16Value)
Microseconds getTxOpMicroseconds(std::uint8_t) const
get the txop for a given queue index
const std::uint8_t MAX_ACCESS_CATEGORIES
std::uint16_t u16RtsThreshold_
std::uint16_t u16FlowControlTokens_
std::uint8_t u8QueueSize0_
Log service provider interface.
void setCWMin0(std::uint16_t u16Value)
std::uint16_t getCWMin(std::uint8_t) const
get the min contention window size for a given queue index
std::uint32_t u32MaxP2PDistance_
std::uint8_t u8BroadcastDataRateIndex_
Microseconds txopMicroseconds0_
void setCWMax2(std::uint16_t u16Value)
ConfigItems()
ieee80211abg mac configuration initializer.
const std::uint16_t MAX_PACKET_SIZE
Microseconds getChannelActivityIntervalMicroseconds() const
Microseconds radioMetricReportIntervalMicroseconds_
std::uint8_t u8ModeIndex_
Microseconds aifsMicroseconds1_
std::uint32_t getUnicastDataRateKbps() const
get the unicast datarate
std::uint16_t getFlowControlTokens() const
get the number of flow control tokens
std::chrono::microseconds Microseconds
void setCWMin1(std::uint16_t u16Value)
Microseconds txopMicroseconds3_
std::chrono::duration< double > DoubleSeconds
std::string getPcrUri() const
get the pcr uri
const std::uint8_t MODULATION_TYPE_INDEX_MIN
bool processConfiguration(const ConfigurationUpdate &update)
Microseconds aifsMicroseconds2_
Microseconds aifsMicroseconds3_
Microseconds getNeighborMetricDeleteTimeMicroseconds() const
const std::uint8_t QUEUE_SIZE_DEFAULT
Microseconds channelActivityIntervalMicroseconds_
std::uint8_t u8UnicastDataRateIndex_
MODULATION_TYPE getModulationType() const
get the modulation type
std::uint8_t getRetryLimit(std::uint8_t) const
get the retry limit for a given queue index
bool getPromiscuosEnable() const
get the promiscuous mode
Microseconds txopMicroseconds1_
The ConfigurationRegistrar allows NEM layers to register the configuration items they require...
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
void registerConfiguration(ConfigurationRegistrar &configRegistrar)
bool getRadioMetricEnable() const
bool bPromiscousModeEnable_
std::pair< std::string, std::vector< EMANE::Any > > ConfigurationNameAnyValues
Microseconds getRadioMetricReportIntervalMicroseconds() const
std::uint8_t getUnicastDataRateIndex() const
get the unicast datarate index
bool getWmmEnable() const
get the wmm mode
void setCWMax1(std::uint16_t u16Value)
void setCWMin2(std::uint16_t u16Value)
std::uint8_t u8RetryLimit3_
std::uint8_t u8RetryLimit2_
std::uint32_t getMaxDataRateKbps() const
void registerNumeric(const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", T minValue=std::numeric_limits< T >::lowest(), T maxValue=std::numeric_limits< T >::max(), std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
std::vector< float > CWRatioVector
Microseconds neighborTimeoutMicroseconds_
std::uint8_t u8QueueSize2_
std::uint8_t u8QueueSize1_
#define LOGGER_STANDARD_LOGGING(logger, level, fmt, args...)
std::uint16_t getCWMax(std::uint8_t) const
get the max contention window size for a given queue index
std::uint8_t u8RetryLimit0_
MACConfig(LogServiceProvider &logServiceProvider, NEMId id)
constructor
std::uint16_t getQueueEntrySize(std::uint8_t) const
get the queue entry size for a given queue index
CWRatioVector getCWMinRatioVector(std::uint8_t) const
std::uint32_t getMaxP2pDistance() const
get the max ptp distance
const std::uint8_t MODULATION_TYPE_INDEX_MAX
bool getFlowControlEnable() const
get the flow control enable status