26 #include "ns3/traced-value.h" 37 class QosBlockedDestinations;
38 class MgtAddBaResponseHeader;
40 class AggregationCapableTransmissionListener;
42 class WifiAckPolicySelector;
96 friend class ::AmpduAggregationTest;
98 friend class ::TwoLevelAggregationTest;
100 friend class ::HeAggregationTest;
121 double rxSnr,
double dataSnr,
WifiTxVector dataTxVector);
384 bool aggregate =
true, uint32_t ampduSize = 0,
472 uint16_t
timeout,
bool immediateBAck);
AcIndex m_ac
the access category
void ScheduleBar(Ptr< const WifiMacQueueItem > bar, bool skipIfNoDataQueued=false)
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 GetAmpduExist(Mac48Address dest) const
Return whether A-MPDU is used to transmit data to a peer station.
void ResetBa(Mac48Address recipient, uint8_t tid)
Reset BA agreement after BA negotiation failed.
void RestartAccessIfNeeded(void)
Restart access request if needed.
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
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.
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.
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.
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 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.
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.
Time GetAddBaResponseTimeout(void) const
Get the timeout for ADDBA response.
void GotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, WifiTxVector dataTxVector)
Event handler when a BlockAck is received.
friend class AggregationCapableTransmissionListener
allow AggregationCapableTransmissionListener class access
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.
Ptr< BlockAckManager > m_baManager
the block ack manager
static Mac48Address GetBroadcast(void)
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.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void BaTxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
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.
MacLowTransmissionParameters GetTransmissionParameters(Ptr< const WifiMacQueueItem > frame) const
Compute the MacLow transmission parameters for the given frame.
void BaTxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
void EndTxNoAck(void)
Event handler when a transmission that does not require an Ack has completed.
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.
uint8_t m_blockAckThreshold
the block ack threshold (use BA mechanism if number of packets in queue reaches this value...
Two Level Aggregation Test.
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 ...
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.
802.11ax aggregation test which permits 64 or 256 MPDUs in A-MPDU according to the negociated buffer ...
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
bool m_useExplicitBarAfterMissedBlockAck
flag whether explicit BlockAckRequest should be sent upon missed BlockAck Response ...
TypeOfStation GetTypeOfStation(void) const
Return type of station.
Ptr< const WifiMacQueueItem > PrepareBlockAckRequest(Mac48Address recipient, uint8_t tid) const
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
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.
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.
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 BlockAck inactivity timeout value (in TUs, i.e.
bool SetupBlockAckIfNeeded(void)
If number of packets in the queue reaches m_blockAckThreshold value, an ADDBA Request frame is sent t...
void NotifyInternalCollision(void)
Notify the Txop that internal collision has occurred.
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.
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.
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
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...
BlockAckType
The different block ack policies.
Handle packet fragmentation and retransmissions for data and management frames.