Handle packet fragmentation and retransmissions for data and management frames. More...
#include "txop.h"
Public Types | |
enum | ChannelAccessStatus { NOT_REQUESTED = 0 , REQUESTED , GRANTED } |
Enumeration for channel access status. More... | |
typedef Callback< void, WifiMacDropReason, Ptr< const WifiMacQueueItem > > | DroppedMpdu |
typedef for a callback to invoke when an MPDU is dropped. More... | |
Public Member Functions | |
Txop () | |
virtual | ~Txop () |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
virtual AcIndex | GetAccessCategory (void) const |
Get the access category. More... | |
virtual ChannelAccessStatus | GetAccessStatus (void) const |
uint8_t | GetAifsn (void) const |
Return the number of slots that make up an AIFS. More... | |
uint32_t | GetMaxCw (void) const |
Return the maximum contention window size. More... | |
uint32_t | GetMinCw (void) const |
Return the minimum contention window size. More... | |
Time | GetTxopLimit (void) const |
Return the TXOP limit. More... | |
Ptr< WifiMacQueue > | GetWifiMacQueue () const |
Return the packet queue associated with this Txop. More... | |
virtual bool | IsQosTxop () const |
Check for QoS TXOP. More... | |
virtual void | NotifyChannelAccessed (Time txopDuration=Seconds(0)) |
Called by the FrameExchangeManager to notify that channel access has been granted for the given amount of time. More... | |
virtual void | NotifyChannelReleased (void) |
Called by the FrameExchangeManager to notify the completion of the transmissions. More... | |
virtual void | NotifyChannelSwitching (void) |
When a channel switching occurs, enqueued packets are removed. More... | |
virtual void | NotifyOff (void) |
When off operation occurs, the queue gets cleaned up. More... | |
virtual void | NotifyOn (void) |
When on operation occurs, channel access will be started. More... | |
virtual void | NotifySleep (void) |
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the front of the queue. More... | |
virtual void | NotifyWakeUp (void) |
When wake up operation occurs, channel access will be restarted. More... | |
virtual void | Queue (Ptr< Packet > packet, const WifiMacHeader &hdr) |
void | ResetCw (void) |
Update the value of the CW variable 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). More... | |
void | SetAifsn (uint8_t aifsn) |
Set the number of slots that make up an AIFS. More... | |
void | SetChannelAccessManager (const Ptr< ChannelAccessManager > manager) |
Set ChannelAccessManager this Txop is associated to. More... | |
virtual void | SetDroppedMpduCallback (DroppedMpdu callback) |
void | SetMaxCw (uint32_t maxCw) |
Set the maximum contention window size. More... | |
void | SetMinCw (uint32_t minCw) |
Set the minimum contention window size. More... | |
void | SetTxMiddle (const Ptr< MacTxMiddle > txMiddle) |
Set MacTxMiddle this Txop is associated to. More... | |
void | SetTxopLimit (Time txopLimit) |
Set the TXOP limit. More... | |
virtual void | SetWifiRemoteStationManager (const Ptr< WifiRemoteStationManager > remoteManager) |
Set WifiRemoteStationsManager this Txop is associated to. More... | |
void | StartBackoffNow (uint32_t nSlots) |
void | UpdateFailedCw (void) |
Update the value of the CW variable to take into account a transmission failure. More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
void | DoDispose (void) override |
Destructor implementation. More... | |
void | DoInitialize (void) override |
Initialize() implementation. More... | |
virtual void | GenerateBackoff (void) |
Generate a new backoff now. More... | |
uint32_t | GetBackoffSlots (void) const |
Return the current number of backoff slots. More... | |
Time | GetBackoffStart (void) const |
Return the time when the backoff procedure started. More... | |
uint32_t | GetCw (void) const |
virtual bool | HasFramesToTransmit (void) |
Check if the Txop has frames to transmit. More... | |
virtual void | NotifyAccessRequested (void) |
Notify that access request has been received. More... | |
virtual void | NotifyInternalCollision (void) |
Notify the Txop that internal collision has occurred. More... | |
void | RequestAccess (void) |
Request access to the ChannelAccessManager. More... | |
virtual void | StartAccessIfNeeded (void) |
Request access from Txop if needed. More... | |
void | UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound) |
Update backoff slots that nSlots has passed. More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Protected Attributes | |
ChannelAccessStatus | m_access |
channel access status More... | |
uint8_t | m_aifsn |
the AIFSN More... | |
uint32_t | m_backoff |
the current backoff More... | |
uint32_t | m_backoffSlots |
the number of backoff slots More... | |
Time | m_backoffStart |
the backoffStart variable is used to keep track of the time at which a backoff was started or the time at which the backoff counter was last updated. More... | |
TracedCallback< uint32_t > | m_backoffTrace |
backoff trace value More... | |
Ptr< ChannelAccessManager > | m_channelAccessManager |
the channel access manager More... | |
uint32_t | m_cw |
the current contention window More... | |
uint32_t | m_cwMax |
the maximum contention window More... | |
uint32_t | m_cwMin |
the minimum contention window More... | |
TracedValue< uint32_t > | m_cwTrace |
CW trace value. More... | |
DroppedMpdu | m_droppedMpduCallback |
the dropped MPDU callback More... | |
Ptr< WifiMacQueue > | m_queue |
the wifi MAC queue More... | |
Ptr< UniformRandomVariable > | m_rng |
the random stream More... | |
Ptr< WifiRemoteStationManager > | m_stationManager |
the wifi remote station manager More... | |
Ptr< MacTxMiddle > | m_txMiddle |
the MacTxMiddle More... | |
Time | m_txopLimit |
the TXOP limit time More... | |
Friends | |
class | ChannelAccessManager |
< ChannelAccessManager associated class More... | |
class | MacLowTransmissionListener |
allow MacLowTransmissionListener class access More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Handle packet fragmentation and retransmissions for data and management frames.
This class implements the packet fragmentation and retransmission policy for data and management frames. It uses the ns3::MacLow and ns3::ChannelAccessManager helper classes to respectively send packets and decide when to send them. Packets are stored in a ns3::WifiMacQueue until they can be sent.
The policy currently implemented uses a simple fragmentation threshold: any packet bigger than this threshold is fragmented in fragments whose size is smaller than the threshold.
The retransmission policy is also very simple: every packet is retransmitted until it is either successfully transmitted or it has been retransmitted up until the SSRC or SLRC thresholds.
The RTS/CTS policy is similar to the fragmentation policy: when a packet is bigger than a threshold, the RTS/CTS protocol is used.
ns3::Txop is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 184 bytes (on a 64-bit architecture).
typedef Callback<void, WifiMacDropReason, Ptr<const WifiMacQueueItem> > ns3::Txop::DroppedMpdu |
ns3::Txop::Txop | ( | ) |
Definition at line 86 of file txop.cc.
References m_queue, m_rng, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 101 of file txop.cc.
References NS_LOG_FUNCTION.
int64_t ns3::Txop::AssignStreams | ( | int64_t | stream | ) |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
stream | first stream index to use. |
Definition at line 303 of file txop.cc.
References m_rng, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
Referenced by ns3::MeshHelper::AssignStreams(), ns3::WaveHelper::AssignStreams(), ns3::WifiHelper::AssignStreams(), and AssignWifiRandomStreams().
|
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 107 of file txop.cc.
References m_channelAccessManager, m_queue, m_rng, m_stationManager, m_txMiddle, and NS_LOG_FUNCTION.
Referenced by ns3::QosTxop::DoDispose().
|
overrideprotectedvirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 321 of file txop.cc.
References GenerateBackoff(), NS_LOG_FUNCTION, and ResetCw().
|
protectedvirtual |
Generate a new backoff now.
Definition at line 370 of file txop.cc.
References GetCw(), ns3::UniformRandomVariable::GetInteger(), m_backoff, m_backoffTrace, m_rng, NS_LOG_FUNCTION, and StartBackoffNow().
Referenced by ns3::QosTxop::AddBaResponseTimeout(), ns3::QosTxop::DoInitialize(), DoInitialize(), NotifyChannelReleased(), NotifyInternalCollision(), ns3::QosTxop::NotifyInternalCollision(), and Queue().
|
virtual |
Get the access category.
Reimplemented in ns3::QosTxop.
Definition at line 427 of file txop.cc.
References ns3::AC_BE_NQOS.
|
virtual |
Definition at line 329 of file txop.cc.
References m_access.
Referenced by ns3::ChannelAccessManager::DoGrantDcfAccess(), ns3::ChannelAccessManager::NeedBackoffUponAccess(), and ns3::ChannelAccessManager::RequestAccess().
uint8_t ns3::Txop::GetAifsn | ( | void | ) | const |
Return the number of slots that make up an AIFS.
Definition at line 268 of file txop.cc.
References m_aifsn.
Referenced by OfdmaAckSequenceTest::DoRun(), ns3::ChannelAccessManager::GetBackoffStartFor(), ns3::ApWifiMac::GetEdcaParameterSet(), GetTypeId(), ns3::ChannelAccessManager::NeedBackoffUponAccess(), and ns3::ChannelAccessManager::RequestAccess().
|
protected |
Return the current number of backoff slots.
Definition at line 204 of file txop.cc.
References m_backoffSlots.
Referenced by ns3::ChannelAccessManager::DoGrantDcfAccess(), ns3::ChannelAccessManager::GetBackoffEndFor(), and ns3::ChannelAccessManager::NeedBackoffUponAccess().
|
protected |
Return the time when the backoff procedure started.
Definition at line 210 of file txop.cc.
References m_backoffStart.
Referenced by ns3::ChannelAccessManager::GetBackoffStartFor(), and ns3::ChannelAccessManager::RequestAccess().
|
protected |
Definition at line 181 of file txop.cc.
References m_cw.
Referenced by GenerateBackoff().
uint32_t ns3::Txop::GetMaxCw | ( | void | ) | const |
Return the maximum contention window size.
Definition at line 262 of file txop.cc.
References m_cwMax.
Referenced by ns3::ApWifiMac::GetEdcaParameterSet(), and GetTypeId().
uint32_t ns3::Txop::GetMinCw | ( | void | ) | const |
Return the minimum contention window size.
Definition at line 256 of file txop.cc.
References m_cwMin.
Referenced by ns3::ApWifiMac::GetEdcaParameterSet(), and GetTypeId().
Time ns3::Txop::GetTxopLimit | ( | void | ) | const |
Return the TXOP limit.
Definition at line 274 of file txop.cc.
References m_txopLimit.
Referenced by TwoLevelAggregationTest::DoRun(), ns3::QosFrameExchangeManager::GetCtsToSelfDurationId(), ns3::ApWifiMac::GetEdcaParameterSet(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::HtFrameExchangeManager::GetPsduDurationId(), ns3::QosFrameExchangeManager::GetRtsDurationId(), GetTypeId(), ns3::WifiDefaultAckManager::IsResponseNeeded(), ns3::QosFrameExchangeManager::SendCfEndIfNeeded(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::TransmissionFailed(), ns3::HtFrameExchangeManager::TransmissionSucceeded(), and ns3::QosFrameExchangeManager::TransmissionSucceeded().
|
static |
Get the type ID.
Definition at line 44 of file txop.cc.
References GetAifsn(), GetMaxCw(), GetMinCw(), GetTxopLimit(), GetWifiMacQueue(), m_backoffTrace, m_cwTrace, ns3::MakePointerAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MilliSeconds(), SetAifsn(), SetMaxCw(), SetMinCw(), ns3::TypeId::SetParent(), and SetTxopLimit().
Ptr< WifiMacQueue > ns3::Txop::GetWifiMacQueue | ( | ) | const |
Return the packet queue associated with this Txop.
Definition at line 150 of file txop.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), HeAggregationTest::DoRunSubTest(), GetTypeId(), ns3::WifiHelper::Install(), ns3::WifiDefaultAckManager::IsResponseNeeded(), ns3::HtFrameExchangeManager::NeedSetupBlockAck(), ns3::FrameExchangeManager::ReceivedNormalAck(), ns3::FrameExchangeManager::RetransmitMpduAfterMissedAck(), ns3::WaveFrameExchangeManager::StartTransmission(), and ns3::FrameExchangeManager::StartTransmission().
|
protectedvirtual |
Check if the Txop has frames to transmit.
Reimplemented in ns3::QosTxop.
Definition at line 280 of file txop.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::ChannelAccessManager::NeedBackoffUponAccess(), NotifyChannelReleased(), and StartAccessIfNeeded().
|
virtual |
Check for QoS TXOP.
Reimplemented in ns3::QosTxop.
Definition at line 421 of file txop.cc.
Referenced by ns3::ChannelAccessManager::NeedBackoffUponAccess(), ns3::ChannelAccessManager::RequestAccess(), and ns3::QosFrameExchangeManager::StartTransmission().
|
protectedvirtual |
Notify that access request has been received.
Definition at line 335 of file txop.cc.
References m_access, NS_LOG_FUNCTION, and REQUESTED.
Referenced by ns3::ChannelAccessManager::RequestAccess().
Called by the FrameExchangeManager to notify that channel access has been granted for the given amount of time.
txopDuration | the duration of the TXOP gained (zero for DCF) |
Reimplemented in ns3::QosTxop.
Definition at line 342 of file txop.cc.
References GRANTED, m_access, and NS_LOG_FUNCTION.
Referenced by ns3::QosTxop::NotifyChannelAccessed(), ns3::WaveFrameExchangeManager::StartTransmission(), ns3::FrameExchangeManager::StartTransmission(), and FrameExchangeManagerStub::StartTransmission().
|
virtual |
Called by the FrameExchangeManager to notify the completion of the transmissions.
This method generates a new backoff and restarts access if needed.
Reimplemented in ns3::QosTxop.
Definition at line 349 of file txop.cc.
References GenerateBackoff(), HasFramesToTransmit(), m_access, NOT_REQUESTED, NS_LOG_FUNCTION, RequestAccess(), and ns3::Simulator::ScheduleNow().
Referenced by ns3::QosTxop::NotifyChannelReleased(), ns3::QosFrameExchangeManager::SendCfEndIfNeeded(), ns3::WaveFrameExchangeManager::StartTransmission(), ns3::FrameExchangeManager::StartTransmission(), ns3::FrameExchangeManager::TransmissionFailed(), and ns3::FrameExchangeManager::TransmissionSucceeded().
|
virtual |
When a channel switching occurs, enqueued packets are removed.
Definition at line 387 of file txop.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::OcbWifiMac::CancleTx().
|
protectedvirtual |
Notify the Txop that internal collision has occurred.
Reimplemented in ns3::QosTxop.
Definition at line 379 of file txop.cc.
References GenerateBackoff(), NS_LOG_FUNCTION, and StartAccessIfNeeded().
|
virtual |
When off operation occurs, the queue gets cleaned up.
Definition at line 400 of file txop.cc.
References m_queue, and NS_LOG_FUNCTION.
|
virtual |
When on operation occurs, channel access will be started.
Definition at line 414 of file txop.cc.
References NS_LOG_FUNCTION, and StartAccessIfNeeded().
|
virtual |
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the front of the queue.
Definition at line 394 of file txop.cc.
References NS_LOG_FUNCTION.
|
virtual |
When wake up operation occurs, channel access will be restarted.
Definition at line 407 of file txop.cc.
References NS_LOG_FUNCTION, and StartAccessIfNeeded().
|
virtual |
packet | packet to send. |
hdr | header of packet to send. |
Store the packet in the internal queue until it can be sent safely.
Definition at line 288 of file txop.cc.
References GenerateBackoff(), m_channelAccessManager, m_queue, NS_LOG_FUNCTION, ns3::Packet::RemovePacketTag(), and StartAccessIfNeeded().
Referenced by ns3::OcbWifiMac::Enqueue(), ns3::AdhocWifiMac::Enqueue(), ns3::StaWifiMac::Enqueue(), ns3::ApWifiMac::ForwardDown(), ns3::StaWifiMac::SendAssociationRequest(), ns3::ApWifiMac::SendAssocResp(), ns3::MeshWifiInterfaceMac::SendBeacon(), ns3::ApWifiMac::SendOneBeacon(), ns3::StaWifiMac::SendProbeRequest(), ns3::ApWifiMac::SendProbeResp(), and ns3::OcbWifiMac::SendVsc().
|
protected |
Request access to the ChannelAccessManager.
Definition at line 361 of file txop.cc.
References m_access, m_channelAccessManager, and NOT_REQUESTED.
Referenced by NotifyChannelReleased().
void ns3::Txop::ResetCw | ( | void | ) |
Update the value of the CW variable 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).
By default, this resets the CW variable to minCW.
Definition at line 187 of file txop.cc.
References m_cw, m_cwMin, m_cwTrace, and NS_LOG_FUNCTION.
Referenced by ns3::HtFrameExchangeManager::BlockAckTimeout(), ns3::FrameExchangeManager::CtsTimeout(), ns3::HtFrameExchangeManager::CtsTimeout(), ns3::QosTxop::DoInitialize(), DoInitialize(), ns3::FrameExchangeManager::NormalAckTimeout(), ns3::QosTxop::NotifyInternalCollision(), ns3::FrameExchangeManager::ReceivedNormalAck(), ns3::HtFrameExchangeManager::ReceiveMpdu(), SetMaxCw(), and SetMinCw().
void ns3::Txop::SetAifsn | ( | uint8_t | aifsn | ) |
Set the number of slots that make up an AIFS.
aifsn | the number of slots that make up an AIFS. |
Definition at line 241 of file txop.cc.
References m_aifsn, and NS_LOG_FUNCTION.
Referenced by ns3::ApWifiMac::ApWifiMac(), ns3::WifiMac::ConfigureDcf(), ns3::OcbWifiMac::ConfigureEdca(), ns3::MeshWifiInterfaceMac::ConfigureStandard(), GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
void ns3::Txop::SetChannelAccessManager | ( | const Ptr< ChannelAccessManager > | manager | ) |
Set ChannelAccessManager this Txop is associated to.
manager | ChannelAccessManager to associate. |
Definition at line 118 of file txop.cc.
References m_channelAccessManager, and NS_LOG_FUNCTION.
Referenced by ns3::ApWifiMac::ApWifiMac(), ns3::RegularWifiMac::RegularWifiMac(), and ns3::RegularWifiMac::SetupEdcaQueue().
|
virtual |
callback | the callback to invoke when an MPDU is dropped |
Reimplemented in ns3::QosTxop.
Definition at line 139 of file txop.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Bind(), m_droppedMpduCallback, m_queue, NS_LOG_FUNCTION, ns3::WIFI_MAC_DROP_EXPIRED_LIFETIME, and ns3::WIFI_MAC_DROP_FAILED_ENQUEUE.
Referenced by ns3::RegularWifiMac::RegularWifiMac(), and ns3::QosTxop::SetDroppedMpduCallback().
void ns3::Txop::SetMaxCw | ( | uint32_t | maxCw | ) |
Set the maximum contention window size.
maxCw | the maximum contention window size. |
Definition at line 169 of file txop.cc.
References m_cwMax, NS_LOG_FUNCTION, and ResetCw().
Referenced by ns3::ApWifiMac::ApWifiMac(), ns3::WifiMac::ConfigureDcf(), ns3::OcbWifiMac::ConfigureEdca(), ns3::MeshWifiInterfaceMac::ConfigureStandard(), GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
void ns3::Txop::SetMinCw | ( | uint32_t | minCw | ) |
Set the minimum contention window size.
minCw | the minimum contention window size. |
Definition at line 157 of file txop.cc.
References m_cwMin, NS_LOG_FUNCTION, and ResetCw().
Referenced by ns3::ApWifiMac::ApWifiMac(), ns3::WifiMac::ConfigureDcf(), ns3::OcbWifiMac::ConfigureEdca(), ns3::MeshWifiInterfaceMac::ConfigureStandard(), GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
void ns3::Txop::SetTxMiddle | ( | const Ptr< MacTxMiddle > | txMiddle | ) |
Set MacTxMiddle this Txop is associated to.
txMiddle | MacTxMiddle to associate. |
Definition at line 125 of file txop.cc.
References m_txMiddle, and NS_LOG_FUNCTION.
Referenced by ns3::ApWifiMac::ApWifiMac(), ns3::RegularWifiMac::RegularWifiMac(), and ns3::RegularWifiMac::SetupEdcaQueue().
void ns3::Txop::SetTxopLimit | ( | Time | txopLimit | ) |
Set the TXOP limit.
txopLimit | the TXOP limit. Value zero corresponds to default Txop. |
Definition at line 248 of file txop.cc.
References ns3::Time::GetMicroSeconds(), m_txopLimit, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::WifiMac::ConfigureDcf(), OfdmaAckSequenceTest::DoRun(), GetTypeId(), Experiment::Run(), and ns3::StaWifiMac::SetEdcaParameters().
|
virtual |
Set WifiRemoteStationsManager this Txop is associated to.
remoteManager | WifiRemoteStationManager to associate. |
Reimplemented in ns3::QosTxop.
Definition at line 132 of file txop.cc.
References m_stationManager, and NS_LOG_FUNCTION.
Referenced by ns3::QosTxop::SetWifiRemoteStationManager(), ns3::ApWifiMac::SetWifiRemoteStationManager(), and ns3::RegularWifiMac::SetWifiRemoteStationManager().
|
protectedvirtual |
Request access from Txop if needed.
Definition at line 311 of file txop.cc.
References HasFramesToTransmit(), m_access, m_channelAccessManager, NOT_REQUESTED, and NS_LOG_FUNCTION.
Referenced by NotifyInternalCollision(), NotifyOn(), NotifyWakeUp(), and Queue().
void ns3::Txop::StartBackoffNow | ( | uint32_t | nSlots | ) |
nSlots | the number of slots of the backoff. |
Start a backoff by initializing the backoff counter to the number of slots specified.
Definition at line 225 of file txop.cc.
References m_backoffSlots, m_backoffStart, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by GenerateBackoff().
|
protected |
Update backoff slots that nSlots has passed.
nSlots | the number of slots to decrement |
backoffUpdateBound | the time at which backoff should start |
Definition at line 216 of file txop.cc.
References m_backoffSlots, m_backoffStart, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::ChannelAccessManager::NeedBackoffUponAccess(), and ns3::ChannelAccessManager::RequestAccess().
void ns3::Txop::UpdateFailedCw | ( | void | ) |
Update the value of the CW variable to take into account a transmission failure.
By default, this triggers a doubling of CW (capped by maxCW).
Definition at line 195 of file txop.cc.
References m_cw, m_cwMax, m_cwTrace, min, and NS_LOG_FUNCTION.
Referenced by ns3::HtFrameExchangeManager::BlockAckTimeout(), ns3::FrameExchangeManager::CtsTimeout(), ns3::HtFrameExchangeManager::CtsTimeout(), ns3::FrameExchangeManager::NormalAckTimeout(), and ns3::QosTxop::NotifyInternalCollision().
|
friend |
< ChannelAccessManager associated class
|
friend |
|
protected |
channel access status
Definition at line 342 of file txop.h.
Referenced by ns3::QosTxop::AddBaResponseTimeout(), GetAccessStatus(), ns3::QosTxop::GotAddBaResponse(), NotifyAccessRequested(), NotifyChannelAccessed(), NotifyChannelReleased(), ns3::QosTxop::NotifyInternalCollision(), ns3::QosTxop::PushFront(), RequestAccess(), and StartAccessIfNeeded().
|
protected |
|
protected |
|
protected |
the number of backoff slots
Definition at line 343 of file txop.h.
Referenced by GetBackoffSlots(), StartBackoffNow(), and UpdateBackoffSlotsNow().
|
protected |
the backoffStart variable is used to keep track of the time at which a backoff was started or the time at which the backoff counter was last updated.
Definition at line 349 of file txop.h.
Referenced by GetBackoffStart(), StartBackoffNow(), and UpdateBackoffSlotsNow().
|
protected |
backoff trace value
Definition at line 354 of file txop.h.
Referenced by GenerateBackoff(), and GetTypeId().
|
protected |
the channel access manager
Definition at line 331 of file txop.h.
Referenced by ns3::QosTxop::AddBaResponseTimeout(), DoDispose(), ns3::QosTxop::GotAddBaResponse(), ns3::QosTxop::NotifyInternalCollision(), ns3::QosTxop::PushFront(), Queue(), RequestAccess(), SetChannelAccessManager(), and StartAccessIfNeeded().
|
protected |
the current contention window
Definition at line 340 of file txop.h.
Referenced by GetCw(), ResetCw(), and UpdateFailedCw().
|
protected |
the maximum contention window
Definition at line 339 of file txop.h.
Referenced by GetMaxCw(), SetMaxCw(), and UpdateFailedCw().
|
protected |
the minimum contention window
Definition at line 338 of file txop.h.
Referenced by GetMinCw(), ResetCw(), and SetMinCw().
|
protected |
CW trace value.
Definition at line 355 of file txop.h.
Referenced by GetTypeId(), ResetCw(), and UpdateFailedCw().
|
protected |
the dropped MPDU callback
Definition at line 332 of file txop.h.
Referenced by ns3::QosTxop::NotifyInternalCollision(), SetDroppedMpduCallback(), and ns3::QosTxop::SetDroppedMpduCallback().
|
protected |
the wifi MAC queue
Definition at line 333 of file txop.h.
Referenced by ns3::QosTxop::QosTxop(), Txop(), DoDispose(), ns3::QosTxop::GetNextMpdu(), GetWifiMacQueue(), ns3::QosTxop::GotAddBaResponse(), HasFramesToTransmit(), ns3::QosTxop::HasFramesToTransmit(), NotifyChannelSwitching(), ns3::QosTxop::NotifyInternalCollision(), NotifyOff(), ns3::QosTxop::PeekNextMpdu(), ns3::QosTxop::PushFront(), Queue(), SetDroppedMpduCallback(), and ns3::QosTxop::SetQosQueueSize().
|
protected |
the random stream
Definition at line 336 of file txop.h.
Referenced by Txop(), AssignStreams(), DoDispose(), and GenerateBackoff().
|
protected |
the wifi remote station manager
Definition at line 335 of file txop.h.
Referenced by DoDispose(), ns3::QosTxop::GetNextMpdu(), ns3::QosTxop::NotifyInternalCollision(), ns3::QosTxop::PrepareBlockAckRequest(), SetWifiRemoteStationManager(), and ns3::QosTxop::SetWifiRemoteStationManager().
|
protected |
the MacTxMiddle
Definition at line 334 of file txop.h.
Referenced by ns3::QosTxop::AssignSequenceNumber(), DoDispose(), ns3::QosTxop::GetNextSequenceNumberFor(), ns3::QosTxop::GotAddBaResponse(), ns3::QosTxop::PeekNextMpdu(), ns3::QosTxop::PeekNextSequenceNumberFor(), and SetTxMiddle().
|
protected |
the TXOP limit time
Definition at line 352 of file txop.h.
Referenced by GetTxopLimit(), and SetTxopLimit().