25 #include "ns3/pointer.h" 26 #include "ns3/simulator.h" 27 #include "ns3/random-variable-stream.h" 42 #undef NS_LOG_APPEND_CONTEXT 43 #define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; } 56 .SetGroupName (
"Wifi")
58 .AddAttribute (
"UseExpliciteBarAfterMissedBlockAck",
59 "Specify whether explicit Block Ack Request should be sent upon missed Block Ack Response.",
63 .AddAttribute (
"AddBaResponseTimeout",
64 "The timeout to wait for ADDBA response after the ACK to " 65 "ADDBA request is received.",
70 .AddAttribute (
"FailedAddBaTimeout",
71 "The timeout after a failed BA agreement. During this " 72 "timeout, the originator resumes sending packets using normal " 73 "MPDU. After that, BA agreement is reset and the originator " 74 "will retry BA negotiation.",
79 .AddAttribute (
"BlockAckManager",
80 "The BlockAckManager object.",
83 MakePointerChecker<BlockAckManager> ())
84 .AddTraceSource (
"TxopTrace",
85 "Trace source for txop start and duration times",
87 "ns3::TracedValueCallback::Time")
93 : m_typeOfStation (
STA),
96 m_isAccessRequestedForRts (false),
97 m_currentIsFragmented (false)
166 return m_txMiddle->GetNextSequenceNumberFor (hdr);
172 return m_txMiddle->PeekNextSequenceNumberFor (hdr);
180 if (!mpdu->GetHeader ().IsQosData ())
185 Mac48Address recipient = mpdu->GetHeader ().GetAddr1 ();
186 uint8_t tid = mpdu->GetHeader ().GetQosTid ();
194 mpdu->GetHeader ().GetSequenceNumber ()))
210 if (tid == 8 && recipient.IsBroadcast ())
214 return queue->PeekByTidAndAddress (tid, recipient, it);
222 NS_LOG_DEBUG (
"removing an old packet from BlockAckManager retransmit queue: " << **it);
223 it =
m_baManager->GetRetransmitQueue ()->Remove (it);
226 if (it !=
m_baManager->GetRetransmitQueue ()->end ())
228 NS_LOG_DEBUG (
"packet peeked from BlockAckManager retransmit queue: " << **it);
239 uint16_t sequence =
m_txMiddle->PeekNextSequenceNumberFor (&(*it)->GetHeader ());
240 if ((*it)->GetHeader ().IsQosData ())
242 Mac48Address recipient = (*it)->GetHeader ().GetAddr1 ();
243 uint8_t tid = (*it)->GetHeader ().GetQosTid ();
248 NS_LOG_DEBUG (
"packet beyond the end of the current transmit window");
259 NS_LOG_DEBUG (
"packet peeked from EDCA queue: " << *item);
268 bool aggregate, uint32_t ampduSize,
Time ppduDurationLimit)
270 NS_LOG_FUNCTION (
this << peekedItem << txVector << ampduSize << ppduDurationLimit);
275 if (peekedItem->GetHeader ().IsQosData () &&
276 !
m_low->IsWithinSizeAndTimeLimits (peekedItem, txVector, ampduSize, ppduDurationLimit))
281 Mac48Address recipient = peekedItem->GetHeader ().GetAddr1 ();
284 WifiMacQueue::ConstIterator testIt;
291 if (peekedItem->GetHeader ().IsQosData () && !recipient.
IsBroadcast ()
294 uint8_t tid = peekedItem->GetHeader ().GetQosTid ();
295 testIt =
m_baManager->GetRetransmitQueue ()->PeekByTidAndAddress (tid, recipient);
297 if (testIt !=
m_baManager->GetRetransmitQueue ()->end ())
301 NS_ASSERT (testItem->GetPacket () == peekedItem->GetPacket ());
304 testItem->GetHeader ().GetSequenceNumber ()));
305 item =
m_baManager->GetRetransmitQueue ()->Dequeue (testIt);
306 NS_LOG_DEBUG (
"dequeued from BA manager queue: " << *item);
312 uint16_t sequence =
m_txMiddle->GetNextSequenceNumberFor (&peekedItem->GetHeader ());
316 if (peekedItem->GetHeader ().IsQosData ())
318 uint8_t tid = peekedItem->GetHeader ().GetQosTid ();
319 testIt =
m_queue->PeekByTidAndAddress (tid, recipient);
321 NS_ASSERT (testIt !=
m_queue->end () && (*testIt)->GetPacket () == peekedItem->GetPacket ());
327 NS_LOG_DEBUG (
"packet beyond the end of the current transmit window");
332 if (
m_low->GetMsduAggregator () != 0 && !recipient.
IsBroadcast () && aggregate)
334 item =
m_low->GetMsduAggregator ()->GetNextAmsdu (recipient, tid, txVector, ampduSize, ppduDurationLimit);
343 item =
m_queue->Dequeue (testIt);
351 NS_ASSERT (item != 0 && item->GetPacket () == peekedItem->GetPacket ());
356 item->GetHeader ().SetSequenceNumber (sequence);
357 item->GetHeader ().SetFragmentNumber (0);
358 item->GetHeader ().SetNoMoreFragments ();
359 item->GetHeader ().SetNoRetry ();
371 Mac48Address recipient = frame->GetHeader ().GetAddr1 ();
382 if (frame->GetHeader ().IsMgt ())
390 if (!frame->GetHeader ().IsBlockAckReq ()
392 frame->GetPacket (),
m_low->GetDataTxVector (frame))
393 && !
m_low->IsCfPeriod ())
404 if (frame->GetHeader ().IsBlockAckReq ())
406 frame->GetPacket ()->PeekHeader (baReqHdr);
409 else if (frame->GetHeader ().IsQosData ())
411 tid = frame->GetHeader ().GetQosTid ();
426 else if (frame->GetHeader ().IsQosData () && frame->GetHeader ().IsQosBlockAck ())
471 NS_LOG_DEBUG (
"the lifetime of current packet expired");
549 m_low->CalculateOverallTxTime (mpdu->GetPacket (), &mpdu->GetHeader (),
576 m_low->StartTransmission (Create<WifiMacQueueItem> (fragment, hdr),
594 bool resetDcf =
false;
604 packet = item->GetPacket ();
605 header = item->GetHeader ();
658 NS_LOG_DEBUG (
"Dequeueing and discarding head of queue");
698 for (
auto& mpdu : mpduList)
714 if (mpduList.size () > 1 ||
715 (mpduList.front ()->GetHeader ().IsQosData ()
717 mpduList.front ()->GetHeader ().GetQosTid ())))
719 for (
auto it = mpduList.rbegin (); it != mpduList.rend (); it++)
721 m_baManager->GetRetransmitQueue ()->PushFront (*it);
959 packet = item->GetPacket ();
960 hdr = item->GetHeader ();
966 m_low->GetDataTxVector (Create<const WifiMacQueueItem> (packet, hdr)));
989 packet = item->GetPacket ();
990 hdr = item->GetHeader ();
995 m_low->GetDataTxVector (Create<const WifiMacQueueItem> (packet, hdr)));
1009 uint16_t seqNumber = 0;
1058 if (
GetTxopRemaining () >=
m_low->CalculateOverallTxTime (nextFrame->GetPacket (), &nextFrame->GetHeader (), params))
1060 if (nextFrame->GetHeader ().IsBlockAckReq ())
1062 NS_LOG_DEBUG (
"start next BlockAckReq within the current TXOP");
1087 true, 0, maxPpduDuration);
1089 NS_LOG_DEBUG (
"start next packet " << *item <<
" within the current TXOP");
1141 return remainingTxop;
1148 NS_LOG_DEBUG (
"a transmission that did not require an ACK just finished");
1164 &&
GetLow ()->GetMpduAggregator () != 0
1172 bool needTxopFragmentation =
false;
1199 if (txopDuration.
IsZero ())
1204 uint32_t minSize = 0;
1209 size = (minSize + ((maxSize - minSize) / 2));
1237 NS_LOG_DEBUG (
"GetNTxopFragment returning " << nFragments);
1244 if (fragmentNumber == 0)
1248 uint32_t offset = 0;
1255 if (fragmentNumber < nFragments)
1257 offset = (fragmentNumber * fragmentSize);
1263 NS_LOG_DEBUG (
"GetTxopFragmentOffset returning " << offset);
1273 if (fragmentNumber >= nFragments)
1278 if (fragmentNumber == nFragments - 1)
1282 NS_LOG_DEBUG (
"GetNextTxopFragmentSize returning " << fragmentSize);
1283 return fragmentSize;
1335 bool isLastFragment;
1345 return isLastFragment;
1414 m_queue->PushFront (Create<WifiMacQueueItem> (packet, hdr));
1422 uint8_t tid = respHdr->
GetTid ();
1425 NS_LOG_DEBUG (
"block ack agreement established with " << recipient);
1426 m_baManager->UpdateAgreement (respHdr, recipient);
1431 m_baManager->NotifyAgreementRejected (recipient, tid);
1440 NS_LOG_DEBUG (
"received DELBA frame from=" << recipient);
1449 m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, txMode, dataSnr);
1467 && (
GetLow ()->GetMpduAggregator () == 0 ||
1511 NS_ASSERT (mpdu->GetHeader ().IsQosData ());
1513 m_baManager->NotifyMpduTransmission (mpdu->GetHeader ().GetAddr1 (), mpdu->GetHeader ().GetQosTid (),
1514 m_txMiddle->GetNextSeqNumberByTidAndAddress (mpdu->GetHeader ().GetQosTid (),
1515 mpdu->GetHeader ().GetAddr1 ()),
1525 uint32_t packets =
m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1527 || (
GetLow ()->GetMpduAggregator () != 0 &&
GetLow ()->GetMpduAggregator ()->GetMaxAmpduSize (recipient, tid,
WIFI_MOD_CLASS_HT) > 0 && packets > 1)
1532 uint16_t startingSequence =
m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
1595 uint16_t
timeout,
bool immediateBAck)
1618 reqHdr.SetImmediateBlockAck ();
1622 reqHdr.SetDelayedBlockAck ();
1624 reqHdr.SetTid (tid);
1628 reqHdr.SetBufferSize (0);
1630 reqHdr.SetStartingSequence (startSeq);
1676 m_low->DestroyBlockAckAgreement (addr, tid);
1729 m_baManager->NotifyAgreementNoReply (recipient, tid);
1744 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
bool IsSuccess(void) const
Return whether the status code is success.
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...
bool IsBroadcast(void) const
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.
#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.
void VerifyBlockAck(void)
Verifies if dequeued packet has to be transmitted with ack policy Block Ack.
AttributeValue implementation for Boolean.
void RestartAccessIfNeeded(void)
Restart access request if needed.
TracedCallback< uint32_t > m_backoffTrace
backoff trace value
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
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 Block ACK 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.
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.
void EnableBasicBlockAck(void)
Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_backoff
the current backoff
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 Block ACK timeout has occurred.
bool NeedBarRetransmission(void)
Check if Block ACK Request 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.
Ptr< WifiMacQueueItem > DequeuePeekedFrame(Ptr< const WifiMacQueueItem > peekedItem, WifiTxVector txVector, bool aggregate=true, uint32_t ampduSize=0, Time ppduDurationLimit=Seconds(0))
Dequeue the frame that has been previously peeked by calling PeekNextFrame or PeekNextFrameByTidAndAd...
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the Block Ack 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...
#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
uint16_t GetBaStartingSequence(Mac48Address address, uint8_t tid) const
bool NeedRts(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, WifiTxVector txVector)
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)
Ptr< UniformRandomVariable > m_rng
the random stream
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
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.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
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.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
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.
virtual uint32_t GetInteger(void)=0
Get the next random value as an integer drawn from the distribution.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
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 DCF manager if needed.
void EnableExtendedCompressedBlockAck(void)
Wait COMPRESSEDBLOCKACKTimeout for an Extended Compressed Block Ack Response frame.
void SetFailedAddBaTimeout(Time failedAddBaTimeout)
Set the timeout for failed BA agreement.
void SendBlockAckRequest(const Bar &bar)
After that all packets, for which a block ack agreement was established, have been transmitted...
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.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
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.
std::string GetUniqueName(void) const
bool HasNextPacket(void) const
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...
Mac48Address recipient
recipient
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.
void EnableCompressedBlockAck(void)
Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame.
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.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
void BaTxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
Bar m_currentBar
the current BAR
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 blockackagreement (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.
Ptr< MacLow > m_low
the MacLow
uint8_t m_blockAckThreshold
the Block ACK threshold
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this QosTxop is associated to.
uint32_t GetTxopFragmentOffset(uint32_t fragmentNumber) const
Calculate the offset for the fragment.
void NotifyCollision(void)
Notify the EDCAF that collision has occurred.
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
void GotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
Event handler when a Block ACK is received.
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
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 IsPositive(void) const
void CompleteTx(void)
For now is typically invoked to complete transmission of a packets sent with ack policy Block Ack: th...
bool IsStrictlyNegative(void) const
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 Block Ack Request should be sent upon missed Block Ack Response ...
TypeOfStation GetTypeOfStation(void) const
Return type of station.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const Packet > bar
block ack request
Ptr< QosBlockedDestinations > m_qosBlockedDestinations
QOS blocked destinations.
void NotifyAccessGranted(void)
Notify the EDCAF 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.
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
uint8_t m_fragmentNumber
the fragment number
TracedCallback< Time, Time > m_txopTrace
TXOP trace callback.
void DoInitialize(void)
Initialize() implementation.
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
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.
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 Block ACK inactivity timeout
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 EDCAF 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.
void StartBackoffNow(uint32_t nSlots)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
void AddBaResponseTimeout(Mac48Address recipient, uint8_t tid)
Callback when ADDBA response is not received after timeout.
void RequestAccess(Ptr< Txop > state, bool isCfPeriod=false)
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...
Handle packet fragmentation and retransmissions for data and management frames.
Time GetTxopLimit(void) const
Return the TXOP limit.