A Discrete-Event Network Simulator
API
DcfImmediateAccessBroadcastTestCase Class Reference

Make sure that when multiple broadcast packets are queued on the same device in a short succession, that: 1) no backoff occurs if the frame arrives and the idle time >= DIFS or AIFSn (this is 'DCF immediate access', Figure 9-3 of IEEE 802.11-2012) 2) a backoff occurs for the second frame that arrives (this is clearly stated in Sec. More...

+ Inheritance diagram for DcfImmediateAccessBroadcastTestCase:
+ Collaboration diagram for DcfImmediateAccessBroadcastTestCase:

Public Member Functions

 DcfImmediateAccessBroadcastTestCase ()
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

void NotifyPhyTxBegin (Ptr< const Packet > p, double txPowerW)
 Notify Phy transmit begin. More...
 
void SendOnePacket (Ptr< WifiNetDevice > dev)
 Send one packet function. More...
 

Private Attributes

Time m_firstTransmissionTime
 first transmission time More...
 
ObjectFactory m_mac
 MAC. More...
 
ObjectFactory m_manager
 manager More...
 
unsigned int m_numSentPackets
 number of sent packets More...
 
ObjectFactory m_propDelay
 propagation delay More...
 
Time m_secondTransmissionTime
 second transmission time 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 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...
 

Detailed Description

Make sure that when multiple broadcast packets are queued on the same device in a short succession, that: 1) no backoff occurs if the frame arrives and the idle time >= DIFS or AIFSn (this is 'DCF immediate access', Figure 9-3 of IEEE 802.11-2012) 2) a backoff occurs for the second frame that arrives (this is clearly stated in Sec.

9.3.4.2 of IEEE 802.11-2012, (basic access, which applies to group-addressed frames) where it states "If, under these conditions, the medium is determined by the CS mechanism to be busy when a STA desires to initiate the initial frame of a frame exchange sequence (described in Annex G), exclusive of the CF period, the random backoff procedure described in 9.3.4.3 shall be followed." and from 9.3.4.3 "The result of this procedure is that transmitted frames from a STA are always separated by at least one backoff interval."

The observed behavior is that the first frame will be sent immediately, and the frames are spaced by (backoff + DIFS) time intervals (where backoff is a random number of slot sizes up to maximum CW)

The following test case should not generate virtual collision for the second frame. The seed and run numbers were pick such that the second frame gets backoff = 1 slot.

                 frame 1, frame 2
                 arrive                DIFS = 2 x slot + SIFS
                 |                          = 2 x 9us + 16us for 11a
                 |                    <----------->
                 V                                 <-backoff->

time |-----------—|----------------—|----------—|--------—> 0 1s 1.001408s 1.001442s |1.001451s ^ ^ ^ start TX finish TX start TX frame 1 frame 1 frame 2 ^ frame 2 backoff = 1 slot

The buggy behavior observed in prior versions was shown by picking RngSeedManager::SetRun (17); which generated a 0 slot backoff for frame 2. Then, frame 2 experiences a virtual collision and re-selects the backoff again. As a result, the actual backoff experience by frame 2 is less likely to be 0 since that would require two successions of 0 backoff (one that generates the virtual collision and one after the virtual collision).

See Bug 555 for past behavior.

Definition at line 424 of file wifi-test.cc.

Constructor & Destructor Documentation

◆ DcfImmediateAccessBroadcastTestCase()

DcfImmediateAccessBroadcastTestCase::DcfImmediateAccessBroadcastTestCase ( )

Definition at line 455 of file wifi-test.cc.

Member Function Documentation

◆ DoRun()

◆ NotifyPhyTxBegin()

void DcfImmediateAccessBroadcastTestCase::NotifyPhyTxBegin ( Ptr< const Packet p,
double  txPowerW 
)
private

Notify Phy transmit begin.

Parameters
pthe packet
txPowerWthe tx power

Definition at line 461 of file wifi-test.cc.

References m_firstTransmissionTime, m_numSentPackets, m_secondTransmissionTime, and ns3::Now().

Referenced by DoRun().

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

◆ SendOnePacket()

void DcfImmediateAccessBroadcastTestCase::SendOnePacket ( Ptr< WifiNetDevice dev)
private

Send one packet function.

Parameters
devthe device

Definition at line 475 of file wifi-test.cc.

References ns3::WifiNetDevice::GetBroadcast(), and ns3::WifiNetDevice::Send().

Referenced by DoRun().

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

Member Data Documentation

◆ m_firstTransmissionTime

Time DcfImmediateAccessBroadcastTestCase::m_firstTransmissionTime
private

first transmission time

Definition at line 443 of file wifi-test.cc.

Referenced by DoRun(), and NotifyPhyTxBegin().

◆ m_mac

ObjectFactory DcfImmediateAccessBroadcastTestCase::m_mac
private

MAC.

Definition at line 440 of file wifi-test.cc.

Referenced by DoRun().

◆ m_manager

ObjectFactory DcfImmediateAccessBroadcastTestCase::m_manager
private

manager

Definition at line 439 of file wifi-test.cc.

Referenced by DoRun().

◆ m_numSentPackets

unsigned int DcfImmediateAccessBroadcastTestCase::m_numSentPackets
private

number of sent packets

Definition at line 445 of file wifi-test.cc.

Referenced by DoRun(), and NotifyPhyTxBegin().

◆ m_propDelay

ObjectFactory DcfImmediateAccessBroadcastTestCase::m_propDelay
private

propagation delay

Definition at line 441 of file wifi-test.cc.

Referenced by DoRun().

◆ m_secondTransmissionTime

Time DcfImmediateAccessBroadcastTestCase::m_secondTransmissionTime
private

second transmission time

Definition at line 444 of file wifi-test.cc.

Referenced by DoRun(), and NotifyPhyTxBegin().


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