Loading...
Searching...
No Matches
satellite-fwd-link-scheduler.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Sami Rantanen <sami.rantanen@magister.fi>
19 */
20
21#ifndef SAT_FWD_LINK_SCHEDULER_H
22#define SAT_FWD_LINK_SCHEDULER_H
23
26#include "satellite-bbframe.h"
28#include "satellite-mac.h"
30#include "satellite-phy.h"
33
34#include "ns3/address.h"
35#include "ns3/callback.h"
36#include "ns3/mac48-address.h"
37#include "ns3/node.h"
38#include "ns3/nstime.h"
39#include "ns3/packet.h"
40#include "ns3/ptr.h"
41#include "ns3/random-variable-stream.h"
42#include "ns3/timer.h"
43#include "ns3/traced-callback.h"
44
45#include <cstring>
46#include <map>
47#include <math.h>
48#include <stdint.h>
49#include <utility>
50#include <vector>
51
52namespace ns3
53{
54
67
68class SatFwdLinkScheduler : public Object
69{
70 public:
82
91 static bool CompareSoFlowId(Ptr<SatSchedulingObject> obj1, Ptr<SatSchedulingObject> obj2);
92
101 static bool CompareSoPriorityLoad(Ptr<SatSchedulingObject> obj1, Ptr<SatSchedulingObject> obj2);
102
111 static bool CompareSoPriorityHol(Ptr<SatSchedulingObject> obj1, Ptr<SatSchedulingObject> obj2);
112
117 static TypeId GetTypeId(void);
118
126
134 SatFwdLinkScheduler(Ptr<SatBbFrameConf> conf,
135 Mac48Address address,
136 double carrierBandwidthInHz);
137
146 virtual void NotifyConstructionCompleted() override;
147
154
160 virtual std::pair<Ptr<SatBbFrame>, const Time> GetNextFrame();
161
166 typedef Callback<void, std::vector<Ptr<SatSchedulingObject>>&> SchedContextCallback;
167
177 typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&>
179
186 typedef Callback<bool, Ptr<SatControlMessage>, const Address&> SendControlMsgCallback;
187
195
202
208
214 bool SendControlMsg(Ptr<SatControlMessage> message, const Address& dest) const;
215
222 void CnoInfoUpdated(Mac48Address utAddress, double cnoEstimate);
223
230 Time GetDefaultFrameDuration() const;
231
235 void SetDummyFrameSendingEnabled(bool dummyFrameSendingEnabled);
236
240 virtual void ClearAllPackets();
241
242 protected:
243 typedef std::map<Mac48Address, Ptr<SatCnoEstimator>> CnoEstimatorMap_t;
244
247
251 void DoDispose(void);
252
256 virtual void ScheduleBbFrames() = 0;
257
265 bool CnoMatchWithFrame(double cno, Ptr<SatBbFrame> frame) const;
266
272 double GetSchedulingObjectCno(Ptr<SatSchedulingObject> ob);
273
277 virtual void SendAndClearSymbolsSentStat() = 0;
278
283
290 void GetSchedulingObjects(std::vector<Ptr<SatSchedulingObject>>& output);
291
297 void SortSchedulingObjects(std::vector<Ptr<SatSchedulingObject>>& so);
298
303 Ptr<SatCnoEstimator> CreateCnoEstimator();
304
308 Mac48Address m_macAddress;
309
315
319 Ptr<UniformRandomVariable> m_random;
320
326
330 Ptr<SatBbFrameConf> m_bbFrameConf;
331
336
343
348
353
358
363
368
373
377 TracedCallback<uint8_t, double> m_schedulingSymbolRateTrace;
378};
379
380} // namespace ns3
381
382#endif /* SAT_FWD_LINK_SCHEDULER_H */
EstimationMode_t
Definition of modes for estimator.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.