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

Default wifi Association Manager. More...

#include "wifi-default-assoc-manager.h"

+ Inheritance diagram for ns3::WifiDefaultAssocManager:
+ Collaboration diagram for ns3::WifiDefaultAssocManager:

Classes

struct  ChannelSwitchInfo
 Channel switch info. More...
 

Public Member Functions

 WifiDefaultAssocManager ()
 
 ~WifiDefaultAssocManager () override
 
bool Compare (const StaWifiMac::ApInfo &lhs, const StaWifiMac::ApInfo &rhs) const override
 Compare two ApInfo objects for the purpose of keeping a sorted list of ApInfo objects.
 
void NotifyChannelSwitched (uint8_t linkId) override
 Notify that the given link has completed channel switching.
 
- Public Member Functions inherited from ns3::WifiAssocManager
 ~WifiAssocManager () override
 
virtual bool Compare (const StaWifiMac::ApInfo &lhs, const StaWifiMac::ApInfo &rhs) const =0
 Compare two ApInfo objects for the purpose of keeping a sorted list of ApInfo objects.
 
virtual void NotifyApInfo (const StaWifiMac::ApInfo &&apInfo)
 STA wifi MAC received a Beacon frame or Probe Response frame while scanning and notifies us the AP information contained in the received frame.
 
virtual void NotifyChannelSwitched (uint8_t linkId)=0
 Notify that the given link has completed channel switching.
 
void SetStaWifiMac (Ptr< StaWifiMac > mac)
 Set the pointer to the STA wifi MAC.
 
void StartScanning (WifiScanParams &&scanParams)
 Request the Association Manager to start a scanning procedure according to the given scanning parameters.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~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 override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () 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.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
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.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy 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) 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.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
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::WifiAssocManager
static std::list< WifiAssocManager::RnrLinkInfoGetAllAffiliatedAps (const ReducedNeighborReport &rnr)
 Find all the APs affiliated to the same AP MLD as the reporting AP that sent the given RNR element.
 
static std::optional< WifiAssocManager::RnrLinkInfoGetNextAffiliatedAp (const ReducedNeighborReport &rnr, std::size_t nbrApInfoId)
 Search the given RNR element for APs affiliated to the same AP MLD as the reporting AP.
 
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

bool CanBeInserted (const StaWifiMac::ApInfo &apInfo) const override
 Allow subclasses to choose whether the given ApInfo shall be considered and hence inserted in the sorted list of ApInfo objects.
 
bool CanBeReturned (const StaWifiMac::ApInfo &apInfo) const override
 Allow subclasses to choose whether the given ApInfo shall be returned or discarded when the STA wifi MAC requests information on the best AP.
 
void DoDispose () override
 Destructor implementation.
 
void EndScanning ()
 Perform operations to do at the end of a scanning procedure, such as identifying the links to setup in case of 11be MLD devices.
 
- Protected Member Functions inherited from ns3::WifiAssocManager
 WifiAssocManager ()
 Constructor (protected as this is an abstract base class)
 
virtual bool CanBeInserted (const StaWifiMac::ApInfo &apInfo) const =0
 Allow subclasses to choose whether the given ApInfo shall be considered and hence inserted in the sorted list of ApInfo objects.
 
virtual bool CanBeReturned (const StaWifiMac::ApInfo &apInfo) const =0
 Allow subclasses to choose whether the given ApInfo shall be returned or discarded when the STA wifi MAC requests information on the best AP.
 
bool CanSetupMultiLink (OptMleConstRef &mle, OptRnrConstRef &rnr)
 Check whether 11be Multi-Link setup can be established with the current best AP.
 
void DoDispose () override
 Destructor implementation.
 
const WifiScanParamsGetScanParams () const
 
std::list< StaWifiMac::ApInfo::SetupLinksInfo > & GetSetupLinks (const StaWifiMac::ApInfo &apInfo)
 Get a reference to the list of the links to setup with the given AP.
 
const SortedListGetSortedList () const
 
bool MatchScanParams (const StaWifiMac::ApInfo &apInfo) const
 Check whether the given AP information match the current scanning parameters.
 
void ScanningTimeout ()
 Extract the best AP to associate with from the sorted list and return it, if any, to the STA wifi MAC along with the notification that scanning is completed.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
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.
 

Private Member Functions

void ChannelSwitchTimeout (uint8_t linkId)
 Take action upon the expiration of the timer set when requesting channel switch on the given link.
 
void DoStartScanning () override
 Start a scanning procedure.
 

Private Attributes

std::vector< ChannelSwitchInfom_channelSwitchInfo
 per-link channel switch info
 
Time m_channelSwitchTimeout
 maximum delay for channel switching
 
EventId m_probeRequestEvent
 probe request event
 
EventId m_waitBeaconEvent
 wait beacon event
 

Additional Inherited Members

- Protected Types inherited from ns3::WifiAssocManager
using OptMleConstRef = std::optional< std::reference_wrapper< const MultiLinkElement > >
 typedef for an optional const reference to a MultiLinkElement object
 
using OptRnrConstRef = std::optional< std::reference_wrapper< const ReducedNeighborReport > >
 typedef for an optional const reference to a ReducedNeighborReport object
 
using SortedList = std::set< StaWifiMac::ApInfo, ApInfoCompare >
 typedef for the sorted list of ApInfo objects
 
- Protected Attributes inherited from ns3::WifiAssocManager
std::set< uint8_t > m_allowedLinks
 "Only Beacon and Probe Response frames received on a link belonging to the this set are processed
 
Ptr< StaWifiMacm_mac
 pointer to the STA wifi MAC
 

Detailed Description

Default wifi Association Manager.

Introspection did not find any typical Config paths.


Attributes

  • ChannelSwitchTimeout: After requesting a channel switch on a link to setup that link, wait at most this amount of time. If a channel switch is not notified within this amount of time, we give up setting up that link.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +0ns:+9.22337e+18ns
    • Initial value: +5e+06ns
    • Flags: constructwriteread

Attributes defined in parent class ns3::WifiAssocManager

No TraceSources are defined for this type.
Size of this type is 400 bytes (on a 64-bit architecture).

Definition at line 35 of file wifi-default-assoc-manager.h.

Constructor & Destructor Documentation

◆ WifiDefaultAssocManager()

ns3::WifiDefaultAssocManager::WifiDefaultAssocManager ( )

Definition at line 56 of file wifi-default-assoc-manager.cc.

References NS_LOG_FUNCTION.

◆ ~WifiDefaultAssocManager()

ns3::WifiDefaultAssocManager::~WifiDefaultAssocManager ( )
override

Definition at line 61 of file wifi-default-assoc-manager.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CanBeInserted()

bool ns3::WifiDefaultAssocManager::CanBeInserted ( const StaWifiMac::ApInfo apInfo) const
overrideprotectedvirtual

Allow subclasses to choose whether the given ApInfo shall be considered and hence inserted in the sorted list of ApInfo objects.

Parameters
apInfothe apInfo object to insert
Returns
true if the apInfo object can be inserted, false otherwise

Implements ns3::WifiAssocManager.

Definition at line 294 of file wifi-default-assoc-manager.cc.

References ns3::EventId::IsRunning(), m_probeRequestEvent, and m_waitBeaconEvent.

+ Here is the call graph for this function:

◆ CanBeReturned()

bool ns3::WifiDefaultAssocManager::CanBeReturned ( const StaWifiMac::ApInfo apInfo) const
overrideprotectedvirtual

Allow subclasses to choose whether the given ApInfo shall be returned or discarded when the STA wifi MAC requests information on the best AP.

Parameters
apInfothe apInfo object to return
Returns
true if the apInfo object can be returned, false otherwise

Implements ns3::WifiAssocManager.

Definition at line 300 of file wifi-default-assoc-manager.cc.

◆ ChannelSwitchTimeout()

void ns3::WifiDefaultAssocManager::ChannelSwitchTimeout ( uint8_t  linkId)
private

Take action upon the expiration of the timer set when requesting channel switch on the given link.

Parameters
linkIdthe ID of the given link

Definition at line 271 of file wifi-default-assoc-manager.cc.

References ns3::WifiAssocManager::GetSetupLinks(), ns3::WifiAssocManager::GetSortedList(), m_channelSwitchInfo, NS_ASSERT, NS_LOG_FUNCTION, and ns3::WifiAssocManager::ScanningTimeout().

Referenced by EndScanning().

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

◆ Compare()

bool ns3::WifiDefaultAssocManager::Compare ( const StaWifiMac::ApInfo lhs,
const StaWifiMac::ApInfo rhs 
) const
overridevirtual

Compare two ApInfo objects for the purpose of keeping a sorted list of ApInfo objects.

Parameters
lhsleft hand side ApInfo object
rhsright hand side ApInfo object
Returns
true if the left hand side ApInfo object should be placed before the right hand side ApInfo object in the sorted list of ApInfo objects, false otherwise

Implements ns3::WifiAssocManager.

Definition at line 76 of file wifi-default-assoc-manager.cc.

References ns3::StaWifiMac::ApInfo::m_snr.

◆ DoDispose()

void ns3::WifiDefaultAssocManager::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::WifiAssocManager.

Definition at line 67 of file wifi-default-assoc-manager.cc.

References ns3::EventId::Cancel(), ns3::WifiAssocManager::DoDispose(), m_probeRequestEvent, m_waitBeaconEvent, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoStartScanning()

void ns3::WifiDefaultAssocManager::DoStartScanning ( )
overrideprivatevirtual

Start a scanning procedure.

This method needs to schedule a call to ScanningTimeout when the scanning procedure is completed.

Implements ns3::WifiAssocManager.

Definition at line 82 of file wifi-default-assoc-manager.cc.

References ns3::ACTIVE, ns3::EventId::Cancel(), EndScanning(), ns3::WifiMac::GetNLinks(), ns3::WifiAssocManager::GetScanParams(), ns3::WifiAssocManager::GetSortedList(), ns3::WifiAssocManager::m_mac, m_probeRequestEvent, m_waitBeaconEvent, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), and ns3::StaWifiMac::SendProbeRequest().

+ Here is the call graph for this function:

◆ EndScanning()

void ns3::WifiDefaultAssocManager::EndScanning ( )
protected

Perform operations to do at the end of a scanning procedure, such as identifying the links to setup in case of 11be MLD devices.

Definition at line 120 of file wifi-default-assoc-manager.cc.

References ns3::WifiAssocManager::CanSetupMultiLink(), ChannelSwitchTimeout(), ns3::WifiAssocManager::GetAllAffiliatedAps(), ns3::WifiMac::GetNLinks(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiAssocManager::GetSetupLinks(), ns3::WifiAssocManager::GetSortedList(), ns3::WifiMac::GetWifiPhy(), ns3::WifiPhy::HasFixedPhyBand(), m_channelSwitchInfo, m_channelSwitchTimeout, ns3::WifiAssocManager::m_mac, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiAssocManager::ScanningTimeout(), and ns3::Simulator::Schedule().

Referenced by DoStartScanning().

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

◆ GetTypeId()

TypeId ns3::WifiDefaultAssocManager::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 39 of file wifi-default-assoc-manager.cc.

References m_channelSwitchTimeout, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MilliSeconds(), ns3::Seconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ NotifyChannelSwitched()

void ns3::WifiDefaultAssocManager::NotifyChannelSwitched ( uint8_t  linkId)
overridevirtual

Notify that the given link has completed channel switching.

Parameters
linkIdthe ID of the given link

Implements ns3::WifiAssocManager.

Definition at line 252 of file wifi-default-assoc-manager.cc.

References m_channelSwitchInfo, NS_LOG_FUNCTION, and ns3::WifiAssocManager::ScanningTimeout().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_channelSwitchInfo

std::vector<ChannelSwitchInfo> ns3::WifiDefaultAssocManager::m_channelSwitchInfo
private

per-link channel switch info

Definition at line 83 of file wifi-default-assoc-manager.h.

Referenced by ChannelSwitchTimeout(), EndScanning(), and NotifyChannelSwitched().

◆ m_channelSwitchTimeout

Time ns3::WifiDefaultAssocManager::m_channelSwitchTimeout
private

maximum delay for channel switching

Definition at line 73 of file wifi-default-assoc-manager.h.

Referenced by EndScanning(), and GetTypeId().

◆ m_probeRequestEvent

EventId ns3::WifiDefaultAssocManager::m_probeRequestEvent
private

probe request event

Definition at line 72 of file wifi-default-assoc-manager.h.

Referenced by CanBeInserted(), DoDispose(), and DoStartScanning().

◆ m_waitBeaconEvent

EventId ns3::WifiDefaultAssocManager::m_waitBeaconEvent
private

wait beacon event

Definition at line 71 of file wifi-default-assoc-manager.h.

Referenced by CanBeInserted(), DoDispose(), and DoStartScanning().


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