30 #include "ns3/cbr-application.h"
31 #include "ns3/cbr-helper.h"
32 #include "ns3/config.h"
35 #include "ns3/packet-sink-helper.h"
36 #include "ns3/packet-sink.h"
37 #include "ns3/satellite-env-variables.h"
38 #include "ns3/satellite-helper.h"
39 #include "ns3/satellite-topology.h"
40 #include "ns3/simulator.h"
41 #include "ns3/singleton.h"
42 #include "ns3/string.h"
71 virtual void DoRun(
void);
76 : TestCase(
"'Periodic control message, test 1' case tests successful transmission of UDP "
77 "packets from UT connected user to GW connected user in simple scenario with "
78 "periodic control messages.")
95 Singleton<SatEnvVariables>::Get()->DoInitialize();
96 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-periodic-control-message",
104 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel", EnumValue(em));
105 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel", EnumValue(em));
108 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel", EnumValue(SatEnums::RA_MODEL_OFF));
111 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
114 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
115 BooleanValue(
false));
116 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
117 BooleanValue(
false));
118 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
119 BooleanValue(
false));
120 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
121 BooleanValue(
false));
122 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
123 BooleanValue(
false));
124 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
125 BooleanValue(
false));
126 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
127 BooleanValue(
false));
128 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
129 BooleanValue(
false));
130 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
131 BooleanValue(
false));
132 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
133 BooleanValue(
false));
134 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
135 BooleanValue(
false));
136 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
140 Ptr<SatHelper> helper = CreateObject<SatHelper>(
141 Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
"/scenarios/geo-33E");
142 helper->CreatePredefinedScenario(SatHelper::SIMPLE);
146 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
151 CbrHelper cbr(
"ns3::UdpSocketFactory",
152 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
153 cbr.SetAttribute(
"Interval", StringValue(
"1s"));
155 ApplicationContainer utApps = cbr.Install(Singleton<SatTopology>::Get()->GetUtUserNodes());
156 utApps.Start(Seconds(1.0));
157 utApps.Stop(Seconds(2.1));
160 PacketSinkHelper sink(
"ns3::UdpSocketFactory",
161 Address(InetSocketAddress(helper->GetUserAddress(gwUsers.Get(0)), port)));
163 ApplicationContainer gwApps = sink.Install(gwUsers);
164 gwApps.Start(Seconds(1.0));
165 gwApps.Stop(Seconds(10.0));
167 Simulator::Stop(Seconds(11));
170 Simulator::Destroy();
172 Ptr<PacketSink> receiver = DynamicCast<PacketSink>(gwApps.Get(0));
173 Ptr<CbrApplication> sender = DynamicCast<CbrApplication>(utApps.Get(0));
178 NS_TEST_ASSERT_MSG_NE(sender->GetSent(), (uint32_t)0,
"Nothing sent !");
179 NS_TEST_ASSERT_MSG_EQ(receiver->GetTotalRx(), sender->GetSent(),
"Packets were lost !");
181 Singleton<SatEnvVariables>::Get()->DoDispose();
196 : TestSuite(
"sat-periodic-control-message-test", Type::SYSTEM)
'Periodic control message, test 1' test case implementation.
SatPeriodicControlMessageTest1()
virtual ~SatPeriodicControlMessageTest1()
SatPeriodicControlMessageTestSuite()
ErrorModel
Error model enum.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatPeriodicControlMessageTestSuite satPeriodicControlMessageTestSuite