A Discrete-Event Network Simulator
API
PreservePacketsInAmpdus Class Reference

Test for A-MSDU and A-MPDU aggregation. More...

+ Inheritance diagram for PreservePacketsInAmpdus:
+ Collaboration diagram for PreservePacketsInAmpdus:

Public Member Functions

 PreservePacketsInAmpdus ()
 
 ~PreservePacketsInAmpdus () override
 
void DoRun () 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 () const
 
TestCaseoperator= (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...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () 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 () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () 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...
 

Detailed Description

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 933 of file wifi-aggregation-test.cc.

Constructor & Destructor Documentation

◆ PreservePacketsInAmpdus()

PreservePacketsInAmpdus::PreservePacketsInAmpdus ( )

Definition at line 965 of file wifi-aggregation-test.cc.

◆ ~PreservePacketsInAmpdus()

PreservePacketsInAmpdus::~PreservePacketsInAmpdus ( )
override

Definition at line 971 of file wifi-aggregation-test.cc.

Member Function Documentation

◆ DoRun()

◆ NotifyMacForwardUp()

void PreservePacketsInAmpdus::NotifyMacForwardUp ( Ptr< const Packet p)
private

Callback invoked when the receiver MAC forwards a packet up to the upper layer.

Parameters
pthe packet

Definition at line 1006 of file wifi-aggregation-test.cc.

References m_packetList, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ NotifyMacTransmit()

void PreservePacketsInAmpdus::NotifyMacTransmit ( Ptr< const Packet packet)
private

Callback invoked when an MSDU is passed to the MAC.

Parameters
packetthe MSDU to transmit

Definition at line 976 of file wifi-aggregation-test.cc.

References m_packetList.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ NotifyPsduForwardedDown()

void PreservePacketsInAmpdus::NotifyPsduForwardedDown ( WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
private

Callback invoked when the sender MAC passes a PSDU(s) to the PHY.

Parameters
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe transmit power in Watts

Definition at line 982 of file wifi-aggregation-test.cc.

References m_nMpdus, m_nMsdus, NS_TEST_EXPECT_MSG_EQ, ns3::PeekPointer(), and ns3::SU_STA_ID.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nMpdus

std::vector<std::size_t> PreservePacketsInAmpdus::m_nMpdus
private

Number of MPDUs in PSDUs passed to the PHY.

Definition at line 943 of file wifi-aggregation-test.cc.

Referenced by DoRun(), and NotifyPsduForwardedDown().

◆ m_nMsdus

std::vector<std::size_t> PreservePacketsInAmpdus::m_nMsdus
private

Number of MSDUs in MPDUs passed to the PHY.

Definition at line 944 of file wifi-aggregation-test.cc.

Referenced by DoRun(), and NotifyPsduForwardedDown().

◆ m_packetList

std::list<Ptr<const Packet> > PreservePacketsInAmpdus::m_packetList
private

List of packets passed to the MAC.

Definition at line 942 of file wifi-aggregation-test.cc.

Referenced by DoRun(), NotifyMacForwardUp(), and NotifyMacTransmit().


The documentation for this class was generated from the following file: