satellite-bbframe-conf.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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #ifndef SATELLITE_BBFRAME_CONF_H
22 #define SATELLITE_BBFRAME_CONF_H
23 
24 #include "satellite-enums.h"
25 #include "satellite-link-results.h"
26 
27 #include <ns3/nstime.h>
28 #include <ns3/object.h>
29 #include <ns3/ptr.h>
30 #include <ns3/simple-ref-count.h>
31 
32 #include <map>
33 #include <stdint.h>
34 #include <string>
35 #include <utility>
36 #include <vector>
37 
38 namespace ns3
39 {
40 
41 class SatLinkResultsDvbS2;
42 
51 class SatDvbS2Waveform : public SimpleRefCount<SatDvbS2Waveform>
52 {
53  public:
58 
68  Time frameLen,
69  uint32_t payloadBits);
70 
76 
82 
87  uint32_t GetPayloadInBits() const;
88 
93  Time GetFrameDuration() const;
94 
100  void SetCNoRequirement(double cnoRequirement);
101 
106  double GetCNoRequirement() const;
107 
111  void Dump() const;
112 
113  private:
118 
123 
128 
132  uint32_t m_payloadBits;
133 
139 };
140 
148 class SatBbFrameConf : public Object
149 {
150  public:
154  SatBbFrameConf();
155 
160  SatBbFrameConf(double symbolRate, SatEnums::DvbVersion_t dvbVersion);
161 
165  virtual ~SatBbFrameConf();
166 
171  static TypeId GetTypeId(void);
172 
177  virtual TypeId GetInstanceTypeId(void) const;
178 
182  typedef std::map<std::pair<SatEnums::SatModcod_t, SatEnums::SatBbFrameType_t>,
183  Ptr<SatDvbS2Waveform>>
185 
191  inline uint32_t GetBbFrameHeaderSizeInBytes() const
192  {
194  }
195 
201  inline double GetBbFrameHighOccupancyThreshold() const
202  {
204  }
205 
211  inline double GetBbFrameLowOccupancyThreshold() const
212  {
214  }
215 
222  {
223  return m_bbFrameUsageMode;
224  }
225 
231  void InitializeCNoRequirements(Ptr<SatLinkResultsFwd> linkResults);
232 
238  Time GetDummyBbFrameDuration() const;
239 
247  SatEnums::SatBbFrameType_t frameType) const;
248 
254  double GetSymbolRate();
255 
262  SatEnums::SatBbFrameType_t frameType) const;
263 
271 
277 
283 
290 
294  void DumpWaveforms() const;
295 
302 
308  std::vector<SatEnums::SatModcod_t> GetModCodsUsed();
309 
310  private:
318  SatEnums::SatBbFrameType_t frameType) const;
319 
328  SatEnums::SatBbFrameType_t frameType) const;
329 
333  void GetModCodsList();
334 
338  double m_symbolRate;
339 
344 
349 
354 
359 
364 
369 
374 
379 
384  double m_targetBler;
385 
391 
396 
405 
419 
425  std::string m_defaultModCodStr;
426 
427  std::map<uint32_t, uint32_t> m_shortFramePayloadInSlots;
428  std::map<uint32_t, uint32_t> m_normalFramePayloadInSlots;
429 
434 
439 
444 
449 
454 
459 
463  std::vector<SatEnums::SatModcod_t> m_modCodsUsed;
464 
468  std::string m_modCodsUsedStr;
469 };
470 
471 } // namespace ns3
472 
473 #endif // SATELLITE_BBFRAME_CONF_H
This class implements the BB Frame configurations for DVB-S2.
SatEnums::BbFrameUsageMode_t m_bbFrameUsageMode
BBFrame usage mode.
double GetSymbolRate()
Symbol rate in baud.
uint32_t m_pilotBlockInSymbols
The size of the pilot block in symbols.
double GetBbFrameHighOccupancyThreshold() const
Get configured BB frame high occupancy threshold.
uint32_t GetBbFrameHeaderSizeInBytes() const
Get BB frame header size in bytes.
void GetModCodsList()
Get the list of ModCods from their string representation.
void DumpWaveforms() const
Dump waveform details for debugging purposes.
SatBbFrameConf()
Default constructor.
uint32_t m_symbolsPerSlot
The size of the (data) slot in symbols.
Time CalculateBbFrameDuration(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Calculate the BBFrame duration in Time.
double m_targetBler
Block error rate target for the waveforms.
void InitializeCNoRequirements(Ptr< SatLinkResultsFwd > linkResults)
Initialize the C/No requirements for a given BLER target.
virtual ~SatBbFrameConf()
Destructor for SatBbFrameConf.
double m_bbFrameLowOccupancyThreshold
The BB frame low occupancy threshold in range 0 - 1.
double m_bbFrameHighOccupancyThreshold
The BB frame high occupancy threshold in range 0 - 1.
std::map< uint32_t, uint32_t > m_normalFramePayloadInSlots
SatEnums::SatModcod_t m_defaultModCodDummyFramesS2X
Default MODCOD for DVB-S2X dummy Frames.
bool m_acmEnabled
Flag to indicate whether ACM is enabled or disabled.
static TypeId GetTypeId(void)
Get the type ID.
std::string m_defaultModCodStr
The string representation of default ModCod.
Time GetBbFrameDuration(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Get the BB frame frame duration.
std::vector< SatEnums::SatModcod_t > m_modCodsUsed
List of ModCods used.
bool m_bbFrameS2XPilots
Indicates if using pilots in BBFrames when DVB-S2X is chosen.
double GetBbFrameLowOccupancyThreshold() const
Get configured BB frame low occupancy threshold.
std::map< uint32_t, uint32_t > m_shortFramePayloadInSlots
std::map< std::pair< SatEnums::SatModcod_t, SatEnums::SatBbFrameType_t >, Ptr< SatDvbS2Waveform > > waveformMap_t
Define type waveformMap_t.
uint32_t m_bbFrameHeaderSizeInBytes
The BB frame header size in bytes.
uint32_t m_plHeaderInSlots
The PL header size in slots.
SatEnums::SatModcod_t GetMostRobustModcod(SatEnums::SatBbFrameType_t frameType) const
Get the most robust MODCOD with a given BB frame type.
SatEnums::SatModcod_t m_mostRobustShortFrameModcod
The most robust MODCOD for short frame.
std::string m_defaultModCodDummyFramesS2XStr
String representation of default ModCod for DVB-S2X Dummy Frames.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
SatEnums::DvbVersion_t GetDvbVersion()
Indicates if using DVB-S2 or DVB-S2X.
SatEnums::DvbVersion_t m_dvbVersion
Indicates if using DVB-S2 or DVB-S2X.
uint32_t m_pilotBlockIntervalInSlots
Interval of pilot block in slots.
uint32_t GetBbFramePayloadBits(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Get the BB frame payload in bits.
Time GetDummyBbFrameDuration() const
Get the dummy frame duration in Time.
std::vector< SatEnums::SatModcod_t > GetModCodsUsed()
Get the list of ModCods used.
SatEnums::SatModcod_t GetDefaultModCod() const
Get the default MODCOD.
uint32_t CalculateBbFramePayloadBits(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Calculate the BBrame higher layer payload in bits.
SatEnums::BbFrameUsageMode_t GetBbFrameUsageMode() const
Get configured BB frame usage mode.
SatEnums::SatModcod_t GetBestModcod(double cNo, SatEnums::SatBbFrameType_t frameType) const
Get the best MODCOD with a given BB frame type.
std::string m_modCodsUsedStr
String containing all DVB-S2X ModCods used.
waveformMap_t m_waveforms
Available "waveforms", i.e.
SatEnums::SatModcod_t m_defaultModCod
Default MODCOD is used.
SatEnums::SatModcod_t GetDefaultModCodDummyFramesS2X() const
Get the default MODCOD for short DVB-S2X frames.
SatEnums::SatModcod_t m_mostRobustNormalFrameModcod
The most robust MODCOD for long frame.
double m_symbolRate
Symbol rate in baud.
uint32_t m_dummyFrameInSlots
Dummy BBFrame length in slots.
This class implements the content of one individual DVB-S2 waveform.
SatDvbS2Waveform()
Default constructor for SatDvbS2Waveform.
uint32_t GetPayloadInBits() const
Get payload of this waveform in bits.
double m_cnoRequirement
C/No requirement calculated with a certain BLER target from the link results.
void SetCNoRequirement(double cnoRequirement)
Set the C/No requirement of the waveform in linear domain.
Time GetFrameDuration() const
Get the frame duration in Time.
SatEnums::SatModcod_t m_modcod
MODCOD.
uint32_t m_payloadBits
Payload in bits.
void Dump() const
Dump the contents of the waveform.
SatEnums::SatBbFrameType_t m_frameType
Frame type: short, normal.
double GetCNoRequirement() const
Get C/No requirement corresponding a given BLER target.
Time m_frameDuration
Frame duration in Time.
SatEnums::SatModcod_t GetModcod() const
Get MODCOD of this waveform.
SatEnums::SatBbFrameType_t GetBbFrameType() const
Get BB frame type.
SatBbFrameType_t
BB frame type used in DVB-S2 FWD link.
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
BbFrameUsageMode_t
BBFrame usage modes.
DvbVersion_t
The scheduling algorithm used to fill the BBFrames.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.