Loading...
Searching...
No Matches
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"
31
32#include "ns3/address.h"
33#include "ns3/simple-ref-count.h"
34#include "ns3/traced-callback.h"
35
36#include <map>
37#include <stdint.h>
38#include <vector>
39
40namespace ns3
41{
42
55{
56 public:
61 SatDefaultSuperframeAllocator(Ptr<SatSuperframeConf> superFrameConf);
62
67
71 static TypeId GetTypeId(void);
72
80 void ReserveMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled);
81
89 void ReleaseMinimumRate(uint32_t minimumRateBytes, bool controlSlotsEnabled);
90
96
107 uint32_t maxSizeInBytes,
109 TracedCallback<uint32_t> waveformTrace,
110 TracedCallback<uint32_t, uint32_t> utLoadTrace,
111 TracedCallback<uint32_t, double> loadTrace);
112
113 private:
117 typedef std::vector<Ptr<SatFrameAllocator>> FrameAllocatorContainer_t;
118
122 typedef std::map<Ptr<SatFrameAllocator>, uint32_t> SupportedFramesMap_t;
123
124 // Frame info container.
126
127 // target load for the frame
129
130 // flag telling if FCA (free capacity allocation) is on
132
133 // minimum carrier payload in bytes
135
136 // minimum rate based bytes left can been guaranteed by frame allocator
138
139 // The flag telling if time slot generation is done per RC based symbols
140 // instead of UT based symbols
142
143 // the most robust
145
146 // the total bandwidth for all configured frames
148
159 const SupportedFramesMap_t& frames);
160
168
172 void RemoveAllocations();
173
181
188 Ptr<SatFrameAllocator> SelectBestCarrier(double cno, uint32_t& bestWaveFormId);
189};
190
191} // namespace ns3
192
193#endif /* SAT_DEFAULT_SUPERFRAME_ALLOCATOR_H */
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.
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.
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.
SatSuperframeAllocator(Ptr< SatSuperframeConf > superFrameConf)
Construct SatSuperframeAllocator.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.