A Discrete-Event Network Simulator
API
ns3::DcfManager Class Reference

Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a single DCF within a MAC stack. More...

#include "dcf-manager.h"

+ Inheritance diagram for ns3::DcfManager:
+ Collaboration diagram for ns3::DcfManager:

Public Member Functions

 DcfManager ()
 
virtual ~DcfManager ()
 
void Add (Ptr< DcfState > dcf)
 
Time GetEifsNoDifs () const
 
void NotifyAckTimeoutResetNow ()
 Notify that ACK timer has resetted. More...
 
void NotifyAckTimeoutStartNow (Time duration)
 Notify that ACK timer has started for the given duration. More...
 
void NotifyCtsTimeoutResetNow ()
 Notify that CTS timer has resetted. 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 NotifyRxEndErrorNow (void)
 Notify the DCF that a packet reception was just completed unsuccessfully. More...
 
void NotifyRxEndOkNow (void)
 Notify the DCF that a packet reception was just completed successfully. More...
 
void NotifyRxStartNow (Time duration)
 
void NotifySleepNow (void)
 Notify the DCF that the device has been put in sleep mode. More...
 
void NotifySwitchingStartNow (Time duration)
 
void NotifyTxStartNow (Time duration)
 
void NotifyWakeupNow (void)
 Notify the DCF 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< DcfState > state)
 
void SetEifsNoDifs (Time eifsNoDifs)
 
void SetSifs (Time sifs)
 
void SetSlot (Time slotTime)
 
void SetupLow (Ptr< MacLow > low)
 Set up listener for MacLow events. 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<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (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)
 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< DcfState > > States
 typedef for a vector of DcfStates More...
 

Private Member Functions

void AccessTimeout (void)
 Called when access timeout should occur (e.g. More...
 
void DoGrantAccess (void)
 Grant access to DCF. More...
 
void DoRestartAccessTimeoutIfNeeded (void)
 
Time GetAccessGrantStart (void) const
 Access will never be granted to the medium before the time returned by this method. More...
 
Time GetBackoffEndFor (Ptr< DcfState > state)
 Return the time when the backoff procedure ended (or will ended) for the given DcfState. More...
 
Time GetBackoffStartFor (Ptr< DcfState > state)
 Return the time when the backoff procedure started for the given DcfState. More...
 
bool IsBusy (void) const
 Check if the device is busy sending or receiving, or NAV or CCA busy. More...
 
bool IsWithinAifs (Ptr< DcfState > state) const
 Check if the device is between frames (in DIFS or AIFS interval) More...
 
Time MostRecent (Time a, Time b) const
 Return the most recent time. More...
 
Time MostRecent (Time a, Time b, Time c) const
 Return the most recent time. More...
 
Time MostRecent (Time a, Time b, Time c, Time d) const
 Return the most recent time. More...
 
Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const
 Return the most recent time. More...
 
Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f, Time g) const
 Return the most recent time. More...
 
void UpdateBackoff (void)
 Update backoff slots for all DcfStates. More...
 

Private Attributes

EventId m_accessTimeout
 the access timeout ID More...
 
Time m_eifsNoDifs
 EIFS no DIFS time. 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...
 
Time m_lastRxEnd
 the last receive end 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...
 
PhyListenerm_phyListener
 the phy listener More...
 
bool m_rxing
 flag whether it is in receiving state More...
 
Time m_sifs
 the SIFS time More...
 
bool m_sleeping
 flag whether it is in sleeping state More...
 
uint32_t m_slotTimeUs
 the slot time in microseconds More...
 
States m_states
 the DCF states 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...
 

Detailed Description

Manage a set of ns3::DcfState

Handle a set of independent ns3::DcfState, each of which represents a single DCF within a MAC stack.

Each ns3::DcfState has a priority implicitely associated with it (the priority is determined when the ns3::DcfState is added to the DcfManager: the first DcfState 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 DcfState are expected to get access to the medium at the same time, the highest priority local DcfState wins access to the medium and the other DcfState suffers a "internal" collision.

Definition at line 51 of file dcf-manager.h.

Member Typedef Documentation

typedef std::vector<Ptr<DcfState> > ns3::DcfManager::States
private

typedef for a vector of DcfStates

Definition at line 328 of file dcf-manager.h.

Constructor & Destructor Documentation

ns3::DcfManager::DcfManager ( )

Definition at line 89 of file dcf-manager.cc.

References NS_LOG_FUNCTION.

ns3::DcfManager::~DcfManager ( )
virtual

Definition at line 113 of file dcf-manager.cc.

References m_phyListener.

Member Function Documentation

void ns3::DcfManager::AccessTimeout ( void  )
private

Called when access timeout should occur (e.g.

backoff procedure expired).

Definition at line 395 of file dcf-manager.cc.

References DoGrantAccess(), DoRestartAccessTimeoutIfNeeded(), NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by DoRestartAccessTimeoutIfNeeded().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::Add ( Ptr< DcfState dcf)
Parameters
dcfa new DcfState.

The DcfManager does not take ownership of this pointer so, the callee must make sure that the DcfState pointer will stay valid as long as the DcfManager is valid. Note that the order in which DcfState objects are added to a DcfManager matters: the first DcfState added has the highest priority, the second DcfState added, has the second highest priority, etc.

Definition at line 190 of file dcf-manager.cc.

References m_states, and NS_LOG_FUNCTION.

Referenced by DcfManagerTest::AddDcfState(), and ns3::DcaTxop::SetManager().

+ Here is the caller graph for this function:

void ns3::DcfManager::DoDispose ( void  )
protectedvirtual

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 overriden 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 120 of file dcf-manager.cc.

References m_states, and NS_LOG_FUNCTION.

void ns3::DcfManager::DoGrantAccess ( void  )
private

Grant access to DCF.

This is the first dcf we find with an expired backoff and which needs access to the medium. i.e., it has data to send.

all other dcfs 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. It is necessary to perform first the calculations of which states 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 340 of file dcf-manager.cc.

References GetBackoffEndFor(), ns3::DcfState::GetBackoffSlots(), ns3::DcfState::IsAccessRequested(), m_states, ns3::DcfState::NotifyAccessGranted(), ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by AccessTimeout(), and RequestAccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::DoRestartAccessTimeoutIfNeeded ( void  )
private

Is there a DcfState which needs to access the medium, and, if there is one, how many slots for AIFS+backoff does it require ?

Definition at line 500 of file dcf-manager.cc.

References AccessTimeout(), ns3::EventId::Cancel(), GetBackoffEndFor(), ns3::Simulator::GetDelayLeft(), ns3::Simulator::GetMaximumSimulationTime(), ns3::DcfState::IsAccessRequested(), ns3::EventId::IsExpired(), ns3::EventId::IsRunning(), m_accessTimeout, m_states, min, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

Referenced by AccessTimeout(), NotifyAckTimeoutResetNow(), NotifyCtsTimeoutResetNow(), NotifyNavResetNow(), and RequestAccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::GetAccessGrantStart ( void  ) const
private

Access will never be granted to the medium before the time returned by this method.

Returns
the absolute time at which access could start to be granted

Definition at line 404 of file dcf-manager.cc.

References m_eifsNoDifs, m_lastAckTimeoutEnd, m_lastBusyDuration, m_lastBusyStart, m_lastCtsTimeoutEnd, m_lastNavDuration, m_lastNavStart, m_lastRxDuration, m_lastRxEnd, m_lastRxReceivedOk, m_lastRxStart, m_lastSwitchingDuration, m_lastSwitchingStart, m_lastTxDuration, m_lastTxStart, m_rxing, m_sifs, MostRecent(), NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by GetBackoffStartFor(), and IsWithinAifs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::GetBackoffEndFor ( Ptr< DcfState state)
private

Return the time when the backoff procedure ended (or will ended) for the given DcfState.

Parameters
state
Returns
the time when the backoff procedure ended (or will ended)

Definition at line 453 of file dcf-manager.cc.

References ns3::Time::As(), ns3::DcfState::GetBackoffSlots(), GetBackoffStartFor(), m_slotTimeUs, ns3::MicroSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Time::US.

Referenced by DoGrantAccess(), and DoRestartAccessTimeoutIfNeeded().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::GetBackoffStartFor ( Ptr< DcfState state)
private

Return the time when the backoff procedure started for the given DcfState.

Parameters
state
Returns
the time when the backoff procedure started

Definition at line 443 of file dcf-manager.cc.

References GetAccessGrantStart(), ns3::DcfState::GetAifsn(), ns3::DcfState::GetBackoffStart(), m_slotTimeUs, ns3::MicroSeconds(), MostRecent(), and NS_LOG_FUNCTION.

Referenced by GetBackoffEndFor(), and UpdateBackoff().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::GetEifsNoDifs ( ) const
Returns
value set previously using SetEifsNoDifs.

Definition at line 183 of file dcf-manager.cc.

References m_eifsNoDifs, and NS_LOG_FUNCTION.

Referenced by ns3::RegularWifiMac::GetEifsNoDifs().

+ Here is the caller graph for this function:

bool ns3::DcfManager::IsBusy ( void  ) const
private

Check if the device is busy sending or receiving, or NAV or CCA busy.

Returns
true if the device is busy, false otherwise

Definition at line 249 of file dcf-manager.cc.

References m_lastBusyDuration, m_lastBusyStart, m_lastNavDuration, m_lastNavStart, m_lastTxDuration, m_lastTxStart, m_rxing, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by RequestAccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::DcfManager::IsWithinAifs ( Ptr< DcfState state) const
private

Check if the device is between frames (in DIFS or AIFS interval)

Parameters
statethe state to check
Returns
true if the device is within AIFS, false otherwise

Definition at line 278 of file dcf-manager.cc.

References GetAccessGrantStart(), ns3::DcfState::GetAifsn(), ns3::Time::GetSeconds(), m_slotTimeUs, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by RequestAccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::MostRecent ( Time  a,
Time  b 
) const
private

Return the most recent time.

Parameters
a
b
Returns
the most recent time

Definition at line 197 of file dcf-manager.cc.

References ns3::Max(), and NS_LOG_FUNCTION.

Referenced by GetAccessGrantStart(), and GetBackoffStartFor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::DcfManager::MostRecent ( Time  a,
Time  b,
Time  c 
) const
private

Return the most recent time.

Parameters
a
b
c
Returns
the most recent time

Definition at line 204 of file dcf-manager.cc.

References ns3::Max(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Time ns3::DcfManager::MostRecent ( Time  a,
Time  b,
Time  c,
Time  d 
) const
private

Return the most recent time.

Parameters
a
b
c
d
Returns
the most recent time

Definition at line 214 of file dcf-manager.cc.

References f(), ns3::Max(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Time ns3::DcfManager::MostRecent ( Time  a,
Time  b,
Time  c,
Time  d,
Time  e,
Time  f 
) const
private

Return the most recent time.

Parameters
a
b
c
d
e
f
Returns
the most recent time

Definition at line 224 of file dcf-manager.cc.

References ns3::Max(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Time ns3::DcfManager::MostRecent ( Time  a,
Time  b,
Time  c,
Time  d,
Time  e,
Time  f,
Time  g 
) const
private

Return the most recent time.

Parameters
a
b
c
d
e
f
g
Returns
the most recent time

Definition at line 236 of file dcf-manager.cc.

References ns3::Max(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::DcfManager::NotifyAckTimeoutResetNow ( )

Notify that ACK timer has resetted.

Definition at line 742 of file dcf-manager.cc.

References DoRestartAccessTimeoutIfNeeded(), m_lastAckTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::DcfManager::NotifyAckTimeoutStartNow ( Time  duration)

Notify that ACK timer has started for the given duration.

Parameters
duration

Definition at line 734 of file dcf-manager.cc.

References m_lastAckTimeoutEnd, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by DcfManagerTest::NotifyAccessGranted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyCtsTimeoutResetNow ( )

Notify that CTS timer has resetted.

Definition at line 757 of file dcf-manager.cc.

References DoRestartAccessTimeoutIfNeeded(), m_lastCtsTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::DcfManager::NotifyCtsTimeoutStartNow ( Time  duration)

Notify that CTS timer has started for the given duration.

Parameters
duration

Definition at line 750 of file dcf-manager.cc.

References m_lastCtsTimeoutEnd, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::DcfManager::NotifyMaybeCcaBusyStartNow ( Time  duration)
Parameters
durationexpected duration of cca busy period

Notify the DCF that a CCA busy period has just started.

Definition at line 592 of file dcf-manager.cc.

References m_lastBusyDuration, m_lastBusyStart, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by ns3::OcbWifiMac::MakeVirtualBusy(), and ns3::PhyListener::NotifyMaybeCcaBusyStart().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyNavResetNow ( Time  duration)
Parameters
durationthe 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 701 of file dcf-manager.cc.

References DoRestartAccessTimeoutIfNeeded(), m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyNavStartNow ( Time  duration)
Parameters
durationthe value of the received NAV.

Called at end of rx

Definition at line 718 of file dcf-manager.cc.

References m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

+ Here is the call graph for this function:

void ns3::DcfManager::NotifyRxEndErrorNow ( void  )

Notify the DCF that a packet reception was just completed unsuccessfully.

Definition at line 562 of file dcf-manager.cc.

References m_lastRxEnd, m_lastRxReceivedOk, m_rxing, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::PhyListener::NotifyRxEndError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyRxEndOkNow ( void  )

Notify the DCF that a packet reception was just completed successfully.

Definition at line 552 of file dcf-manager.cc.

References m_lastRxEnd, m_lastRxReceivedOk, m_rxing, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::PhyListener::NotifyRxEndOk().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyRxStartNow ( Time  duration)
Parameters
durationexpected duration of reception

Notify the DCF that a packet reception started for the expected duration.

Definition at line 541 of file dcf-manager.cc.

References m_lastRxDuration, m_lastRxStart, m_rxing, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by ns3::PhyListener::NotifyRxStart().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifySleepNow ( void  )

Notify the DCF that the device has been put in sleep mode.

Definition at line 662 of file dcf-manager.cc.

References ns3::EventId::Cancel(), ns3::EventId::IsRunning(), m_accessTimeout, m_sleeping, m_states, ns3::DcfState::NotifySleep(), and NS_LOG_FUNCTION.

Referenced by ns3::PhyListener::NotifySleep(), and ns3::OcbWifiMac::Suspend().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifySwitchingStartNow ( Time  duration)
Parameters
durationexpected duration of channel switching period

Notify the DCF that a channel switching period has just started. During switching state, new packets can be enqueued in DcaTxop/EdcaTxop but they won't access to the medium until the end of the channel switching.

Definition at line 602 of file dcf-manager.cc.

References ns3::EventId::Cancel(), ns3::DcfState::GetBackoffSlots(), ns3::EventId::IsRunning(), ns3::DcfState::m_accessRequested, m_accessTimeout, m_lastAckTimeoutEnd, m_lastBusyDuration, m_lastBusyStart, m_lastCtsTimeoutEnd, m_lastNavDuration, m_lastNavStart, m_lastRxDuration, m_lastRxEnd, m_lastRxReceivedOk, m_lastRxStart, m_lastSwitchingDuration, m_lastSwitchingStart, m_lastTxDuration, m_lastTxStart, m_rxing, m_states, ns3::DcfState::NotifyChannelSwitching(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), and ns3::DcfState::UpdateBackoffSlotsNow().

Referenced by ns3::PhyListener::NotifySwitchingStart(), and ns3::OcbWifiMac::Reset().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyTxStartNow ( Time  duration)
Parameters
durationexpected duration of transmission

Notify the DCF that a packet transmission was just started and is expected to last for the specified duration.

Definition at line 572 of file dcf-manager.cc.

References m_lastRxDuration, m_lastRxEnd, m_lastRxReceivedOk, m_lastRxStart, m_lastTxDuration, m_lastTxStart, m_rxing, m_sifs, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by DcfManagerTest::NotifyAccessGranted(), and ns3::PhyListener::NotifyTxStart().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::NotifyWakeupNow ( void  )

Notify the DCF that the device has been resumed from sleep mode.

Definition at line 681 of file dcf-manager.cc.

References ns3::DcfState::GetBackoffSlots(), ns3::DcfState::m_accessRequested, m_sleeping, m_states, ns3::DcfState::NotifyWakeUp(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), and ns3::DcfState::UpdateBackoffSlotsNow().

Referenced by ns3::PhyListener::NotifyWakeup(), and ns3::OcbWifiMac::Resume().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::RemovePhyListener ( Ptr< WifiPhy phy)

Remove current registered listener for Phy events.

Parameters
phy

Definition at line 143 of file dcf-manager.cc.

References m_phyListener, NS_LOG_FUNCTION, and ns3::WifiPhy::UnregisterListener().

Referenced by ns3::RegularWifiMac::ResetWifiPhy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::RequestAccess ( Ptr< DcfState state)
Parameters
statea DcfState

Notify the DcfManager that a specific DcfState needs access to the medium. The DcfManager is then responsible for starting an access timer and, invoking DcfState::DoNotifyAccessGranted when the access is granted if it ever gets granted.

If there is a collision, generate a backoff by notifying the collision to the user.

Definition at line 292 of file dcf-manager.cc.

References DoGrantAccess(), DoRestartAccessTimeoutIfNeeded(), ns3::DcfState::GetBackoffSlots(), ns3::DcfState::IsAccessRequested(), IsBusy(), IsWithinAifs(), m_lastTxDuration, m_lastTxStart, m_sleeping, ns3::DcfState::NotifyAccessRequested(), ns3::DcfState::NotifyCollision(), ns3::DcfState::NotifyInternalCollision(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and UpdateBackoff().

Referenced by DcfManagerTest::DoAccessRequest(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::DcaTxop::RestartAccessIfNeeded(), ns3::EdcaTxopN::StartAccessIfNeeded(), and ns3::DcaTxop::StartAccessIfNeeded().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::SetEifsNoDifs ( Time  eifsNoDifs)
Parameters
eifsNoDifsthe duration of a EIFS minus the duration of DIFS.

It is a bad idea to call this method after RequestAccess or one of the Notify methods has been invoked.

Definition at line 176 of file dcf-manager.cc.

References m_eifsNoDifs, and NS_LOG_FUNCTION.

Referenced by ns3::RegularWifiMac::SetEifsNoDifs(), and DcfManagerTest::StartTest().

+ Here is the caller graph for this function:

void ns3::DcfManager::SetSifs ( Time  sifs)
Parameters
sifsthe duration of a SIFS.

It is a bad idea to call this method after RequestAccess or one of the Notify methods has been invoked.

Definition at line 169 of file dcf-manager.cc.

References m_sifs, and NS_LOG_FUNCTION.

Referenced by ns3::RegularWifiMac::SetSifs(), and DcfManagerTest::StartTest().

+ Here is the caller graph for this function:

void ns3::DcfManager::SetSlot ( Time  slotTime)
Parameters
slotTimethe duration of a slot.

It is a bad idea to call this method after RequestAccess or one of the Notify methods has been invoked.

Definition at line 162 of file dcf-manager.cc.

References ns3::Time::GetMicroSeconds(), m_slotTimeUs, and NS_LOG_FUNCTION.

Referenced by AmpduAggregationTest::DoRun(), ns3::RegularWifiMac::SetSlot(), and DcfManagerTest::StartTest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::SetupLow ( Ptr< MacLow low)

Set up listener for MacLow events.

Parameters
low

Definition at line 155 of file dcf-manager.cc.

References NS_LOG_FUNCTION, and ns3::MacLow::RegisterDcf().

Referenced by AmpduAggregationTest::DoRun(), ns3::OcbWifiMac::EnableForWave(), and ns3::RegularWifiMac::RegularWifiMac().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::SetupPhyListener ( Ptr< WifiPhy phy)

Set up listener for Phy events.

Parameters
phy

Definition at line 131 of file dcf-manager.cc.

References m_phyListener, NS_LOG_FUNCTION, and ns3::WifiPhy::RegisterListener().

Referenced by AmpduAggregationTest::DoRun(), and ns3::RegularWifiMac::SetWifiPhy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DcfManager::UpdateBackoff ( void  )
private

Member Data Documentation

EventId ns3::DcfManager::m_accessTimeout
private

the access timeout ID

Definition at line 348 of file dcf-manager.h.

Referenced by DoRestartAccessTimeoutIfNeeded(), NotifySleepNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_eifsNoDifs
private

EIFS no DIFS time.

Definition at line 347 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), GetEifsNoDifs(), and SetEifsNoDifs().

Time ns3::DcfManager::m_lastAckTimeoutEnd
private

the last ACK timeout end time

Definition at line 331 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyAckTimeoutResetNow(), NotifyAckTimeoutStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastBusyDuration
private

the last busy duration time

Definition at line 342 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifyMaybeCcaBusyStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastBusyStart
private

the last busy start time

Definition at line 341 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifyMaybeCcaBusyStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastCtsTimeoutEnd
private

the last CTS timeout end time

Definition at line 332 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyCtsTimeoutResetNow(), NotifyCtsTimeoutStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastNavDuration
private

the last NAV duration time

Definition at line 334 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifyNavResetNow(), NotifyNavStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastNavStart
private

the last NAV start time

Definition at line 333 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifyNavResetNow(), NotifyNavStartNow(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastRxDuration
private

the last receive duration time

Definition at line 336 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().

Time ns3::DcfManager::m_lastRxEnd
private

the last receive end time

Definition at line 338 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyRxEndErrorNow(), NotifyRxEndOkNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().

bool ns3::DcfManager::m_lastRxReceivedOk
private
Time ns3::DcfManager::m_lastRxStart
private

the last receive start time

Definition at line 335 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().

Time ns3::DcfManager::m_lastSwitchingDuration
private

the last switching duration time

Definition at line 344 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastSwitchingStart
private

the last switching start time

Definition at line 343 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), and NotifySwitchingStartNow().

Time ns3::DcfManager::m_lastTxDuration
private

the last transmit duration time

Definition at line 340 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifySwitchingStartNow(), NotifyTxStartNow(), and RequestAccess().

Time ns3::DcfManager::m_lastTxStart
private

the last transmit start time

Definition at line 339 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifySwitchingStartNow(), NotifyTxStartNow(), and RequestAccess().

PhyListener* ns3::DcfManager::m_phyListener
private

the phy listener

Definition at line 351 of file dcf-manager.h.

Referenced by RemovePhyListener(), SetupPhyListener(), and ~DcfManager().

bool ns3::DcfManager::m_rxing
private

flag whether it is in receiving state

Definition at line 345 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), IsBusy(), NotifyRxEndErrorNow(), NotifyRxEndOkNow(), NotifyRxStartNow(), NotifySwitchingStartNow(), and NotifyTxStartNow().

Time ns3::DcfManager::m_sifs
private

the SIFS time

Definition at line 350 of file dcf-manager.h.

Referenced by GetAccessGrantStart(), NotifyTxStartNow(), and SetSifs().

bool ns3::DcfManager::m_sleeping
private

flag whether it is in sleeping state

Definition at line 346 of file dcf-manager.h.

Referenced by NotifySleepNow(), NotifyWakeupNow(), and RequestAccess().

uint32_t ns3::DcfManager::m_slotTimeUs
private

the slot time in microseconds

Definition at line 349 of file dcf-manager.h.

Referenced by GetBackoffEndFor(), GetBackoffStartFor(), IsWithinAifs(), SetSlot(), and UpdateBackoff().

States ns3::DcfManager::m_states
private

The documentation for this class was generated from the following files: