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)
 Notify CCH slot start. More...
 
void NotifyGuardSlotStart (Time duration, bool cchi)
 Notify guard slot start. More...
 
void NotifySchSlotStart (Time duration)
 Notify SCH slot start. More...
 
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
 Get the most derived TypeId for this Object. More...
 
template<>
Ptr< ObjectGetObject () 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< ObjectGetObject (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...
 
SimpleRefCountoperator= ([[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...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ChannelScheduler
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- 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...
 

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
 channel access More...
 
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
 coordination listener More...
 
Ptr< ChannelCoordinatorm_coordinator
 channel coordinator More...
 
uint32_t m_extend
 extend More...
 
EventId m_extendEvent
 extend event More...
 
Ptr< ChannelManagerm_manager
 channel manager More...
 
Ptr< WifiPhym_phy
 Phy. More...
 
uint32_t m_waitChannelNumber
 wait channel number More...
 
EventId m_waitEvent
 wait event More...
 
uint32_t m_waitExtend
 wait extend More...
 

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
 the device More...
 

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

◆ DefaultChannelScheduler()

ns3::DefaultChannelScheduler::DefaultChannelScheduler ( )

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

References NS_LOG_FUNCTION.

◆ ~DefaultChannelScheduler()

ns3::DefaultChannelScheduler::~DefaultChannelScheduler ( )
virtual

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignAlternatingAccess()

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 148 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:

◆ AssignContinuousAccess()

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 185 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:

◆ AssignDefaultCchAccess()

bool ns3::DefaultChannelScheduler::AssignDefaultCchAccess ( void  )
privatevirtual

◆ AssignExtendedAccess()

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

◆ DoDispose()

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

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

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

+ Here is the call graph for this function:

◆ DoInitialize()

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

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

+ Here is the call graph for this function:

◆ GetAssignedAccessType()

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

References ns3::WaveNetDevice::GetChannelCoordinator(), ns3::WaveNetDevice::GetPhy(), ns3::WaveNetDevice::GetPhys(), m_coordinationListener, m_coordinator, m_phy, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::ChannelCoordinator::RegisterListener(), and ns3::ChannelScheduler::SetWaveNetDevice().

+ Here is the call graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

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

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ NotifyCchSlotStart()

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

Notify CCH slot start.

Parameters
durationthe CCH slot duration

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ NotifyGuardSlotStart()

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

Notify guard slot start.

Parameters
durationthe CCH slot duration
cchiif true, switch to next channel

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

References ns3::AlternatingAccess, CCH, ns3::WaveNetDevice::GetMac(), m_channelAccess, m_channelNumber, ns3::ChannelScheduler::m_device, third::mac, NS_LOG_FUNCTION, and SwitchToNextChannel().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifySchSlotStart()

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

Notify SCH slot start.

Parameters
durationthe SCH slot duration

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

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ ReleaseAccess()

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

Implements ns3::ChannelScheduler.

Definition at line 386 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:

◆ SetWaveNetDevice()

void ns3::DefaultChannelScheduler::SetWaveNetDevice ( Ptr< WaveNetDevice device)
virtual
Parameters
deviceenable channel scheduler associated with WaveNetDevice

Reimplemented from ns3::ChannelScheduler.

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

◆ SwitchToNextChannel()

void ns3::DefaultChannelScheduler::SwitchToNextChannel ( uint32_t  curChannelNumber,
uint32_t  nextChannelNumber 
)
private

Member Data Documentation

◆ m_channelAccess

enum ChannelAccess ns3::DefaultChannelScheduler::m_channelAccess
private

◆ m_channelNumber

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. channel number

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

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

◆ m_coordinationListener

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

coordination listener

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

Referenced by DoDispose(), and GetAssignedAccessType().

◆ m_coordinator

Ptr<ChannelCoordinator> ns3::DefaultChannelScheduler::m_coordinator
private

◆ m_extend

uint32_t ns3::DefaultChannelScheduler::m_extend
private

extend

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

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

◆ m_extendEvent

EventId ns3::DefaultChannelScheduler::m_extendEvent
private

extend event

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

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

◆ m_manager

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

channel manager

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

◆ m_phy

Ptr<WifiPhy> ns3::DefaultChannelScheduler::m_phy
private

◆ m_waitChannelNumber

uint32_t ns3::DefaultChannelScheduler::m_waitChannelNumber
private

wait channel number

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

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

◆ m_waitEvent

EventId ns3::DefaultChannelScheduler::m_waitEvent
private

wait event

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

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

◆ m_waitExtend

uint32_t ns3::DefaultChannelScheduler::m_waitExtend
private

wait extend

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

Referenced by AssignExtendedAccess(), and ReleaseAccess().


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