SatFwdLinkSchedulerTimeSlicing schedules BB frames for forward link. More...
#include "satellite-fwd-link-scheduler-time-slicing.h"
Public Member Functions | |
SatFwdLinkSchedulerTimeSlicing () | |
Construct a SatFwdLinkScheduler. More... | |
SatFwdLinkSchedulerTimeSlicing (Ptr< SatBbFrameConf > conf, Mac48Address address, double carrierBandwidthInHz) | |
Actual constructor of a SatFwdLinkScheduler. More... | |
~SatFwdLinkSchedulerTimeSlicing () | |
Destroy a SatFwdLinkScheduler. More... | |
virtual void | ClearAllPackets () |
Remove all packets being treated. More... | |
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... | |
Public Member Functions inherited from ns3::SatFwdLinkScheduler | |
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... | |
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 TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::SatFwdLinkScheduler | |
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... | |
Private Member Functions | |
bool | CanOpenBbFrame (Mac48Address address, uint32_t priorityClass, SatEnums::SatModcod_t modcod) |
void | DoDispose (void) |
Do dispose actions. More... | |
void | GetSchedulingObjects (std::vector< Ptr< SatSchedulingObject >> &output) |
Gets scheduling object in sorted order according to configured sorting criteria. More... | |
uint32_t | GetSymbols (uint8_t sliceId, SatEnums::SatModcod_t modcod) |
Time | GetTotalDuration () |
void | PeriodicTimerExpired () |
Handles periodic timer timeouts. More... | |
void | ScheduleBbFrames () |
Schedule BB Frames. More... | |
void | SendAndClearSymbolsSentStat () |
Send stats and reset all the symbols sent count for each slice to zero. More... | |
void | SendTimeSliceSubscription (Mac48Address address, std::vector< uint8_t > slices) |
Private Attributes | |
std::map< uint8_t, Ptr< SatBbFrameContainer > > | m_bbFrameContainers |
The containers for BBFrames. More... | |
uint8_t | m_lastSliceAssigned |
The slice of the last MAC address discovered. More... | |
uint8_t | m_lastSliceDequeued |
The last slice from which a BBFrame has been sent. More... | |
uint8_t | m_numberOfSlices |
The number of slices. More... | |
std::map< Mac48Address, uint8_t > | m_slicesMapping |
The association between a destination MAC address and its slice. More... | |
std::map< uint8_t, uint32_t > | m_symbolsSent |
The number of symbols sent for each slice during an allocation cycle. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::SatFwdLinkScheduler | |
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... | |
Protected Types inherited from ns3::SatFwdLinkScheduler | |
typedef std::map< Mac48Address, Ptr< SatCnoEstimator > > | CnoEstimatorMap_t |
Protected Member Functions inherited from ns3::SatFwdLinkScheduler | |
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... | |
void | SortSchedulingObjects (std::vector< Ptr< SatSchedulingObject >> &so) |
Sorts given scheduling objects according to configured sorting criteria. More... | |
Protected Attributes inherited from ns3::SatFwdLinkScheduler | |
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... | |
SatFwdLinkSchedulerTimeSlicing schedules BB frames for forward link.
It classifies the packets into different time slices depending on its destination MAC address.
SatFwdLinkSchedulerTimeSlicing communicated through callback functions to request
scheduling objects and notifying TX opportunities.
GW MAC requests frames from scheduler through method GetNextFrame.
Definition at line 48 of file satellite-fwd-link-scheduler-time-slicing.h.
ns3::SatFwdLinkSchedulerTimeSlicing::SatFwdLinkSchedulerTimeSlicing | ( | ) |
Construct a SatFwdLinkScheduler.
This the default constructor for the SatFwdLinkScheduler is not supported.
Definition at line 58 of file satellite-fwd-link-scheduler-time-slicing.cc.
ns3::SatFwdLinkSchedulerTimeSlicing::SatFwdLinkSchedulerTimeSlicing | ( | 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 65 of file satellite-fwd-link-scheduler-time-slicing.cc.
References ns3::SatFwdLinkScheduler::m_bbFrameConf, m_bbFrameContainers, ns3::SatFwdLinkScheduler::m_carrierBandwidthInHz, m_numberOfSlices, ns3::SatFwdLinkScheduler::m_periodicInterval, m_symbolsSent, ns3::SatEnums::NORMAL_FRAME, PeriodicTimerExpired(), ns3::SatEnums::SAT_NONVALID_MODCOD, and ns3::SatEnums::SHORT_FRAME.
ns3::SatFwdLinkSchedulerTimeSlicing::~SatFwdLinkSchedulerTimeSlicing | ( | ) |
Destroy a SatFwdLinkScheduler.
This is the destructor for the SatFwdLinkScheduler.
Definition at line 136 of file satellite-fwd-link-scheduler-time-slicing.cc.
|
private |
Definition at line 445 of file satellite-fwd-link-scheduler-time-slicing.cc.
References GetSymbols(), m_bbFrameContainers, ns3::SatFwdLinkScheduler::m_periodicInterval, m_slicesMapping, and ns3::SatEnums::SAT_NONVALID_MODCOD.
Referenced by ScheduleBbFrames().
|
virtual |
Remove all packets being treated.
Reimplemented from ns3::SatFwdLinkScheduler.
Definition at line 242 of file satellite-fwd-link-scheduler-time-slicing.cc.
References m_bbFrameContainers.
|
private |
Do dispose actions.
Definition at line 142 of file satellite-fwd-link-scheduler-time-slicing.cc.
References ns3::SatFwdLinkScheduler::DoDispose(), and m_bbFrameContainers.
|
virtual |
Get the type ID of instance.
Reimplemented from ns3::SatFwdLinkScheduler.
Definition at line 53 of file satellite-fwd-link-scheduler-time-slicing.cc.
References GetTypeId().
|
virtual |
Get next frame to be transmitted.
Reimplemented from ns3::SatFwdLinkScheduler.
Definition at line 150 of file satellite-fwd-link-scheduler-time-slicing.cc.
References ns3::SatEnums::DUMMY_FRAME, ns3::SatFwdLinkScheduler::m_bbFrameConf, m_bbFrameContainers, ns3::SatFwdLinkScheduler::m_carrierBandwidthInHz, ns3::SatFwdLinkScheduler::m_dummyFrameSendingEnabled, m_lastSliceDequeued, ns3::SatFwdLinkScheduler::m_macAddress, m_numberOfSlices, ns3::SatFwdLinkScheduler::m_periodicInterval, m_symbolsSent, ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), ns3::SatAddressE2ETag::SetE2ESourceAddress(), and ns3::SatMacTag::SetSourceAddress().
|
private |
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 398 of file satellite-fwd-link-scheduler-time-slicing.cc.
References GetTotalDuration(), ns3::SatFwdLinkScheduler::m_periodicInterval, ns3::SatFwdLinkScheduler::m_schedContextCallback, and ns3::SatFwdLinkScheduler::SortSchedulingObjects().
Referenced by ScheduleBbFrames().
|
private |
Definition at line 494 of file satellite-fwd-link-scheduler-time-slicing.cc.
References m_bbFrameContainers, ns3::SatFwdLinkScheduler::m_carrierBandwidthInHz, and ns3::SatEnums::SAT_NONVALID_MODCOD.
Referenced by CanOpenBbFrame().
|
private |
Definition at line 412 of file satellite-fwd-link-scheduler-time-slicing.cc.
References m_bbFrameContainers.
Referenced by GetSchedulingObjects(), and ScheduleBbFrames().
|
static |
Get the type ID.
Definition at line 38 of file satellite-fwd-link-scheduler-time-slicing.cc.
References m_numberOfSlices.
Referenced by GetInstanceTypeId().
|
private |
Handles periodic timer timeouts.
Definition at line 254 of file satellite-fwd-link-scheduler-time-slicing.cc.
References ns3::SatFwdLinkScheduler::m_periodicInterval, ScheduleBbFrames(), and SendAndClearSymbolsSentStat().
Referenced by SatFwdLinkSchedulerTimeSlicing().
|
private |
Schedule BB Frames.
Definition at line 287 of file satellite-fwd-link-scheduler-time-slicing.cc.
References CanOpenBbFrame(), ns3::SatFwdLinkScheduler::GetSchedulingObjectCno(), GetSchedulingObjects(), GetTotalDuration(), ns3::SatFwdLinkScheduler::m_bbFrameConf, m_bbFrameContainers, ns3::SatFwdLinkScheduler::m_carrierBandwidthInHz, m_lastSliceAssigned, m_numberOfSlices, ns3::SatFwdLinkScheduler::m_periodicInterval, m_slicesMapping, ns3::SatFwdLinkScheduler::m_txOpportunityCallback, and SendTimeSliceSubscription().
Referenced by PeriodicTimerExpired().
|
privatevirtual |
Send stats and reset all the symbols sent count for each slice to zero.
Reimplemented from ns3::SatFwdLinkScheduler.
Definition at line 267 of file satellite-fwd-link-scheduler-time-slicing.cc.
References m_numberOfSlices, ns3::SatFwdLinkScheduler::m_schedulingSymbolRateTrace, and m_symbolsSent.
Referenced by PeriodicTimerExpired().
|
private |
Definition at line 428 of file satellite-fwd-link-scheduler-time-slicing.cc.
References ns3::SatFwdLinkScheduler::m_sendControlMsgCallback.
Referenced by ScheduleBbFrames().
|
private |
The containers for BBFrames.
The keys are the slices and the values the associated container
Definition at line 158 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by SatFwdLinkSchedulerTimeSlicing(), CanOpenBbFrame(), ClearAllPackets(), DoDispose(), GetNextFrame(), GetSymbols(), GetTotalDuration(), and ScheduleBbFrames().
|
private |
The slice of the last MAC address discovered.
Used to associated destination MAC address to a slice following a Round Robin law.
Definition at line 180 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by ScheduleBbFrames().
|
private |
The last slice from which a BBFrame has been sent.
used for Round Robin scheduling.
Definition at line 185 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by GetNextFrame().
|
private |
The number of slices.
Definition at line 174 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by SatFwdLinkSchedulerTimeSlicing(), GetNextFrame(), GetTypeId(), ScheduleBbFrames(), and SendAndClearSymbolsSentStat().
|
private |
The association between a destination MAC address and its slice.
Slice 0 is the container for control BBFrames that are broadcasted to all UT.
Definition at line 164 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by CanOpenBbFrame(), and ScheduleBbFrames().
|
private |
The number of symbols sent for each slice during an allocation cycle.
Definition at line 169 of file satellite-fwd-link-scheduler-time-slicing.h.
Referenced by SatFwdLinkSchedulerTimeSlicing(), GetNextFrame(), and SendAndClearSymbolsSentStat().