Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC). More...
#include "qos-txop.h"
Classes | |
struct | QosLinkEntity |
Structure holding information specific to a single link. More... | |
Public Member Functions | |
QosTxop () | |
~QosTxop () override | |
void | AddBaResponseTimeout (Mac48Address recipient, uint8_t tid) |
Callback when ADDBA response is not received after timeout. | |
void | AssignSequenceNumber (Ptr< WifiMpdu > mpdu) const |
Assign a sequence number to the given MPDU, if it is not a fragment and it is not a retransmitted frame. | |
void | CompleteMpduTx (Ptr< WifiMpdu > mpdu) |
Stores an MPDU (part of an A-MPDU) in block ack agreement (i.e. | |
bool | EdcaDisabled (uint8_t linkId) const |
Return true if the EDCA is disabled (the MU EDCA Timer is running and the MU AIFSN is zero) for the given link, false otherwise. | |
AcIndex | GetAccessCategory () const |
Get the access category of this object. | |
Time | GetAddBaResponseTimeout () const |
Get the timeout for ADDBA response. | |
uint8_t | GetAifsn (uint8_t linkId) const override |
For the given link, return the number of slots that make up an AIFS according to the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not. | |
uint16_t | GetBaBufferSize (Mac48Address address, uint8_t tid) const |
Ptr< BlockAckManager > | GetBaManager () |
Get the Block Ack Manager associated with this QosTxop. | |
uint16_t | GetBaStartingSequence (Mac48Address address, uint8_t tid) const |
uint16_t | GetBlockAckInactivityTimeout () const |
Get the BlockAck inactivity timeout. | |
uint8_t | GetBlockAckThreshold () const |
Return the current threshold for block ack mechanism. | |
Time | GetFailedAddBaTimeout () const |
Get the timeout for failed BA agreement. | |
uint32_t | GetMaxCw (uint8_t linkId) const override |
For the given link, return the maximum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not. | |
uint32_t | GetMinCw (uint8_t linkId) const override |
For the given link, return the minimum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not. | |
Ptr< WifiMpdu > | GetNextMpdu (uint8_t linkId, Ptr< WifiMpdu > peekedItem, WifiTxParameters &txParams, Time availableTime, bool initialFrame) |
Prepare the frame to transmit on the given link starting from the MPDU that has been previously peeked by calling PeekNextMpdu. | |
uint16_t | GetNextSequenceNumberFor (const WifiMacHeader *hdr) |
Return the next sequence number for the given header. | |
uint8_t | GetQosQueueSize (uint8_t tid, Mac48Address receiver) const |
Get the value for the Queue Size subfield of the QoS Control field of a QoS data frame of the given TID and addressed to the given receiver. | |
virtual Time | GetRemainingTxop (uint8_t linkId) const |
Return the remaining duration in the current TXOP on the given link. | |
virtual std::optional< Time > | GetTxopStartTime (uint8_t linkId) const |
void | GotAddBaResponse (const MgtAddBaResponseHeader &respHdr, Mac48Address recipient) |
Event handler when an ADDBA response is received. | |
void | GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient) |
Event handler when a DELBA frame is received. | |
bool | HasFramesToTransmit (uint8_t linkId) override |
Check if the Txop has frames to transmit over the given link. | |
bool | IsQosTxop () const override |
Check for QoS TXOP. | |
bool | MuEdcaTimerRunning (uint8_t linkId) const |
Return true if the MU EDCA Timer is running for the given link, false otherwise. | |
void | NotifyChannelAccessed (uint8_t linkId, Time txopDuration) override |
Called by the FrameExchangeManager to notify that channel access has been granted on the given link for the given amount of time. | |
void | NotifyChannelReleased (uint8_t linkId) override |
Called by the FrameExchangeManager to notify the completion of the transmissions. | |
void | NotifyOriginatorAgreementNoReply (const Mac48Address &recipient, uint8_t tid) |
Take action upon notification of ADDBA_REQUEST frame being discarded (likely due to exceeded max retry limit). | |
Ptr< WifiMpdu > | PeekNextMpdu (uint8_t linkId, uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast(), Ptr< const WifiMpdu > mpdu=nullptr) |
Peek the next frame to transmit on the given link to the given receiver and of the given TID from the EDCA queue. | |
uint16_t | PeekNextSequenceNumberFor (const WifiMacHeader *hdr) |
Return the next sequence number for the Traffic ID and destination, but do not pick it (i.e. | |
std::pair< CtrlBAckRequestHeader, WifiMacHeader > | PrepareBlockAckRequest (Mac48Address recipient, uint8_t tid) const |
void | ResetBa (Mac48Address recipient, uint8_t tid) |
Reset BA agreement after BA negotiation failed. | |
void | SetAddBaResponseTimeout (Time addBaResponseTimeout) |
Set the timeout to wait for ADDBA response. | |
void | SetBlockAckInactivityTimeout (uint16_t timeout) |
Set the BlockAck inactivity timeout. | |
void | SetBlockAckThreshold (uint8_t threshold) |
Set threshold for block ack mechanism. | |
void | SetDroppedMpduCallback (DroppedMpdu callback) override |
void | SetFailedAddBaTimeout (Time failedAddBaTimeout) |
Set the timeout for failed BA agreement. | |
void | SetMuAifsn (uint8_t aifsn, uint8_t linkId) |
Set the number of slots that make up an AIFS while the MU EDCA Timer is running for the given link. | |
void | SetMuCwMax (uint16_t cwMax, uint8_t linkId) |
Set the maximum contention window size to use while the MU EDCA Timer is running for the given link. | |
void | SetMuCwMin (uint16_t cwMin, uint8_t linkId) |
Set the minimum contention window size to use while the MU EDCA Timer is running for the given link. | |
void | SetMuEdcaTimer (Time timer, uint8_t linkId) |
Set the MU EDCA Timer for the given link. | |
void | StartMuEdcaTimerNow (uint8_t linkId) |
Start the MU EDCA Timer for the given link. | |
bool | UseExplicitBarAfterMissedBlockAck () const |
Return true if an explicit BlockAckRequest is sent after a missed BlockAck. | |
Public Member Functions inherited from ns3::Txop | |
Txop () | |
~Txop () override | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. | |
virtual ChannelAccessStatus | GetAccessStatus (uint8_t linkId) const |
uint8_t | GetAifsn () const |
Return the number of slots that make up an AIFS. | |
std::vector< uint8_t > | GetAifsns () const |
Return the number of slots that make up an AIFS for each link. | |
uint32_t | GetMaxCw () const |
Return the maximum contention window size. | |
std::vector< uint32_t > | GetMaxCws () const |
Return the maximum contention window size for each link. | |
uint32_t | GetMinCw () const |
Return the minimum contention window size. | |
std::vector< uint32_t > | GetMinCws () const |
Return the minimum contention window size for each link. | |
Time | GetTxopLimit () const |
Return the TXOP limit. | |
Time | GetTxopLimit (uint8_t linkId) const |
Return the TXOP limit for the given link. | |
std::vector< Time > | GetTxopLimits () const |
Return the TXOP limit for each link. | |
const UserDefinedAccessParams & | GetUserAccessParams () const |
Ptr< WifiMacQueue > | GetWifiMacQueue () const |
Return the packet queue associated with this Txop. | |
virtual void | NotifyOff () |
When off operation occurs, the queue gets cleaned up. | |
virtual void | NotifyOn () |
When on operation occurs, channel access will be started. | |
virtual void | NotifySleep (uint8_t linkId) |
Notify that the given link switched to sleep mode. | |
virtual void | NotifyWakeUp (uint8_t linkId) |
When wake up operation occurs on a link, channel access on that link will be restarted. | |
virtual void | Queue (Ptr< WifiMpdu > mpdu) |
void | ResetCw (uint8_t linkId) |
Update the value of the CW variable for the given link to take into account a transmission success or a transmission abort (stop transmission of a packet after the maximum number of retransmissions has been reached). | |
void | SetAifsn (uint8_t aifsn) |
Set the number of slots that make up an AIFS. | |
void | SetAifsn (uint8_t aifsn, uint8_t linkId) |
Set the number of slots that make up an AIFS for the given link. | |
void | SetAifsns (const std::vector< uint8_t > &aifsns) |
Set the number of slots that make up an AIFS for each link. | |
void | SetMaxCw (uint32_t maxCw) |
Set the maximum contention window size. | |
void | SetMaxCw (uint32_t maxCw, uint8_t linkId) |
Set the maximum contention window size for the given link. | |
void | SetMaxCws (const std::vector< uint32_t > &maxCws) |
Set the maximum contention window size for each link. | |
void | SetMinCw (uint32_t minCw) |
Set the minimum contention window size. | |
void | SetMinCw (uint32_t minCw, uint8_t linkId) |
Set the minimum contention window size for the given link. | |
void | SetMinCws (const std::vector< uint32_t > &minCws) |
Set the minimum contention window size for each link. | |
void | SetTxMiddle (const Ptr< MacTxMiddle > txMiddle) |
Set MacTxMiddle this Txop is associated to. | |
void | SetTxopLimit (Time txopLimit) |
Set the TXOP limit. | |
void | SetTxopLimit (Time txopLimit, uint8_t linkId) |
Set the TXOP limit for the given link. | |
void | SetTxopLimits (const std::vector< Time > &txopLimits) |
Set the TXOP limit for each link. | |
virtual void | SetWifiMac (const Ptr< WifiMac > mac) |
Set the wifi MAC this Txop is associated to. | |
void | StartAccessAfterEvent (uint8_t linkId, bool hadFramesToTransmit, bool checkMediumBusy) |
Request channel access on the given link after the occurrence of an event that possibly requires to generate a new backoff value. | |
void | StartBackoffNow (uint32_t nSlots, uint8_t linkId) |
void | SwapLinks (std::map< uint8_t, uint8_t > links) |
Swap the links based on the information included in the given map. | |
void | UpdateFailedCw (uint8_t linkId) |
Update the value of the CW variable for the given link to take into account a transmission failure. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Txop | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Protected Member Functions | |
void | CreateQueue (AcIndex aci) override |
Create a wifi MAC queue containing packets of the given AC. | |
void | DoDispose () override |
Destructor implementation. | |
QosLinkEntity & | GetLink (uint8_t linkId) const |
Get a reference to the link associated with the given ID. | |
Protected Member Functions inherited from ns3::Txop | |
void | DoDispose () override |
Destructor implementation. | |
void | DoInitialize () override |
Initialize() implementation. | |
virtual void | GenerateBackoff (uint8_t linkId) |
Generate a new backoff for the given link now. | |
uint32_t | GetBackoffSlots (uint8_t linkId) const |
Return the current number of backoff slots on the given link. | |
Time | GetBackoffStart (uint8_t linkId) const |
Return the time when the backoff procedure started on the given link. | |
uint32_t | GetCw (uint8_t linkId) const |
Get the current value of the CW variable for the given link. | |
LinkEntity & | GetLink (uint8_t linkId) const |
Get a reference to the link associated with the given ID. | |
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & | GetLinks () const |
virtual void | NotifyAccessRequested (uint8_t linkId) |
Notify that access request has been received for the given link. | |
void | RequestAccess (uint8_t linkId) |
Request access to the ChannelAccessManager associated with the given link. | |
void | UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId) |
Update backoff slots for the given link that nSlots has passed. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Private Types | |
typedef TracedCallback< Time, Time, uint8_t > | TxopTracedCallback |
TracedCallback for TXOP trace typedef. | |
Private Member Functions | |
std::unique_ptr< LinkEntity > | CreateLinkEntity () const override |
Create a LinkEntity object. | |
bool | IsQosOldPacket (Ptr< const WifiMpdu > mpdu) |
Check if the given MPDU is to be considered old according to the current starting sequence number of the transmit window, provided that a block ack agreement has been established with the recipient for the given TID. | |
Private Attributes | |
AcIndex | m_ac |
the access category | |
Time | m_addBaResponseTimeout |
timeout for ADDBA response | |
Ptr< BlockAckManager > | m_baManager |
the block ack manager | |
uint16_t | m_blockAckInactivityTimeout |
the BlockAck inactivity timeout value (in TUs, i.e. | |
uint8_t | m_blockAckThreshold |
the block ack threshold (use BA mechanism if number of packets in queue reaches this value. | |
Time | m_failedAddBaTimeout |
timeout after failed BA agreement | |
uint8_t | m_nMaxInflights |
the maximum number of links on which an MPDU can be in-flight at the same time | |
TxopTracedCallback | m_txopTrace |
TXOP trace callback. | |
bool | m_useExplicitBarAfterMissedBlockAck |
flag whether explicit BlockAckRequest should be sent upon missed BlockAck Response | |
Friends | |
class | AggregationCapableTransmissionListener |
allow AggregationCapableTransmissionListener class access | |
Additional Inherited Members | |
Public Types inherited from ns3::Txop | |
enum | ChannelAccessStatus { NOT_REQUESTED = 0 , REQUESTED , GRANTED } |
Enumeration for channel access status. More... | |
typedef Callback< void, WifiMacDropReason, Ptr< const WifiMpdu > > | DroppedMpdu |
typedef for a callback to invoke when an MPDU is dropped. | |
Static Public Attributes inherited from ns3::Txop | |
static constexpr bool | CHECK_MEDIUM_BUSY |
generation of backoff (also) depends on the busy/idle state of the medium | |
static constexpr bool | DIDNT_HAVE_FRAMES_TO_TRANSMIT |
no packet available for transmission was in the queue | |
static constexpr bool | DONT_CHECK_MEDIUM_BUSY |
generation of backoff is independent of the busy/idle state of the medium | |
static constexpr bool | HAD_FRAMES_TO_TRANSMIT |
packets available for transmission were in the queue | |
Protected Types inherited from ns3::Txop | |
typedef TracedCallback< uint32_t, uint8_t > | BackoffValueTracedCallback |
TracedCallback for backoff trace value typedef. | |
typedef TracedCallback< uint32_t, uint8_t > | CwValueTracedCallback |
TracedCallback for CW trace value typedef. | |
Protected Attributes inherited from ns3::Txop | |
BackoffValueTracedCallback | m_backoffTrace |
backoff trace value | |
CwValueTracedCallback | m_cwTrace |
CW trace value. | |
DroppedMpdu | m_droppedMpduCallback |
the dropped MPDU callback | |
Ptr< WifiMac > | m_mac |
the wifi MAC | |
Ptr< WifiMacQueue > | m_queue |
the wifi MAC queue | |
Ptr< UniformRandomVariable > | m_rng |
the random stream | |
UniformRandomBitGenerator | m_shuffleLinkIdsGen |
random number generator to shuffle link IDs | |
Ptr< MacTxMiddle > | m_txMiddle |
the MacTxMiddle | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
This class handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC). It generates backoff values and stores the channel access status (not requested, requested, granted) for the corresponding DCF/EDCA and for each link.
This queue contains packets for a particular access class. Possibles access classes are:
This class also implements block ack sessions and MSDU aggregation (A-MSDU).
Definition at line 51 of file qos-txop.h.
|
private |
TracedCallback for TXOP trace typedef.
Definition at line 458 of file qos-txop.h.
ns3::QosTxop::QosTxop | ( | ) |
Definition at line 92 of file qos-txop.cc.
References ns3::CreateObject(), m_baManager, and NS_LOG_FUNCTION.
|
override |
Definition at line 141 of file qos-txop.cc.
References NS_LOG_FUNCTION.
void ns3::QosTxop::AddBaResponseTimeout | ( | Mac48Address | recipient, |
uint8_t | tid ) |
Callback when ADDBA response is not received after timeout.
recipient | MAC address of recipient |
tid | traffic ID |
Definition at line 736 of file qos-txop.cc.
References m_baManager, m_failedAddBaTimeout, NotifyOriginatorAgreementNoReply(), NS_LOG_FUNCTION, ResetBa(), and ns3::Simulator::Schedule().
Referenced by ns3::HtFrameExchangeManager::NotifyReceivedNormalAck().
Assign a sequence number to the given MPDU, if it is not a fragment and it is not a retransmitted frame.
mpdu | the MPDU |
Definition at line 562 of file qos-txop.cc.
References ns3::Txop::m_queue, ns3::Txop::m_txMiddle, and NS_LOG_FUNCTION.
Referenced by GetNextMpdu().
Stores an MPDU (part of an A-MPDU) in block ack agreement (i.e.
the sender is waiting for a BlockAck containing the sequence number of this MPDU).
mpdu | received MPDU. |
Definition at line 694 of file qos-txop.cc.
References m_baManager, ns3::Txop::m_mac, ns3::Txop::m_queue, and NS_ASSERT.
|
overrideprivatevirtual |
Create a LinkEntity object.
Reimplemented from ns3::Txop.
Definition at line 159 of file qos-txop.cc.
|
overrideprotectedvirtual |
Create a wifi MAC queue containing packets of the given AC.
aci | the index of the given AC |
Reimplemented from ns3::Txop.
Definition at line 99 of file qos-txop.cc.
References ns3::Txop::CHECK_MEDIUM_BUSY, ns3::Txop::CreateQueue(), ns3::Txop::GetLinks(), HasFramesToTransmit(), m_ac, m_baManager, ns3::Txop::m_mac, ns3::Txop::m_queue, ns3::MakeCallback(), ns3::BlockAckManager::NotifyDiscardedMpdu(), NS_LOG_FUNCTION, ns3::Txop::StartAccessAfterEvent(), ns3::WAITING_ADDBA_RESP, and ns3::WIFI_QOSDATA_QUEUE.
|
overrideprotectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 147 of file qos-txop.cc.
References ns3::Txop::DoDispose(), m_baManager, and NS_LOG_FUNCTION.
bool ns3::QosTxop::EdcaDisabled | ( | uint8_t | linkId | ) | const |
Return true if the EDCA is disabled (the MU EDCA Timer is running and the MU AIFSN is zero) for the given link, false otherwise.
linkId | the ID of the given link |
Definition at line 240 of file qos-txop.cc.
References GetLink(), and MuEdcaTimerRunning().
Referenced by GetMaxCw(), GetMinCw(), and StartMuEdcaTimerNow().
AcIndex ns3::QosTxop::GetAccessCategory | ( | ) | const |
Get the access category of this object.
Definition at line 796 of file qos-txop.cc.
References m_ac.
Referenced by ns3::HtFrameExchangeManager::TransmissionSucceeded(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().
Time ns3::QosTxop::GetAddBaResponseTimeout | ( | ) | const |
Get the timeout for ADDBA response.
Definition at line 771 of file qos-txop.cc.
References m_addBaResponseTimeout.
Referenced by GetTypeId().
|
overridevirtual |
For the given link, return the number of slots that make up an AIFS according to the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not.
linkId | the ID of the given link |
Reimplemented from ns3::Txop.
Definition at line 268 of file qos-txop.cc.
References ns3::Txop::LinkEntity::aifsn, GetLink(), ns3::QosTxop::QosLinkEntity::muAifsn, and MuEdcaTimerRunning().
uint16_t ns3::QosTxop::GetBaBufferSize | ( | Mac48Address | address, |
uint8_t | tid ) const |
address | recipient address of the peer station |
tid | traffic ID. |
Returns the negotiated buffer size during ADDBA handshake with station addressed by recipient for TID tid.
Definition at line 284 of file qos-txop.cc.
References m_baManager.
Referenced by GetNextMpdu(), and PeekNextMpdu().
Ptr< BlockAckManager > ns3::QosTxop::GetBaManager | ( | ) |
Get the Block Ack Manager associated with this QosTxop.
Definition at line 278 of file qos-txop.cc.
References m_baManager.
Referenced by AmpduAggregationTest::EstablishAgreement(), ns3::WifiMac::GetBaAgreementEstablishedAsOriginator(), ns3::WifiMac::GetBaAgreementEstablishedAsRecipient(), and ns3::HeFrameExchangeManager::SendPsduMap().
uint16_t ns3::QosTxop::GetBaStartingSequence | ( | Mac48Address | address, |
uint8_t | tid ) const |
address | recipient address of the peer station |
tid | traffic ID. |
Returns the current starting sequence number of the transmit window on the originator (WinStartO) of the block ack agreement established with the given recipient for the given TID.
Definition at line 290 of file qos-txop.cc.
References m_baManager.
Referenced by GetNextMpdu(), IsQosOldPacket(), and PeekNextMpdu().
uint16_t ns3::QosTxop::GetBlockAckInactivityTimeout | ( | ) | const |
Get the BlockAck inactivity timeout.
Definition at line 730 of file qos-txop.cc.
References m_blockAckInactivityTimeout.
uint8_t ns3::QosTxop::GetBlockAckThreshold | ( | ) | const |
Return the current threshold for block ack mechanism.
Definition at line 723 of file qos-txop.cc.
References m_blockAckThreshold, and NS_LOG_FUNCTION.
Time ns3::QosTxop::GetFailedAddBaTimeout | ( | ) | const |
Get the timeout for failed BA agreement.
Definition at line 784 of file qos-txop.cc.
References m_failedAddBaTimeout.
Referenced by GetTypeId().
|
protected |
Get a reference to the link associated with the given ID.
linkId | the given link ID |
Definition at line 165 of file qos-txop.cc.
References ns3::Txop::GetLink().
Referenced by EdcaDisabled(), GetAifsn(), GetMaxCw(), GetMinCw(), GetRemainingTxop(), GetTxopStartTime(), MuEdcaTimerRunning(), NotifyChannelAccessed(), NotifyChannelReleased(), SetMuAifsn(), SetMuCwMax(), SetMuCwMin(), SetMuEdcaTimer(), and StartMuEdcaTimerNow().
|
overridevirtual |
For the given link, return the maximum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not.
linkId | the ID of the given link |
Reimplemented from ns3::Txop.
Definition at line 257 of file qos-txop.cc.
References ns3::Txop::LinkEntity::cwMax, EdcaDisabled(), GetLink(), ns3::QosTxop::QosLinkEntity::muCwMax, MuEdcaTimerRunning(), and NS_ASSERT.
|
overridevirtual |
For the given link, return the minimum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set, depending on whether the MU EDCA Timer is running or not.
linkId | the ID of the given link |
Reimplemented from ns3::Txop.
Definition at line 246 of file qos-txop.cc.
References ns3::Txop::LinkEntity::cwMin, EdcaDisabled(), GetLink(), ns3::QosTxop::QosLinkEntity::muCwMin, MuEdcaTimerRunning(), and NS_ASSERT.
Ptr< WifiMpdu > ns3::QosTxop::GetNextMpdu | ( | uint8_t | linkId, |
Ptr< WifiMpdu > | peekedItem, | ||
WifiTxParameters & | txParams, | ||
Time | availableTime, | ||
bool | initialFrame ) |
Prepare the frame to transmit on the given link starting from the MPDU that has been previously peeked by calling PeekNextMpdu.
A frame is only returned if it meets the constraint on the maximum A-MPDU size (by assuming that the frame has to be aggregated to an existing A-MPDU as specified by the TX parameters) and its transmission time does not exceed the given PPDU duration limit (if distinct from Time::Min ()). If the peeked MPDU is a unicast QoS Data frame stored in the EDCA queue, attempt to perform A-MSDU aggregation (while meeting the constraints mentioned above) and assign a sequence number to the dequeued frame.
linkId | the ID of the given link |
peekedItem | the peeked frame. |
txParams | the TX parameters for the frame |
availableTime | the time available for the transmission of the frame (including protection and acknowledgment); a value of Time::Min() indicates no time constraint |
initialFrame | true if the frame is the initial PPDU of a TXOP |
Definition at line 491 of file qos-txop.cc.
References AssignSequenceNumber(), GetBaBufferSize(), GetBaStartingSequence(), ns3::WifiTxParameters::GetSize(), ns3::Mac48Address::IsBroadcast(), ns3::IsInWindow(), ns3::Txop::m_mac, ns3::Time::Min(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::StaticCast().
Referenced by AmpduAggregationTest::DoRun(), EhtAggregationTest::DoRun(), HeAggregationTest::DoRun(), and TwoLevelAggregationTest::DoRun().
uint16_t ns3::QosTxop::GetNextSequenceNumberFor | ( | const WifiMacHeader * | hdr | ) |
Return the next sequence number for the given header.
hdr | Wi-Fi header. |
Definition at line 340 of file qos-txop.cc.
References ns3::Txop::m_txMiddle.
uint8_t ns3::QosTxop::GetQosQueueSize | ( | uint8_t | tid, |
Mac48Address | receiver ) const |
Get the value for the Queue Size subfield of the QoS Control field of a QoS data frame of the given TID and addressed to the given receiver.
tid | the Traffic ID |
receiver | the address of the given receiver |
Definition at line 171 of file qos-txop.cc.
References ns3::Txop::m_queue, NS_LOG_DEBUG, queueSize, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
|
virtual |
Return the remaining duration in the current TXOP on the given link.
linkId | the ID of the given link |
Definition at line 632 of file qos-txop.cc.
References GetLink(), ns3::Time::IsStrictlyNegative(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by ns3::QosFrameExchangeManager::GetCtsToSelfDurationId(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::HeFrameExchangeManager::GetMuRtsDurationId(), ns3::HtFrameExchangeManager::GetPsduDurationId(), ns3::QosFrameExchangeManager::GetRtsDurationId(), ns3::QosFrameExchangeManager::SendCfEndIfNeeded(), ns3::QosFrameExchangeManager::StartTransmission(), and ns3::QosFrameExchangeManager::TransmissionSucceeded().
|
virtual |
linkId | the ID of the given link |
Definition at line 587 of file qos-txop.cc.
References GetLink(), and NS_LOG_FUNCTION.
Referenced by ns3::QosFrameExchangeManager::PifsRecovery(), and ns3::QosFrameExchangeManager::StartTransmission().
|
static |
Get the type ID.
Definition at line 45 of file qos-txop.cc.
References GetAddBaResponseTimeout(), GetFailedAddBaTimeout(), m_baManager, m_nMaxInflights, m_txopTrace, m_useExplicitBarAfterMissedBlockAck, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MilliSeconds(), SetAddBaResponseTimeout(), SetFailedAddBaTimeout(), and ns3::TypeId::SetParent().
void ns3::QosTxop::GotAddBaResponse | ( | const MgtAddBaResponseHeader & | respHdr, |
Mac48Address | recipient ) |
Event handler when an ADDBA response is received.
respHdr | ADDBA response header. |
recipient | address of the recipient. |
Definition at line 648 of file qos-txop.cc.
References ns3::MgtAddBaResponseHeader::GetStatusCode(), ns3::MgtAddBaResponseHeader::GetTid(), ns3::StatusCode::IsSuccess(), m_baManager, ns3::Txop::m_queue, ns3::Txop::m_txMiddle, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
void ns3::QosTxop::GotDelBaFrame | ( | const MgtDelBaHeader * | delBaHdr, |
Mac48Address | recipient ) |
Event handler when a DELBA frame is received.
delBaHdr | DELBA header. |
recipient | address of the recipient. |
Definition at line 679 of file qos-txop.cc.
References ns3::MgtDelBaHeader::GetTid(), m_baManager, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
overridevirtual |
Check if the Txop has frames to transmit over the given link.
linkId | the ID of the given link. |
Reimplemented from ns3::Txop.
Definition at line 325 of file qos-txop.cc.
References m_ac, ns3::Txop::m_queue, and NS_LOG_DEBUG.
Referenced by CreateQueue(), and ns3::WifiMac::UnblockUnicastTxOnLinks().
Check if the given MPDU is to be considered old according to the current starting sequence number of the transmit window, provided that a block ack agreement has been established with the recipient for the given TID.
mpdu | the given MPDU |
Definition at line 352 of file qos-txop.cc.
References GetBaStartingSequence(), ns3::Txop::m_mac, NS_LOG_FUNCTION, and ns3::QosUtilsIsOldPacket().
Referenced by PeekNextMpdu().
|
overridevirtual |
Check for QoS TXOP.
Reimplemented from ns3::Txop.
Definition at line 790 of file qos-txop.cc.
bool ns3::QosTxop::MuEdcaTimerRunning | ( | uint8_t | linkId | ) | const |
Return true if the MU EDCA Timer is running for the given link, false otherwise.
linkId | the ID of the given link |
Definition at line 231 of file qos-txop.cc.
References GetLink(), and ns3::Simulator::Now().
Referenced by EdcaDisabled(), GetAifsn(), GetMaxCw(), and GetMinCw().
|
overridevirtual |
Called by the FrameExchangeManager to notify that channel access has been granted on the given link for the given amount of time.
linkId | the ID of the given link |
txopDuration | the duration of the TXOP gained (zero for DCF) |
Reimplemented from ns3::Txop.
Definition at line 576 of file qos-txop.cc.
References GetLink(), ns3::Time::Min(), ns3::Txop::NotifyChannelAccessed(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::QosTxop::QosLinkEntity::startTxop, and ns3::QosTxop::QosLinkEntity::txopDuration.
Referenced by ns3::QosFrameExchangeManager::StartTransmission().
|
overridevirtual |
Called by the FrameExchangeManager to notify the completion of the transmissions.
This method generates a new backoff and restarts access if needed.
linkId | the ID of the link the FrameExchangeManager is operating on |
Reimplemented from ns3::Txop.
Definition at line 595 of file qos-txop.cc.
References ns3::Txop::LinkEntity::access, ns3::Txop::GenerateBackoff(), GetLink(), ns3::Txop::m_mac, ns3::Txop::m_queue, m_txopTrace, ns3::Txop::NOT_REQUESTED, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Txop::RequestAccess(), and ns3::Simulator::ScheduleNow().
void ns3::QosTxop::NotifyOriginatorAgreementNoReply | ( | const Mac48Address & | recipient, |
uint8_t | tid ) |
Take action upon notification of ADDBA_REQUEST frame being discarded (likely due to exceeded max retry limit).
recipient | the intended recipient of the ADDBA_REQUEST frame |
tid | the TID |
Definition at line 687 of file qos-txop.cc.
References m_baManager, and NS_LOG_FUNCTION.
Referenced by AddBaResponseTimeout().
Ptr< WifiMpdu > ns3::QosTxop::PeekNextMpdu | ( | uint8_t | linkId, |
uint8_t | tid = 8, | ||
Mac48Address | recipient = Mac48Address::GetBroadcast(), | ||
Ptr< const WifiMpdu > | mpdu = nullptr ) |
Peek the next frame to transmit on the given link to the given receiver and of the given TID from the EDCA queue.
If tid is equal to 8 (invalid value) and recipient is the broadcast address, the first available frame is returned. If mpdu is not a null pointer, the search starts from the MPDU following mpdu in the queue; otherwise, the search starts from the head of the queue. Note that A-MSDU aggregation is never attempted. If the frame has never been transmitted, it is assigned a sequence number peeked from MacTxMiddle. Also note that multiple links are only available since 802.11be.
linkId | the ID of the given link |
tid | traffic ID. |
recipient | the receiver station address. |
mpdu | the MPDU after which the search starts from |
Definition at line 374 of file qos-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), GetBaBufferSize(), GetBaStartingSequence(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::Mac48Address::IsBroadcast(), ns3::IsInWindow(), ns3::Callback< R, UArgs >::IsNull(), ns3::WifiMacHeader::IsQosData(), IsQosOldPacket(), m_ac, ns3::Txop::m_droppedMpduCallback, ns3::Txop::m_mac, m_nMaxInflights, ns3::Txop::m_queue, ns3::Txop::m_txMiddle, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetSequenceNumber(), ns3::WIFI_MAC_DROP_QOS_OLD_PACKET, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
Referenced by AmpduAggregationTest::DoRun(), EhtAggregationTest::DoRun(), HeAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), ns3::RrMultiUserScheduler::SelectTxFormat(), and ns3::RrMultiUserScheduler::TrySendingDlMuPpdu().
uint16_t ns3::QosTxop::PeekNextSequenceNumberFor | ( | const WifiMacHeader * | hdr | ) |
Return the next sequence number for the Traffic ID and destination, but do not pick it (i.e.
the current sequence number remains unchanged).
hdr | Wi-Fi header. |
Definition at line 346 of file qos-txop.cc.
References ns3::Txop::m_txMiddle.
std::pair< CtrlBAckRequestHeader, WifiMacHeader > ns3::QosTxop::PrepareBlockAckRequest | ( | Mac48Address | recipient, |
uint8_t | tid ) const |
recipient | Address of recipient. |
tid | traffic ID. |
Prepare a BlockAckRequest to be sent to recipient for Traffic ID tid. The header for the BlockAckRequest is requested to the QosTxop corresponding to the given TID. A block ack agreement with the given recipient for the given TID must have been established by such QosTxop.
Definition at line 296 of file qos-txop.cc.
References m_ac, m_baManager, ns3::Txop::m_mac, NS_ASSERT, NS_LOG_FUNCTION, ns3::QosUtilsMapTidToAc(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_BACKREQ.
void ns3::QosTxop::ResetBa | ( | Mac48Address | recipient, |
uint8_t | tid ) |
Reset BA agreement after BA negotiation failed.
recipient | MAC address of recipient |
tid | traffic ID |
Definition at line 749 of file qos-txop.cc.
References m_baManager, and NS_LOG_FUNCTION.
Referenced by AddBaResponseTimeout(), and ns3::HtFrameExchangeManager::NotifyPacketDiscarded().
void ns3::QosTxop::SetAddBaResponseTimeout | ( | Time | addBaResponseTimeout | ) |
Set the timeout to wait for ADDBA response.
addBaResponseTimeout | the timeout to wait for ADDBA response |
Definition at line 764 of file qos-txop.cc.
References m_addBaResponseTimeout, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::QosTxop::SetBlockAckInactivityTimeout | ( | uint16_t | timeout | ) |
Set the BlockAck inactivity timeout.
timeout | the BlockAck inactivity timeout. |
Definition at line 716 of file qos-txop.cc.
References m_blockAckInactivityTimeout, NS_LOG_FUNCTION, and timeout.
Referenced by ns3::WifiMac::SetBeBlockAckInactivityTimeout(), ns3::WifiMac::SetBkBlockAckInactivityTimeout(), ns3::WifiMac::SetViBlockAckInactivityTimeout(), and ns3::WifiMac::SetVoBlockAckInactivityTimeout().
void ns3::QosTxop::SetBlockAckThreshold | ( | uint8_t | threshold | ) |
Set threshold for block ack mechanism.
If number of packets in the queue reaches the threshold, block ack mechanism is used.
threshold | block ack threshold value. |
Definition at line 708 of file qos-txop.cc.
References m_baManager, m_blockAckThreshold, and NS_LOG_FUNCTION.
Referenced by ns3::WifiMac::SetBeBlockAckThreshold(), ns3::WifiMac::SetBkBlockAckThreshold(), ns3::WifiMac::SetViBlockAckThreshold(), and ns3::WifiMac::SetVoBlockAckThreshold().
|
overridevirtual |
callback | the callback to invoke when an MPDU is dropped |
Reimplemented from ns3::Txop.
Definition at line 182 of file qos-txop.cc.
References ns3::Callback< R, UArgs >::Bind(), m_baManager, NS_LOG_FUNCTION, ns3::Txop::SetDroppedMpduCallback(), and ns3::WIFI_MAC_DROP_QOS_OLD_PACKET.
void ns3::QosTxop::SetFailedAddBaTimeout | ( | Time | failedAddBaTimeout | ) |
Set the timeout for failed BA agreement.
During the timeout period, all packets will be transmitted using normal MPDU.
failedAddBaTimeout | the timeout for failed BA agreement |
Definition at line 777 of file qos-txop.cc.
References m_failedAddBaTimeout, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::QosTxop::SetMuAifsn | ( | uint8_t | aifsn, |
uint8_t | linkId ) |
Set the number of slots that make up an AIFS while the MU EDCA Timer is running for the given link.
aifsn | the number of slots that make up an AIFS. |
linkId | the ID of the given link |
Definition at line 204 of file qos-txop.cc.
References GetLink(), ns3::QosTxop::QosLinkEntity::muAifsn, and NS_LOG_FUNCTION.
void ns3::QosTxop::SetMuCwMax | ( | uint16_t | cwMax, |
uint8_t | linkId ) |
Set the maximum contention window size to use while the MU EDCA Timer is running for the given link.
cwMax | the maximum contention window size. |
linkId | the ID of the given link |
Definition at line 197 of file qos-txop.cc.
References GetLink(), ns3::QosTxop::QosLinkEntity::muCwMax, and NS_LOG_FUNCTION.
void ns3::QosTxop::SetMuCwMin | ( | uint16_t | cwMin, |
uint8_t | linkId ) |
Set the minimum contention window size to use while the MU EDCA Timer is running for the given link.
cwMin | the minimum contention window size. |
linkId | the ID of the given link |
Definition at line 190 of file qos-txop.cc.
References GetLink(), ns3::QosTxop::QosLinkEntity::muCwMin, and NS_LOG_FUNCTION.
void ns3::QosTxop::SetMuEdcaTimer | ( | Time | timer, |
uint8_t | linkId ) |
Set the MU EDCA Timer for the given link.
timer | the timer duration. |
linkId | the ID of the given link |
Definition at line 211 of file qos-txop.cc.
References GetLink(), ns3::QosTxop::QosLinkEntity::muEdcaTimer, and NS_LOG_FUNCTION.
void ns3::QosTxop::StartMuEdcaTimerNow | ( | uint8_t | linkId | ) |
Start the MU EDCA Timer for the given link.
linkId | the ID of the given link |
Definition at line 218 of file qos-txop.cc.
References EdcaDisabled(), GetLink(), ns3::Txop::m_mac, ns3::Time::MS, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
bool ns3::QosTxop::UseExplicitBarAfterMissedBlockAck | ( | ) | const |
Return true if an explicit BlockAckRequest is sent after a missed BlockAck.
Definition at line 319 of file qos-txop.cc.
References m_useExplicitBarAfterMissedBlockAck.
|
friend |
allow AggregationCapableTransmissionListener class access
Definition at line 426 of file qos-txop.h.
|
private |
the access category
Definition at line 440 of file qos-txop.h.
Referenced by CreateQueue(), GetAccessCategory(), HasFramesToTransmit(), PeekNextMpdu(), and PrepareBlockAckRequest().
|
private |
timeout for ADDBA response
Definition at line 448 of file qos-txop.h.
Referenced by GetAddBaResponseTimeout(), and SetAddBaResponseTimeout().
|
private |
the block ack manager
Definition at line 441 of file qos-txop.h.
Referenced by QosTxop(), AddBaResponseTimeout(), CompleteMpduTx(), CreateQueue(), DoDispose(), GetBaBufferSize(), GetBaManager(), GetBaStartingSequence(), GetTypeId(), GotAddBaResponse(), GotDelBaFrame(), NotifyOriginatorAgreementNoReply(), PrepareBlockAckRequest(), ResetBa(), SetBlockAckThreshold(), and SetDroppedMpduCallback().
|
private |
the BlockAck inactivity timeout value (in TUs, i.e.
blocks of 1024 microseconds)
Definition at line 446 of file qos-txop.h.
Referenced by GetBlockAckInactivityTimeout(), and SetBlockAckInactivityTimeout().
|
private |
the block ack threshold (use BA mechanism if number of packets in queue reaches this value.
If this value is 0, block ack is never used. When A-MPDU is enabled, block ack mechanism is used regardless of this value)
Definition at line 442 of file qos-txop.h.
Referenced by GetBlockAckThreshold(), and SetBlockAckThreshold().
|
private |
timeout after failed BA agreement
Definition at line 449 of file qos-txop.h.
Referenced by AddBaResponseTimeout(), GetFailedAddBaTimeout(), and SetFailedAddBaTimeout().
|
private |
the maximum number of links on which an MPDU can be in-flight at the same time
Definition at line 452 of file qos-txop.h.
Referenced by GetTypeId(), and PeekNextMpdu().
|
private |
TXOP trace callback.
Definition at line 460 of file qos-txop.h.
Referenced by GetTypeId(), and NotifyChannelReleased().
|
private |
flag whether explicit BlockAckRequest should be sent upon missed BlockAck Response
Definition at line 450 of file qos-txop.h.
Referenced by GetTypeId(), and UseExplicitBarAfterMissedBlockAck().