24 #include "ns3/traced-value.h"
30 class ChannelAccessManager;
34 class WifiMacQueueItem;
35 class UniformRandomVariable;
36 class CtrlBAckResponseHeader;
167 virtual uint32_t
GetMinCw (
void)
const;
173 virtual uint32_t
GetMaxCw (
void)
const;
179 virtual uint8_t
GetAifsn (
void)
const;
300 uint32_t
GetCw (
void)
const;
Manage a set of ns3::Txop.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Handle packet fragmentation and retransmissions for data and management frames.
Ptr< WifiMac > m_mac
the wifi MAC
void DoInitialize(void) override
Initialize() implementation.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual ChannelAccessStatus GetAccessStatus(void) const
void UpdateFailedCw(void)
Update the value of the CW variable to take into account a transmission failure.
Ptr< WifiMacQueue > m_queue
the wifi MAC queue
virtual void NotifyChannelReleased(void)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Ptr< UniformRandomVariable > m_rng
the random stream
uint32_t m_backoff
the current backoff
uint32_t GetCw(void) const
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
virtual void NotifySleep(void)
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the ...
uint32_t m_cw
the current contention window
ChannelAccessStatus m_access
channel access status
TracedValue< uint32_t > m_cwTrace
CW trace value.
ChannelAccessStatus
Enumeration for channel access status.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
Time GetTxopLimit(void) const
Return the TXOP limit.
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
TracedCallback< uint32_t > m_backoffTrace
backoff trace value
virtual void NotifyAccessRequested(void)
Notify that access request has been received.
uint32_t m_cwMin
the minimum contention window
Time m_backoffStart
the backoffStart variable is used to keep track of the time at which a backoff was started or the tim...
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
virtual void NotifyOn(void)
When on operation occurs, channel access will be started.
static TypeId GetTypeId(void)
Get the type ID.
virtual bool IsQosTxop() const
Check for QoS TXOP.
virtual void NotifyChannelAccessed(Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
Time m_txopLimit
the TXOP limit time
DroppedMpdu m_droppedMpduCallback
the dropped MPDU callback
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Callback< void, WifiMacDropReason, Ptr< const WifiMacQueueItem > > DroppedMpdu
typedef for a callback to invoke when an MPDU is dropped.
Ptr< ChannelAccessManager > m_channelAccessManager
the channel access manager
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound)
Update backoff slots that nSlots has passed.
void ResetCw(void)
Update the value of the CW variable to take into account a transmission success or a transmission abo...
uint32_t m_backoffSlots
the number of backoff slots
void RequestAccess(void)
Request access to the ChannelAccessManager.
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
Time GetBackoffStart(void) const
Return the time when the backoff procedure started.
virtual uint32_t GetMaxCw(void) const
Return the maximum contention window size.
uint32_t m_cwMax
the maximum contention window
virtual void NotifyWakeUp(void)
When wake up operation occurs, channel access will be restarted.
void StartBackoffNow(uint32_t nSlots)
virtual void NotifyOff(void)
When off operation occurs, the queue gets cleaned up.
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
uint32_t GetBackoffSlots(void) const
Return the current number of backoff slots.
void SetChannelAccessManager(const Ptr< ChannelAccessManager > manager)
Set ChannelAccessManager this Txop is associated to.
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
virtual void GenerateBackoff(void)
Generate a new backoff now.
virtual bool HasFramesToTransmit(void)
Check if the Txop has frames to transmit.
virtual uint32_t GetMinCw(void) const
Return the minimum contention window size.
virtual uint8_t GetAifsn(void) const
Return the number of slots that make up an AIFS.
void DoDispose(void) override
Destructor implementation.
virtual void StartAccessIfNeeded(void)
Request access from Txop if needed.
a unique identifier for an interface.
Time Seconds(double value)
Construct a Time in the indicated unit.
WifiMacDropReason
The reason why an MPDU was dropped.
Every class exported by the ns3 library is enclosed in the ns3 namespace.