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"
44 NS_LOG_COMPONENT_DEFINE(
"sat-per-packet-if-sim-tn9");
47 main(
int argc,
char* argv[])
49 uint32_t endUsersPerUt(1);
50 uint32_t utsPerBeam(220);
51 DataRate dataRate(32000);
53 uint32_t fadingConf(0);
55 uint32_t packetSize(1280);
56 double simLength(50.0);
57 Time appStartTime = Seconds(0.1);
60 auto simulationHelper = CreateObject<SimulationHelper>(
"example-per-packet-if-sim-tn9");
61 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
64 std::string pathToFile = Singleton<SatEnvVariables>::Get()->LocateFile(
65 "contrib/satellite/examples/tn9-dama-input-attributes.xml");
104 cmd.AddValue(
"simLength",
"Simulation duration in seconds", simLength);
105 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
106 cmd.AddValue(
"beamConf",
"Beam configuration", beamConf);
107 cmd.AddValue(
"fadingConf",
"Fading configuration (0: Markov, 1: Rain)", fadingConf);
108 simulationHelper->AddDefaultUiArguments(cmd, pathToFile);
109 cmd.Parse(argc, argv);
111 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(pathToFile));
112 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
113 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
115 ConfigStore inputConfig;
116 inputConfig.ConfigureDefaults();
119 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_2"));
120 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
123 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
124 BooleanValue(
false));
125 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed", BooleanValue(
true));
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_MinimumServiceRate",
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
129 BooleanValue(
false));
131 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
134 Config::SetDefault(
"ns3::SatUtHelper::DaFwdLinkInterferenceModel",
136 Config::SetDefault(
"ns3::SatOrbiterHelper::DaFwdLinkInterferenceModel",
138 Config::SetDefault(
"ns3::SatOrbiterHelper::DaRtnLinkInterferenceModel",
140 Config::SetDefault(
"ns3::SatGwHelper::DaRtnLinkInterferenceModel",
156 Config::SetDefault(
"ns3::SatChannel::EnableExternalFadingInputTrace", BooleanValue(
true));
157 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtFwdDownIndexFileName",
158 StringValue(
"BeamId-1_256_UT_fading_fwddwn_trace_index.txt"));
159 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtRtnUpIndexFileName",
160 StringValue(
"BeamId-1_256_UT_fading_rtnup_trace_index.txt"));
165 NS_FATAL_ERROR(
"Unsupported fadingConf: " << fadingConf);
170 simulationHelper->SetSimulationTime(simLength);
171 simulationHelper->SetUtCountPerBeam(utsPerBeam);
172 simulationHelper->SetUserCountPerUt(endUsersPerUt);
178 simulationHelper->SetBeamSet({18});
184 simulationHelper->SetBeamSet(
185 {1, 3, 5, 7, 9, 22, 24, 26, 28, 30, 44, 46, 48, 50, 59, 61, 70, 72});
189 NS_FATAL_ERROR(
"Unsupported beam configuration: " << beamConf);
193 simulationHelper->LoadScenario(
"geo-33E");
196 simulationHelper->CreateSatScenario();
198 simulationHelper->GetTrafficHelper()->AddOnOffTraffic(
203 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
204 Singleton<SatTopology>::Get()->GetUtUserNodes(),
205 "ns3::ConstantRandomVariable[Constant=1000]",
206 "ns3::ConstantRandomVariable[Constant=0]",
208 Seconds(simLength + 1),
214 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
225 NS_LOG_INFO(
"--- sat-per-packet-if-sim-tn9 ---");
226 NS_LOG_INFO(
" Packet size: " << packetSize);
227 NS_LOG_INFO(
" Simulation length: " << simLength);
228 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
229 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
248 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.