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

Test transmission of broadcast and unicast frames with STAs in Power Save mode. More...

Inheritance diagram for WifiPowerSaveModeTest:
Collaboration diagram for WifiPowerSaveModeTest:

Classes

struct  Events
 Actions and checks to perform upon the transmission of each frame. More...

Public Member Functions

 WifiPowerSaveModeTest (WifiStandard standard)
 Constructor.
void NotifyMpduEnqueued (Ptr< const WifiMpdu > mpdu)
 Notify that the given MPDU was enqueued at the AP.
void NotifyStateChange (uint32_t nodeId, uint8_t phyId, Time stateStart, Time stateDuration, WifiPhyState state)
 Callback invoked when the PHY state helper reports a change in PHY state.
void Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
 Callback invoked when PHY receives a PSDU to transmit.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCaseoperator= (const TestCase &)=delete

Protected Member Functions

Ptr< PacketSocketClientGetApplication (const PacketSocketAddress &sockAddr, std::size_t count, std::size_t pktSize, Time delay=Time{0}, uint8_t priority=0) const
void L7Receive (uint8_t nodeId, Ptr< const Packet > p, const Address &addr)
 Function to trace packets received by the server application.
void SetEvents ()
 Set the list of events to expect in this test run.
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.

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
void DoSetup () override
 Implementation to do any local setup required for this TestCase.

Private Attributes

Ptr< ListErrorModelm_apErrorModel
 error model to install on the AP MLD
Ptr< ApWifiMacm_apMac
 AP wifi MAC.
Time m_duration {Seconds(5)}
 simulation duration
std::list< Eventsm_events
 list of events for a test run
std::vector< doublem_jitter {0.2, 0.6}
 jitter for the initial Beacon frames on the links
Ptr< ListErrorModelm_nonApMldErrorModel
 error model to install on the non-AP MLD
Ptr< ListErrorModelm_nonApStaErrorModel
 error model to install on the non-AP STA
std::size_t m_processedEvents {0}
 number of processed events
std::array< std::size_t, 3 > m_rxPkts {{0, 0, 0}}
 number of packets received at application layer by each node (index is node ID)
std::vector< Ptr< StaWifiMac > > m_staMacs
 STA wifi MACs.
WifiStandard m_standard
 the wifi standard for AP and STA

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...

Detailed Description

Test transmission of broadcast and unicast frames with STAs in Power Save mode.

The test scenario comprises an AP MLD with two links, a non-AP STA (operating on link 0) and a non-AP MLD with two links. The non-AP MLD negotiates a TID-to-Link Mapping such that (both in DL and UL) TID 0 is mapped on both links and TID 2 is mapped on link 1 only. The sequence of events is depicted in the diagram below. Note that, for most of the time, the non-AP STA affiliated with the non-AP MLD and operating on link 0 is in active mode, while the non-AP STA affiliated with the non-AP MLD and operating on link 1 is in power save mode.

The standard supported by the non-AP STA is a parameter of this test, while the non-AP MLD supports the 802.11be standard.

            (1)            (2)                   (3)                           (4) non-AP STA
                                                                                   is set to go
         ┌──────┐                       ┌──────┐   Broadcast  ┌─────────┐  ┌──────┐to PS mode
         │Beacon│   non-AP STA performs │Beacon│ frame queued │Broadcast│  │Beacon││      ┌───┐
[link 0] │ DTIM │     association       │ TIM  │    at AP  │  │QoS Data │  │ DTIM ││      │Ack│
─────────┴──────┴───────────────────────┴──────┴───────────▼──┴─────────┴──┴──────┴▼┬────┬┴───┴─
                                                           │Not buffered            │Data│
                      non-AP MLD performs                  │(no STA in PS mode)     │Null│
             ┌──────┐ association and sends Data ┌──────┐  │  ┌─────────┐  ┌──────┐ └────┘
             │Beacon│ Null for other non-AP STA  │Beacon│  │  │Broadcast│  │Beacon│       ┌───┐
[link 1]     │ DTIM │ to switch to active mode   │ TIM  │  │  │QoS Data │  │ DTIM │       │Ack│
─────────────┴──────┴────────────────────────────┴──────┴──▼──┴─────────┴──┴──────┴▲┬────┬┴───┴─
                                                                                   ││Data│
                                                                                   ││Null│
                                                                                   │└────┘
                                                                           non-AP STA affiliated
                                                                       with non-AP MLD on link 1
                                                                         is set to go to PS mode
(CONTINUED)

                          (5)          (6)            (7)         (8)               (9)
                   QoS data frame with    another broadcast frame       2 frames for non-AP
   1 broadcast      TID 4 queued for |        |queued at AP               STA are queued at
   frame queued     ┌──────┐ non-AP ┌──────┐ ┌─────────┐ ┌────────────────┐ AP and buffered
     at AP │        │Beacon│    MLD │Beacon│ │Broadcast│ │ BA agreement + │ │
[link 0]   │        │ TIM  │        │ DTIM │ │QoS Data │ │unicast QoS Data│ │
───────────▼────────┴──────┴────────┴▼─────┴─┴▼────────┴─┴────────────────┴─▼───────────────────
           │                         │        │
non-AP STA -sleep--│        │------│ │        │        │----------------------------------------
non-AP STA │                         │        │
affiliated ---sleep--------│        │------------------------│                                │-
on link 1  │                  No DTIM,        │
           │Buffered because  frames still    │
           │STAs in PS mode   buffered        │
           │                ┌──────┐ │        │               ┌──────┐ ┌─────────┐ ┌─────────┐
           │                │Beacon│ │        │               │Beacon│ │Broadcast│ │Broadcast│
[link 1]   │                │ TIM  │ │        │               │ DTIM │ │QoS Data │ │QoS Data │
───────────▼────────────────┴──────┴─▼────────▼───────────────┴──────┴─┴─────────┴─┴─────────┴──



(CONTINUED)
                    (10)                      (11)        (12)               (13)

         ┌──────┐       ┌────────┐                               ┌──────┐       ┌────────┐
         │Beacon│       │QoS Data│                  PS-Poll      │Beacon│       │QoS Data│
[link 0] │ TIM  │       │ to STA │                  dropped      │ DTIM │       │ to STA │
─────────┴──────┴─┬────┬┴────────┴┬───┬─┬────X───┬────X──────────┴──────┴─┬────┬┴────────┴┬───┬─
                  │ PS │          │ACK│ │ PS │...│ PS │                   │ PS │          │ACK│
                  │Poll│          └───┘ │Poll│   │Poll│                   │Poll│          └───┘
                  └────┘                └────┘   └────┘                   └────┘
non-AP STA                                             │--sleep-│                              │-
non-AP STA
affiliated --------sleep-------------------------------│        │-------------------------------
on link 1
                                                        ┌──────┐ drop broadcast
                                                        │Beacon│ frame queued for
[link 1]                                                │ TIM  │ TX on link 0
────────────────────────────────────────────────────────┴──────┴────────────────────────────────


(CONTINUED)

                             (14)            (15)          (16)                    (17)
  2 QoS Data frames with                   2 QoS Data frames
    TID 0 for non-AP MLD                    with TID 2 for
    are queued at AP but                    non-AP MLD are
  not buffered as STA on  ┌────────┬────────┐ queued and ┌──────┐
link 0 is in active mode  │QoS Data│QoS Data│  buffered  │Beacon│
[link 0]           │      │ to MLD │ to MLD │     │      │ TIM  │
───────────────────▼──────┴────────┴────────┴┬──┬────────┴──────┴───────────────────────────────
                   │ Block Ack               │BA│ │
                   │ agreement               └──┘ │
                   │ establishment                │
non-AP STA ------------------sleep----------------------│        │------------------------------
non-AP STA         │                              │
affiliated       │--------sleep-----------------------------------│
on link 1          │                              │
         ┌──────┐  │                              │                ┌──────┐       ┌────────┐
         │Beacon│  │                              │                │Beacon│       │QoS Data│
[link 1] │ DTIM │  │                              │                │ TIM  │       │ to MLD │
─────────┴──────┴──▼──────────────────────────────▼────────────────┴──────┴─┬────┬┴────────X────
                                                                            │ PS │
                                                                            │Poll│
                                                                            └────┘


(CONTINUED)
                          (17)                                          (18)
                                                 2 QoS Data frames
                                                 are queued at
                                                 non-AP STA         ADDBA
                                                       │       ┌───┐Resp      ┌───┐      ┌───┐
[link 0]                                               │       │Ack│timer     │Ack│      │Ack│
───────────────────────────────────────────────────────▼┬─────┬┴───┴────┬────┬┴───┴┬────┬┴───┴──
                                                        │ADDBA│         │QoS │     │QoS │
                                                        │ Req │         │Data│     │Data│
                                                        └─────┘         └────┘     └────┘
non-AP STA ------------------sleep---------------------│            │--│                      │-
non-AP STA
affiliated                                             │--------sleep---------------------------
on link 1
                 ┌────────┐             ┌────────┐
                 │QoS Data│             │QoS Data│
[link 1]         │ to MLD │             │ to MLD │
───────────┬────┬┴────────┴┬───┬──┬────┬┴────────┴┬───┬─────────────────────────────────────────
           │ PS │          │ACK│  │ PS │          │ACK│
           │Poll│          └───┘  │Poll│          └───┘
           └────┘                 └────┘



(CONTINUED)
                   (19)                        (20)                          (21)
                                 2 QoS Data frames
         ┌──────┐        ┌─────┐ with TID 0 are queued   ┌─────┐
         │Beacon│        │ADDBA│ at non-AP MLD  ┌───┐    │ADDBA│
[link 0] │ DTIM │        │Resp │     |          │Ack│    │Resp │
─────────┴──────┴──┬────┬┴─────┴┬───┬▼───┬─────┬┴───┴────┴─────┴┬───┬───────────────────────────
                   │ PS │       │Ack│|   │ADDBA│                │Ack│
                   │Poll│       └───┘|   │ Req │                └───┘
                   └────┘            |   └─────┘
non-AP STA                           │------------------sleep-----------------------------------
non-AP STA                           |
affiliated --------sleep-------------|   backoff   |------sleep-----|                 |--sleep--
on link 1                            |                                   can also
                                     |                                   occur on  ┌──┐
[link 1]                             |                                   link 0    │BA│
─────────────────────────────────────▼──────────────────────────────────┬────┬────┬┴──┴─────────
                                                                        │QoS │QoS │
                                                                        │Data│Data│
                                                                        └────┴────┘



(CONTINUED)
                    (22)                      (23)
 a QoS Data frame       frame dropped   a QoS Data frame with
 with TID 0 for non-AP  at AckTimeout,  TID 0 for non-AP MLD
 MLD is queued at AP    non-AP STA on   is queued and buffered
 MLD but not  ┌────┐    link 0 set to   at AP  ┌──────┐                         ┌────┐
  buffered  | │QoS │    go to  ┌───┐    MLD    │Beacon│        ┌───┐            │QoS │
[link 0]    | │Data│    PS mode│Ack│          |│ TIM  │        │BAR│            │Data│
────────────▼─┴────X─────┬────┬┴───┴──────────▼┴──────┴──┬────┬┴───┴┬──┬──┬────┬┴────┴┬───┬─────
            |            │Data│               |          │ PS │     │BA│  │ PS │      │Ack│
            |            │Null│               |          │Poll│     └──┘  │Poll│      └───┘
            |            └────┘               |          └────┘           └────┘
non-AP STA ------------sleep------------------|        |----------------------------------------
non-AP STA  |                                 |
affiliated  |                       |--sleep--|                                            |----
on link 0   |                                 |
non-AP STA  |                                 |
affiliated ---------------sleep------|        |-------sleep-------------------------------------
on link 1   |                         ┌──────┐|
            |                         │Beacon│|
[link 1]    |                         │ DTIM │|
────────────▼─────────────────────────┴──────┴▼─────────────────────────────────────────────────

Definition at line 499 of file power-save-test.cc.

Constructor & Destructor Documentation

◆ WifiPowerSaveModeTest()

WifiPowerSaveModeTest::WifiPowerSaveModeTest ( WifiStandard standard)

Constructor.

Parameters
standardthe standard supported by the non-AP STA

Definition at line 612 of file power-save-test.cc.

References ns3::TestCase::TestCase(), ns3::CreateObject(), m_apErrorModel, m_nonApMldErrorModel, m_nonApStaErrorModel, and m_standard.

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void WifiPowerSaveModeTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 861 of file power-save-test.cc.

References ns3::Simulator::Destroy(), m_events, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Seconds(), and ns3::Simulator::Stop().

Here is the call graph for this function:

◆ DoSetup()

void WifiPowerSaveModeTest::DoSetup ( )
overrideprivatevirtual

◆ GetApplication()

Ptr< PacketSocketClient > WifiPowerSaveModeTest::GetApplication ( const PacketSocketAddress & sockAddr,
std::size_t count,
std::size_t pktSize,
Time delay = Time{0},
uint8_t priority = 0 ) const
protected
Parameters
sockAddrthe packet socket address identifying local outgoing interface and remote address
countthe number of packets to generate
pktSizethe size of the packets to generate
delaythe delay with which traffic generation starts
priorityuser priority for generated packets
Returns
an application generating the given number packets of the given size destined to the given packet socket address

Definition at line 622 of file power-save-test.cc.

References ns3::CreateObject(), m_duration, ns3::MicroSeconds(), and ns3::Simulator::Now().

Here is the call graph for this function:

◆ L7Receive()

void WifiPowerSaveModeTest::L7Receive ( uint8_t nodeId,
Ptr< const Packet > p,
const Address & addr )
protected

Function to trace packets received by the server application.

Parameters
nodeIdthe ID of the node that received the packet
pthe packet
addrthe address

Definition at line 854 of file power-save-test.cc.

References m_rxPkts, and NS_LOG_INFO.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ NotifyMpduEnqueued()

void WifiPowerSaveModeTest::NotifyMpduEnqueued ( Ptr< const WifiMpdu > mpdu)

Notify that the given MPDU was enqueued at the AP.

Parameters
mpduthe given MPDU

Definition at line 887 of file power-save-test.cc.

References NS_LOG_DEBUG.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ NotifyStateChange()

void WifiPowerSaveModeTest::NotifyStateChange ( uint32_t nodeId,
uint8_t phyId,
Time stateStart,
Time stateDuration,
WifiPhyState state )

Callback invoked when the PHY state helper reports a change in PHY state.

Parameters
nodeIdthe ID of the node
phyIdthe ID of the PHY that changed state
stateStartthe start time of the period elapsed in the given PHY state
stateDurationthe duration of the period elapsed in the given PHY state
statethe given PHY state

Definition at line 872 of file power-save-test.cc.

References ns3::Time::As(), NS_LOG_DEBUG, ns3::Time::S, and ns3::SLEEP.

Referenced by DoSetup().

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

◆ SetEvents()

void WifiPowerSaveModeTest::SetEvents ( )
protected

Set the list of events to expect in this test run.

(1) The AP MLD sends a Beacon frame on each of its two links. Both Beacon frames contain a DTIM and the multicast pending bit is not set. After receiving these Beacon frames, the non-AP STA and the non-AP MLD start the association procedure.

(2) Frames (other than Beacon frames) exchanged before non-AP STA and non-AP MLD are considered associated by the AP MLD are ignored. The following frames are the Data Null/Ack exchange for the non-AP STA affiliated with the non-AP MLD to switch to active mode.

(3) After two other Beacon frames (each sent on a distinct link), a broadcast frame is queued at the AP MLD, which immediately transmits it on both links, given that no STA is in power save mode.

(4) After two other Beacon frames (each sent on a distinct link), the non-AP STA (operating on link 0) and the non-AP STA affiliated with the non-AP MLD and operating on link 1 switch to power save mode by sending a Data Null frame with the PM flag set to 1. After receiving the Ack response, the non-AP STAs put their PHYs to sleep. Also, after transmitting the last Ack response, a broadcast frame is queued at the AP MLD, but it is buffered because there are STAs in power save mode on both links.

(5) The next two Beacon frames (on the two links) do not contain a DTIM, thus the broadcast frames are still buffered. Check that all non-AP STAs operating on the link on which the Beacon frame is transmitted are awake to listen to the Beacon frame and that the non-AP STAs in power save mode return to sleep after the Beacon frame.

(6) The next Beacon frame includes a DTIM and the AID bits in the virtual bitmap corresponding to both AID 0 (buffered group addressed frames on the same link) and AID 1 (buffered group addressed frames on the other link) are both set. Therefore, after receiving the Beacon frame, the non-AP STAs operating on the link on which the Beacon frame was received stay awake to receive the broadcast frames. When the transmission of the Beacon frame starts, a QoS data frame with TID 4 for the non-AP MLD is queued at the AP MLD.

(7) After the Beacon frame including a DTIM, the broadcast frame is sent with the More Data flag set to 0, because at the time the frame is sent no other broadcast frame is queued. Right after starting its transmission, another broadcast frame is queued. The non-AP STA operating on the same link goes to sleep after the reception of the broadcast frame because the More Data flag is set to 0. Given that a broadcast frame with the More Data flag set to 0 is sent, the AP blocks the transmission of group addressed frames and transmits the unicast data frame for the non-AP MLD, which has an affiliated STA in active mode on link 0. The jitter between the initial Beacon frames sent on the two links has been set large enough to have these frames transmitted on the same link as the first Beacon frame before a Beacon frame is transmitted on the other link.

(8) Next, a Beacon frame is transmitted on the other link. It includes a DTIM and the AID bit in the virtual bitmap corresponding to AID 0 (buffered group addressed frames on the same link) and to AID 1 (buffered group addressed frames on the other link) are both set, because the second broadcast frame has not been transmitted on link 0. Again, after receiving the Beacon frame, the non-AP STAs operating on the link on which the Beacon frame was received stay awake to receive the broadcast frames. Also, two unicast frames addressed to the non-AP STA are queued at the AP MLD, but they are buffered because the non-AP STA is in power save mode.

(9) We check that the first broadcast frame has the More Data flag set to 1 and the non-AP STAs operating on the same link stay awake after its reception. The second broadcast frame has the More Data flag set to 0 and the non-AP STAs operating on the same link go to sleep after its reception.

(10) We assume that the Beacon frame on link 0 is sent first. This Beacon frame has the AID bit in the virtual bitmap corresponding to the AID of the non-AP STA set to 1. The non-AP STA is awake before the transmission of the Beacon frame and stays awake afterwards. The non-AP STA sends a PS Poll frame, receives a QoS data frame from the AP (having the More Data flag set to 1) and transmits an Ack. Then, it stays awake to send another PS Poll frame.

(11) The second PS Poll frame is discarded multiple times by the AP MLD for a post reception error. We configure the remote station manager on the non-AP STA to drop the PS Poll after the 5th unsuccessful transmission.

(12) The next transmitted frame is the Beacon frame on link 1. The non-AP STA turned to the sleep state after giving up sending the PS Poll frame (which was dropped) and is still in the sleep state. Drop the broadcast frame that is still buffered for transmission on link 0, so as to avoid a possible collision after the next Beacon frame including a DTIM sent on link 0 between the AP (trying to send the broadcast frame) and the non-AP STA (trying to send a PS-Poll frame)

(13) The next Beacon frame is sent again on link 0. This Beacon frame has again the AID bit in the virtual bitmap corresponding to the AID of the non-AP STA set to 1. The non-AP STA is awake before the transmission of the Beacon frame and stays awake afterwards. The non-AP STA sends a PS Poll frame, receives a QoS data frame from the AP (having the More Data flag set to 0) and transmits an Ack. Then, it goes to sleep because no other QoS data frame is expected to be received from the AP.

(14) The next Beacon frame is sent on link 1. Non-AP STAs operating on link 1 wake up to listen to the Beacon and go to sleep afterwards. After the transmission of the Beacon frame, two unicast data frames with TID 0 are queued at the AP MLD and addressed to the non-AP MLD. Given that TID 0 is mapped on both links and, specifically, is mapped onto link 0, on which an affiliated non-AP STA is operating in active mode, the unicast frames are not buffered and are transmitted on link 0 (aggregated in an A-MPDU) after the frame exchanges to establish the Block Ack agreement in the DL direction. These MPDUs have both the Power Management flag and the More Data flag not set, because the More Data flag is used by the AP MLD when transmitting frames to a non-AP STA in PS mode.

(15) The non-AP STA affiliated with the non-AP MLD and operating on link 0 transmits a BlockAck response. Afterwards, two unicast Data frames with TID 2 are queued at the AP MLD and addressed to the non-AP MLD. These frames are buffered because TID 2 is only mapped to link 1, on which an affiliated non-AP STA in PS mode is operating.

(16) The next frame is a Beacon sent on link 0. The AID bit in the virtual bitmap corresponding to the AID of the non-AP MLD is set to 1 because there are buffered units. The non-AP STA affiliated with the non-AP MLD and operating on link 0 is in active mode, hence it is not supposed to send a PS Poll frame.

(17) The next frame is thus a Beacon sent on link 1. The AID bit in the virtual bitmap corresponding to the AID of the non-AP MLD is still set to 1 because there are buffered units. The non-AP STA affiliated with the non-AP MLD and operating on link 1 in PS mode stays awake to send a PS Poll frame. The AP MLD sends the first buffered unit, which is corrupted at the receiver. After the timeout, the non-AP STA affiliated with the non-AP MLD and operating on link 1 sends again a PS Poll, receives a buffered unit and sends the Ack response (repeated twice because the two buffered units are sent one at a time). After the last Ack response, two QoS Data frames are queued at the non-AP STA and addressed to the AP MLD.

(18) Two QoS data frames have been queued at the non-AP STA, which is in sleep state. The non-AP STA does not wait until the next Beacon, but it is immediately awaken to start a TXOP. Actually, the queued frames trigger the establishment of a Block Ack agreement in the uplink direction; the non-AP STA sends an ADDBA Request, which is acknowledged by the AP. Then, the AP buffers the ADDBA Response, because the non-AP STA is in power save mode; the non-AP STA has blocked transmission of QoS data frames (while waiting for ADDBA Response) and thus releases the channel, generates backoff and restarts channel access. When the non-AP STA is granted channel access again, it still has nothing to transmit and this time it does not restart channel access and goes to sleep. When the ADDBA Response timer expires, the transmission of the QoS data frames is unblocked, the non-AP STA wakes up and transmits the two QoS data frames using normal acknowledgment; afterwards, the non-AP STA goes back to sleep.

(19) The next Beacon frame sent on link 0 indicates that the AP has a buffered unit (the ADDBA Response) for the non-AP STA, which sends a PS-Poll to request the AP to transmit it.

(20) Frames with TID 0 can be transmitted on both links, hence the non-AP MLD requests channel access on both links. This implies that the non-AP STA affiliated with the non-AP MLD and operating on link 1 awakens and generates a new backoff value. The backoff counter of the non-AP STA affiliated with the non-AP MLD and operating on link 0 has likely reached zero already, hence the management frames to establish the BA agreement are sent on link 0. During such frame exchange, the backoff counter on link 1 reaches zero, channel access is granted but no frame is available for transmission (queues are blocked while BA is being established), hence the non-AP STA affiliated with the non-AP MLD and operating on link 1 is put to sleep. When the non-AP MLD completes the transmission of the Ack in response to the ADDBA Response frame, transmissions are unblocked and channel access is requested on both links. Hence, the non-AP STA affiliated with the non-AP MLD and operating on link 1 awakens and generates a new backoff value.

(21) UL QoS Data frames can now be sent in an A-MPDU on either link 0 or 1 (depends on the generated backoff values)

(22) The AP MLD transmits the QoS data with TID 0 for the non-AP MLD on link 0, but we force a receive error at the non-AP MLD. The frame retry limit on the AP is set to 1, so that the QoS data frame is dropped when the Ack timeout occurs; consequently, a BlockAckReq is enqueued. The non-AP MLD is then configured to switch the affiliated non-AP STA operating on link 0, too, to powersave mode. The affiliated non-AP STA operating on link 0 is put to sleep after receiving the Ack in response to the sent Data Null frame.

(23) When the Beacon frame is sent on link 1, another QoS data with TID 0 for the non-AP MLD is queued at the AP MLD, which is now buffered because both STAs affiliated with the non-AP MLD are in powersave mode. The next Beacon frame, on link 0, indicates that frames are buffered for the non-AP MLD, which sends a two PS-Poll frames: the AP sends the BlockAckReq (ack'ed by a BlockAck frame) in response to the first PS-Poll and the QoS Data frame (ack'ed by a Normal Ack) in response to the second PS-Poll frame.

Definition at line 893 of file power-save-test.cc.

References ns3::Mac48Address::GetBroadcast(), m_apMac, m_events, m_processedEvents, m_staMacs, ns3::MAX_PROPAGATION_DELAY, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::PeekPointer(), ns3::Simulator::Schedule(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::SLEEP, ns3::WIFI_MAC_CTL_ACK, ns3::WIFI_MAC_DATA_NULL, ns3::WIFI_MAC_MGT_BEACON, ns3::WIFI_PM_ACTIVE, and ns3::WIFI_PM_POWERSAVE.

Referenced by DoSetup().

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

◆ Transmit()

void WifiPowerSaveModeTest::Transmit ( Ptr< WifiMac > mac,
uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
Watt_u txPower )

Callback invoked when PHY receives a PSDU to transmit.

Parameters
macthe MAC transmitting the PSDUs
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerthe tx power

Definition at line 796 of file power-save-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiMacHeader::GetTypeString(), m_apMac, m_events, m_processedEvents, m_staMacs, ns3::Time::MS, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and ns3::Time::US.

Referenced by DoSetup().

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

Member Data Documentation

◆ m_apErrorModel

Ptr<ListErrorModel> WifiPowerSaveModeTest::m_apErrorModel
private

error model to install on the AP MLD

Definition at line 607 of file power-save-test.cc.

Referenced by WifiPowerSaveModeTest(), and DoSetup().

◆ m_apMac

Ptr<ApWifiMac> WifiPowerSaveModeTest::m_apMac
private

AP wifi MAC.

Definition at line 599 of file power-save-test.cc.

Referenced by DoSetup(), SetEvents(), and Transmit().

◆ m_duration

Time WifiPowerSaveModeTest::m_duration {Seconds(5)}
private

simulation duration

Definition at line 603 of file power-save-test.cc.

Referenced by DoSetup(), and GetApplication().

◆ m_events

std::list<Events> WifiPowerSaveModeTest::m_events
private

list of events for a test run

Definition at line 601 of file power-save-test.cc.

Referenced by DoRun(), SetEvents(), and Transmit().

◆ m_jitter

std::vector<double> WifiPowerSaveModeTest::m_jitter {0.2, 0.6}
private

jitter for the initial Beacon frames on the links

Definition at line 606 of file power-save-test.cc.

Referenced by DoSetup().

◆ m_nonApMldErrorModel

Ptr<ListErrorModel> WifiPowerSaveModeTest::m_nonApMldErrorModel
private

error model to install on the non-AP MLD

Definition at line 609 of file power-save-test.cc.

Referenced by WifiPowerSaveModeTest(), and DoSetup().

◆ m_nonApStaErrorModel

Ptr<ListErrorModel> WifiPowerSaveModeTest::m_nonApStaErrorModel
private

error model to install on the non-AP STA

Definition at line 608 of file power-save-test.cc.

Referenced by WifiPowerSaveModeTest(), and DoSetup().

◆ m_processedEvents

std::size_t WifiPowerSaveModeTest::m_processedEvents {0}
private

number of processed events

Definition at line 602 of file power-save-test.cc.

Referenced by SetEvents(), and Transmit().

◆ m_rxPkts

std::array<std::size_t, 3> WifiPowerSaveModeTest::m_rxPkts {{0, 0, 0}}
private

number of packets received at application layer by each node (index is node ID)

Definition at line 604 of file power-save-test.cc.

Referenced by L7Receive().

◆ m_staMacs

std::vector<Ptr<StaWifiMac> > WifiPowerSaveModeTest::m_staMacs
private

STA wifi MACs.

Definition at line 600 of file power-save-test.cc.

Referenced by DoSetup(), SetEvents(), and Transmit().

◆ m_standard

WifiStandard WifiPowerSaveModeTest::m_standard
private

the wifi standard for AP and STA

Definition at line 598 of file power-save-test.cc.

Referenced by WifiPowerSaveModeTest(), and DoSetup().


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