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"
58 NS_LOG_COMPONENT_DEFINE(
"sat-random-access-slotted-aloha-collision-example");
61 main(
int argc,
char* argv[])
64 uint32_t endUsersPerUt(1);
65 uint32_t utsPerBeam(30);
66 uint32_t packetSize(20);
67 Time interval(Seconds(0.01));
68 Time simLength(Seconds(3.00));
69 Time appStartTime = Seconds(0.01);
72 LogComponentEnable(
"sat-random-access-slotted-aloha-collision-example", LOG_LEVEL_INFO);
75 LogComponentEnable(
"SatPhyRxCarrier", LOG_LEVEL_INFO);
76 LogComponentEnable(
"SatInterference", LOG_LEVEL_INFO);
79 auto simulationHelper =
80 CreateObject<SimulationHelper>(
"example-random-access-slotted-aloha-collision");
82 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
86 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
87 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
88 simulationHelper->AddDefaultUiArguments(cmd);
89 cmd.Parse(argc, argv);
93 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
94 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
98 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
102 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
106 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
110 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
113 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
114 BooleanValue(
false));
116 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
120 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
129 UintegerValue(10000));
130 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
131 UintegerValue(30000));
132 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
135 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
137 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
138 TimeValue(MilliSeconds(100)));
139 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
140 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
144 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
145 BooleanValue(
false));
146 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
147 BooleanValue(
false));
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
149 BooleanValue(
false));
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
151 BooleanValue(
false));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
153 BooleanValue(
false));
154 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
155 BooleanValue(
false));
156 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
157 BooleanValue(
false));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
161 BooleanValue(
false));
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
163 BooleanValue(
false));
164 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
165 BooleanValue(
false));
166 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
167 BooleanValue(
false));
170 simulationHelper->SetSimulationTime(simLength);
171 simulationHelper->SetUserCountPerUt(endUsersPerUt);
172 simulationHelper->SetUtCountPerBeam(utsPerBeam);
173 simulationHelper->SetBeamSet({beamId});
175 simulationHelper->LoadScenario(
"geo-33E");
177 simulationHelper->CreateSatScenario();
179 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
184 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
185 Singleton<SatTopology>::Get()->GetUtUserNodes(),
187 simLength + Seconds(1),
190 NS_LOG_INFO(
"--- Cbr-user-defined-example ---");
191 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
192 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
193 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
194 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
195 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
198 simulationHelper->RunSimulation();
ErrorModel
Error model enum.
@ RA_COLLISION_CHECK_AGAINST_SINR
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.