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"
39 NS_LOG_COMPONENT_DEFINE(
"sat-essa-example");
42 main(
int argc,
char* argv[])
45 std::string beams =
"8";
47 uint32_t nbUtsPerBeam = 100;
48 uint32_t nbEndUsersPerUt = 1;
50 Time appStartTime = Seconds(0.001);
51 Time simLength = Seconds(60.0);
53 uint32_t packetSize = 64;
54 std::string dataRate =
"5kbps";
55 std::string onTime =
"0.2";
56 std::string offTime =
"0.8";
58 double frameAllocatedBandwidthHz = 15000;
59 double frameCarrierAllocatedBandwidthHz = 15000;
60 double frameCarrierRollOff = 0.22;
61 double frameCarrierSpacing = 0;
62 uint32_t frameSpreadingFactor = 256;
64 bool interferenceModePerPacket =
true;
65 bool displayTraces =
true;
67 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"example-essa");
71 cmd.AddValue(
"modelPP",
"interferenceModePerPacket", interferenceModePerPacket);
72 cmd.AddValue(
"traces",
"displayTraces", displayTraces);
73 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", nbUtsPerBeam);
74 cmd.AddValue(
"simLength",
"Simulation duration in seconds", simLength);
75 cmd.AddValue(
"packetSize",
"Constant packet size in bytes", packetSize);
76 cmd.AddValue(
"dataRate",
"Data rate (e.g. 500kb/s)", dataRate);
77 cmd.AddValue(
"onTime",
"Time for packet sending is on in seconds", onTime);
78 cmd.AddValue(
"offTime",
"Time for packet sending is off in seconds", offTime);
79 cmd.AddValue(
"frameAllocatedBandwidthHz",
80 "Allocated bandwidth in Hz",
81 frameAllocatedBandwidthHz);
82 cmd.AddValue(
"frameCarrierAllocatedBandwidthHz",
83 "Allocated carrier bandwidth in Hz",
84 frameCarrierAllocatedBandwidthHz);
85 cmd.AddValue(
"frameCarrierRollOff",
"Roll-off factor", frameCarrierRollOff);
86 cmd.AddValue(
"frameCarrierSpacing",
"Carrier spacing factor", frameCarrierSpacing);
87 cmd.AddValue(
"frameSpreadingFactor",
"Carrier spreading factor", frameSpreadingFactor);
88 simulationHelper->AddDefaultUiArguments(cmd);
89 cmd.Parse(argc, argv);
92 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
93 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
96 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
98 Config::SetDefault(
"ns3::SatSuperframeConf4::FrameConfigType",
100 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_AllocatedBandwidthHz",
101 DoubleValue(frameAllocatedBandwidthHz));
102 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierAllocatedBandwidthHz",
103 DoubleValue(frameCarrierAllocatedBandwidthHz));
104 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierRollOff",
105 DoubleValue(frameCarrierRollOff));
106 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_CarrierSpacing",
107 DoubleValue(frameCarrierSpacing));
108 Config::SetDefault(
"ns3::SatSuperframeConf4::Frame0_SpreadingFactor",
109 UintegerValue(frameSpreadingFactor));
112 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaServiceCount", UintegerValue(4));
113 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
114 BooleanValue(
false));
115 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
116 BooleanValue(
false));
117 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
118 BooleanValue(
false));
119 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
120 BooleanValue(
false));
121 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
122 BooleanValue(
false));
123 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
124 BooleanValue(
false));
125 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
126 BooleanValue(
false));
127 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
128 BooleanValue(
false));
129 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
130 BooleanValue(
false));
131 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
132 BooleanValue(
false));
133 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
134 BooleanValue(
false));
135 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
136 BooleanValue(
false));
140 if (interferenceModePerPacket)
142 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
147 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
150 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceEliminationModel",
152 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
154 Config::SetDefault(
"ns3::SatBeamHelper::ReturnLinkLinkResults", EnumValue(
SatEnums::LR_FSIM));
156 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowDuration", StringValue(
"600ms"));
157 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowStep", StringValue(
"200ms"));
158 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowDelay", StringValue(
"0s"));
159 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::FirstWindow", StringValue(
"0s"));
160 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::WindowSICIterations", UintegerValue(5));
161 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::SpreadingFactor", UintegerValue(1));
162 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::DetectionThreshold", DoubleValue(0));
163 Config::SetDefault(
"ns3::SatPhyRxCarrierPerWindow::EnableSIC", BooleanValue(
false));
166 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
168 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
170 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
172 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
174 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
176 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
179 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
181 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
183 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_SlottedAlohaAllowed",
184 BooleanValue(
false));
185 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_CrdsaAllowed",
186 BooleanValue(
false));
187 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_EssaAllowed", BooleanValue(
true));
190 simulationHelper->SetSimulationTime(simLength);
192 simulationHelper->SetGwUserCount(nbGw);
193 simulationHelper->SetUtCountPerBeam(nbUtsPerBeam);
194 simulationHelper->SetUserCountPerUt(nbEndUsersPerUt);
195 simulationHelper->SetBeams(beams);
197 simulationHelper->LoadScenario(
"geo-33E-fsim");
199 simulationHelper->CreateSatScenario();
201 simulationHelper->GetTrafficHelper()->AddOnOffTraffic(
206 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
207 Singleton<SatTopology>::Get()->GetUtUserNodes(),
208 "ns3::ConstantRandomVariable[Constant=" + onTime +
"]",
209 "ns3::ConstantRandomVariable[Constant=" + offTime +
"]",
215 simulationHelper->EnableProgressLogs();
217 std::string outputPath = Singleton<SatEnvVariables>::Get()->LocateDirectory(
218 "contrib/satellite/data/sims/example-essa");
219 Config::SetDefault(
"ns3::ConfigStore::Filename",
220 StringValue(outputPath +
"/output-attributes.xml"));
221 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
222 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
223 ConfigStore outputConfig;
224 outputConfig.ConfigureDefaults();
228 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
271 simulationHelper->RunSimulation();
@ 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.