100 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
102 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
104 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
106 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
108 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_RandomAccessFrame", BooleanValue(
true));
109 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_RandomAccessFrame", BooleanValue(
true));
110 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_LogonFrame", BooleanValue(
true));
112 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_GuardTimeSymbols", UintegerValue(4));
113 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_GuardTimeSymbols", UintegerValue(4));
114 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame2_GuardTimeSymbols", UintegerValue(4));
115 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame3_GuardTimeSymbols", UintegerValue(4));
116 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame4_GuardTimeSymbols", UintegerValue(4));
117 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame5_GuardTimeSymbols", UintegerValue(4));
118 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame6_GuardTimeSymbols", UintegerValue(4));
119 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame7_GuardTimeSymbols", UintegerValue(4));
120 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame8_GuardTimeSymbols", UintegerValue(4));
121 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame9_GuardTimeSymbols", UintegerValue(4));
123 Config::SetDefault(
"ns3::SatUtMac::WindowInitLogon", TimeValue(Seconds(20)));
124 Config::SetDefault(
"ns3::SatUtMac::MaxWaitingTimeLogonResponse", TimeValue(Seconds(1)));
127 Config::SetDefault(
"ns3::SatMac::NcrVersion2", BooleanValue(
false));
128 Config::SetDefault(
"ns3::SatGwMac::NcrBroadcastPeriod", TimeValue(MilliSeconds(100)));
129 Config::SetDefault(
"ns3::SatGwMac::UseCmt", BooleanValue(
true));
130 Config::SetDefault(
"ns3::SatUtMacState::NcrSyncTimeout", TimeValue(Seconds(1)));
131 Config::SetDefault(
"ns3::SatUtMacState::NcrRecoveryTimeout", TimeValue(Seconds(10)));
132 Config::SetDefault(
"ns3::SatNcc::UtTimeout", TimeValue(Seconds(10)));
134 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
135 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotInterval", TimeValue(MilliSeconds(500)));
137 Config::SetDefault(
"ns3::SatUtMac::ClockDrift", IntegerValue(100));
138 Config::SetDefault(
"ns3::SatGwMac::CmtPeriodMin", TimeValue(MilliSeconds(550)));
142 "/scenarios/geo-33E");
145 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
150 CbrHelper cbr(
"ns3::UdpSocketFactory",
151 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
152 cbr.SetAttribute(
"Interval", StringValue(
"100ms"));
153 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
154 utApps.Start(Seconds(1.0));
155 utApps.Stop(Seconds(59.0));
158 PacketSinkHelper sink(
159 "ns3::UdpSocketFactory",
160 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
161 ApplicationContainer gwApps = sink.Install(gwUsers);
162 gwApps.Start(Seconds(1.0));
163 gwApps.Stop(Seconds(60.0));
165 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
166 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
170 Simulator::Stop(Seconds(60));
173 Simulator::Destroy();
177 uint32_t indexSwitchTdmaSync = 0;
178 for (uint32_t i = 0; i <
m_states.size(); i++)
182 indexSwitchTdmaSync = i;
188 NS_TEST_ASSERT_MSG_NE(indexSwitchTdmaSync,
190 "UT should switch to TDMA_SYNC before the end of simulation");
193 NS_TEST_ASSERT_MSG_NE(
m_totalSent[indexSwitchTdmaSync - 1], 0,
"Data sent before logon");
196 "Nothing received before logon");
199 for (uint32_t i = indexSwitchTdmaSync + 1; i <
m_totalReceived.size() - 1; i++)
203 "Receiver should always receive data after logon");
207 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");
278 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
281 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
283 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
285 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
287 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
289 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_RandomAccessFrame", BooleanValue(
true));
290 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_RandomAccessFrame", BooleanValue(
true));
291 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_LogonFrame", BooleanValue(
true));
293 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_GuardTimeSymbols", UintegerValue(4));
294 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_GuardTimeSymbols", UintegerValue(4));
295 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame2_GuardTimeSymbols", UintegerValue(4));
296 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame3_GuardTimeSymbols", UintegerValue(4));
297 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame4_GuardTimeSymbols", UintegerValue(4));
298 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame5_GuardTimeSymbols", UintegerValue(4));
299 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame6_GuardTimeSymbols", UintegerValue(4));
300 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame7_GuardTimeSymbols", UintegerValue(4));
301 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame8_GuardTimeSymbols", UintegerValue(4));
302 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame9_GuardTimeSymbols", UintegerValue(4));
304 Config::SetDefault(
"ns3::SatUtMac::WindowInitLogon", TimeValue(Seconds(20)));
305 Config::SetDefault(
"ns3::SatUtMac::MaxWaitingTimeLogonResponse", TimeValue(Seconds(1)));
308 Config::SetDefault(
"ns3::SatMac::NcrVersion2", BooleanValue(
false));
309 Config::SetDefault(
"ns3::SatGwMac::NcrBroadcastPeriod", TimeValue(MilliSeconds(100)));
310 Config::SetDefault(
"ns3::SatGwMac::UseCmt", BooleanValue(
true));
311 Config::SetDefault(
"ns3::SatUtMacState::NcrSyncTimeout", TimeValue(Seconds(1)));
312 Config::SetDefault(
"ns3::SatUtMacState::NcrRecoveryTimeout", TimeValue(Seconds(10)));
313 Config::SetDefault(
"ns3::SatNcc::UtTimeout", TimeValue(Seconds(10)));
315 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
316 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotInterval", TimeValue(MilliSeconds(500)));
318 Config::SetDefault(
"ns3::SatUtMac::ClockDrift", IntegerValue(100));
319 Config::SetDefault(
"ns3::SatGwMac::CmtPeriodMin", TimeValue(MilliSeconds(550)));
323 "/scenarios/geo-33E");
326 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
331 CbrHelper cbr(
"ns3::UdpSocketFactory",
332 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
333 cbr.SetAttribute(
"Interval", StringValue(
"100ms"));
334 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
335 utApps.Start(Seconds(1.0));
336 utApps.Stop(Seconds(59.0));
339 PacketSinkHelper sink(
340 "ns3::UdpSocketFactory",
341 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
342 ApplicationContainer gwApps = sink.Install(gwUsers);
343 gwApps.Start(Seconds(1.0));
344 gwApps.Stop(Seconds(60.0));
346 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
347 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
355 Simulator::Stop(Seconds(60));
358 Simulator::Destroy();
362 uint32_t indexSwitchTdmaSync = 0;
363 for (uint32_t i = 0; i <
m_states.size(); i++)
367 indexSwitchTdmaSync = i;
373 NS_TEST_ASSERT_MSG_NE(indexSwitchTdmaSync,
375 "UT should switch to TDMA_SYNC before the end of simulation");
378 for (uint32_t i = indexSwitchTdmaSync; i <
m_states.size() - 1; i++)
382 "UT should not switch to OFF_STANDBY after NCR_RECOVERY");
385 "UT should not switch to READY_FOR_LOGON after NCR_RECOVERY");
389 for (uint32_t i = 31; i < 39; i++)
393 "UT should be in NCR_RECOVERY after loss of NCR");
398 for (uint32_t i = 31; i < 39; i++)
401 receivedBeforeNcrRecovery,
402 "Receiver should not receive anything between 31s and 38s");
410 "Receiver should always receive data after logon");
414 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");
509 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
511 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode", EnumValue(
m_regenerationMode));
514 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
516 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
518 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
520 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
522 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_RandomAccessFrame", BooleanValue(
true));
523 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_RandomAccessFrame", BooleanValue(
true));
524 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_LogonFrame", BooleanValue(
true));
526 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_GuardTimeSymbols", UintegerValue(4));
527 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame1_GuardTimeSymbols", UintegerValue(4));
528 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame2_GuardTimeSymbols", UintegerValue(4));
529 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame3_GuardTimeSymbols", UintegerValue(4));
530 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame4_GuardTimeSymbols", UintegerValue(4));
531 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame5_GuardTimeSymbols", UintegerValue(4));
532 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame6_GuardTimeSymbols", UintegerValue(4));
533 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame7_GuardTimeSymbols", UintegerValue(4));
534 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame8_GuardTimeSymbols", UintegerValue(4));
535 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame9_GuardTimeSymbols", UintegerValue(4));
537 Config::SetDefault(
"ns3::SatUtMac::WindowInitLogon", TimeValue(Seconds(20)));
538 Config::SetDefault(
"ns3::SatUtMac::MaxWaitingTimeLogonResponse", TimeValue(Seconds(1)));
541 Config::SetDefault(
"ns3::SatMac::NcrVersion2", BooleanValue(
false));
542 Config::SetDefault(
"ns3::SatGwMac::NcrBroadcastPeriod", TimeValue(MilliSeconds(100)));
543 Config::SetDefault(
"ns3::SatGwMac::UseCmt", BooleanValue(
true));
544 Config::SetDefault(
"ns3::SatUtMacState::NcrSyncTimeout", TimeValue(Seconds(1)));
545 Config::SetDefault(
"ns3::SatUtMacState::NcrRecoveryTimeout", TimeValue(Seconds(10)));
546 Config::SetDefault(
"ns3::SatNcc::UtTimeout", TimeValue(Seconds(10)));
548 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
549 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotInterval", TimeValue(MilliSeconds(500)));
551 Config::SetDefault(
"ns3::SatUtMac::ClockDrift", IntegerValue(100));
552 Config::SetDefault(
"ns3::SatGwMac::CmtPeriodMin", TimeValue(MilliSeconds(550)));
556 "/scenarios/geo-33E");
559 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
564 CbrHelper cbr(
"ns3::UdpSocketFactory",
565 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
566 cbr.SetAttribute(
"Interval", StringValue(
"100ms"));
567 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
568 utApps.Start(Seconds(1.0));
569 utApps.Stop(Seconds(119.0));
572 PacketSinkHelper sink(
573 "ns3::UdpSocketFactory",
574 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
575 ApplicationContainer gwApps = sink.Install(gwUsers);
576 gwApps.Start(Seconds(1.0));
577 gwApps.Stop(Seconds(120.0));
579 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
580 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
588 Simulator::Stop(Seconds(120));
591 Simulator::Destroy();
595 uint32_t indexSwitchTdmaSync = 0;
596 uint32_t indexSwitchNcrRecovery = 0;
597 uint32_t indexSwitchTdmaSyncSecondTime = 0;
598 for (uint32_t i = 0; i <
m_states.size(); i++)
602 indexSwitchTdmaSync = i;
606 indexSwitchNcrRecovery = i;
608 if (indexSwitchTdmaSync & indexSwitchNcrRecovery)
614 for (uint32_t i = indexSwitchNcrRecovery; i <
m_states.size(); i++)
618 indexSwitchTdmaSyncSecondTime = i;
624 NS_TEST_ASSERT_MSG_NE(indexSwitchTdmaSync,
626 "UT should switch to TDMA_SYNC before the end of simulation");
627 NS_TEST_ASSERT_MSG_NE(indexSwitchNcrRecovery,
629 "UT should switch to NCR_RECOVERY before the end of simulation");
630 NS_TEST_ASSERT_MSG_NE(
631 indexSwitchTdmaSyncSecondTime,
633 "UT should switch to TDMA_SYNC after NCR_RECOVERY and before the end of simulation");
636 for (uint32_t i = 31; i < 41; i++)
640 "UT should be in NCR_RECOVERY after loss of NCR");
644 bool stateFound =
false;
645 for (uint32_t i = indexSwitchNcrRecovery; i <
m_states.size() - 1; i++)
653 NS_TEST_ASSERT_MSG_EQ(stateFound,
655 "UT should switch to OFF_STANDBY or READY_FOR_LOGON after NCR_RECOVERY");
657 uint32_t receivedBeforeNcrRecovery =
m_totalReceived[indexSwitchNcrRecovery + 1];
659 for (uint32_t i = 31; i < 56; i++)
662 receivedBeforeNcrRecovery,
663 "Receiver should not receive anything between 31s and 50s");
667 for (uint32_t i = indexSwitchTdmaSyncSecondTime + 2; i <
m_totalReceived.size() - 1; i++)
671 "Receiver should always receive data after second logon");
675 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");