Loading...
Searching...
No Matches
satellite-conf.cc
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#include "satellite-conf.h"
22
23#include "ns3/double.h"
24#include "ns3/enum.h"
25#include "ns3/log.h"
26#include "ns3/satellite-const-variables.h"
27#include "ns3/satellite-env-variables.h"
28#include "ns3/satellite-topology.h"
29#include "ns3/satellite-wave-form-conf.h"
30#include "ns3/simulator.h"
31#include "ns3/singleton.h"
32#include "ns3/string.h"
33
34#include <fstream>
35#include <sstream>
36#include <string>
37#include <utility>
38#include <vector>
39
40NS_LOG_COMPONENT_DEFINE("SatConf");
41
42namespace ns3
43{
44
45NS_OBJECT_ENSURE_REGISTERED(SatConf);
46
47TypeId
49{
50 static TypeId tid =
51 TypeId("ns3::SatConf")
52 .SetParent<Object>()
53 .AddConstructor<SatConf>()
54 .AddAttribute("FwdFeederLinkBandwidth",
55 "Bandwidth of the forward link.",
56 DoubleValue(2.0e9),
57 MakeDoubleAccessor(&SatConf::m_fwdFeederLinkBandwidthHz),
58 MakeDoubleChecker<double>())
59 .AddAttribute("FwdFeederLinkBaseFrequency",
60 "Base frequency of the forward feeder link band.",
61 DoubleValue(27.5e9),
62 MakeDoubleAccessor(&SatConf::m_fwdFeederLinkFreqHz),
63 MakeDoubleChecker<double>())
64 .AddAttribute("RtnFeederLinkBandwidth",
65 "Bandwidth of the return feeder link band.",
66 DoubleValue(2.0e9),
67 MakeDoubleAccessor(&SatConf::m_rtnFeederLinkBandwidthHz),
68 MakeDoubleChecker<double>())
69 .AddAttribute("RtnFeederLinkBaseFrequency",
70 "Base frequency of the return feeder link band.",
71 DoubleValue(17.7e9),
72 MakeDoubleAccessor(&SatConf::m_rtnFeederLinkFreqHz),
73 MakeDoubleChecker<double>())
74 .AddAttribute("FwdUserLinkBandwidth",
75 "Bandwidth of the forward user link band.",
76 DoubleValue(0.5e9),
77 MakeDoubleAccessor(&SatConf::m_fwdUserLinkBandwidthHz),
78 MakeDoubleChecker<double>())
79 .AddAttribute("FwdUserLinkBaseFrequency",
80 "Base frequency of the forward user link band.",
81 DoubleValue(19.7e9),
82 MakeDoubleAccessor(&SatConf::m_fwdUserLinkFreqHz),
83 MakeDoubleChecker<double>())
84 .AddAttribute("RtnUserLinkBandwidth",
85 "Bandwidth of the return user link band.",
86 DoubleValue(0.5e9),
87 MakeDoubleAccessor(&SatConf::m_rtnUserLinkBandwidthHz),
88 MakeDoubleChecker<double>())
89 .AddAttribute("RtnUserLinkBaseFrequency",
90 "Base frequency of the return user link band.",
91 DoubleValue(29.5e9),
92 MakeDoubleAccessor(&SatConf::m_rtnUserLinkFreqHz),
93 MakeDoubleChecker<double>())
94 .AddAttribute("FwdUserLinkChannels",
95 "The number of channels in forward user link",
96 UintegerValue(4),
97 MakeUintegerAccessor(&SatConf::m_fwdUserLinkChannelCount),
98 MakeUintegerChecker<uint32_t>(1))
99 .AddAttribute("RtnUserLinkChannels",
100 "The number of channels in return user link",
101 UintegerValue(4),
102 MakeUintegerAccessor(&SatConf::m_rtnUserLinkChannelCount),
103 MakeUintegerChecker<uint32_t>(1))
104 .AddAttribute("FwdFeederLinkChannels",
105 "The number of channels in forward feeder link",
106 UintegerValue(16),
107 MakeUintegerAccessor(&SatConf::m_fwdFeederLinkChannelCount),
108 MakeUintegerChecker<uint32_t>(1))
109 .AddAttribute("RtnFeederLinkChannels",
110 "The number of channels in return feeder link",
111 UintegerValue(16),
112 MakeUintegerAccessor(&SatConf::m_rtnFeederLinkChannelCount),
113 MakeUintegerChecker<uint32_t>(1))
114 .AddAttribute("SuperFrameConfForSeq0",
115 "Super frame configuration used for super frame sequence 0.",
117 MakeEnumAccessor<SatSuperframeConf::SuperFrameConfiguration_t>(
120 "Configuration_0",
122 "Configuration_1",
124 "Configuration_2",
126 "Configuration_3",
128 "Configuration_4"))
129 .AddAttribute("FwdCarrierAllocatedBandwidth",
130 "The allocated carrier bandwidth for forward link carriers [Hz].",
131 DoubleValue(0.125e9),
133 MakeDoubleChecker<double>())
134 .AddAttribute("FwdCarrierRollOff",
135 "The roll-off factor for forward link carriers.",
136 DoubleValue(0.20),
137 MakeDoubleAccessor(&SatConf::m_fwdCarrierRollOffFactor),
138 MakeDoubleChecker<double>(0.00, 1.00))
139 .AddAttribute("FwdCarrierSpacing",
140 "The carrier spacing factor for forward link carriers.",
141 DoubleValue(0.00),
142 MakeDoubleAccessor(&SatConf::m_fwdCarrierSpacingFactor),
143 MakeDoubleChecker<double>(0.00, 1.00))
144 .AddAttribute("RtnScpcCarrierAllocatedBandwidth",
145 "The allocated carrier bandwidth for SCPC link carriers [Hz].",
146 DoubleValue(0.125e9),
148 MakeDoubleChecker<double>())
149 .AddAttribute("RtnScpcCarrierRollOff",
150 "The roll-off factor for SCPC link carriers.",
151 DoubleValue(0.20),
152 MakeDoubleAccessor(&SatConf::m_rtnCarrierRollOffFactor),
153 MakeDoubleChecker<double>(0.00, 1.00))
154 .AddAttribute("RtnScpcCarrierSpacing",
155 "The carrier spacing factor for SCPC link carriers.",
156 DoubleValue(0.00),
157 MakeDoubleAccessor(&SatConf::m_rtnCarrierSpacingFactor),
158 MakeDoubleChecker<double>(0.00, 1.00))
159 .AddAttribute("ForwardLinkRegenerationMode",
160 "The regeneration mode used in satellites for forward link.",
161 EnumValue(SatEnums::TRANSPARENT),
162 MakeEnumAccessor<SatEnums::RegenerationMode_t>(
164 MakeEnumChecker(SatEnums::TRANSPARENT,
165 "TRANSPARENT",
167 "REGENERATION_PHY",
169 "REGENERATION_NETWORK"))
170 .AddAttribute("ReturnLinkRegenerationMode",
171 "The regeneration mode used in satellites for return link.",
172 EnumValue(SatEnums::TRANSPARENT),
173 MakeEnumAccessor<SatEnums::RegenerationMode_t>(
175 MakeEnumChecker(SatEnums::TRANSPARENT,
176 "TRANSPARENT",
178 "REGENERATION_PHY",
180 "REGENERATION_LINK",
182 "REGENERATION_NETWORK"))
183
184 ;
185 return tid;
186}
187
216
217void
218SatConf::Initialize(std::string rtnConf,
219 std::string fwdConf,
220 std::string gwPos,
221 std::string satPos,
222 std::string utPos,
223 std::string wfConf,
224 bool isConstellation)
225{
226 NS_LOG_FUNCTION(this << rtnConf << fwdConf << gwPos << satPos << utPos << wfConf
227 << isConstellation);
228
229 Singleton<SatTopology>::Get()->SetForwardLinkRegenerationMode(m_forwardLinkRegenerationMode);
230 Singleton<SatTopology>::Get()->SetReturnLinkRegenerationMode(m_returnLinkRegenerationMode);
231
232 m_isConstellation = isConstellation;
233
234 // Load satellite configuration file
235 m_rtnConf = LoadSatConf(rtnConf);
236 m_fwdConf = LoadSatConf(fwdConf);
237
238 NS_ASSERT(m_rtnConf.size() == m_fwdConf.size());
239 m_beamCount = m_rtnConf.size();
240
242
243 // Load GW positions
245
246 // Load satellite position
247 if (!isConstellation)
248 {
250 }
251
252 // Load UT positions
254
255 // Update fwdConf & rtnConf with correct nb of GWs
257 {
258 uint32_t nbGws = m_gwPositions.size();
259 uint32_t gwId;
260 for (uint32_t i = 0; i < m_fwdConf.size(); i++)
261 {
262 gwId = i % nbGws;
263 m_fwdConf[i][GW_ID_INDEX] = gwId + 1;
264 m_rtnConf[i][GW_ID_INDEX] = gwId + 1;
265 }
266 }
267
268 Configure(wfConf);
269}
270
271void
272SatConf::Configure(std::string wfConf)
273{
274 NS_LOG_FUNCTION(this);
275
276 // *** configure forward link ***
277
278 // currently only one carrier in forward link is used.
279 double fwdFeederLinkChannelBandwidthHz =
281 double fwdUserLinkChannelBandwidthHz = m_fwdUserLinkBandwidthHz / m_fwdUserLinkChannelCount;
282
283 // channel bandwidths for the forward feeder and user links is expected to be equal if forward
284 // generation is physical or transparent
285 if ((fwdFeederLinkChannelBandwidthHz != fwdUserLinkChannelBandwidthHz) &&
288 {
289 NS_FATAL_ERROR("Channel bandwidths for forward feeder and user links are not equal!!!");
290 }
291
292 if (m_fwdCarrierAllocatedBandwidthHz > fwdFeederLinkChannelBandwidthHz)
293 {
294 NS_FATAL_ERROR("Fwd Link carrier bandwidth exceeds channel bandwidth!!!");
295 }
296
297 // create forward link carrier configuration and one carrier pushing just one carrier to
298 // container only one carrier supported in forward link currently
299 Ptr<SatFwdCarrierConf> fwdCarrierConf =
300 Create<SatFwdCarrierConf>(m_fwdCarrierAllocatedBandwidthHz,
303 m_forwardLinkCarrierConf.push_back(fwdCarrierConf);
304
305 // create return link carrier configuration and one carrier pushing just one carrier to
306 // container only one carrier supported in return link currently only used for SCPC
307 Ptr<SatFwdCarrierConf> rtnCarrierConf =
308 Create<SatFwdCarrierConf>(m_rtnCarrierAllocatedBandwidthHz,
311 m_returnLinkCarrierConf.push_back(rtnCarrierConf);
312
313 // *** configure return link ***
314
315 double rtnFeederLinkBandwidthHz = m_rtnFeederLinkBandwidthHz / m_rtnFeederLinkChannelCount;
316 double rtnUserLinkBandwidthHz = m_rtnUserLinkBandwidthHz / m_rtnUserLinkChannelCount;
317
318 // bandwidths of the return feeder and user links is expected to be equal if return generation
319 // is physical or transparent
320 if ((rtnFeederLinkBandwidthHz != rtnUserLinkBandwidthHz) &&
323 {
324 NS_FATAL_ERROR("Bandwidths of return feeder and user links are not equal!!!");
325 }
326
327 // Create super frame sequence
328 m_superframeSeq = CreateObject<SatSuperframeSeq>();
329
330 // Create a waveform configuration and add it to super frame sequence.
331 Ptr<SatWaveformConf> waveFormConf = CreateObject<SatWaveformConf>(wfConf);
332 m_superframeSeq->AddWaveformConf(waveFormConf);
333
334 Ptr<SatSuperframeConf> superFrameConf =
336
337 superFrameConf->Configure(rtnUserLinkBandwidthHz,
338 m_superframeSeq->GetTargetDuration(),
339 waveFormConf);
340 m_superframeSeq->AddSuperframe(superFrameConf);
341}
342
343double
344SatConf::GetCarrierFrequencyHz(SatEnums::ChannelType_t chType, uint32_t freqId, uint32_t carrierId)
345{
346 NS_LOG_FUNCTION(this << chType << freqId << carrierId);
347
348 double centerFrequencyHz = 0.0;
349 double baseFreqHz = 0.0;
350 double channelBandwidthHz = 0.0;
351 double carrierBandwidthHz = 0.0;
352
353 switch (chType)
354 {
356 if (carrierId >= m_forwardLinkCarrierConf.size())
357 {
358 NS_FATAL_ERROR("Fwd Carrier id out of the range!!");
359 }
360
362 carrierBandwidthHz = m_forwardLinkCarrierConf[carrierId]->GetAllocatedBandwidthInHz();
363 baseFreqHz = m_fwdFeederLinkFreqHz + (channelBandwidthHz * (freqId - 1));
364 centerFrequencyHz =
365 baseFreqHz + (carrierBandwidthHz * carrierId) + (carrierBandwidthHz / 2);
366 break;
367
369 if (carrierId >= m_forwardLinkCarrierConf.size())
370 {
371 NS_FATAL_ERROR("Fwd Carrier id out of the range!!");
372 }
373
375 carrierBandwidthHz = m_forwardLinkCarrierConf[carrierId]->GetAllocatedBandwidthInHz();
376 baseFreqHz = m_fwdUserLinkFreqHz + (channelBandwidthHz * (freqId - 1));
377 centerFrequencyHz =
378 baseFreqHz + (carrierBandwidthHz * carrierId) + (carrierBandwidthHz / 2);
379 break;
380
383 baseFreqHz = m_rtnFeederLinkFreqHz + (channelBandwidthHz * (freqId - 1));
384 centerFrequencyHz = baseFreqHz + m_superframeSeq->GetCarrierFrequencyHz(carrierId);
385 break;
386
389 baseFreqHz = m_rtnUserLinkFreqHz + (channelBandwidthHz * (freqId - 1));
390 centerFrequencyHz = baseFreqHz + m_superframeSeq->GetCarrierFrequencyHz(carrierId);
391 break;
392
393 default:
394 NS_ASSERT(false);
395 break;
396 }
397
398 return centerFrequencyHz;
399}
400
401double
403 uint32_t carrierId,
405{
406 NS_LOG_FUNCTION(this << chType << carrierId << bandwidthType);
407
408 double carrierBandwidthHz = 0.0;
409
410 switch (chType)
411 {
413 carrierBandwidthHz = GetFwdLinkCarrierBandwidthHz(carrierId, bandwidthType);
414 break;
415
417 carrierBandwidthHz = GetFwdLinkCarrierBandwidthHz(carrierId, bandwidthType);
418 break;
419
421 carrierBandwidthHz = m_superframeSeq->GetCarrierBandwidthHz(carrierId, bandwidthType);
424 {
425 carrierBandwidthHz = GetRtnLinkCarrierBandwidthHz(0, bandwidthType);
426 }
427 break;
428
430 carrierBandwidthHz = m_superframeSeq->GetCarrierBandwidthHz(carrierId, bandwidthType);
431 break;
432
433 default:
434 NS_ASSERT(false);
435 break;
436 }
437
438 return carrierBandwidthHz;
439}
440
441std::ifstream*
442SatConf::OpenFile(std::string filePathName) const
443{
444 NS_LOG_FUNCTION(this << filePathName);
445
446 // READ FROM THE SPECIFIED INPUT FILE
447 std::ifstream* ifs = new std::ifstream(filePathName.c_str(), std::ifstream::in);
448
449 if (!ifs->is_open())
450 {
451 // script might be launched by test.py, try a different base path
452 delete ifs;
453 filePathName = "../../" + filePathName;
454 ifs = new std::ifstream(filePathName.c_str(), std::ifstream::in);
455
456 if (!ifs->is_open())
457 {
458 NS_FATAL_ERROR("The file " << filePathName << " is not found.");
459 }
460 }
461 return ifs;
462}
463
464std::vector<std::vector<uint32_t>>
465SatConf::LoadSatConf(std::string filePathName) const
466{
467 NS_LOG_FUNCTION(this << filePathName);
468
469 std::vector<std::vector<uint32_t>> conf;
470
471 // READ FROM THE SPECIFIED INPUT FILE
472 std::ifstream* ifs = OpenFile(filePathName);
473
474 uint32_t beamId, userChannelId, gwId, feederChannelId;
475 *ifs >> beamId >> userChannelId >> gwId >> feederChannelId;
476
477 while (ifs->good())
478 {
479 NS_LOG_DEBUG(this << " beamId = " << beamId << ", userChannelId = " << userChannelId
480 << ", gwId = " << gwId << ", feederChannelId = " << feederChannelId);
481
482 // Store the values
483 std::vector<uint32_t> beamConf;
484
485 beamConf.push_back(beamId);
486 beamConf.push_back(userChannelId);
487 beamConf.push_back(gwId);
488 beamConf.push_back(feederChannelId);
489
490 conf.push_back(beamConf);
491
492 // get next row
493 *ifs >> beamId >> userChannelId >> gwId >> feederChannelId;
494 }
495
496 ifs->close();
497 delete ifs;
498
499 return conf;
500}
501
502void
503SatConf::SetUtPositionsPath(std::string inputFileUtListPositions)
504{
505 NS_LOG_FUNCTION(this << inputFileUtListPositions);
506
507 // Load UT positions
508 LoadPositions(inputFileUtListPositions, m_utPositions);
509}
510
511void
512SatConf::LoadPositions(std::string filePathName, PositionContainer_t& container)
513{
514 NS_LOG_FUNCTION(this << filePathName);
515
516 // READ FROM THE SPECIFIED INPUT FILE
517 std::ifstream* ifs = OpenFile(filePathName);
518
519 double lat, lon, alt;
520 *ifs >> lat >> lon >> alt;
521
522 while (ifs->good())
523 {
524 NS_LOG_DEBUG(this << " latitude [deg] = " << lat << ", longitude [deg] = " << lon
525 << ", altitude [m] = ");
526
527 // Store the values
528 GeoCoordinate coord(lat, lon, alt);
529 container.push_back(coord);
530
531 // get next row
532 *ifs >> lat >> lon >> alt;
533 }
534
535 ifs->close();
536 delete ifs;
537}
538
539std::vector<std::string>
540SatConf::LoadTles(std::string filePathName, std::string startDatePathName)
541{
542 NS_LOG_FUNCTION(this << filePathName);
543
544 // READ START TIME
545 std::ifstream* ifs = OpenFile(startDatePathName);
546
547 std::getline(*ifs, m_startTimeStr);
548
549 ifs->close();
550
551 // READ TLE
552 std::vector<std::string> tles;
553
554 ifs = OpenFile(filePathName);
555
556 double size;
557 uint32_t i = 0;
558 std::string firstLine;
559 std::getline(*ifs, firstLine);
560 std::istringstream iss(firstLine);
561 iss >> size;
562
563 tles.reserve(size);
564
565 while (ifs->good() && i < size)
566 {
567 std::string tle;
568 std::string name;
569 std::string line1;
570 std::string line2;
571
572 std::getline(*ifs, name);
573 std::getline(*ifs, line1);
574 std::getline(*ifs, line2);
575
576 tle = line1 + '\n' + line2;
577 tles.push_back(tle);
578
579 i += 1;
580 }
581
582 NS_ASSERT(tles.size() < SatConstVariables::MAX_SATELLITES);
583
584 ifs->close();
585 delete ifs;
586
587 m_tles = tles;
588
589 return tles;
590}
591
592std::vector<std::pair<uint32_t, uint32_t>>
593SatConf::LoadIsls(std::string filePathName)
594{
595 NS_LOG_FUNCTION(this << filePathName);
596
597 std::vector<std::pair<uint32_t, uint32_t>> isls;
598
599 // READ FROM THE SPECIFIED INPUT FILE
600 std::ifstream* ifs = OpenFile(filePathName);
601
602 double size;
603 uint32_t i = 0;
604 std::string firstLine;
605 std::getline(*ifs, firstLine);
606 std::istringstream iss(firstLine);
607 iss >> size;
608
609 isls.reserve(size);
610
611 while (ifs->good() && i < size)
612 {
613 std::string line;
614 std::string sat1;
615 std::string sat2;
616
617 std::getline(*ifs, line);
618
619 std::stringstream ss(line);
620 ss >> sat1;
621 ss >> sat2;
622
623 isls.push_back(std::make_pair(std::stoi(sat1), std::stoi(sat2)));
624
625 i += 1;
626 }
627
628 ifs->close();
629 delete ifs;
630
631 return isls;
632}
633
634uint32_t
636{
637 NS_LOG_FUNCTION(this);
638
639 return m_beamCount;
640}
641
642uint32_t
644{
645 NS_LOG_FUNCTION(this);
646
647 return m_gwPositions.size();
648}
649
650uint32_t
652{
653 NS_LOG_FUNCTION(this);
654
655 return m_utPositions.size();
656}
657
658uint32_t
660{
661 NS_LOG_FUNCTION(this);
662
664 {
665 return m_tles.size();
666 }
667 else
668 {
669 return m_satPosition.size();
670 }
671}
672
673std::vector<uint32_t>
675{
676 NS_LOG_FUNCTION(this);
677 NS_ASSERT((beamId > 0) && (beamId <= m_beamCount));
678
679 return (dir == SatEnums::LD_RETURN) ? m_rtnConf[beamId - 1] : m_fwdConf[beamId - 1];
680}
681
682uint32_t
684{
685 NS_LOG_FUNCTION(this);
686
687 return m_superframeSeq->GetCarrierCount();
688}
689
690uint32_t
692{
693 NS_LOG_FUNCTION(this);
694
695 return m_forwardLinkCarrierConf.size();
696}
697
698double
700 SatEnums::CarrierBandwidthType_t bandwidthType) const
701{
702 NS_LOG_FUNCTION(this);
703
704 double bandwidtHz = 0.0;
705
706 if (carrierId >= m_forwardLinkCarrierConf.size())
707 {
708 NS_FATAL_ERROR("Fwd Carrier id out of the range!!");
709 }
710
711 switch (bandwidthType)
712 {
714 bandwidtHz = m_forwardLinkCarrierConf[carrierId]->GetAllocatedBandwidthInHz();
715 break;
716
718 bandwidtHz = m_forwardLinkCarrierConf[carrierId]->GetOccupiedBandwidthInHz();
719 break;
720
722 bandwidtHz = m_forwardLinkCarrierConf[carrierId]->GetEffectiveBandwidthInHz();
723 break;
724
725 default:
726 NS_FATAL_ERROR("Invalid bandwidth type");
727 break;
728 }
729
730 return bandwidtHz;
731}
732
733double
735 SatEnums::CarrierBandwidthType_t bandwidthType) const
736{
737 NS_LOG_FUNCTION(this);
738
739 double bandwidtHz = 0.0;
740
741 if (carrierId >= m_returnLinkCarrierConf.size())
742 {
743 NS_FATAL_ERROR("Rtn Carrier id out of the range!!");
744 }
745
746 switch (bandwidthType)
747 {
749 bandwidtHz = m_returnLinkCarrierConf[carrierId]->GetAllocatedBandwidthInHz();
750 break;
751
753 bandwidtHz = m_returnLinkCarrierConf[carrierId]->GetOccupiedBandwidthInHz();
754 break;
755
757 bandwidtHz = m_returnLinkCarrierConf[carrierId]->GetEffectiveBandwidthInHz();
758 break;
759
760 default:
761 NS_FATAL_ERROR("Invalid bandwidth type");
762 break;
763 }
764
765 return bandwidtHz;
766}
767
769SatConf::GetGwPosition(uint32_t gwId) const
770{
771 NS_LOG_FUNCTION(this);
772 NS_ASSERT((gwId > 0) && (gwId <= m_gwPositions.size()));
773
774 return m_gwPositions[gwId - 1];
775}
776
778SatConf::GetUtPosition(uint32_t utId) const
779{
780 NS_LOG_FUNCTION(this);
781 NS_ASSERT((utId > 0) && (utId <= m_utPositions.size()));
782
783 return m_utPositions[utId - 1];
784}
785
788{
789 NS_LOG_FUNCTION(this);
790 NS_ASSERT(m_satPosition.size() == 1);
791
792 return m_satPosition[0];
793}
794
795std::string
797{
798 NS_LOG_FUNCTION(this);
799
800 return m_startTimeStr;
801}
802
803} // namespace ns3
GeoCoordinate class is used to store and operate with geodetic coordinates.
A configuration class for the satellite reference system.
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.
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.
SatConf()
Default constructor.
uint32_t m_rtnUserLinkChannelCount
std::string GetStartTimeStr() const
Get the simulation start time for scenarios using SGP4 model.
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.
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.
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.
std::vector< GeoCoordinate > PositionContainer_t
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.
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,...
SatEnums class is for simplifying the use of enumerators in the satellite module.
SatLinkDir_t
Link direction used for packet tracing.
ChannelType_t
Types of channel.
CarrierBandwidthType_t
Types of bandwidth.
This abstract class defines and implements interface of configuration for super frames.
@ SUPER_FRAME_CONFIG_0
SUPER_FRAME_CONFIG_0.
@ SUPER_FRAME_CONFIG_3
SUPER_FRAME_CONFIG_3.
@ SUPER_FRAME_CONFIG_4
SUPER_FRAME_CONFIG_4.
@ SUPER_FRAME_CONFIG_1
SUPER_FRAME_CONFIG_1.
@ SUPER_FRAME_CONFIG_2
SUPER_FRAME_CONFIG_2.
static Ptr< SatSuperframeConf > CreateSuperframeConf(SuperFrameConfiguration_t conf)
Create pre-configured super frame configuration-.
constexpr uint32_t MAX_BEAMS_PER_SATELLITE
Maximum number of beams per satellite.
constexpr uint32_t MAX_SATELLITES
Maximum number of satellites in constellation.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.