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"
42 NS_LOG_COMPONENT_DEFINE(
"sat-regeneration-collisions-example");
45 main(
int argc,
char* argv[])
47 uint32_t packetSize = 512;
48 std::string interval =
"1ms";
49 std::string randomAccess =
"SlottedAloha";
50 std::string forwardRegeneration =
"regeneration_phy";
51 std::string returnRegeneration =
"regeneration_phy";
53 std::map<std::string, SatEnums::RegenerationMode_t> mapForwardRegeneration{
57 std::map<std::string, SatEnums::RegenerationMode_t> mapReturnRegeneration{
63 Ptr<SimulationHelper> simulationHelper =
64 CreateObject<SimulationHelper>(
"example-regeneration-collisions");
68 cmd.AddValue(
"packetSize",
"Size of constant packet (bytes)", packetSize);
69 cmd.AddValue(
"interval",
"Interval to sent packets in seconds, (e.g. (1s))", interval);
70 cmd.AddValue(
"randomAccess",
71 "Choose RA (SlottedAloha, Marsala, Crdsa, Essa) or DA.",
74 "forwardRegeneration",
75 "Regeneration mode on forward link (transparent, regeneration_phy or regeneration_network)",
77 cmd.AddValue(
"returnRegeneration",
78 "Regeneration mode on forward link (transparent, regeneration_phy, "
79 "regeneration_link or regeneration_network)",
81 simulationHelper->AddDefaultUiArguments(cmd);
82 cmd.Parse(argc, argv);
85 mapForwardRegeneration[forwardRegeneration];
87 mapReturnRegeneration[returnRegeneration];
90 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
91 EnumValue(forwardLinkRegenerationMode));
92 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
93 EnumValue(returnLinkRegenerationMode));
95 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
98 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
101 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
103 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_SlottedAlohaAllowed",
104 BooleanValue(
false));
105 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_CrdsaAllowed",
106 BooleanValue(
false));
107 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_EssaAllowed",
108 BooleanValue(
false));
111 if (randomAccess ==
"SlottedAloha")
113 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
115 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_SlottedAlohaAllowed",
118 else if (randomAccess ==
"Crdsa")
120 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_CrdsaAllowed",
125 else if (randomAccess ==
"Marsala")
127 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
129 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_CrdsaAllowed",
132 else if (randomAccess ==
"Essa")
134 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
136 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_EssaAllowed",
139 else if (randomAccess ==
"DA")
141 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
146 NS_FATAL_ERROR(
"Unknown random access: " << randomAccess);
150 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
154 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
158 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
161 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
162 BooleanValue(
false));
164 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
168 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
170 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
172 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
174 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
176 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
178 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
180 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
183 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
185 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
186 TimeValue(MilliSeconds(100)));
187 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
188 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
191 Config::SetDefault(
"ns3::SatOrbiterHelper::FwdLinkErrorModel",
193 Config::SetDefault(
"ns3::SatOrbiterHelper::RtnLinkErrorModel",
196 if (randomAccess ==
"Essa")
199 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
201 Config::SetDefault(
"ns3::SatSuperframeConf4::FrameConfigType",
203 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_AllocatedBandwidthHz",
205 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierAllocatedBandwidthHz",
207 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierRollOff", DoubleValue(0.22));
208 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierSpacing", DoubleValue(0));
209 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_SpreadingFactor", UintegerValue(256));
211 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
213 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceEliminationModel",
215 Config::SetDefault(
"ns3::SatBeamHelper::ReturnLinkLinkResults",
217 Config::SetDefault(
"ns3::SatOrbiterHelper::RtnLinkErrorModel",
220 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowDuration", StringValue(
"600ms"));
221 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowStep", StringValue(
"200ms"));
222 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowDelay", StringValue(
"0s"));
223 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::FirstWindow", StringValue(
"0s"));
224 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowSICIterations", UintegerValue(5));
225 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::SpreadingFactor", UintegerValue(1));
226 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::DetectionThreshold", DoubleValue(0));
227 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::EnableSIC", BooleanValue(
false));
229 simulationHelper->LoadScenario(
"geo-33E-fsim");
233 if (randomAccess !=
"DA")
235 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaServiceCount", UintegerValue(4));
236 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
237 BooleanValue(
false));
238 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
239 BooleanValue(
false));
240 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
241 BooleanValue(
false));
242 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
243 BooleanValue(
false));
244 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
245 BooleanValue(
false));
246 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
247 BooleanValue(
false));
248 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
249 BooleanValue(
false));
250 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
251 BooleanValue(
false));
252 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
253 BooleanValue(
false));
254 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
255 BooleanValue(
false));
256 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
257 BooleanValue(
false));
258 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
259 BooleanValue(
false));
261 simulationHelper->LoadScenario(
"geo-33E");
264 simulationHelper->SetSimulationTime(Seconds(11));
266 LogComponentEnable(
"sat-regeneration-collisions-example", LOG_LEVEL_INFO);
268 simulationHelper->SetUserCountPerUt(1);
269 simulationHelper->SetUtCountPerBeam(50);
270 simulationHelper->SetBeamSet({1});
272 simulationHelper->CreateSatScenario();
274 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
279 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
280 Singleton<SatTopology>::Get()->GetUtUserNodes(),
285 NS_LOG_INFO(
"--- sat-regeneration-collisions-example ---");
286 NS_LOG_INFO(
" Random Access (or DA): " << randomAccess);
287 NS_LOG_INFO(
" PacketSize: " << packetSize);
288 NS_LOG_INFO(
" Interval: " << interval);
292 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
293 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
294 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
295 ConfigStore outputConfig;
296 outputConfig.ConfigureDefaults();
298 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
324 simulationHelper->EnableProgressLogs();
325 simulationHelper->RunSimulation();
RegenerationMode_t
The regeneration mode used in satellites.
@ RA_COLLISION_CHECK_AGAINST_SINR
@ SUPER_FRAME_CONFIG_4
SUPER_FRAME_CONFIG_4.
@ CONFIG_TYPE_4
Configuration type 4 (ESSA)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.