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"
58 NS_LOG_COMPONENT_DEFINE(
"sat-ra-sim-tn9-comparison");
61 main(
int argc,
char* argv[])
64 uint32_t endUsersPerUt(1);
65 uint32_t utsPerBeam(1);
66 uint32_t packetSize(1);
67 uint32_t numOfInstances(3);
68 double intervalInSeconds(0.1);
71 double simLength(60.0);
72 Time appStartTime = Seconds(0.1);
75 auto simulationHelper = CreateObject<SimulationHelper>(
"example-ra-sim-tn9-comparison");
77 std::string inputFileNameWithPath =
78 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
79 "/tn9-ra-input-attributes.xml";
83 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
84 cmd.AddValue(
"numOfInstances",
"Number of CRDSA packet instances", numOfInstances);
85 cmd.AddValue(
"isNoisy",
"If true, may print some logging messages", isNoisy);
86 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
87 cmd.Parse(argc, argv);
91 LogComponentEnable(
"sat-ra-sim-tn9", LOG_INFO);
94 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
95 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
96 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
97 ConfigStore inputConfig;
98 inputConfig.ConfigureDefaults();
101 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
105 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
109 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
116 Config::SetDefault(
"ns3::SatRequestManager::CnoReportInterval", TimeValue(Seconds(60.0)));
119 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
122 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
123 BooleanValue(
false));
125 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
129 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
131 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
133 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
135 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
137 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
139 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
142 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
144 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
145 UintegerValue(numOfInstances));
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
149 BooleanValue(
false));
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
151 BooleanValue(
false));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
153 BooleanValue(
false));
154 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
155 BooleanValue(
false));
156 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
157 BooleanValue(
false));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
161 BooleanValue(
false));
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
163 BooleanValue(
false));
164 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
165 BooleanValue(
false));
166 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
167 BooleanValue(
false));
168 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
169 BooleanValue(
false));
170 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
171 BooleanValue(
false));
174 simulationHelper->SetSimulationTime(simLength);
175 simulationHelper->SetUserCountPerUt(endUsersPerUt);
176 simulationHelper->SetUtCountPerBeam(utsPerBeam);
177 simulationHelper->SetBeamSet({beamId});
179 simulationHelper->LoadScenario(
"geo-33E");
181 simulationHelper->CreateSatScenario();
186 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
189 Seconds(intervalInSeconds),
191 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
192 Singleton<SatTopology>::Get()->GetUtUserNodes(),
194 Seconds(simLength + 1),
199 const double kbps = packetSize / intervalInSeconds / 125.0;
200 std::cout <<
"Each of " << utsPerBeam * endUsersPerUt <<
" UT Users"
201 <<
" offer bandwidth of " << kbps <<
" kbps" << std::endl;
207 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
256 NS_LOG_INFO(
"--- sat-ra-sim-tn9-comparison ---");
257 NS_LOG_INFO(
" Packet size: " << packetSize);
258 NS_LOG_INFO(
" Simulation length: " << simLength);
259 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
260 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
279 simulationHelper->RunSimulation();
@ RA_MODEL_RCS2_SPECIFICATION
@ RA_COLLISION_CHECK_AGAINST_SINR
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.