21 #include "ns3/simulator.h"
24 #include "ns3/boolean.h"
25 #include "ns3/string.h"
26 #include "ns3/double.h"
29 #include "ns3/data-rate.h"
30 #include "ns3/inet-socket-address.h"
31 #include "ns3/packet-sink.h"
33 #include "ns3/wifi-helper.h"
34 #include "ns3/qos-wifi-mac-helper.h"
35 #include "ns3/yans-wifi-helper.h"
36 #include "ns3/mobility-helper.h"
37 #include "ns3/internet-stack-helper.h"
38 #include "ns3/ipv4-address-helper.h"
39 #include "ns3/packet-sink-helper.h"
40 #include "ns3/on-off-helper.h"
50 virtual void DoRun (
void);
57 :
TestCase (
"MsduAggregator throughput test"),
58 m_writeResults (false)
72 Ssid ssid =
Ssid (
"wifi-amsdu-throughput");
77 std::string phyMode (
"DsssRate1Mbps");
87 wifiMac.
SetType (
"ns3::ApWifiMac",
90 "BeaconInterval",
TimeValue (MicroSeconds (102400)));
98 wifiMac.
SetType (
"ns3::StaWifiMac",
122 address.
SetBase (
"192.168.0.0",
"255.255.255.0");
124 staNodeInterface = address.
Assign (staDev);
125 apNodeInterface = address.
Assign (apDev);
130 uint16_t udpPort = 50000;
140 sinkApp.
Start (Seconds (0));
141 sinkApp.
Stop (Seconds (9.0));
155 sourceApp.
Start (Seconds (1.0));
156 sourceApp.
Stop (Seconds (9.0));
164 Simulator::Stop (Seconds (10.0));
166 Simulator::Destroy ();
171 uint32_t totalOctetsThrough =
172 DynamicCast<PacketSink>(sinkApp.
Get (0))->GetTotalRx ();
187 "A-MSDU test fails for low throughput of "
188 << totalOctetsThrough <<
" octets");
202 :
TestSuite (
"ns3-wifi-msdu-aggregator", SYSTEM)
holds a vector of ns3::Application pointers.
holds a vector of std::pair of Ptr and interface index.
Ptr< YansWifiChannel > Create(void) const
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
WifiMsduAggregatorThroughputTest()
hold variables of type string
Make it easy to create and manage PHY objects for the yans model.
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Set the underlying type of the MAC and its attributes.
aggregate IP/TCP/UDP functionality to existing Nodes.
void SetMsduAggregatorForAc(AcIndex ac, std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue())
Set the class, type and attributes for the Msdu aggregator.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
helps to create WifiNetDevice objects
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Class for representing data rates.
void SetChannel(Ptr< YansWifiChannel > channel)
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
hold objects of type ns3::Time
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
virtual void SetStandard(enum WifiPhyStandard standard)
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
WifiMsduAggregatorTestSuite()
NS_LOG_COMPONENT_DEFINE("WifiMsduAggregatorThroughputTest")
create QoS-enabled MAC layers for a ns3::WifiNetDevice.
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
keep track of a set of node pointers.
Ptr< Application > Get(uint32_t i) const
Get the Ptr
stored in this container at a given index.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
manage and create wifi channel objects for the yans model.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
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...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
uint32_t GetId(void) const
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
hold objects of type ns3::Ssid
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void EnablePcap(std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
Enable pcap output the indicated net device.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
Hold a floating point type.
static WifiMsduAggregatorTestSuite wifiMsduAggregatorTestSuite
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const