23 #include "ns3/string.h" 24 #include "ns3/qos-utils.h" 25 #include "ns3/packet.h" 26 #include "ns3/wifi-net-device.h" 27 #include "ns3/ap-wifi-mac.h" 28 #include "ns3/mobility-helper.h" 29 #include "ns3/spectrum-wifi-helper.h" 30 #include "ns3/multi-model-spectrum-channel.h" 31 #include "ns3/udp-client-server-helper.h" 32 #include "ns3/internet-stack-helper.h" 33 #include "ns3/ipv4-address-helper.h" 34 #include "ns3/rng-seed-manager.h" 35 #include "ns3/config.h" 36 #include "ns3/queue-size.h" 67 virtual void DoRun (
void);
83 :
TestCase (
"Test case for resuming data transmission when the recipient moves back"),
85 m_lastCheckPointTime (
Seconds (0)),
111 RngSeedManager::SetSeed (1);
112 RngSeedManager::SetRun (40);
113 int64_t streamNumber = 100;
128 phy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
129 phy.SetChannel (spectrumChannel);
133 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
140 mac.SetType (
"ns3::StaWifiMac",
145 mac.SetType (
"ns3::ApWifiMac",
157 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
158 positionAlloc->
Add (Vector (5.0, 0.0, 0.0));
159 mobility.SetPositionAllocator (positionAlloc);
161 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
168 stack.Install (wifiStaNode);
171 address.SetBase (
"192.168.1.0",
"255.255.255.0");
183 serverApp = server.
Install (wifiStaNode.
Get (0));
185 serverApp.
Stop (warmup + simulationTime);
192 clientApp.
Start (warmup);
193 clientApp.
Stop (warmup + simulationTime);
199 Vector (10000.0, 0.0, 0.0));
201 DynamicCast<UdpServer> (serverApp.
Get (0)));
205 Vector (5.0, 0.0, 0.0));
207 DynamicCast<UdpServer> (serverApp.
Get (0)));
211 DynamicCast<UdpServer> (serverApp.
Get (0)));
213 Simulator::Stop (warmup + simulationTime);
224 std::cout <<
"Throughput = " << t <<
" Mb/s" << std::endl;
227 Simulator::Destroy ();
holds a vector of ns3::Application pointers.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
uint32_t m_payloadSize
payload size in bytes
AttributeValue implementation for Boolean.
Class for representing queue sizes.
HT PHY for the 5 GHz band (clause 20)
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Hold variables of type string.
std::vector< double > m_tputValues
throughput in sub-intervals
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
aggregate IP/TCP/UDP functionality to existing Nodes.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
uint64_t GetReceived(void) const
Returns the number of received packets.
helps to create WifiNetDevice objects
static void SetPosition(Ptr< Node > node, Vector position)
Keep track of the current position and velocity of an object.
Test for issue 211 (https://gitlab.com/nsnam/ns-3-dev/-/issues/211)
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
AttributeValue implementation for Time.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
uint64_t m_lastRxBytes
RX bytes at last check-point.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.
Time m_lastCheckPointTime
time of last check-point
holds a vector of ns3::NetDevice pointers
virtual void DoRun(void)
Implementation to actually run this TestCase.
Create a server application which waits for input UDP packets and uses the information carried into t...
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void CalcThroughput(Ptr< UdpServer > server)
Compute the average throughput since the last check-point.
create MAC layers for a ns3::WifiNetDevice.
#define NS_TEST_EXPECT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report if not.
The IEEE 802.11 SSID Information Element.
Helper class used to assign positions and mobility models to nodes.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
Time Seconds(double value)
Construct a Time in the indicated unit.
AttributeValue implementation for Ssid.
void SetDefault(std::string name, const AttributeValue &value)
void Add(Vector v)
Add a position to the list of positions.
static Issue211TestSuite g_issue211TestSuite
the test suite
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Issue211Test()
Constructor.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
Make it easy to create and manage PHY objects for the spectrum model.