28#include "ns3/applications-module.h"
29#include "ns3/boolean.h"
30#include "ns3/config.h"
32#include "ns3/satellite-module.h"
33#include "ns3/simulator.h"
34#include "ns3/singleton.h"
35#include "ns3/string.h"
38#include "ns3/traffic-module.h"
46 Ptr<SatSignalParameters> params,
53 if (!destAdd.IsBroadcast())
55 std::cout.precision(2);
56 std::cout.setf(std::cout.fixed | std::cout.showpoint);
58 std::cout <<
"Time= " << Simulator::Now() <<
", ChType= " << std::setw(17)
60 <<
", DestAddr= " << destAdd <<
", Beam= " << std::setw(2) << params->m_beamId
61 <<
", Freq= " << params->m_carrierFreq_hz <<
", IFPwr= " << std::setw(8)
80 UintegerValue pSize2);
117 UintegerValue pSize1,
119 UintegerValue pSize2)
138 Ptr<SatIdMapper> ptrMapper = Singleton<SatIdMapper>::Get();
141 Ptr<SatInterferenceOutputTraceContainer> ptrCont =
142 Singleton<SatInterferenceOutputTraceContainer>::Get();
147 while (pos != std::string::npos)
155 while (pos != std::string::npos)
163 while (pos != std::string::npos)
169 ptrCont->EnableFigureOutput(figureOutput);
175 Ptr<SatIdMapper> ptrMapper = Singleton<SatIdMapper>::Get();
178 ptrMapper->PrintTraceMap();
209 "Test satellite per packet interference in Forward Link with user defined scenario. ";
222 UintegerValue pSize1,
224 UintegerValue pSize2);
229 virtual void DoRun(
void);
237 StringValue(
"0.00015s"),
248 "IfTestFwdUsr_" + name,
251 StringValue(
"0.00015s"),
262 UintegerValue pSize1,
264 UintegerValue pSize2)
266 "IfTestFwdUsr_" + name,
292 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
293 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
295 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", EnumValue(
m_fading));
296 Config::SetDefault(
"ns3::SatFwdLinkScheduler::DummyFrameSendingEnabled",
299 Config::SetDefault(
"ns3::SatHelper::UtCount", UintegerValue(1));
300 Config::SetDefault(
"ns3::SatHelper::UtUsers", UintegerValue(1));
301 Config::SetDefault(
"ns3::SatOrbiterHelper::DaFwdLinkInterferenceModel",
303 Config::SetDefault(
"ns3::SatUtHelper::DaFwdLinkInterferenceModel",
305 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableIntfOutputTrace", BooleanValue(
true));
308 Ptr<SatHelper> helper = CreateObject<SatHelper>(
314 beamMap[std::make_pair(0, 1)] = beamInfo;
315 beamMap[std::make_pair(0, 5)] = beamInfo;
317 helper->CreateUserDefinedScenario(beamMap);
321 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/PhyRx/RxCarrierList/*/LinkBudgetTrace",
324 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
327 Config::Connect(
"/NodeList/*/DeviceList/*/FeederPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
330 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
331 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
335 PacketSinkHelper sinkHelper(
"ns3::UdpSocketFactory",
336 InetSocketAddress(helper->GetUserAddress(utUsers.Get(0)), port));
339 ApplicationContainer utSinks = sinkHelper.Install(utUsers.Get(0));
342 sinkHelper.SetAttribute(
344 AddressValue(Address(InetSocketAddress(helper->GetUserAddress(utUsers.Get(1)), port))));
345 utSinks.Add(sinkHelper.Install(utUsers.Get(1)));
346 utSinks.Start(Seconds(0.1));
347 utSinks.Stop(Seconds(0.5));
349 CbrHelper cbrHelper(
"ns3::UdpSocketFactory",
350 InetSocketAddress(helper->GetUserAddress(utUsers.Get(0)), port));
356 ApplicationContainer gw1Cbr = cbrHelper.Install(gwUsers.Get(0));
357 gw1Cbr.Start(Seconds(0.2));
358 gw1Cbr.Stop(Seconds(0.5));
361 cbrHelper.SetAttribute(
363 AddressValue(Address(InetSocketAddress(helper->GetUserAddress(utUsers.Get(1)), port))));
367 ApplicationContainer gw2Cbr = cbrHelper.Install(gwUsers.Get(1));
368 gw2Cbr.Start(Seconds(0.2));
369 gw2Cbr.Stop(Seconds(1.0));
371 Simulator::Stop(Seconds(1.0));
375 Simulator::Destroy();
408 "Test satellite per packet interference in Forward Link with fullscenario. ";
421 UintegerValue pSize1,
423 UintegerValue pSize2);
427 virtual void DoRun(
void);
435 StringValue(
"0.00015s"),
447 "IfTestFwdFull_" + name,
450 StringValue(
"0.00015s"),
461 UintegerValue pSize1,
463 UintegerValue pSize2)
465 "IfTestFwdFull_" + name,
489 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", EnumValue(
m_fading));
490 Config::SetDefault(
"ns3::SatFwdLinkScheduler::DummyFrameSendingEnabled",
493 Config::SetDefault(
"ns3::SatHelper::UtCount", UintegerValue(1));
494 Config::SetDefault(
"ns3::SatHelper::UtUsers", UintegerValue(1));
495 Config::SetDefault(
"ns3::SatOrbiterHelper::DaFwdLinkInterferenceModel",
497 Config::SetDefault(
"ns3::SatUtHelper::DaFwdLinkInterferenceModel",
499 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableIntfOutputTrace", BooleanValue(
true));
502 Ptr<SatHelper> helper = CreateObject<SatHelper>(
509 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/PhyRx/RxCarrierList/*/LinkBudgetTrace",
512 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
515 Config::Connect(
"/NodeList/*/DeviceList/*/FeederPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
518 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
519 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
523 PacketSinkHelper sinkHelper(
"ns3::UdpSocketFactory",
524 InetSocketAddress(helper->GetUserAddress(utUsers.Get(0)), port));
527 ApplicationContainer utSinks = sinkHelper.Install(utUsers.Get(0));
530 sinkHelper.SetAttribute(
532 AddressValue(Address(InetSocketAddress(helper->GetUserAddress(utUsers.Get(4)), port))));
533 utSinks.Add(sinkHelper.Install(utUsers.Get(4)));
534 utSinks.Start(Seconds(0.1));
535 utSinks.Stop(Seconds(1.0));
537 CbrHelper cbrHelper(
"ns3::UdpSocketFactory",
538 InetSocketAddress(helper->GetUserAddress(utUsers.Get(0)), port));
544 ApplicationContainer gw1Cbr = cbrHelper.Install(gwUsers.Get(0));
545 gw1Cbr.Start(Seconds(0.2));
546 gw1Cbr.Stop(Seconds(0.4));
549 cbrHelper.SetAttribute(
551 AddressValue(Address(InetSocketAddress(helper->GetUserAddress(utUsers.Get(4)), port))));
555 ApplicationContainer gw2Cbr = cbrHelper.Install(gwUsers.Get(4));
556 gw2Cbr.Start(Seconds(0.2));
557 gw2Cbr.Stop(Seconds(0.4));
559 Simulator::Stop(Seconds(1.0));
563 Simulator::Destroy();
595 "Test satellite per packet interference in Return Link with user defined scenario. ";
605 UintegerValue pSize1,
607 UintegerValue pSize2);
612 virtual void DoRun(
void);
620 StringValue(
"0.01s"),
622 StringValue(
"0.01s"),
630 "IfTestRtnUsr_" + name,
633 StringValue(
"0.01s"),
635 StringValue(
"0.01s"),
643 UintegerValue pSize1,
645 UintegerValue pSize2)
647 "IfTestRtnUsr_" + name,
671 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", EnumValue(
m_fading));
672 Config::SetDefault(
"ns3::SatFwdLinkScheduler::DummyFrameSendingEnabled",
675 Config::SetDefault(
"ns3::SatHelper::UtCount", UintegerValue(1));
676 Config::SetDefault(
"ns3::SatHelper::UtUsers", UintegerValue(1));
677 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
679 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameCount", UintegerValue(1));
680 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType",
682 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_AllocatedBandwidthHz", DoubleValue(1.25e6));
683 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierAllocatedBandwidthHz",
684 DoubleValue(1.25e6));
686 Config::SetDefault(
"ns3::SatGwHelper::DaRtnLinkInterferenceModel",
688 Config::SetDefault(
"ns3::SatOrbiterHelper::DaRtnLinkInterferenceModel",
690 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableIntfOutputTrace", BooleanValue(
true));
693 Ptr<SatHelper> helper = CreateObject<SatHelper>(
699 beamMap[std::make_pair(0, 1)] = beamInfo;
700 beamMap[std::make_pair(0, 5)] = beamInfo;
702 helper->CreateUserDefinedScenario(beamMap);
706 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/PhyRx/RxCarrierList/*/LinkBudgetTrace",
709 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
712 Config::Connect(
"/NodeList/*/DeviceList/*/FeederPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
715 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
716 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
720 PacketSinkHelper sinkHelper(
"ns3::UdpSocketFactory",
721 InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port));
724 ApplicationContainer gwSink = sinkHelper.Install(gwUsers.Get(0));
725 gwSink.Start(Seconds(0.1));
726 gwSink.Stop(Seconds(0.5));
728 CbrHelper cbrHelper(
"ns3::UdpSocketFactory",
729 InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port));
735 ApplicationContainer ut1Cbr = cbrHelper.Install(utUsers.Get(0));
736 ut1Cbr.Start(Seconds(0.1));
737 ut1Cbr.Stop(Seconds(0.4));
743 ApplicationContainer ut5Cbr = cbrHelper.Install(utUsers.Get(1));
744 ut5Cbr.Start(Seconds(0.1));
745 ut5Cbr.Stop(Seconds(0.4));
747 Simulator::Stop(Seconds(1.0));
751 Simulator::Destroy();
759 "Test satellite per packet interference in Return Link with full defined scenario. ";
770 UintegerValue pSize1,
772 UintegerValue pSize2);
776 virtual void DoRun(
void);
784 StringValue(
"0.01s"),
786 StringValue(
"0.01s"),
794 "IfTestRtnFull_" + name,
797 StringValue(
"0.01s"),
799 StringValue(
"0.01s"),
807 UintegerValue pSize1,
809 UintegerValue pSize2)
811 "IfTestRtnFull_" + name,
835 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", EnumValue(
m_fading));
836 Config::SetDefault(
"ns3::SatFwdLinkScheduler::DummyFrameSendingEnabled",
839 Config::SetDefault(
"ns3::SatHelper::UtCount", UintegerValue(1));
840 Config::SetDefault(
"ns3::SatHelper::UtUsers", UintegerValue(1));
841 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0",
843 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameCount", UintegerValue(1));
844 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType",
846 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_AllocatedBandwidthHz", DoubleValue(1.25e6));
847 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierAllocatedBandwidthHz",
848 DoubleValue(1.25e6));
850 Config::SetDefault(
"ns3::SatGwHelper::DaRtnLinkInterferenceModel",
852 Config::SetDefault(
"ns3::SatOrbiterHelper::DaRtnLinkInterferenceModel",
854 Config::SetDefault(
"ns3::SatPhyRxCarrierConf::EnableIntfOutputTrace", BooleanValue(
true));
857 Ptr<SatHelper> helper = CreateObject<SatHelper>(
863 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/PhyRx/RxCarrierList/*/LinkBudgetTrace",
866 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
869 Config::Connect(
"/NodeList/*/DeviceList/*/FeederPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
872 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
873 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
877 PacketSinkHelper sinkHelper(
"ns3::UdpSocketFactory",
878 InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port));
881 ApplicationContainer gwSink = sinkHelper.Install(gwUsers.Get(0));
882 gwSink.Start(Seconds(0.1));
883 gwSink.Stop(Seconds(0.5));
885 CbrHelper cbrHelper(
"ns3::UdpSocketFactory",
886 InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port));
892 ApplicationContainer ut1Cbr = cbrHelper.Install(utUsers.Get(0));
893 ut1Cbr.Start(Seconds(0.1));
894 ut1Cbr.Stop(Seconds(0.4));
900 ApplicationContainer ut5Cbr = cbrHelper.Install(utUsers.Get(4));
901 ut5Cbr.Start(Seconds(0.1));
902 ut5Cbr.Stop(Seconds(0.4));
904 Simulator::Stop(Seconds(1.0));
908 Simulator::Destroy();
924 : TestSuite(
"sat-per-packet-if-test", Type::SYSTEM)
928 TestCase::Duration::QUICK);
931 TestCase::Duration::QUICK);
935 TestCase::Duration::QUICK);
940 TestCase::Duration::QUICK);
943 TestCase::Duration::QUICK);
947 TestCase::Duration::QUICK);
virtual void DoRun(void)=0
SatEnums::FadingModel_t m_fading
void InitOutput(bool figureOutput)
UintegerValue m_PackageSize1
virtual ~SatPerPacketBaseTestCase()
SatPerPacketBaseTestCase()
UintegerValue m_PackageSize2
SatPerPacketFwdLinkFullTestCase()
virtual ~SatPerPacketFwdLinkFullTestCase()
SatPerPacketFwdLinkUserTestCase()
virtual ~SatPerPacketFwdLinkUserTestCase()
Test suite for Satellite interference unit test cases.
SatPerPacketIfTestSuite()
SatPerPacketRtnLinkFullTestCase()
virtual ~SatPerPacketRtnLinkFullTestCase()
SatPerPacketRtnLinkUserTestCase()
virtual ~SatPerPacketRtnLinkUserTestCase()
Class that holds information for each beam regarding UTs and their users camped in each beam.
SatEnums class is for simplifying the use of enumerators in the satellite module.
static std::string GetChannelTypeName(ChannelType_t channelType)
FadingModel_t
Fading models.
static Ptr< SatEnvVariables > GetInstance()
@ FULL
FULL Full scenario used as base.
ErrorModel
Error model enum.
@ SUPER_FRAME_CONFIG_0
SUPER_FRAME_CONFIG_0.
@ CONFIG_TYPE_0
Configuration type 0.
static T WToDbW(T w)
Converts Watts to Decibel Watts.
static T LinearToDb(T linear)
Converts linear to decibels.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatPerPacketIfTestSuite satSatPerPacketIfTestSuite
static const char * defRtnUserName
Per-packet interference, Return Link System test case.
static const char * defFwdUserName
Per-packet interference, Forward Link System test case.
static const char * defFwdFullName
Per-packet interference, Forward Link System test case.
static void LinkBudgetTraceCb(std::string context, Ptr< SatSignalParameters > params, Mac48Address ownAdd, Mac48Address destAdd, double ifPower, double cSinr)
static const char * defRtnFullName