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-phy-rx-carrier.h"
42 #include "ns3/satellite-ut-mac-state.h"
43 #include "ns3/simulation-helper.h"
44 #include "ns3/simulator.h"
45 #include "ns3/singleton.h"
46 #include "ns3/string.h"
67 virtual void DoRun(
void);
68 void PhyDelayTraceCb(std::string context,
const Time& time,
const Address& address);
69 void GeoFeederPhyTraceDelayCb(
const Time& time,
const Address& address);
70 void GeoUserPhyTraceDelayCb(
const Time& time,
const Address& address);
86 "This case tests that delay of packets takes into account regeneration in satellite.")
130 Singleton<SatEnvVariables>::Get()->DoInitialize();
131 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test1",
true);
134 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
135 EnumValue(SatEnums::REGENERATION_PHY));
136 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
137 EnumValue(SatEnums::REGENERATION_PHY));
139 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
142 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
143 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
146 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
148 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"500ms"));
149 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
152 m_helper = CreateObject<SatHelper>();
153 m_helper->CreatePredefinedScenario(SatHelper::SIMPLE);
155 NodeContainer utUsers =
m_helper->GetUtUsers();
156 NodeContainer gwUsers =
m_helper->GetGwUsers();
160 CbrHelper cbrForward(
161 "ns3::UdpSocketFactory",
162 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
163 ApplicationContainer gwAppsForward = cbrForward.Install(gwUsers);
164 gwAppsForward.Start(Seconds(1.0));
165 gwAppsForward.Stop(Seconds(5.0));
167 PacketSinkHelper sinkForward(
168 "ns3::UdpSocketFactory",
169 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
170 ApplicationContainer utAppsForward = sinkForward.Install(utUsers);
171 utAppsForward.Start(Seconds(1.0));
172 utAppsForward.Stop(Seconds(10.0));
175 CbrHelper cbrReturn(
"ns3::UdpSocketFactory",
176 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
177 ApplicationContainer utAppsReturn = cbrReturn.Install(utUsers);
178 utAppsReturn.Start(Seconds(1.0));
179 utAppsReturn.Stop(Seconds(5.0));
181 PacketSinkHelper sinkReturn(
182 "ns3::UdpSocketFactory",
183 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
184 ApplicationContainer gwAppsReturn = sinkReturn.Install(gwUsers);
185 gwAppsReturn.Start(Seconds(1.0));
186 gwAppsReturn.Stop(Seconds(10.0));
191 Ptr<SatGeoFeederPhy> satGeoFeederPhy = DynamicCast<SatGeoFeederPhy>(
192 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))
194 Ptr<SatGeoUserPhy> satGeoUserPhy = DynamicCast<SatGeoUserPhy>(
195 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetUserPhy(8));
197 satGeoFeederPhy->TraceConnectWithoutContext(
200 satGeoUserPhy->TraceConnectWithoutContext(
203 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/RxLinkDelay",
206 Ptr<SatChannel> feederChannel = satGeoFeederPhy->GetPhyTx()->GetChannel();
207 Ptr<SatChannel> userChannel = satGeoUserPhy->GetPhyTx()->GetChannel();
209 Ptr<PropagationDelayModel> feederDelayModel = feederChannel->GetPropagationDelayModel();
210 Ptr<PropagationDelayModel> userDelayModel = userChannel->GetPropagationDelayModel();
212 Time feederDelay = feederDelayModel->GetDelay(
213 DynamicCast<SatNetDevice>(
m_helper->GwNodes().Get(0)->GetDevice(1))
217 satGeoFeederPhy->GetPhyTx()->GetMobility());
220 userDelayModel->GetDelay(DynamicCast<SatNetDevice>(
m_helper->UtNodes().Get(0)->GetDevice(2))
224 satGeoUserPhy->GetPhyTx()->GetMobility());
226 Simulator::Stop(Seconds(10));
229 Simulator::Destroy();
237 Time fwdTime = NanoSeconds(319507) - MicroSeconds(1);
238 Time rtnTime = NanoSeconds(668928) - MicroSeconds(1);
244 "Transmission time on FWD FEEDER incorrect.");
251 "Transmission time on RTN USER incorrect.");
258 "Transmission time on FWD USER incorrect.");
265 "Transmission time on RTN FEEDER incorrect.");
288 virtual void DoRun(
void);
293 Mac48Address address,
296 std::string packetInfo);
301 Mac48Address address,
304 std::string packetInfo);
321 : TestCase(
"This case tests physical regeneration on satellite. It is based on a SIMPLE "
322 "scenario, with losses on uplink, forward and return."),
323 m_packetsReceivedFeeder(0),
324 m_packetsDroppedFeeder(0),
325 m_packetsReceivedUser(0),
326 m_packetsDroppedUser(0),
327 m_packetsReceivedUt(0),
328 m_packetsDroppedUt(0),
329 m_packetsReceivedGw(0),
330 m_packetsDroppedGw(0)
345 Mac48Address address,
348 std::string packetInfo)
352 case SatEnums::LD_FORWARD:
353 if (event == SatEnums::PACKET_RECV)
357 else if (event == SatEnums::PACKET_DROP)
362 case SatEnums::LD_RETURN:
363 if (event == SatEnums::PACKET_RECV)
367 else if (event == SatEnums::PACKET_DROP)
382 Mac48Address address,
385 std::string packetInfo)
389 case SatEnums::LD_FORWARD:
390 if (event == SatEnums::PACKET_RECV)
394 else if (event == SatEnums::PACKET_DROP)
399 case SatEnums::LD_RETURN:
400 if (event == SatEnums::PACKET_RECV)
404 else if (event == SatEnums::PACKET_DROP)
423 Singleton<SatEnvVariables>::Get()->DoInitialize();
424 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test2",
true);
427 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
428 EnumValue(SatEnums::REGENERATION_PHY));
429 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
430 EnumValue(SatEnums::REGENERATION_PHY));
432 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
435 Config::SetDefault(
"ns3::SatGeoHelper::FwdLinkErrorModel",
436 EnumValue(SatPhyRxCarrierConf::EM_CONSTANT));
437 Config::SetDefault(
"ns3::SatGeoHelper::FwdLinkConstantErrorRate", DoubleValue(0.1));
438 Config::SetDefault(
"ns3::SatGeoHelper::RtnLinkErrorModel",
439 EnumValue(SatPhyRxCarrierConf::EM_CONSTANT));
440 Config::SetDefault(
"ns3::SatGeoHelper::RtnLinkConstantErrorRate", DoubleValue(0.1));
443 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
444 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
447 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
449 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(
"10ms"));
450 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
453 m_helper = CreateObject<SatHelper>();
454 m_helper->CreatePredefinedScenario(SatHelper::SIMPLE);
456 NodeContainer utUsers =
m_helper->GetUtUsers();
457 NodeContainer gwUsers =
m_helper->GetGwUsers();
461 CbrHelper cbrForward(
462 "ns3::UdpSocketFactory",
463 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
464 ApplicationContainer gwAppsForward = cbrForward.Install(gwUsers);
465 gwAppsForward.Start(Seconds(1.0));
466 gwAppsForward.Stop(Seconds(59.0));
468 PacketSinkHelper sinkForward(
469 "ns3::UdpSocketFactory",
470 Address(InetSocketAddress(
m_helper->GetUserAddress(utUsers.Get(0)), port)));
471 ApplicationContainer utAppsForward = sinkForward.Install(utUsers);
472 utAppsForward.Start(Seconds(1.0));
473 utAppsForward.Stop(Seconds(60.0));
476 CbrHelper cbrReturn(
"ns3::UdpSocketFactory",
477 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
478 ApplicationContainer utAppsReturn = cbrReturn.Install(utUsers);
479 utAppsReturn.Start(Seconds(1.0));
480 utAppsReturn.Stop(Seconds(59.0));
482 PacketSinkHelper sinkReturn(
483 "ns3::UdpSocketFactory",
484 Address(InetSocketAddress(
m_helper->GetUserAddress(gwUsers.Get(0)), port)));
485 ApplicationContainer gwAppsReturn = sinkReturn.Install(gwUsers);
486 gwAppsReturn.Start(Seconds(1.0));
487 gwAppsReturn.Stop(Seconds(60.0));
489 Ptr<SatGeoFeederPhy> satGeoFeederPhy = DynamicCast<SatGeoFeederPhy>(
490 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))
492 Ptr<SatGeoUserPhy> satGeoUserPhy = DynamicCast<SatGeoUserPhy>(
493 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetUserPhy(8));
495 satGeoFeederPhy->TraceConnectWithoutContext(
498 satGeoUserPhy->TraceConnectWithoutContext(
502 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatPhy/PacketTrace",
505 Simulator::Stop(Seconds(60));
508 Simulator::Destroy();
510 double dropRateForwardFeeder =
512 double dropRateReturnUser =
515 double forwardDifference =
517 double returnDifference =
520 NS_TEST_ASSERT_MSG_GT(dropRateForwardFeeder, 8.0,
"Not enough losses on FWD feeder");
521 NS_TEST_ASSERT_MSG_LT(dropRateForwardFeeder, 12.0,
"Too much losses on FWD feeder");
522 NS_TEST_ASSERT_MSG_GT(dropRateReturnUser, 8.0,
"Not enough losses on RTN user");
523 NS_TEST_ASSERT_MSG_LT(dropRateReturnUser, 12.0,
"Too much losses on RTN user");
530 NS_TEST_ASSERT_MSG_LT(
533 "Number of packets received on FWD should be almost the same between SAT and UT");
534 NS_TEST_ASSERT_MSG_LT(
537 "Number of packets received on RTN should be almost the same between SAT and GW");
559 virtual void DoRun(
void);
560 void GeoPhyTraceErrorCb(std::string, uint32_t nPackets,
const Address& address,
bool hasError);
563 const Address& address,
569 Mac48Address address,
572 std::string packetInfo);
591 : TestCase(
"This case tests physical regeneration on satellite. It is based on a LARGER "
592 "scenario, with collisions on return uplink."),
593 m_nbErrorpacketsFwd(0),
594 m_nbErrorpacketsRtn(0),
595 m_nbCollisionPacketsFwd(0),
596 m_nbCollisionPacketsRtn(0),
597 m_packetsReceivedFeeder(0),
598 m_packetsDroppedFeeder(0),
599 m_packetsReceivedUser(0),
600 m_packetsDroppedUser(0)
613 const Address& address,
633 const Address& address,
655 Mac48Address address,
658 std::string packetInfo)
662 case SatEnums::LD_FORWARD:
663 if (event == SatEnums::PACKET_RECV)
667 else if (event == SatEnums::PACKET_DROP)
672 case SatEnums::LD_RETURN:
673 if (event == SatEnums::PACKET_RECV)
677 else if (event == SatEnums::PACKET_DROP)
696 Singleton<SatEnvVariables>::Get()->DoInitialize();
697 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test3",
true);
700 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
701 EnumValue(SatEnums::REGENERATION_PHY));
702 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
703 EnumValue(SatEnums::REGENERATION_PHY));
705 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
708 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
709 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
712 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
715 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
716 EnumValue(SatEnums::RA_MODEL_SLOTTED_ALOHA));
719 Config::SetDefault(
"ns3::SatBeamHelper::RaInterferenceModel",
720 EnumValue(SatPhyRxCarrierConf::IF_PER_PACKET));
723 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
false));
726 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableRandomAccessDynamicLoadControl",
727 BooleanValue(
false));
729 "ns3::SatPhyRxCarrierConf::RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
733 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumUniquePayloadPerBlock",
735 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MaximumConsecutiveBlockAccessed",
737 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_MinimumIdleBlock",
739 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffTimeInMilliSeconds",
741 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_BackOffProbability",
742 UintegerValue(10000));
743 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_HighLoadBackOffProbability",
744 UintegerValue(30000));
745 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::RaService0_NumberOfInstances",
748 "ns3::SatLowerLayerServiceConf::RaService0_AverageNormalizedOfferedLoadThreshold",
750 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DefaultControlRandomizationInterval",
751 TimeValue(MilliSeconds(100)));
752 Config::SetDefault(
"ns3::SatRandomAccessConf::CrdsaSignalingOverheadInBytes", UintegerValue(5));
753 Config::SetDefault(
"ns3::SatRandomAccessConf::SlottedAlohaSignalingOverheadInBytes",
757 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
758 BooleanValue(
false));
759 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
760 BooleanValue(
false));
761 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
762 BooleanValue(
false));
763 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
764 BooleanValue(
false));
765 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
766 BooleanValue(
false));
767 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
768 BooleanValue(
false));
769 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
770 BooleanValue(
false));
771 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
772 BooleanValue(
false));
773 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
774 BooleanValue(
false));
775 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
776 BooleanValue(
false));
777 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
778 BooleanValue(
false));
779 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
780 BooleanValue(
false));
782 Config::SetDefault(
"ns3::SatGeoHelper::FwdLinkErrorModel",
783 EnumValue(SatPhyRxCarrierConf::EM_NONE));
784 Config::SetDefault(
"ns3::SatGeoHelper::RtnLinkErrorModel",
785 EnumValue(SatPhyRxCarrierConf::EM_AVI));
786 Config::SetDefault(
"ns3::SatBeamHelper::RaCollisionModel",
787 EnumValue(SatPhyRxCarrierConf::RA_COLLISION_CHECK_AGAINST_SINR));
789 Ptr<SimulationHelper> simulationHelper =
790 CreateObject<SimulationHelper>(
"test-sat-regeneration");
791 simulationHelper->SetSimulationTime(Seconds(5));
792 simulationHelper->SetUserCountPerUt(1);
793 simulationHelper->SetUtCountPerBeam(50);
794 simulationHelper->SetBeamSet({1});
795 simulationHelper->CreateSatScenario();
797 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(MilliSeconds(1)));
798 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
799 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
800 SimulationHelper::UDP,
801 SimulationHelper::RTN_LINK,
806 m_helper = simulationHelper->GetSatelliteHelper();
808 Ptr<SatGeoFeederPhy> satGeoFeederPhy = DynamicCast<SatGeoFeederPhy>(
809 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))
811 Ptr<SatGeoUserPhy> satGeoUserPhy = DynamicCast<SatGeoUserPhy>(
812 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetUserPhy(1));
816 satGeoFeederPhy->TraceConnectWithoutContext(
819 satGeoUserPhy->TraceConnectWithoutContext(
824 "/NodeList/*/DeviceList/*/FeederPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxError",
827 "/NodeList/*/DeviceList/*/FeederPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxCollision",
829 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxError",
832 "/NodeList/*/DeviceList/*/UserPhy/1/PhyRx/RxCarrierList/*/SlottedAlohaRxCollision",
835 Simulator::Stop(Seconds(5));
838 Simulator::Destroy();
843 "Packets received on RTN user link due to collisions");
847 "Packets dropped on RTN user link due to collisions");
872 virtual void DoRun(
void);
914 for (uint32_t i = 0; i < node->GetNApplications(); i++)
916 Ptr<PacketSink> sink = DynamicCast<PacketSink>(node->GetApplication(i));
920 sink->GetAttribute(
"Local", av);
921 if (InetSocketAddress::ConvertFrom(av.Get()).GetPort() == port)
932 : TestCase(
"This case tests link regeneration on satellite. It is based on a LARGER scenario.")
955 Singleton<SatEnvVariables>::Get()->DoInitialize();
956 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test4",
true);
959 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
960 EnumValue(SatEnums::REGENERATION_PHY));
961 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
962 EnumValue(SatEnums::REGENERATION_LINK));
964 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
967 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
968 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
971 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
973 Ptr<SimulationHelper> simulationHelper =
974 CreateObject<SimulationHelper>(
"test-sat-regeneration");
975 simulationHelper->SetSimulationTime(Seconds(20));
976 simulationHelper->CreateSatScenario(SatHelper::LARGER);
978 m_helper = simulationHelper->GetSatelliteHelper();
980 NodeContainer gws =
m_helper->GwNodes();
981 NodeContainer uts =
m_helper->UtNodes();
984 for (i = 0; i < gws.GetN(); i++)
986 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
989 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
993 for (i = 0; i < uts.GetN(); i++)
995 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
998 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1003 std::string socketFactory =
"ns3::UdpSocketFactory";
1006 PacketSinkHelper sinkHelper(socketFactory, Address());
1007 CbrHelper cbrHelper(socketFactory, Address());
1008 ApplicationContainer sinkContainer;
1009 ApplicationContainer cbrContainer;
1011 Time startTime = Seconds(1);
1012 Time stopTime = Seconds(15);
1013 Time startDelay = MilliSeconds(10);
1014 Time interval = MilliSeconds(100);
1015 uint32_t packetSize = 512;
1017 for (uint32_t j = 0; j < gws.GetN(); j++)
1019 for (uint32_t i = 0; i < uts.GetN(); i++)
1021 InetSocketAddress gwUserAddr =
1022 InetSocketAddress(
m_helper->GetUserAddress(gws.Get(j)), port);
1025 sinkHelper.SetAttribute(
"Local", AddressValue(Address(gwUserAddr)));
1026 sinkContainer.Add(sinkHelper.Install(gws.Get(j)));
1029 cbrHelper.SetConstantTraffic(Time(interval), packetSize);
1030 cbrHelper.SetAttribute(
"Remote", AddressValue(Address(gwUserAddr)));
1031 auto app = cbrHelper.Install(uts.Get(i)).Get(0);
1032 app->SetStartTime(startTime + (i + j * gws.GetN() + 1) * startDelay);
1033 app->SetStopTime(stopTime);
1034 cbrContainer.Add(app);
1038 sinkContainer.Start(startTime);
1039 sinkContainer.Stop(stopTime + Seconds(1));
1041 simulationHelper->RunSimulation();
1043 Simulator::Destroy();
1045 NS_TEST_ASSERT_MSG_EQ(
m_totalSentGw, 0,
"No packets sent on FWD link");
1049 "Same number of packets sent and received on RTN link");
1072 virtual void DoRun(
void);
1078 double GetAverage(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1079 double GetMostFrequent(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1117 for (uint32_t i = beg; i < end; i++)
1121 return 1.0 * sum / (end - beg);
1127 std::map<uint32_t, uint32_t> frequencies;
1128 for (uint32_t i = beg; i < end; i++)
1130 frequencies[list[i]]++;
1133 uint32_t max_count = 0;
1134 uint32_t index = -1;
1135 for (std::pair<const uint32_t, uint32_t>& i : frequencies)
1137 if (max_count < i.second)
1140 max_count = i.second;
1149 : TestCase(
"This case tests ACM on all links. It is based on a SIMPLE scenario.")
1168 Singleton<SatEnvVariables>::Get()->DoInitialize();
1169 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test5",
true);
1172 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1173 EnumValue(SatEnums::REGENERATION_PHY));
1174 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1175 EnumValue(SatEnums::REGENERATION_LINK));
1177 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
1180 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
1183 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1184 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1187 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1189 Ptr<SimulationHelper> simulationHelper =
1190 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1191 simulationHelper->SetSimulationTime(Seconds(20));
1192 simulationHelper->CreateSatScenario(SatHelper::SIMPLE);
1194 m_helper = simulationHelper->GetSatelliteHelper();
1196 Ptr<Node> gwNode =
m_helper->GwNodes().Get(0);
1197 Ptr<Node> utNode =
m_helper->UtNodes().Get(0);
1198 Ptr<Node> geoNode =
m_helper->GeoSatNodes().Get(0);
1199 Ptr<SatGeoFeederPhy> satGeoFeederPhy = DynamicCast<SatGeoFeederPhy>(
1200 DynamicCast<SatGeoNetDevice>(geoNode->GetDevice(0))->GetFeederPhy(8));
1201 Ptr<SatGeoUserPhy> satGeoUserPhy = DynamicCast<SatGeoUserPhy>(
1202 DynamicCast<SatGeoNetDevice>(geoNode->GetDevice(0))->GetUserPhy(8));
1203 Ptr<SatPhy> satGwPhy =
1204 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(gwNode->GetDevice(1))->GetPhy());
1205 Ptr<SatPhy> satUtPhy =
1206 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(utNode->GetDevice(2))->GetPhy());
1208 satGwPhy->TraceConnectWithoutContext(
1211 satUtPhy->TraceConnectWithoutContext(
1214 satGeoFeederPhy->TraceConnectWithoutContext(
1217 satGeoUserPhy->TraceConnectWithoutContext(
1221 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(MilliSeconds(20)));
1222 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
1224 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1225 SimulationHelper::UDP,
1226 SimulationHelper::RTN_LINK,
1231 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1232 SimulationHelper::UDP,
1233 SimulationHelper::FWD_LINK,
1238 simulationHelper->RunSimulation();
1240 Simulator::Destroy();
1246 double averageGwModcodsEnd =
1248 double averageUtModcodsEnd =
1250 double averageFeederModcodsEnd =
1252 double averageUserModcodsEnd =
1255 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsBeg,
1257 "Most robust MODCOD on FWD feeder link at startup");
1258 NS_TEST_ASSERT_MSG_EQ(averageUtModcodsBeg, 2,
"Most robust MODCOD on FWD user link at startup");
1259 NS_TEST_ASSERT_MSG_EQ(averageGwModcodsBeg,
1261 "Most robust MODCOD on RTN feeder link at startup");
1262 NS_TEST_ASSERT_MSG_EQ(averageUserModcodsBeg,
1264 "Most robust MODCOD on RTN user link at startup");
1266 NS_TEST_ASSERT_MSG_LT(averageFeederModcodsEnd, 28,
"Max MODCOD on FWD feeder link is 27");
1267 NS_TEST_ASSERT_MSG_LT(averageUtModcodsEnd, 28,
"Max MODCOD on FWD user link is 27");
1268 NS_TEST_ASSERT_MSG_LT(averageGwModcodsEnd, 28,
"Max MODCOD on RTN feeder link is 27");
1269 NS_TEST_ASSERT_MSG_LT(averageUserModcodsEnd, 24,
"Max MODCOD on RTN user link is 23");
1271 NS_TEST_ASSERT_MSG_GT(averageFeederModcodsEnd,
1273 "Most robust MODCOD on FWD feeder link not used after a few seconds");
1274 NS_TEST_ASSERT_MSG_GT(averageUtModcodsEnd,
1276 "Most robust MODCOD on FWD user link not used after a few seconds");
1277 NS_TEST_ASSERT_MSG_GT(averageGwModcodsEnd,
1279 "Most robust MODCOD on RTN feeder link not used after a few seconds");
1280 NS_TEST_ASSERT_MSG_GT(averageUserModcodsEnd,
1282 "Most robust MODCOD on RTN user link not used after a few seconds");
1284 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsEnd,
1285 averageUtModcodsEnd,
1286 "Same MODCOD on both FWD links");
1287 NS_TEST_ASSERT_MSG_NE(averageUserModcodsEnd,
1288 averageGwModcodsEnd,
1289 "Not same MODCOD on both RTN links");
1309 virtual void DoRun(
void);
1351 for (uint32_t i = 0; i < node->GetNApplications(); i++)
1353 Ptr<PacketSink> sink = DynamicCast<PacketSink>(node->GetApplication(i));
1357 sink->GetAttribute(
"Local", av);
1358 if (InetSocketAddress::ConvertFrom(av.Get()).GetPort() == port)
1370 "This case tests network regeneration on satellite. It is based on a LARGER scenario.")
1393 Singleton<SatEnvVariables>::Get()->DoInitialize();
1394 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test6",
true);
1397 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1398 EnumValue(SatEnums::REGENERATION_NETWORK));
1399 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1400 EnumValue(SatEnums::REGENERATION_NETWORK));
1402 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
1405 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1406 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1409 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1411 Ptr<SimulationHelper> simulationHelper =
1412 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1413 simulationHelper->SetSimulationTime(Seconds(20));
1414 simulationHelper->CreateSatScenario(SatHelper::LARGER);
1416 m_helper = simulationHelper->GetSatelliteHelper();
1418 NodeContainer gws =
m_helper->GwNodes();
1419 NodeContainer uts =
m_helper->UtNodes();
1422 for (i = 0; i < gws.GetN(); i++)
1424 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1427 gws.Get(i)->GetDevice(1)->TraceConnectWithoutContext(
1431 for (i = 0; i < uts.GetN(); i++)
1433 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1436 uts.Get(i)->GetDevice(2)->TraceConnectWithoutContext(
1441 Time startTime = Seconds(1);
1442 Time stopTime = Seconds(15);
1443 Time startDelay = MilliSeconds(10);
1444 Time interval = MilliSeconds(1000);
1445 uint32_t packetSize = 512;
1447 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(interval));
1448 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(packetSize));
1450 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1451 SimulationHelper::UDP,
1452 SimulationHelper::RTN_LINK,
1457 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1458 SimulationHelper::UDP,
1459 SimulationHelper::FWD_LINK,
1464 simulationHelper->RunSimulation();
1466 Simulator::Destroy();
1472 "Same number of packets sent and received on FWD link (taking into "
1473 "account 2 UTs on beam 3)");
1476 "Same number of packets sent and received on RTN link");
1499 virtual void DoRun(
void);
1505 double GetAverage(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1506 double GetMostFrequent(std::vector<uint32_t> list, uint32_t beg, uint32_t end);
1544 for (uint32_t i = beg; i < end; i++)
1548 return 1.0 * sum / (end - beg);
1554 std::map<uint32_t, uint32_t> frequencies;
1555 for (uint32_t i = beg; i < end; i++)
1557 frequencies[list[i]]++;
1560 uint32_t max_count = 0;
1561 uint32_t index = -1;
1562 for (std::pair<const uint32_t, uint32_t>& i : frequencies)
1564 if (max_count < i.second)
1567 max_count = i.second;
1576 : TestCase(
"This case tests ACM on all links. It is based on a SIMPLE scenario.")
1595 Singleton<SatEnvVariables>::Get()->DoInitialize();
1596 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test7",
true);
1599 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1600 EnumValue(SatEnums::REGENERATION_NETWORK));
1601 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1602 EnumValue(SatEnums::REGENERATION_NETWORK));
1604 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
1607 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
1610 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1611 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1614 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1616 Ptr<SimulationHelper> simulationHelper =
1617 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1618 simulationHelper->SetSimulationTime(Seconds(20));
1619 simulationHelper->CreateSatScenario(SatHelper::SIMPLE);
1621 m_helper = simulationHelper->GetSatelliteHelper();
1623 Ptr<Node> gwNode =
m_helper->GwNodes().Get(0);
1624 Ptr<Node> utNode =
m_helper->UtNodes().Get(0);
1625 Ptr<Node> geoNode =
m_helper->GeoSatNodes().Get(0);
1626 Ptr<SatGeoFeederPhy> satGeoFeederPhy = DynamicCast<SatGeoFeederPhy>(
1627 DynamicCast<SatGeoNetDevice>(geoNode->GetDevice(0))->GetFeederPhy(8));
1628 Ptr<SatGeoUserPhy> satGeoUserPhy = DynamicCast<SatGeoUserPhy>(
1629 DynamicCast<SatGeoNetDevice>(geoNode->GetDevice(0))->GetUserPhy(8));
1630 Ptr<SatPhy> satGwPhy =
1631 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(gwNode->GetDevice(1))->GetPhy());
1632 Ptr<SatPhy> satUtPhy =
1633 DynamicCast<SatPhy>(DynamicCast<SatNetDevice>(utNode->GetDevice(2))->GetPhy());
1635 satGwPhy->TraceConnectWithoutContext(
1638 satUtPhy->TraceConnectWithoutContext(
1641 satGeoFeederPhy->TraceConnectWithoutContext(
1644 satGeoUserPhy->TraceConnectWithoutContext(
1648 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(MilliSeconds(20)));
1649 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
1651 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1652 SimulationHelper::UDP,
1653 SimulationHelper::RTN_LINK,
1658 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1659 SimulationHelper::UDP,
1660 SimulationHelper::FWD_LINK,
1665 simulationHelper->RunSimulation();
1667 Simulator::Destroy();
1673 double averageGwModcodsEnd =
1675 double averageUtModcodsEnd =
1677 double averageFeederModcodsEnd =
1679 double averageUserModcodsEnd =
1682 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsBeg,
1684 "Most robust MODCOD on FWD feeder link at startup");
1685 NS_TEST_ASSERT_MSG_EQ(averageUtModcodsBeg, 2,
"Most robust MODCOD on FWD user link at startup");
1686 NS_TEST_ASSERT_MSG_EQ(averageGwModcodsBeg,
1688 "Most robust MODCOD on RTN feeder link at startup");
1689 NS_TEST_ASSERT_MSG_EQ(averageUserModcodsBeg,
1691 "Most robust MODCOD on RTN user link at startup");
1693 NS_TEST_ASSERT_MSG_LT(averageFeederModcodsEnd, 28,
"Max MODCOD on FWD feeder link is 27");
1694 NS_TEST_ASSERT_MSG_LT(averageUtModcodsEnd, 28,
"Max MODCOD on FWD user link is 27");
1695 NS_TEST_ASSERT_MSG_LT(averageGwModcodsEnd, 28,
"Max MODCOD on RTN feeder link is 27");
1696 NS_TEST_ASSERT_MSG_LT(averageUserModcodsEnd, 24,
"Max MODCOD on RTN user link is 23");
1698 NS_TEST_ASSERT_MSG_GT(averageFeederModcodsEnd,
1700 "Most robust MODCOD on FWD feeder link not used after a few seconds");
1701 NS_TEST_ASSERT_MSG_GT(averageUtModcodsEnd,
1703 "Most robust MODCOD on FWD user link not used after a few seconds");
1704 NS_TEST_ASSERT_MSG_GT(averageGwModcodsEnd,
1706 "Most robust MODCOD on RTN feeder link not used after a few seconds");
1707 NS_TEST_ASSERT_MSG_GT(averageUserModcodsEnd,
1709 "Most robust MODCOD on RTN user link not used after a few seconds");
1711 NS_TEST_ASSERT_MSG_EQ(averageFeederModcodsEnd,
1712 averageUtModcodsEnd,
1713 "Same MODCOD on both FWD links");
1714 NS_TEST_ASSERT_MSG_NE(averageUserModcodsEnd,
1715 averageGwModcodsEnd,
1716 "Not same MODCOD on both RTN links");
1742 virtual void DoRun(
void);
1748 Mac48Address macAddress,
1751 std::string packetInfo);
1771 Mac48Address macAddress,
1774 std::string packetInfo)
1776 if (packetEvent != SatEnums::PACKET_RECV)
1782 case SatEnums::LL_PHY: {
1783 if (linkDir == SatEnums::LD_FORWARD)
1787 else if (linkDir == SatEnums::LD_RETURN)
1793 case SatEnums::LL_MAC: {
1794 if (linkDir == SatEnums::LD_FORWARD)
1798 else if (linkDir == SatEnums::LD_RETURN)
1804 case SatEnums::LL_ND: {
1805 if (linkDir == SatEnums::LD_FORWARD)
1809 else if (linkDir == SatEnums::LD_RETURN)
1816 NS_FATAL_ERROR(
"Wrong log level received");
1823 : TestCase(
"This test is launched several time to test every regeneration combination.")
1851 Singleton<SatEnvVariables>::Get()->DoInitialize();
1852 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-regeneration",
"test8",
true);
1855 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
1857 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
1863 Config::SetDefault(
"ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
1866 Config::SetDefault(
"ns3::SatPhy::EnableStatisticsTags", BooleanValue(
true));
1867 Config::SetDefault(
"ns3::SatNetDevice::EnableStatisticsTags", BooleanValue(
true));
1870 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
1872 Ptr<SimulationHelper> simulationHelper =
1873 CreateObject<SimulationHelper>(
"test-sat-regeneration");
1874 simulationHelper->SetSimulationTime(Seconds(20));
1875 simulationHelper->CreateSatScenario(SatHelper::LARGER);
1877 m_helper = simulationHelper->GetSatelliteHelper();
1879 std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhy =
1880 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetFeederPhy();
1881 std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhy =
1882 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetUserPhy();
1883 std::map<uint32_t, Ptr<SatMac>> satGeoFeederMac =
1884 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetFeederMac();
1885 std::map<uint32_t, Ptr<SatMac>> satGeoUserMac =
1886 DynamicCast<SatGeoNetDevice>(
m_helper->GeoSatNodes().Get(0)->GetDevice(0))->GetUserMac();
1888 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/UserPhy/*/PacketTrace",
1890 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/FeederPhy/*/PacketTrace",
1892 if (maxRegeneration == SatEnums::REGENERATION_LINK ||
1893 maxRegeneration == SatEnums::REGENERATION_NETWORK)
1895 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/UserMac/*/PacketTrace",
1897 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/FeederMac/*/PacketTrace",
1900 if (maxRegeneration == SatEnums::REGENERATION_NETWORK)
1902 Config::ConnectWithoutContext(
"/NodeList/0/DeviceList/0/PacketTrace",
1906 Time startTime = Seconds(1);
1907 Time stopTime = Seconds(15);
1908 Time startDelay = MilliSeconds(10);
1909 Time interval = MilliSeconds(100);
1910 uint32_t packetSize = 512;
1912 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(interval));
1913 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(packetSize));
1915 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1916 SimulationHelper::UDP,
1917 SimulationHelper::RTN_LINK,
1922 simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
1923 SimulationHelper::UDP,
1924 SimulationHelper::FWD_LINK,
1929 simulationHelper->RunSimulation();
1931 Simulator::Destroy();
1935 case SatEnums::TRANSPARENT:
1936 case SatEnums::REGENERATION_PHY: {
1937 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
1938 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederMac, 0,
"Packets should not be received on feeder MAC");
1939 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederNet, 0,
"Packets should not be received on feeder network");
1942 case SatEnums::REGENERATION_LINK: {
1943 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
1944 NS_TEST_ASSERT_MSG_GT(
m_rxFeederMac, 1600,
"Packets should be received on feeder MAC");
1945 NS_TEST_ASSERT_MSG_EQ(
m_rxFeederNet, 0,
"Packets should not be received on feeder network");
1948 case SatEnums::REGENERATION_NETWORK: {
1949 NS_TEST_ASSERT_MSG_GT(
m_rxFeederPhy, 1600,
"Packets should be received on feeder phy");
1950 NS_TEST_ASSERT_MSG_GT(
m_rxFeederMac, 1600,
"Packets should be received on feeder MAC");
1951 NS_TEST_ASSERT_MSG_GT(
m_rxFeederNet, 1600,
"Packets should be received on feeder network");
1958 case SatEnums::TRANSPARENT:
1959 case SatEnums::REGENERATION_PHY: {
1960 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
1961 NS_TEST_ASSERT_MSG_EQ(
m_rxUserMac, 0,
"Packets should not be received on user MAC");
1962 NS_TEST_ASSERT_MSG_EQ(
m_rxUserNet, 0,
"Packets should not be received on user network");
1965 case SatEnums::REGENERATION_LINK: {
1966 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
1967 NS_TEST_ASSERT_MSG_GT(
m_rxUserMac, 1600,
"Packets should be received on user MAC");
1968 NS_TEST_ASSERT_MSG_EQ(
m_rxUserNet, 0,
"Packets should not be received on user network");
1971 case SatEnums::REGENERATION_NETWORK: {
1972 NS_TEST_ASSERT_MSG_GT(
m_rxUserPhy, 1600,
"Packets should be received on user phy");
1973 NS_TEST_ASSERT_MSG_GT(
m_rxUserMac, 1600,
"Packets should be received on user MAC");
1974 NS_TEST_ASSERT_MSG_GT(
m_rxUserNet, 1600,
"Packets should be received on user network");
1991 : TestSuite(
"sat-regeneration-test", SYSTEM)
'Regeneration, test 1' test case implementation.
std::vector< Time > m_returnDelay
std::vector< Time > m_geoReturnDelay
std::vector< Time > m_forwardDelay
void GeoUserPhyTraceDelayCb(const Time &time, const Address &address)
std::vector< Time > m_geoForwardDelay
void PhyDelayTraceCb(std::string context, const Time &time, const Address &address)
Ptr< SatHelper > m_helper
virtual ~SatRegenerationTest1()
void GeoFeederPhyTraceDelayCb(const Time &time, const Address &address)
'Regeneration, test 2' test case implementation.
virtual ~SatRegenerationTest2()
uint32_t m_packetsReceivedGw
uint32_t m_packetsDroppedGw
void GeoPhyTraceCb(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 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)
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.
uint32_t m_nbCollisionPacketsRtn
void GeoPhyTraceCb(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_nbCollisionPacketsFwd
uint32_t m_nbErrorpacketsFwd
uint32_t m_packetsDroppedUser
void GeoPhyTraceCollisionCb(std::string, uint32_t nPackets, const Address &address, bool hasCollision)
uint32_t m_packetsReceivedFeeder
virtual ~SatRegenerationTest3()
Ptr< SatHelper > m_helper
uint32_t m_packetsDroppedFeeder
uint32_t m_nbErrorpacketsRtn
void GeoPhyTraceErrorCb(std::string, uint32_t nPackets, const Address &address, bool hasError)
uint32_t m_packetsReceivedUser
'Regeneration, test 4' test case implementation.
void GeoDevGwTxTraceCb(Ptr< const Packet > packet)
void GeoDevGwRxTraceCb(Ptr< const Packet > packet, const Address &)
bool HasSinkInstalled(Ptr< Node > node, uint16_t port)
uint32_t m_totalReceivedUt
virtual ~SatRegenerationTest4()
Ptr< SatHelper > m_helper
uint32_t m_totalReceivedGw
void GeoDevUtTxTraceCb(Ptr< const Packet > packet)
void GeoDevUtRxTraceCb(Ptr< const Packet > packet, const Address &)
'Regeneration, test 5' test case implementation.
Ptr< SatHelper > m_helper
void GeoPhyGwModcodTraceCb(uint32_t modcod, const Address &address)
double GetAverage(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void GeoPhyUserModcodTraceCb(uint32_t modcod, const Address &address)
virtual ~SatRegenerationTest5()
void GeoPhyUtModcodTraceCb(uint32_t modcod, const Address &address)
double GetMostFrequent(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void GeoPhyFeederModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_feederModcods
std::vector< uint32_t > m_gwModcods
std::vector< uint32_t > m_userModcods
std::vector< uint32_t > m_utModcods
'Regeneration, test 6' test case implementation.
void GeoDevGwTxTraceCb(Ptr< const Packet > packet)
void GeoDevGwRxTraceCb(Ptr< const Packet > packet, const Address &)
bool HasSinkInstalled(Ptr< Node > node, uint16_t port)
virtual ~SatRegenerationTest6()
Ptr< SatHelper > m_helper
void GeoDevUtRxTraceCb(Ptr< const Packet > packet, const Address &)
uint32_t m_totalReceivedUt
uint32_t m_totalReceivedGw
void GeoDevUtTxTraceCb(Ptr< const Packet > packet)
'Regeneration, test 7' test case implementation.
double GetMostFrequent(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
void GeoPhyFeederModcodTraceCb(uint32_t modcod, const Address &address)
void GeoPhyUserModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_gwModcods
Ptr< SatHelper > m_helper
void GeoPhyGwModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_feederModcods
std::vector< uint32_t > m_utModcods
void GeoPhyUtModcodTraceCb(uint32_t modcod, const Address &address)
std::vector< uint32_t > m_userModcods
double GetAverage(std::vector< uint32_t > list, uint32_t beg, uint32_t end)
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