satellite-fwd-link-scheduler-time-slicing.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: Bastien Tauran <bastien.tauran@viveris.fr>
19  */
20 
21 #ifndef SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H
22 #define SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H
23 
25 
26 #include <ns3/pointer.h>
27 
28 namespace ns3
29 {
30 
44 {
45  public:
50  static TypeId GetTypeId(void);
51  TypeId GetInstanceTypeId(void) const;
52 
60 
68  SatFwdLinkSchedulerTimeSlicing(Ptr<SatBbFrameConf> conf,
69  Mac48Address address,
70  double carrierBandwidthInHz);
71 
78 
84  virtual std::pair<Ptr<SatBbFrame>, const Time> GetNextFrame();
85 
86  private:
90  void DoDispose(void);
91 
95  void ScheduleBbFrames();
96 
100  void PeriodicTimerExpired();
101 
106 
113  void GetSchedulingObjects(std::vector<Ptr<SatSchedulingObject>>& output);
114 
115  /*
116  * Give the total sending time of all the BBFrames in all the slices.
117  * \return The total duration.
118  */
119  Time GetTotalDuration();
120 
121  /*
122  * Send a control packet to the UT to inform which slices to subscribe
123  * \param address The MAC address of the UT
124  * \param slices The slices id the destination must subscribe to.
125  */
126  void SendTimeSliceSubscription(Mac48Address address, std::vector<uint8_t> slices);
127 
128  /*
129  * Compute if a new BBFrame can be openned while respecting symbol rate constraints.
130  * \param address The MAC destination address of the BBFrame
131  * \param priorityClass The priority class of the new BBFrame
132  * \param modcod The modcod of the new BBFrame
133  * \return true if a new BBFrame can be openned
134  */
135  bool CanOpenBbFrame(Mac48Address address, uint32_t priorityClass, SatEnums::SatModcod_t modcod);
136 
137  /*
138  * Compute the number of symbols to send for a slice, including a new BBFrame to be open
139  * \param sliceId The slice tested.
140  * \param modcod The modcod of the new BBFrame. If is SAT_NONVALID_MODCOD, the new BBFrame is
141  * ignored. \return The total number of symbols for all the BBFrames.
142  */
143  uint32_t GetSymbols(uint8_t sliceId, SatEnums::SatModcod_t modcod);
144 
148  std::map<uint8_t, Ptr<SatBbFrameContainer>> m_bbFrameContainers;
149 
154  std::map<Mac48Address, uint8_t> m_slicesMapping;
155 
159  std::map<uint8_t, uint32_t> m_symbolsSent;
160 
165 
171 
176 };
177 
178 } // namespace ns3
179 
180 #endif /* SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H */
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.