28NS_LOG_COMPONENT_DEFINE(
"SatScpcScheduler");
39 TypeId(
"ns3::SatScpcScheduler")
41 .AddConstructor<SatScpcScheduler>()
42 .AddAttribute(
"SchedulingStartThresholdTime",
43 "Threshold time of total transmissions in BB Frame container to trigger "
44 "a scheduling round.",
45 TimeValue(MilliSeconds(5)),
48 .AddAttribute(
"SchedulingStopThresholdTime",
49 "Threshold time of total transmissions in BB Frame container to stop a "
51 TimeValue(MilliSeconds(15)),
54 .AddAttribute(
"BBFrameContainer",
55 "BB frame container of this scheduler.",
58 MakePointerChecker<SatBbFrameContainer>());
65 NS_LOG_FUNCTION(
this);
66 NS_FATAL_ERROR(
"Default constructor for SatScpcScheduler not supported");
71 double carrierBandwidthInHz)
75 NS_LOG_FUNCTION(
this << conf << address << carrierBandwidthInHz);
81 NS_LOG_FUNCTION(
this);
85 std::vector<SatEnums::SatModcod_t> modCods =
m_bbFrameConf->GetModCodsUsed();
92 NS_LOG_FUNCTION(
this);
98 NS_LOG_FUNCTION(
this);
103std::pair<Ptr<SatBbFrame>,
const Time>
106 NS_LOG_FUNCTION(
this);
116 if (frame !=
nullptr)
124 frame = Create<SatBbFrame>(
m_bbFrameConf->GetDefaultModCod(),
129 Ptr<Packet> dummyPacket = Create<Packet>(1);
135 dummyPacket->AddPacketTag(mTag);
141 dummyPacket->AddPacketTag(addressE2ETag);
144 frame->AddPayload(dummyPacket);
146 frameDuration = frame->GetDuration();
149 else if (frame ==
nullptr)
154 if (frame !=
nullptr)
156 frameDuration = frame->GetDuration();
157 frame->SetSliceId(0);
160 return std::make_pair(frame, frameDuration);
166 NS_LOG_FUNCTION(
this);
176 NS_LOG_FUNCTION(
this);
179 std::vector<Ptr<SatSchedulingObject>> so;
182 for (std::vector<Ptr<SatSchedulingObject>>::const_iterator it = so.begin();
187 uint32_t currentObBytes = (*it)->GetBufferedBytes();
188 uint32_t currentObMinReqBytes = (*it)->GetMinTxOpportunityInBytes();
189 uint8_t flowId = (*it)->GetFlowId();
196 (currentObBytes > 0))
198 if (frameBytes < currentObMinReqBytes)
205 if (frameBytes < currentObMinReqBytes)
207 NS_FATAL_ERROR(
"Control package probably too long!!!");
212 (*it)->GetMacAddress(),
215 currentObMinReqBytes);
229 NS_FATAL_ERROR(
"Packet does not fit in empty BB Frame. Control package too long or "
230 "fragmentation problem in user package!!!");
241 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.
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.
void SortSchedulingObjects(std::vector< Ptr< SatSchedulingObject > > &so)
Sorts given scheduling objects according to configured sorting criteria.
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).
SatFwdLinkScheduler()
Construct a SatFwdLinkScheduler.
double GetSchedulingObjectCno(Ptr< SatSchedulingObject > ob)
SatFwdLinkScheduler::SchedContextCallback m_schedContextCallback
The scheduling context getter callback.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
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.
SatFwdLinkSchedulerDefault schedules BB frames for forward link.
void SendAndClearSymbolsSentStat()
Send stats and reset all the symbols sent count for each slice to zero.
Ptr< SatBbFrameContainer > m_bbFrameContainer
The container for BB Frames.
~SatScpcScheduler()
Destroy a SatFwdLinkScheduler.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
void DoDispose(void)
Do dispose actions.
void GetSchedulingObjects(std::vector< Ptr< SatSchedulingObject > > &output)
Gets scheduling object in sorted order according to configured sorting criteria.
uint32_t m_symbolsSent
The number of symbols sent for each slice during an allocation cycle.
Time m_schedulingStartThresholdTime
Threshold time of total transmissions in BB Frame container to trigger a scheduling round.
virtual std::pair< Ptr< SatBbFrame >, const Time > GetNextFrame()
Get next frame to be transmitted.
static TypeId GetTypeId(void)
Get the type ID.
SatScpcScheduler()
Construct a SatFwdLinkScheduler.
void ScheduleBbFrames()
Schedule BB Frames.
Time m_schedulingStopThresholdTime
Threshold time of total transmissions in BB Frame container to stop a scheduling round.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.