25 NS_LOG_COMPONENT_DEFINE(
"SatFwdLinkSchedulerDefault");
30 NS_OBJECT_ENSURE_REGISTERED(SatFwdLinkSchedulerDefault);
36 TypeId(
"ns3::SatFwdLinkSchedulerDefault")
38 .AddConstructor<SatFwdLinkSchedulerDefault>()
40 "SchedulingStartThresholdTime",
41 "Threshold time of total transmissions in BB Frame container to trigger a "
43 TimeValue(MilliSeconds(5)),
47 "SchedulingStopThresholdTime",
48 "Threshold time of total transmissions in BB Frame container to stop a scheduling "
50 TimeValue(MilliSeconds(15)),
53 .AddAttribute(
"BBFrameContainer",
54 "BB frame container of this scheduler.",
57 MakePointerChecker<SatBbFrameContainer>());
64 NS_LOG_FUNCTION(
this);
72 NS_LOG_FUNCTION(
this);
73 NS_FATAL_ERROR(
"Default constructor for SatFwdLinkSchedulerDefault not supported");
78 double carrierBandwidthInHz)
82 NS_LOG_FUNCTION(
this);
84 ObjectBase::ConstructSelf(AttributeConstructionList());
86 std::vector<SatEnums::SatModcod_t> modCods = conf->GetModCodsUsed();
97 NS_LOG_FUNCTION(
this);
103 NS_LOG_FUNCTION(
this);
108 std::pair<Ptr<SatBbFrame>,
const Time>
111 NS_LOG_FUNCTION(
this);
129 frame = Create<SatBbFrame>(
m_bbFrameConf->GetDefaultModCod(),
134 Ptr<Packet> dummyPacket = Create<Packet>(1);
140 dummyPacket->AddPacketTag(mTag);
146 dummyPacket->AddPacketTag(addressE2ETag);
149 frame->AddPayload(dummyPacket);
151 frameDuration = frame->GetDuration();
154 else if (frame == NULL)
161 frameDuration = frame->GetDuration();
162 frame->SetSliceId(0);
165 return std::make_pair(frame, frameDuration);
171 NS_LOG_FUNCTION(
this);
184 NS_LOG_FUNCTION(
this);
194 NS_LOG_FUNCTION(
this);
197 std::vector<Ptr<SatSchedulingObject>> so;
200 for (std::vector<Ptr<SatSchedulingObject>>::const_iterator it = so.begin();
205 uint32_t currentObBytes = (*it)->GetBufferedBytes();
206 uint32_t currentObMinReqBytes = (*it)->GetMinTxOpportunityInBytes();
207 uint8_t flowId = (*it)->GetFlowId();
214 (currentObBytes > 0))
216 if (frameBytes < currentObMinReqBytes)
223 if (frameBytes < currentObMinReqBytes)
225 NS_FATAL_ERROR(
"Control package too probably too long!!!");
230 (*it)->GetMacAddress(),
233 currentObMinReqBytes);
247 NS_FATAL_ERROR(
"Packet does not fit in empty BB Frame. Control package too long or "
248 "fragmentation problem in user package!!!");
259 NS_LOG_FUNCTION(
this);
This class implements a tag that carries the satellite MAC of GW and UT.
void SetE2ESourceAddress(Mac48Address e2eSourceAddress)
Set E2E source MAC address.
void SetE2EDestAddress(Mac48Address e2eDestAddress)
Set E2E destination MAC address.
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
void GetSchedulingObjects(std::vector< Ptr< SatSchedulingObject >> &output)
Gets scheduling object in sorted order according to configured sorting criteria.
virtual std::pair< Ptr< SatBbFrame >, const Time > GetNextFrame()
Get next frame to be transmitted.
void ScheduleBbFrames()
Schedule BB Frames.
void PeriodicTimerExpired()
Handles periodic timer timeouts.
Time m_schedulingStopThresholdTime
Threshold time of total transmissions in BB Frame container to stop a scheduling round.
void SendAndClearSymbolsSentStat()
Send stats and reset all the symbols sent count for each slice to zero.
SatFwdLinkSchedulerDefault()
Construct a SatFwdLinkScheduler.
Time m_schedulingStartThresholdTime
Threshold time of total transmissions in BB Frame container to trigger a scheduling round.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< SatBbFrameContainer > m_bbFrameContainer
The container for BB Frames.
~SatFwdLinkSchedulerDefault()
Destroy a SatFwdLinkScheduler.
void DoDispose(void)
Do dispose actions.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
uint32_t m_symbolsSent
The number of symbols sent for each slice during an allocation cycle.
SatFwdLinkScheduler schedules BB frames for forward link.
TracedCallback< uint8_t, double > m_schedulingSymbolRateTrace
Traced callback for symbol rate, with flowId, requested Modcod info.
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.
void DoDispose(void)
Do dispose actions.
Ptr< SatBbFrameConf > m_bbFrameConf
Configured BB Frame conf.
bool m_dummyFrameSendingEnabled
Flag indicating if Dummy Frames are sent or not.
Mac48Address m_macAddress
MAC address of the this instance (node)
Time m_periodicInterval
The interval for periodic scheduling timer.
double GetSchedulingObjectCno(Ptr< SatSchedulingObject > ob)
void SortSchedulingObjects(std::vector< Ptr< SatSchedulingObject >> &so)
Sorts given scheduling objects according to configured sorting criteria.
SatFwdLinkScheduler::SchedContextCallback m_schedContextCallback
The scheduling context getter callback.
This class implements a tag that carries the satellite MAC specific information, such as source and d...
void SetDestAddress(Mac48Address dest)
Set destination MAC address.
void SetSourceAddress(Mac48Address source)
Set source MAC address.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.