22 #include "ns3/applications-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"
56 NS_LOG_COMPONENT_DEFINE(
"sat-random-access-crdsa-example");
59 main(
int argc,
char* argv[])
62 uint32_t endUsersPerUt(1);
63 uint32_t utsPerBeam(1);
64 uint32_t packetSize(20);
65 Time interval(Seconds(0.01));
66 Time simLength(Seconds(1.00));
67 Time appStartTime = Seconds(0.01);
70 LogComponentEnable(
"sat-random-access-crdsa-example", LOG_LEVEL_INFO);
71 LogComponentEnable(
"SatRandomAccess", LOG_LEVEL_INFO);
72 LogComponentEnable(
"SatUtMac", LOG_LEVEL_INFO);
77 auto simulationHelper = CreateObject<SimulationHelper>(
"example-random-access-crdsa");
78 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
82 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
83 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
84 simulationHelper->AddDefaultUiArguments(cmd);
85 cmd.Parse(argc, argv);
89 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
90 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
94 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
98 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
102 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
106 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
109 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
110 BooleanValue(
false));
112 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
116 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
118 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
120 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
125 UintegerValue(10000));
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
127 UintegerValue(30000));
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
131 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
133 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
134 TimeValue(MilliSeconds(100)));
135 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
136 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
140 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
141 BooleanValue(
false));
142 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
143 BooleanValue(
false));
144 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
145 BooleanValue(
false));
146 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
147 BooleanValue(
false));
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
149 BooleanValue(
false));
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
151 BooleanValue(
false));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
153 BooleanValue(
false));
154 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
155 BooleanValue(
false));
156 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
157 BooleanValue(
false));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
161 BooleanValue(
false));
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
163 BooleanValue(
false));
166 simulationHelper->SetSimulationTime(simLength);
167 simulationHelper->SetUserCountPerUt(endUsersPerUt);
168 simulationHelper->SetUtCountPerBeam(utsPerBeam);
169 simulationHelper->SetBeamSet({beamId});
171 simulationHelper->LoadScenario(
"geo-33E");
173 simulationHelper->CreateSatScenario();
175 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
180 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
181 Singleton<SatTopology>::Get()->GetUtUserNodes(),
183 simLength + Seconds(1),
186 NS_LOG_INFO(
"--- Cbr-user-defined-example ---");
187 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
188 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
189 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
190 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
191 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
194 simulationHelper->RunSimulation();
ErrorModel
Error model enum.
@ RA_COLLISION_CHECK_AGAINST_SINR
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.