25 #include "ns3/pointer.h" 26 #include "ns3/simulator.h" 27 #include "ns3/random-variable-stream.h" 44 #undef NS_LOG_APPEND_CONTEXT 45 #define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; } 58 .SetGroupName (
"Wifi")
60 .AddAttribute (
"UseExplicitBarAfterMissedBlockAck",
61 "Specify whether explicit BlockAckRequest should be sent upon missed BlockAck Response.",
65 .AddAttribute (
"AddBaResponseTimeout",
66 "The timeout to wait for ADDBA response after the Ack to " 67 "ADDBA request is received.",
72 .AddAttribute (
"FailedAddBaTimeout",
73 "The timeout after a failed BA agreement. During this " 74 "timeout, the originator resumes sending packets using normal " 75 "MPDU. After that, BA agreement is reset and the originator " 76 "will retry BA negotiation.",
81 .AddAttribute (
"BlockAckManager",
82 "The BlockAckManager object.",
85 MakePointerChecker<BlockAckManager> ())
86 .AddTraceSource (
"TxopTrace",
87 "Trace source for TXOP start and duration times",
89 "ns3::TracedValueCallback::Time")
95 : m_typeOfStation (
STA),
98 m_isAccessRequestedForRts (false),
99 m_currentIsFragmented (false)
163 return Create<const WifiMacQueueItem> (bar, hdr);
169 m_baManager->ScheduleBar (bar, skipIfNoDataQueued);
217 return m_txMiddle->GetNextSequenceNumberFor (hdr);
223 return m_txMiddle->PeekNextSequenceNumberFor (hdr);
231 if (!mpdu->GetHeader ().IsQosData ())
236 Mac48Address recipient = mpdu->GetHeader ().GetAddr1 ();
237 uint8_t tid = mpdu->GetHeader ().GetQosTid ();
245 mpdu->GetHeader ().GetSequenceNumber ()))
261 if (tid == 8 && recipient.IsGroup ())
265 return queue->PeekByTidAndAddress (tid, recipient, it);
273 NS_LOG_DEBUG (
"removing an old packet from BlockAckManager retransmit queue: " << **it);
274 it =
m_baManager->GetRetransmitQueue ()->Remove (it);
277 if (it !=
m_baManager->GetRetransmitQueue ()->end ())
279 NS_LOG_DEBUG (
"packet peeked from BlockAckManager retransmit queue: " << **it);
290 uint16_t sequence =
m_txMiddle->PeekNextSequenceNumberFor (&(*it)->GetHeader ());
291 if ((*it)->GetHeader ().IsQosData ())
293 Mac48Address recipient = (*it)->GetHeader ().GetAddr1 ();
294 uint8_t tid = (*it)->GetHeader ().GetQosTid ();
299 NS_LOG_DEBUG (
"packet beyond the end of the current transmit window");
310 NS_LOG_DEBUG (
"packet peeked from EDCA queue: " << *item);
319 bool aggregate, uint32_t ampduSize,
Time ppduDurationLimit)
321 NS_LOG_FUNCTION (
this << peekedItem << txVector << ampduSize << ppduDurationLimit);
326 if (peekedItem->GetHeader ().IsQosData () &&
327 !
m_low->IsWithinSizeAndTimeLimits (peekedItem, txVector, ampduSize, ppduDurationLimit))
332 Mac48Address recipient = peekedItem->GetHeader ().GetAddr1 ();
335 WifiMacQueue::ConstIterator testIt;
342 if (peekedItem->GetHeader ().IsQosData () && !recipient.
IsGroup ()
345 uint8_t tid = peekedItem->GetHeader ().GetQosTid ();
346 testIt =
m_baManager->GetRetransmitQueue ()->PeekByTidAndAddress (tid, recipient);
348 if (testIt !=
m_baManager->GetRetransmitQueue ()->end ())
352 NS_ASSERT (testItem->GetPacket () == peekedItem->GetPacket ());
355 testItem->GetHeader ().GetSequenceNumber ()));
356 item =
m_baManager->GetRetransmitQueue ()->Dequeue (testIt);
357 NS_LOG_DEBUG (
"dequeued from BA manager queue: " << *item);
365 if (peekedItem->GetHeader ().IsQosData ())
367 uint8_t tid = peekedItem->GetHeader ().GetQosTid ();
368 testIt =
m_queue->PeekByTidAndAddress (tid, recipient);
370 NS_ASSERT (testIt !=
m_queue->end () && (*testIt)->GetPacket () == peekedItem->GetPacket ());
372 uint16_t sequence =
m_txMiddle->PeekNextSequenceNumberFor (&peekedItem->GetHeader ());
378 NS_LOG_DEBUG (
"packet beyond the end of the current transmit window");
383 if (
m_low->GetMsduAggregator () != 0 && !recipient.
IsGroup () && aggregate)
385 item =
m_low->GetMsduAggregator ()->GetNextAmsdu (recipient, tid, txVector, ampduSize, ppduDurationLimit);
394 item =
m_queue->Dequeue (testIt);
402 NS_ASSERT (item != 0 && item->GetPacket () == peekedItem->GetPacket ());
408 uint16_t sequence =
m_txMiddle->GetNextSequenceNumberFor (&item->GetHeader ());
409 item->GetHeader ().SetSequenceNumber (sequence);
410 item->GetHeader ().SetFragmentNumber (0);
411 item->GetHeader ().SetNoMoreFragments ();
412 item->GetHeader ().SetNoRetry ();
424 Mac48Address recipient = frame->GetHeader ().GetAddr1 ();
435 if (frame->GetHeader ().IsMgt ())
443 if (!frame->GetHeader ().IsBlockAckReq ()
445 && !
m_low->IsCfPeriod ())
455 if (frame->GetHeader ().IsQosData ())
460 else if (frame->GetHeader ().IsBlockAckReq ())
471 frame->GetPacket ()->PeekHeader (baReqHdr);
513 NS_LOG_DEBUG (
"the lifetime of current packet expired");
558 if (peekedItem->GetHeader ().IsQosData () && !peekedItem->GetHeader ().GetAddr1 ().IsGroup ()
561 item =
Copy (peekedItem);
620 m_low->StartTransmission (Create<WifiMacQueueItem> (fragment, hdr),
633 bool resetTxop =
false;
643 packet = item->GetPacket ();
644 header = item->GetHeader ();
697 NS_LOG_DEBUG (
"Dequeueing and discarding head of queue");
725 for (
auto& mpdu : mpduList)
741 if (mpduList.size () > 1 ||
742 (mpduList.front ()->GetHeader ().IsQosData ()
744 mpduList.front ()->GetHeader ().GetQosTid ())))
746 for (
auto it = mpduList.rbegin (); it != mpduList.rend (); it++)
748 m_baManager->GetRetransmitQueue ()->PushFront (*it);
994 bool baManagerHasPackets =
m_baManager->HasPackets ();
996 bool queueIsNotEmpty = !
m_queue->IsEmpty ();
1030 bool baManagerHasPackets =
m_baManager->HasPackets ();
1032 bool queueIsNotEmpty = !
m_queue->IsEmpty ();
1035 && (baManagerHasPackets || queueIsNotEmpty)
1093 if (
GetTxopRemaining () >=
m_low->CalculateOverallTxTime (nextFrame->GetPacket (), &nextFrame->GetHeader (), params))
1108 if (nextFrame->GetHeader ().IsBlockAckReq ())
1117 else if (nextFrame->GetHeader ().IsQosData () && !nextFrame->GetHeader ().GetAddr1 ().IsGroup ())
1119 item =
Copy (nextFrame);
1128 NS_LOG_DEBUG (
"start next packet " << *item <<
" within the current TXOP");
1169 return remainingTxop;
1176 NS_LOG_DEBUG (
"a transmission that did not require an ACK just finished");
1192 &&
GetLow ()->GetMpduAggregator () != 0
1200 bool needTxopFragmentation =
false;
1227 if (txopDuration.
IsZero ())
1232 uint32_t minSize = 0;
1237 size = (minSize + ((maxSize - minSize) / 2));
1265 NS_LOG_DEBUG (
"GetNTxopFragment returning " << nFragments);
1272 if (fragmentNumber == 0)
1276 uint32_t offset = 0;
1283 if (fragmentNumber < nFragments)
1285 offset = (fragmentNumber * fragmentSize);
1291 NS_LOG_DEBUG (
"GetTxopFragmentOffset returning " << offset);
1301 if (fragmentNumber >= nFragments)
1306 if (fragmentNumber == nFragments - 1)
1310 NS_LOG_DEBUG (
"GetNextTxopFragmentSize returning " << fragmentSize);
1311 return fragmentSize;
1363 bool isLastFragment;
1373 return isLastFragment;
1441 m_queue->PushFront (Create<WifiMacQueueItem> (packet, hdr));
1449 uint8_t tid = respHdr->
GetTid ();
1452 NS_LOG_DEBUG (
"block ack agreement established with " << recipient);
1466 m_baManager->GetRetransmitQueue ()->Enqueue (mpdu);
1469 m_baManager->UpdateAgreement (respHdr, recipient);
1474 m_baManager->NotifyAgreementRejected (recipient, tid);
1483 NS_LOG_DEBUG (
"received DELBA frame from=" << recipient);
1490 NS_LOG_FUNCTION (
this << blockAck << recipient << rxSnr << dataSnr << dataTxVector);
1492 m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr, dataTxVector);
1521 NS_ASSERT (mpdu->GetHeader ().IsQosData ());
1535 uint32_t packets =
m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1537 || (
GetLow ()->GetMpduAggregator () != 0 &&
GetLow ()->GetMpduAggregator ()->GetMaxAmpduSize (recipient, tid,
WIFI_MOD_CLASS_HT) > 0 && packets > 1)
1542 uint16_t startingSequence =
m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
1582 uint16_t
timeout,
bool immediateBAck)
1605 reqHdr.SetImmediateBlockAck ();
1609 reqHdr.SetDelayedBlockAck ();
1611 reqHdr.SetTid (tid);
1615 reqHdr.SetBufferSize (0);
1617 reqHdr.SetStartingSequence (startSeq);
1663 m_low->DestroyBlockAckAgreement (addr, tid);
1714 m_baManager->NotifyAgreementNoReply (recipient, tid);
1732 m_baManager->NotifyAgreementReset (recipient, tid);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
AcIndex m_ac
the access category
TxFailed m_txFailedCallback
the transmit failed callback
void ScheduleBar(Ptr< const WifiMacQueueItem > bar, bool skipIfNoDataQueued=false)
bool IsSuccess(void) const
Return whether the status code is success.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
void MissedAck(void)
Event handler when an Ack is missed.
Ptr< const WifiMacQueueItem > PeekNextFrame(uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast())
Peek the next frame to transmit to the given receiver and of the given TID from the block ack manager...
Simulation virtual time values and global simulation resolution.
Time GetTxopRemaining(void) const
Return the remaining duration in the current TXOP.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
bool GetAmpduExist(Mac48Address dest) const
Return whether A-MPDU is used to transmit data to a peer station.
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
void ResetBa(Mac48Address recipient, uint8_t tid)
Reset BA agreement after BA negotiation failed.
AttributeValue implementation for Boolean.
void RestartAccessIfNeeded(void)
Restart access request if needed.
TracedValue< uint32_t > m_cwTrace
CW trace value.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
BlockAckType m_blockAckType
the BlockAck type
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
Time m_startTxop
the start TXOP time
Mac48Address MapDestAddressForAggregation(const WifiMacHeader &hdr)
This functions are used only to correctly set destination address in A-MSDU subframes.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool m_isAccessRequestedForRts
flag whether access is requested to transmit a RTS frame
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
void MissedBlockAck(uint8_t nMpdus)
Event handler when a BlockAck timeout has occurred.
bool NeedBarRetransmission(void)
Check if BlockAckRequest should be re-transmitted.
Ptr< ChannelAccessManager > m_channelAccessManager
the channel access manager
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void RequestAccess(Ptr< Txop > txop, bool isCfPeriod=false)
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
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...
Ptr< WifiAckPolicySelector > GetAckPolicySelector(void) const
Return the ack policy selector.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet. ...
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
uint16_t GetBaStartingSequence(Mac48Address address, uint8_t tid) const
void GotDelBaFrame(const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
Event handler when a DELBA frame is received.
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
virtual void GenerateBackoff(void)
Generate a new backoff now.
void SetAccessCategory(AcIndex ac)
Set the access category of this EDCAF.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetBlockAckThreshold(void) const
Return the current threshold for block ack mechanism.
void DoDispose(void)
Destructor implementation.
uint32_t GetTxopFragmentSize(void) const
Calculate the size of the current TXOP fragment.
Time m_failedAddBaTimeout
timeout after failed BA agreement
control how a packet is transmitted.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
bool IsLastFragment(void) const
Check if the current fragment is the last fragment.
uint32_t GetFragmentOffset(void) const
Calculate the offset for the current fragment.
void UpdateFailedCw(void)
Update the value of the CW variable to take into account a transmission failure.
Time GetAddBaResponseTimeout(void) const
Get the timeout for ADDBA response.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void GotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, WifiTxVector dataTxVector)
Event handler when a BlockAck is received.
bool IsZero(void) const
Exactly equivalent to t == 0.
AttributeValue implementation for Time.
void ReportRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
uint32_t GetNextFragmentSize(void) const
Calculate the size of the next fragment.
void SetAmpduExist(Mac48Address dest, bool enableAmpdu)
Set indication whether A-MPDU is used to transmit data to a peer station.
void StartAccessIfNeeded(void)
Request access from Txop if needed.
void SetFailedAddBaTimeout(Time failedAddBaTimeout)
Set the timeout for failed BA agreement.
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
Ptr< BlockAckManager > m_baManager
the block ack manager
static Mac48Address GetBroadcast(void)
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
void GotAddBaResponse(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
Event handler when an ADDBA response is received.
void SetTypeOfStation(TypeOfStation type)
Set type of station with the given type.
static const ConstIterator EMPTY
Invalid iterator to signal an empty queue.
virtual bool IsAccessRequested(void) const
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
bool HasNextPacket(void) const
bool NeedRts(const WifiMacHeader &header, uint32_t size)
uint32_t GetFragmentSize(void) const
Calculate the size of the current fragment.
uint16_t GetNextSequenceNumberFor(const WifiMacHeader *hdr)
Return the next sequence number for the given header.
void PushFront(Ptr< const Packet > packet, const WifiMacHeader &hdr)
uint16_t PeekNextSequenceNumberFor(const WifiMacHeader *hdr)
Return the next sequence number for the Traffic ID and destination, but do not pick it (i...
bool IsQosTxop(void) const
Check for QoS TXOP.
uint32_t GetNTxopFragment(void) const
Calculate the number of TXOP fragments needed for the transmission of the current packet...
void SetAddBaResponseTimeout(Time addBaResponseTimeout)
Set the timeout to wait for ADDBA response.
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool NeedRtsRetransmission(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Check if RTS should be re-transmitted if CTS was missed.
Ptr< MacLow > GetLow(void) const
Return the MacLow associated with this Txop.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetCw(void) const
Hold objects of type Ptr<T>.
void EnableAck(void)
Wait ACKTimeout for an Ack.
void BaTxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
uint32_t GetFragmentSize(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
void NotifyMissedCts(std::list< Ptr< WifiMacQueueItem >> mpduList)
Event handler when a CTS timeout has occurred.
void CompleteMpduTx(Ptr< WifiMacQueueItem > mpdu)
Stores an MPDU (part of an A-MPDU) in block ack agreement (i.e.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Ptr< WifiMacQueue > m_queue
the wifi MAC queue
virtual void DoDispose(void)
Destructor implementation.
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
MacLowTransmissionParameters GetTransmissionParameters(Ptr< const WifiMacQueueItem > frame) const
Compute the MacLow transmission parameters for the given frame.
bool NeedDataRetransmission(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Check if Data should be re-transmitted if Ack was missed.
void BaTxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
Ptr< const Packet > m_currentPacket
the current packet
uint8_t GetTid(Ptr< const Packet > packet, const WifiMacHeader hdr)
Extraction operator for TypeId.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void EndTxNoAck(void)
Event handler when a transmission that does not require an Ack has completed.
void DisableRts(void)
Do not send RTS and wait for CTS before sending data.
static Time Now(void)
Return the current simulation virtual time.
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ack mechanism.
void UpdateCurrentPacket(Ptr< WifiMacQueueItem > mpdu)
Update the current packet this QosTxop is trying to transmit.
Ptr< MacLow > m_low
the MacLow
uint8_t m_blockAckThreshold
the block ack threshold (use BA mechanism if number of packets in queue reaches this value...
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this Txop is associated to.
uint32_t GetTxopFragmentOffset(uint32_t fragmentNumber) const
Calculate the offset for the fragment.
Ptr< WifiAckPolicySelector > m_ackPolicySelector
the ack policy selector
Ptr< WifiMacQueueItem > DequeuePeekedFrame(Ptr< const WifiMacQueueItem > peekedItem, WifiTxVector txVector, bool aggregate=true, uint32_t ampduSize=0, Time ppduDurationLimit=Time::Min())
Dequeue the frame that has been previously peeked by calling PeekNextFrame.
bool IsQosOldPacket(Ptr< const WifiMacQueueItem > mpdu)
Check if the given MPDU is to be considered old according to the current starting sequence number of ...
void ReportDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
MacLowTransmissionParameters m_currentParams
current transmission parameters
virtual bool HasFramesToTransmit(void)
Check if the Txop has frames to transmit.
void GotAck(void)
Event handler when an Ack is received.
void StartNextPacket(void)
Start transmission for the next packet if allowed by the TxopLimit.
void EnableRts(void)
Send a RTS, and wait CTSTimeout for a CTS.
bool m_accessRequested
flag whether channel access is already requested
void Unblock(Mac48Address dest, uint8_t tid)
Un-block the given destination address and TID (e.g.
bool IsStrictlyNegative(void) const
Exactly equivalent to t < 0.
Mac48Address MapSrcAddressForAggregation(const WifiMacHeader &hdr)
This functions are used only to correctly set source address in A-MSDU subframes. ...
bool GetBaAgreementEstablished(Mac48Address address, uint8_t tid) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
bool m_useExplicitBarAfterMissedBlockAck
flag whether explicit BlockAckRequest should be sent upon missed BlockAck Response ...
TypeOfStation GetTypeOfStation(void) const
Return type of station.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const WifiMacQueueItem > PrepareBlockAckRequest(Mac48Address recipient, uint8_t tid) const
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< QosBlockedDestinations > m_qosBlockedDestinations
the QoS blocked destinations
void NotifyAccessGranted(void)
Notify the Txop that access has been granted.
uint16_t GetBaBufferSize(Mac48Address address, uint8_t tid) const
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
void EnableNextData(uint32_t size)
void Block(Mac48Address dest, uint8_t tid)
Block the given destination address and TID from sending (e.g.
TxOk m_txOkCallback
the transmit OK callback
void DisableNextData(void)
Do not attempt to send data burst after current transmission.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this Txop is associated to.
void CompleteConfig(void)
Complete block ack configuration.
bool m_currentIsFragmented
flag whether current packet is fragmented
void SetAckPolicySelector(Ptr< WifiAckPolicySelector > ackSelector)
Set the ack policy selector.
uint8_t m_fragmentNumber
the fragment number
TracedCallback< Time, Time > m_txopTrace
TXOP trace callback.
void DoInitialize(void)
Initialize() implementation.
void TerminateTxop(void)
Update backoff and restart access if needed.
bool NeedFragmentation(void) const
Check if the current packet should be fragmented.
TypeOfStation
Enumeration for type of station.
WifiMacHeader m_currentHdr
the current header
Time m_currentPacketTimestamp
the current packet timestamp
bool IsTxopFragmentation(void) const
Check if the current packet is fragmented because of an exceeded TXOP duration.
void EnableBlockAck(BlockAckType type)
Wait the timeout corresponding to the given BlockAck response type.
Ptr< Packet > GetFragmentPacket(WifiMacHeader *hdr)
Get the next fragment from the packet with appropriate Wifi header for the fragment.
Time GetFailedAddBaTimeout(void) const
Get the timeout for failed BA agreement.
uint16_t m_blockAckInactivityTimeout
the BlockAck inactivity timeout value (in TUs, i.e.
bool IsNull(void) const
Check for null implementation.
Ptr< WifiRemoteStationManager > m_stationManager
the wifi remote station manager
bool SetupBlockAckIfNeeded(void)
If number of packets in the queue reaches m_blockAckThreshold value, an ADDBA Request frame is sent t...
void DisableAck(void)
Do not wait for Ack after data transmission.
void NotifyInternalCollision(void)
Notify the Txop that internal collision has occurred.
void ResetCw(void)
Update the value of the CW variable to take into account a transmission success or a transmission abo...
uint32_t GetNextTxopFragmentSize(uint32_t fragmentNumber) const
Calculate the size of the next TXOP fragment.
TypeOfStation m_typeOfStation
the type of station
a unique identifier for an interface.
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
void AddBaResponseTimeout(Mac48Address recipient, uint8_t tid)
Callback when ADDBA response is not received after timeout.
void AddHeader(const Header &header)
Add header to this packet.
Time m_addBaResponseTimeout
timeout for ADDBA response
std::map< Mac48Address, bool > m_aMpduEnabled
list containing flags whether A-MPDU is enabled for a given destination address
Implements the IEEE 802.11 MAC trailer.
void SendAddBaRequest(Mac48Address recipient, uint8_t tid, uint16_t startSeq, uint16_t timeout, bool immediateBAck)
Sends an ADDBA Request to establish a block ack agreement with STA addressed by recipient for TID tid...
void ReportAmpduTxStatus(Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, WifiTxVector dataTxVector)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
Handle packet fragmentation and retransmissions for data and management frames.
Time GetTxopLimit(void) const
Return the TXOP limit.