98 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
99 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
102 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
106 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
110 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
114 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
117 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
118 BooleanValue(
false));
120 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
130 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
132 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
134 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
136 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
139 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
141 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
142 TimeValue(MilliSeconds(100)));
143 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
144 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
149 BooleanValue(
false));
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
151 BooleanValue(
false));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
153 BooleanValue(
false));
154 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
155 BooleanValue(
false));
156 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
157 BooleanValue(
false));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
159 BooleanValue(
false));
160 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
161 BooleanValue(
false));
162 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
163 BooleanValue(
false));
164 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
165 BooleanValue(
false));
166 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
167 BooleanValue(
false));
168 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
169 BooleanValue(
false));
170 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
171 BooleanValue(
false));
174 Ptr<SatHelper> helper = CreateObject<SatHelper>(
180 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
185 CbrHelper cbr(
"ns3::UdpSocketFactory",
186 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
187 cbr.SetAttribute(
"Interval", StringValue(
"1s"));
188 cbr.SetAttribute(
"PacketSize", UintegerValue(64));
190 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
191 utApps.Start(Seconds(1.0));
192 utApps.Stop(Seconds(2.1));
195 PacketSinkHelper sink(
"ns3::UdpSocketFactory",
196 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
198 ApplicationContainer gwApps = sink.Install(gwUsers);
199 gwApps.Start(Seconds(1.0));
200 gwApps.Stop(Seconds(10.0));
202 Simulator::Stop(Seconds(11));
205 Simulator::Destroy();
207 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
208 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
213 NS_TEST_ASSERT_MSG_NE(sender->GetSent(), (uint32_t)0,
"Nothing sent !");
214 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");
278 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
279 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
282 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
286 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
290 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
294 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
297 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
298 BooleanValue(
false));
300 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
304 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
306 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
308 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
310 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
312 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
314 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
316 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
319 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
321 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
322 TimeValue(MilliSeconds(100)));
323 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
324 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
328 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
329 BooleanValue(
false));
330 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
331 BooleanValue(
false));
332 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
333 BooleanValue(
false));
334 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
335 BooleanValue(
false));
336 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
337 BooleanValue(
false));
338 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
339 BooleanValue(
false));
340 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
341 BooleanValue(
false));
342 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
343 BooleanValue(
false));
344 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
345 BooleanValue(
false));
346 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
347 BooleanValue(
false));
348 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
349 BooleanValue(
false));
350 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
354 Ptr<SatHelper> helper = CreateObject<SatHelper>(
360 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
365 CbrHelper cbr(
"ns3::UdpSocketFactory",
366 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
367 cbr.SetAttribute(
"Interval", StringValue(
"1s"));
368 cbr.SetAttribute(
"PacketSize", UintegerValue(64));
370 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
371 utApps.Start(Seconds(1.0));
372 utApps.Stop(Seconds(2.1));
375 PacketSinkHelper sink(
"ns3::UdpSocketFactory",
376 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
378 ApplicationContainer gwApps = sink.Install(gwUsers);
379 gwApps.Start(Seconds(1.0));
380 gwApps.Stop(Seconds(10.0));
382 Simulator::Stop(Seconds(11));
385 Simulator::Destroy();
387 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
388 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
393 NS_TEST_ASSERT_MSG_NE(sender->GetSent(), (uint32_t)0,
"Nothing sent !");
394 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");