SatFwdLinkScheduler schedules BB frames for forward link. More...
#include "satellite-fwd-link-scheduler.h"
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< SatCnoEstimator > | CreateCnoEstimator () |
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... | |
SatFwdLinkScheduler & | operator= (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< SatBbFrameConf > | m_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... | |
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.
|
protected |
Definition at line 230 of file satellite-fwd-link-scheduler.h.
typedef Callback<void, std::vector<Ptr<SatSchedulingObject> >&> ns3::SatFwdLinkScheduler::SchedContextCallback |
Callback to get scheduling contexts from upper layer.
vector | of scheduling contexts |
Definition at line 158 of file satellite-fwd-link-scheduler.h.
typedef Callback<bool, Ptr<SatControlMessage>, const Address&> ns3::SatFwdLinkScheduler::SendControlMsgCallback |
Callback to notify upper layer about Tx opportunity.
Ptr<SatControlMessage> | The control message to send. |
Address& | the destination MAC address. |
Definition at line 178 of file satellite-fwd-link-scheduler.h.
typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&> ns3::SatFwdLinkScheduler::TxOpportunityCallback |
Callback to notify upper layer about Tx opportunity.
Mac48Address | address |
uint32_t | payload size in bytes |
uint8_t | Flow identifier |
uint32_t& | Bytes left |
uint32_t& | Next min TxO |
Definition at line 170 of file satellite-fwd-link-scheduler.h.
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.
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.
ns3::SatFwdLinkScheduler::SatFwdLinkScheduler | ( | Ptr< SatBbFrameConf > | conf, |
Mac48Address | address, | ||
double | carrierBandwidthInHz | ||
) |
Actual constructor of a SatFwdLinkScheduler.
conf | BB Frame configuration |
address | MAC address |
carrierBandwidthInHz | Carrier bandwidth where scheduler is associated to [Hz]. |
Definition at line 175 of file satellite-fwd-link-scheduler.cc.
References m_random.
ns3::SatFwdLinkScheduler::~SatFwdLinkScheduler | ( | ) |
Destroy a SatFwdLinkScheduler.
This is the destructor for the SatFwdLinkScheduler.
Definition at line 192 of file satellite-fwd-link-scheduler.cc.
|
protected |
void ns3::SatFwdLinkScheduler::CnoInfoUpdated | ( | Mac48Address | utAddress, |
double | cnoEstimate | ||
) |
Called when UT's C/N0 estimation is updated.
utAddress | Address of the UT updated C/N0 info. |
cnoEstimate | Value of the estimated C/N0. |
Definition at line 246 of file satellite-fwd-link-scheduler.cc.
References CreateCnoEstimator(), and m_cnoEstimatorContainer.
|
protected |
Check if given estimated C/N0 match with given frame.
cno | Estimated C/N0 value. |
frame | Frame to match |
Definition at line 346 of file satellite-fwd-link-scheduler.cc.
References m_bbFrameConf.
|
static |
Compares to scheduling objects priorities.
obj1 | First object to compare |
obj2 | Second object to compare |
Definition at line 68 of file satellite-fwd-link-scheduler.cc.
Referenced by CompareSoPriorityHol(), CompareSoPriorityLoad(), and SortSchedulingObjects().
|
static |
Compares to scheduling objects priorities and HOL.
obj1 | First object to compare |
obj2 | Second object to compare |
Definition at line 88 of file satellite-fwd-link-scheduler.cc.
References CompareSoFlowId().
Referenced by SortSchedulingObjects().
|
static |
Compares to scheduling objects priorities and load.
obj1 | First object to compare |
obj2 | Second object to compare |
Definition at line 74 of file satellite-fwd-link-scheduler.cc.
References CompareSoFlowId().
Referenced by SortSchedulingObjects().
|
protected |
Create estimator for the UT according to set attributes.
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().
|
protected |
Do dispose actions.
Definition at line 198 of file satellite-fwd-link-scheduler.cc.
References m_cnoEstimatorContainer, m_schedContextCallback, m_sendControlMsgCallback, and m_txOpportunityCallback.
Referenced by ns3::SatFwdLinkSchedulerDefault::DoDispose(), ns3::SatFwdLinkSchedulerTimeSlicing::DoDispose(), and ns3::SatScpcScheduler::DoDispose().
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.
Definition at line 270 of file satellite-fwd-link-scheduler.cc.
References m_bbFrameConf, and ns3::SatEnums::NORMAL_FRAME.
|
virtual |
Get the type ID of instance.
Reimplemented in ns3::SatScpcScheduler, ns3::SatFwdLinkSchedulerTimeSlicing, and ns3::SatFwdLinkSchedulerDefault.
Definition at line 159 of file satellite-fwd-link-scheduler.cc.
References GetTypeId().
|
virtual |
Get next frame to be transmitted.
Reimplemented in ns3::SatScpcScheduler, ns3::SatFwdLinkSchedulerTimeSlicing, and ns3::SatFwdLinkSchedulerDefault.
Definition at line 236 of file satellite-fwd-link-scheduler.cc.
References m_bbFrameConf.
|
protected |
Scheduling | object |
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().
|
protected |
Gets scheduling object in sorted order according to configured sorting criteria.
output | reference 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.
|
static |
Get the type ID.
Definition at line 102 of file satellite-fwd-link-scheduler.cc.
References ns3::SatCnoEstimator::AVERAGE, BUFFERING_DELAY_SORT, BUFFERING_LOAD_SORT, ns3::SatCnoEstimator::LAST, m_additionalSortCriteria, m_bbFrameConf, m_cnoEstimationWindow, m_cnoEstimatorMode, m_dummyFrameSendingEnabled, m_periodicInterval, m_schedulingSymbolRateTrace, ns3::SatCnoEstimator::MINIMUM, and NO_SORT.
Referenced by GetInstanceTypeId().
|
protected |
|
protected |
Handles periodic timer timeouts.
Definition at line 285 of file satellite-fwd-link-scheduler.cc.
|
protected |
Schedule BB Frames.
Definition at line 297 of file satellite-fwd-link-scheduler.cc.
|
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.
bool ns3::SatFwdLinkScheduler::SendControlMsg | ( | Ptr< SatControlMessage > | message, |
const Address & | dest | ||
) | const |
Method te send a control message to a destination.
message | The control message to send |
dest | The destination mac address |
Definition at line 229 of file satellite-fwd-link-scheduler.cc.
References m_sendControlMsgCallback.
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.
void ns3::SatFwdLinkScheduler::SetSchedContextCallback | ( | SatFwdLinkScheduler::SchedContextCallback | cb | ) |
Method to set Tx opportunity callback.
cb | callback 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.
void ns3::SatFwdLinkScheduler::SetSendControlMsgCallback | ( | SatFwdLinkScheduler::SendControlMsgCallback | cb | ) |
Method to set the control message sender callback.
cb | callback to invoke whenever a control packet has to be sent. |
Definition at line 222 of file satellite-fwd-link-scheduler.cc.
References m_sendControlMsgCallback.
void ns3::SatFwdLinkScheduler::SetTxOpportunityCallback | ( | SatFwdLinkScheduler::TxOpportunityCallback | cb | ) |
Method to set Tx opportunity callback.
cb | callback 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.
|
protected |
Sorts given scheduling objects according to configured sorting criteria.
so | Scheduling 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().
|
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().
|
protected |
Configured BB Frame conf.
Definition at line 317 of file satellite-fwd-link-scheduler.h.
Referenced by ns3::SatFwdLinkSchedulerDefault::SatFwdLinkSchedulerDefault(), ns3::SatFwdLinkSchedulerTimeSlicing::SatFwdLinkSchedulerTimeSlicing(), ns3::SatScpcScheduler::SatScpcScheduler(), CnoMatchWithFrame(), GetDefaultFrameDuration(), ns3::SatFwdLinkSchedulerDefault::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetNextFrame(), GetNextFrame(), ns3::SatScpcScheduler::GetNextFrame(), GetTypeId(), ns3::SatFwdLinkSchedulerDefault::ScheduleBbFrames(), ns3::SatFwdLinkSchedulerTimeSlicing::ScheduleBbFrames(), and ns3::SatScpcScheduler::ScheduleBbFrames().
|
protected |
Carrier bandwidth in hertz where scheduler is associated to.
Definition at line 359 of file satellite-fwd-link-scheduler.h.
Referenced by ns3::SatFwdLinkSchedulerTimeSlicing::SatFwdLinkSchedulerTimeSlicing(), ns3::SatFwdLinkSchedulerDefault::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetNextFrame(), ns3::SatScpcScheduler::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetSymbols(), ns3::SatFwdLinkSchedulerDefault::ScheduleBbFrames(), ns3::SatFwdLinkSchedulerTimeSlicing::ScheduleBbFrames(), and ns3::SatScpcScheduler::ScheduleBbFrames().
|
protected |
Time window for C/N0 estimation.
Definition at line 354 of file satellite-fwd-link-scheduler.h.
Referenced by CreateCnoEstimator(), and GetTypeId().
|
protected |
C/N0 estimator per UT.
Definition at line 344 of file satellite-fwd-link-scheduler.h.
Referenced by CnoInfoUpdated(), DoDispose(), and GetSchedulingObjectCno().
|
protected |
Mode used for C/N0 estimator.
Definition at line 349 of file satellite-fwd-link-scheduler.h.
Referenced by CreateCnoEstimator(), and GetTypeId().
|
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().
|
protected |
MAC address of the this instance (node)
Definition at line 295 of file satellite-fwd-link-scheduler.h.
Referenced by ns3::SatFwdLinkSchedulerDefault::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetNextFrame(), and ns3::SatScpcScheduler::GetNextFrame().
|
protected |
The interval for periodic scheduling timer.
Timer is evaluated by scheduling calls to PeriodicTimerExpired.
Definition at line 312 of file satellite-fwd-link-scheduler.h.
Referenced by ns3::SatFwdLinkSchedulerDefault::SatFwdLinkSchedulerDefault(), ns3::SatFwdLinkSchedulerTimeSlicing::SatFwdLinkSchedulerTimeSlicing(), ns3::SatScpcScheduler::SatScpcScheduler(), ns3::SatFwdLinkSchedulerTimeSlicing::CanOpenBbFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetNextFrame(), ns3::SatFwdLinkSchedulerTimeSlicing::GetSchedulingObjects(), GetTypeId(), ns3::SatFwdLinkSchedulerDefault::PeriodicTimerExpired(), ns3::SatFwdLinkSchedulerTimeSlicing::PeriodicTimerExpired(), ns3::SatScpcScheduler::PeriodicTimerExpired(), and ns3::SatFwdLinkSchedulerTimeSlicing::ScheduleBbFrames().
|
protected |
Random variable used in FWD link scheduling.
Definition at line 306 of file satellite-fwd-link-scheduler.h.
Referenced by SatFwdLinkScheduler().
|
protected |
The scheduling context getter callback.
Definition at line 334 of file satellite-fwd-link-scheduler.h.
Referenced by DoDispose(), ns3::SatFwdLinkSchedulerDefault::GetSchedulingObjects(), ns3::SatFwdLinkSchedulerTimeSlicing::GetSchedulingObjects(), ns3::SatScpcScheduler::GetSchedulingObjects(), and SetSchedContextCallback().
|
protected |
Traced callback for symbol rate, with flowId, requested Modcod info.
Definition at line 364 of file satellite-fwd-link-scheduler.h.
Referenced by GetTypeId(), ns3::SatFwdLinkSchedulerDefault::SendAndClearSymbolsSentStat(), ns3::SatFwdLinkSchedulerTimeSlicing::SendAndClearSymbolsSentStat(), and ns3::SatScpcScheduler::SendAndClearSymbolsSentStat().
|
protected |
The control message sender callback.
Definition at line 339 of file satellite-fwd-link-scheduler.h.
Referenced by DoDispose(), SendControlMsg(), ns3::SatFwdLinkSchedulerTimeSlicing::SendTimeSliceSubscription(), and SetSendControlMsgCallback().
|
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().