A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
PreservePacketsInAmpdus Class Reference

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

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

Public Member Functions

 PreservePacketsInAmpdus (bool notifyMacHdrRxEnd)
 Constructor.
 
 ~PreservePacketsInAmpdus () override
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
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.
 
void NotifyMacHeaderEndRx (Ptr< WifiMac > mac, const WifiMacHeader &macHdr, const WifiTxVector &txVector, Time psduDuration)
 Callback invoked when the reception of the MAC header of an MPDU is completed.
 
void NotifyMacTransmit (Ptr< const Packet > packet)
 Callback invoked when an MSDU is passed to the MAC.
 
void NotifyPsduForwardedDown (WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when the sender MAC passes a PSDU(s) to the PHY.
 

Private Attributes

std::vector< Ptr< WifiMpdu > >::const_iterator m_expectedMpdu
 next MPDU expected to be received
 
std::size_t m_nMacHdrs {0}
 Number of notified MAC headers in QoS data frames.
 
std::vector< std::size_t > m_nMpdus
 Number of MPDUs in PSDUs passed to the PHY.
 
std::vector< std::size_t > m_nMsdus
 Number of MSDUs in MPDUs passed to the PHY.
 
bool m_notifyMacHdrRxEnd
 whether notification of MAC header reception end is enabled
 
std::list< Ptr< const Packet > > m_packetList
 List of packets passed to the MAC.
 
Ptr< const WifiPsdum_txPsdu
 PSDU being transmitted.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
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.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

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.

It is also checked that the MAC header of every MPDU is notified to the FrameExchangeManager while the PSDU is being transmitted.

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

Constructor & Destructor Documentation

◆ PreservePacketsInAmpdus()

PreservePacketsInAmpdus::PreservePacketsInAmpdus ( bool notifyMacHdrRxEnd)

Constructor.

Parameters
notifyMacHdrRxEndwhether notification of MAC header reception end is enabled

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

◆ ~PreservePacketsInAmpdus()

PreservePacketsInAmpdus::~PreservePacketsInAmpdus ( )
override

Definition at line 1007 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 1095 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:

◆ NotifyMacHeaderEndRx()

void PreservePacketsInAmpdus::NotifyMacHeaderEndRx ( Ptr< WifiMac > mac,
const WifiMacHeader & macHdr,
const WifiTxVector & txVector,
Time psduDuration )
private

Callback invoked when the reception of the MAC header of an MPDU is completed.

Parameters
macthe MAC to which the reception of the MAC header is notified
macHdrthe MAC header of the MPDU being received
txVectorthe TXVECTOR used to transmit the PSDU
psduDurationthe remaining duration of the PSDU

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

References ns3::WifiPsdu::end(), ns3::WifiMacHeader::GetSequenceNumber(), m_expectedMpdu, m_nMacHdrs, m_txPsdu, ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, and ns3::Simulator::Schedule().

Referenced by DoRun().

+ Here is the call graph for this function:
+ 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 1012 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 1018 of file wifi-aggregation-test.cc.

References ns3::WifiPsdu::begin(), m_expectedMpdu, m_nMpdus, m_nMsdus, m_notifyMacHdrRxEnd, m_txPsdu, 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_expectedMpdu

std::vector<Ptr<WifiMpdu>>::const_iterator PreservePacketsInAmpdus::m_expectedMpdu
private

next MPDU expected to be received

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

Referenced by NotifyMacHeaderEndRx(), and NotifyPsduForwardedDown().

◆ m_nMacHdrs

std::size_t PreservePacketsInAmpdus::m_nMacHdrs {0}
private

Number of notified MAC headers in QoS data frames.

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

Referenced by DoRun(), and NotifyMacHeaderEndRx().

◆ m_nMpdus

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

Number of MPDUs in PSDUs passed to the PHY.

Definition at line 962 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 963 of file wifi-aggregation-test.cc.

Referenced by DoRun(), and NotifyPsduForwardedDown().

◆ m_notifyMacHdrRxEnd

bool PreservePacketsInAmpdus::m_notifyMacHdrRxEnd
private

whether notification of MAC header reception end is enabled

Definition at line 968 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 961 of file wifi-aggregation-test.cc.

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

◆ m_txPsdu

Ptr<const WifiPsdu> PreservePacketsInAmpdus::m_txPsdu
private

PSDU being transmitted.

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

Referenced by NotifyMacHeaderEndRx(), and NotifyPsduForwardedDown().


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