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-gw-mac.h>
37 #include <ns3/satellite-helper.h>
38 #include <ns3/satellite-id-mapper.h>
39 #include <ns3/satellite-isl-arbiter-unicast.h>
40 #include <ns3/satellite-isl-arbiter.h>
41 #include <ns3/satellite-orbiter-feeder-phy.h>
42 #include <ns3/satellite-orbiter-net-device.h>
43 #include <ns3/satellite-orbiter-user-phy.h>
44 #include <ns3/satellite-phy-rx-carrier.h>
45 #include <ns3/satellite-topology.h>
46 #include <ns3/satellite-ut-mac-state.h>
47 #include <ns3/simulation-helper.h>
48 #include <ns3/simulator.h>
49 #include <ns3/singleton.h>
50 #include <ns3/string.h>
79 virtual void DoRun(
void);
84 : TestCase(
"This case tests that a topology is correctly loaded.")
103 Singleton<SatEnvVariables>::Get()->DoInitialize();
104 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test1",
true);
107 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
108 EnumValue(SatEnums::REGENERATION_NETWORK));
109 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
110 EnumValue(SatEnums::REGENERATION_NETWORK));
113 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
114 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
115 TimeValue(MilliSeconds(10)));
116 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
118 Ptr<SimulationHelper> simulationHelper =
119 CreateObject<SimulationHelper>(
"test-sat-constellation");
122 simulationHelper->SetBeamSet({43, 30});
123 simulationHelper->SetUserCountPerUt(5);
125 simulationHelper->LoadScenario(
"constellation-eutelsat-geo-2-sats-no-isls");
127 simulationHelper->CreateSatScenario();
129 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
130 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
131 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
132 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
133 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
135 uint32_t countNetDevices = 0;
136 for (uint32_t i = 0; i < sats.GetN(); i++)
138 for (uint32_t j = 0; j < sats.Get(i)->GetNDevices(); j++)
140 if (DynamicCast<SatOrbiterNetDevice>(sats.Get(i)->GetDevice(j)) !=
nullptr)
142 countNetDevices += 1;
147 NS_TEST_ASSERT_MSG_EQ(sats.GetN(), 2,
"Topology must contain 2 satellites");
148 NS_TEST_ASSERT_MSG_EQ(countNetDevices,
150 "Topology must contain 2 satellite Orbiter Net Devices");
151 NS_TEST_ASSERT_MSG_EQ(gws.GetN(), 2,
"Topology must contain 2 GWs");
152 NS_TEST_ASSERT_MSG_EQ(uts.GetN(), 3,
"Topology must contain 3 UTs");
153 NS_TEST_ASSERT_MSG_EQ(gwUsers.GetN(), 3,
"Topology must contain 3 GW users");
154 NS_TEST_ASSERT_MSG_EQ(utUsers.GetN(), 15,
"Topology must contain 15 UT users");
169 "Incorrect latitude for satellite 1");
173 "Incorrect longitude for satellite 1");
177 "Incorrect altitude for satellite 1");
182 "Incorrect latitude for satellite 2");
186 "Incorrect longitude for satellite 2");
190 "Incorrect altitude for satellite 2");
192 NS_TEST_ASSERT_MSG_EQ_TOL(gw1.
GetLatitude(), 48.85, 0.001,
"Incorrect latitude for GW 1");
193 NS_TEST_ASSERT_MSG_EQ_TOL(gw1.
GetLongitude(), 2.34, 0.001,
"Incorrect longitude for GW 1");
194 NS_TEST_ASSERT_MSG_EQ(gw1.
GetAltitude(), 0,
"Incorrect altitude for GW 1");
196 NS_TEST_ASSERT_MSG_EQ_TOL(gw2.
GetLatitude(), 55.75, 0.001,
"Incorrect latitude for GW 2");
197 NS_TEST_ASSERT_MSG_EQ_TOL(gw2.
GetLongitude(), 37.62, 0.001,
"Incorrect longitude for GW 2");
198 NS_TEST_ASSERT_MSG_EQ(gw2.
GetAltitude(), 0,
"Incorrect altitude for GW 2");
200 NS_TEST_ASSERT_MSG_EQ_TOL(ut1.
GetLatitude(), 48.8534, 0.001,
"Incorrect latitude for UT 1");
201 NS_TEST_ASSERT_MSG_EQ_TOL(ut1.
GetLongitude(), 2.3488, 0.001,
"Incorrect longitude for UT 1");
202 NS_TEST_ASSERT_MSG_EQ(ut1.
GetAltitude(), 0,
"Incorrect altitude for UT 1");
204 NS_TEST_ASSERT_MSG_EQ_TOL(ut2.
GetLatitude(), 55.755, 0.001,
"Incorrect latitude for UT 2");
205 NS_TEST_ASSERT_MSG_EQ_TOL(ut2.
GetLongitude(), 37.6218, 0.001,
"Incorrect longitude for UT 2");
206 NS_TEST_ASSERT_MSG_EQ(ut2.
GetAltitude(), 0,
"Incorrect altitude for UT 2");
208 NS_TEST_ASSERT_MSG_EQ_TOL(ut3.
GetLatitude(), 55.754, 0.001,
"Incorrect latitude for UT 3");
209 NS_TEST_ASSERT_MSG_EQ_TOL(ut3.
GetLongitude(), 37.621, 0.001,
"Incorrect longitude for UT 3");
210 NS_TEST_ASSERT_MSG_EQ(ut3.
GetAltitude(), 0,
"Incorrect altitude for UT 3");
212 Simulator::Destroy();
238 virtual void DoRun(
void);
240 std::vector<std::string>
Split(std::string s,
char del);
241 void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue);
246 : TestCase(
"This case tests that a application throughputs PerEntity are correct.")
256 std::vector<std::string>
259 std::stringstream ss(s);
261 std::vector<std::string> tokens;
264 std::getline(ss, word, del);
265 tokens.push_back(word);
274 std::ifstream myfile(path);
275 std::string delimiter =
" ";
279 if (myfile.is_open())
282 while (std::getline(myfile, line))
284 std::vector<std::string> tokens =
Split(line,
' ');
285 if (tokens.size() == 2)
287 if ((uint32_t)std::stoi(tokens[0]) == time)
289 NS_TEST_ASSERT_MSG_EQ_TOL(std::stof(tokens[1]),
292 "Incorrect throughput for statistic " << path);
301 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot find time " << time <<
" for trace file " << path);
306 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot read trace file " << path);
317 Singleton<SatIdMapper>::Get()->Reset();
320 Singleton<SatEnvVariables>::Get()->DoInitialize();
321 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test2",
true);
324 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
325 EnumValue(SatEnums::REGENERATION_NETWORK));
326 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
327 EnumValue(SatEnums::REGENERATION_NETWORK));
330 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
331 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
332 TimeValue(MilliSeconds(10)));
333 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
335 Ptr<SimulationHelper> simulationHelper =
336 CreateObject<SimulationHelper>(
"test-sat-constellation/test2");
339 simulationHelper->SetBeamSet({43, 30});
340 simulationHelper->SetUserCountPerUt(5);
342 simulationHelper->LoadScenario(
"constellation-eutelsat-geo-2-sats-no-isls");
344 simulationHelper->CreateSatScenario();
346 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
347 SatTrafficHelper::FWD_LINK,
348 SatTrafficHelper::UDP,
351 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
352 Singleton<SatTopology>::Get()->GetUtUserNodes(),
357 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
358 SatTrafficHelper::RTN_LINK,
359 SatTrafficHelper::UDP,
362 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
363 Singleton<SatTopology>::Get()->GetUtUserNodes(),
368 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
370 s->AddGlobalFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
371 s->AddGlobalRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
372 s->AddPerGwFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
373 s->AddPerGwRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
374 s->AddPerSatFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
375 s->AddPerSatRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
376 s->AddPerBeamFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
377 s->AddPerBeamRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
378 s->AddPerUtFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
379 s->AddPerUtRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
381 simulationHelper->SetSimulationTime(Seconds(10));
382 simulationHelper->RunSimulation();
384 Simulator::Destroy();
387 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
388 "stat-global-fwd-app-throughput-scatter-0.txt",
391 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
392 "stat-global-rtn-app-throughput-scatter-0.txt",
397 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
398 "stat-per-sat-fwd-app-throughput-scatter-1.txt",
401 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
402 "stat-per-sat-fwd-app-throughput-scatter-2.txt",
405 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
406 "stat-per-sat-rtn-app-throughput-scatter-1.txt",
409 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
410 "stat-per-sat-rtn-app-throughput-scatter-2.txt",
415 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
416 "stat-per-beam-fwd-app-throughput-scatter-1-30.txt",
419 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
420 "stat-per-beam-fwd-app-throughput-scatter-1-43.txt",
423 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
424 "stat-per-beam-fwd-app-throughput-scatter-2-30.txt",
427 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
428 "stat-per-beam-fwd-app-throughput-scatter-2-43.txt",
431 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
432 "stat-per-beam-rtn-app-throughput-scatter-1-30.txt",
435 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
436 "stat-per-beam-rtn-app-throughput-scatter-1-43.txt",
439 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
440 "stat-per-beam-rtn-app-throughput-scatter-2-30.txt",
443 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
444 "stat-per-beam-rtn-app-throughput-scatter-2-43.txt",
449 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
450 "stat-per-gw-fwd-app-throughput-scatter-1.txt",
453 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
454 "stat-per-gw-fwd-app-throughput-scatter-2.txt",
457 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
458 "stat-per-gw-rtn-app-throughput-scatter-1.txt",
461 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
462 "stat-per-gw-rtn-app-throughput-scatter-2.txt",
467 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
468 "stat-per-ut-fwd-app-throughput-scatter-1.txt",
471 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
472 "stat-per-ut-fwd-app-throughput-scatter-2.txt",
475 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
476 "stat-per-ut-fwd-app-throughput-scatter-3.txt",
479 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
480 "stat-per-ut-rtn-app-throughput-scatter-1.txt",
483 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
484 "stat-per-ut-rtn-app-throughput-scatter-2.txt",
487 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test2/"
488 "stat-per-ut-rtn-app-throughput-scatter-3.txt",
516 virtual void DoRun(
void);
518 std::vector<std::string>
Split(std::string s,
char del);
519 void TestFileValue(std::string path, uint32_t time, uint32_t expectedValue);
524 : TestCase(
"This case tests that a application throughputs PerEntity are correct.")
534 std::vector<std::string>
537 std::stringstream ss(s);
539 std::vector<std::string> tokens;
542 std::getline(ss, word, del);
543 tokens.push_back(word);
552 std::ifstream myfile(path);
553 std::string delimiter =
" ";
557 if (myfile.is_open())
560 while (std::getline(myfile, line))
562 std::vector<std::string> tokens =
Split(line,
' ');
563 if (tokens.size() == 2)
565 if ((uint32_t)std::stoi(tokens[0]) == time)
567 NS_TEST_ASSERT_MSG_EQ_TOL(std::stof(tokens[1]),
570 "Incorrect throughput for statistic " << path);
579 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot find time " << time <<
" for trace file " << path);
584 NS_TEST_ASSERT_MSG_EQ(0, 1,
"Cannot read trace file " << path);
595 Singleton<SatIdMapper>::Get()->Reset();
598 Singleton<SatEnvVariables>::Get()->DoInitialize();
599 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test3",
true);
602 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
603 EnumValue(SatEnums::REGENERATION_NETWORK));
604 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
605 EnumValue(SatEnums::REGENERATION_NETWORK));
608 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
609 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
610 TimeValue(MilliSeconds(10)));
611 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
613 Ptr<SimulationHelper> simulationHelper =
614 CreateObject<SimulationHelper>(
"test-sat-constellation/test3");
617 simulationHelper->SetBeamSet({43, 30});
618 simulationHelper->SetUserCountPerUt(5);
620 simulationHelper->LoadScenario(
"constellation-eutelsat-geo-2-sats-isls");
622 simulationHelper->CreateSatScenario();
624 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
625 SatTrafficHelper::FWD_LINK,
626 SatTrafficHelper::UDP,
629 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
630 Singleton<SatTopology>::Get()->GetUtUserNodes(),
635 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
636 SatTrafficHelper::RTN_LINK,
637 SatTrafficHelper::UDP,
640 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
641 Singleton<SatTopology>::Get()->GetUtUserNodes(),
646 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
648 s->AddGlobalFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
649 s->AddGlobalRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
650 s->AddPerGwFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
651 s->AddPerGwRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
652 s->AddPerSatFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
653 s->AddPerSatRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
654 s->AddPerBeamFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
655 s->AddPerBeamRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
656 s->AddPerUtFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
657 s->AddPerUtRtnAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
659 simulationHelper->SetSimulationTime(Seconds(10));
660 simulationHelper->RunSimulation();
662 Simulator::Destroy();
665 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
666 "stat-global-fwd-app-throughput-scatter-0.txt",
669 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
670 "stat-global-rtn-app-throughput-scatter-0.txt",
675 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
676 "stat-per-sat-fwd-app-throughput-scatter-1.txt",
679 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
680 "stat-per-sat-fwd-app-throughput-scatter-2.txt",
683 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
684 "stat-per-sat-rtn-app-throughput-scatter-1.txt",
687 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
688 "stat-per-sat-rtn-app-throughput-scatter-2.txt",
693 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
694 "stat-per-beam-fwd-app-throughput-scatter-1-30.txt",
697 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
698 "stat-per-beam-fwd-app-throughput-scatter-1-43.txt",
701 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
702 "stat-per-beam-fwd-app-throughput-scatter-2-30.txt",
705 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
706 "stat-per-beam-fwd-app-throughput-scatter-2-43.txt",
709 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
710 "stat-per-beam-rtn-app-throughput-scatter-1-30.txt",
713 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
714 "stat-per-beam-rtn-app-throughput-scatter-1-43.txt",
717 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
718 "stat-per-beam-rtn-app-throughput-scatter-2-30.txt",
721 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
722 "stat-per-beam-rtn-app-throughput-scatter-2-43.txt",
727 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
728 "stat-per-gw-fwd-app-throughput-scatter-1.txt",
731 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
732 "stat-per-gw-fwd-app-throughput-scatter-2.txt",
735 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
736 "stat-per-gw-rtn-app-throughput-scatter-1.txt",
739 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
740 "stat-per-gw-rtn-app-throughput-scatter-2.txt",
745 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
746 "stat-per-ut-fwd-app-throughput-scatter-1.txt",
749 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
750 "stat-per-ut-fwd-app-throughput-scatter-2.txt",
753 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
754 "stat-per-ut-fwd-app-throughput-scatter-3.txt",
757 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
758 "stat-per-ut-rtn-app-throughput-scatter-1.txt",
761 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
762 "stat-per-ut-rtn-app-throughput-scatter-2.txt",
765 TestFileValue(
"contrib/satellite/data/sims/test-sat-constellation/test3/"
766 "stat-per-ut-rtn-app-throughput-scatter-3.txt",
790 virtual void DoRun(
void);
796 "This case tests that a topology with hundreds of LEO satellites is correctly loaded.")
815 Singleton<SatEnvVariables>::Get()->DoInitialize();
816 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-constellation",
"test4",
true);
819 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
820 EnumValue(SatEnums::REGENERATION_NETWORK));
821 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
822 EnumValue(SatEnums::REGENERATION_NETWORK));
825 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
826 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
827 TimeValue(MilliSeconds(10)));
828 Config::SetDefault(
"ns3::SatOrbiterHelper::IslArbiterType", EnumValue(SatEnums::UNICAST));
829 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
832 Config::SetDefault(
"ns3::SatHelper::BeamNetworkAddress", Ipv4AddressValue(
"20.1.0.0"));
833 Config::SetDefault(
"ns3::SatHelper::GwNetworkAddress", Ipv4AddressValue(
"10.1.0.0"));
834 Config::SetDefault(
"ns3::SatHelper::UtNetworkAddress", Ipv4AddressValue(
"250.1.0.0"));
836 Ptr<SimulationHelper> simulationHelper =
837 CreateObject<SimulationHelper>(
"test-sat-constellation");
840 simulationHelper->SetBeamSet({1, 43, 60, 64});
841 simulationHelper->SetUserCountPerUt(5);
843 simulationHelper->LoadScenario(
"constellation-telesat-351-sats");
845 simulationHelper->CreateSatScenario();
847 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
848 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
849 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
850 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
851 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
853 uint32_t countNetDevices = 0;
854 uint32_t countIslNetDevice = 0;
855 for (uint32_t i = 0; i < sats.GetN(); i++)
857 for (uint32_t j = 0; j < sats.Get(i)->GetNDevices(); j++)
859 if (DynamicCast<SatOrbiterNetDevice>(sats.Get(i)->GetDevice(j)) !=
nullptr)
861 countNetDevices += 1;
862 countIslNetDevice += DynamicCast<SatOrbiterNetDevice>(sats.Get(i)->GetDevice(j))
863 ->GetIslsNetDevices()
869 NS_TEST_ASSERT_MSG_EQ(sats.GetN(), 351,
"Topology must contain 351 satellites");
870 NS_TEST_ASSERT_MSG_EQ(countNetDevices,
872 "Topology must contain 351 satellite Orbiter Net Devices");
873 NS_TEST_ASSERT_MSG_EQ(countIslNetDevice,
875 "Topology must contain 1404 (351*4) satellite ISL Net Devices");
876 NS_TEST_ASSERT_MSG_EQ(gws.GetN(), 2,
"Topology must contain 2 GWs");
877 NS_TEST_ASSERT_MSG_EQ(uts.GetN(), 3,
"Topology must contain 3 UTs");
878 NS_TEST_ASSERT_MSG_EQ(gwUsers.GetN(), 3,
"Topology must contain 3 GW users");
879 NS_TEST_ASSERT_MSG_EQ(utUsers.GetN(), 15,
"Topology must contain 15 UT users");
881 for (uint32_t i = 0; i < sats.GetN(); i++)
883 Ptr<SatIslArbiter> arbiter =
884 DynamicCast<SatOrbiterNetDevice>(sats.Get(i)->GetDevice(0))->GetArbiter();
885 Ptr<SatIslArbiterUnicast> arbiterUnicast = DynamicCast<SatIslArbiterUnicast>(arbiter);
886 NS_TEST_ASSERT_MSG_NE(arbiterUnicast,
888 "Arbiter of satellite " << i
889 <<
" is not of type SatIslArbiterUnicast");
890 for (uint32_t j = 0; j < sats.GetN(); j++)
894 NS_TEST_ASSERT_MSG_NE(arbiterUnicast->Decide(i, j,
nullptr),
896 "No entry in arbiter of satellite " << i <<
" to satellite "
902 Simulator::Destroy();
916 : TestSuite(
"sat-constellation-test", Type::SYSTEM)
920 TestCase::Duration::QUICK);
922 TestCase::Duration::QUICK);
924 TestCase::Duration::QUICK);
'Constellation, test 1' test case implementation.
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)
virtual ~SatConstellationTest2()
'Constellation, test 3 test case implementation.
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.
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