satellite-default-superframe-allocator.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions Ltd
4  * Copyright (c) 2019 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Sami Rantanen <sami.rantanen@magister.fi>
20  * Author: Joaquin Muguerza <jmuguerza@viveris.fr>
21  */
22 
23 #ifndef SAT_DEFAULT_SUPERFRAME_ALLOCATOR_H
24 #define SAT_DEFAULT_SUPERFRAME_ALLOCATOR_H
25 
27 #include "satellite-enums.h"
29 #include "satellite-frame-conf.h"
31 
32 #include <ns3/address.h>
33 #include <ns3/simple-ref-count.h>
34 #include <ns3/traced-callback.h>
35 
36 namespace ns3
37 {
38 
51 {
52  public:
57  SatDefaultSuperframeAllocator(Ptr<SatSuperframeConf> superFrameConf);
58 
63 
67  static TypeId GetTypeId(void);
68 
73  virtual TypeId GetInstanceTypeId(void) const;
74 
82  void ReserveMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled);
83 
91  void ReleaseMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled);
92 
98 
109  uint32_t maxSizeInBytes,
111  TracedCallback<uint32_t> waveformTrace,
112  TracedCallback<uint32_t, uint32_t> utLoadTrace,
113  TracedCallback<uint32_t, double> loadTrace);
114 
115  private:
119  typedef std::vector<Ptr<SatFrameAllocator>> FrameAllocatorContainer_t;
120 
124  typedef std::map<Ptr<SatFrameAllocator>, uint32_t> SupportedFramesMap_t;
125 
126  // Frame info container.
128 
129  // target load for the frame
130  double m_targetLoad;
131 
132  // flag telling if FCA (free capacity allocation) is on
134 
135  // minimum carrier payload in bytes
137 
138  // minimum rate based bytes left can been guaranteed by frame allocator
140 
141  // The flag telling if time slot generation is done per RC based symbols
142  // instead of UT based symbols
144 
145  // the most robust
147 
148  // the total bandwidth for all configured frames
150 
161  const SupportedFramesMap_t& frames);
162 
170 
174  void RemoveAllocations();
175 
183 
190  Ptr<SatFrameAllocator> SelectBestCarrier(double cno, uint32_t& bestWaveFormId);
191 };
192 
193 } // namespace ns3
194 
195 #endif /* SAT_DEFAULT_SUPERFRAME_ALLOCATOR_H */
helper class for Satellite Beam Scheduler.
bool AllocateBasedOnCc(SatFrameAllocator::CcLevel_t ccLevel, SatFrameAllocator::SatFrameAllocReq *allocReq, const SupportedFramesMap_t &frames)
Allocate given request according to type.
bool AllocateToFrame(SatFrameAllocator::SatFrameAllocReq *allocReq)
Allocate a request to a frame.
void PreAllocateSymbols(SatFrameAllocator::SatFrameAllocContainer_t &allocReqs)
Preallocate symbols for given to UTs in superframe.
std::vector< Ptr< SatFrameAllocator > > FrameAllocatorContainer_t
Container for SatFrameInfo items.
void ReleaseMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled)
Release minimum rate from the allocator.
SatDefaultSuperframeAllocator(Ptr< SatSuperframeConf > superFrameConf)
Construct SatDefaultSuperframeAllocator.
void RemoveAllocations()
Remove allocations from all frames maintained by frame allocator.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
Ptr< SatFrameAllocator > SelectBestCarrier(double cno, uint32_t &bestWaveFormId)
Select which carrier is the best suited for handling requests of a terminal communicating at the give...
void SelectCarriers(SatFrameAllocator::SatFrameAllocContainer_t &allocReqs)
Select which carriers to use from the underlying frames.
void GenerateTimeSlots(SatFrameAllocator::TbtpMsgContainer_t &tbtpContainer, uint32_t maxSizeInBytes, SatFrameAllocator::UtAllocInfoContainer_t &utAllocContainer, TracedCallback< uint32_t > waveformTrace, TracedCallback< uint32_t, uint32_t > utLoadTrace, TracedCallback< uint32_t, double > loadTrace)
Generate time slots in TBTP(s) for the UT/RC.
~SatDefaultSuperframeAllocator()
Destruct SatDefaultSuperframeAllocator.
static TypeId GetTypeId(void)
derived from object
std::map< Ptr< SatFrameAllocator >, uint32_t > SupportedFramesMap_t
Container for the supported SatFrameAllocator (frames).
void ReserveMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled)
Reserve minimum rate from the allocator.
SatFrameAllocReq is used to define frame allocation parameters when requesting allocation from SatFra...
std::vector< SatFrameAllocReq * > SatFrameAllocContainer_t
Container to store SatFrameAllocReq item pointers.
std::vector< Ptr< SatTbtpMessage > > TbtpMsgContainer_t
Container to store generated TBTP messages.
std::map< Address, UtAllocInfoItem_t > UtAllocInfoContainer_t
Map container to store UT allocation information.
helper class for Satellite Beam Scheduler.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.