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"
57 NS_LOG_COMPONENT_DEFINE(
"sat-random-access-crdsa-collision-example");
60 main(
int argc,
char* argv[])
63 uint32_t endUsersPerUt(1);
64 uint32_t utsPerBeam(30);
65 uint32_t packetSize(20);
66 Time interval(Seconds(0.01));
67 Time simLength(Seconds(3.00));
68 Time appStartTime = Seconds(0.01);
71 LogComponentEnable(
"sat-random-access-crdsa-collision-example", LOG_LEVEL_INFO);
74 LogComponentEnable(
"SatPhyRxCarrier", LOG_LEVEL_INFO);
75 LogComponentEnable(
"SatInterference", LOG_LEVEL_INFO);
78 auto simulationHelper = CreateObject<SimulationHelper>(
"example-random-access-crdsa-collision");
79 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
83 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
84 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
85 simulationHelper->AddDefaultUiArguments(cmd);
86 cmd.Parse(argc, argv);
90 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
91 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
95 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
99 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
103 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
107 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
110 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
111 BooleanValue(
false));
113 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
117 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
119 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
121 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
123 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
125 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
126 UintegerValue(10000));
127 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
128 UintegerValue(30000));
129 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
132 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
134 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
135 TimeValue(MilliSeconds(100)));
136 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
137 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
141 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
142 BooleanValue(
false));
143 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
144 BooleanValue(
false));
145 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
146 BooleanValue(
false));
147 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
148 BooleanValue(
false));
149 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
150 BooleanValue(
false));
151 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
152 BooleanValue(
false));
153 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
154 BooleanValue(
false));
155 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
156 BooleanValue(
false));
157 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
158 BooleanValue(
false));
159 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
160 BooleanValue(
false));
161 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
162 BooleanValue(
false));
163 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
164 BooleanValue(
false));
167 simulationHelper->SetSimulationTime(simLength);
168 simulationHelper->SetUserCountPerUt(endUsersPerUt);
169 simulationHelper->SetUtCountPerBeam(utsPerBeam);
170 simulationHelper->SetBeamSet({beamId});
172 simulationHelper->LoadScenario(
"geo-33E");
174 simulationHelper->CreateSatScenario();
176 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
181 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
182 Singleton<SatTopology>::Get()->GetUtUserNodes(),
184 simLength + Seconds(1),
187 NS_LOG_INFO(
"--- Cbr-user-defined-example ---");
188 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
189 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
190 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
191 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
192 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
195 simulationHelper->RunSimulation();
ErrorModel
Error model enum.
@ RA_COLLISION_CHECK_AGAINST_SINR
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.