A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::DefaultPowerSaveManager Class Reference

DefaultPowerSaveManager is the default power save manager. More...

#include "default-power-save-manager.h"

Inheritance diagram for ns3::DefaultPowerSaveManager:
Collaboration diagram for ns3::DefaultPowerSaveManager:

Public Member Functions

 DefaultPowerSaveManager ()
 ~DefaultPowerSaveManager () override
Public Member Functions inherited from ns3::PowerSaveManager
 ~PowerSaveManager () override
uint32_t GetListenInterval () const
std::optional< TimeGetTimeUntilNextTbtt (linkId_t linkId) const
void NotifyAssocCompleted ()
 Notify that the non-AP STA/MLD has completed association with an AP.
void NotifyBeaconIntervalAndTimestamp (const Time &beaconInterval, const Time &timestamp, linkId_t linkId)
 This function is normally used to notify the Beacon interval and timestamp included in the last Beacon frame advertised by the AP this device is going to associate with.
void NotifyChannelReleased (Ptr< Txop > txop, linkId_t linkId)
 Notify that the given TXOP has released the channel on the given link.
void NotifyDisassociation ()
 Notify that the non-AP STA/MLD has disassociated.
void NotifyPmModeChanged (WifiPowerManagementMode pmMode, linkId_t linkId)
 Notify that the Power Management mode of the non-AP STA operating on the given link has changed.
void NotifyReceivedBeacon (Ptr< const WifiMpdu > mpdu, linkId_t linkId)
 Notify that a Beacon frame has been received from the associated AP on the given link.
void NotifyReceivedFrameAfterPsPoll (Ptr< const WifiMpdu > mpdu, linkId_t linkId)
 Notify the reception of a frame in response to a PS-Poll frame on the given link.
void NotifyReceivedGroupcast (Ptr< const WifiMpdu > mpdu, linkId_t linkId)
 Notify the reception of a groupcast frame (possibly after a DTIM) on the given link.
void NotifyRequestAccess (Ptr< Txop > txop, linkId_t linkId)
 Notify that the given TXOP is requesting channel access on the given link.
void SetPowerSaveMode (const std::map< linkId_t, bool > &linkIdEnableMap)
 Enable or disable Power Save mode on a given set of links.
void SetWifiMac (Ptr< StaWifiMac > mac)
 Set the MAC which is using this Power Save Manager.
void TxDropped (WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
 Notify that the given MPDU has been discarded for the given reason.
Public Member Functions inherited from ns3::Object
 Object ()
 Caller graph was not generated because of its size.
 ~Object () override
 Destructor.
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
void Dispose ()
 Dispose of this Object.
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
TypeId GetInstanceTypeId () const final
 Get the most derived TypeId for this Object.
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
bool IsInitialized () const
 Check if the object has been initialized.
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
uint32_t GetReferenceCount () const
 Get the reference count of the object.
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
void Ref () const
 Increment the reference count.
void Unref () const
 Decrement the reference count.
Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::PowerSaveManager
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.

Protected Member Functions

void DoNotifyAssocCompleted () override
 Notify subclasses that the non-AP STA/MLD has completed association with an AP.
void DoNotifyChannelReleased (Ptr< Txop > txop, linkId_t linkId) override
 Notify subclasses that the given TXOP is releasing the channel on the given link.
void DoNotifyDisassociation () override
 Notify subclasses that the non-AP STA/MLD has disassociated.
void DoNotifyPmModeChanged (WifiPowerManagementMode pmMode, linkId_t linkId) override
 Notify subclasses that the Power Management mode of the non-AP STA operating on the given link has changed.
void DoNotifyReceivedBeacon (const MgtBeaconHeader &beacon, linkId_t linkId) override
 Notify subclasses that a Beacon frame has been received from the associated AP on the given link.
void DoNotifyReceivedFrameAfterPsPoll (Ptr< const WifiMpdu > mpdu, linkId_t linkId) override
 Notify subclasses of the reception of a frame in response to a PS-Poll frame on the given link.
void DoNotifyReceivedGroupcast (Ptr< const WifiMpdu > mpdu, linkId_t linkId) override
 Notify subclasses of the reception of a groupcast frame (possibly after a DTIM) on the given link.
void DoNotifyRequestAccess (Ptr< Txop > txop, linkId_t linkId) override
 Notify subclasses that the given TXOP is requesting channel access on the given link.
void DoTxDropped (WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu) override
 Notify subclasses that the given MPDU has been discarded for the given reason.
void GoToSleepIfPossible (linkId_t linkId)
 Put the PHY operating on the given link to sleep, if no reason to stay awake.
Protected Member Functions inherited from ns3::PowerSaveManager
void DoDispose () override
 Destructor implementation.
void DoInitialize () override
 Initialize() implementation.
StaInfoGetStaInfo (linkId_t linkId)
 Get the information about the STA operating on the given link.
Ptr< StaWifiMacGetStaMac () const
bool HasRequestedOrGainedChannel (linkId_t linkId) const
 Get whether any Access Category has requested (or gained) the channel on the given link.
Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.

Protected Attributes

Time m_listenAdvance
 the amount of time the STA wakes up in advance prior to the TBTT
Time m_psmTimeout
 the extra time during which the PHY is kept in active state before being put to sleep state
std::map< linkId_t, EventIdm_sleepEvents
 events scheduled to set PHYs to sleep
std::map< linkId_t, EventIdm_wakeUpEvents
 events scheduled to wake up PHYs

Additional Inherited Members

Detailed Description

DefaultPowerSaveManager is the default power save manager.

Config Paths

ns3::DefaultPowerSaveManager is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/PowerSaveManager/$ns3::DefaultPowerSaveManager"

Attributes

  • ListenAdvance: The amount of time the STA wakes up in advance prior to the Target Beacon Transmission Time.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +0ns:+9.22337e+18ns
    • Initial value: +0ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • PsmTimeout: The length of the extra time during which the PHY is kept in active state before being put to sleep state. If channel access is requested (to transmit a frame) during such extra time, the PHY is kept in active state to attempt to gain channel access and transmit. See the TGax Simulation Scenarios document IEEE 802.11-14/0980r16.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +0ns:+9.22337e+18ns
    • Initial value: +0ns
    • Flags: constructwriteread
    • Support level: SUPPORTED

Attributes defined in parent class ns3::PowerSaveManager

No TraceSources are defined for this type

TraceSources defined in parent class ns3::PowerSaveManager

  • PmMode: Traces every change in the power management mode of the STAs affiliated with this device. Provides the ID of the link on which the STA that changed power management mode is operating and the new power management mode of the STA.

Group: Wifi
Size of this type is 304 bytes (on a 64-bit architecture).

Definition at line 22 of file default-power-save-manager.h.

Constructor & Destructor Documentation

◆ DefaultPowerSaveManager()

ns3::DefaultPowerSaveManager::DefaultPowerSaveManager ( )

Definition at line 51 of file default-power-save-manager.cc.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

Here is the caller graph for this function:

◆ ~DefaultPowerSaveManager()

ns3::DefaultPowerSaveManager::~DefaultPowerSaveManager ( )
override

Definition at line 56 of file default-power-save-manager.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ DoNotifyAssocCompleted()

void ns3::DefaultPowerSaveManager::DoNotifyAssocCompleted ( )
overrideprotectedvirtual

Notify subclasses that the non-AP STA/MLD has completed association with an AP.

Implements ns3::PowerSaveManager.

Definition at line 146 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetStaMac(), GoToSleepIfPossible(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WIFI_PM_POWERSAVE.

Here is the call graph for this function:

◆ DoNotifyChannelReleased()

void ns3::DefaultPowerSaveManager::DoNotifyChannelReleased ( Ptr< Txop > txop,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses that the given TXOP is releasing the channel on the given link.

Parameters
txopthe DCF/EDCAF releasing the channel
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 261 of file default-power-save-manager.cc.

References GoToSleepIfPossible(), and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ DoNotifyDisassociation()

void ns3::DefaultPowerSaveManager::DoNotifyDisassociation ( )
overrideprotectedvirtual

Notify subclasses that the non-AP STA/MLD has disassociated.

Implements ns3::PowerSaveManager.

Definition at line 162 of file default-power-save-manager.cc.

References m_sleepEvents, m_wakeUpEvents, and NS_LOG_FUNCTION.

◆ DoNotifyPmModeChanged()

void ns3::DefaultPowerSaveManager::DoNotifyPmModeChanged ( WifiPowerManagementMode pmMode,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses that the Power Management mode of the non-AP STA operating on the given link has changed.

Parameters
pmModethe new PM mode
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 178 of file default-power-save-manager.cc.

References m_sleepEvents, m_wakeUpEvents, NS_LOG_FUNCTION, and ns3::WIFI_PM_ACTIVE.

◆ DoNotifyReceivedBeacon()

void ns3::DefaultPowerSaveManager::DoNotifyReceivedBeacon ( const MgtBeaconHeader & beacon,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses that a Beacon frame has been received from the associated AP on the given link.

Parameters
beaconthe Beacon frame
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 197 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetStaInfo(), ns3::PowerSaveManager::GetStaMac(), GoToSleepIfPossible(), NS_LOG_FUNCTION, and ns3::WIFI_PM_POWERSAVE.

Here is the call graph for this function:

◆ DoNotifyReceivedFrameAfterPsPoll()

void ns3::DefaultPowerSaveManager::DoNotifyReceivedFrameAfterPsPoll ( Ptr< const WifiMpdu > mpdu,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses of the reception of a frame in response to a PS-Poll frame on the given link.

The notification is sent a SIFS after the reception of the frame.

Parameters
mpduthe received MPDU
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 217 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetStaInfo(), ns3::PowerSaveManager::GetStaMac(), GoToSleepIfPossible(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Here is the call graph for this function:

◆ DoNotifyReceivedGroupcast()

void ns3::DefaultPowerSaveManager::DoNotifyReceivedGroupcast ( Ptr< const WifiMpdu > mpdu,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses of the reception of a groupcast frame (possibly after a DTIM) on the given link.

Parameters
mpduthe received MPDU
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 233 of file default-power-save-manager.cc.

References GoToSleepIfPossible(), and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ DoNotifyRequestAccess()

void ns3::DefaultPowerSaveManager::DoNotifyRequestAccess ( Ptr< Txop > txop,
linkId_t linkId )
overrideprotectedvirtual

Notify subclasses that the given TXOP is requesting channel access on the given link.

Parameters
txopthe DCF/EDCAF requesting channel access
linkIdthe ID of the given link

Implements ns3::PowerSaveManager.

Definition at line 241 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetStaMac(), m_sleepEvents, m_wakeUpEvents, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ DoTxDropped()

void ns3::DefaultPowerSaveManager::DoTxDropped ( WifiMacDropReason reason,
Ptr< const WifiMpdu > mpdu )
overrideprotectedvirtual

Notify subclasses that the given MPDU has been discarded for the given reason.

Parameters
reasonthe reason why the MPDU was dropped
mpduthe dropped MPDU

Implements ns3::PowerSaveManager.

Definition at line 269 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetStaInfo(), ns3::PowerSaveManager::GetStaMac(), GoToSleepIfPossible(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::PowerSaveManager::StaInfo::pendingUnicast.

Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::DefaultPowerSaveManager::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 26 of file default-power-save-manager.cc.

References DefaultPowerSaveManager(), m_listenAdvance, m_psmTimeout, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), and ns3::TypeId::SetParent().

Here is the call graph for this function:

◆ GoToSleepIfPossible()

void ns3::DefaultPowerSaveManager::GoToSleepIfPossible ( linkId_t linkId)
protected

Put the PHY operating on the given link to sleep, if no reason to stay awake.

Parameters
linkIdthe ID of the given link

Definition at line 62 of file default-power-save-manager.cc.

References ns3::PowerSaveManager::GetListenInterval(), ns3::PowerSaveManager::GetStaInfo(), ns3::PowerSaveManager::GetStaMac(), ns3::PowerSaveManager::HasRequestedOrGainedChannel(), m_listenAdvance, m_psmTimeout, m_sleepEvents, m_wakeUpEvents, Max, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiPhy::ResumeFromSleep(), ns3::Simulator::Schedule(), ns3::Time::US, and ns3::WIFI_PM_ACTIVE.

Referenced by DoNotifyAssocCompleted(), DoNotifyChannelReleased(), DoNotifyReceivedBeacon(), DoNotifyReceivedFrameAfterPsPoll(), DoNotifyReceivedGroupcast(), and DoTxDropped().

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

Member Data Documentation

◆ m_listenAdvance

Time ns3::DefaultPowerSaveManager::m_listenAdvance
protected

the amount of time the STA wakes up in advance prior to the TBTT

Definition at line 56 of file default-power-save-manager.h.

Referenced by GetTypeId(), and GoToSleepIfPossible().

◆ m_psmTimeout

Time ns3::DefaultPowerSaveManager::m_psmTimeout
protected

the extra time during which the PHY is kept in active state before being put to sleep state

Definition at line 54 of file default-power-save-manager.h.

Referenced by GetTypeId(), and GoToSleepIfPossible().

◆ m_sleepEvents

std::map<linkId_t, EventId> ns3::DefaultPowerSaveManager::m_sleepEvents
protected

events scheduled to set PHYs to sleep

Definition at line 53 of file default-power-save-manager.h.

Referenced by DoNotifyDisassociation(), DoNotifyPmModeChanged(), DoNotifyRequestAccess(), and GoToSleepIfPossible().

◆ m_wakeUpEvents

std::map<linkId_t, EventId> ns3::DefaultPowerSaveManager::m_wakeUpEvents
protected

events scheduled to wake up PHYs

Definition at line 52 of file default-power-save-manager.h.

Referenced by DoNotifyDisassociation(), DoNotifyPmModeChanged(), DoNotifyRequestAccess(), and GoToSleepIfPossible().


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