29 #include "ns3/cbr-application.h"
30 #include "ns3/cbr-helper.h"
31 #include "ns3/config.h"
33 #include "ns3/packet-sink-helper.h"
34 #include "ns3/packet-sink.h"
35 #include "ns3/satellite-env-variables.h"
36 #include "ns3/satellite-geo-feeder-phy.h"
37 #include "ns3/satellite-geo-net-device.h"
38 #include "ns3/satellite-geo-user-phy.h"
39 #include "ns3/satellite-gw-mac.h"
40 #include "ns3/satellite-helper.h"
41 #include "ns3/satellite-id-mapper.h"
42 #include "ns3/satellite-isl-arbiter-unicast.h"
43 #include "ns3/satellite-isl-arbiter.h"
44 #include "ns3/satellite-phy-rx-carrier.h"
45 #include "ns3/satellite-ut-mac-state.h"
46 #include "ns3/simulation-helper.h"
47 #include "ns3/simulator.h"
48 #include "ns3/singleton.h"
49 #include "ns3/string.h"
78 virtual void DoRun(
void);
85 : TestCase(
"This case tests that a topology is correctly loaded.")
104 Singleton<SatEnvVariables>::Get()->DoInitialize();
105 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test1",
true);
108 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
109 EnumValue(SatEnums::REGENERATION_NETWORK));
110 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
111 EnumValue(SatEnums::REGENERATION_NETWORK));
114 Config::SetDefault(
"ns3::SatHelper::SatConstellationEnabled", BooleanValue(
true));
115 Config::SetDefault(
"ns3::SatHelper::SatConstellationFolder",
116 StringValue(
"eutelsat-geo-2-sats-no-isls"));
117 Config::SetDefault(
"ns3::SatSGP4MobilityModel::StartDateStr",
118 StringValue(
"2022-11-13 12:00:00"));
119 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
120 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
121 TimeValue(MilliSeconds(10)));
122 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
124 Ptr<SimulationHelper> simulationHelper =
125 CreateObject<SimulationHelper>(
"test-sat-constellation");
128 simulationHelper->SetBeamSet({43, 30});
129 simulationHelper->SetUserCountPerUt(5);
131 simulationHelper->CreateSatScenario();
132 m_helper = simulationHelper->GetSatelliteHelper();
134 NodeContainer sats =
m_helper->GeoSatNodes();
135 NodeContainer gws =
m_helper->GwNodes();
136 NodeContainer uts =
m_helper->UtNodes();
137 NodeContainer gwUsers =
m_helper->GetGwUsers();
138 NodeContainer utUsers =
m_helper->GetUtUsers();
140 uint32_t countNetDevices = 0;
141 for (uint32_t i = 0; i < sats.GetN(); i++)
143 for (uint32_t j = 0; j < sats.Get(i)->GetNDevices(); j++)
145 if (DynamicCast<SatGeoNetDevice>(sats.Get(i)->GetDevice(j)) !=
nullptr)
147 countNetDevices += 1;
152 NS_TEST_ASSERT_MSG_EQ(sats.GetN(), 2,
"Topology must contain 2 satellites");
153 NS_TEST_ASSERT_MSG_EQ(countNetDevices, 2,
"Topology must contain 2 satellite Geo Net Devices");
154 NS_TEST_ASSERT_MSG_EQ(gws.GetN(), 2,
"Topology must contain 2 GWs");
155 NS_TEST_ASSERT_MSG_EQ(uts.GetN(), 3,
"Topology must contain 3 UTs");
156 NS_TEST_ASSERT_MSG_EQ(gwUsers.GetN(), 3,
"Topology must contain 3 GW users");
157 NS_TEST_ASSERT_MSG_EQ(utUsers.GetN(), 15,
"Topology must contain 15 UT users");
172 "Incorrect latitude for satellite 1");
176 "Incorrect longitude for satellite 1");
180 "Incorrect altitude for satellite 1");
185 "Incorrect latitude for satellite 2");
189 "Incorrect longitude for satellite 2");
193 "Incorrect altitude for satellite 2");
195 NS_TEST_ASSERT_MSG_EQ_TOL(gw1.
GetLatitude(), 48.85, 0.001,
"Incorrect latitude for GW 1");
196 NS_TEST_ASSERT_MSG_EQ_TOL(gw1.
GetLongitude(), 2.34, 0.001,
"Incorrect longitude for GW 1");
197 NS_TEST_ASSERT_MSG_EQ(gw1.
GetAltitude(), 0,
"Incorrect altitude for GW 1");
199 NS_TEST_ASSERT_MSG_EQ_TOL(gw2.
GetLatitude(), 55.75, 0.001,
"Incorrect latitude for GW 2");
200 NS_TEST_ASSERT_MSG_EQ_TOL(gw2.
GetLongitude(), 37.62, 0.001,
"Incorrect longitude for GW 2");
201 NS_TEST_ASSERT_MSG_EQ(gw2.
GetAltitude(), 0,
"Incorrect altitude for GW 2");
203 NS_TEST_ASSERT_MSG_EQ_TOL(ut1.
GetLatitude(), 48.8534, 0.001,
"Incorrect latitude for UT 1");
204 NS_TEST_ASSERT_MSG_EQ_TOL(ut1.
GetLongitude(), 2.3488, 0.001,
"Incorrect longitude for UT 1");
205 NS_TEST_ASSERT_MSG_EQ(ut1.
GetAltitude(), 0,
"Incorrect altitude for UT 1");
207 NS_TEST_ASSERT_MSG_EQ_TOL(ut2.
GetLatitude(), 55.755, 0.001,
"Incorrect latitude for UT 2");
208 NS_TEST_ASSERT_MSG_EQ_TOL(ut2.
GetLongitude(), 37.6218, 0.001,
"Incorrect longitude for UT 2");
209 NS_TEST_ASSERT_MSG_EQ(ut2.
GetAltitude(), 0,
"Incorrect altitude for UT 2");
211 NS_TEST_ASSERT_MSG_EQ_TOL(ut3.
GetLatitude(), 55.754, 0.001,
"Incorrect latitude for UT 3");
212 NS_TEST_ASSERT_MSG_EQ_TOL(ut3.
GetLongitude(), 37.621, 0.001,
"Incorrect longitude for UT 3");
213 NS_TEST_ASSERT_MSG_EQ(ut3.
GetAltitude(), 0,
"Incorrect altitude for UT 3");
215 Simulator::Destroy();
241 virtual void DoRun(
void);
243 std::vector<std::string>
Split(std::string s,
char del);
244 void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue);
251 : TestCase(
"This case tests that a application throughputs PerEntity are correct.")
261 std::vector<std::string>
264 std::stringstream ss(s);
266 std::vector<std::string> tokens;
269 std::getline(ss, word, del);
270 tokens.push_back(word);
279 std::ifstream myfile(path);
280 std::string delimiter =
" ";
284 if (myfile.is_open())
287 while (std::getline(myfile, line))
289 std::vector<std::string> tokens =
Split(line,
' ');
290 if (tokens.size() == 2)
292 if ((uint32_t)std::stoi(tokens[0]) == time)
294 NS_TEST_ASSERT_MSG_EQ_TOL(std::stof(tokens[1]),
297 "Incorrect throughput for statistic " << path);
306 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot find time " << time <<
" for trace file " << path);
311 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot read trace file " << path);
322 Singleton<SatIdMapper>::Get()->Reset();
325 Singleton<SatEnvVariables>::Get()->DoInitialize();
326 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test2",
true);
329 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
330 EnumValue(SatEnums::REGENERATION_NETWORK));
331 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
332 EnumValue(SatEnums::REGENERATION_NETWORK));
335 Config::SetDefault(
"ns3::SatHelper::SatConstellationEnabled", BooleanValue(
true));
336 Config::SetDefault(
"ns3::SatHelper::SatConstellationFolder",
337 StringValue(
"eutelsat-geo-2-sats-no-isls"));
338 Config::SetDefault(
"ns3::SatSGP4MobilityModel::StartDateStr",
339 StringValue(
"2022-11-13 12:00:00"));
340 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
341 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
342 TimeValue(MilliSeconds(10)));
343 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
345 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"10ms"));
346 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
348 Ptr<SimulationHelper> simulationHelper =
349 CreateObject<SimulationHelper>(
"test-sat-constellation/test2");
352 simulationHelper->SetBeamSet({43, 30});
353 simulationHelper->SetUserCountPerUt(5);
355 simulationHelper->CreateSatScenario();
356 m_helper = simulationHelper->GetSatelliteHelper();
358 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
359 SimulationHelper::UDP,
360 SimulationHelper::FWD_LINK,
363 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
364 SimulationHelper::UDP,
365 SimulationHelper::RTN_LINK,
369 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
371 s->AddGlobalFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
372 s->AddGlobalRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
373 s->AddPerGwFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
374 s->AddPerGwRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
375 s->AddPerSatFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
376 s->AddPerSatRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
377 s->AddPerBeamFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
378 s->AddPerBeamRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
379 s->AddPerUtFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
380 s->AddPerUtRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
382 simulationHelper->SetSimulationTime(Seconds(10));
383 simulationHelper->RunSimulation();
385 Simulator::Destroy();
388 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
389 "stat-global-fwd-app-throughput-scatter-0.txt",
392 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
393 "stat-global-rtn-app-throughput-scatter-0.txt",
398 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
399 "stat-per-sat-fwd-app-throughput-scatter-1.txt",
402 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
403 "stat-per-sat-fwd-app-throughput-scatter-2.txt",
406 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
407 "stat-per-sat-rtn-app-throughput-scatter-1.txt",
410 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
411 "stat-per-sat-rtn-app-throughput-scatter-2.txt",
416 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
417 "stat-per-beam-fwd-app-throughput-scatter-1-30.txt",
420 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
421 "stat-per-beam-fwd-app-throughput-scatter-1-43.txt",
424 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
425 "stat-per-beam-fwd-app-throughput-scatter-2-30.txt",
428 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
429 "stat-per-beam-fwd-app-throughput-scatter-2-43.txt",
432 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
433 "stat-per-beam-rtn-app-throughput-scatter-1-30.txt",
436 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
437 "stat-per-beam-rtn-app-throughput-scatter-1-43.txt",
440 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
441 "stat-per-beam-rtn-app-throughput-scatter-2-30.txt",
444 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
445 "stat-per-beam-rtn-app-throughput-scatter-2-43.txt",
450 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
451 "stat-per-gw-fwd-app-throughput-scatter-1.txt",
454 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
455 "stat-per-gw-fwd-app-throughput-scatter-2.txt",
458 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
459 "stat-per-gw-rtn-app-throughput-scatter-1.txt",
462 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
463 "stat-per-gw-rtn-app-throughput-scatter-2.txt",
468 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
469 "stat-per-ut-fwd-app-throughput-scatter-1.txt",
472 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
473 "stat-per-ut-fwd-app-throughput-scatter-2.txt",
476 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
477 "stat-per-ut-fwd-app-throughput-scatter-3.txt",
480 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
481 "stat-per-ut-rtn-app-throughput-scatter-1.txt",
484 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
485 "stat-per-ut-rtn-app-throughput-scatter-2.txt",
488 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
489 "stat-per-ut-rtn-app-throughput-scatter-3.txt",
517 virtual void DoRun(
void);
519 std::vector<std::string>
Split(std::string s,
char del);
520 void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue);
527 : TestCase(
"This case tests that a application throughputs PerEntity are correct.")
537 std::vector<std::string>
540 std::stringstream ss(s);
542 std::vector<std::string> tokens;
545 std::getline(ss, word, del);
546 tokens.push_back(word);
555 std::ifstream myfile(path);
556 std::string delimiter =
" ";
560 if (myfile.is_open())
563 while (std::getline(myfile, line))
565 std::vector<std::string> tokens =
Split(line,
' ');
566 if (tokens.size() == 2)
568 if ((uint32_t)std::stoi(tokens[0]) == time)
570 NS_TEST_ASSERT_MSG_EQ_TOL(std::stof(tokens[1]),
573 "Incorrect throughput for statistic " << path);
582 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot find time " << time <<
" for trace file " << path);
587 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot read trace file " << path);
598 Singleton<SatIdMapper>::Get()->Reset();
601 Singleton<SatEnvVariables>::Get()->DoInitialize();
602 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test3",
true);
605 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
606 EnumValue(SatEnums::REGENERATION_NETWORK));
607 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
608 EnumValue(SatEnums::REGENERATION_NETWORK));
611 Config::SetDefault(
"ns3::SatHelper::SatConstellationEnabled", BooleanValue(
true));
612 Config::SetDefault(
"ns3::SatHelper::SatConstellationFolder",
613 StringValue(
"eutelsat-geo-2-sats-isls"));
614 Config::SetDefault(
"ns3::SatSGP4MobilityModel::StartDateStr",
615 StringValue(
"2022-11-13 12:00:00"));
616 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
617 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
618 TimeValue(MilliSeconds(10)));
619 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
621 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"10ms"));
622 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
624 Ptr<SimulationHelper> simulationHelper =
625 CreateObject<SimulationHelper>(
"test-sat-constellation/test3");
628 simulationHelper->SetBeamSet({43, 30});
629 simulationHelper->SetUserCountPerUt(5);
631 simulationHelper->CreateSatScenario();
632 m_helper = simulationHelper->GetSatelliteHelper();
634 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
635 SimulationHelper::UDP,
636 SimulationHelper::FWD_LINK,
639 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
640 SimulationHelper::UDP,
641 SimulationHelper::RTN_LINK,
645 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
647 s->AddGlobalFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
648 s->AddGlobalRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
649 s->AddPerGwFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
650 s->AddPerGwRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
651 s->AddPerSatFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
652 s->AddPerSatRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
653 s->AddPerBeamFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
654 s->AddPerBeamRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
655 s->AddPerUtFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
656 s->AddPerUtRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
658 simulationHelper->SetSimulationTime(Seconds(10));
659 simulationHelper->RunSimulation();
661 Simulator::Destroy();
664 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
665 "stat-global-fwd-app-throughput-scatter-0.txt",
668 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
669 "stat-global-rtn-app-throughput-scatter-0.txt",
674 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
675 "stat-per-sat-fwd-app-throughput-scatter-1.txt",
678 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
679 "stat-per-sat-fwd-app-throughput-scatter-2.txt",
682 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
683 "stat-per-sat-rtn-app-throughput-scatter-1.txt",
686 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
687 "stat-per-sat-rtn-app-throughput-scatter-2.txt",
692 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
693 "stat-per-beam-fwd-app-throughput-scatter-1-30.txt",
696 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
697 "stat-per-beam-fwd-app-throughput-scatter-1-43.txt",
700 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
701 "stat-per-beam-fwd-app-throughput-scatter-2-30.txt",
704 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
705 "stat-per-beam-fwd-app-throughput-scatter-2-43.txt",
708 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
709 "stat-per-beam-rtn-app-throughput-scatter-1-30.txt",
712 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
713 "stat-per-beam-rtn-app-throughput-scatter-1-43.txt",
716 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
717 "stat-per-beam-rtn-app-throughput-scatter-2-30.txt",
720 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
721 "stat-per-beam-rtn-app-throughput-scatter-2-43.txt",
726 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
727 "stat-per-gw-fwd-app-throughput-scatter-1.txt",
730 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
731 "stat-per-gw-fwd-app-throughput-scatter-2.txt",
734 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
735 "stat-per-gw-rtn-app-throughput-scatter-1.txt",
738 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
739 "stat-per-gw-rtn-app-throughput-scatter-2.txt",
744 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
745 "stat-per-ut-fwd-app-throughput-scatter-1.txt",
748 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
749 "stat-per-ut-fwd-app-throughput-scatter-2.txt",
752 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
753 "stat-per-ut-fwd-app-throughput-scatter-3.txt",
756 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
757 "stat-per-ut-rtn-app-throughput-scatter-1.txt",
760 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
761 "stat-per-ut-rtn-app-throughput-scatter-2.txt",
764 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
765 "stat-per-ut-rtn-app-throughput-scatter-3.txt",
789 virtual void DoRun(
void);
797 "This case tests that a topology with hundreds of LEO satellites is correctly loaded.")
816 Singleton<SatEnvVariables>::Get()->DoInitialize();
817 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test4",
true);
820 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
821 EnumValue(SatEnums::REGENERATION_NETWORK));
822 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
823 EnumValue(SatEnums::REGENERATION_NETWORK));
826 Config::SetDefault(
"ns3::SatHelper::SatConstellationEnabled", BooleanValue(
true));
827 Config::SetDefault(
"ns3::SatHelper::SatConstellationFolder", StringValue(
"telesat-351-sats"));
828 Config::SetDefault(
"ns3::SatSGP4MobilityModel::StartDateStr",
829 StringValue(
"2000-01-01 00:00:00"));
830 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
831 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
832 TimeValue(MilliSeconds(10)));
833 Config::SetDefault(
"ns3::SatGeoHelper::IslArbiterType", EnumValue(SatEnums::UNICAST));
834 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
837 Config::SetDefault(
"ns3::SatAntennaGainPatternContainer::PatternsFolder",
838 StringValue(
"SatAntennaGain72BeamsShifted"));
841 Config::SetDefault(
"ns3::SatHelper::BeamNetworkAddress", Ipv4AddressValue(
"20.1.0.0"));
842 Config::SetDefault(
"ns3::SatHelper::GwNetworkAddress", Ipv4AddressValue(
"10.1.0.0"));
843 Config::SetDefault(
"ns3::SatHelper::UtNetworkAddress", Ipv4AddressValue(
"250.1.0.0"));
845 Ptr<SimulationHelper> simulationHelper =
846 CreateObject<SimulationHelper>(
"test-sat-constellation");
849 simulationHelper->SetBeamSet({1, 43, 60, 64});
850 simulationHelper->SetUserCountPerUt(5);
852 simulationHelper->CreateSatScenario();
853 m_helper = simulationHelper->GetSatelliteHelper();
855 NodeContainer sats =
m_helper->GeoSatNodes();
856 NodeContainer gws =
m_helper->GwNodes();
857 NodeContainer uts =
m_helper->UtNodes();
858 NodeContainer gwUsers =
m_helper->GetGwUsers();
859 NodeContainer utUsers =
m_helper->GetUtUsers();
861 uint32_t countNetDevices = 0;
862 uint32_t countIslNetDevice = 0;
863 for (uint32_t i = 0; i < sats.GetN(); i++)
865 for (uint32_t j = 0; j < sats.Get(i)->GetNDevices(); j++)
867 if (DynamicCast<SatGeoNetDevice>(sats.Get(i)->GetDevice(j)) !=
nullptr)
869 countNetDevices += 1;
870 countIslNetDevice += DynamicCast<SatGeoNetDevice>(sats.Get(i)->GetDevice(j))
871 ->GetIslsNetDevices()
877 NS_TEST_ASSERT_MSG_EQ(sats.GetN(), 351,
"Topology must contain 351 satellites");
878 NS_TEST_ASSERT_MSG_EQ(countNetDevices,
880 "Topology must contain 351 satellite Geo Net Devices");
881 NS_TEST_ASSERT_MSG_EQ(countIslNetDevice,
883 "Topology must contain 1404 (351*4) satellite ISL Net Devices");
884 NS_TEST_ASSERT_MSG_EQ(gws.GetN(), 2,
"Topology must contain 2 GWs");
885 NS_TEST_ASSERT_MSG_EQ(uts.GetN(), 3,
"Topology must contain 3 UTs");
886 NS_TEST_ASSERT_MSG_EQ(gwUsers.GetN(), 3,
"Topology must contain 3 GW users");
887 NS_TEST_ASSERT_MSG_EQ(utUsers.GetN(), 15,
"Topology must contain 15 UT users");
889 for (uint32_t i = 0; i < sats.GetN(); i++)
891 Ptr<SatIslArbiter> arbiter =
892 DynamicCast<SatGeoNetDevice>(sats.Get(i)->GetDevice(0))->GetArbiter();
893 Ptr<SatIslArbiterUnicast> arbiterUnicast = DynamicCast<SatIslArbiterUnicast>(arbiter);
894 NS_TEST_ASSERT_MSG_NE(arbiterUnicast,
896 "Arbiter of satellite " << i
897 <<
" is not of type SatIslArbiterUnicast");
898 for (uint32_t j = 0; j < sats.GetN(); j++)
902 NS_TEST_ASSERT_MSG_NE(arbiterUnicast->Decide(i, j,
nullptr),
904 "No entry in arbiter of satellite " << i <<
" to satellite "
910 Simulator::Destroy();
924 : TestSuite(
"sat-constellation-test", SYSTEM)
'Constellation, test 1' test case implementation.
Ptr< SatHelper > m_helper
virtual ~SatConstellationTest1()
'Constellation, test 2 test case implementation.
std::vector< std::string > Split(std::string s, char del)
void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue)
Ptr< SatHelper > m_helper
virtual ~SatConstellationTest2()
'Constellation, test 3 test case implementation.
Ptr< SatHelper > m_helper
std::vector< std::string > Split(std::string s, char del)
void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue)
virtual ~SatConstellationTest3()
'Constellation, test 4' test case implementation.
Ptr< SatHelper > m_helper
virtual ~SatConstellationTest4()
SatConstellationTestSuite()
GeoCoordinate class is used to store and operate with geodetic coordinates.
double GetAltitude() const
Gets altitude value of coordinate.
double GetLatitude() const
Gets latitude value of coordinate.
double GetLongitude() const
Gets longitude value of coordinate.
Keep track of the current position and velocity of an object in satellite network.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatConstellationTestSuite satConstellationTestSuite