33#include "ns3/eht-configuration.h" 
   34#include "ns3/he-configuration.h" 
   35#include "ns3/he-frame-exchange-manager.h" 
   36#include "ns3/ht-configuration.h" 
   38#include "ns3/packet.h" 
   39#include "ns3/pointer.h" 
   40#include "ns3/vht-configuration.h" 
   50    : m_qosSupported(false)
 
   73                          "The ssid we want to belong to.",
 
   77            .AddAttribute(
"QosSupported",
 
   78                          "This Boolean attribute is set to enable 802.11e/WMM-style QoS support " 
   85            .AddAttribute(
"CtsToSelfSupported",
 
   86                          "Use CTS to Self when using a rate that is not in the basic rate set.",
 
   91                "ShortSlotTimeSupported",
 
   92                "Whether or not short slot time is supported (only used by ERP APs or STAs).",
 
  101                          MakePointerChecker<Txop>())
 
  102            .AddAttribute(
"VO_Txop",
 
  103                          "Queue that manages packets belonging to AC_VO access class.",
 
  106                          MakePointerChecker<QosTxop>())
 
  107            .AddAttribute(
"VI_Txop",
 
  108                          "Queue that manages packets belonging to AC_VI access class.",
 
  111                          MakePointerChecker<QosTxop>())
 
  112            .AddAttribute(
"BE_Txop",
 
  113                          "Queue that manages packets belonging to AC_BE access class.",
 
  116                          MakePointerChecker<QosTxop>())
 
  117            .AddAttribute(
"BK_Txop",
 
  118                          "Queue that manages packets belonging to AC_BK access class.",
 
  121                          MakePointerChecker<QosTxop>())
 
  122            .AddAttribute(
"VO_MaxAmsduSize",
 
  123                          "Maximum length in bytes of an A-MSDU for AC_VO access class " 
  124                          "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " 
  125                          "Value 0 means A-MSDU aggregation is disabled for that AC.",
 
  128                          MakeUintegerChecker<uint16_t>(0, 11398))
 
  129            .AddAttribute(
"VI_MaxAmsduSize",
 
  130                          "Maximum length in bytes of an A-MSDU for AC_VI access class " 
  131                          "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " 
  132                          "Value 0 means A-MSDU aggregation is disabled for that AC.",
 
  135                          MakeUintegerChecker<uint16_t>(0, 11398))
 
  136            .AddAttribute(
"BE_MaxAmsduSize",
 
  137                          "Maximum length in bytes of an A-MSDU for AC_BE access class " 
  138                          "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " 
  139                          "Value 0 means A-MSDU aggregation is disabled for that AC.",
 
  142                          MakeUintegerChecker<uint16_t>(0, 11398))
 
  143            .AddAttribute(
"BK_MaxAmsduSize",
 
  144                          "Maximum length in bytes of an A-MSDU for AC_BK access class " 
  145                          "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " 
  146                          "Value 0 means A-MSDU aggregation is disabled for that AC.",
 
  149                          MakeUintegerChecker<uint16_t>(0, 11398))
 
  152                "Maximum length in bytes of an A-MPDU for AC_VO access class " 
  153                "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " 
  154                "and 15523200 for EHT PPDUs). " 
  155                "Value 0 means A-MPDU aggregation is disabled for that AC.",
 
  158                MakeUintegerChecker<uint32_t>(0, 15523200))
 
  161                "Maximum length in bytes of an A-MPDU for AC_VI access class " 
  162                "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " 
  163                "and 15523200 for EHT PPDUs). " 
  164                "Value 0 means A-MPDU aggregation is disabled for that AC.",
 
  167                MakeUintegerChecker<uint32_t>(0, 15523200))
 
  170                "Maximum length in bytes of an A-MPDU for AC_BE access class " 
  171                "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " 
  172                "and 15523200 for EHT PPDUs). " 
  173                "Value 0 means A-MPDU aggregation is disabled for that AC.",
 
  176                MakeUintegerChecker<uint32_t>(0, 15523200))
 
  179                "Maximum length in bytes of an A-MPDU for AC_BK access class " 
  180                "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " 
  181                "and 15523200 for EHT PPDUs). " 
  182                "Value 0 means A-MPDU aggregation is disabled for that AC.",
 
  185                MakeUintegerChecker<uint32_t>(0, 15523200))
 
  187                "VO_BlockAckThreshold",
 
  188                "If number of packets in VO queue reaches this value, " 
  189                "block ack mechanism is used. If this value is 0, block ack is never used." 
  190                "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
 
  193                MakeUintegerChecker<uint8_t>(0, 64))
 
  195                "VI_BlockAckThreshold",
 
  196                "If number of packets in VI queue reaches this value, " 
  197                "block ack mechanism is used. If this value is 0, block ack is never used." 
  198                "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
 
  201                MakeUintegerChecker<uint8_t>(0, 64))
 
  203                "BE_BlockAckThreshold",
 
  204                "If number of packets in BE queue reaches this value, " 
  205                "block ack mechanism is used. If this value is 0, block ack is never used." 
  206                "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
 
  209                MakeUintegerChecker<uint8_t>(0, 64))
 
  211                "BK_BlockAckThreshold",
 
  212                "If number of packets in BK queue reaches this value, " 
  213                "block ack mechanism is used. If this value is 0, block ack is never used." 
  214                "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
 
  217                MakeUintegerChecker<uint8_t>(0, 64))
 
  219                "VO_BlockAckInactivityTimeout",
 
  220                "Represents max time (blocks of 1024 microseconds) allowed for block ack" 
  221                "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a" 
  222                "block ack setup is completed and will be reset every time that a block ack" 
  223                "frame is received. If this value is 0, block ack inactivity timeout won't be " 
  227                MakeUintegerChecker<uint16_t>())
 
  229                "VI_BlockAckInactivityTimeout",
 
  230                "Represents max time (blocks of 1024 microseconds) allowed for block ack" 
  231                "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a" 
  232                "block ack setup is completed and will be reset every time that a block ack" 
  233                "frame is received. If this value is 0, block ack inactivity timeout won't be " 
  237                MakeUintegerChecker<uint16_t>())
 
  239                "BE_BlockAckInactivityTimeout",
 
  240                "Represents max time (blocks of 1024 microseconds) allowed for block ack" 
  241                "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a" 
  242                "block ack setup is completed and will be reset every time that a block ack" 
  243                "frame is received. If this value is 0, block ack inactivity timeout won't be " 
  247                MakeUintegerChecker<uint16_t>())
 
  249                "BK_BlockAckInactivityTimeout",
 
  250                "Represents max time (blocks of 1024 microseconds) allowed for block ack" 
  251                "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a" 
  252                "block ack setup is completed and will be reset every time that a block ack" 
  253                "frame is received. If this value is 0, block ack inactivity timeout won't be " 
  257                MakeUintegerChecker<uint16_t>())
 
  258            .AddTraceSource(
"MacTx",
 
  259                            "A packet has been received from higher layers and is being processed " 
  260                            "in preparation for " 
  261                            "queueing for transmission.",
 
  263                            "ns3::Packet::TracedCallback")
 
  266                "A packet has been dropped in the MAC layer before being queued for transmission. " 
  267                "This trace source is fired, e.g., when an AP's MAC receives from the upper layer " 
  268                "a packet destined to a station that is not associated with the AP or a STA's MAC " 
  269                "receives a packet from the upper layer while it is not associated with any AP.",
 
  271                "ns3::Packet::TracedCallback")
 
  274                "A packet has been received by this device, has been passed up from the physical " 
  276                "and is being forwarded up the local protocol stack.  This is a promiscuous trace.",
 
  278                "ns3::Packet::TracedCallback")
 
  279            .AddTraceSource(
"MacRx",
 
  280                            "A packet has been received by this device, has been passed up from " 
  281                            "the physical layer " 
  282                            "and is being forwarded up the local protocol stack. This is a " 
  283                            "non-promiscuous trace.",
 
  285                            "ns3::Packet::TracedCallback")
 
  286            .AddTraceSource(
"MacRxDrop",
 
  287                            "A packet has been dropped in the MAC layer after it has been passed " 
  288                            "up from the physical layer.",
 
  290                            "ns3::Packet::TracedCallback")
 
  291            .AddTraceSource(
"TxOkHeader",
 
  292                            "The header of successfully transmitted packet.",
 
  294                            "ns3::WifiMacHeader::TracedCallback",
 
  296                            "Use the AckedMpdu trace instead.")
 
  297            .AddTraceSource(
"TxErrHeader",
 
  298                            "The header of unsuccessfully transmitted packet.",
 
  300                            "ns3::WifiMacHeader::TracedCallback",
 
  302                            "Depending on the failure type, use the NAckedMpdu trace, the " 
  303                            "DroppedMpdu trace or one of the traces associated with TX timeouts.")
 
  304            .AddTraceSource(
"AckedMpdu",
 
  305                            "An MPDU that was successfully acknowledged, via either a " 
  306                            "Normal Ack or a Block Ack.",
 
  308                            "ns3::WifiMpdu::TracedCallback")
 
  309            .AddTraceSource(
"NAckedMpdu",
 
  310                            "An MPDU that was negatively acknowledged via a Block Ack.",
 
  312                            "ns3::WifiMpdu::TracedCallback")
 
  315                "An MPDU that was dropped for the given reason (see WifiMacDropReason).",
 
  317                "ns3::WifiMac::DroppedMpduCallback")
 
  319                "MpduResponseTimeout",
 
  320                "An MPDU whose response was not received before the timeout, along with " 
  321                "an identifier of the type of timeout (see WifiTxTimer::Reason) and the " 
  322                "TXVECTOR used to transmit the MPDU. This trace source is fired when a " 
  323                "CTS is missing after an RTS or a Normal Ack is missing after an MPDU " 
  324                "or after a DL MU PPDU acknowledged in SU format.",
 
  326                "ns3::WifiMac::MpduResponseTimeoutCallback")
 
  328                "PsduResponseTimeout",
 
  329                "A PSDU whose response was not received before the timeout, along with " 
  330                "an identifier of the type of timeout (see WifiTxTimer::Reason) and the " 
  331                "TXVECTOR used to transmit the PSDU. This trace source is fired when a " 
  332                "BlockAck is missing after an A-MPDU, a BlockAckReq (possibly in the " 
  333                "context of the acknowledgment of a DL MU PPDU in SU format) or a TB PPDU " 
  334                "(in the latter case the missing BlockAck is a Multi-STA BlockAck).",
 
  336                "ns3::WifiMac::PsduResponseTimeoutCallback")
 
  338                "PsduMapResponseTimeout",
 
  339                "A PSDU map for which not all the responses were received before the timeout, " 
  340                "along with an identifier of the type of timeout (see WifiTxTimer::Reason), " 
  341                "the set of MAC addresses of the stations that did not respond and the total " 
  342                "number of stations that had to respond. This trace source is fired when not " 
  343                "all the addressed stations responded to an MU-BAR Trigger frame (either sent as " 
  344                "a SU frame or aggregated to PSDUs in the DL MU PPDU), a Basic Trigger Frame or " 
  345                "a BSRP Trigger Frame.",
 
  347                "ns3::WifiMac::PsduMapResponseTimeoutCallback");
 
  361    for (
auto it = 
m_edca.begin(); it != 
m_edca.end(); ++it)
 
  363        it->second->Initialize();
 
  382    for (
auto it = 
m_edca.begin(); it != 
m_edca.end(); ++it)
 
  385        it->second = 
nullptr;
 
  478        link->feManager->SetPromisc();
 
  498    const auto it = std::find_if(
m_edca.cbegin(), 
m_edca.cend(), [ac](
const auto& pair) {
 
  499        return pair.first == ac;
 
  501    return (it == 
m_edca.cend() ? 
nullptr : it->second);
 
  617    m_edca.insert(std::make_pair(ac, edca));
 
  623    std::list<bool> isDsssOnly;
 
  624    for (
const auto& link : 
m_links)
 
  626        isDsssOnly.push_back(link->dsssSupported && !link->erpSupported);
 
  637    for (
auto it = 
m_edca.begin(); it != 
m_edca.end(); ++it)
 
  639        ConfigureDcf(it->second, cwMin, cwMax, isDsssOnly, it->first);
 
  647                      std::list<bool> isDsss,
 
  654    uint8_t aifsnValue = 0;
 
  655    Time txopLimitDsss(0);
 
  656    Time txopLimitNoDsss(0);
 
  662        cwMinValue = (cwmin + 1) / 4 - 1;
 
  663        cwMaxValue = (cwmin + 1) / 2 - 1;
 
  669        cwMinValue = (cwmin + 1) / 2 - 1;
 
  703    std::vector<uint32_t> cwValues(
m_links.size());
 
  704    std::vector<uint8_t> aifsnValues(
m_links.size());
 
  705    std::vector<Time> txopLimitValues(
m_links.size());
 
  707    std::fill(cwValues.begin(), cwValues.end(), cwMinValue);
 
  709    std::fill(cwValues.begin(), cwValues.end(), cwMaxValue);
 
  711    std::fill(aifsnValues.begin(), aifsnValues.end(), aifsnValue);
 
  713    std::transform(isDsss.begin(),
 
  715                   txopLimitValues.begin(),
 
  716                   [&txopLimitDsss, &txopLimitNoDsss](
bool dsss) {
 
  717                       return (dsss ? txopLimitDsss : txopLimitNoDsss);
 
  732            !link->phy || !link->phy->GetOperatingChannel().IsSet(),
 
  733            "[LinkID " << link->id
 
  734                       << 
"] PHY must have been set and an operating channel must have been set");
 
  738        if (!link->channelAccessManager)
 
  740            link->channelAccessManager = CreateObject<ChannelAccessManager>();
 
  742        link->channelAccessManager->SetupPhyListener(link->phy);
 
  744        if (!link->feManager)
 
  748        link->feManager->SetWifiPhy(link->phy);
 
  749        link->feManager->SetWifiMac(
this);
 
  750        link->feManager->SetLinkId(link->id);
 
  751        link->channelAccessManager->SetLinkId(link->id);
 
  752        link->channelAccessManager->SetupFrameExchangeManager(link->feManager);
 
  757            link->channelAccessManager->Add(
m_txop);
 
  759        for (
auto it = 
m_edca.begin(); it != 
m_edca.end(); ++it)
 
  761            it->second->SetWifiMac(
this);
 
  762            link->channelAccessManager->Add(it->second);
 
  796        feManager = CreateObject<HeFrameExchangeManager>();
 
  800        feManager = CreateObject<VhtFrameExchangeManager>();
 
  804        feManager = CreateObject<HtFrameExchangeManager>();
 
  808        feManager = CreateObject<QosFrameExchangeManager>();
 
  812        feManager = CreateObject<FrameExchangeManager>();
 
  818    feManager->GetWifiTxTimer().SetMpduResponseTimeoutCallback(
 
  819        MakeCallback(&MpduResponseTimeoutTracedCallback::operator(),
 
  821    feManager->GetWifiTxTimer().SetPsduResponseTimeoutCallback(
 
  822        MakeCallback(&PsduResponseTimeoutTracedCallback::operator(),
 
  824    feManager->GetWifiTxTimer().SetPsduMapResponseTimeoutCallback(
 
  825        MakeCallback(&PsduMapResponseTimeoutTracedCallback::operator(),
 
  827    feManager->SetDroppedMpduCallback(
 
  829    feManager->SetAckedMpduCallback(
 
  860                        "If links have been already created, the number of provided " 
  861                        "Remote Manager objects (" 
  862                            << stationManagers.size()
 
  864                               "match the number of links (" 
  867    for (std::size_t i = 0; i < stationManagers.size(); i++)
 
  876        m_links[i]->stationManager = stationManagers[i];
 
  886std::unique_ptr<WifiMac::LinkEntity>
 
  889    return std::make_unique<LinkEntity>();
 
  906std::optional<uint8_t>
 
  909    for (std::size_t ret = 0; ret < 
m_links.size(); ++ret)
 
  926                        "If links have been already created, the number of provided " 
  929                            << 
") must match the number " 
  933    for (std::size_t i = 0; i < phys.size(); i++)
 
  963            link->feManager->ResetPhy();
 
  965        if (link->channelAccessManager)
 
  967            link->channelAccessManager->RemovePhyListener(link->phy);
 
  983        m_txop = CreateObject<Txop>();
 
  998        std::map<AcIndex, Ptr<BlockAckManager>> bamMap;
 
 1101                                       << 
") does not support Enqueue() with from address");
 
 1156                auto htFem = DynamicCast<HtFrameExchangeManager>(link.feManager);
 
 1159                    htFem->SendAddBaResponse(&reqHdr, from);
 
 1175                auto htFem = DynamicCast<HtFrameExchangeManager>(link.feManager);
 
 1180                        ->SetBlockAckInactivityCallback(
 
 1197                    auto htFem = DynamicCast<HtFrameExchangeManager>(link.feManager);
 
 1200                        htFem->DestroyBlockAckAgreement(from, delBaHdr.
GetTid());
 
 1214                NS_FATAL_ERROR(
"Unsupported Action field in Block Ack Action frame");
 
 1232                  msduPair.second.GetSourceAddr(),
 
 1233                  msduPair.second.GetDestinationAddr());
 
 1374    return capabilities;
 
 1386    bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported();
 
 1387    capabilities.
SetLdpc(htConfiguration->GetLdpcSupported());
 
 1392    uint16_t maxAmsduSize =
 
 1394    if (maxAmsduSize <= 3839)
 
 1405    maxAmpduLength = (1UL << 
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
 
 1410    uint64_t maxSupportedRate = 0; 
 
 1414        uint8_t nss = (mcs.GetMcsValue() / 8) + 1;
 
 1416        uint64_t dataRate = mcs.GetDataRate(
phy->GetChannelWidth(), sgiSupported ? 400 : 800, nss);
 
 1417        if (dataRate > maxSupportedRate)
 
 1419            maxSupportedRate = dataRate;
 
 1420            NS_LOG_DEBUG(
"Updating maxSupportedRate to " << maxSupportedRate);
 
 1424        static_cast<uint16_t
>(maxSupportedRate / 1e6)); 
 
 1431    return capabilities;
 
 1444                    "VHT stations have to support 40 MHz operation");
 
 1446    bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported();
 
 1450    uint16_t maxAmsduSize =
 
 1452    if (maxAmsduSize <= 3839)
 
 1456    else if (maxAmsduSize <= 7935)
 
 1467    maxAmpduLength = (1UL << 
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
 
 1471    capabilities.
SetRxLdpc(htConfiguration->GetLdpcSupported());
 
 1477        if (mcs.GetMcsValue() > maxMcs)
 
 1479            maxMcs = mcs.GetMcsValue();
 
 1483    for (uint8_t nss = 1; nss <= 
phy->GetMaxSupportedRxSpatialStreams(); nss++)
 
 1487    for (uint8_t nss = 1; nss <= 
phy->GetMaxSupportedTxSpatialStreams(); nss++)
 
 1491    uint64_t maxSupportedRateLGI = 0; 
 
 1494        if (!mcs.IsAllowed(
phy->GetChannelWidth(), 1))
 
 1498        if (mcs.GetDataRate(
phy->GetChannelWidth()) > maxSupportedRateLGI)
 
 1500            maxSupportedRateLGI = mcs.GetDataRate(
phy->GetChannelWidth());
 
 1501            NS_LOG_DEBUG(
"Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
 
 1505        static_cast<uint16_t
>(maxSupportedRateLGI / 1e6)); 
 
 1507        static_cast<uint16_t
>(maxSupportedRateLGI / 1e6)); 
 
 1512    return capabilities;
 
 1525    uint8_t channelWidthSet = 0;
 
 1528        channelWidthSet |= 0x01;
 
 1530    if ((
phy->GetChannelWidth() >= 80) &&
 
 1533        channelWidthSet |= 0x02;
 
 1535    if ((
phy->GetChannelWidth() >= 160) &&
 
 1538        channelWidthSet |= 0x04;
 
 1542    if (heConfiguration->GetGuardInterval() == 
NanoSeconds(800))
 
 1553    maxAmpduLength = (1UL << 
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
 
 1560        if (mcs.GetMcsValue() > maxMcs)
 
 1562            maxMcs = mcs.GetMcsValue();
 
 1568    return capabilities;
 
 1578    return capabilities;
 
 1609    uint16_t maxSize = 0;
 
AttributeValue implementation for Boolean.
 
The IEEE 802.11be EHT Capabilities.
 
The Extended Capabilities Information Element.
 
void SetHtSupported(uint8_t htSupported)
Set the HT Supported flag.
 
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT Supported flag.
 
The IEEE 802.11ax HE Capabilities.
 
void SetHeSuPpdu1xHeLtf800nsGi(bool heSuPpdu1xHeLtf800nsGi)
Set 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
 
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
 
void SetHePpdu4xHeLtf800nsGi(bool heSuPpdu4xHeLtf800nsGi)
Set 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
 
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
 
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
 
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
 
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
 
The HT Capabilities Information Element.
 
void SetLdpc(uint8_t ldpc)
Set the LDPC field.
 
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
 
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
 
void SetLSigProtectionSupport(uint8_t lSigProtection)
Set the LSIG protection support.
 
void SetMaxAmsduLength(uint16_t maxAmsduLength)
Set the maximum AMSDU length.
 
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum N spatial streams.
 
void SetShortGuardInterval20(uint8_t shortGuardInterval)
Set the short guard interval 20 field.
 
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
 
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
 
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
 
void SetSupportedChannelWidth(uint8_t supportedChannelWidth)
Set the supported channel width field.
 
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
 
void SetShortGuardInterval40(uint8_t shortGuardInterval)
Set the short guard interval 40 field.
 
void SendDelbaFrame(Mac48Address addr, uint8_t tid, bool byOriginator)
Sends DELBA frame to cancel a block ack agreement with STA addressed by addr for TID tid.
 
A base class which provides memory management and object aggregation.
 
void Initialize()
Invoke DoInitialize on all Objects aggregated to this one.
 
void Dispose()
Dispose of this Object.
 
bool IsInitialized() const
Check if the object has been initialized.
 
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
 
Hold objects of type Ptr<T>.
 
Ptr< BlockAckManager > GetBaManager()
Get the Block Ack Manager associated with this QosTxop.
 
void SetDroppedMpduCallback(DroppedMpdu callback) override
 
void GotAddBaResponse(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
Event handler when an ADDBA response is received.
 
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ack mechanism.
 
void GotDelBaFrame(const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
Event handler when a DELBA frame is received.
 
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
 
The IEEE 802.11 SSID Information Element.
 
AttributeValue implementation for Ssid.
 
Simulation virtual time values and global simulation resolution.
 
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
 
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
 
void SetMaxCws(std::vector< uint32_t > maxCws)
Set the maximum contention window size for each link.
 
void SetTxopLimits(const std::vector< Time > &txopLimits)
Set the TXOP limit for each link.
 
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
 
void SetMinCws(std::vector< uint32_t > minCws)
Set the minimum contention window size for each link.
 
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
 
void SetAifsns(std::vector< uint8_t > aifsns)
Set the number of slots that make up an AIFS for each link.
 
a unique identifier for an interface.
 
@ ATTR_GET
The attribute can be read.
 
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
 
TypeId SetParent(TypeId tid)
Set the parent TypeId.
 
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
 
Hold an unsigned integer type.
 
The IEEE 802.11ac VHT Capabilities.
 
void SetRxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the receive highest supported LGI data rate.
 
void SetSupportedChannelWidthSet(uint8_t channelWidthSet)
Set the supported channel width set.
 
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
 
void SetRxLdpc(uint8_t rxLdpc)
Set the receive LDPC.
 
void SetTxStbc(uint8_t txStbc)
Set the transmit STBC.
 
void SetTxMcsMap(uint8_t mcs, uint8_t nss)
 
void SetShortGuardIntervalFor80Mhz(uint8_t shortGuardInterval)
Set the short guard interval 80 MHz.
 
void SetTxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the transmit highest supported LGI data rate.
 
void SetShortGuardIntervalFor160Mhz(uint8_t shortGuardInterval)
Set the short guard interval 160 MHz.
 
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
 
void SetRxMcsMap(uint8_t mcs, uint8_t nss)
 
void SetRxStbc(uint8_t rxStbc)
Set the receive STBC.
 
bool Get160MHzOperationSupported() const
 
uint16_t GetMaxAmsduSize(AcIndex ac) const
Return the maximum A-MSDU size of the given Access Category.
 
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
 
Ptr< QosTxop > GetBEQueue() const
Accessor for the AC_BE channel access function.
 
virtual void NotifyChannelSwitching(uint8_t linkId)
Notify that channel on the given link has been switched.
 
virtual void SetMacQueueScheduler(Ptr< WifiMacQueueScheduler > scheduler)
Set the wifi MAC queue scheduler.
 
Mac48Address GetBssid(uint8_t linkId) const
 
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
 
bool m_shortSlotTimeSupported
flag whether short slot time is supported
 
void ConfigurePhyDependentParameters(uint8_t linkId)
Configure PHY dependent parameters such as CWmin and CWmax on the given link.
 
Ptr< HeConfiguration > GetHeConfiguration() const
 
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
 
TypeOfStation GetTypeOfStation() const
Return the type of station.
 
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service.
 
Ptr< Txop > GetTxop() const
Accessor for the Txop object.
 
VhtCapabilities GetVhtCapabilities(uint8_t linkId) const
Return the VHT capabilities of the device for the given link.
 
Callback< void > m_linkDown
Callback when a link is down.
 
bool GetQosSupported() const
Return whether the device supports QoS.
 
virtual void SetAddress(Mac48Address address)
 
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
 
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
 
Mac48Address m_address
MAC address of this station.
 
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
 
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
 
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
 
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
 
Ptr< WifiMacQueueScheduler > m_scheduler
wifi MAC queue scheduler
 
void DoInitialize() override
Initialize() implementation.
 
std::vector< std::unique_ptr< LinkEntity > > m_links
vector of Link objects
 
TypeOfStation m_typeOfStation
the type of station
 
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
 
virtual void ConfigureStandard(WifiStandard standard)
 
void SetWifiRemoteStationManagers(const std::vector< Ptr< WifiRemoteStationManager > > &stationManagers)
 
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
 
bool GetErpSupported(uint8_t linkId) const
Return whether the device supports ERP on the given link.
 
bool GetHtSupported() const
Return whether the device supports HT.
 
void ResetWifiPhys()
Remove currently attached WifiPhy objects from this MAC.
 
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
 
void SetErpSupported(bool enable, uint8_t linkId)
Enable or disable ERP support for the given link.
 
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
 
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, std::list< bool > isDsss, AcIndex ac)
 
Ptr< WifiNetDevice > m_device
Pointer to the device.
 
Ptr< QosTxop > GetVOQueue() const
Accessor for the AC_VO channel access function.
 
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
 
MpduTracedCallback m_ackedMpduCallback
ack'ed MPDU callback
 
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
 
MpduTracedCallback m_nackedMpduCallback
nack'ed MPDU callback
 
bool GetEhtSupported() const
Return whether the device supports EHT.
 
bool GetHeSupported() const
Return whether the device supports HE.
 
HtCapabilities GetHtCapabilities(uint8_t linkId) const
Return the HT capabilities of the device for the given link.
 
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
 
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
 
virtual std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const
Get the ID of the link having the given MAC address, if any.
 
void NotifyPromiscRx(Ptr< const Packet > packet)
 
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
 
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
 
Ptr< EhtConfiguration > GetEhtConfiguration() const
 
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
 
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
 
void SetDsssSupported(bool enable, uint8_t linkId)
Enable or disable DSSS support for the given link.
 
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
 
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
 
void NotifyTx(Ptr< const Packet > packet)
 
static TypeId GetTypeId()
Get the type ID.
 
Ptr< HtConfiguration > GetHtConfiguration() const
 
uint32_t GetMaxAmpduSize(AcIndex ac) const
Return the maximum A-MPDU size of the given Access Category.
 
Ssid m_ssid
Service Set ID (SSID)
 
virtual void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
 
Ptr< QosTxop > GetVIQueue() const
Accessor for the AC_VI channel access function.
 
void SetBssid(Mac48Address bssid, uint8_t linkId)
 
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
 
Ptr< FrameExchangeManager > SetupFrameExchangeManager(WifiStandard standard)
Create a Frame Exchange Manager depending on the supported version of the standard.
 
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from)
 
void NotifyRx(Ptr< const Packet > packet)
 
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
 
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
 
void SetForwardUpCallback(ForwardUpCallback upCallback)
 
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
 
ExtendedCapabilities GetExtendedCapabilities() const
Return the extended capabilities of the device.
 
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
 
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
 
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
 
virtual bool SupportsSendFrom() const
 
virtual Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed,...
 
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
 
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
 
bool GetShortSlotTimeSupported() const
 
void SetupEdcaQueue(AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...
 
void SetLinkDownCallback(Callback< void > linkDown)
 
Ptr< QosTxop > GetBKQueue() const
Accessor for the AC_BK channel access function.
 
void SetPromisc()
Sets the interface in promiscuous mode.
 
Ptr< VhtConfiguration > GetVhtConfiguration() const
 
void NotifyRxDrop(Ptr< const Packet > packet)
 
virtual void SetLinkUpCallback(Callback< void > linkUp)
 
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
 
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
 
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
 
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
 
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
 
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
 
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
 
virtual void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
 
Mac48Address GetAddress() const
 
TracedCallback< const WifiMacHeader & > m_txErrCallback
transmit error callback
 
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
 
EhtCapabilities GetEhtCapabilities(uint8_t linkId) const
Return the EHT capabilities of the device for the given link.
 
Callback< void > m_linkUp
Callback when a link is up.
 
TracedCallback< const WifiMacHeader & > m_txOkCallback
transmit OK callback
 
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
 
HeCapabilities GetHeCapabilities(uint8_t linkId) const
Return the HE capabilities of the device for the given link.
 
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy > > &phys)
 
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
 
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
 
void NotifyTxDrop(Ptr< const Packet > packet)
 
void DoDispose() override
Destructor implementation.
 
bool GetDsssSupported(uint8_t linkId) const
Return whether the device supports DSSS on the given link.
 
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
 
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
 
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
 
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
 
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
 
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
 
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
 
Ptr< VhtConfiguration > GetVhtConfiguration() const
 
Ptr< EhtConfiguration > GetEhtConfiguration() const
 
Ptr< HtConfiguration > GetHtConfiguration() const
 
Ptr< HeConfiguration > GetHeConfiguration() const
 
WifiStandard GetStandard() const
Get the configured Wi-Fi standard.
 
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
 
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
 
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
 
Ptr< const AttributeChecker > MakeBooleanChecker()
 
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
 
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
 
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
 
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
 
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
 
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
 
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
 
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
 
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
 
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
 
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
 
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
 
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
 
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
 
@ WIFI_STANDARD_UNSPECIFIED
 
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
 
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
 
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
 
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
 
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
 
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
 
@ AC_UNDEF
Total number of ACs.
 
Every class exported by the ns3 library is enclosed in the ns3 namespace.
 
U * PeekPointer(const Ptr< U > &p)
 
TypeOfStation
Enumeration for type of station.
 
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 uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
 
Structure holding information specific to a single link.
 
Ptr< WifiRemoteStationManager > stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
 
Ptr< WifiPhy > phy
Wifi PHY object.
 
virtual ~LinkEntity()
Destructor (a virtual method is needed to make this struct polymorphic)
 
bool dsssSupported
set to true iff this WifiMac is to model 802.11b
 
bool erpSupported
set to true iff this WifiMac is to model 802.11g
 
Ptr< FrameExchangeManager > feManager
Frame Exchange Manager object.
 
Ptr< ChannelAccessManager > channelAccessManager
channel access manager object