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 ()
 
 ~DefaultChannelScheduler () override
 
ChannelAccess GetAssignedAccessType (uint32_t channelNumber) const override
 
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...
 
void SetWaveNetDevice (Ptr< WaveNetDevice > device) override
 
- Public Member Functions inherited from ns3::ChannelScheduler
 ChannelScheduler ()
 
 ~ChannelScheduler () override
 
bool IsAlternatingAccessAssigned (uint32_t channelNumber) const
 
bool IsCchAccessAssigned () const
 
bool IsChannelAccessAssigned (uint32_t channelNumber) const
 
bool IsContinuousAccessAssigned (uint32_t channelNumber) const
 
bool IsDefaultCchAccessAssigned () const
 
bool IsExtendedAccessAssigned (uint32_t channelNumber) const
 
bool IsSchAccessAssigned () const
 
bool StartSch (const SchInfo &schInfo)
 
bool StopSch (uint32_t channelNumber)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated 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...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () 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 () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () 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 errors. 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 ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ChannelScheduler
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Member Functions

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

Private Attributes

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 ()
 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 ()
 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 33 of file default-channel-scheduler.h.

Constructor & Destructor Documentation

◆ DefaultChannelScheduler()

ns3::DefaultChannelScheduler::DefaultChannelScheduler ( )

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

References NS_LOG_FUNCTION.

◆ ~DefaultChannelScheduler()

ns3::DefaultChannelScheduler::~DefaultChannelScheduler ( )
override

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignAlternatingAccess()

bool ns3::DefaultChannelScheduler::AssignAlternatingAccess ( uint32_t  channelNumber,
bool  immediate 
)
overrideprivatevirtual
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 150 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 
)
overrideprivatevirtual
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 187 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 ( )
overrideprivatevirtual

◆ AssignExtendedAccess()

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

◆ DoDispose()

void ns3::DefaultChannelScheduler::DoDispose ( )
overrideprivatevirtual

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 100 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 ( )
overrideprivatevirtual

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 93 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
overridevirtual
Parameters
channelNumberthe specified channel number
Returns
the type of current assigned channel access for the specific channel.

Implements ns3::ChannelScheduler.

Definition at line 121 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 ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 67 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 432 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 444 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 438 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)
overrideprivatevirtual
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 405 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)
overridevirtual
Parameters
deviceenable channel scheduler associated with WaveNetDevice

Reimplemented from ns3::ChannelScheduler.

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

◆ SwitchToNextChannel()

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

Member Data Documentation

◆ m_channelAccess

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 129 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 138 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 130 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 131 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 116 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 135 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 134 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 136 of file default-channel-scheduler.h.

Referenced by AssignExtendedAccess(), and ReleaseAccess().


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