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-example");
60 main(
int argc,
char* argv[])
63 uint32_t endUsersPerUt(1);
64 uint32_t utsPerBeam(1);
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-example", LOG_LEVEL_INFO);
72 LogComponentEnable(
"SatRandomAccess", LOG_LEVEL_INFO);
73 LogComponentEnable(
"SatUtMac", LOG_LEVEL_INFO);
74 LogComponentEnable(
"SatPhyRxCarrier", LOG_LEVEL_INFO);
75 LogComponentEnable(
"SatInterference", LOG_LEVEL_INFO);
76 LogComponentEnable(
"SatBeamScheduler", LOG_LEVEL_INFO);
78 auto simulationHelper = CreateObject<SimulationHelper>(
"example-random-access");
80 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
84 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
85 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
86 simulationHelper->AddDefaultUiArguments(cmd);
87 cmd.Parse(argc, argv);
91 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
92 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
96 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
100 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
104 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
108 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
111 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
112 BooleanValue(
false));
114 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
118 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
120 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
127 UintegerValue(10000));
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
129 UintegerValue(30000));
130 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
133 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
135 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
136 TimeValue(MilliSeconds(100)));
137 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
138 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
142 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
143 BooleanValue(
false));
144 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
145 BooleanValue(
false));
146 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
147 BooleanValue(
false));
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
149 BooleanValue(
false));
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
151 BooleanValue(
false));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
153 BooleanValue(
false));
154 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
155 BooleanValue(
false));
156 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
157 BooleanValue(
false));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
161 BooleanValue(
false));
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
163 BooleanValue(
false));
164 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
165 BooleanValue(
false));
168 simulationHelper->SetSimulationTime(simLength);
169 simulationHelper->SetUserCountPerUt(endUsersPerUt);
170 simulationHelper->SetUtCountPerBeam(utsPerBeam);
171 simulationHelper->SetBeamSet({beamId});
173 simulationHelper->LoadScenario(
"geo-33E");
175 simulationHelper->CreateSatScenario();
177 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
182 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
183 Singleton<SatTopology>::Get()->GetUtUserNodes(),
185 simLength + Seconds(1),
188 NS_LOG_INFO(
"--- Cbr-user-defined-example ---");
189 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
190 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
191 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
192 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
193 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
196 simulationHelper->RunSimulation();
@ RA_MODEL_RCS2_SPECIFICATION
ErrorModel
Error model enum.
@ RA_COLLISION_CHECK_AGAINST_SINR
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.