22 #include "ns3/applications-module.h"
23 #include "ns3/config-store-module.h"
24 #include "ns3/core-module.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/network-module.h"
27 #include "ns3/satellite-module.h"
28 #include "ns3/traffic-module.h"
39 NS_LOG_COMPONENT_DEFINE(
"sat-iot-example");
42 main(
int argc,
char* argv[])
45 std::string beam =
"8";
47 uint32_t nbUtsPerBeam = 1;
48 uint32_t nbEndUsersPerUt = 1;
50 Time appStartTime = Seconds(0.001);
51 Time simLength = Seconds(60.0);
53 uint32_t queueSize = 50;
54 double maxPowerTerminalW = 0.3;
56 double rtnFeederLinkBaseFrequency = 1.77e+10;
57 double rtnUserLinkBaseFrequency = 2.95e+10;
58 double rtnFeederLinkBandwidth = 4.6848e+6;
59 double frame0_AllocatedBandwidthHz = 2.928e+05;
60 double frame0_CarrierAllocatedBandwidthHz = 2.928e+05;
61 double frame0_CarrierRollOff = 0.22;
62 double frame0_CarrierSpacing = 0;
64 std::string modcodsUsed =
65 "QPSK_1_TO_2 QPSK_3_TO_5 QPSK_2_TO_3 QPSK_3_TO_4 QPSK_4_TO_5 QPSK_5_TO_6 QPSK_8_TO_9 "
67 "8PSK_3_TO_5 8PSK_2_TO_3 8PSK_3_TO_4 8PSK_5_TO_6 8PSK_8_TO_9 8PSK_9_TO_10 "
68 "16APSK_2_TO_3 16APSK_3_TO_4 16APSK_4_TO_5 16APSK_5_TO_6 16APSK_8_TO_9 16APSK_9_TO_10 "
69 "32APSK_3_TO_4 32APSK_4_TO_5 32APSK_5_TO_6 32APSK_8_TO_9";
71 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"sat-iot-example");
75 cmd.AddValue(
"Beam",
"Id of beam used (cannot use multiple beams)", beam);
76 cmd.AddValue(
"NbGw",
"Number of GWs", nbGw);
77 cmd.AddValue(
"NbUtsPerBeam",
"Number of UTs per spot-beam", nbUtsPerBeam);
78 cmd.AddValue(
"NbEndUsersPerUt",
"Number of end users per UT", nbEndUsersPerUt);
79 cmd.AddValue(
"QueueSize",
"Satellite queue sizes in packets", queueSize);
80 cmd.AddValue(
"AppStartTime",
"Applications start time (in seconds, or add unit)", appStartTime);
81 cmd.AddValue(
"SimLength",
"Simulation length (in seconds, or add unit)", simLength);
82 cmd.AddValue(
"MaxPowerTerminalW",
"Maximum power of terminals in W", maxPowerTerminalW);
83 cmd.AddValue(
"RtnFeederLinkBaseFrequency",
84 "Base frequency of the return feeder link band",
85 rtnFeederLinkBaseFrequency);
86 cmd.AddValue(
"RtnUserLinkBaseFrequency",
87 "Base frequency of the return user link band",
88 rtnUserLinkBaseFrequency);
89 cmd.AddValue(
"RtnFeederLinkBandwidth",
90 "Bandwidth of the return feeder link band",
91 rtnFeederLinkBandwidth);
92 cmd.AddValue(
"Frame0_AllocatedBandwidthHz",
93 "The allocated bandwidth [Hz] for frame",
94 frame0_AllocatedBandwidthHz);
95 cmd.AddValue(
"Frame0_CarrierAllocatedBandwidthHz",
96 "The allocated carrier bandwidth [Hz] for frame",
97 frame0_CarrierAllocatedBandwidthHz);
98 cmd.AddValue(
"Frame0_CarrierRollOff",
"The roll-off factor for frame", frame0_CarrierRollOff);
99 cmd.AddValue(
"Frame0_CarrierSpacing",
100 "The carrier spacing factor for frame",
101 frame0_CarrierSpacing);
102 simulationHelper->AddDefaultUiArguments(cmd);
103 cmd.Parse(argc, argv);
105 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
106 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
112 Config::SetDefault(
"ns3::SatConf::FwdUserLinkBandwidth", DoubleValue(2e+08));
113 Config::SetDefault(
"ns3::SatConf::FwdFeederLinkBandwidth", DoubleValue(8e+08));
114 Config::SetDefault(
"ns3::SatConf::FwdCarrierAllocatedBandwidth", DoubleValue(50e+06));
115 Config::SetDefault(
"ns3::SatConf::FwdCarrierRollOff", DoubleValue(0.05));
118 Config::SetDefault(
"ns3::SatBeamHelper::DvbVersion", StringValue(
"DVB_S2"));
119 Config::SetDefault(
"ns3::SatBbFrameConf::ModCodsUsed", StringValue(modcodsUsed));
120 Config::SetDefault(
"ns3::SatBbFrameConf::DefaultModCod", StringValue(
"QPSK_1_TO_2"));
123 Config::SetDefault(
"ns3::SatQueue::MaxPackets", UintegerValue(queueSize));
126 Config::SetDefault(
"ns3::SatUtPhy::TxMaxPowerDbw",
133 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameCount", UintegerValue(1));
134 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
136 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType",
139 Config::SetDefault(
"ns3::SatConf::RtnFeederLinkBaseFrequency",
140 DoubleValue(rtnFeederLinkBaseFrequency));
141 Config::SetDefault(
"ns3::SatConf::RtnUserLinkBaseFrequency",
142 DoubleValue(rtnUserLinkBaseFrequency));
143 Config::SetDefault(
"ns3::SatConf::RtnFeederLinkBandwidth", DoubleValue(rtnFeederLinkBandwidth));
144 Config::SetDefault(
"ns3::SatConf::RtnUserLinkBandwidth",
145 DoubleValue(rtnFeederLinkBandwidth / 4));
147 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_AllocatedBandwidthHz",
148 DoubleValue(frame0_AllocatedBandwidthHz));
149 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierAllocatedBandwidthHz",
150 DoubleValue(frame0_CarrierAllocatedBandwidthHz));
151 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierRollOff",
152 DoubleValue(frame0_CarrierRollOff));
153 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierSpacing",
154 DoubleValue(frame0_CarrierSpacing));
159 simulationHelper->SetSimulationTime(simLength);
161 simulationHelper->SetGwUserCount(nbGw);
162 simulationHelper->SetUtCountPerBeam(nbUtsPerBeam);
163 simulationHelper->SetUserCountPerUt(nbEndUsersPerUt);
164 simulationHelper->SetBeams(beam);
166 simulationHelper->LoadScenario(
"geo-33E");
168 simulationHelper->CreateSatScenario();
170 Ptr<SatHelper> satHelper = simulationHelper->GetSatelliteHelper();
171 Ptr<SatTrafficHelper> trafficHelper = simulationHelper->GetTrafficHelper();
177 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
178 Singleton<SatTopology>::Get()->GetUtUserNodes(),
186 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
187 Singleton<SatTopology>::Get()->GetUtUserNodes(),
211 simulationHelper->EnableProgressLogs();
213 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
214 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
215 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
216 ConfigStore outputConfig;
217 outputConfig.ConfigureDefaults();
219 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
269 simulationHelper->RunSimulation();
@ SUPER_FRAME_CONFIG_0
SUPER_FRAME_CONFIG_0.
@ CONFIG_TYPE_0
Configuration type 0.
static T LinearToDb(T linear)
Converts linear to decibels.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.