22 #include "ns3/config-store-module.h"
23 #include "ns3/core-module.h"
24 #include "ns3/internet-module.h"
25 #include "ns3/network-module.h"
26 #include "ns3/satellite-module.h"
27 #include "ns3/traffic-module.h"
42 NS_LOG_COMPONENT_DEFINE(
"sat-dama-http-sim-tn9");
45 main(
int argc,
char* argv[])
49 uint32_t endUsersPerUt(1);
50 uint32_t utsPerBeam(1);
53 double simLength(300.0);
56 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
59 Ptr<SimulationHelper> simulationHelper =
60 CreateObject<SimulationHelper>(
"example-dama-http-sim-tn9");
63 std::string inputFileNameWithPath =
64 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
65 "/tn9-dama-input-attributes.xml";
105 cmd.AddValue(
"simLength",
"Simulation duration in seconds", simLength);
106 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
107 cmd.AddValue(
"crTxConf",
"CR transmission configuration", crTxConf);
108 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
109 cmd.Parse(argc, argv);
111 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
112 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
113 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
114 ConfigStore inputConfig;
115 inputConfig.ConfigureDefaults();
117 simulationHelper->SetSimulationTime(simLength);
118 simulationHelper->SetUserCountPerUt(endUsersPerUt);
119 simulationHelper->SetUtCountPerBeam(utsPerBeam);
122 std::stringstream beamsEnabled;
123 beamsEnabled << beamId;
124 simulationHelper->SetBeams(beamsEnabled.str());
127 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_2"));
128 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
131 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
132 BooleanValue(
false));
133 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed", BooleanValue(
true));
134 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_MinimumServiceRate",
136 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
137 BooleanValue(
false));
143 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
145 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
150 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
152 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
157 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
159 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatUtHelper::UseCrdsaOnlyForControlPackets", BooleanValue(
false));
164 NS_FATAL_ERROR(
"Unsupported crTxConf: " << crTxConf);
169 simulationHelper->LoadScenario(
"geo-33E");
172 simulationHelper->CreateSatScenario();
177 simulationHelper->GetTrafficHelper()->AddHttpTraffic(
179 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
180 Singleton<SatTopology>::Get()->GetUtUserNodes(),
188 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
227 NS_LOG_INFO(
"--- sat-dama-http-sim-tn9 ---");
228 NS_LOG_INFO(
" Simulation length: " << simLength);
229 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
230 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
249 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.