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"
41 NS_LOG_COMPONENT_DEFINE(
"sat-dama-onoff-sim-tn9");
44 main(
int argc,
char* argv[])
48 uint32_t endUsersPerUt(1);
49 uint32_t utsPerBeam(220);
50 uint32_t packetSize(1280);
51 double simLength(300.0);
52 Time appStartTime = Seconds(0.1);
54 DataRate dataRate(32000);
59 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
61 Ptr<SimulationHelper> simulationHelper =
62 CreateObject<SimulationHelper>(
"example-dama-onoff-sim-tn9");
65 std::string inputFileNameWithPath =
66 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
67 "/tn9-dama-input-attributes.xml";
116 cmd.AddValue(
"simLength",
"Simulation duration in seconds", simLength);
117 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
118 cmd.AddValue(
"damaConf",
"DAMA configuration", damaConf);
119 cmd.AddValue(
"crTxConf",
"CR transmission configuration", crTxConf);
120 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
121 cmd.Parse(argc, argv);
123 simulationHelper->SetDefaultValues();
126 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
127 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
128 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
129 ConfigStore inputConfig;
130 inputConfig.ConfigureDefaults();
132 simulationHelper->SetUtCountPerBeam(utsPerBeam);
133 simulationHelper->SetUserCountPerUt(endUsersPerUt);
135 simulationHelper->SetBeamSet({beamId});
136 simulationHelper->SetSimulationTime(simLength);
139 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_2"));
140 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
145 Config::SetDefault(
"ns3::SatChannel::EnableExternalFadingInputTrace", BooleanValue(
true));
146 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtFwdDownIndexFileName",
147 StringValue(
"BeamId-1_256_UT_fading_fwddwn_trace_index.txt"));
148 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtRtnUpIndexFileName",
149 StringValue(
"BeamId-1_256_UT_fading_rtnup_trace_index.txt"));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_MinimumServiceRate",
164 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
165 BooleanValue(
false));
170 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
171 BooleanValue(
false));
172 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
173 BooleanValue(
false));
174 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
179 NS_FATAL_ERROR(
"Unsupported damaConf: " << damaConf);
188 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
190 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
195 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
197 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
198 Config::SetDefault(
"ns3::SatUtHelper::UseCrdsaOnlyForControlPackets", BooleanValue(
true));
203 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
205 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
210 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
212 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
213 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
214 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
215 BooleanValue(
false));
216 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
217 BooleanValue(
false));
219 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
221 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
225 NS_FATAL_ERROR(
"Unsupported crTxConf: " << crTxConf);
230 simulationHelper->LoadScenario(
"geo-33E");
233 simulationHelper->CreateSatScenario();
238 simulationHelper->GetTrafficHelper()->AddOnOffTraffic(
243 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
244 Singleton<SatTopology>::Get()->GetUtUserNodes(),
245 "ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]",
246 "ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]",
254 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
279 NS_LOG_INFO(
"--- sat-dama-onoff-sim-tn9 ---");
280 NS_LOG_INFO(
" Packet size: " << packetSize);
281 NS_LOG_INFO(
" Offered data rate: " << dataRate);
282 NS_LOG_INFO(
" Simulation length: " << simLength);
283 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
284 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
304 simulationHelper->EnableProgressLogs();
305 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.