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-orbiter-feeder-phy.h>
39 #include <ns3/satellite-orbiter-net-device.h>
40 #include <ns3/satellite-orbiter-user-phy.h>
41 #include <ns3/satellite-phy-rx-carrier.h>
42 #include <ns3/satellite-phy-tx.h>
43 #include <ns3/satellite-topology.h>
44 #include <ns3/satellite-ut-mac-state.h>
45 #include <ns3/simulation-helper.h>
46 #include <ns3/simulator.h>
47 #include <ns3/singleton.h>
48 #include <ns3/string.h>
69 virtual void DoRun(
void);
70 void PhyDelayTraceCb(std::string context,
const Time& time,
const Address& address);
71 void OrbiterFeederPhyTraceDelayCb(
const Time& time,
const Address& address);
72 void OrbiterUserPhyTraceDelayCb(
const Time& time,
const Address& address);
88 "This case tests that delay of packets takes into account regeneration in satellite.")
132 Singleton<SatEnvVariables>::Get()->DoInitialize();
133 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test1",
true);
136 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
137 EnumValue(SatEnums::REGENERATION_PHY));
138 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
139 EnumValue(SatEnums::REGENERATION_PHY));
141 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
144 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
145 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
148 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
150 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"500ms"));
151 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
154 m_helper = CreateObject<SatHelper>(Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
155 "/scenarios/geo-33E");
156 m_helper->CreatePredefinedScenario(SatHelper::SIMPLE);
158 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
159 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
163 CbrHelper cbrForward(
164 "ns3::UdpSocketFactory",
165 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
166 ApplicationContainer gwAppsForward = cbrForward.Install(gwUsers);
167 gwAppsForward.Start(Seconds(1.0));
168 gwAppsForward.Stop(Seconds(5.0));
170 PacketSinkHelper sinkForward(
171 "ns3::UdpSocketFactory",
172 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
173 ApplicationContainer utAppsForward = sinkForward.Install(utUsers);
174 utAppsForward.Start(Seconds(1.0));
175 utAppsForward.Stop(Seconds(10.0));
178 CbrHelper cbrReturn(
"ns3::UdpSocketFactory",
179 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
180 ApplicationContainer utAppsReturn = cbrReturn.Install(utUsers);
181 utAppsReturn.Start(Seconds(1.0));
182 utAppsReturn.Stop(Seconds(5.0));
184 PacketSinkHelper sinkReturn(
185 "ns3::UdpSocketFactory",
186 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
187 ApplicationContainer gwAppsReturn = sinkReturn.Install(gwUsers);
188 gwAppsReturn.Start(Seconds(1.0));
189 gwAppsReturn.Stop(Seconds(10.0));
191 m_gwAddress = Singleton<SatTopology>::Get()->GetGwNode(0)->GetDevice(1)->GetAddress();
192 m_stAddress = Singleton<SatTopology>::Get()->GetUtNode(0)->GetDevice(2)->GetAddress();
194 Ptr<SatOrbiterFeederPhy> satOrbiterFeederPhy = DynamicCast<SatOrbiterFeederPhy>(
195 DynamicCast<SatOrbiterNetDevice>(
196 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
198 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = DynamicCast<SatOrbiterUserPhy>(
199 DynamicCast<SatOrbiterNetDevice>(
200 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
203 satOrbiterFeederPhy->TraceConnectWithoutContext(
206 satOrbiterUserPhy->TraceConnectWithoutContext(
209 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/RxLinkDelay",
212 Ptr<SatChannel> feederChannel = satOrbiterFeederPhy->GetPhyTx()->GetChannel();
213 Ptr<SatChannel> userChannel = satOrbiterUserPhy->GetPhyTx()->GetChannel();
215 Ptr<PropagationDelayModel> feederDelayModel = feederChannel->GetPropagationDelayModel();
216 Ptr<PropagationDelayModel> userDelayModel = userChannel->GetPropagationDelayModel();
218 Time feederDelay = feederDelayModel->GetDelay(
219 DynamicCast<SatNetDevice>(Singleton<SatTopology>::Get()->GetGwNode(0)->GetDevice(1))
223 satOrbiterFeederPhy->GetPhyTx()->GetMobility());
225 Time userDelay = userDelayModel->GetDelay(
226 DynamicCast<SatNetDevice>(Singleton<SatTopology>::Get()->GetUtNode(0)->GetDevice(2))
230 satOrbiterUserPhy->GetPhyTx()->GetMobility());
232 Simulator::Stop(Seconds(10));
235 Simulator::Destroy();
243 Time fwdTime = NanoSeconds(319507) - MicroSeconds(1);
244 Time rtnTime = NanoSeconds(668928) - MicroSeconds(1);
250 "Transmission time on FWD FEEDER incorrect.");
257 "Transmission time on RTN USER incorrect.");
264 "Transmission time on FWD USER incorrect.");
271 "Transmission time on RTN FEEDER incorrect.");
294 virtual void DoRun(
void);
299 Mac48Address address,
302 std::string packetInfo);
307 Mac48Address address,
310 std::string packetInfo);
327 : TestCase(
"This case tests physical regeneration on satellite. It is based on a SIMPLE "
328 "scenario, with losses on uplink, forward and return."),
329 m_packetsReceivedFeeder(0),
330 m_packetsDroppedFeeder(0),
331 m_packetsReceivedUser(0),
332 m_packetsDroppedUser(0),
333 m_packetsReceivedUt(0),
334 m_packetsDroppedUt(0),
335 m_packetsReceivedGw(0),
336 m_packetsDroppedGw(0)
351 Mac48Address address,
354 std::string packetInfo)
358 case SatEnums::LD_FORWARD:
359 if (event == SatEnums::PACKET_RECV)
363 else if (event == SatEnums::PACKET_DROP)
368 case SatEnums::LD_RETURN:
369 if (event == SatEnums::PACKET_RECV)
373 else if (event == SatEnums::PACKET_DROP)
388 Mac48Address address,
391 std::string packetInfo)
395 case SatEnums::LD_FORWARD:
396 if (event == SatEnums::PACKET_RECV)
400 else if (event == SatEnums::PACKET_DROP)
405 case SatEnums::LD_RETURN:
406 if (event == SatEnums::PACKET_RECV)
410 else if (event == SatEnums::PACKET_DROP)
429 Singleton<SatEnvVariables>::Get()->DoInitialize();
430 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test2",
true);
433 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
434 EnumValue(SatEnums::REGENERATION_PHY));
435 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
436 EnumValue(SatEnums::REGENERATION_PHY));
438 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
441 Config::SetDefault(
"ns3::SatOrbiterHelper::FwdLinkErrorModel",
442 EnumValue(SatPhyRxCarrierConf::EM_CONSTANT));
443 Config::SetDefault(
"ns3::SatOrbiterHelper::FwdLinkConstantErrorRate", DoubleValue(0.1));
444 Config::SetDefault(
"ns3::SatOrbiterHelper::RtnLinkErrorModel",
445 EnumValue(SatPhyRxCarrierConf::EM_CONSTANT));
446 Config::SetDefault(
"ns3::SatOrbiterHelper::RtnLinkConstantErrorRate", DoubleValue(0.1));
449 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
450 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
453 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
455 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"10ms"));
456 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
459 m_helper = CreateObject<SatHelper>(Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
460 "/scenarios/geo-33E");
461 m_helper->CreatePredefinedScenario(SatHelper::SIMPLE);
463 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
464 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
468 CbrHelper cbrForward(
469 "ns3::UdpSocketFactory",
470 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
471 ApplicationContainer gwAppsForward = cbrForward.Install(gwUsers);
472 gwAppsForward.Start(Seconds(1.0));
473 gwAppsForward.Stop(Seconds(59.0));
475 PacketSinkHelper sinkForward(
476 "ns3::UdpSocketFactory",
477 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
478 ApplicationContainer utAppsForward = sinkForward.Install(utUsers);
479 utAppsForward.Start(Seconds(1.0));
480 utAppsForward.Stop(Seconds(60.0));
483 CbrHelper cbrReturn(
"ns3::UdpSocketFactory",
484 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
485 ApplicationContainer utAppsReturn = cbrReturn.Install(utUsers);
486 utAppsReturn.Start(Seconds(1.0));
487 utAppsReturn.Stop(Seconds(59.0));
489 PacketSinkHelper sinkReturn(
490 "ns3::UdpSocketFactory",
491 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
492 ApplicationContainer gwAppsReturn = sinkReturn.Install(gwUsers);
493 gwAppsReturn.Start(Seconds(1.0));
494 gwAppsReturn.Stop(Seconds(60.0));
496 Ptr<SatOrbiterFeederPhy> satOrbiterFeederPhy = DynamicCast<SatOrbiterFeederPhy>(
497 DynamicCast<SatOrbiterNetDevice>(
498 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
500 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = DynamicCast<SatOrbiterUserPhy>(
501 DynamicCast<SatOrbiterNetDevice>(
502 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
505 satOrbiterFeederPhy->TraceConnectWithoutContext(
508 satOrbiterUserPhy->TraceConnectWithoutContext(
512 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatPhy/PacketTrace",
515 Simulator::Stop(Seconds(60));
518 Simulator::Destroy();
520 double dropRateForwardFeeder =
522 double dropRateReturnUser =
525 double forwardDifference =
527 double returnDifference =
530 NS_TEST_ASSERT_MSG_GT(dropRateForwardFeeder, 8.0,
"Not enough losses on FWD feeder");
531 NS_TEST_ASSERT_MSG_LT(dropRateForwardFeeder, 12.0,
"Too much losses on FWD feeder");
532 NS_TEST_ASSERT_MSG_GT(dropRateReturnUser, 8.0,
"Not enough losses on RTN user");
533 NS_TEST_ASSERT_MSG_LT(dropRateReturnUser, 12.0,
"Too much losses on RTN user");
540 NS_TEST_ASSERT_MSG_LT(
543 "Number of packets received on FWD should be almost the same between SAT and UT");
544 NS_TEST_ASSERT_MSG_LT(
547 "Number of packets received on RTN should be almost the same between SAT and GW");
569 virtual void DoRun(
void);
572 const Address& address,
576 const Address& address,
582 Mac48Address address,
585 std::string packetInfo);
604 : TestCase(
"This case tests physical regeneration on satellite. It is based on a LARGER "
605 "scenario, with collisions on return uplink."),
606 m_nbErrorpacketsFwd(0),
607 m_nbErrorpacketsRtn(0),
608 m_nbCollisionPacketsFwd(0),
609 m_nbCollisionPacketsRtn(0),
610 m_packetsReceivedFeeder(0),
611 m_packetsDroppedFeeder(0),
612 m_packetsReceivedUser(0),
613 m_packetsDroppedUser(0)
626 const Address& address,
646 const Address& address,
668 Mac48Address address,
671 std::string packetInfo)
675 case SatEnums::LD_FORWARD:
676 if (event == SatEnums::PACKET_RECV)
680 else if (event == SatEnums::PACKET_DROP)
685 case SatEnums::LD_RETURN:
686 if (event == SatEnums::PACKET_RECV)
690 else if (event == SatEnums::PACKET_DROP)
709 Singleton<SatEnvVariables>::Get()->DoInitialize();
710 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test3",
true);
713 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
714 EnumValue(SatEnums::REGENERATION_PHY));
715 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
716 EnumValue(SatEnums::REGENERATION_PHY));
718 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
721 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
722 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
725 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
728 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
729 EnumValue(SatEnums::RA_MODEL_SLOTTED_ALOHA));
732 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
733 EnumValue(SatPhyRxCarrierConf::IF_PER_PACKET));
736 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
739 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
740 BooleanValue(
false));
742 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
746 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
748 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
750 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
752 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
754 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
755 UintegerValue(10000));
756 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
757 UintegerValue(30000));
758 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
761 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
763 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
764 TimeValue(MilliSeconds(100)));
765 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
766 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
770 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
771 BooleanValue(
false));
772 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
773 BooleanValue(
false));
774 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
775 BooleanValue(
false));
776 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
777 BooleanValue(
false));
778 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
779 BooleanValue(
false));
780 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
781 BooleanValue(
false));
782 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
783 BooleanValue(
false));
784 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
785 BooleanValue(
false));
786 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
787 BooleanValue(
false));
788 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
789 BooleanValue(
false));
790 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
791 BooleanValue(
false));
792 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
793 BooleanValue(
false));
795 Config::SetDefault(
"ns3::SatOrbiterHelper::FwdLinkErrorModel",
796 EnumValue(SatPhyRxCarrierConf::EM_NONE));
797 Config::SetDefault(
"ns3::SatOrbiterHelper::RtnLinkErrorModel",
798 EnumValue(SatPhyRxCarrierConf::EM_AVI));
799 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
800 EnumValue(SatPhyRxCarrierConf::RA_COLLISION_CHECK_AGAINST_SINR));
802 Ptr<SimulationHelper> simulationHelper =
803 CreateObject<SimulationHelper>(
"test-sat-regeneration");
804 simulationHelper->SetSimulationTime(Seconds(5));
805 simulationHelper->SetUserCountPerUt(1);
806 simulationHelper->SetUtCountPerBeam(50);
807 simulationHelper->SetBeamSet({1});
809 simulationHelper->LoadScenario(
"geo-33E");
811 simulationHelper->CreateSatScenario();
813 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
814 SatTrafficHelper::RTN_LINK,
815 SatTrafficHelper::UDP,
818 Singleton<SatTopology>::Get()->GetGwUserNodes(),
819 Singleton<SatTopology>::Get()->GetUtUserNodes(),
824 m_helper = simulationHelper->GetSatelliteHelper();
826 Ptr<SatOrbiterFeederPhy> satOrbiterFeederPhy = DynamicCast<SatOrbiterFeederPhy>(
827 DynamicCast<SatOrbiterNetDevice>(
828 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
830 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = DynamicCast<SatOrbiterUserPhy>(
831 DynamicCast<SatOrbiterNetDevice>(
832 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
835 m_gwAddress = Singleton<SatTopology>::Get()->GetGwNode(0)->GetDevice(1)->GetAddress();
837 satOrbiterFeederPhy->TraceConnectWithoutContext(
840 satOrbiterUserPhy->TraceConnectWithoutContext(
845 "/NodeList/*/DeviceList/*/FeederPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxError",
848 "/NodeList/*/DeviceList/*/FeederPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxCollision",
850 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxError",
853 "/NodeList/*/DeviceList/*/UserPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxCollision",
856 Simulator::Stop(Seconds(5));
859 Simulator::Destroy();
864 "Packets received on RTN user link due to collisions");
868 "Packets dropped on RTN user link due to collisions");
893 virtual void DoRun(
void);
935 for (uint32_t i = 0; i < node->GetNApplications(); i++)
937 Ptr<PacketSink> sink = DynamicCast<PacketSink>(node->GetApplication(i));
941 sink->GetAttribute(
"Local", av);
942 if (InetSocketAddress::ConvertFrom(av.Get()).GetPort() == port)
953 : TestCase(
"This case tests link regeneration on satellite. It is based on a LARGER scenario.")
976 Singleton<SatEnvVariables>::Get()->DoInitialize();
977 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test4",
true);
980 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
981 EnumValue(SatEnums::REGENERATION_PHY));
982 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
983 EnumValue(SatEnums::REGENERATION_LINK));
985 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
988 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
989 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
992 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
994 Ptr<SimulationHelper> simulationHelper =
995 CreateObject<SimulationHelper>(
"test-sat-regeneration");
996 simulationHelper->SetSimulationTime(Seconds(20));
998 simulationHelper->LoadScenario(
"geo-33E");
1000 simulationHelper->CreateSatScenario(SatHelper::LARGER);
1002 m_helper = simulationHelper->GetSatelliteHelper();
1004 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1005 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1008 for (i = 0; i < gws.GetN(); i++)
1010 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1013 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1017 for (i = 0; i < uts.GetN(); i++)
1019 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1022 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1027 std::string socketFactory =
"ns3::UdpSocketFactory";
1030 PacketSinkHelper sinkHelper(socketFactory, Address());
1031 CbrHelper cbrHelper(socketFactory, Address());
1032 ApplicationContainer sinkContainer;
1033 ApplicationContainer cbrContainer;
1035 Time startTime = Seconds(1);
1036 Time stopTime = Seconds(15);
1037 Time startDelay = MilliSeconds(10);
1038 Time interval = MilliSeconds(100);
1039 uint32_t packetSize = 512;
1041 for (uint32_t j = 0; j < gws.GetN(); j++)
1043 for (uint32_t i = 0; i < uts.GetN(); i++)
1045 InetSocketAddress gwUserAddr =
1046 InetSocketAddress(
m_helper->GetUserAddress(gws.Get(j)), port);
1049 sinkHelper.SetAttribute(
"Local", AddressValue(Address(gwUserAddr)));
1050 sinkContainer.Add(sinkHelper.Install(gws.Get(j)));
1053 cbrHelper.SetConstantTraffic(Time(interval), packetSize);
1054 cbrHelper.SetAttribute(
"Remote", AddressValue(Address(gwUserAddr)));
1055 auto app = cbrHelper.Install(uts.Get(i)).Get(0);
1056 app->SetStartTime(startTime + (i + j * gws.GetN() + 1) * startDelay);
1057 app->SetStopTime(stopTime);
1058 cbrContainer.Add(app);
1062 sinkContainer.Start(startTime);
1063 sinkContainer.Stop(stopTime + Seconds(1));
1065 simulationHelper->RunSimulation();
1067 Simulator::Destroy();
1069 NS_TEST_ASSERT_MSG_EQ(
m_totalSentGw, 0,
"No packets sent on FWD link");
1073 "Same number of packets sent and received on RTN link");
1096 virtual void DoRun(
void);
1102 double GetAverage(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1103 double GetMostFrequent(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1141 for (uint32_t i = beg; i < end; i++)
1145 return 1.0 * sum / (end - beg);
1151 std::map<uint32_t, uint32_t> frequencies;
1152 for (uint32_t i = beg; i < end; i++)
1154 frequencies[list[i]]++;
1157 uint32_t max_count = 0;
1158 uint32_t index = -1;
1159 for (std::pair<const uint32_t, uint32_t>& i : frequencies)
1161 if (max_count < i.second)
1164 max_count = i.second;
1173 : TestCase(
"This case tests ACM on all links. It is based on a SIMPLE scenario.")
1192 Singleton<SatEnvVariables>::Get()->DoInitialize();
1193 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test5",
true);
1196 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1197 EnumValue(SatEnums::REGENERATION_PHY));
1198 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1199 EnumValue(SatEnums::REGENERATION_LINK));
1201 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
1204 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
1207 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1208 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1211 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1213 Ptr<SimulationHelper> simulationHelper =
1214 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1215 simulationHelper->SetSimulationTime(Seconds(20));
1217 simulationHelper->LoadScenario(
"geo-33E");
1219 simulationHelper->CreateSatScenario(SatHelper::SIMPLE);
1221 m_helper = simulationHelper->GetSatelliteHelper();
1223 Ptr<Node> gwNode = Singleton<SatTopology>::Get()->GetGwNode(0);
1224 Ptr<Node> utNode = Singleton<SatTopology>::Get()->GetUtNode(0);
1225 Ptr<Node> satNode = Singleton<SatTopology>::Get()->GetOrbiterNode(0);
1226 Ptr<SatOrbiterFeederPhy> satOrbiterFeederPhy = DynamicCast<SatOrbiterFeederPhy>(
1227 DynamicCast<SatOrbiterNetDevice>(satNode->GetDevice(0))->GetFeederPhy(8));
1228 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = DynamicCast<SatOrbiterUserPhy>(
1229 DynamicCast<SatOrbiterNetDevice>(satNode->GetDevice(0))->GetUserPhy(8));
1230 Ptr<SatPhy> satGwPhy =
1231 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(gwNode->GetDevice(1))->GetPhy());
1232 Ptr<SatPhy> satUtPhy =
1233 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(utNode->GetDevice(2))->GetPhy());
1235 satGwPhy->TraceConnectWithoutContext(
1238 satUtPhy->TraceConnectWithoutContext(
1241 satOrbiterFeederPhy->TraceConnectWithoutContext(
1244 satOrbiterUserPhy->TraceConnectWithoutContext(
1248 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1249 SatTrafficHelper::FWD_LINK,
1250 SatTrafficHelper::UDP,
1253 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1254 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1259 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1260 SatTrafficHelper::RTN_LINK,
1261 SatTrafficHelper::UDP,
1264 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1265 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1270 simulationHelper->RunSimulation();
1272 Simulator::Destroy();
1278 double averageGwModcodsEnd =
1280 double averageUtModcodsEnd =
1282 double averageFeederModcodsEnd =
1284 double averageUserModcodsEnd =
1287 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsBeg,
1289 "Most robust MODCOD on FWD feeder link at startup");
1290 NS_TEST_ASSERT_MSG_EQ(averageUtModcodsBeg, 2,
"Most robust MODCOD on FWD user link at startup");
1291 NS_TEST_ASSERT_MSG_EQ(averageGwModcodsBeg,
1293 "Most robust MODCOD on RTN feeder link at startup");
1294 NS_TEST_ASSERT_MSG_EQ(averageUserModcodsBeg,
1296 "Most robust MODCOD on RTN user link at startup");
1298 NS_TEST_ASSERT_MSG_LT(averageFeederModcodsEnd, 28,
"Max MODCOD on FWD feeder link is 27");
1299 NS_TEST_ASSERT_MSG_LT(averageUtModcodsEnd, 28,
"Max MODCOD on FWD user link is 27");
1300 NS_TEST_ASSERT_MSG_LT(averageGwModcodsEnd, 28,
"Max MODCOD on RTN feeder link is 27");
1301 NS_TEST_ASSERT_MSG_LT(averageUserModcodsEnd, 24,
"Max MODCOD on RTN user link is 23");
1303 NS_TEST_ASSERT_MSG_GT(averageFeederModcodsEnd,
1305 "Most robust MODCOD on FWD feeder link not used after a few seconds");
1306 NS_TEST_ASSERT_MSG_GT(averageUtModcodsEnd,
1308 "Most robust MODCOD on FWD user link not used after a few seconds");
1309 NS_TEST_ASSERT_MSG_GT(averageGwModcodsEnd,
1311 "Most robust MODCOD on RTN feeder link not used after a few seconds");
1312 NS_TEST_ASSERT_MSG_GT(averageUserModcodsEnd,
1314 "Most robust MODCOD on RTN user link not used after a few seconds");
1316 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsEnd,
1317 averageUtModcodsEnd,
1318 "Same MODCOD on both FWD links");
1319 NS_TEST_ASSERT_MSG_NE(averageUserModcodsEnd,
1320 averageGwModcodsEnd,
1321 "Not same MODCOD on both RTN links");
1341 virtual void DoRun(
void);
1383 for (uint32_t i = 0; i < node->GetNApplications(); i++)
1385 Ptr<PacketSink> sink = DynamicCast<PacketSink>(node->GetApplication(i));
1386 if (sink !=
nullptr)
1389 sink->GetAttribute(
"Local", av);
1390 if (InetSocketAddress::ConvertFrom(av.Get()).GetPort() == port)
1402 "This case tests network regeneration on satellite. It is based on a LARGER scenario.")
1425 Singleton<SatEnvVariables>::Get()->DoInitialize();
1426 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test6",
true);
1429 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1430 EnumValue(SatEnums::REGENERATION_NETWORK));
1431 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1432 EnumValue(SatEnums::REGENERATION_NETWORK));
1434 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
1437 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1438 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1441 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1443 Ptr<SimulationHelper> simulationHelper =
1444 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1445 simulationHelper->SetSimulationTime(Seconds(20));
1447 simulationHelper->LoadScenario(
"geo-33E");
1449 simulationHelper->CreateSatScenario(SatHelper::LARGER);
1451 m_helper = simulationHelper->GetSatelliteHelper();
1453 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1454 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1457 for (i = 0; i < gws.GetN(); i++)
1459 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1462 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1466 for (i = 0; i < uts.GetN(); i++)
1468 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1471 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1476 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1477 SatTrafficHelper::FWD_LINK,
1478 SatTrafficHelper::UDP,
1481 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1482 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1487 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1488 SatTrafficHelper::RTN_LINK,
1489 SatTrafficHelper::UDP,
1492 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1493 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1498 simulationHelper->RunSimulation();
1500 Simulator::Destroy();
1506 "Same number of packets sent and received on FWD link (taking into "
1507 "account 2 UTs on beam 3)");
1510 "Same number of packets sent and received on RTN link");
1533 virtual void DoRun(
void);
1539 double GetAverage(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1540 double GetMostFrequent(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1578 for (uint32_t i = beg; i < end; i++)
1582 return 1.0 * sum / (end - beg);
1588 std::map<uint32_t, uint32_t> frequencies;
1589 for (uint32_t i = beg; i < end; i++)
1591 frequencies[list[i]]++;
1594 uint32_t max_count = 0;
1595 uint32_t index = -1;
1596 for (std::pair<const uint32_t, uint32_t>& i : frequencies)
1598 if (max_count < i.second)
1601 max_count = i.second;
1610 : TestCase(
"This case tests ACM on all links. It is based on a SIMPLE scenario.")
1629 Singleton<SatEnvVariables>::Get()->DoInitialize();
1630 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test7",
true);
1633 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1634 EnumValue(SatEnums::REGENERATION_NETWORK));
1635 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1636 EnumValue(SatEnums::REGENERATION_NETWORK));
1638 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
1641 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
1644 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1645 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1648 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1650 Ptr<SimulationHelper> simulationHelper =
1651 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1652 simulationHelper->SetSimulationTime(Seconds(20));
1654 simulationHelper->LoadScenario(
"geo-33E");
1656 simulationHelper->CreateSatScenario(SatHelper::SIMPLE);
1658 m_helper = simulationHelper->GetSatelliteHelper();
1660 Ptr<Node> gwNode = Singleton<SatTopology>::Get()->GetGwNode(0);
1661 Ptr<Node> utNode = Singleton<SatTopology>::Get()->GetUtNode(0);
1662 Ptr<Node> satNode = Singleton<SatTopology>::Get()->GetOrbiterNode(0);
1663 Ptr<SatOrbiterFeederPhy> satOrbiterFeederPhy = DynamicCast<SatOrbiterFeederPhy>(
1664 DynamicCast<SatOrbiterNetDevice>(satNode->GetDevice(0))->GetFeederPhy(8));
1665 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = DynamicCast<SatOrbiterUserPhy>(
1666 DynamicCast<SatOrbiterNetDevice>(satNode->GetDevice(0))->GetUserPhy(8));
1667 Ptr<SatPhy> satGwPhy =
1668 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(gwNode->GetDevice(1))->GetPhy());
1669 Ptr<SatPhy> satUtPhy =
1670 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(utNode->GetDevice(2))->GetPhy());
1672 satGwPhy->TraceConnectWithoutContext(
1675 satUtPhy->TraceConnectWithoutContext(
1678 satOrbiterFeederPhy->TraceConnectWithoutContext(
1681 satOrbiterUserPhy->TraceConnectWithoutContext(
1685 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1686 SatTrafficHelper::FWD_LINK,
1687 SatTrafficHelper::UDP,
1690 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1691 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1696 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1697 SatTrafficHelper::RTN_LINK,
1698 SatTrafficHelper::UDP,
1701 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1702 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1707 simulationHelper->RunSimulation();
1709 Simulator::Destroy();
1715 double averageGwModcodsEnd =
1717 double averageUtModcodsEnd =
1719 double averageFeederModcodsEnd =
1721 double averageUserModcodsEnd =
1724 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsBeg,
1726 "Most robust MODCOD on FWD feeder link at startup");
1727 NS_TEST_ASSERT_MSG_EQ(averageUtModcodsBeg, 2,
"Most robust MODCOD on FWD user link at startup");
1728 NS_TEST_ASSERT_MSG_EQ(averageGwModcodsBeg,
1730 "Most robust MODCOD on RTN feeder link at startup");
1731 NS_TEST_ASSERT_MSG_EQ(averageUserModcodsBeg,
1733 "Most robust MODCOD on RTN user link at startup");
1735 NS_TEST_ASSERT_MSG_LT(averageFeederModcodsEnd, 28,
"Max MODCOD on FWD feeder link is 27");
1736 NS_TEST_ASSERT_MSG_LT(averageUtModcodsEnd, 28,
"Max MODCOD on FWD user link is 27");
1737 NS_TEST_ASSERT_MSG_LT(averageGwModcodsEnd, 28,
"Max MODCOD on RTN feeder link is 27");
1738 NS_TEST_ASSERT_MSG_LT(averageUserModcodsEnd, 24,
"Max MODCOD on RTN user link is 23");
1740 NS_TEST_ASSERT_MSG_GT(averageFeederModcodsEnd,
1742 "Most robust MODCOD on FWD feeder link not used after a few seconds");
1743 NS_TEST_ASSERT_MSG_GT(averageUtModcodsEnd,
1745 "Most robust MODCOD on FWD user link not used after a few seconds");
1746 NS_TEST_ASSERT_MSG_GT(averageGwModcodsEnd,
1748 "Most robust MODCOD on RTN feeder link not used after a few seconds");
1749 NS_TEST_ASSERT_MSG_GT(averageUserModcodsEnd,
1751 "Most robust MODCOD on RTN user link not used after a few seconds");
1753 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsEnd,
1754 averageUtModcodsEnd,
1755 "Same MODCOD on both FWD links");
1756 NS_TEST_ASSERT_MSG_NE(averageUserModcodsEnd,
1757 averageGwModcodsEnd,
1758 "Not same MODCOD on both RTN links");
1784 virtual void DoRun(
void);
1790 Mac48Address macAddress,
1793 std::string packetInfo);
1813 Mac48Address macAddress,
1816 std::string packetInfo)
1818 if (packetEvent != SatEnums::PACKET_RECV)
1824 case SatEnums::LL_PHY: {
1825 if (linkDir == SatEnums::LD_FORWARD)
1829 else if (linkDir == SatEnums::LD_RETURN)
1835 case SatEnums::LL_MAC: {
1836 if (linkDir == SatEnums::LD_FORWARD)
1840 else if (linkDir == SatEnums::LD_RETURN)
1846 case SatEnums::LL_ND: {
1847 if (linkDir == SatEnums::LD_FORWARD)
1851 else if (linkDir == SatEnums::LD_RETURN)
1858 NS_FATAL_ERROR(
"Wrong log level received");
1865 : TestCase(
"This test is launched several time to test every regeneration combination.")
1893 Singleton<SatEnvVariables>::Get()->DoInitialize();
1894 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test8",
true);
1897 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1899 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1905 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
1908 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1909 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1912 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1914 Ptr<SimulationHelper> simulationHelper =
1915 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1916 simulationHelper->SetSimulationTime(Seconds(20));
1918 simulationHelper->LoadScenario(
"geo-33E");
1920 simulationHelper->CreateSatScenario(SatHelper::LARGER);
1922 m_helper = simulationHelper->GetSatelliteHelper();
1924 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhy =
1925 DynamicCast<SatOrbiterNetDevice>(
1926 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
1928 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhy =
1929 DynamicCast<SatOrbiterNetDevice>(
1930 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
1932 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMac =
1933 DynamicCast<SatOrbiterNetDevice>(
1934 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
1936 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMac =
1937 DynamicCast<SatOrbiterNetDevice>(
1938 Singleton<SatTopology>::Get()->GetOrbiterNode(0)->GetDevice(0))
1941 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/UserPhy/*/PacketTrace",
1943 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/FeederPhy/*/PacketTrace",
1945 if (maxRegeneration == SatEnums::REGENERATION_LINK ||
1946 maxRegeneration == SatEnums::REGENERATION_NETWORK)
1948 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/UserMac/*/PacketTrace",
1950 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/FeederMac/*/PacketTrace",
1953 if (maxRegeneration == SatEnums::REGENERATION_NETWORK)
1955 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/PacketTrace",
1959 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1960 SatTrafficHelper::FWD_LINK,
1961 SatTrafficHelper::UDP,
1964 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1965 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1970 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
1971 SatTrafficHelper::RTN_LINK,
1972 SatTrafficHelper::UDP,
1975 Singleton<SatTopology>::Get()->GetGwUserNodes(),
1976 Singleton<SatTopology>::Get()->GetUtUserNodes(),
1981 simulationHelper->RunSimulation();
1983 Simulator::Destroy();
1987 case SatEnums::TRANSPARENT:
1988 case SatEnums::REGENERATION_PHY: {
1989 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
1990 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederMac, 0,
"Packets should not be received on feeder MAC");
1991 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederNet, 0,
"Packets should not be received on feeder network");
1994 case SatEnums::REGENERATION_LINK: {
1995 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
1996 NS_TEST_ASSERT_MSG_GT(
m_rxFeederMac, 1600,
"Packets should be received on feeder MAC");
1997 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederNet, 0,
"Packets should not be received on feeder network");
2000 case SatEnums::REGENERATION_NETWORK: {
2001 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
2002 NS_TEST_ASSERT_MSG_GT(
m_rxFeederMac, 1600,
"Packets should be received on feeder MAC");
2003 NS_TEST_ASSERT_MSG_GT(
m_rxFeederNet, 1600,
"Packets should be received on feeder network");
2010 case SatEnums::TRANSPARENT:
2011 case SatEnums::REGENERATION_PHY: {
2012 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
2013 NS_TEST_ASSERT_MSG_EQ(
m_rxUserMac, 0,
"Packets should not be received on user MAC");
2014 NS_TEST_ASSERT_MSG_EQ(
m_rxUserNet, 0,
"Packets should not be received on user network");
2017 case SatEnums::REGENERATION_LINK: {
2018 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
2019 NS_TEST_ASSERT_MSG_GT(
m_rxUserMac, 1600,
"Packets should be received on user MAC");
2020 NS_TEST_ASSERT_MSG_EQ(
m_rxUserNet, 0,
"Packets should not be received on user network");
2023 case SatEnums::REGENERATION_NETWORK: {
2024 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
2025 NS_TEST_ASSERT_MSG_GT(
m_rxUserMac, 1600,
"Packets should be received on user MAC");
2026 NS_TEST_ASSERT_MSG_GT(
m_rxUserNet, 1600,
"Packets should be received on user network");
2043 : TestSuite(
"sat-regeneration-test", Type::SYSTEM)
2046 TestCase::Duration::QUICK);
2048 TestCase::Duration::QUICK);
2050 TestCase::Duration::QUICK);
2053 TestCase::Duration::QUICK);
2056 TestCase::Duration::QUICK);
2061 TestCase::Duration::QUICK);
2063 TestCase::Duration::QUICK);
2065 TestCase::Duration::QUICK);
2067 TestCase::Duration::QUICK);
2069 TestCase::Duration::QUICK);
2071 TestCase::Duration::QUICK);
2073 TestCase::Duration::QUICK);
2076 TestCase::Duration::QUICK);
2078 TestCase::Duration::QUICK);
2081 TestCase::Duration::QUICK);
2084 TestCase::Duration::QUICK);
2087 TestCase::Duration::QUICK);
'Regeneration, test 1' test case implementation.
std::vector< Time > m_returnDelay
std::vector< Time > m_orbiterReturnDelay
std::vector< Time > m_forwardDelay
void OrbiterUserPhyTraceDelayCb(const Time &time, const Address &address)
void PhyDelayTraceCb(std::string context, const Time &time, const Address &address)
Ptr< SatHelper > m_helper
void OrbiterFeederPhyTraceDelayCb(const Time &time, const Address &address)
std::vector< Time > m_orbiterForwardDelay
virtual ~SatRegenerationTest1()
'Regeneration, test 2' test case implementation.
virtual ~SatRegenerationTest2()
uint32_t m_packetsReceivedGw
uint32_t m_packetsDroppedGw
void PhyTraceCb(Time time, SatEnums::SatPacketEvent_t event, SatEnums::SatNodeType_t type, uint32_t nodeId, Mac48Address address, SatEnums::SatLogLevel_t level, SatEnums::SatLinkDir_t dir, std::string packetInfo)
void OrbiterPhyTraceCb(Time time, SatEnums::SatPacketEvent_t event, SatEnums::SatNodeType_t type, uint32_t nodeId, Mac48Address address, SatEnums::SatLogLevel_t level, SatEnums::SatLinkDir_t dir, std::string packetInfo)
uint32_t m_packetsReceivedUt
uint32_t m_packetsReceivedUser
uint32_t m_packetsDroppedUser
uint32_t m_packetsDroppedUt
Ptr< SatHelper > m_helper
uint32_t m_packetsDroppedFeeder
uint32_t m_packetsReceivedFeeder
'Regeneration, test 3' test case implementation.
void OrbiterPhyTraceCollisionCb(std::string, uint32_t nPackets, const Address &address, bool hasCollision)
uint32_t m_nbCollisionPacketsRtn
uint32_t m_nbCollisionPacketsFwd
void OrbiterPhyTraceCb(Time time, SatEnums::SatPacketEvent_t event, SatEnums::SatNodeType_t type, uint32_t nodeId, Mac48Address address, SatEnums::SatLogLevel_t level, SatEnums::SatLinkDir_t dir, std::string packetInfo)
void OrbiterPhyTraceErrorCb(std::string, uint32_t nPackets, const Address &address, bool hasError)
uint32_t m_nbErrorpacketsFwd
uint32_t m_packetsDroppedUser
uint32_t m_packetsReceivedFeeder
virtual ~SatRegenerationTest3()
Ptr< SatHelper > m_helper
uint32_t m_packetsDroppedFeeder
uint32_t m_nbErrorpacketsRtn
uint32_t m_packetsReceivedUser
'Regeneration, test 4' test case implementation.
void OrbiterDevGwRxTraceCb(Ptr< const Packet > packet, const Address &)
void OrbiterDevUtRxTraceCb(Ptr< const Packet > packet, const Address &)
bool HasSinkInstalled(Ptr< Node > node, uint16_t port)
uint32_t m_totalReceivedUt
virtual ~SatRegenerationTest4()
void OrbiterDevUtTxTraceCb(Ptr< const Packet > packet)
void OrbiterDevGwTxTraceCb(Ptr< const Packet > packet)
Ptr< SatHelper > m_helper
uint32_t m_totalReceivedGw
'Regeneration, test 5' test case implementation.
Ptr< SatHelper > m_helper
double GetAverage(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void OrbiterPhyUtModcodTraceCb(uint32_t modcod, const Address &address)
void OrbiterPhyFeederModcodTraceCb(uint32_t modcod, const Address &address)
virtual ~SatRegenerationTest5()
double GetMostFrequent(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
std::vector< uint32_t > m_feederModcods
std::vector< uint32_t > m_gwModcods
std::vector< uint32_t > m_userModcods
void OrbiterPhyGwModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_utModcods
void OrbiterPhyUserModcodTraceCb(uint32_t modcod, const Address &address)
'Regeneration, test 6' test case implementation.
bool HasSinkInstalled(Ptr< Node > node, uint16_t port)
virtual ~SatRegenerationTest6()
Ptr< SatHelper > m_helper
void OrbiterDevUtRxTraceCb(Ptr< const Packet > packet, const Address &)
void OrbiterDevGwTxTraceCb(Ptr< const Packet > packet)
uint32_t m_totalReceivedUt
uint32_t m_totalReceivedGw
void OrbiterDevGwRxTraceCb(Ptr< const Packet > packet, const Address &)
void OrbiterDevUtTxTraceCb(Ptr< const Packet > packet)
'Regeneration, test 7' test case implementation.
void OrbiterPhyUserModcodTraceCb(uint32_t modcod, const Address &address)
double GetMostFrequent(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void OrbiterPhyGwModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_gwModcods
Ptr< SatHelper > m_helper
void OrbiterPhyUtModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_feederModcods
std::vector< uint32_t > m_utModcods
std::vector< uint32_t > m_userModcods
double GetAverage(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void OrbiterPhyFeederModcodTraceCb(uint32_t modcod, const Address &address)
virtual ~SatRegenerationTest7()
'Regeneration, test 8' test case implementation.
virtual ~SatRegenerationTest8()
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
void AddTraceEntry(Time now, SatEnums::SatPacketEvent_t packetEvent, SatEnums::SatNodeType_t nodeType, uint32_t nodeId, Mac48Address macAddress, SatEnums::SatLogLevel_t logLevel, SatEnums::SatLinkDir_t linkDir, std::string packetInfo)
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
Ptr< SatHelper > m_helper
SatRegenerationTest8(SatEnums::RegenerationMode_t forwardLinkRegenerationMode, SatEnums::RegenerationMode_t returnLinkRegenerationMode)
SatRegenerationTestSuite()
SatLinkDir_t
Link direction used for packet tracing.
SatNodeType_t
Node type used for packet tracing.
SatPacketEvent_t
Packet event used for packet tracing.
SatLogLevel_t
Log level used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatRegenerationTestSuite satRegenerationTestSuite