Loading...
Searching...
No Matches
satellite-wave-form-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: Sami Rantanen <sami.rantanen@magister.fi>
19 */
20
21#ifndef SATELLITE_WAVE_FORM_CONF_H
22#define SATELLITE_WAVE_FORM_CONF_H
23
24#include "satellite-enums.h"
25
26#include "ns3/nstime.h"
27#include "ns3/object.h"
28#include "ns3/ptr.h"
29#include "ns3/simple-ref-count.h"
30
31#include <map>
32#include <stdint.h>
33#include <string>
34#include <vector>
35
36namespace ns3
37{
38
40
50class SatWaveform : public SimpleRefCount<SatWaveform>
51{
52 public:
57
68 SatWaveform(uint32_t wfId,
69 uint32_t modulatedBits,
70 double codingRate,
72 uint32_t payloadBytes,
73 uint32_t lengthInSymbols,
74 uint32_t preambleLengthInSymbols);
75
80 uint32_t GetWaveformId() const;
81
87
92 uint32_t GetPayloadInBytes() const;
93
98 uint32_t GetPreambleLengthInSymbols() const;
99
104 uint32_t GetBurstLengthInSymbols() const;
105
111 Time GetPreambleDuration(double symbolRateInBaud) const;
112
118 Time GetBurstDuration(double symbolRateInBaud) const;
119
126 double GetSpectralEfficiency(double carrierBandwidthInHz, double symbolRateInBaud) const;
127
133 double GetThroughputInBitsPerSecond(double symbolRateInBaud) const;
134
140 double GetCNoThreshold(double symbolRateInBaud) const;
141
147 void SetEbNoRequirement(double ebnoRequirement);
148
155 void Dump(double carrierBandwidthInHz, double symbolRateInBaud) const;
156
157 private:
161 uint32_t m_waveformId;
162
170
175
180
185
190
195
201};
202
212class SatWaveformConf : public Object
213{
214 public:
218 typedef std::vector<uint32_t> BurstLengthContainer_t;
219
224
229 SatWaveformConf(std::string directoryPathName);
230
239 virtual void NotifyConstructionCompleted() override;
240
244 virtual ~SatWaveformConf();
245
249 static TypeId GetTypeId(void);
250
254 inline bool IsAcmEnabled() const
255 {
256 return m_acmEnabled;
257 }
258
264 void InitializeEbNoRequirements(Ptr<SatLinkResultsRtn> linkResults);
265
271 Ptr<SatWaveform> GetWaveform(uint32_t wfId) const;
272
278 SatEnums::SatModcod_t GetModCod(uint32_t wfId) const;
279
284 uint32_t GetDefaultWaveformId() const;
285
290 inline uint32_t GetDefaultBurstLength() const
291 {
292 return GetWaveform(m_defaultWfId)->GetBurstLengthInSymbols();
293 }
294
303
313 bool GetBestWaveformId(double cno,
314 double symbolRateInBaud,
315 uint32_t& wfId,
316 double& cnoThreshold,
317 uint32_t burstLength = SHORT_BURST_LENGTH) const;
318
325 bool GetMostRobustWaveformId(uint32_t& wfId, uint32_t burstLength = SHORT_BURST_LENGTH) const;
326
333 void Dump(double carrierBandwidthInHz, double symbolRateInBaud) const;
334
339 inline uint32_t GetMinWfId()
340 {
341 return m_minWfId;
342 }
343
348 inline uint32_t GetMaxWfId()
349 {
350 return m_maxWfId;
351 }
352
356 static const uint32_t SHORT_BURST_LENGTH = 536;
357
361 static const uint32_t LONG_BURST_LENGTH = 1616;
362
363 private:
368 void ReadFromFileDefaultWaveform(std::string filePathName);
369
374 void ReadFromFile(std::string filePathName);
375
383 SatEnums::SatModcod_t ConvertToModCod(uint32_t modulatedBits,
384 uint32_t codingRateNumerator,
385 uint32_t codingRateDenominator) const;
386
390 std::map<uint32_t, Ptr<SatWaveform>> m_waveforms;
391
397
403
408
413 uint32_t m_minWfId;
414 uint32_t m_maxWfId;
415
420
425};
426
427} // namespace ns3
428
429#endif // SATELLITE_WAVE_FORM_CONF_H
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
SatWaveFormBurstLength_t
Definition for different types of Capacity Request (CR) messages.
virtual ~SatWaveformConf()
Destructor for SatWaveformConf.
bool GetMostRobustWaveformId(uint32_t &wfId, uint32_t burstLength=SHORT_BURST_LENGTH) const
Get the most robust waveform id based payload of the waveform in bytes.
uint32_t m_defaultWfId
Default waveform id.
Ptr< SatWaveform > GetWaveform(uint32_t wfId) const
Get the details of a certain waveform.
uint32_t GetMaxWfId()
Get maximum supported waveform id return Maximum waveform id.
void Dump(double carrierBandwidthInHz, double symbolRateInBaud) const
Dump the contents of the waveform.
std::vector< uint32_t > BurstLengthContainer_t
Define BurstLengthContainer.
bool IsAcmEnabled() const
Check if ACM is enabled.
void ReadFromFile(std::string filePathName)
Read the waveform table from a file.
SatEnums::SatWaveFormBurstLength_t m_burstLength
Burst length used.
const BurstLengthContainer_t & GetSupportedBurstLengths() const
Get supported burst lengths.
uint32_t GetMinWfId()
Get minimum supported waveform id return Minimum waveform id.
bool GetBestWaveformId(double cno, double symbolRateInBaud, uint32_t &wfId, double &cnoThreshold, uint32_t burstLength=SHORT_BURST_LENGTH) const
Get the best waveform id based on UT's C/No and C/No thresholds.
std::map< uint32_t, Ptr< SatWaveform > > m_waveforms
Container of the waveforms.
static const uint32_t LONG_BURST_LENGTH
Static variable defining long burst length.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
BurstLengthContainer_t m_supportedBurstLengthsInSymbols
Container to store supported burst lengths.
SatEnums::SatModcod_t GetModCod(uint32_t wfId) const
Get MODCOD enum corresponding to a waveform id.
void InitializeEbNoRequirements(Ptr< SatLinkResultsRtn > linkResults)
Initialize the Eb/No requirements of the waveforms based on the used return link results.
double m_targetBLER
Block error rate target for the waveforms.
bool m_acmEnabled
Flag to indicate whether ACM is enabled or disabled.
void ReadFromFileDefaultWaveform(std::string filePathName)
Read the default waveform ID from a file.
static const uint32_t SHORT_BURST_LENGTH
Static variable defining short burst length.
uint32_t GetDefaultWaveformId() const
Get default waveform id.
uint32_t GetDefaultBurstLength() const
Get default burst length.
static TypeId GetTypeId(void)
Derived from Object.
SatWaveformConf()
Default constructor, which is not to be used.
SatEnums::SatModcod_t ConvertToModCod(uint32_t modulatedBits, uint32_t codingRateNumerator, uint32_t codingRateDenominator) const
Convert modulated bits and coding rate to a MODCOD enum.
uint32_t m_minWfId
Minimum and maximum waveform ids.
void SetEbNoRequirement(double ebnoRequirement)
Set the Eb/No requirement of the waveform in linear domain based on the used link results.
SatWaveform()
Default constructor for SatWaveform.
uint32_t m_payloadBytes
Payload in bytes.
uint32_t m_lengthInSymbols
Length of the burst in symbols.
double m_codingRate
Coding rate.
double m_ebnoRequirement
Eb/No threshold calculated with a certain BLER target from the link results.
uint32_t GetWaveformId() const
Get waveform id.
double GetCNoThreshold(double symbolRateInBaud) const
Get the C/No threshold of the waveform in linear domain.
SatEnums::SatModcod_t m_modCod
MODCOD enum.
uint32_t GetBurstLengthInSymbols() const
Get burst length of the waveform in symbols.
SatEnums::SatModcod_t GetModCod() const
Get MODCOD enum.
Time GetBurstDuration(double symbolRateInBaud) const
Get/calculate the burst duration of a waveform based on symbol rate.
Time GetPreambleDuration(double symbolRateInBaud) const
Get/calculate the preamble duration of a waveform based on symbol rate.
double GetSpectralEfficiency(double carrierBandwidthInHz, double symbolRateInBaud) const
Get/calculate the spectral efficiency of a waveform.
uint32_t GetPreambleLengthInSymbols() const
Get preamble length of the waveform in symbols.
uint32_t GetPayloadInBytes() const
Get payload of a waveform in bytes.
double GetThroughputInBitsPerSecond(double symbolRateInBaud) const
Get/calculate the throughput of a waveform based on symbol rate.
void Dump(double carrierBandwidthInHz, double symbolRateInBaud) const
Dump the contents of the waveform.
uint32_t m_waveformId
Id of this waveform.
uint32_t m_modulatedBits
Modulated bits QPSK = 2 8PSK = 3 16QAM = 4.
uint32_t m_preambleLengthInSymbols
Length of the preamble in symbols.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.