ns3::SatFwdLinkScheduler Class Reference

SatFwdLinkScheduler schedules BB frames for forward link. More...

#include "satellite-fwd-link-scheduler.h"

+ Inheritance diagram for ns3::SatFwdLinkScheduler:
+ Collaboration diagram for ns3::SatFwdLinkScheduler:

Public Types

typedef Callback< void, std::vector< Ptr< SatSchedulingObject > > & > SchedContextCallback
 Callback to get scheduling contexts from upper layer. More...
 
enum  ScheduleSortingCriteria_t {
  NO_SORT , BUFFERING_DELAY_SORT , BUFFERING_LOAD_SORT , RANDOM_SORT ,
  PRIORITY_SORT
}
 Types for sorting algorithm used by forward link scheduler. More...
 
typedef Callback< bool, Ptr< SatControlMessage >, const Address & > SendControlMsgCallback
 Callback to notify upper layer about Tx opportunity. More...
 
typedef Callback< Ptr< Packet >, uint32_t, Mac48Address, uint8_t, uint32_t &, uint32_t & > TxOpportunityCallback
 Callback to notify upper layer about Tx opportunity. More...
 

Public Member Functions

 SatFwdLinkScheduler ()
 Construct a SatFwdLinkScheduler. More...
 
 SatFwdLinkScheduler (Ptr< SatBbFrameConf > conf, Mac48Address address, double carrierBandwidthInHz)
 Actual constructor of a SatFwdLinkScheduler. More...
 
 ~SatFwdLinkScheduler ()
 Destroy a SatFwdLinkScheduler. More...
 
void CnoInfoUpdated (Mac48Address utAddress, double cnoEstimate)
 Called when UT's C/N0 estimation is updated. More...
 
Time GetDefaultFrameDuration () const
 Return the BB frame duration of the default frame format, i.e. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the type ID of instance. More...
 
virtual std::pair< Ptr< SatBbFrame >, const Time > GetNextFrame ()
 Get next frame to be transmitted. More...
 
bool SendControlMsg (Ptr< SatControlMessage > message, const Address &dest) const
 Method te send a control message to a destination. More...
 
void SetDummyFrameSendingEnabled (bool dummyFrameSendingEnabled)
 Set the value of m_dummyFrameSendingEnabled. More...
 
void SetSchedContextCallback (SatFwdLinkScheduler::SchedContextCallback cb)
 Method to set Tx opportunity callback. More...
 
void SetSendControlMsgCallback (SatFwdLinkScheduler::SendControlMsgCallback cb)
 Method to set the control message sender callback. More...
 
void SetTxOpportunityCallback (SatFwdLinkScheduler::TxOpportunityCallback cb)
 Method to set Tx opportunity callback. More...
 

Static Public Member Functions

static bool CompareSoFlowId (Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
 Compares to scheduling objects priorities. More...
 
static bool CompareSoPriorityHol (Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
 Compares to scheduling objects priorities and HOL. More...
 
static bool CompareSoPriorityLoad (Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
 Compares to scheduling objects priorities and load. More...
 
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Types

typedef std::map< Mac48Address, Ptr< SatCnoEstimator > > CnoEstimatorMap_t
 

Protected Member Functions

 SatFwdLinkScheduler (const SatFwdLinkScheduler &)
 
bool CnoMatchWithFrame (double cno, Ptr< SatBbFrame > frame) const
 Check if given estimated C/N0 match with given frame. More...
 
Ptr< SatCnoEstimatorCreateCnoEstimator ()
 Create estimator for the UT according to set attributes. More...
 
void DoDispose (void)
 Do dispose actions. More...
 
double GetSchedulingObjectCno (Ptr< SatSchedulingObject > ob)
 
void GetSchedulingObjects (std::vector< Ptr< SatSchedulingObject >> &output)
 Gets scheduling object in sorted order according to configured sorting criteria. More...
 
SatFwdLinkScheduleroperator= (const SatFwdLinkScheduler &)
 
void PeriodicTimerExpired ()
 Handles periodic timer timeouts. More...
 
void ScheduleBbFrames ()
 Schedule BB Frames. More...
 
virtual void SendAndClearSymbolsSentStat ()
 Send stats and reset all the symbols sent count for each slice to zero. More...
 
void SortSchedulingObjects (std::vector< Ptr< SatSchedulingObject >> &so)
 Sorts given scheduling objects according to configured sorting criteria. More...
 

Protected Attributes

ScheduleSortingCriteria_t m_additionalSortCriteria
 Additional sorting criteria for scheduling objects received from LLC. More...
 
Ptr< SatBbFrameConfm_bbFrameConf
 Configured BB Frame conf. More...
 
double m_carrierBandwidthInHz
 Carrier bandwidth in hertz where scheduler is associated to. More...
 
Time m_cnoEstimationWindow
 Time window for C/N0 estimation. More...
 
CnoEstimatorMap_t m_cnoEstimatorContainer
 C/N0 estimator per UT. More...
 
SatCnoEstimator::EstimationMode_t m_cnoEstimatorMode
 Mode used for C/N0 estimator. More...
 
bool m_dummyFrameSendingEnabled
 Flag indicating if Dummy Frames are sent or not. More...
 
Mac48Address m_macAddress
 MAC address of the this instance (node) More...
 
Time m_periodicInterval
 The interval for periodic scheduling timer. More...
 
Ptr< UniformRandomVariable > m_random
 Random variable used in FWD link scheduling. More...
 
SatFwdLinkScheduler::SchedContextCallback m_schedContextCallback
 The scheduling context getter callback. More...
 
TracedCallback< uint8_t, double > m_schedulingSymbolRateTrace
 Traced callback for symbol rate, with flowId, requested Modcod info. More...
 
SatFwdLinkScheduler::SendControlMsgCallback m_sendControlMsgCallback
 The control message sender callback. More...
 
SatFwdLinkScheduler::TxOpportunityCallback m_txOpportunityCallback
 Callback to notify the txOpportunity to upper layer Returns a packet Attributes: payload in bytes. More...
 

Detailed Description

SatFwdLinkScheduler schedules BB frames for forward link.

In every GW MAC is assigned own instance of the SatFwdLinkScheduler. To handle BB frames and maintain queues for the them, it utilizes BB frame container given as attribute.

SatFwdLinkScheduler communicated through callback functions to request scheduling objects and notifying TX opportunities.

   GW MAC requests frames from scheduler through method GetNextFrame.

Definition at line 64 of file satellite-fwd-link-scheduler.h.

Member Typedef Documentation

◆ CnoEstimatorMap_t

typedef std::map<Mac48Address, Ptr<SatCnoEstimator> > ns3::SatFwdLinkScheduler::CnoEstimatorMap_t
protected

Definition at line 230 of file satellite-fwd-link-scheduler.h.

◆ SchedContextCallback

typedef Callback<void, std::vector<Ptr<SatSchedulingObject> >&> ns3::SatFwdLinkScheduler::SchedContextCallback

Callback to get scheduling contexts from upper layer.

Parameters
vectorof scheduling contexts

Definition at line 158 of file satellite-fwd-link-scheduler.h.

◆ SendControlMsgCallback

typedef Callback<bool, Ptr<SatControlMessage>, const Address&> ns3::SatFwdLinkScheduler::SendControlMsgCallback

Callback to notify upper layer about Tx opportunity.

Parameters
Ptr<SatControlMessage>The control message to send.
Address&the destination MAC address.
Returns
True

Definition at line 178 of file satellite-fwd-link-scheduler.h.

◆ TxOpportunityCallback

typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&> ns3::SatFwdLinkScheduler::TxOpportunityCallback

Callback to notify upper layer about Tx opportunity.

Parameters
Mac48Addressaddress
uint32_tpayload size in bytes
uint8_tFlow identifier
uint32_t&Bytes left
uint32_t&Next min TxO
Returns
packet Packet to be transmitted to PHY

Definition at line 170 of file satellite-fwd-link-scheduler.h.

Member Enumeration Documentation

◆ ScheduleSortingCriteria_t

Types for sorting algorithm used by forward link scheduler.

Enumerator
NO_SORT 

NO_SORT.

BUFFERING_DELAY_SORT 

BUFFERING_DELAY_SORT.

BUFFERING_LOAD_SORT 

BUFFERING_LOAD_SORT.

RANDOM_SORT 

RANDOM_SORT.

PRIORITY_SORT 

PRIORITY_SORT.

Definition at line 70 of file satellite-fwd-link-scheduler.h.

Constructor & Destructor Documentation

◆ SatFwdLinkScheduler() [1/3]

ns3::SatFwdLinkScheduler::SatFwdLinkScheduler ( )

Construct a SatFwdLinkScheduler.

This the default constructor for the SatFwdLinkScheduler is not supported.

Definition at line 166 of file satellite-fwd-link-scheduler.cc.

◆ SatFwdLinkScheduler() [2/3]

ns3::SatFwdLinkScheduler::SatFwdLinkScheduler ( Ptr< SatBbFrameConf conf,
Mac48Address  address,
double  carrierBandwidthInHz 
)

Actual constructor of a SatFwdLinkScheduler.

Parameters
confBB Frame configuration
addressMAC address
carrierBandwidthInHzCarrier bandwidth where scheduler is associated to [Hz].

Definition at line 175 of file satellite-fwd-link-scheduler.cc.

References m_random.

◆ ~SatFwdLinkScheduler()

ns3::SatFwdLinkScheduler::~SatFwdLinkScheduler ( )

Destroy a SatFwdLinkScheduler.

This is the destructor for the SatFwdLinkScheduler.

Definition at line 192 of file satellite-fwd-link-scheduler.cc.

◆ SatFwdLinkScheduler() [3/3]

ns3::SatFwdLinkScheduler::SatFwdLinkScheduler ( const SatFwdLinkScheduler )
protected

Member Function Documentation

◆ CnoInfoUpdated()

void ns3::SatFwdLinkScheduler::CnoInfoUpdated ( Mac48Address  utAddress,
double  cnoEstimate 
)

Called when UT's C/N0 estimation is updated.

Parameters
utAddressAddress of the UT updated C/N0 info.
cnoEstimateValue of the estimated C/N0.

Definition at line 246 of file satellite-fwd-link-scheduler.cc.

References CreateCnoEstimator(), and m_cnoEstimatorContainer.

+ Here is the call graph for this function:

◆ CnoMatchWithFrame()

bool ns3::SatFwdLinkScheduler::CnoMatchWithFrame ( double  cno,
Ptr< SatBbFrame frame 
) const
protected

Check if given estimated C/N0 match with given frame.

Parameters
cnoEstimated C/N0 value.
frameFrame to match
Returns
True if C/N0 match with frame false otherwise.

Definition at line 346 of file satellite-fwd-link-scheduler.cc.

References m_bbFrameConf.

◆ CompareSoFlowId()

bool ns3::SatFwdLinkScheduler::CompareSoFlowId ( Ptr< SatSchedulingObject obj1,
Ptr< SatSchedulingObject obj2 
)
static

Compares to scheduling objects priorities.

Parameters
obj1First object to compare
obj2Second object to compare
Returns
true if first object priority is considered to be higher that second object, false otherwise

Definition at line 68 of file satellite-fwd-link-scheduler.cc.

Referenced by CompareSoPriorityHol(), CompareSoPriorityLoad(), and SortSchedulingObjects().

+ Here is the caller graph for this function:

◆ CompareSoPriorityHol()

bool ns3::SatFwdLinkScheduler::CompareSoPriorityHol ( Ptr< SatSchedulingObject obj1,
Ptr< SatSchedulingObject obj2 
)
static

Compares to scheduling objects priorities and HOL.

Parameters
obj1First object to compare
obj2Second object to compare
Returns
true if first object priority is considered to be higher that second object or if priorities are same first object HOL is considered to be higher, false otherwise

Definition at line 88 of file satellite-fwd-link-scheduler.cc.

References CompareSoFlowId().

Referenced by SortSchedulingObjects().

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

◆ CompareSoPriorityLoad()

bool ns3::SatFwdLinkScheduler::CompareSoPriorityLoad ( Ptr< SatSchedulingObject obj1,
Ptr< SatSchedulingObject obj2 
)
static

Compares to scheduling objects priorities and load.

Parameters
obj1First object to compare
obj2Second object to compare
Returns
true if first object priority is considered to be higher that second object or if priorities are same first object load is considered to be higher, false otherwise

Definition at line 74 of file satellite-fwd-link-scheduler.cc.

References CompareSoFlowId().

Referenced by SortSchedulingObjects().

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

◆ CreateCnoEstimator()

Ptr< SatCnoEstimator > ns3::SatFwdLinkScheduler::CreateCnoEstimator ( )
protected

Create estimator for the UT according to set attributes.

Returns
pointer to created estimator

Definition at line 380 of file satellite-fwd-link-scheduler.cc.

References ns3::SatCnoEstimator::AVERAGE, ns3::SatCnoEstimator::LAST, m_cnoEstimationWindow, m_cnoEstimatorMode, and ns3::SatCnoEstimator::MINIMUM.

Referenced by CnoInfoUpdated().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::SatFwdLinkScheduler::DoDispose ( void  )
protected

◆ GetDefaultFrameDuration()

Time ns3::SatFwdLinkScheduler::GetDefaultFrameDuration ( ) const

Return the BB frame duration of the default frame format, i.e.

default MODCOD and NORMAL frame type. This is used by the GW MAC to schedule next txop events if it is disabled.

Returns
Default frame duration in Time

Definition at line 270 of file satellite-fwd-link-scheduler.cc.

References m_bbFrameConf, and ns3::SatEnums::NORMAL_FRAME.

◆ GetInstanceTypeId()

TypeId ns3::SatFwdLinkScheduler::GetInstanceTypeId ( void  ) const
virtual

Get the type ID of instance.

Returns
the object TypeId

Reimplemented in ns3::SatScpcScheduler, ns3::SatFwdLinkSchedulerTimeSlicing, and ns3::SatFwdLinkSchedulerDefault.

Definition at line 159 of file satellite-fwd-link-scheduler.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetNextFrame()

std::pair< Ptr< SatBbFrame >, const Time > ns3::SatFwdLinkScheduler::GetNextFrame ( )
virtual

Get next frame to be transmitted.

Returns
Pointer to frame

Reimplemented in ns3::SatScpcScheduler, ns3::SatFwdLinkSchedulerTimeSlicing, and ns3::SatFwdLinkSchedulerDefault.

Definition at line 236 of file satellite-fwd-link-scheduler.cc.

References m_bbFrameConf.

◆ GetSchedulingObjectCno()

double ns3::SatFwdLinkScheduler::GetSchedulingObjectCno ( Ptr< SatSchedulingObject ob)
protected
Parameters
Schedulingobject
Returns
C/N0 estimated for object. NAN, if estimate is not available.

Definition at line 363 of file satellite-fwd-link-scheduler.cc.

References m_cnoEstimatorContainer.

Referenced by ns3::SatFwdLinkSchedulerDefault::ScheduleBbFrames(), ns3::SatFwdLinkSchedulerTimeSlicing::ScheduleBbFrames(), and ns3::SatScpcScheduler::ScheduleBbFrames().

+ Here is the caller graph for this function:

◆ GetSchedulingObjects()

void ns3::SatFwdLinkScheduler::GetSchedulingObjects ( std::vector< Ptr< SatSchedulingObject >> &  output)
protected

Gets scheduling object in sorted order according to configured sorting criteria.

Parameters
outputreference to a vector which will be filled with pointers to the scheduling objects available for scheduling.

Definition at line 303 of file satellite-fwd-link-scheduler.cc.

◆ GetTypeId()

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

◆ operator=()

SatFwdLinkScheduler& ns3::SatFwdLinkScheduler::operator= ( const SatFwdLinkScheduler )
protected

◆ PeriodicTimerExpired()

void ns3::SatFwdLinkScheduler::PeriodicTimerExpired ( )
protected

Handles periodic timer timeouts.

Definition at line 285 of file satellite-fwd-link-scheduler.cc.

◆ ScheduleBbFrames()

void ns3::SatFwdLinkScheduler::ScheduleBbFrames ( )
protected

Schedule BB Frames.

Definition at line 297 of file satellite-fwd-link-scheduler.cc.

◆ SendAndClearSymbolsSentStat()

void ns3::SatFwdLinkScheduler::SendAndClearSymbolsSentStat ( )
protectedvirtual

Send stats and reset all the symbols sent count for each slice to zero.

Reimplemented in ns3::SatScpcScheduler, ns3::SatFwdLinkSchedulerTimeSlicing, and ns3::SatFwdLinkSchedulerDefault.

Definition at line 291 of file satellite-fwd-link-scheduler.cc.

◆ SendControlMsg()

bool ns3::SatFwdLinkScheduler::SendControlMsg ( Ptr< SatControlMessage message,
const Address &  dest 
) const

Method te send a control message to a destination.

Parameters
messageThe control message to send
destThe destination mac address

Definition at line 229 of file satellite-fwd-link-scheduler.cc.

References m_sendControlMsgCallback.

◆ SetDummyFrameSendingEnabled()

void ns3::SatFwdLinkScheduler::SetDummyFrameSendingEnabled ( bool  dummyFrameSendingEnabled)

Set the value of m_dummyFrameSendingEnabled.

Definition at line 279 of file satellite-fwd-link-scheduler.cc.

References m_dummyFrameSendingEnabled.

◆ SetSchedContextCallback()

void ns3::SatFwdLinkScheduler::SetSchedContextCallback ( SatFwdLinkScheduler::SchedContextCallback  cb)

Method to set Tx opportunity callback.

Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Definition at line 208 of file satellite-fwd-link-scheduler.cc.

References m_schedContextCallback.

◆ SetSendControlMsgCallback()

void ns3::SatFwdLinkScheduler::SetSendControlMsgCallback ( SatFwdLinkScheduler::SendControlMsgCallback  cb)

Method to set the control message sender callback.

Parameters
cbcallback to invoke whenever a control packet has to be sent.

Definition at line 222 of file satellite-fwd-link-scheduler.cc.

References m_sendControlMsgCallback.

◆ SetTxOpportunityCallback()

void ns3::SatFwdLinkScheduler::SetTxOpportunityCallback ( SatFwdLinkScheduler::TxOpportunityCallback  cb)

Method to set Tx opportunity callback.

Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Definition at line 215 of file satellite-fwd-link-scheduler.cc.

References m_txOpportunityCallback.

◆ SortSchedulingObjects()

void ns3::SatFwdLinkScheduler::SortSchedulingObjects ( std::vector< Ptr< SatSchedulingObject >> &  so)
protected

Sorts given scheduling objects according to configured sorting criteria.

Parameters
soScheduling objects to sort.

Definition at line 309 of file satellite-fwd-link-scheduler.cc.

References BUFFERING_DELAY_SORT, BUFFERING_LOAD_SORT, CompareSoFlowId(), CompareSoPriorityHol(), CompareSoPriorityLoad(), m_additionalSortCriteria, and NO_SORT.

Referenced by ns3::SatFwdLinkSchedulerDefault::GetSchedulingObjects(), ns3::SatFwdLinkSchedulerTimeSlicing::GetSchedulingObjects(), and ns3::SatScpcScheduler::GetSchedulingObjects().

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

Member Data Documentation

◆ m_additionalSortCriteria

ScheduleSortingCriteria_t ns3::SatFwdLinkScheduler::m_additionalSortCriteria
protected

Additional sorting criteria for scheduling objects received from LLC.

Definition at line 322 of file satellite-fwd-link-scheduler.h.

Referenced by GetTypeId(), and SortSchedulingObjects().

◆ m_bbFrameConf

◆ m_carrierBandwidthInHz

◆ m_cnoEstimationWindow

Time ns3::SatFwdLinkScheduler::m_cnoEstimationWindow
protected

Time window for C/N0 estimation.

Definition at line 354 of file satellite-fwd-link-scheduler.h.

Referenced by CreateCnoEstimator(), and GetTypeId().

◆ m_cnoEstimatorContainer

CnoEstimatorMap_t ns3::SatFwdLinkScheduler::m_cnoEstimatorContainer
protected

C/N0 estimator per UT.

Definition at line 344 of file satellite-fwd-link-scheduler.h.

Referenced by CnoInfoUpdated(), DoDispose(), and GetSchedulingObjectCno().

◆ m_cnoEstimatorMode

SatCnoEstimator::EstimationMode_t ns3::SatFwdLinkScheduler::m_cnoEstimatorMode
protected

Mode used for C/N0 estimator.

Definition at line 349 of file satellite-fwd-link-scheduler.h.

Referenced by CreateCnoEstimator(), and GetTypeId().

◆ m_dummyFrameSendingEnabled

bool ns3::SatFwdLinkScheduler::m_dummyFrameSendingEnabled
protected

Flag indicating if Dummy Frames are sent or not.

false means that only transmission time is simulated without sending.

Definition at line 301 of file satellite-fwd-link-scheduler.h.

Referenced by ns3::SatFwdLinkSchedulerDefault::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetNextFrame(), ns3::SatScpcScheduler::GetNextFrame(), GetTypeId(), and SetDummyFrameSendingEnabled().

◆ m_macAddress

Mac48Address ns3::SatFwdLinkScheduler::m_macAddress
protected

◆ m_periodicInterval

◆ m_random

Ptr<UniformRandomVariable> ns3::SatFwdLinkScheduler::m_random
protected

Random variable used in FWD link scheduling.

Definition at line 306 of file satellite-fwd-link-scheduler.h.

Referenced by SatFwdLinkScheduler().

◆ m_schedContextCallback

◆ m_schedulingSymbolRateTrace

TracedCallback<uint8_t, double> ns3::SatFwdLinkScheduler::m_schedulingSymbolRateTrace
protected

◆ m_sendControlMsgCallback

SatFwdLinkScheduler::SendControlMsgCallback ns3::SatFwdLinkScheduler::m_sendControlMsgCallback
protected

◆ m_txOpportunityCallback

SatFwdLinkScheduler::TxOpportunityCallback ns3::SatFwdLinkScheduler::m_txOpportunityCallback
protected

Callback to notify the txOpportunity to upper layer Returns a packet Attributes: payload in bytes.

Definition at line 329 of file satellite-fwd-link-scheduler.h.

Referenced by DoDispose(), ns3::SatFwdLinkSchedulerDefault::ScheduleBbFrames(), ns3::SatFwdLinkSchedulerTimeSlicing::ScheduleBbFrames(), ns3::SatScpcScheduler::ScheduleBbFrames(), and SetTxOpportunityCallback().


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