Manage a set of ns3::Txop. More...
#include "channel-access-manager.h"
Public Member Functions | |
ChannelAccessManager () | |
virtual | ~ChannelAccessManager () |
void | Add (Ptr< Txop > txop) |
void | DisableEdcaFor (Ptr< Txop > qosTxop, Time duration) |
Time | GetAccessGrantStart (bool ignoreNav=false) const |
Access will never be granted to the medium before the time returned by this method. More... | |
bool | IsBusy (void) const |
Check if the device is busy sending or receiving, or NAV or CCA busy. More... | |
bool | NeedBackoffUponAccess (Ptr< Txop > txop) |
Determine if a new backoff needs to be generated when a packet is queued for transmission. More... | |
void | NotifyAckTimeoutResetNow (void) |
Notify that ack timer has reset. More... | |
void | NotifyAckTimeoutStartNow (Time duration) |
Notify that ack timer has started for the given duration. More... | |
void | NotifyCtsTimeoutResetNow (void) |
Notify that CTS timer has reset. More... | |
void | NotifyCtsTimeoutStartNow (Time duration) |
Notify that CTS timer has started for the given duration. More... | |
void | NotifyMaybeCcaBusyStartNow (Time duration) |
void | NotifyNavResetNow (Time duration) |
void | NotifyNavStartNow (Time duration) |
void | NotifyOffNow (void) |
Notify the Txop that the device has been put in off mode. More... | |
void | NotifyOnNow (void) |
Notify the Txop that the device has been resumed from off mode. More... | |
void | NotifyRxEndErrorNow (void) |
Notify the Txop that a packet reception was just completed unsuccessfully. More... | |
void | NotifyRxEndOkNow (void) |
Notify the Txop that a packet reception was just completed successfully. More... | |
void | NotifyRxStartNow (Time duration) |
void | NotifySleepNow (void) |
Notify the Txop that the device has been put in sleep mode. More... | |
void | NotifySwitchingStartNow (Time duration) |
void | NotifyTxStartNow (Time duration) |
void | NotifyWakeupNow (void) |
Notify the Txop that the device has been resumed from sleep mode. More... | |
void | RemovePhyListener (Ptr< WifiPhy > phy) |
Remove current registered listener for PHY events. More... | |
void | RequestAccess (Ptr< Txop > txop) |
void | SetupFrameExchangeManager (Ptr< FrameExchangeManager > feManager) |
Set up the Frame Exchange Manager. More... | |
void | SetupPhyListener (Ptr< WifiPhy > phy) |
Set up listener for PHY events. More... | |
Public Member Functions inherited from ns3::Object | |
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... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
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... | |
Protected Member Functions | |
void | DoDispose (void) override |
Destructor implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
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... | |
Private Types | |
typedef std::vector< Ptr< Txop > > | Txops |
typedef for a vector of Txops More... | |
Private Member Functions | |
void | AccessTimeout (void) |
Called when access timeout should occur (e.g. More... | |
void | DoGrantDcfAccess (void) |
Grant access to Txop using DCF/EDCF contention rules. More... | |
void | DoRestartAccessTimeoutIfNeeded (void) |
Time | GetBackoffEndFor (Ptr< Txop > txop) |
Return the time when the backoff procedure ended (or will ended) for the given Txop. More... | |
Time | GetBackoffStartFor (Ptr< Txop > txop) |
Return the time when the backoff procedure started for the given Txop. More... | |
virtual Time | GetEifsNoDifs (void) const |
Return the EIFS duration minus a DIFS. More... | |
virtual Time | GetSifs (void) const |
Return the Short Interframe Space (SIFS) for this PHY. More... | |
virtual Time | GetSlot (void) const |
Return the slot duration for this PHY. More... | |
Time | MostRecent (std::initializer_list< Time > list) const |
Return the most recent time. More... | |
void | UpdateBackoff (void) |
Update backoff slots for all Txops. More... | |
Private Attributes | |
EventId | m_accessTimeout |
the access timeout ID More... | |
Time | m_eifsNoDifs |
EIFS no DIFS time. More... | |
Ptr< FrameExchangeManager > | m_feManager |
pointer to the Frame Exchange Manager More... | |
Time | m_lastAckTimeoutEnd |
the last Ack timeout end time More... | |
Time | m_lastBusyDuration |
the last busy duration time More... | |
Time | m_lastBusyStart |
the last busy start time More... | |
Time | m_lastCtsTimeoutEnd |
the last CTS timeout end time More... | |
Time | m_lastNavDuration |
the last NAV duration time More... | |
Time | m_lastNavStart |
the last NAV start time More... | |
Time | m_lastRxDuration |
the last receive duration time More... | |
bool | m_lastRxReceivedOk |
the last receive OK More... | |
Time | m_lastRxStart |
the last receive start time More... | |
Time | m_lastSwitchingDuration |
the last switching duration time More... | |
Time | m_lastSwitchingStart |
the last switching start time More... | |
Time | m_lastTxDuration |
the last transmit duration time More... | |
Time | m_lastTxStart |
the last transmit start time More... | |
bool | m_off |
flag whether it is in off state More... | |
Ptr< WifiPhy > | m_phy |
pointer to the PHY More... | |
PhyListener * | m_phyListener |
the PHY listener More... | |
Time | m_sifs |
the SIFS time More... | |
bool | m_sleeping |
flag whether it is in sleeping state More... | |
Time | m_slot |
the slot time More... | |
Txops | m_txops |
the vector of managed Txops More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Manage a set of ns3::Txop.
Handle a set of independent ns3::Txop, each of which represents a single DCF within a MAC stack. Each ns3::Txop has a priority implicitly associated with it (the priority is determined when the ns3::Txop is added to the ChannelAccessManager: the first Txop to be added gets the highest priority, the second, the second highest priority, and so on.) which is used to handle "internal" collisions. i.e., when two local Txop are expected to get access to the medium at the same time, the highest priority local Txop wins access to the medium and the other Txop suffers a "internal" collision.
Definition at line 51 of file channel-access-manager.h.
|
private |
typedef for a vector of Txops
Definition at line 296 of file channel-access-manager.h.
ns3::ChannelAccessManager::ChannelAccessManager | ( | ) |
Definition at line 101 of file channel-access-manager.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 122 of file channel-access-manager.cc.
References m_phyListener, and NS_LOG_FUNCTION.
|
private |
Called when access timeout should occur (e.g.
backoff procedure expired).
Definition at line 395 of file channel-access-manager.cc.
References DoGrantDcfAccess(), DoRestartAccessTimeoutIfNeeded(), NS_LOG_FUNCTION, and UpdateBackoff().
Referenced by DoRestartAccessTimeoutIfNeeded().
txop | a new Txop. |
The ChannelAccessManager does not take ownership of this pointer so, the callee must make sure that the Txop pointer will stay valid as long as the ChannelAccessManager is valid. Note that the order in which Txop objects are added to a ChannelAccessManager matters: the first Txop added has the highest priority, the second Txop added, has the second highest priority, etc.
Definition at line 192 of file channel-access-manager.cc.
References m_txops, and NS_LOG_FUNCTION.
qosTxop | a QosTxop that needs to be disabled |
duration | the amount of time during which the QosTxop is disabled |
Disable the given EDCA for the given amount of time. This EDCA will not be granted channel access during this period and the backoff timer will be frozen. After this period, the EDCA will start normal operations again by resuming the backoff timer.
Definition at line 547 of file channel-access-manager.cc.
References DoRestartAccessTimeoutIfNeeded(), ns3::Txop::GetBackoffSlots(), ns3::Txop::IsQosTxop(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, UpdateBackoff(), and ns3::Txop::UpdateBackoffSlotsNow().
|
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 130 of file channel-access-manager.cc.
References m_feManager, m_phy, m_txops, and NS_LOG_FUNCTION.
|
private |
Grant access to Txop using DCF/EDCF contention rules.
This is the first Txop we find with an expired backoff and which needs access to the medium. i.e., it has data to send.
all other Txops with a lower priority whose backoff has expired and which needed access to the medium must be notified that we did get an internal collision.
Now, we notify all of these changes in one go if the EDCAF winning the contention actually transmitted a frame. It is necessary to perform first the calculations of which Txops are colliding and then only apply the changes because applying the changes through notification could change the global state of the manager, and, thus, could change the result of the calculations.
Definition at line 328 of file channel-access-manager.cc.
References ns3::Txop::GetAccessStatus(), GetBackoffEndFor(), ns3::Txop::GetBackoffSlots(), ns3::Txop::IsQosTxop(), bianchi11ax::k, m_feManager, m_txops, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Txop::REQUESTED.
Referenced by AccessTimeout(), and RequestAccess().
|
private |
Is there a Txop which needs to access the medium, and, if there is one, how many slots for AIFS+backoff does it require ?
Definition at line 507 of file channel-access-manager.cc.
References AccessTimeout(), ns3::EventId::Cancel(), GetBackoffEndFor(), ns3::Simulator::GetDelayLeft(), ns3::Simulator::GetMaximumSimulationTime(), ns3::EventId::IsExpired(), ns3::EventId::IsRunning(), m_accessTimeout, m_txops, min, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Txop::REQUESTED, and ns3::Simulator::Schedule().
Referenced by AccessTimeout(), DisableEdcaFor(), NotifyAckTimeoutResetNow(), NotifyCtsTimeoutResetNow(), NotifyNavResetNow(), and RequestAccess().
Time ns3::ChannelAccessManager::GetAccessGrantStart | ( | bool | ignoreNav = false | ) | const |
Access will never be granted to the medium before the time returned by this method.
ignoreNav | flag whether NAV should be ignored |
Definition at line 404 of file channel-access-manager.cc.
References GetEifsNoDifs(), GetSifs(), m_lastAckTimeoutEnd, m_lastBusyDuration, m_lastBusyStart, m_lastCtsTimeoutEnd, m_lastNavDuration, m_lastNavStart, m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, m_lastSwitchingDuration, m_lastSwitchingStart, m_lastTxDuration, m_lastTxStart, MostRecent(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by GetBackoffStartFor(), and RequestAccess().
Return the time when the backoff procedure ended (or will ended) for the given Txop.
txop | the Txop |
Definition at line 462 of file channel-access-manager.cc.
References ns3::Time::As(), ns3::Txop::GetBackoffSlots(), GetBackoffStartFor(), GetSlot(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Time::US.
Referenced by DoGrantDcfAccess(), and DoRestartAccessTimeoutIfNeeded().
Return the time when the backoff procedure started for the given Txop.
txop | the Txop |
Definition at line 451 of file channel-access-manager.cc.
References ns3::Time::As(), GetAccessGrantStart(), ns3::Txop::GetAifsn(), ns3::Txop::GetBackoffStart(), GetSlot(), MostRecent(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Time::US.
Referenced by GetBackoffEndFor(), and UpdateBackoff().
|
privatevirtual |
Return the EIFS duration minus a DIFS.
Reimplemented in ChannelAccessManagerStub.
Definition at line 186 of file channel-access-manager.cc.
References ns3::WifiPhy::GetAckTxTime(), ns3::WifiPhy::GetSifs(), and m_phy.
Referenced by GetAccessGrantStart().
|
privatevirtual |
Return the Short Interframe Space (SIFS) for this PHY.
Reimplemented in ChannelAccessManagerStub.
Definition at line 180 of file channel-access-manager.cc.
References ns3::WifiPhy::GetSifs(), and m_phy.
Referenced by GetAccessGrantStart(), NeedBackoffUponAccess(), and NotifyTxStartNow().
|
privatevirtual |
Return the slot duration for this PHY.
Reimplemented in ChannelAccessManagerStub.
Definition at line 174 of file channel-access-manager.cc.
References ns3::WifiPhy::GetSlot(), and m_phy.
Referenced by GetBackoffEndFor(), GetBackoffStartFor(), NeedBackoffUponAccess(), RequestAccess(), and UpdateBackoff().
bool ns3::ChannelAccessManager::IsBusy | ( | void | ) | const |
Check if the device is busy sending or receiving, or NAV or CCA busy.
Definition at line 206 of file channel-access-manager.cc.
References m_lastBusyDuration, m_lastBusyStart, m_lastNavDuration, m_lastNavStart, m_lastRxDuration, m_lastRxStart, m_lastTxDuration, m_lastTxStart, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by NeedBackoffUponAccess().
Return the most recent time.
list | the initializer list including the times to compare |
Definition at line 199 of file channel-access-manager.cc.
References list, and NS_ASSERT.
Referenced by GetAccessGrantStart(), and GetBackoffStartFor().
Determine if a new backoff needs to be generated when a packet is queued for transmission.
txop | the Txop requesting to generate a backoff |
Definition at line 236 of file channel-access-manager.cc.
References ns3::Txop::GetAccessStatus(), ns3::Txop::GetAifsn(), ns3::Txop::GetBackoffSlots(), GetSifs(), GetSlot(), ns3::Txop::GRANTED, ns3::Txop::HasFramesToTransmit(), IsBusy(), ns3::Txop::IsQosTxop(), m_off, m_sleeping, ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::Seconds(), UpdateBackoff(), and ns3::Txop::UpdateBackoffSlotsNow().
void ns3::ChannelAccessManager::NotifyAckTimeoutResetNow | ( | void | ) |
Notify that ack timer has reset.
Definition at line 800 of file channel-access-manager.cc.
References DoRestartAccessTimeoutIfNeeded(), m_lastAckTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
void ns3::ChannelAccessManager::NotifyAckTimeoutStartNow | ( | Time | duration | ) |
Notify that ack timer has started for the given duration.
duration | the duration of the timer |
Definition at line 792 of file channel-access-manager.cc.
References m_lastAckTimeoutEnd, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::ChannelAccessManager::NotifyCtsTimeoutResetNow | ( | void | ) |
Notify that CTS timer has reset.
Definition at line 815 of file channel-access-manager.cc.
References DoRestartAccessTimeoutIfNeeded(), m_lastCtsTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
void ns3::ChannelAccessManager::NotifyCtsTimeoutStartNow | ( | Time | duration | ) |
Notify that CTS timer has started for the given duration.
duration | the duration of the timer |
Definition at line 808 of file channel-access-manager.cc.
References m_lastCtsTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
void ns3::ChannelAccessManager::NotifyMaybeCcaBusyStartNow | ( | Time | duration | ) |
duration | expected duration of CCA busy period |
Notify the Txop that a CCA busy period has just started.
Definition at line 616 of file channel-access-manager.cc.
References m_lastBusyDuration, m_lastBusyStart, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().
Referenced by ns3::PhyListener::NotifyMaybeCcaBusyStart().
void ns3::ChannelAccessManager::NotifyNavResetNow | ( | Time | duration | ) |
duration | the value of the received NAV. |
Called at end of RX
If the NAV reset indicates an end-of-NAV which is earlier than the previous end-of-NAV, the expected end of backoff might be later than previously thought so, we might need to restart a new access timeout.
Definition at line 759 of file channel-access-manager.cc.
References DoRestartAccessTimeoutIfNeeded(), m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().
void ns3::ChannelAccessManager::NotifyNavStartNow | ( | Time | duration | ) |
duration | the value of the received NAV. |
Called at end of RX
Definition at line 776 of file channel-access-manager.cc.
References m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().
void ns3::ChannelAccessManager::NotifyOffNow | ( | void | ) |
Notify the Txop that the device has been put in off mode.
Definition at line 703 of file channel-access-manager.cc.
References ns3::EventId::Cancel(), ns3::EventId::IsRunning(), m_accessTimeout, m_off, m_txops, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifyOff().
void ns3::ChannelAccessManager::NotifyOnNow | ( | void | ) |
Notify the Txop that the device has been resumed from off mode.
Definition at line 740 of file channel-access-manager.cc.
References m_off, m_txops, ns3::Txop::NOT_REQUESTED, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifyOn().
void ns3::ChannelAccessManager::NotifyRxEndErrorNow | ( | void | ) |
Notify the Txop that a packet reception was just completed unsuccessfully.
Definition at line 580 of file channel-access-manager.cc.
References m_lastBusyDuration, m_lastBusyStart, m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifyRxEndError().
void ns3::ChannelAccessManager::NotifyRxEndOkNow | ( | void | ) |
Notify the Txop that a packet reception was just completed successfully.
Definition at line 571 of file channel-access-manager.cc.
References m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifyRxEndOk().
void ns3::ChannelAccessManager::NotifyRxStartNow | ( | Time | duration | ) |
duration | expected duration of reception |
Notify the Txop that a packet reception started for the expected duration.
Definition at line 560 of file channel-access-manager.cc.
References m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().
Referenced by ns3::PhyListener::NotifyRxStart().
void ns3::ChannelAccessManager::NotifySleepNow | ( | void | ) |
Notify the Txop that the device has been put in sleep mode.
Definition at line 685 of file channel-access-manager.cc.
References ns3::EventId::Cancel(), ns3::EventId::IsRunning(), m_accessTimeout, m_sleeping, m_txops, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifySleep().
void ns3::ChannelAccessManager::NotifySwitchingStartNow | ( | Time | duration | ) |
duration | expected duration of channel switching period |
Notify the Txop that a channel switching period has just started. During switching state, new packets can be enqueued in Txop/QosTxop but they won't access to the medium until the end of the channel switching.
Definition at line 626 of file channel-access-manager.cc.
References ns3::EventId::Cancel(), ns3::EventId::IsRunning(), m_accessTimeout, m_feManager, m_lastAckTimeoutEnd, m_lastBusyDuration, m_lastBusyStart, m_lastCtsTimeoutEnd, m_lastNavDuration, m_lastNavStart, m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, m_lastSwitchingDuration, m_lastSwitchingStart, m_lastTxDuration, m_lastTxStart, m_txops, ns3::Txop::NOT_REQUESTED, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifySwitchingStart().
void ns3::ChannelAccessManager::NotifyTxStartNow | ( | Time | duration | ) |
duration | expected duration of transmission |
Notify the Txop that a packet transmission was just started and is expected to last for the specified duration.
Definition at line 596 of file channel-access-manager.cc.
References GetSifs(), m_lastRxDuration, m_lastRxReceivedOk, m_lastRxStart, m_lastTxDuration, m_lastTxStart, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().
Referenced by ns3::PhyListener::NotifyTxStart().
void ns3::ChannelAccessManager::NotifyWakeupNow | ( | void | ) |
Notify the Txop that the device has been resumed from sleep mode.
Definition at line 721 of file channel-access-manager.cc.
References m_sleeping, m_txops, ns3::Txop::NOT_REQUESTED, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::PhyListener::NotifyWakeup().
Remove current registered listener for PHY events.
phy | the WifiPhy to listen to |
Definition at line 153 of file channel-access-manager.cc.
References m_phy, m_phyListener, NS_LOG_FUNCTION, and third::phy.
txop | a Txop |
Notify the ChannelAccessManager that a specific Txop needs access to the medium. The ChannelAccessManager is then responsible for starting an access timer and, invoking FrameExchangeManager::StartTransmission when the access is granted if it ever gets granted.
Definition at line 293 of file channel-access-manager.cc.
References DoGrantDcfAccess(), DoRestartAccessTimeoutIfNeeded(), GetAccessGrantStart(), ns3::Txop::GetAccessStatus(), ns3::Txop::GetAifsn(), ns3::Txop::GetBackoffStart(), GetSlot(), ns3::Txop::IsQosTxop(), m_off, m_phy, m_sleeping, ns3::Txop::NotifyAccessRequested(), ns3::WifiPhy::NotifyChannelAccessRequested(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Txop::REQUESTED, UpdateBackoff(), and ns3::Txop::UpdateBackoffSlotsNow().
void ns3::ChannelAccessManager::SetupFrameExchangeManager | ( | Ptr< FrameExchangeManager > | feManager | ) |
Set up the Frame Exchange Manager.
feManager | the Frame Exchange Manager |
Definition at line 166 of file channel-access-manager.cc.
References m_feManager, and NS_LOG_FUNCTION.
Set up listener for PHY events.
phy | the WifiPhy to listen to |
Definition at line 143 of file channel-access-manager.cc.
References m_phy, m_phyListener, NS_ASSERT, NS_LOG_FUNCTION, and third::phy.
|
private |
Update backoff slots for all Txops.
Definition at line 472 of file channel-access-manager.cc.
References GetBackoffStartFor(), GetSlot(), bianchi11ax::k, m_txops, min, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by AccessTimeout(), DisableEdcaFor(), NeedBackoffUponAccess(), NotifyMaybeCcaBusyStartNow(), NotifyNavResetNow(), NotifyNavStartNow(), NotifyRxStartNow(), NotifyTxStartNow(), and RequestAccess().
|
private |
the access timeout ID
Definition at line 315 of file channel-access-manager.h.
Referenced by DoRestartAccessTimeoutIfNeeded(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().
|
private |
EIFS no DIFS time.
Definition at line 314 of file channel-access-manager.h.
|
private |
pointer to the Frame Exchange Manager
Definition at line 320 of file channel-access-manager.h.
Referenced by DoDispose(), DoGrantDcfAccess(), NotifySwitchingStartNow(), and SetupFrameExchangeManager().
|
private |
the last Ack timeout end time
Definition at line 299 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), NotifyAckTimeoutResetNow(), NotifyAckTimeoutStartNow(), and NotifySwitchingStartNow().
|
private |
the last busy duration time
Definition at line 309 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyMaybeCcaBusyStartNow(), NotifyRxEndErrorNow(), and NotifySwitchingStartNow().
|
private |
the last busy start time
Definition at line 308 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyMaybeCcaBusyStartNow(), NotifyRxEndErrorNow(), and NotifySwitchingStartNow().
|
private |
the last CTS timeout end time
Definition at line 300 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), NotifyCtsTimeoutResetNow(), NotifyCtsTimeoutStartNow(), and NotifySwitchingStartNow().
|
private |
the last NAV duration time
Definition at line 302 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyNavResetNow(), NotifyNavStartNow(), and NotifySwitchingStartNow().
|
private |
the last NAV start time
Definition at line 301 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyNavResetNow(), NotifyNavStartNow(), and NotifySwitchingStartNow().
|
private |
the last receive duration time
Definition at line 304 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyRxEndErrorNow(), NotifyRxEndOkNow(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().
|
private |
the last receive OK
Definition at line 305 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), NotifyRxEndErrorNow(), NotifyRxEndOkNow(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().
|
private |
the last receive start time
Definition at line 303 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifyRxEndErrorNow(), NotifyRxEndOkNow(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().
|
private |
the last switching duration time
Definition at line 311 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), and NotifySwitchingStartNow().
|
private |
the last switching start time
Definition at line 310 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), and NotifySwitchingStartNow().
|
private |
the last transmit duration time
Definition at line 307 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifySwitchingStartNow(), and NotifyTxStartNow().
|
private |
the last transmit start time
Definition at line 306 of file channel-access-manager.h.
Referenced by GetAccessGrantStart(), IsBusy(), NotifySwitchingStartNow(), and NotifyTxStartNow().
|
private |
flag whether it is in off state
Definition at line 313 of file channel-access-manager.h.
Referenced by NeedBackoffUponAccess(), NotifyOffNow(), NotifyOnNow(), and RequestAccess().
pointer to the PHY
Definition at line 319 of file channel-access-manager.h.
Referenced by DoDispose(), GetEifsNoDifs(), GetSifs(), GetSlot(), RemovePhyListener(), RequestAccess(), and SetupPhyListener().
|
private |
the PHY listener
Definition at line 318 of file channel-access-manager.h.
Referenced by ~ChannelAccessManager(), RemovePhyListener(), and SetupPhyListener().
|
private |
the SIFS time
Definition at line 317 of file channel-access-manager.h.
|
private |
flag whether it is in sleeping state
Definition at line 312 of file channel-access-manager.h.
Referenced by NeedBackoffUponAccess(), NotifySleepNow(), NotifyWakeupNow(), and RequestAccess().
|
private |
the slot time
Definition at line 316 of file channel-access-manager.h.
|
private |
the vector of managed Txops
Definition at line 298 of file channel-access-manager.h.
Referenced by Add(), DoDispose(), DoGrantDcfAccess(), DoRestartAccessTimeoutIfNeeded(), NotifyOffNow(), NotifyOnNow(), NotifySleepNow(), NotifySwitchingStartNow(), NotifyWakeupNow(), and UpdateBackoff().