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

A-MPDU reception test. More...

+ Inheritance diagram for TestAmpduReception:
+ Collaboration diagram for TestAmpduReception:

Public Member Functions

 TestAmpduReception ()
 
- Public Member Functions inherited from WifiPhyReceptionTest
 WifiPhyReceptionTest (std::string test_name)
 Constructor.
 
 ~WifiPhyReceptionTest () override=default
 Destructor.
 
- 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 CheckPhyState (WifiPhyState expectedState)
 Check the PHY state.
 
void CheckRxDroppedBitmapAmpdu1 (uint8_t expected)
 Check the RX dropped bitmap for A-MPDU 1.
 
void CheckRxDroppedBitmapAmpdu2 (uint8_t expected)
 Check the RX dropped bitmap for A-MPDU 2.
 
void CheckRxFailureBitmapAmpdu1 (uint8_t expected)
 Check the RX failure bitmap for A-MPDU 1.
 
void CheckRxFailureBitmapAmpdu2 (uint8_t expected)
 Check the RX failure bitmap for A-MPDU 2.
 
void CheckRxSuccessBitmapAmpdu1 (uint8_t expected)
 Check the RX success bitmap for A-MPDU 1.
 
void CheckRxSuccessBitmapAmpdu2 (uint8_t expected)
 Check the RX success bitmap for A-MPDU 2.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void IncrementFailureBitmap (uint32_t size)
 Increment reception failure bitmap.
 
void IncrementSuccessBitmap (uint32_t size)
 Increment reception success bitmap.
 
void ResetBitmaps ()
 Reset bitmaps function.
 
void RxDropped (Ptr< const Packet > p, WifiPhyRxfailureReason reason)
 RX dropped function.
 
void RxFailure (Ptr< const WifiPsdu > psdu)
 RX failure function.
 
void RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 RX success function.
 
void SendAmpduWithThreeMpdus (double rxPowerDbm, uint32_t referencePacketSize)
 Send A-MPDU with 3 MPDUs of different size (i-th MSDU will have 100 bytes more than (i-1)-th).
 

Private Attributes

uint8_t m_rxDroppedBitmapAmpdu1 {0}
 bitmap of dropped MPDUs in A-MPDU #1
 
uint8_t m_rxDroppedBitmapAmpdu2 {0}
 bitmap of dropped MPDUs in A-MPDU #2
 
uint8_t m_rxFailureBitmapAmpdu1 {0}
 bitmap of unsuccessfully received MPDUs in A-MPDU #1
 
uint8_t m_rxFailureBitmapAmpdu2 {0}
 bitmap of unsuccessfully received MPDUs in A-MPDU #2
 
uint8_t m_rxSuccessBitmapAmpdu1 {0}
 bitmap of successfully received MPDUs in A-MPDU #1
 
uint8_t m_rxSuccessBitmapAmpdu2 {0}
 bitmap of successfully received MPDUs in A-MPDU #2
 

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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- Protected Member Functions inherited from WifiPhyReceptionTest
void CheckPhyState (WifiPhyState expectedState)
 Schedule now to check the PHY state.
 
void DoCheckPhyState (WifiPhyState expectedState)
 Check the PHY state now.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void DoTeardown () override
 Implementation to do any local setup required for this TestCase.
 
void SendPacket (double rxPowerDbm, uint32_t packetSize, uint8_t mcs)
 Send packet function.
 
- 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.
 
- Protected Attributes inherited from WifiPhyReceptionTest
Ptr< SpectrumWifiPhym_phy
 the PHY
 
uint64_t m_uid {0}
 the UID to use for the PPDU
 

Detailed Description

A-MPDU reception test.

Definition at line 2466 of file wifi-phy-reception-test.cc.

Constructor & Destructor Documentation

◆ TestAmpduReception()

TestAmpduReception::TestAmpduReception ( )

Definition at line 2569 of file wifi-phy-reception-test.cc.

Member Function Documentation

◆ CheckPhyState()

void TestAmpduReception::CheckPhyState ( WifiPhyState  expectedState)
private

Check the PHY state.

Parameters
expectedStatethe expected PHY state

Definition at line 2760 of file wifi-phy-reception-test.cc.

References ns3::PointerValue::Get(), ns3::ObjectBase::GetAttribute(), WifiPhyReceptionTest::m_phy, ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ CheckRxDroppedBitmapAmpdu1()

void TestAmpduReception::CheckRxDroppedBitmapAmpdu1 ( uint8_t  expected)
private

Check the RX dropped bitmap for A-MPDU 1.

Parameters
expectedthe expected bitmap

Definition at line 2744 of file wifi-phy-reception-test.cc.

References m_rxDroppedBitmapAmpdu1, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxDroppedBitmapAmpdu2()

void TestAmpduReception::CheckRxDroppedBitmapAmpdu2 ( uint8_t  expected)
private

Check the RX dropped bitmap for A-MPDU 2.

Parameters
expectedthe expected bitmap

Definition at line 2752 of file wifi-phy-reception-test.cc.

References m_rxDroppedBitmapAmpdu2, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxFailureBitmapAmpdu1()

void TestAmpduReception::CheckRxFailureBitmapAmpdu1 ( uint8_t  expected)
private

Check the RX failure bitmap for A-MPDU 1.

Parameters
expectedthe expected bitmap

Definition at line 2728 of file wifi-phy-reception-test.cc.

References m_rxFailureBitmapAmpdu1, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxFailureBitmapAmpdu2()

void TestAmpduReception::CheckRxFailureBitmapAmpdu2 ( uint8_t  expected)
private

Check the RX failure bitmap for A-MPDU 2.

Parameters
expectedthe expected bitmap

Definition at line 2736 of file wifi-phy-reception-test.cc.

References m_rxFailureBitmapAmpdu2, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxSuccessBitmapAmpdu1()

void TestAmpduReception::CheckRxSuccessBitmapAmpdu1 ( uint8_t  expected)
private

Check the RX success bitmap for A-MPDU 1.

Parameters
expectedthe expected bitmap

Definition at line 2712 of file wifi-phy-reception-test.cc.

References m_rxSuccessBitmapAmpdu1, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxSuccessBitmapAmpdu2()

void TestAmpduReception::CheckRxSuccessBitmapAmpdu2 ( uint8_t  expected)
private

Check the RX success bitmap for A-MPDU 2.

Parameters
expectedthe expected bitmap

Definition at line 2720 of file wifi-phy-reception-test.cc.

References m_rxSuccessBitmapAmpdu2, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void TestAmpduReception::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 2833 of file wifi-phy-reception-test.cc.

References ns3::WifiPhy::AssignStreams(), CheckRxDroppedBitmapAmpdu1(), CheckRxDroppedBitmapAmpdu2(), CheckRxFailureBitmapAmpdu1(), CheckRxFailureBitmapAmpdu2(), CheckRxSuccessBitmapAmpdu1(), CheckRxSuccessBitmapAmpdu2(), ns3::Simulator::Destroy(), WifiPhyReceptionTest::m_phy, ns3::MicroSeconds(), ns3::NanoSeconds(), ResetBitmaps(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendAmpduWithThreeMpdus(), ns3::RngSeedManager::SetRun(), and ns3::RngSeedManager::SetSeed().

+ Here is the call graph for this function:

◆ DoSetup()

void TestAmpduReception::DoSetup ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from WifiPhyReceptionTest.

Definition at line 2812 of file wifi-phy-reception-test.cc.

References WifiPhyReceptionTest::DoSetup(), WifiPhyReceptionTest::m_phy, ns3::MakeCallback(), ns3::MicroSeconds(), RxDropped(), RxFailure(), RxSuccess(), ns3::WifiPhy::SetFrameCaptureModel(), ns3::WifiPhy::SetPreambleDetectionModel(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), and ns3::ObjectBase::TraceConnectWithoutContext().

+ Here is the call graph for this function:

◆ IncrementFailureBitmap()

void TestAmpduReception::IncrementFailureBitmap ( uint32_t  size)
private

Increment reception failure bitmap.

Parameters
sizethe size of the received packet

Definition at line 2653 of file wifi-phy-reception-test.cc.

References m_rxFailureBitmapAmpdu1, and m_rxFailureBitmapAmpdu2.

Referenced by RxFailure(), and RxSuccess().

+ Here is the caller graph for this function:

◆ IncrementSuccessBitmap()

void TestAmpduReception::IncrementSuccessBitmap ( uint32_t  size)
private

Increment reception success bitmap.

Parameters
sizethe size of the received packet

Definition at line 2614 of file wifi-phy-reception-test.cc.

References m_rxSuccessBitmapAmpdu1, and m_rxSuccessBitmapAmpdu2.

Referenced by RxSuccess().

+ Here is the caller graph for this function:

◆ ResetBitmaps()

void TestAmpduReception::ResetBitmaps ( )
private

Reset bitmaps function.

Definition at line 2575 of file wifi-phy-reception-test.cc.

References m_rxDroppedBitmapAmpdu1, m_rxDroppedBitmapAmpdu2, m_rxFailureBitmapAmpdu1, m_rxFailureBitmapAmpdu2, m_rxSuccessBitmapAmpdu1, and m_rxSuccessBitmapAmpdu2.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RxDropped()

void TestAmpduReception::RxDropped ( Ptr< const Packet p,
WifiPhyRxfailureReason  reason 
)
private

RX dropped function.

Parameters
pthe packet
reasonthe reason

Definition at line 2682 of file wifi-phy-reception-test.cc.

References m_rxDroppedBitmapAmpdu1, m_rxDroppedBitmapAmpdu2, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ RxFailure()

void TestAmpduReception::RxFailure ( Ptr< const WifiPsdu psdu)
private

RX failure function.

Parameters
psduthe PSDU

Definition at line 2643 of file wifi-phy-reception-test.cc.

References IncrementFailureBitmap(), and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ RxSuccess()

void TestAmpduReception::RxSuccess ( Ptr< const WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
std::vector< bool >  statusPerMpdu 
)
private

RX success function.

Parameters
psduthe PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorthe transmit vector
statusPerMpdureception status per MPDU

Definition at line 2586 of file wifi-phy-reception-test.cc.

References IncrementFailureBitmap(), IncrementSuccessBitmap(), NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ SendAmpduWithThreeMpdus()

void TestAmpduReception::SendAmpduWithThreeMpdus ( double  rxPowerDbm,
uint32_t  referencePacketSize 
)
private

Send A-MPDU with 3 MPDUs of different size (i-th MSDU will have 100 bytes more than (i-1)-th).

Parameters
rxPowerDbmthe transmit power in dBm
referencePacketSizethe reference size of the packets in bytes (i-th MSDU will have 100 bytes more than (i-1)-th)

Definition at line 2774 of file wifi-phy-reception-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), CHANNEL_WIDTH, ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), FREQUENCY, ns3::HePhy::GetHeMcs0(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhy::GetPhyBand(), GUARD_WIDTH, WifiPhyReceptionTest::m_phy, WifiPhyReceptionTest::m_uid, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SpectrumWifiPhy::StartRx(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

Member Data Documentation

◆ m_rxDroppedBitmapAmpdu1

uint8_t TestAmpduReception::m_rxDroppedBitmapAmpdu1 {0}
private

bitmap of dropped MPDUs in A-MPDU #1

Definition at line 2565 of file wifi-phy-reception-test.cc.

Referenced by CheckRxDroppedBitmapAmpdu1(), ResetBitmaps(), and RxDropped().

◆ m_rxDroppedBitmapAmpdu2

uint8_t TestAmpduReception::m_rxDroppedBitmapAmpdu2 {0}
private

bitmap of dropped MPDUs in A-MPDU #2

Definition at line 2566 of file wifi-phy-reception-test.cc.

Referenced by CheckRxDroppedBitmapAmpdu2(), ResetBitmaps(), and RxDropped().

◆ m_rxFailureBitmapAmpdu1

uint8_t TestAmpduReception::m_rxFailureBitmapAmpdu1 {0}
private

bitmap of unsuccessfully received MPDUs in A-MPDU #1

Definition at line 2562 of file wifi-phy-reception-test.cc.

Referenced by CheckRxFailureBitmapAmpdu1(), IncrementFailureBitmap(), and ResetBitmaps().

◆ m_rxFailureBitmapAmpdu2

uint8_t TestAmpduReception::m_rxFailureBitmapAmpdu2 {0}
private

bitmap of unsuccessfully received MPDUs in A-MPDU #2

Definition at line 2563 of file wifi-phy-reception-test.cc.

Referenced by CheckRxFailureBitmapAmpdu2(), IncrementFailureBitmap(), and ResetBitmaps().

◆ m_rxSuccessBitmapAmpdu1

uint8_t TestAmpduReception::m_rxSuccessBitmapAmpdu1 {0}
private

bitmap of successfully received MPDUs in A-MPDU #1

Definition at line 2559 of file wifi-phy-reception-test.cc.

Referenced by CheckRxSuccessBitmapAmpdu1(), IncrementSuccessBitmap(), and ResetBitmaps().

◆ m_rxSuccessBitmapAmpdu2

uint8_t TestAmpduReception::m_rxSuccessBitmapAmpdu2 {0}
private

bitmap of successfully received MPDUs in A-MPDU #2

Definition at line 2560 of file wifi-phy-reception-test.cc.

Referenced by CheckRxSuccessBitmapAmpdu2(), IncrementSuccessBitmap(), and ResetBitmaps().


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