Test for A-MSDU and A-MPDU aggregation. More...
Public Member Functions | |
PreservePacketsInAmpdus () | |
virtual | ~PreservePacketsInAmpdus () |
void | DoRun (void) override |
Implementation to actually run this TestCase. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | NotifyMacForwardUp (Ptr< const Packet > p) |
Callback invoked when the receiver MAC forwards a packet up to the upper layer. More... | |
void | NotifyMacTransmit (Ptr< const Packet > packet) |
Callback invoked when an MSDU is passed to the MAC. More... | |
void | NotifyPsduForwardedDown (WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when the sender MAC passes a PSDU(s) to the PHY. More... | |
Private Attributes | |
std::vector< std::size_t > | m_nMpdus |
Number of MPDUs in PSDUs passed to the PHY. More... | |
std::vector< std::size_t > | m_nMsdus |
Number of MSDUs in MPDUs passed to the PHY. More... | |
std::list< Ptr< const Packet > > | m_packetList |
List of packets passed to the MAC. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. More... | |
bool | MustAssertOnFailure (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Test for A-MSDU and A-MPDU aggregation.
This test aims to check that the packets passed to the MAC layer (on the sender side) are forwarded up to the upper layer (on the receiver side) when A-MSDU and A-MPDU aggregation are used. This test checks that no packet copies are performed, hence packets can be tracked by means of a pointer.
In this test, an HT STA sends 8 packets (each of 1000 bytes) to an HT AP. The block ack threshold is set to 2, hence the first packet is sent as an MPDU containing a single MSDU because the establishment of a Block Ack agreement is not triggered yet. The maximum A-MSDU size is set to 4500 bytes and the maximum A-MPDU size is set to 7500 bytes, hence the remaining packets are sent in an A-MPDU containing two MPDUs, the first one including 4 MSDUs and the second one including 3 MPDUs.
Definition at line 742 of file wifi-aggregation-test.cc.
PreservePacketsInAmpdus::PreservePacketsInAmpdus | ( | ) |
Definition at line 775 of file wifi-aggregation-test.cc.
|
virtual |
Definition at line 780 of file wifi-aggregation-test.cc.
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 820 of file wifi-aggregation-test.cc.
References ns3::Node::AddApplication(), third::apDevices, third::channel, ns3::NodeContainer::Create(), ns3::NodeContainer::Get(), ns3::WifiNetDevice::GetAddress(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetMac(), ns3::WifiNetDevice::GetPhy(), ns3::PacketSocketHelper::Install(), m_nMpdus, m_nMsdus, m_packetList, third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), third::mobility, NotifyMacForwardUp(), NotifyMacTransmit(), NotifyPsduForwardedDown(), NS_TEST_EXPECT_MSG_EQ, third::phy, ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), third::ssid, third::staDevices, ns3::ObjectBase::TraceConnectWithoutContext(), third::wifi, ns3::WIFI_STANDARD_80211n, and third::wifiApNode.
Callback invoked when the receiver MAC forwards a packet up to the upper layer.
p | the packet |
Definition at line 812 of file wifi-aggregation-test.cc.
References m_packetList, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
Callback invoked when an MSDU is passed to the MAC.
packet | the MSDU to transmit |
Definition at line 785 of file wifi-aggregation-test.cc.
References m_packetList.
Referenced by DoRun().
|
private |
Callback invoked when the sender MAC passes a PSDU(s) to the PHY.
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the transmit power in Watts |
Definition at line 791 of file wifi-aggregation-test.cc.
References m_nMpdus, m_nMsdus, NS_TEST_EXPECT_MSG_EQ, ns3::PeekPointer(), and SU_STA_ID.
Referenced by DoRun().
|
private |
Number of MPDUs in PSDUs passed to the PHY.
Definition at line 753 of file wifi-aggregation-test.cc.
Referenced by DoRun(), and NotifyPsduForwardedDown().
|
private |
Number of MSDUs in MPDUs passed to the PHY.
Definition at line 754 of file wifi-aggregation-test.cc.
Referenced by DoRun(), and NotifyPsduForwardedDown().
List of packets passed to the MAC.
Definition at line 752 of file wifi-aggregation-test.cc.
Referenced by DoRun(), NotifyMacForwardUp(), and NotifyMacTransmit().