Loading...
Searching...
No Matches
satellite-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 SAT_CONF_H
22#define SAT_CONF_H
23
24#include "ns3/geo-coordinate.h"
25#include "ns3/object.h"
26#include "ns3/satellite-channel.h"
27#include "ns3/satellite-fwd-carrier-conf.h"
28#include "ns3/satellite-superframe-sequence.h"
29#include "ns3/uinteger.h"
30
31#include <fstream>
32#include <set>
33#include <stdint.h>
34#include <string>
35#include <utility>
36#include <vector>
37
38namespace ns3
39{
40
45class SatConf : public Object
46{
47 public:
51 SatConf();
52
53 virtual ~SatConf()
54 {
55 }
56
61 static TypeId GetTypeId(void);
62
63 inline Ptr<SatSuperframeSeq> GetSuperframeSeq()
64 {
65 return m_superframeSeq;
66 }
67
78 void Initialize(std::string rtnConf,
79 std::string fwdConf,
80 std::string gwPos,
81 std::string satPos,
82 std::string utPos,
83 std::string wfConf,
84 bool isConstellation = false);
85
90 std::ifstream* OpenFile(std::string filePathName) const;
91
97 std::vector<std::vector<uint32_t>> LoadSatConf(std::string filePathName) const;
98
103 void SetUtPositionsPath(std::string inputFileUtListPositions);
104
110 uint32_t GetBeamCount() const;
111
118 std::vector<uint32_t> GetBeamConfiguration(uint32_t beamId, SatEnums::SatLinkDir_t dir) const;
119
123 uint32_t GetRtnLinkCarrierCount() const;
124
130 uint32_t GetGwCount() const;
131
137 uint32_t GetUtCount() const;
138
144 uint32_t GetSatCount() const;
145
153 GeoCoordinate GetGwPosition(uint32_t gwId) const;
154
162 GeoCoordinate GetUtPosition(uint32_t utId) const;
163
170
176 std::string GetStartTimeStr() const;
177
187 uint32_t freqId,
188 uint32_t carrierId);
189
199 uint32_t carrierId,
201
205 uint32_t GetFwdLinkCarrierCount() const;
206
213 std::vector<std::string> LoadTles(std::string filePathName, std::string startDatePathName);
214
221 std::vector<std::pair<uint32_t, uint32_t>> LoadIsls(std::string filePathName);
222
226 static const uint32_t BEAM_ID_INDEX = 0;
227
231 static const uint32_t U_FREQ_ID_INDEX = 1;
232
236 static const uint32_t GW_ID_INDEX = 2;
237
241 static const uint32_t F_FREQ_ID_INDEX = 3;
242 static const uint32_t BEAM_ELEM_COUNT = 4;
243
244 private:
245 typedef std::vector<GeoCoordinate> PositionContainer_t;
246
247 /*
248 * Columns:
249 * 1. Beam id
250 * 2. User frequency id
251 * 3. GW id
252 * 4. Feeder frequency id
253 */
254 std::vector<std::vector<uint32_t>> m_rtnConf;
255 std::vector<std::vector<uint32_t>> m_fwdConf;
256
261
265 uint32_t m_beamCount;
266
271
276
281
285 std::vector<std::string> m_tles;
286
290 std::string m_startTimeStr;
291
298 Ptr<SatSuperframeSeq> m_superframeSeq;
299
306 std::vector<Ptr<SatFwdCarrierConf>> m_forwardLinkCarrierConf;
307
314 std::vector<Ptr<SatFwdCarrierConf>> m_returnLinkCarrierConf;
315
320
325
330
335
340
345
350
355
365
370
375
380
385
390
395
400
405
410
418 double GetFwdLinkCarrierBandwidthHz(uint32_t carrierId,
419 SatEnums::CarrierBandwidthType_t bandwidthType) const;
420
428 double GetRtnLinkCarrierBandwidthHz(uint32_t carrierId,
429 SatEnums::CarrierBandwidthType_t bandwidthType) const;
430
435 void Configure(std::string wfConf);
436
444 uint32_t GetSuperframeCarrierId(uint32_t carrierId, uint32_t* seqId);
445
452 uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId);
453
459 void LoadPositions(std::string filePathName, PositionContainer_t& container);
460};
461
462} // namespace ns3
463
464#endif /* SAT_CONF_H */
GeoCoordinate class is used to store and operate with geodetic coordinates.
uint32_t m_beamCount
Beam count.
double GetCarrierBandwidthHz(SatEnums::ChannelType_t chType, uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType)
Convert carrier id and sequence id to to bandwidth value.
std::vector< uint32_t > GetBeamConfiguration(uint32_t beamId, SatEnums::SatLinkDir_t dir) const
Get the configuration vector for a given satellite beam id.
Ptr< SatSuperframeSeq > GetSuperframeSeq()
uint32_t m_fwdFeederLinkChannelCount
GeoCoordinate GetUtPosition(uint32_t utId) const
Get the position of the GW for a given UT id.
double m_rtnUserLinkBandwidthHz
Bandwidth of return user link.
uint32_t m_rtnFeederLinkChannelCount
uint32_t GetSatCount() const
Get count of the SATs (positions).
void Initialize(std::string rtnConf, std::string fwdConf, std::string gwPos, std::string satPos, std::string utPos, std::string wfConf, bool isConstellation=false)
Initialize the configuration.
double m_fwdCarrierAllocatedBandwidthHz
The configured allocated bandwidth for forward link carriers.
uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId)
SatConf()
Default constructor.
uint32_t m_rtnUserLinkChannelCount
std::string GetStartTimeStr() const
Get the simulation start time for scenarios using SGP4 model.
uint32_t GetSuperframeCarrierId(uint32_t carrierId, uint32_t *seqId)
PositionContainer_t m_utPositions
Geodetic positions of the UTs.
static const uint32_t GW_ID_INDEX
Definition for GW ID index (column) in m_conf.
double GetRtnLinkCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get bandwidth of the return link carrier.
uint32_t GetRtnLinkCarrierCount() const
std::vector< std::pair< uint32_t, uint32_t > > LoadIsls(std::string filePathName)
Load a vector of ISLs from a file.
double m_rtnCarrierSpacingFactor
The configured carrier spacing factor for return link carriers.
SatSuperframeConf::SuperFrameConfiguration_t m_SuperFrameConfForSeq0
The super frame configuration used for sequence 0.
double m_fwdFeederLinkFreqHz
Base frequency of forward feeder link.
std::vector< std::string > m_tles
TLE information for a satellite constellation.
std::vector< Ptr< SatFwdCarrierConf > > m_returnLinkCarrierConf
Return link carrier configuration for SCPC.
double m_fwdCarrierRollOffFactor
The configured carrier roll-off factor for forward link carriers.
std::ifstream * OpenFile(std::string filePathName) const
Try to open a file from a given path.
double m_rtnFeederLinkFreqHz
Base frequency of return feeder link.
uint32_t GetBeamCount() const
Get count of the beams (configurations).
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
The regeneration mode used in satellites for return link.
static const uint32_t BEAM_ID_INDEX
Definition for beam ID index (column) in m_conf.
uint32_t GetGwCount() const
Get count of the GWs (positions).
double m_rtnCarrierAllocatedBandwidthHz
The configured allocated bandwidth for return link carriers.
double m_rtnCarrierRollOffFactor
The configured carrier roll-off factor for return link carriers.
std::string m_startTimeStr
Start time of simulation, on format "YYYY-MM-DD hh:mm:ss".
void Configure(std::string wfConf)
Configures itself with default values.
double m_rtnFeederLinkBandwidthHz
Bandwidth of return feeder link.
GeoCoordinate GetGwPosition(uint32_t gwId) const
Get the position of the GW for a given GW id.
double GetCarrierFrequencyHz(SatEnums::ChannelType_t chType, uint32_t freqId, uint32_t carrierId)
Convert carrier id, sequency id and frequency id to real frequency value.
double m_rtnUserLinkFreqHz
Base frequency of return user link.
double GetFwdLinkCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get bandwidth of the forward link carrier.
GeoCoordinate GetSatPosition() const
Get the position of the Satellite.
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
The regeneration mode used in satellites for forward link.
static TypeId GetTypeId(void)
Get the type ID.
double m_fwdUserLinkBandwidthHz
Bandwidth of forward user link.
std::vector< std::vector< uint32_t > > m_fwdConf
double m_fwdFeederLinkBandwidthHz
Bandwidth of forward feeder link.
PositionContainer_t m_gwPositions
Geodetic positions of the GWs.
static const uint32_t U_FREQ_ID_INDEX
Definition for user frequency ID index (column) in m_conf.
std::vector< std::vector< uint32_t > > LoadSatConf(std::string filePathName) const
Load satellite configuration from a file.
double m_fwdUserLinkFreqHz
Base frequency of forward user link.
uint32_t GetFwdLinkCarrierCount() const
Ptr< SatSuperframeSeq > m_superframeSeq
Superframe sequence configuration.
virtual ~SatConf()
std::vector< GeoCoordinate > PositionContainer_t
static const uint32_t BEAM_ELEM_COUNT
void LoadPositions(std::string filePathName, PositionContainer_t &container)
Load node positions from a file.
std::vector< std::vector< uint32_t > > m_rtnConf
PositionContainer_t m_satPosition
Geodetic positions of the Satellite.
std::vector< std::string > LoadTles(std::string filePathName, std::string startDatePathName)
Load a vector of TLE information from a file.
double m_fwdCarrierSpacingFactor
The configured carrier spacing factor for forward link carriers.
static const uint32_t F_FREQ_ID_INDEX
Definition for feeder frequency ID index (column) in m_conf.
void SetUtPositionsPath(std::string inputFileUtListPositions)
Update the list of positions.
bool m_isConstellation
Indicates with this is a constellation of satellites.
uint32_t GetUtCount() const
Get count of the UTs (positions).
std::vector< Ptr< SatFwdCarrierConf > > m_forwardLinkCarrierConf
Forward link carrier configuration.
uint32_t m_fwdUserLinkChannelCount
The number of the channels in different satellite links: forward user, return user,...
SatLinkDir_t
Link direction used for packet tracing.
ChannelType_t
Types of channel.
CarrierBandwidthType_t
Types of bandwidth.
RegenerationMode_t
The regeneration mode used in satellites.
SuperFrameConfiguration_t
Configurable Super Frames.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.