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

This class uses a simple mechanism to assign channel access with following features: (1) only in the context of single-PHY device; (2) FCFS (First come First service) strategy, which seems against the description of the standard (preemptive strategy). More...

#include "default-channel-scheduler.h"

+ Inheritance diagram for ns3::DefaultChannelScheduler:
+ Collaboration diagram for ns3::DefaultChannelScheduler:

Public Member Functions

 DefaultChannelScheduler ()
 
virtual ~DefaultChannelScheduler ()
 
virtual enum ChannelAccess GetAssignedAccessType (uint32_t channelNumber) const
 
void NotifyCchSlotStart (Time duration)
 
void NotifyGuardSlotStart (Time duration, bool cchi)
 
void NotifySchSlotStart (Time duration)
 
virtual void SetWaveNetDevice (Ptr< WaveNetDevice > device)
 
- Public Member Functions inherited from ns3::ChannelScheduler
 ChannelScheduler ()
 
virtual ~ChannelScheduler ()
 
bool IsAlternatingAccessAssigned (uint32_t channelNumber) const
 
bool IsCchAccessAssigned (void) const
 
bool IsChannelAccessAssigned (uint32_t channelNumber) const
 
bool IsContinuousAccessAssigned (uint32_t channelNumber) const
 
bool IsDefaultCchAccessAssigned (void) const
 
bool IsExtendedAccessAssigned (uint32_t channelNumber) const
 
bool IsSchAccessAssigned (void) const
 
bool StartSch (const SchInfo &schInfo)
 
bool StopSch (uint32_t channelNumber)
 
- 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
 Implement the GetInstanceTypeId method defined in ObjectBase. 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 ()
 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. 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...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::ChannelScheduler
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

virtual bool AssignAlternatingAccess (uint32_t channelNumber, bool immediate)
 
virtual bool AssignContinuousAccess (uint32_t channelNumber, bool immediate)
 
virtual bool AssignDefaultCchAccess (void)
 This method will assign default CCH access for CCH. More...
 
virtual bool AssignExtendedAccess (uint32_t channelNumber, uint32_t extends, bool immediate)
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual bool ReleaseAccess (uint32_t channelNumber)
 
void SwitchToNextChannel (uint32_t curChannelNumber, uint32_t nextChannelNumber)
 

Private Attributes

enum ChannelAccess m_channelAccess
 
uint32_t m_channelNumber
 when m_channelAccess is ContinuousAccess, m_channelNumber is continuous channel number; when m_channelAccess is AlternatingAccess, m_channelNumber is SCH channel number, another alternating channel is CCH; when m_channelAccess is ExtendedAccess, m_channelNumber is extended access, extends is the number of extends access. More...
 
Ptr< ChannelCoordinationListenerm_coordinationListener
 
Ptr< ChannelCoordinatorm_coordinator
 
uint32_t m_extend
 
EventId m_extendEvent
 
Ptr< ChannelManagerm_manager
 
Ptr< WifiPhym_phy
 
uint32_t m_waitChannelNumber
 
EventId m_waitEvent
 
uint32_t m_waitExtend
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 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...
 
- 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...
 
- Protected Attributes inherited from ns3::ChannelScheduler
Ptr< WaveNetDevicem_device
 

Detailed Description

This class uses a simple mechanism to assign channel access with following features: (1) only in the context of single-PHY device; (2) FCFS (First come First service) strategy, which seems against the description of the standard (preemptive strategy).

Config Paths

ns3::DefaultChannelScheduler is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/ChannelScheduler/$ns3::DefaultChannelScheduler"

No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 144 bytes (on a 64-bit architecture).

Definition at line 32 of file default-channel-scheduler.h.

Constructor & Destructor Documentation

ns3::DefaultChannelScheduler::DefaultChannelScheduler ( )

Definition at line 65 of file default-channel-scheduler.cc.

References NS_LOG_FUNCTION.

ns3::DefaultChannelScheduler::~DefaultChannelScheduler ( )
virtual

Definition at line 75 of file default-channel-scheduler.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

bool ns3::DefaultChannelScheduler::AssignAlternatingAccess ( uint32_t  channelNumber,
bool  immediate 
)
privatevirtual
Parameters
channelNumberthe specific channel
immediateindicate whether channel switch to channel
Returns
whether the channel access is assigned successfully

This method will assign alternating access for SCHs and CCH.

Implements ns3::ChannelScheduler.

Definition at line 137 of file default-channel-scheduler.cc.

References ns3::AlternatingAccess, CCH, ns3::ContinuousAccess, ns3::ExtendedAccess, ns3::ChannelCoordinator::IsSchInterval(), m_channelAccess, m_channelNumber, m_coordinator, ns3::NoAccess, NS_ASSERT, NS_LOG_FUNCTION, and SwitchToNextChannel().

+ Here is the call graph for this function:

bool ns3::DefaultChannelScheduler::AssignContinuousAccess ( uint32_t  channelNumber,
bool  immediate 
)
privatevirtual
Parameters
channelNumberthe specific channel
immediateindicate whether channel switch to channel
Returns
whether the channel access is assigned successfully

This method will assign continuous SCH access CCH.

Implements ns3::ChannelScheduler.

Definition at line 174 of file default-channel-scheduler.cc.

References ns3::AlternatingAccess, ns3::EventId::Cancel(), ns3::ContinuousAccess, ns3::ExtendedAccess, ns3::EventId::IsExpired(), ns3::ChannelCoordinator::IsSchInterval(), m_channelAccess, m_channelNumber, m_coordinator, m_waitChannelNumber, m_waitEvent, ns3::ChannelCoordinator::NeedTimeToSchInterval(), ns3::NoAccess, NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SwitchToNextChannel().

+ Here is the call graph for this function:

bool ns3::DefaultChannelScheduler::AssignDefaultCchAccess ( void  )
privatevirtual
bool ns3::DefaultChannelScheduler::AssignExtendedAccess ( uint32_t  channelNumber,
uint32_t  extends,
bool  immediate 
)
privatevirtual
void ns3::DefaultChannelScheduler::DoDispose ( void  )
privatevirtual

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 88 of file default-channel-scheduler.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), ns3::EventId::IsExpired(), m_coordinationListener, m_coordinator, m_extendEvent, m_waitEvent, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::DefaultChannelScheduler::DoInitialize ( void  )
privatevirtual

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::ChannelScheduler.

Definition at line 81 of file default-channel-scheduler.cc.

References ns3::ChannelScheduler::DoInitialize(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

enum ChannelAccess ns3::DefaultChannelScheduler::GetAssignedAccessType ( uint32_t  channelNumber) const
virtual
Parameters
channelNumberthe specified channel number
Returns
the type of current assigned channel access for the specific channel.

Implements ns3::ChannelScheduler.

Definition at line 125 of file default-channel-scheduler.cc.

References ns3::AlternatingAccess, CCH, m_channelAccess, m_channelNumber, ns3::NoAccess, and NS_LOG_FUNCTION.

TypeId ns3::DefaultChannelScheduler::GetTypeId ( void  )
static

Definition at line 55 of file default-channel-scheduler.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::DefaultChannelScheduler::NotifyCchSlotStart ( Time  duration)

Definition at line 402 of file default-channel-scheduler.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::CoordinationListener::NotifyCchSlotStart().

+ Here is the caller graph for this function:

void ns3::DefaultChannelScheduler::NotifyGuardSlotStart ( Time  duration,
bool  cchi 
)
void ns3::DefaultChannelScheduler::NotifySchSlotStart ( Time  duration)

Definition at line 408 of file default-channel-scheduler.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::CoordinationListener::NotifySchSlotStart().

+ Here is the caller graph for this function:

bool ns3::DefaultChannelScheduler::ReleaseAccess ( uint32_t  channelNumber)
privatevirtual
Parameters
channelNumberindicating for which channel should release the assigned channel access resource.

Implements ns3::ChannelScheduler.

Definition at line 375 of file default-channel-scheduler.cc.

References ns3::EventId::Cancel(), CCH, ns3::DefaultCchAccess, EXTENDED_CONTINUOUS, ns3::EventId::IsExpired(), m_channelAccess, m_channelNumber, m_extend, m_extendEvent, m_waitChannelNumber, m_waitEvent, m_waitExtend, NS_ASSERT, NS_LOG_FUNCTION, and SwitchToNextChannel().

Referenced by AssignExtendedAccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::DefaultChannelScheduler::SetWaveNetDevice ( Ptr< WaveNetDevice device)
virtual
void ns3::DefaultChannelScheduler::SwitchToNextChannel ( uint32_t  curChannelNumber,
uint32_t  nextChannelNumber 
)
private

Member Data Documentation

uint32_t ns3::DefaultChannelScheduler::m_channelNumber
private

when m_channelAccess is ContinuousAccess, m_channelNumber is continuous channel number; when m_channelAccess is AlternatingAccess, m_channelNumber is SCH channel number, another alternating channel is CCH; when m_channelAccess is ExtendedAccess, m_channelNumber is extended access, extends is the number of extends access.

when m_channelAccess is DefaultCchAccess, m_channelNumber is CCH.

Definition at line 107 of file default-channel-scheduler.h.

Referenced by AssignAlternatingAccess(), AssignContinuousAccess(), AssignDefaultCchAccess(), AssignExtendedAccess(), GetAssignedAccessType(), NotifyGuardSlotStart(), and ReleaseAccess().

Ptr<ChannelCoordinationListener> ns3::DefaultChannelScheduler::m_coordinationListener
private

Definition at line 116 of file default-channel-scheduler.h.

Referenced by DoDispose(), and SetWaveNetDevice().

Ptr<ChannelCoordinator> ns3::DefaultChannelScheduler::m_coordinator
private
uint32_t ns3::DefaultChannelScheduler::m_extend
private
EventId ns3::DefaultChannelScheduler::m_extendEvent
private

Definition at line 109 of file default-channel-scheduler.h.

Referenced by AssignExtendedAccess(), DoDispose(), and ReleaseAccess().

Ptr<ChannelManager> ns3::DefaultChannelScheduler::m_manager
private

Definition at line 94 of file default-channel-scheduler.h.

Ptr<WifiPhy> ns3::DefaultChannelScheduler::m_phy
private
uint32_t ns3::DefaultChannelScheduler::m_waitChannelNumber
private
EventId ns3::DefaultChannelScheduler::m_waitEvent
private
uint32_t ns3::DefaultChannelScheduler::m_waitExtend
private

Definition at line 114 of file default-channel-scheduler.h.

Referenced by AssignExtendedAccess(), and ReleaseAccess().


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