21 #ifndef SAT_FWD_LINK_SCHEDULER_H
22 #define SAT_FWD_LINK_SCHEDULER_H
34 #include <ns3/address.h>
35 #include <ns3/callback.h>
36 #include <ns3/mac48-address.h>
38 #include <ns3/nstime.h>
39 #include <ns3/packet.h>
41 #include <ns3/random-variable-stream.h>
42 #include <ns3/timer.h>
43 #include <ns3/traced-callback.h>
87 static bool CompareSoFlowId(Ptr<SatSchedulingObject> obj1, Ptr<SatSchedulingObject> obj2);
137 Mac48Address address,
138 double carrierBandwidthInHz);
152 virtual std::pair<Ptr<SatBbFrame>,
const Time>
GetNextFrame();
169 typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&>
206 bool SendControlMsg(Ptr<SatControlMessage> message,
const Address& dest)
const;
EstimationMode_t
Definition of modes for estimator.
SatFwdLinkScheduler schedules BB frames for forward link.
TracedCallback< uint8_t, double > m_schedulingSymbolRateTrace
Traced callback for symbol rate, with flowId, requested Modcod info.
static bool CompareSoPriorityLoad(Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
Compares to scheduling objects priorities and load.
SatCnoEstimator::EstimationMode_t m_cnoEstimatorMode
Mode used for C/N0 estimator.
SatFwdLinkScheduler::TxOpportunityCallback m_txOpportunityCallback
Callback to notify the txOpportunity to upper layer Returns a packet Attributes: payload in bytes.
double m_carrierBandwidthInHz
Carrier bandwidth in hertz where scheduler is associated to.
Time m_cnoEstimationWindow
Time window for C/N0 estimation.
SatFwdLinkScheduler(const SatFwdLinkScheduler &)
void SetDummyFrameSendingEnabled(bool dummyFrameSendingEnabled)
Set the value of m_dummyFrameSendingEnabled.
CnoEstimatorMap_t m_cnoEstimatorContainer
C/N0 estimator per UT.
ScheduleSortingCriteria_t m_additionalSortCriteria
Additional sorting criteria for scheduling objects received from LLC.
void DoDispose(void)
Do dispose actions.
static TypeId GetTypeId(void)
Get the type ID.
void PeriodicTimerExpired()
Handles periodic timer timeouts.
Ptr< SatBbFrameConf > m_bbFrameConf
Configured BB Frame conf.
virtual void SendAndClearSymbolsSentStat()
Send stats and reset all the symbols sent count for each slice to zero.
void SetSchedContextCallback(SatFwdLinkScheduler::SchedContextCallback cb)
Method to set Tx opportunity callback.
void CnoInfoUpdated(Mac48Address utAddress, double cnoEstimate)
Called when UT's C/N0 estimation is updated.
Callback< void, std::vector< Ptr< SatSchedulingObject > > & > SchedContextCallback
Callback to get scheduling contexts from upper layer.
bool m_dummyFrameSendingEnabled
Flag indicating if Dummy Frames are sent or not.
Mac48Address m_macAddress
MAC address of the this instance (node)
std::map< Mac48Address, Ptr< SatCnoEstimator > > CnoEstimatorMap_t
Callback< Ptr< Packet >, uint32_t, Mac48Address, uint8_t, uint32_t &, uint32_t & > TxOpportunityCallback
Callback to notify upper layer about Tx opportunity.
SatFwdLinkScheduler()
Construct a SatFwdLinkScheduler.
SatFwdLinkScheduler::SendControlMsgCallback m_sendControlMsgCallback
The control message sender callback.
Time GetDefaultFrameDuration() const
Return the BB frame duration of the default frame format, i.e.
Ptr< SatCnoEstimator > CreateCnoEstimator()
Create estimator for the UT according to set attributes.
void ScheduleBbFrames()
Schedule BB Frames.
Ptr< UniformRandomVariable > m_random
Random variable used in FWD link scheduling.
Time m_periodicInterval
The interval for periodic scheduling timer.
void SetSendControlMsgCallback(SatFwdLinkScheduler::SendControlMsgCallback cb)
Method to set the control message sender callback.
double GetSchedulingObjectCno(Ptr< SatSchedulingObject > ob)
virtual std::pair< Ptr< SatBbFrame >, const Time > GetNextFrame()
Get next frame to be transmitted.
void SortSchedulingObjects(std::vector< Ptr< SatSchedulingObject >> &so)
Sorts given scheduling objects according to configured sorting criteria.
SatFwdLinkScheduler & operator=(const SatFwdLinkScheduler &)
bool CnoMatchWithFrame(double cno, Ptr< SatBbFrame > frame) const
Check if given estimated C/N0 match with given frame.
SatFwdLinkScheduler::SchedContextCallback m_schedContextCallback
The scheduling context getter callback.
static bool CompareSoPriorityHol(Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
Compares to scheduling objects priorities and HOL.
ScheduleSortingCriteria_t
Types for sorting algorithm used by forward link scheduler.
@ RANDOM_SORT
RANDOM_SORT.
@ BUFFERING_DELAY_SORT
BUFFERING_DELAY_SORT.
@ PRIORITY_SORT
PRIORITY_SORT.
@ BUFFERING_LOAD_SORT
BUFFERING_LOAD_SORT.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
bool SendControlMsg(Ptr< SatControlMessage > message, const Address &dest) const
Method te send a control message to a destination.
void GetSchedulingObjects(std::vector< Ptr< SatSchedulingObject >> &output)
Gets scheduling object in sorted order according to configured sorting criteria.
~SatFwdLinkScheduler()
Destroy a SatFwdLinkScheduler.
static bool CompareSoFlowId(Ptr< SatSchedulingObject > obj1, Ptr< SatSchedulingObject > obj2)
Compares to scheduling objects priorities.
void SetTxOpportunityCallback(SatFwdLinkScheduler::TxOpportunityCallback cb)
Method to set Tx opportunity callback.
Callback< bool, Ptr< SatControlMessage >, const Address & > SendControlMsgCallback
Callback to notify upper layer about Tx opportunity.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.