14#include "ns3/ap-wifi-mac.h"
15#include "ns3/assert.h"
16#include "ns3/ctrl-headers.h"
17#include "ns3/gcr-manager.h"
19#include "ns3/mgt-action-headers.h"
20#include "ns3/recipient-block-ack-agreement.h"
21#include "ns3/snr-tag.h"
22#include "ns3/sta-wifi-mac.h"
23#include "ns3/vht-configuration.h"
24#include "ns3/wifi-mac-queue.h"
25#include "ns3/wifi-net-device.h"
26#include "ns3/wifi-utils.h"
31#undef NS_LOG_APPEND_CONTEXT
32#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
44 static TypeId tid =
TypeId(
"ns3::HtFrameExchangeManager")
46 .AddConstructor<HtFrameExchangeManager>()
47 .SetGroupName(
"Wifi");
102 return m_mac->GetQosTxop(tid)->GetBaManager();
112 if (!
m_mac->GetHtConfiguration() ||
120 else if (
auto agreement = qosTxop->GetBaManager()->GetAgreementAsOriginator(recipient, tid);
121 agreement && !agreement->get().IsReset())
130 uint32_t packets = qosTxop->GetWifiMacQueue()->GetNPackets(queueId);
133 (qosTxop->GetBlockAckThreshold() > 0 && packets >= qosTxop->GetBlockAckThreshold()) ||
136 m_mac->GetVhtConfiguration());
143std::optional<Mac48Address>
147 const auto& groupAddress = header.
GetAddr1();
150 auto qosTxop =
m_mac->GetQosTxop(tid);
151 const auto maxMpduSize =
153 const auto isGcrBa = (
m_apMac->GetGcrManager()->GetRetransmissionPolicy() ==
157 for (
const auto& recipients =
158 m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(groupAddress);
159 const auto& nextRecipient : recipients)
162 qosTxop->GetBaManager()->GetAgreementAsOriginator(nextRecipient, tid, groupAddress);
163 agreement && !agreement->get().IsReset())
168 const auto packets = qosTxop->GetWifiMacQueue()->GetNPackets(queueId);
169 const auto establish =
171 (qosTxop->GetBlockAckThreshold() > 0 && packets >= qosTxop->GetBlockAckThreshold()) ||
172 (maxMpduSize > 0 && packets > 1));
176 return nextRecipient;
186 uint16_t startingSeq,
190 std::optional<Mac48Address> gcrGroupAddr)
193 << gcrGroupAddr.has_value());
200 hdr.
SetAddr1(addr1 ? *addr1 : dest);
237 GetBaManager(tid)->CreateOriginatorAgreement(reqHdr, dest);
239 packet->AddHeader(reqHdr);
240 packet->AddHeader(actionHdr);
245 uint16_t sequence =
m_txMiddle->GetNextSequenceNumberFor(&mpdu->GetHeader());
246 mpdu->GetHeader().SetSequenceNumber(sequence);
251 if (!
TryAddMpdu(mpdu, txParams, availableTime))
253 NS_LOG_DEBUG(
"Not enough time to send the ADDBA Request frame");
258 m_mac->GetQosTxop(tid)->GetWifiMacQueue()->Enqueue(mpdu);
291 auto tid = reqHdr.
GetTid();
294 auto bufferSize = std::min(
m_mac->GetMpduBufferSize(),
m_mac->GetMaxBaBufferSize(originator));
309 packet->AddHeader(respHdr);
310 packet->AddHeader(actionHdr);
315 originator = *originatorMld;
329 agreement->get().m_inactivityEvent =
355 NS_ASSERT_MSG(it->second,
"The pointer to the pending ADDBA_RESPONSE cannot be null");
366 m_mac->GetQosTxop(tid)->Queue(mpdu);
373 std::optional<Mac48Address> gcrGroupAddr)
375 NS_LOG_FUNCTION(
this << addr << +tid << byOriginator << gcrGroupAddr.has_value());
388 if (gcrGroupAddr.has_value())
399 packet->AddHeader(delbaHdr);
400 packet->AddHeader(actionHdr);
422 if (
auto mpdu =
GetBar(edca->GetAccessCategory());
447 edca->GetBlockAckInactivityTimeout(),
458 edca->GetBlockAckInactivityTimeout(),
470 return SendDataFrame(peekedItem, availableTime, initialFrame);
483 std::optional<uint8_t> optTid,
484 std::optional<Mac48Address> optAddress)
486 NS_LOG_FUNCTION(
this << +ac << optTid.has_value() << optAddress.has_value());
488 "Either both or none of TID and address must be provided");
492 auto queue =
m_mac->GetTxopQueue(ac);
493 queue->WipeAllExpiredMpdus();
502 while ((bar = queue->PeekFirstAvailable(
m_linkId, prevBar)) && bar && bar->GetHeader().IsCtl())
504 if (bar->GetHeader().IsBlockAckReq())
507 bar->GetPacket()->PeekHeader(reqHdr);
510 auto recipientMld =
m_mac->GetMldAddress(recipient);
516 (bar->GetHeader().GetAddr2() ==
m_mac->GetAddress() && recipientMld &&
518 "Cannot use link " << +
m_linkId <<
" to send BAR: " << *bar);
526 <<
" cannot be returned because it is not addressed"
527 " to the given station for the given TID");
532 auto agreement =
m_mac->GetBaAgreementEstablishedAsOriginator(
535 reqHdr.
IsGcr() ? std::optional{reqHdr.GetGcrGroupAddress()} : std::nullopt);
536 if (
const auto isGcrBa =
537 reqHdr.
IsGcr() && (
m_apMac->GetGcrManager()->GetRetransmissionPolicy() ==
539 agreement && reqHdr.
IsGcr() && !isGcrBa)
541 NS_LOG_DEBUG(
"Skip GCR BAR if GCR-BA retransmission policy is not selected");
547 NS_LOG_DEBUG(
"BA agreement with " << recipient <<
" for TID=" << +tid
548 <<
" was torn down");
553 if (
auto seqNo = agreement->get().GetStartingSequence();
558 packet->AddHeader(reqHdr);
559 auto updatedBar =
Create<WifiMpdu>(packet, bar->GetHeader(), bar->GetTimestamp());
560 queue->Replace(bar, updatedBar);
570 if (bar->GetHeader().GetAddr2() ==
m_self && recipientMld)
577 while ((otherBar = queue->PeekByQueueId(queueId, otherBar)))
579 if (otherBar->GetHeader().IsBlockAckReq())
582 otherBar->GetPacket()->PeekHeader(otherReqHdr);
585 queue->Remove(otherBar);
593 if (bar->GetHeader().IsTrigger() && !optAddress && !selectedBar)
604 auto baManager =
m_mac->GetQosTxop(ac)->GetBaManager();
605 for (
const auto& [recipient, tid] : baManager->GetSendBarIfDataQueuedList())
613 if (queue->PeekByTidAndAddress(tid, recipient) &&
616 auto [reqHdr, hdr] =
m_mac->GetQosTxop(ac)->PrepareBlockAckRequest(recipient, tid);
618 pkt->AddHeader(reqHdr);
620 baManager->RemoveFromSendBarIfDataQueuedList(recipient, tid);
621 queue->Enqueue(selectedBar);
627 if (selectedBar && selectedBar->GetHeader().GetAddr2() !=
m_self)
631 NS_ASSERT(selectedBar->GetHeader().GetAddr2() ==
m_mac->GetAddress());
633 const auto currAddr1 = selectedBar->GetHeader().GetAddr1();
636 selectedBar->GetHeader().SetAddr1(addr1);
637 selectedBar->GetHeader().SetAddr2(
m_self);
638 queue->Enqueue(selectedBar);
652 if (!mpdu->GetHeader().IsBlockAckReq())
654 NS_LOG_DEBUG(
"Block Ack Manager returned no frame to send");
666 if (!
TryAddMpdu(mpdu, txParams, availableTime))
668 NS_LOG_DEBUG(
"Not enough time to send the BAR frame returned by the Block Ack Manager");
676 txParams.
m_txVector = blockAcknowledgment->blockAckTxVector;
688 NS_ASSERT(peekedItem && peekedItem->GetHeader().IsQosData() &&
689 !peekedItem->GetHeader().GetAddr1().IsBroadcast() && !peekedItem->IsFragment());
697 edca->GetNextMpdu(
m_linkId, peekedItem, txParams, availableTime, initialFrame);
706 std::vector<Ptr<WifiMpdu>> mpduList =
710 if (mpduList.size() > 1)
738 auto blockAcknowledgment =
static_cast<WifiBlockAck*
>(acknowledgment);
741 blockAcknowledgment->blockAckTxVector,
743 blockAcknowledgment->acknowledgmentTime =
m_phy->
GetSifs() + baTxDuration;
747 auto barBlockAcknowledgment =
static_cast<WifiBarBlockAck*
>(acknowledgment);
750 barBlockAcknowledgment->blockAckReqTxVector,
754 barBlockAcknowledgment->blockAckTxVector,
756 barBlockAcknowledgment->acknowledgmentTime =
782 if (mpdu->GetHeader().IsQosData())
784 uint8_t tid = mpdu->GetHeader().GetQosTid();
787 if (
m_mac->GetBaAgreementEstablishedAsOriginator(mpdu->GetHeader().GetAddr1(), tid))
790 edca->GetBaManager()->NotifyGotAck(
m_linkId, mpdu);
795 else if (mpdu->GetHeader().IsAction())
797 auto addr1 = mpdu->GetHeader().GetAddr1();
801 p->RemoveHeader(actionHdr);
807 p->PeekHeader(delBa);
808 auto tid = delBa.
GetTid();
826 p->PeekHeader(addBa);
839 p->PeekHeader(addBa);
840 auto tid = addBa.
GetTid();
845 "Recipient BA agreement {" << address <<
", " << +tid <<
"} not found");
865 NS_LOG_DEBUG(
"Schedule a transmission from Block Ack Manager in a SIFS");
889 if (mpdu->GetHeader().IsQosData())
891 GetBaManager(mpdu->GetHeader().GetQosTid())->NotifyDiscardedMpdu(mpdu);
893 else if (mpdu->GetHeader().IsAction())
896 mpdu->GetPacket()->PeekHeader(actionHdr);
900 const auto tid =
GetTid(mpdu->GetPacket(), mpdu->GetHeader());
901 auto recipient = mpdu->GetHeader().GetAddr1();
905 recipient = *mldAddr;
907 auto p = mpdu->GetPacket()->Copy();
908 p->RemoveHeader(actionHdr);
910 p->PeekHeader(addBa);
915 agreement && agreement->get().IsPending())
919 qosTxop->NotifyOriginatorAgreementNoReply(recipient,
934 if (mpdu->IsQueued())
945 if (mpdu->GetHeader().IsQosData())
947 uint8_t tid = mpdu->GetHeader().GetQosTid();
950 if (
m_mac->GetBaAgreementEstablishedAsOriginator(mpdu->GetHeader().GetAddr1(), tid))
953 edca->GetBaManager()->NotifyMissedAck(
m_linkId, mpdu);
965 const auto tids = psdu->GetTids();
966 const auto isGcr =
IsGcr(
m_mac, psdu->GetHeader(0));
967 auto agreementEstablished =
970 ->IsGcrAgreementEstablished(
971 psdu->GetHeader(0).GetAddr1(),
973 m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(
974 psdu->GetHeader(0).GetAddr1()))
975 :
m_mac->GetBaAgreementEstablishedAsOriginator(psdu->GetAddr1(), *tids.begin())
978 if (!agreementEstablished)
985 auto mpduIt = psdu->end();
989 std::advance(mpduIt, -1);
991 const WifiMacHeader& hdr = (*mpduIt)->GetOriginal()->GetHeader();
995 agreementEstablished =
997 psdu->GetHeader(0).GetAddr1(),
999 m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(
1000 psdu->GetHeader(0).GetAddr1()))
1001 :
m_mac->GetBaAgreementEstablishedAsOriginator(psdu->GetAddr1(), tid)
1005 if (!hdr.
IsRetry() && !(*mpduIt)->IsInFlight())
1010 uint16_t currentNextSeq =
m_txMiddle->PeekNextSequenceNumberFor(&hdr);
1014 (*mpduIt)->UnassignSeqNo();
1018 <<
", next sequence "
1020 << hdr.
GetAddr1() <<
",tid=" << +tid <<
" is "
1021 <<
m_txMiddle->PeekNextSequenceNumberFor(&hdr));
1025 }
while (mpduIt != psdu->begin());
1057#ifdef NS3_BUILD_PROFILE_DEBUG
1064 NS_ASSERT(mpdu->GetHeader().IsCtl() || mpdu->IsQueued());
1083 if (mpdu->IsQueued())
1143 NS_ASSERT_MSG(tids.size() <= 1,
"Multi-TID A-MPDUs are not supported");
1151 NS_LOG_DEBUG(
"Prepare groupcast PSDU for retry");
1152 for (const auto& mpdu : *PeekPointer(psdu))
1154 mpdu->ResetInFlight(m_linkId);
1156 if (m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
1158 mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
1160 mpdu->GetHeader().SetRetry();
1166 if (
m_apMac->GetGcrManager()->GetRetransmissionPolicy() ==
1190 m_psdu->SetDuration(GetPsduDurationId(txDuration, m_txParams));
1195 auto blockAcknowledgment =
static_cast<WifiBlockAck*
>(m_txParams.m_acknowledgment.get());
1198 txDuration + m_phy->GetSifs() + m_phy->GetSlot() +
1203 {m_psdu->GetAddr1()},
1207 m_txParams.m_txVector);
1208 m_channelAccessManager->NotifyAckTimeoutStartNow(
timeout);
1212 m_psdu->SetDuration(GetPsduDurationId(txDuration, m_txParams));
1215 const auto tids = m_psdu->GetTids();
1217 "Acknowledgment method incompatible with a Multi-TID A-MPDU");
1218 const auto tid = *tids.begin();
1220 auto edca = m_mac->GetQosTxop(tid);
1221 const auto isGcr =
IsGcr(m_mac, m_psdu->GetHeader(0));
1222 const auto& recipients =
1223 isGcr ? m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(m_psdu->GetAddr1())
1225 std::optional<Mac48Address> gcrGroupAddress{isGcr ? std::optional{m_psdu->GetAddr1()}
1227 for (
const auto& recipient : recipients)
1229 auto [reqHdr, hdr] = edca->PrepareBlockAckRequest(recipient, tid, gcrGroupAddress);
1230 GetBaManager(tid)->ScheduleBar(reqHdr, hdr);
1236 NS_LOG_DEBUG(
"Restore group address of PSDU");
1237 for (const auto& mpdu : *PeekPointer(psdu))
1240 if (m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
1242 mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
1249 TransmissionSucceeded();
1255 NS_ABORT_MSG(
"Unable to handle the selected acknowledgment method ("
1256 << m_txParams.m_acknowledgment.get() <<
")");
1260 if (m_psdu->GetNMpdus() > 1)
1262 ForwardPsduDown(m_psdu, m_txParams.m_txVector);
1266 ForwardMpduDown(*m_psdu->begin(), m_txParams.m_txVector);
1269 if (m_txTimer.IsRunning())
1272 m_sentFrameTo = {m_psdu->GetAddr1()};
1275 if (m_txParams.m_acknowledgment->method == WifiAcknowledgment::NONE)
1289 auto& hdr = mpdu->GetHeader();
1291 if (hdr.IsQosData() && hdr.HasData())
1293 auto tid = hdr.GetQosTid();
1294 m_mac->GetQosTxop(tid)->CompleteMpduTx(mpdu);
1305 std::array<std::optional<uint8_t>, 8> queueSizeForTid;
1314 auto edca = m_mac->GetQosTxop(tid);
1316 if (m_mac->GetTypeOfStation() ==
STA && (m_setQosQueueSize || hdr.
IsQosEosp()))
1319 if (!queueSizeForTid[tid].has_value())
1321 queueSizeForTid[tid] =
1322 edca->GetQosQueueSize(tid, mpdu->GetOriginal()->GetHeader().GetAddr1());
1329 if (m_mac->GetTypeOfStation() ==
AP && m_apMac->UseGcr(hdr) &&
1330 m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
1332 const auto& gcrConcealmentAddress =
1333 m_apMac->GetGcrManager()->GetGcrConcealmentAddress();
1334 hdr.
SetAddr1(gcrConcealmentAddress);
1339 QosFrameExchangeManager::FinalizeMacHeader(psdu);
1357 NS_LOG_DEBUG(
"Transmitting a PSDU: " << *psdu <<
" TXVECTOR: " << txVector);
1358 FinalizeMacHeader(psdu);
1359 NotifyTxToEdca(psdu);
1360 m_allowedWidth = std::min(m_allowedWidth, txVector.
GetChannelWidth());
1362 if (psdu->IsAggregate())
1367 auto txDuration = WifiPhy::CalculateTxDuration(psdu, txVector, m_phy->GetPhyBand());
1371 if (!psdu->GetHeader(0).IsPsPoll())
1373 m_txNav =
Max(m_txNav, Simulator::Now() + txDuration + psdu->GetDuration());
1376 m_phy->Send(psdu, txVector);
1382 Time ppduDurationLimit)
const
1397 if (mpdu->GetHeader().IsQosData())
1399 tid = mpdu->GetHeader().GetQosTid();
1407 NS_ABORT_MSG(
"Cannot aggregate a non-QoS data frame to an A-MPDU that does"
1408 " not contain any QoS data frame");
1413 if (!IsWithinAmpduSizeLimit(ampduSize, receiver, tid, modulation))
1419 return IsWithinSizeAndTimeLimits(ampduSize, receiver, txParams, ppduDurationLimit);
1423HtFrameExchangeManager::IsWithinAmpduSizeLimit(
uint32_t ampduSize,
1430 uint32_t maxAmpduSize = m_mpduAggregator->GetMaxAmpduSize(receiver, tid, modulation);
1432 if (maxAmpduSize == 0)
1438 if (ampduSize > maxAmpduSize)
1440 NS_LOG_DEBUG(
"the frame does not meet the constraint on max A-MPDU size (" << maxAmpduSize
1450 Time availableTime)
const
1452 NS_ASSERT(msdu && msdu->GetHeader().IsQosData());
1458 UpdateTxDuration(msdu->GetHeader().GetAddr1(), txParams);
1462 auto protectionTime = txParams.
m_protection->protectionTime;
1464 std::unique_ptr<WifiProtection> protection;
1465 protection = GetProtectionManager()->TryAggregateMsdu(msdu, txParams);
1466 bool protectionSwapped =
false;
1471 CalculateProtectionTime(protection.get());
1472 protectionTime = protection->protectionTime;
1476 protectionSwapped =
true;
1484 std::unique_ptr<WifiAcknowledgment> acknowledgment;
1485 acknowledgment = GetAckManager()->TryAggregateMsdu(msdu, txParams);
1486 bool acknowledgmentSwapped =
false;
1491 CalculateAcknowledgmentTime(acknowledgment.get());
1492 acknowledgmentTime = acknowledgment->acknowledgmentTime;
1496 acknowledgmentSwapped =
true;
1498 NS_ASSERT(acknowledgmentTime.has_value());
1500 Time ppduDurationLimit = Time::Min();
1501 if (availableTime != Time::Min())
1503 ppduDurationLimit = availableTime - *protectionTime - *acknowledgmentTime;
1506 if (!IsWithinLimitsIfAggregateMsdu(msdu, txParams, ppduDurationLimit))
1512 if (protectionSwapped)
1516 if (acknowledgmentSwapped)
1529 Time ppduDurationLimit)
const
1531 NS_ASSERT(msdu && msdu->GetHeader().IsQosData());
1534 auto receiver = msdu->GetHeader().GetAddr1();
1535 auto tid = msdu->GetHeader().GetQosTid();
1538 NS_ASSERT_MSG(psduInfo,
"No PSDU info for receiver " << receiver);
1541 uint16_t maxAmsduSize = m_msduAggregator->GetMaxAmsduSize(receiver, tid, modulation);
1543 if (maxAmsduSize == 0)
1549 if (psduInfo->amsduSize > maxAmsduSize)
1551 NS_LOG_DEBUG(
"No other MSDU can be aggregated: maximum A-MSDU size (" << maxAmsduSize
1558 auto ampduSize = txParams.
GetSize(receiver);
1564 if (!IsWithinAmpduSizeLimit(ampduSize, receiver, tid, modulation))
1570 return IsWithinSizeAndTimeLimits(ampduSize, receiver, txParams, ppduDurationLimit);
1578 GetWifiRemoteStationManager()->ReportDataFailed(*psdu->begin());
1580 MissedBlockAck(psdu, txVector);
1583 TransmissionFailed();
1591 auto recipient = psdu->GetAddr1();
1592 auto recipientMld = GetWifiRemoteStationManager()->GetMldAddress(recipient).value_or(recipient);
1595 std::optional<Mac48Address> gcrGroupAddress;
1597 if (psdu->GetNMpdus() == 1 && psdu->GetHeader(0).IsBlockAckReq())
1601 psdu->GetPayload(0)->PeekHeader(baReqHdr);
1603 if (baReqHdr.
IsGcr())
1611 std::set<uint8_t> tids = psdu->GetTids();
1612 NS_ABORT_MSG_IF(tids.size() > 1,
"Multi-TID A-MPDUs not handled here");
1614 tid = *tids.begin();
1616 GetWifiRemoteStationManager()
1617 ->ReportAmpduTxStatus(recipient, 0, psdu->GetNMpdus(), 0, 0, txVector);
1619 if (
auto droppedMpdu = DropMpduIfRetryLimitReached(psdu))
1622 GetWifiRemoteStationManager()->ReportFinalDataFailed(droppedMpdu);
1628 if (edca->UseExplicitBarAfterMissedBlockAck() || isBar)
1631 const auto retransmitBar =
1632 gcrGroupAddress.has_value()
1633 ? GetBaManager(tid)->NeedGcrBarRetransmission(gcrGroupAddress.value(),
1636 : GetBaManager(tid)->NeedBarRetransmission(tid, recipientMld);
1639 NS_LOG_DEBUG(
"Missed Block Ack, transmit a BlockAckReq");
1652 psdu->GetHeader(0).SetRetry();
1657 auto [reqHdr, hdr] = edca->PrepareBlockAckRequest(recipient, tid);
1658 GetBaManager(tid)->ScheduleBar(reqHdr, hdr);
1663 NS_LOG_DEBUG(
"Missed Block Ack, do not transmit a BlockAckReq");
1670 if (m_mac->GetBaAgreementEstablishedAsOriginator(recipient, tid))
1674 GetBaManager(tid)->AddToSendBarIfDataQueuedList(recipientMld, tid);
1681 GetBaManager(tid)->NotifyMissedBlockAck(m_linkId, recipientMld, tid);
1690 std::optional<Mac48Address> gcrGroupAddr)
1692 NS_LOG_FUNCTION(
this << durationId << blockAckTxVector << rxSnr << gcrGroupAddr.has_value());
1696 auto addr1 = agreement.
GetPeer();
1697 if (
auto originator = GetWifiRemoteStationManager()->GetAffiliatedStaAddress(addr1))
1699 addr1 = *originator;
1708 if (gcrGroupAddr.has_value())
1716 packet->AddHeader(blockAck);
1717 Ptr<WifiPsdu> psdu = GetWifiPsdu(Create<WifiMpdu>(packet, hdr), blockAckTxVector);
1725 Time baDurationId = durationId - m_phy->GetSifs() -
1726 WifiPhy::CalculateTxDuration(psdu, blockAckTxVector, m_phy->GetPhyBand());
1732 psdu->GetHeader(0).SetDuration(baDurationId);
1736 psdu->GetPayload(0)->AddPacketTag(tag);
1738 ForwardPsduDown(psdu, blockAckTxVector);
1747 NS_LOG_FUNCTION(
this << *mpdu << rxSignalInfo << txVector << inAmpdu);
1750 NS_ASSERT(mpdu->GetHeader().GetAddr1().IsGroup() || mpdu->GetHeader().GetAddr1() == m_self);
1752 double rxSnr = rxSignalInfo.
snr;
1757 if (hdr.
IsCts() && m_txTimer.IsRunning() &&
1758 m_txTimer.GetReason() == WifiTxTimer::WAIT_CTS && m_psdu)
1767 mpdu->GetPacket()->PeekPacketTag(tag);
1768 GetWifiRemoteStationManager()->ReportRxOk(sender, rxSignalInfo, txVector);
1769 GetWifiRemoteStationManager()->ReportRtsOk(m_psdu->GetHeader(0),
1775 m_channelAccessManager->NotifyCtsTimeoutResetNow();
1776 ProtectionCompleted();
1778 else if (hdr.
IsBlockAck() && m_txTimer.IsRunning() &&
1779 m_txTimer.GetReason() == WifiTxTimer::WAIT_BLOCK_ACK && hdr.
GetAddr1() == m_self)
1783 m_txTimer.GotResponseFrom(sender);
1786 mpdu->GetPacket()->PeekPacketTag(tag);
1790 mpdu->GetPacket()->PeekHeader(blockAck);
1792 if (blockAck.
IsGcr())
1794 const auto& gcrMembers = m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(
1796 const auto ret = GetBaManager(tid)->NotifyGotGcrBlockAck(
1799 m_mac->GetMldAddress(sender).value_or(sender),
1802 if (ret.has_value())
1804 for (
const auto& sender : gcrMembers)
1806 GetWifiRemoteStationManager()->ReportAmpduTxStatus(sender,
1811 m_txParams.m_txVector);
1817 const auto [nSuccessful, nFailed] = GetBaManager(tid)->NotifyGotBlockAck(
1820 m_mac->GetMldAddress(sender).value_or(sender),
1823 GetWifiRemoteStationManager()->ReportAmpduTxStatus(sender,
1828 m_txParams.m_txVector);
1833 m_channelAccessManager->NotifyAckTimeoutResetNow();
1836 m_edca->ResetCw(m_linkId);
1839 if (m_psdu && m_psdu->GetNMpdus() == 1 && m_psdu->GetHeader(0).IsBlockAckReq())
1841 DequeuePsdu(m_psdu);
1844 TransmissionSucceeded();
1855 mpdu->GetPacket()->PeekHeader(blockAckReq);
1859 auto agreement = m_mac->GetBaAgreementEstablishedAsRecipient(
1862 blockAckReq.
IsGcr() ? std::optional{blockAckReq.GetGcrGroupAddress()}
1866 NS_LOG_DEBUG(
"There's not a valid agreement for this BlockAckReq");
1870 GetBaManager(tid)->NotifyGotBlockAckRequest(
1871 m_mac->GetMldAddress(sender).value_or(sender),
1874 blockAckReq.
IsGcr() ? std::optional{blockAckReq.GetGcrGroupAddress()}
1878 Simulator::Schedule(
1880 &HtFrameExchangeManager::SendBlockAck,
1884 GetWifiRemoteStationManager()->GetBlockAckTxVector(sender, txVector),
1886 blockAckReq.
IsGcr() ? std::optional{blockAckReq.GetGcrGroupAddress()}
1892 QosFrameExchangeManager::ReceiveMpdu(mpdu, rxSignalInfo, txVector, inAmpdu);
1899 ((hdr.
GetAddr1() == m_self) || (isGroup && (inAmpdu || !mpdu->GetHeader().IsQosNoAck()))))
1903 auto agreement = m_mac->GetBaAgreementEstablishedAsRecipient(
1906 isGroup ? std::optional{hdr.
IsQosAmsdu() ? mpdu->begin()->second.GetDestinationAddr()
1914 GetBaManager(tid)->NotifyGotMpdu(mpdu);
1919 Simulator::Schedule(m_phy->GetSifs(),
1920 &HtFrameExchangeManager::SendNormalAck,
1934 ReceiveMgtAction(mpdu, txVector);
1938 !m_mac->GetRobustAVStreamingSupported())
1943 QosFrameExchangeManager::ReceiveMpdu(mpdu, rxSignalInfo, txVector, inAmpdu);
1951 NS_ASSERT(mpdu->GetHeader().IsAction());
1952 const auto from = mpdu->GetOriginal()->GetHeader().GetAddr2();
1955 auto packet = mpdu->GetPacket()->Copy();
1956 packet->RemoveHeader(actionHdr);
1959 const auto ackTxVector =
1960 GetWifiRemoteStationManager()->GetAckTxVector(mpdu->GetHeader().GetAddr2(), txVector);
1961 const auto ackTxTime =
1962 WifiPhy::CalculateTxDuration(
GetAckSize(), ackTxVector, m_phy->GetPhyBand());
1966 case WifiActionHeader::BLOCK_ACK:
1970 case WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST: {
1972 packet->RemoveHeader(reqHdr);
1977 Simulator::Schedule(m_phy->GetSifs() + ackTxTime,
1978 &HtFrameExchangeManager::SendAddBaResponse,
1985 case WifiActionHeader::BLOCK_ACK_ADDBA_RESPONSE: {
1987 packet->RemoveHeader(respHdr);
1992 Simulator::Schedule(m_phy->GetSifs() + ackTxTime, [=,
this]() {
1993 const auto recipient =
1994 GetWifiRemoteStationManager()->GetMldAddress(from).value_or(from);
1995 m_mac->GetQosTxop(respHdr.GetTid())->GotAddBaResponse(respHdr, recipient);
1996 GetBaManager(respHdr.GetTid())
1997 ->SetBlockAckInactivityCallback(
1998 MakeCallback(&HtFrameExchangeManager::SendDelbaFrame, this));
2003 case WifiActionHeader::BLOCK_ACK_DELBA: {
2005 packet->RemoveHeader(delBaHdr);
2006 auto recipient = GetWifiRemoteStationManager()->GetMldAddress(from).value_or(from);
2014 GetBaManager(delBaHdr.
GetTid())
2015 ->DestroyRecipientAgreement(recipient,
2024 m_mac->GetQosTxop(delBaHdr.
GetTid())->GotDelBaFrame(&delBaHdr, recipient);
2030 NS_FATAL_ERROR(
"Unsupported Action field in Block Ack Action frame");
2042 const std::vector<bool>& perMpduStatus)
2045 this << *psdu << rxSignalInfo << txVector << perMpduStatus.size()
2046 << std::all_of(perMpduStatus.begin(), perMpduStatus.end(), [](
bool v) { return v; }));
2048 std::set<uint8_t> tids = psdu->GetTids();
2051 if (tids.size() == 1)
2053 uint8_t tid = *tids.begin();
2057 if (ackPolicy == WifiMacHeader::NORMAL_ACK)
2061 auto agreement = m_mac->GetBaAgreementEstablishedAsRecipient(psdu->GetAddr2(), tid);
2064 Simulator::Schedule(
2066 &HtFrameExchangeManager::SendBlockAck,
2069 psdu->GetDuration(),
2070 GetWifiRemoteStationManager()->GetBlockAckTxVector(psdu->GetAddr2(), txVector),
2074 else if (psdu->GetAddr1().IsGroup() && (ackPolicy == WifiMacHeader::NO_ACK))
2077 m_flushGroupcastMpdusEvent.Cancel();
2089 const auto startSeq = psdu->GetHeader(0).GetSequenceNumber();
2090 const auto groupAddress = psdu->GetHeader(0).IsQosAmsdu()
2091 ? (*psdu->begin())->begin()->second.GetDestinationAddr()
2093 FlushGroupcastMpdus(groupAddress, psdu->GetAddr2(), tid, startSeq);
2101 const auto stopSeq = (startSeq + perMpduStatus.size()) % 4096;
2102 const auto maxDelay = m_mac->GetQosTxop(tid)->GetWifiMacQueue()->GetMaxDelay();
2103 m_flushGroupcastMpdusEvent =
2104 Simulator::Schedule(maxDelay,
2105 &HtFrameExchangeManager::FlushGroupcastMpdus,
2116HtFrameExchangeManager::FlushGroupcastMpdus(
const Mac48Address& groupAddress,
2123 GetBaManager(tid)->NotifyGotBlockAckRequest(originator, tid, seq, groupAddress);
2130 const auto tid = mpdu->GetHeader().GetQosTid();
2131 const auto groupAddress = mpdu->GetHeader().GetAddr1();
2132 if (!GetBaManager(tid)->IsGcrAgreementEstablished(
2135 m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(groupAddress)))
2139 GetBaManager(tid)->NotifyLastGcrUrTx(
2141 m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(groupAddress));
BlockAckType GetBlockAckType() const
Get the type of the Block Acks sent by the recipient of this agreement.
uint8_t GetTid() const
Return the Traffic ID (TID).
Mac48Address GetPeer() const
Return the peer address.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsPending() const
This method is syntactic sugar for !IsExpired().
std::set< Mac48Address > m_sentRtsTo
the STA(s) which we sent an RTS to (waiting for CTS)
void DoCtsTimeout(Ptr< WifiPsdu > psdu)
Take required actions when the CTS timer fired after sending an RTS to protect the given PSDU expires...
uint8_t m_linkId
the ID of the link this object is associated with
Ptr< WifiMac > m_mac
the MAC layer on this station
bool m_protectedIfResponded
whether a STA is assumed to be protected if replied to a frame requiring acknowledgment
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the MAC layer to use.
void SendMpduWithProtection(Ptr< WifiMpdu > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
virtual void CalculateAcknowledgmentTime(WifiAcknowledgment *acknowledgment) const
Calculate the time required to acknowledge a frame according to the given acknowledgment method.
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
Mac48Address m_self
the MAC address of this device
virtual void StartProtection(const WifiTxParameters &txParams)
Start the protection mechanism indicated by the given TX parameters.
virtual void NotifyPacketDiscarded(Ptr< const WifiMpdu > mpdu)
Pass the given MPDU, discarded because of the max retry limit was reached, to the MPDU dropped callba...
std::set< Mac48Address > m_protectedStas
STAs that have replied to an RTS in this TXOP.
virtual void RetransmitMpduAfterMissedAck(Ptr< WifiMpdu > mpdu) const
Retransmit an MPDU that was not acknowledged.
virtual void ProtectionCompleted()
Transmit prepared frame immediately, if no protection was used, or in a SIFS, if protection was compl...
virtual void NotifyReceivedNormalAck(Ptr< WifiMpdu > mpdu)
Notify other components that an MPDU was acknowledged.
virtual void CtsTimeout(Ptr< WifiMpdu > rts, const WifiTxVector &txVector)
Called when the CTS timeout expires.
Time m_txNav
the TXNAV timer
virtual void DequeueMpdu(Ptr< const WifiMpdu > mpdu)
Dequeue the given MPDU from the queue in which it is stored.
Ptr< MacRxMiddle > m_rxMiddle
the MAC RX Middle on this station
Ptr< WifiPhy > m_phy
the PHY layer on this station
virtual void ReleaseSequenceNumbers(Ptr< const WifiPsdu > psdu) const
Make the sequence numbers of MPDUs included in the given PSDU available again if the MPDUs have never...
std::set< Mac48Address > m_sentFrameTo
the STA(s) to which we sent a frame requesting a response
Ptr< ApWifiMac > m_apMac
AP MAC layer pointer (null if not an AP)
Mac48Address m_bssid
BSSID address (Mac48Address)
virtual bool StartTransmission(Ptr< Txop > dcf, MHz_u allowedWidth)
Request the FrameExchangeManager to start a frame exchange sequence.
MHz_u m_allowedWidth
the allowed width for the current transmission
std::unordered_set< Mac48Address, WifiAddressHash > GcrMembers
MAC addresses of member STAs of a GCR group.
HtFrameExchangeManager handles the frame exchange sequences for HT stations.
Ptr< MpduAggregator > m_mpduAggregator
A-MPDU aggregator.
std::map< AgreementKey, Ptr< WifiMpdu > > m_pendingAddBaResp
pending ADDBA_RESPONSE frames indexed by agreement key
void SendAddBaResponse(const MgtAddBaRequestHeader &reqHdr, Mac48Address originator)
This method can be called to accept a received ADDBA Request.
void CtsTimeout(Ptr< WifiMpdu > rts, const WifiTxVector &txVector) override
Called when the CTS timeout expires.
Ptr< WifiPsdu > m_psdu
the A-MPDU being transmitted
Ptr< BlockAckManager > GetBaManager(uint8_t tid) const
Get the Block Ack Manager handling the given TID.
virtual Ptr< WifiPsdu > GetWifiPsdu(Ptr< WifiMpdu > mpdu, const WifiTxVector &txVector) const
Get a PSDU containing the given MPDU.
virtual void BlockAckTimeout(Ptr< WifiPsdu > psdu, const WifiTxVector &txVector)
Called when the BlockAck timeout expires.
Ptr< WifiMpdu > GetBar(AcIndex ac, std::optional< uint8_t > optTid=std::nullopt, std::optional< Mac48Address > optAddress=std::nullopt)
Get the next BlockAckRequest or MU-BAR Trigger Frame to send, if any.
virtual Time GetPsduDurationId(Time txDuration, const WifiTxParameters &txParams) const
Compute how to set the Duration/ID field of PSDUs that do not include fragments.
virtual bool NeedSetupBlockAck(Mac48Address recipient, uint8_t tid)
A Block Ack agreement needs to be established with the given recipient for the given TID if it does n...
void TransmissionSucceeded() override
Take necessary actions upon a transmission success.
virtual bool SendMpduFromBaManager(Ptr< WifiMpdu > mpdu, Time availableTime, bool initialFrame)
If the given MPDU contains a BlockAckReq frame (the duration of which plus the response fits within t...
Ptr< MpduAggregator > GetMpduAggregator() const
Returns the aggregator used to construct A-MPDU subframes.
void SetWifiMac(const Ptr< WifiMac > mac) override
Set the MAC layer to use.
virtual std::optional< Mac48Address > NeedSetupGcrBlockAck(const WifiMacHeader &header)
A Block Ack agreement needs to be established prior to the transmission of a groupcast data packet us...
bool SendAddBaRequest(Mac48Address recipient, uint8_t tid, uint16_t startingSeq, uint16_t timeout, bool immediateBAck, Time availableTime, std::optional< Mac48Address > gcrGroupAddr=std::nullopt)
Sends an ADDBA Request to establish a block ack agreement with STA addressed by recipient for TID tid...
void ProtectionCompleted() override
Transmit prepared frame immediately, if no protection was used, or in a SIFS, if protection was compl...
void ForwardMpduDown(Ptr< WifiMpdu > mpdu, WifiTxVector &txVector) override
Forward an MPDU down to the PHY layer.
Ptr< MsduAggregator > GetMsduAggregator() const
Returns the aggregator used to construct A-MSDU subframes.
void SendPsduWithProtection(Ptr< WifiPsdu > psdu, WifiTxParameters &txParams)
Send a PSDU (A-MPDU or BlockAckReq frame) requesting a BlockAck frame or a BlockAckReq frame followed...
void NotifyReceivedNormalAck(Ptr< WifiMpdu > mpdu) override
Notify other components that an MPDU was acknowledged.
void RetransmitMpduAfterMissedAck(Ptr< WifiMpdu > mpdu) const override
Retransmit an MPDU that was not acknowledged.
void DoDispose() override
Destructor implementation.
static TypeId GetTypeId()
Get the type ID.
bool StartFrameExchange(Ptr< QosTxop > edca, Time availableTime, bool initialFrame) override
Start a frame exchange (including protection frames and acknowledgment frames as needed) that fits wi...
WifiTxParameters m_txParams
the TX parameters for the current frame
void SendPsdu()
Send the current PSDU, which can be acknowledged by a BlockAck frame or followed by a BlockAckReq fra...
virtual bool SendDataFrame(Ptr< WifiMpdu > peekedItem, Time availableTime, bool initialFrame)
Given a non-broadcast QoS data frame, prepare the PSDU to transmit by attempting A-MSDU and A-MPDU ag...
void SendDelbaFrame(Mac48Address addr, uint8_t tid, bool byOriginator, std::optional< Mac48Address > gcrGroupAddr)
Sends DELBA frame to cancel a block ack agreement with STA addressed by addr for TID tid.
void NotifyPacketDiscarded(Ptr< const WifiMpdu > mpdu) override
Pass the given MPDU, discarded because of the max retry limit was reached, to the MPDU dropped callba...
virtual void ForwardPsduDown(Ptr< const WifiPsdu > psdu, WifiTxVector &txVector)
Forward a PSDU down to the PHY layer.
void CalculateAcknowledgmentTime(WifiAcknowledgment *acknowledgment) const override
Calculate the time required to acknowledge a frame according to the given acknowledgment method.
~HtFrameExchangeManager() override
EventId m_flushGroupcastMpdusEvent
the event to flush pending groupcast MPDUs from previously received A-MPDU
void DequeuePsdu(Ptr< const WifiPsdu > psdu)
Dequeue the MPDUs of the given PSDU from the queue in which they are stored.
void ReleaseSequenceNumbers(Ptr< const WifiPsdu > psdu) const override
Make the sequence numbers of MPDUs included in the given PSDU available again if the MPDUs have never...
Ptr< MsduAggregator > m_msduAggregator
A-MSDU aggregator.
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef (MAC address and TID)
void NotifyLastGcrUrTx(Ptr< const WifiMpdu > mpdu) override
Notify the last (re)transmission of a groupcast MPDU using the GCR-UR service.
uint16_t GetBaAgreementStartingSequenceNumber(const WifiMacHeader &header)
Retrieve the starting sequence number for a BA agreement to be established.
Smart pointer class similar to boost::intrusive_ptr.
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
virtual bool StartFrameExchange(Ptr< QosTxop > edca, Time availableTime, bool initialFrame)
Start a frame exchange (including protection frames and acknowledgment frames as needed) that fits wi...
Ptr< QosTxop > m_edca
the EDCAF that gained channel access
virtual Ptr< WifiMpdu > CreateAliasIfNeeded(Ptr< WifiMpdu > mpdu) const
Create an alias of the given MPDU for transmission by this Frame Exchange Manager.
void TransmissionSucceeded() override
Take necessary actions upon a transmission success.
bool TryAddMpdu(Ptr< const WifiMpdu > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
void DoDispose() override
Destructor implementation.
AcIndex GetAccessCategory() const
Get the access category of this object.
void AddBaResponseTimeout(Mac48Address recipient, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr)
Callback when ADDBA response is not received after timeout.
virtual Time GetRemainingTxop(uint8_t linkId) const
Return the remaining duration in the current TXOP on the given link.
void ResetBa(Mac48Address recipient, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr)
Reset BA agreement after BA negotiation failed.
Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreeme...
void FillBlockAckBitmap(CtrlBAckResponseHeader &blockAckHeader, std::size_t index=0) const
Set the Starting Sequence Number subfield of the Block Ack Starting Sequence Control subfield of the ...
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
Introspection did not find any typical Config paths.
void Set(double snr)
Set the SNR to the given value.
double Get() const
Return the SNR value.
Status code for association response.
void SetSuccess()
Set success bit to 0 (success).
Simulation virtual time values and global simulation resolution.
bool IsStrictlyNegative() const
Exactly equivalent to t < 0.
bool IsZero() const
Exactly equivalent to t == 0.
Time GetTxopLimit() const
Return the TXOP limit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
static void SetQosAckPolicy(Ptr< WifiMpdu > item, const WifiAcknowledgment *acknowledgment)
Set the QoS Ack policy for the given MPDU, which must be a QoS data frame.
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
std::set< uint8_t > GetTids() const
Get the set of TIDs of the QoS Data frames included in the PSDU.
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
std::vector< Ptr< WifiMpdu > >::const_iterator begin() const
Return a const iterator to the first MPDU.
uint32_t GetSize() const
Return the size of the PSDU in bytes.
WifiMacHeader::QosAckPolicy GetAckPolicyForTid(uint8_t tid) const
Get the QoS Ack Policy of the QoS Data frames included in the PSDU that have the given TID.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
std::optional< Time > m_txDuration
TX duration of the frame.
std::unique_ptr< WifiProtection > m_protection
protection method
uint32_t GetSize(Mac48Address receiver) const
Get the size in bytes of the (A-)MPDU addressed to the given receiver.
std::unique_ptr< WifiAcknowledgment > m_acknowledgment
acknowledgment method
const PsduInfo * GetPsduInfo(Mac48Address receiver) const
Get a pointer to the information about the PSDU addressed to the given receiver, if present,...
void UndoAddMpdu()
Undo the addition of the last MPDU added by calling AddMpdu().
bool LastAddedIsFirstMpdu(Mac48Address receiver) const
Check if the last added MPDU is the first MPDU for the given receiver.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void AggregateMsdu(Ptr< const WifiMpdu > msdu)
Record that an MSDU is being aggregated to the last MPDU added to the frame that hase the same receiv...
void Clear()
Reset the TX parameters.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
MHz_u GetChannelWidth() const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#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_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
uint8_t GetTid(Ptr< const Packet > packet, const WifiMacHeader hdr)
This function is useful to get traffic id of different packet types.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)
std:: tuple< WifiContainerQueueType, WifiReceiverAddressType, Mac48Address, std::optional< uint8_t > > WifiContainerQueueId
Tuple (queue type, receiver address type, Address, TID) identifying a container queue.
bool IsGroupcast(const Mac48Address &adr)
Check whether a MAC destination address corresponds to a groupcast transmission.
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
static constexpr uint16_t SEQNO_SPACE_SIZE
Size of the space of sequence numbers.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
uint32_t GetAckSize()
Return the total Ack size (including FCS trailer).
bool IsGcr(Ptr< WifiMac > mac, const WifiMacHeader &hdr)
Return whether a given packet is transmitted using the GCR service.
RxSignalInfo structure containing info on the received signal.
double snr
SNR in linear scale.
WifiAcknowledgment is an abstract base struct.
const Method method
acknowledgment method
WifiBarBlockAck specifies that a BlockAckReq is sent to solicit a Block Ack response.
WifiBlockAck specifies that acknowledgment via Block Ack is required.
information about the frame being prepared for a specific receiver
std::map< uint8_t, std::set< uint16_t > > seqNumbers
set of the sequence numbers of the MPDUs added for each TID
uint32_t ampduSize
the size in bytes of the A-MPDU if multiple MPDUs have been added, and zero otherwise