The Wifi MAC high model for a non-AP STA in a BSS. More...
#include "sta-wifi-mac.h"
Classes | |
struct | ApInfo |
Struct to hold information regarding observed AP through active/passive scanning. More... | |
struct | EdcaParams |
EDCA Parameters. More... | |
struct | MuEdcaParams |
MU EDCA Parameters. More... | |
struct | StaLinkEntity |
Structure holding information specific to a single link. More... | |
Public Types | |
enum | MacState { ASSOCIATED , SCANNING , WAIT_ASSOC_RESP , UNASSOCIATED , REFUSED } |
The current MAC state of the STA. More... | |
using | MgtFrameType |
type of the management frames used to get info about APs | |
Public Types inherited from ns3::WifiMac | |
typedef Callback< void, Ptr< const Packet >, Mac48Address, Mac48Address > | ForwardUpCallback |
This type defines the callback of a higher layer that a WifiMac(-derived) object invokes to pass a packet up the stack. | |
using | OriginatorAgreementOptConstRef |
optional const reference to OriginatorBlockAckAgreement | |
using | RecipientAgreementOptConstRef |
optional const reference to RecipientBlockAckAgreement | |
Public Member Functions | |
StaWifiMac () | |
~StaWifiMac () override | |
int64_t | AssignStreams (int64_t stream) override |
Assign a fixed random variable stream number to the random variables used by this model. | |
void | BlockTxOnLink (uint8_t linkId, WifiQueueBlockedReason reason) |
Block transmissions on the given link for the given reason. | |
bool | CanForwardPacketsTo (Mac48Address to) const override |
Return true if packets can be forwarded to the given destination, false otherwise. | |
uint16_t | GetAssociationId () const |
Return the association ID. | |
Ptr< EmlsrManager > | GetEmlsrManager () const |
WifiPowerManagementMode | GetPmMode (uint8_t linkId) const |
std::set< uint8_t > | GetSetupLinkIds () const |
Get the IDs of the setup links (if any). | |
bool | IsAssociated () const |
Return whether we are associated with an AP. | |
bool | IsEmlsrLink (uint8_t linkId) const |
void | NotifyChannelSwitching (uint8_t linkId) override |
Notify that channel on the given link has been switched. | |
void | NotifyEmlsrModeChanged (const std::set< uint8_t > &linkIds) |
Notify the MAC that EMLSR mode has changed on the given set of links. | |
void | NotifySwitchingEmlsrLink (Ptr< WifiPhy > phy, uint8_t linkId, Time delay) |
Notify that the given PHY switched channel to operate on another EMLSR link. | |
void | ScanningTimeout (const std::optional< ApInfo > &bestAp) |
This method is called after wait beacon timeout or wait probe request timeout has occurred. | |
void | SendProbeRequest (uint8_t linkId) |
Enqueue a probe request packet for transmission on the given link. | |
void | SetAssocManager (Ptr< WifiAssocManager > assocManager) |
Set the Association Manager. | |
void | SetEmlsrManager (Ptr< EmlsrManager > emlsrManager) |
Set the EMLSR Manager. | |
void | SetPmModeAfterAssociation (uint8_t linkId) |
Set the Power Management mode of the setup links after association. | |
void | SetPowerSaveMode (const std::pair< bool, uint8_t > &enableLinkIdPair) |
Enable or disable Power Save mode on the given link. | |
void | SetWifiPhys (const std::vector< Ptr< WifiPhy > > &phys) override |
void | TxOk (Ptr< const WifiMpdu > mpdu) |
Notify that the MPDU we sent was successfully received by the receiver (i.e. | |
void | UnblockTxOnLink (std::set< uint8_t > linkIds, WifiQueueBlockedReason reason) |
Unblock transmissions on the given links for the given reason. | |
Public Member Functions inherited from ns3::WifiMac | |
WifiMac () | |
WifiMac (const WifiMac &)=delete | |
~WifiMac () override | |
void | BlockUnicastTxOnLinks (WifiQueueBlockedReason reason, const Mac48Address &address, const std::set< uint8_t > &linkIds) |
Block the transmission on the given links of all unicast frames addressed to the station with the given address for the given reason. | |
void | Enqueue (Ptr< Packet > packet, Mac48Address to) |
void | Enqueue (Ptr< Packet > packet, Mac48Address to, Mac48Address from) |
void | Enqueue (Ptr< Packet > packet, Mac48Address to, Mac48Address from, uint8_t tid) |
Mac48Address | GetAddress () const |
OriginatorAgreementOptConstRef | GetBaAgreementEstablishedAsOriginator (Mac48Address recipient, uint8_t tid) const |
RecipientAgreementOptConstRef | GetBaAgreementEstablishedAsRecipient (Mac48Address originator, uint8_t tid) const |
BlockAckReqType | GetBarTypeAsOriginator (const Mac48Address &recipient, uint8_t tid) const |
BlockAckReqType | GetBarTypeAsRecipient (Mac48Address originator, uint8_t tid) const |
BlockAckType | GetBaTypeAsOriginator (const Mac48Address &recipient, uint8_t tid) const |
BlockAckType | GetBaTypeAsRecipient (Mac48Address originator, uint8_t tid) const |
Mac48Address | GetBssid (uint8_t linkId) const |
Ptr< ChannelAccessManager > | GetChannelAccessManager (uint8_t linkId=SINGLE_LINK_OP_ID) const |
Get the Channel Access Manager associated with the given link. | |
Ptr< WifiNetDevice > | GetDevice () const |
Return the device this PHY is associated with. | |
bool | GetDsssSupported (uint8_t linkId) const |
Return whether the device supports DSSS on the given link. | |
EhtCapabilities | GetEhtCapabilities (uint8_t linkId) const |
Return the EHT capabilities of the device for the given link. | |
Ptr< EhtConfiguration > | GetEhtConfiguration () const |
bool | GetEhtSupported () const |
Return whether the device supports EHT. | |
bool | GetEhtSupported (const Mac48Address &address) const |
bool | GetErpSupported (uint8_t linkId) const |
Return whether the device supports ERP on the given link. | |
ExtendedCapabilities | GetExtendedCapabilities () const |
Return the extended capabilities of the device. | |
Ptr< FrameExchangeManager > | GetFrameExchangeManager (uint8_t linkId=SINGLE_LINK_OP_ID) const |
Get the Frame Exchange Manager associated with the given link. | |
He6GhzBandCapabilities | GetHe6GhzBandCapabilities (uint8_t linkId) const |
Return the HE 6GHz band capabilities of the device for the given 6 GHz link. | |
HeCapabilities | GetHeCapabilities (uint8_t linkId) const |
Return the HE capabilities of the device for the given link. | |
Ptr< HeConfiguration > | GetHeConfiguration () const |
bool | GetHeSupported () const |
Return whether the device supports HE. | |
bool | GetHeSupported (const Mac48Address &address) const |
HtCapabilities | GetHtCapabilities (uint8_t linkId) const |
Return the HT capabilities of the device for the given link. | |
Ptr< HtConfiguration > | GetHtConfiguration () const |
bool | GetHtSupported (const Mac48Address &address) const |
bool | GetHtSupported (uint8_t linkId) const |
Return whether the device supports HT on the given link. | |
std::optional< uint8_t > | GetLinkForPhy (Ptr< const WifiPhy > phy) const |
Get the ID of the link (if any) on which the given PHY is operating. | |
std::optional< uint8_t > | GetLinkForPhy (std::size_t phyId) const |
Get the ID of the link (if any) on which the given PHY is operating. | |
virtual std::optional< uint8_t > | GetLinkIdByAddress (const Mac48Address &address) const |
Get the ID of the link having the given MAC address, if any. | |
const std::set< uint8_t > & | GetLinkIds () const |
Mac48Address | GetLocalAddress (const Mac48Address &remoteAddr) const |
Get the local MAC address used to communicate with a remote STA. | |
Ptr< WifiMacQueueScheduler > | GetMacQueueScheduler () const |
Get the wifi MAC queue scheduler. | |
uint32_t | GetMaxAmpduSize (AcIndex ac) const |
Return the maximum A-MPDU size of the given Access Category. | |
uint16_t | GetMaxAmsduSize (AcIndex ac) const |
Return the maximum A-MSDU size of the given Access Category. | |
uint16_t | GetMaxBaBufferSize (std::optional< Mac48Address > address=std::nullopt) const |
Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device, if any, or by this device, otherwise, based on the supported standard. | |
std::optional< Mac48Address > | GetMldAddress (const Mac48Address &remoteAddr) const |
uint16_t | GetMpduBufferSize () const |
uint8_t | GetNLinks () const |
Get the number of links (can be greater than 1 for 11be devices only). | |
bool | GetQosSupported () const |
Return whether the device supports QoS. | |
Ptr< QosTxop > | GetQosTxop (AcIndex ac) const |
Accessor for a specified EDCA object. | |
Ptr< QosTxop > | GetQosTxop (uint8_t tid) const |
Accessor for a specified EDCA object. | |
Ssid | GetSsid () const |
std::optional< std::reference_wrapper< const WifiTidLinkMapping > > | GetTidToLinkMapping (Mac48Address mldAddr, WifiDirection dir) const |
Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction. | |
bool | GetTxBlockedOnLink (AcIndex ac, const WifiContainerQueueId &queueId, uint8_t linkId, WifiQueueBlockedReason reason=WifiQueueBlockedReason::REASONS_COUNT) const |
Check whether the transmission of the packets in the given container queue of the given Access Category are blocked on the given link for the given reason (if any). | |
Ptr< Txop > | GetTxop () const |
Accessor for the Txop object. | |
virtual Ptr< WifiMacQueue > | GetTxopQueue (AcIndex ac) const |
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer, otherwise. | |
TypeOfStation | GetTypeOfStation () const |
Return the type of station. | |
VhtCapabilities | GetVhtCapabilities (uint8_t linkId) const |
Return the VHT capabilities of the device for the given link. | |
Ptr< VhtConfiguration > | GetVhtConfiguration () const |
bool | GetVhtSupported (const Mac48Address &address) const |
bool | GetVhtSupported (uint8_t linkId) const |
Return whether the device supports VHT on the given link. | |
Ptr< WifiPhy > | GetWifiPhy (uint8_t linkId=SINGLE_LINK_OP_ID) const |
Ptr< WifiRemoteStationManager > | GetWifiRemoteStationManager (uint8_t linkId=0) const |
virtual bool | HasFramesToTransmit (uint8_t linkId) |
Check if the MAC has frames to transmit over the given link. | |
bool | Is6GhzBand (uint8_t linkId) const |
Indicate if a given link is on the 6 GHz band. | |
void | NotifyPromiscRx (Ptr< const Packet > packet) |
void | NotifyRx (Ptr< const Packet > packet) |
void | NotifyRxDrop (Ptr< const Packet > packet) |
void | NotifyTx (Ptr< const Packet > packet) |
void | NotifyTxDrop (Ptr< const Packet > packet) |
WifiMac & | operator= (const WifiMac &)=delete |
void | ResetWifiPhys () |
Remove currently attached WifiPhy objects from this MAC. | |
virtual void | SetAddress (Mac48Address address) |
void | SetBssid (Mac48Address bssid, uint8_t linkId) |
void | SetChannelAccessManagers (const std::vector< Ptr< ChannelAccessManager > > &caManagers) |
void | SetCtsToSelfSupported (bool enable) |
Enable or disable CTS-to-self feature. | |
void | SetDevice (const Ptr< WifiNetDevice > device) |
Sets the device this PHY is associated with. | |
void | SetForwardUpCallback (ForwardUpCallback upCallback) |
void | SetFrameExchangeManagers (const std::vector< Ptr< FrameExchangeManager > > &feManagers) |
void | SetLinkDownCallback (Callback< void > linkDown) |
virtual void | SetLinkUpCallback (Callback< void > linkUp) |
virtual void | SetMacQueueScheduler (Ptr< WifiMacQueueScheduler > scheduler) |
Set the wifi MAC queue scheduler. | |
void | SetMpduBufferSize (uint16_t size) |
void | SetPromisc () |
Sets the interface in promiscuous mode. | |
void | SetSsid (Ssid ssid) |
void | SetTypeOfStation (TypeOfStation type) |
This method is invoked by a subclass to specify what type of station it is implementing. | |
void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager) |
void | SetWifiRemoteStationManagers (const std::vector< Ptr< WifiRemoteStationManager > > &stationManagers) |
virtual bool | SupportsSendFrom () const |
bool | TidMappedOnLink (Mac48Address mldAddr, WifiDirection dir, uint8_t tid, uint8_t linkId) const |
Check whether the given TID is mapped on the given link in the given direction for the given MLD. | |
void | UnblockUnicastTxOnLinks (WifiQueueBlockedReason reason, const Mac48Address &address, const std::set< uint8_t > &linkIds) |
Unblock the transmission on the given links of all unicast frames addressed to the station with the given address for the given reason. | |
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< Object > | GetObject () 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< Object > | GetObject (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. | |
SimpleRefCount & | operator= (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::WifiMac | |
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 | |
StaLinkEntity & | GetLink (uint8_t linkId) const |
Get a reference to the link associated with the given ID. | |
StaLinkEntity & | GetStaLink (const std::unique_ptr< WifiMac::LinkEntity > &link) const |
Cast the given LinkEntity object to StaLinkEntity. | |
Protected Member Functions inherited from ns3::WifiMac | |
void | ApplyTidLinkMapping (const Mac48Address &mldAddr, WifiDirection dir) |
Apply the TID-to-Link Mapping negotiated with the given MLD for the given direction by properly configuring the queue scheduler. | |
virtual void | ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax) |
virtual void | DeaggregateAmsduAndForward (Ptr< const WifiMpdu > mpdu) |
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack. | |
void | DoDispose () override |
Destructor implementation. | |
void | DoInitialize () override |
Initialize() implementation. | |
void | ForwardUp (Ptr< const Packet > packet, Mac48Address from, Mac48Address to) |
Forward the packet up to the device. | |
Ptr< QosTxop > | GetBEQueue () const |
Accessor for the AC_BE channel access function. | |
Ptr< QosTxop > | GetBKQueue () const |
Accessor for the AC_BK channel access function. | |
LinkEntity & | GetLink (uint8_t linkId) const |
Get a reference to the link associated with the given ID. | |
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & | GetLinks () const |
bool | GetShortSlotTimeSupported () const |
Ptr< QosTxop > | GetVIQueue () const |
Accessor for the AC_VI channel access function. | |
Ptr< QosTxop > | GetVOQueue () const |
Accessor for the AC_VO channel access function. | |
void | NotifyConstructionCompleted () override |
Notifier called once the ObjectBase is fully constructed. | |
void | SetShortSlotTimeSupported (bool enable) |
Enable or disable short slot time feature. | |
void | SwapLinks (std::map< uint8_t, uint8_t > links) |
Swap the links based on the information included in the given map. | |
void | UpdateTidToLinkMapping (const Mac48Address &mldAddr, WifiDirection dir, const WifiTidLinkMapping &mapping) |
Update the TID-to-Link Mappings for the given MLD in the given direction based on the given negotiated mappings. | |
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. | |
Private Types | |
using | LinkSetupCallback = void (*)(uint8_t , Mac48Address ) |
TracedCallback signature for link setup completed/canceled events. | |
Private Member Functions | |
void | AssocRequestTimeout () |
This method is called after the association timeout occurred. | |
bool | CheckSupportedRates (std::variant< MgtBeaconHeader, MgtProbeResponseHeader > frame, uint8_t linkId) |
Determine whether the supported rates indicated in a given Beacon frame or Probe Response frame fit with the configured membership selector. | |
std::unique_ptr< LinkEntity > | CreateLinkEntity () const override |
Create a LinkEntity object. | |
void | Disassociated () |
Set the state to unassociated and try to associate again. | |
void | DoCompleteConfig () override |
Allow subclasses to complete the configuration of the MAC layer components. | |
void | DoDispose () override |
Destructor implementation. | |
Mac48Address | DoGetLocalAddress (const Mac48Address &remoteAddr) const override |
This method is called if this device is an MLD to determine the MAC address of the affiliated STA used to communicate with the single link device having the given MAC address. | |
void | DoInitialize () override |
Initialize() implementation. | |
void | Enqueue (Ptr< WifiMpdu > mpdu, Mac48Address to, Mac48Address from) override |
bool | GetActiveProbing () const |
Return whether active probing is enabled. | |
std::variant< MgtAssocRequestHeader, MgtReassocRequestHeader > | GetAssociationRequest (bool isReassoc, uint8_t linkId) const |
Get the (Re)Association Request frame to send on a given link. | |
CapabilityInformation | GetCapabilities (uint8_t linkId) const |
Return the Capability information for the given link. | |
WifiScanParams::Channel | GetCurrentChannel (uint8_t linkId) const |
Get the current primary20 channel used on the given link as a (channel number, PHY band) pair. | |
MultiLinkElement | GetMultiLinkElement (bool isReassoc, uint8_t linkId) const |
Return the Multi-Link Element to include in the management frames transmitted on the given link. | |
AllSupportedRates | GetSupportedRates (uint8_t linkId) const |
Return an instance of SupportedRates that contains all rates that we support including HT rates. | |
std::vector< TidToLinkMapping > | GetTidToLinkMappingElements (WifiTidToLinkMappingNegSupport apNegSupport) |
bool | IsWaitAssocResp () const |
Return whether we are waiting for an association response from an AP. | |
void | MissedBeacons () |
This method is called after we have not received a beacon from the AP on any link. | |
void | NotifyDropPacketToEnqueue (Ptr< Packet > packet, Mac48Address to) override |
Allow subclasses to take actions when a packet to enqueue has been dropped. | |
void | PhyCapabilitiesChanged () |
Indicate that PHY capabilities have changed. | |
void | Receive (Ptr< const WifiMpdu > mpdu, uint8_t linkId) override |
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has been received on the given link. | |
void | ReceiveAssocResp (Ptr< const WifiMpdu > mpdu, uint8_t linkId) |
Process the (Re)Association Response frame received on the given link. | |
void | ReceiveBeacon (Ptr< const WifiMpdu > mpdu, uint8_t linkId) |
Process the Beacon frame received on the given link. | |
void | ReceiveProbeResp (Ptr< const WifiMpdu > mpdu, uint8_t linkId) |
Process the Probe Response frame received on the given link. | |
void | RestartBeaconWatchdog (Time delay) |
Restarts the beacon timer. | |
void | SendAssociationRequest (bool isReassoc) |
Forward an association or reassociation request packet to the DCF. | |
void | SetActiveProbing (bool enable) |
Enable or disable active probing. | |
void | SetEdcaParameters (const EdcaParams ¶ms, uint8_t linkId) |
Set the EDCA parameters for the given link. | |
void | SetMuEdcaParameters (const MuEdcaParams ¶ms, uint8_t linkId) |
Set the MU EDCA parameters for the given link. | |
void | SetState (MacState value) |
Set the current MAC state. | |
void | StartScanning () |
Start the scanning process which trigger active or passive scanning based on the active probing flag. | |
void | TryToEnsureAssociated () |
Try to ensure that we are associated with an AP by taking an appropriate action depending on the current association status. | |
void | UpdateApInfo (const MgtFrameType &frame, const Mac48Address &apAddr, const Mac48Address &bssid, uint8_t linkId) |
Update associated AP's information from the given management frame (Beacon, Probe Response or Association Response). | |
Private Attributes | |
bool | m_activeProbing |
active probing | |
uint16_t | m_aid |
Association AID. | |
TracedCallback< Mac48Address > | m_assocLogger |
association logger | |
Ptr< WifiAssocManager > | m_assocManager |
Association Manager. | |
EventId | m_assocRequestEvent |
association request event | |
Time | m_assocRequestTimeout |
association request timeout | |
TracedCallback< Time > | m_beaconArrival |
beacon arrival logger | |
TracedCallback< ApInfo > | m_beaconInfo |
beacon info logger | |
EventId | m_beaconWatchdog |
beacon watchdog | |
Time | m_beaconWatchdogEnd {0} |
beacon watchdog end | |
TracedCallback< Mac48Address > | m_deAssocLogger |
disassociation logger | |
WifiTidLinkMapping | m_dlTidLinkMappingInAssocReq |
store the DL TID-to-Link Mapping included in the Association Request frame | |
std::map< uint8_t, EventId > | m_emlsrLinkSwitch |
maps PHY ID to the event scheduled to switch the corresponding PHY to a new EMLSR link | |
Ptr< EmlsrManager > | m_emlsrManager |
EMLSR Manager. | |
uint32_t | m_maxMissedBeacons |
maximum missed beacons | |
Time | m_pmModeSwitchTimeout |
PM mode switch timeout. | |
Ptr< RandomVariableStream > | m_probeDelay |
RandomVariable used to randomize the time of the first Probe Response on each channel. | |
Time | m_probeRequestTimeout |
probe request timeout | |
TracedCallback< uint8_t, Mac48Address > | m_setupCanceled |
link setup canceled logger | |
TracedCallback< uint8_t, Mac48Address > | m_setupCompleted |
link setup completed logger | |
MacState | m_state |
MAC state. | |
WifiTidLinkMapping | m_ulTidLinkMappingInAssocReq |
store the UL TID-to-Link Mapping included in the Association Request frame | |
Time | m_waitBeaconTimeout |
wait beacon timeout | |
Friends | |
class | ::AmpduAggregationTest |
Allow test cases to access private members. | |
class | ::MultiLinkOperationsTestBase |
Allow test cases to access private members. | |
Additional Inherited Members | |
Protected Attributes inherited from ns3::WifiMac | |
Callback< void > | m_linkDown |
Callback when a link is down. | |
Callback< void > | m_linkUp |
Callback when a link is up. | |
Ptr< MacRxMiddle > | m_rxMiddle |
RX middle (defragmentation etc.) | |
Ptr< WifiMacQueueScheduler > | m_scheduler |
wifi MAC queue scheduler | |
Ptr< MacTxMiddle > | m_txMiddle |
TX middle (aggregation etc.) | |
Ptr< Txop > | m_txop |
TXOP used for transmission of frames to non-QoS peers. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
The Wifi MAC high model for a non-AP STA in a BSS.
The state machine is as follows:
┌───────────┐ ┌────────────────┐ ┌─────────────┐ │ Start │ ┌─────┤ Associated ◄───────────────────┐ ┌──► Refused │ └─┬─────────┘ │ └────────────────┘ │ │ └─────────────┘ │ │ │ │ │ │ ┌─────────────────────────────────────┐ │ │ │ │ │ │ │ │ │ ┌─────────────▼─▼──┐ ┌──────────────┐ ┌───┴──▼────┴───────────────────┐ └──► Unassociated ├───────► Scanning ├───────► Wait Association Response │ └──────────────────┘ └──────┬──▲────┘ └───────────────┬──▲────────────┘ │ │ │ │ │ │ │ │ └──┘ └──┘
Notes:
Definition at line 132 of file sta-wifi-mac.h.
|
private |
TracedCallback signature for link setup completed/canceled events.
Definition at line 619 of file sta-wifi-mac.h.
type of the management frames used to get info about APs
Definition at line 141 of file sta-wifi-mac.h.
The current MAC state of the STA.
Enumerator | |
---|---|
ASSOCIATED | |
SCANNING | |
WAIT_ASSOC_RESP | |
UNASSOCIATED | |
REFUSED |
Definition at line 353 of file sta-wifi-mac.h.
ns3::StaWifiMac::StaWifiMac | ( | ) |
Definition at line 144 of file sta-wifi-mac.cc.
References NS_LOG_FUNCTION, ns3::WifiMac::SetTypeOfStation(), and ns3::STA.
|
override |
Definition at line 201 of file sta-wifi-mac.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
stream | first stream index to use |
Reimplemented from ns3::WifiMac.
Definition at line 236 of file sta-wifi-mac.cc.
References ns3::WifiMac::AssignStreams(), m_probeDelay, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
This method is called after the association timeout occurred.
We switch the state to WAIT_ASSOC_RESP and re-send an association request.
Definition at line 845 of file sta-wifi-mac.cc.
References NS_LOG_FUNCTION, SendAssociationRequest(), SetState(), and WAIT_ASSOC_RESP.
Referenced by SendAssociationRequest().
void ns3::StaWifiMac::BlockTxOnLink | ( | uint8_t | linkId, |
WifiQueueBlockedReason | reason ) |
Block transmissions on the given link for the given reason.
linkId | the ID of the given link |
reason | the reason for blocking transmissions on the given link |
Definition at line 1009 of file sta-wifi-mac.cc.
References ns3::WifiMac::BlockUnicastTxOnLinks(), ns3::Mac48Address::GetBroadcast(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetMacQueueScheduler(), ns3::WifiMac::GetWifiRemoteStationManager(), NS_LOG_FUNCTION, ns3::WIFI_MGT_QUEUE, and ns3::wifiAcList.
|
overridevirtual |
Return true if packets can be forwarded to the given destination, false otherwise.
to | the address to which the packet should be sent |
Implements ns3::WifiMac.
Definition at line 971 of file sta-wifi-mac.cc.
References IsAssociated().
|
private |
Determine whether the supported rates indicated in a given Beacon frame or Probe Response frame fit with the configured membership selector.
frame | the given Beacon or Probe Response frame |
linkId | ID of the link the mgt frame was received over |
Definition at line 1532 of file sta-wifi-mac.cc.
References ns3::WifiPhy::GetBssMembershipSelectorList(), ns3::WifiMac::GetWifiPhy(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ReceiveBeacon(), and ReceiveProbeResp().
|
overrideprivatevirtual |
Create a LinkEntity object.
Reimplemented from ns3::WifiMac.
Definition at line 218 of file sta-wifi-mac.cc.
|
private |
Set the state to unassociated and try to associate again.
Definition at line 885 of file sta-wifi-mac.cc.
References ns3::StaWifiMac::StaLinkEntity::bssid, ns3::EventId::Cancel(), ns3::WifiMac::GetLinks(), GetStaLink(), ns3::WifiMac::GetWifiRemoteStationManager(), m_aid, m_assocRequestEvent, m_deAssocLogger, NS_LOG_DEBUG, NS_LOG_FUNCTION, SetState(), TryToEnsureAssociated(), and UNASSOCIATED.
Referenced by MissedBeacons(), and NotifyChannelSwitching().
|
overrideprivatevirtual |
Allow subclasses to complete the configuration of the MAC layer components.
Implements ns3::WifiMac.
Definition at line 207 of file sta-wifi-mac.cc.
References NS_LOG_FUNCTION.
|
overrideprivatevirtual |
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::Object.
Definition at line 180 of file sta-wifi-mac.cc.
References ns3::WifiMac::DoDispose(), m_assocManager, m_emlsrLinkSwitch, m_emlsrManager, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
This method is called if this device is an MLD to determine the MAC address of the affiliated STA used to communicate with the single link device having the given MAC address.
This method is overridden because its implementation depends on the type of station.
remoteAddr | the MAC address of the remote single link device |
Reimplemented from ns3::WifiMac.
Definition at line 955 of file sta-wifi-mac.cc.
References ns3::StaWifiMac::StaLinkEntity::bssid, ns3::WifiMac::GetAddress(), ns3::WifiMac::GetLinks(), and GetStaLink().
|
overrideprivatevirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 157 of file sta-wifi-mac.cc.
References ns3::WifiMac::DoInitialize(), ns3::WifiMac::GetLinkForPhy(), m_assocManager, m_emlsrManager, ns3::MakeCallback(), NS_ABORT_IF, NS_ASSERT, NS_LOG_FUNCTION, StartScanning(), ns3::ObjectBase::TraceConnectWithoutContext(), and TxOk().
|
overrideprivatevirtual |
mpdu | the MPDU to send. |
to | the address to which the packet should be sent. |
from | the address from which the packet should be sent. |
Subclasses need to implement this method to finalize the MAC header of the MPDU (MAC addresses and ToDS/FromDS flags) and enqueue the MPDU in a TX queue.
Implements ns3::WifiMac.
Definition at line 984 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetAddress(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetQosTxop(), GetSetupLinkIds(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetWifiRemoteStationManager(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::StaticCast().
|
private |
Return whether active probing is enabled.
Definition at line 287 of file sta-wifi-mac.cc.
References m_activeProbing.
Referenced by GetTypeId().
uint16_t ns3::StaWifiMac::GetAssociationId | ( | ) | const |
Return the association ID.
Definition at line 268 of file sta-wifi-mac.cc.
References IsAssociated(), m_aid, and NS_ASSERT_MSG.
|
private |
Get the (Re)Association Request frame to send on a given link.
The returned frame never includes a Multi-Link Element.
isReassoc | whether a Reassociation Request has to be returned |
linkId | the ID of the given link |
Definition at line 409 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetBssid(), GetCapabilities(), ns3::WifiMac::GetEhtCapabilities(), ns3::WifiMac::GetEhtSupported(), ns3::WifiMac::GetExtendedCapabilities(), ns3::WifiMac::GetHe6GhzBandCapabilities(), ns3::WifiMac::GetHeCapabilities(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetHtCapabilities(), ns3::WifiMac::GetHtSupported(), ns3::WifiMac::GetSsid(), GetSupportedRates(), ns3::WifiMac::GetVhtCapabilities(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::Is6GhzBand(), NS_LOG_FUNCTION, and ns3::MgtReassocRequestHeader::SetCurrentApAddress().
Referenced by GetMultiLinkElement(), and SendAssociationRequest().
|
private |
Return the Capability information for the given link.
linkId | the ID of the given link |
Definition at line 1921 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetErpSupported(), ns3::WifiMac::GetShortSlotTimeSupported(), ns3::WifiMac::GetWifiPhy(), ns3::CapabilityInformation::SetShortPreamble(), and ns3::CapabilityInformation::SetShortSlotTime().
Referenced by GetAssociationRequest().
|
private |
Get the current primary20 channel used on the given link as a (channel number, PHY band) pair.
linkId | the ID of the given link |
Definition at line 305 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetWifiPhy().
Referenced by ReceiveBeacon().
Ptr< EmlsrManager > ns3::StaWifiMac::GetEmlsrManager | ( | ) | const |
|
protected |
Get a reference to the link associated with the given ID.
linkId | the given link ID |
Definition at line 224 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetLink().
Referenced by GetPmMode(), IsEmlsrLink(), NotifySwitchingEmlsrLink(), ReceiveAssocResp(), ReceiveBeacon(), ScanningTimeout(), SendAssociationRequest(), SetPmModeAfterAssociation(), SetPowerSaveMode(), and TxOk().
|
private |
Return the Multi-Link Element to include in the management frames transmitted on the given link.
isReassoc | whether the Multi-Link Element is included in a Reassociation Request |
linkId | the ID of the given link |
Definition at line 462 of file sta-wifi-mac.cc.
References ns3::MultiLinkElement::AddPerStaProfileSubelement(), ns3::MultiLinkElement::BASIC_VARIANT, ns3::EnumValue< T >::Get(), ns3::TimeValue::Get(), ns3::WifiMac::GetAddress(), GetAssociationRequest(), ns3::MultiLinkElement::GetCommonInfoBasic(), ns3::WifiMac::GetEhtConfiguration(), ns3::WifiMac::GetLinks(), ns3::WifiMac::GetNLinks(), ns3::MultiLinkElement::GetNPerStaProfileSubelements(), ns3::MultiLinkElement::GetPerStaProfile(), GetStaLink(), m_emlsrManager, ns3::CommonInfoBasicMle::m_mldCapabilities, NS_ASSERT, NS_LOG_FUNCTION, ns3::MultiLinkElement::SetEmlsrPaddingDelay(), ns3::MultiLinkElement::SetEmlsrSupported(), ns3::MultiLinkElement::SetEmlsrTransitionDelay(), ns3::MultiLinkElement::PerStaProfileSubelement::SetLinkId(), and ns3::MultiLinkElement::SetMldMacAddress().
Referenced by SendAssociationRequest().
WifiPowerManagementMode ns3::StaWifiMac::GetPmMode | ( | uint8_t | linkId | ) | const |
linkId | the ID of the given link |
Definition at line 1857 of file sta-wifi-mac.cc.
References GetLink(), and ns3::StaWifiMac::StaLinkEntity::pmMode.
std::set< uint8_t > ns3::StaWifiMac::GetSetupLinkIds | ( | ) | const |
Get the IDs of the setup links (if any).
Definition at line 936 of file sta-wifi-mac.cc.
References ns3::StaWifiMac::StaLinkEntity::bssid, ns3::WifiMac::GetLinks(), GetStaLink(), and IsAssociated().
Referenced by Enqueue(), and Receive().
|
protected |
Cast the given LinkEntity object to StaLinkEntity.
link | the given LinkEntity object |
Definition at line 230 of file sta-wifi-mac.cc.
Referenced by Disassociated(), DoGetLocalAddress(), GetMultiLinkElement(), GetSetupLinkIds(), NotifyEmlsrModeChanged(), ReceiveAssocResp(), ScanningTimeout(), SendAssociationRequest(), and SetPmModeAfterAssociation().
|
private |
Return an instance of SupportedRates that contains all rates that we support including HT rates.
linkId | the ID of the link for which the request is made |
Definition at line 1901 of file sta-wifi-mac.cc.
References ns3::AllSupportedRates::AddBssMembershipSelectorRate(), ns3::AllSupportedRates::AddSupportedRate(), ns3::WifiPhy::GetBssMembershipSelectorList(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiMac::GetHtSupported(), ns3::WifiPhy::GetModeList(), ns3::WifiMac::GetWifiPhy(), and NS_LOG_DEBUG.
Referenced by GetAssociationRequest(), and SendProbeRequest().
|
private |
apNegSupport | the negotiation type supported by the AP MLD |
Definition at line 542 of file sta-wifi-mac.cc.
References ns3::BOTH_DIRECTIONS, ns3::DOWNLINK, ns3::EnumValue< T >::Get(), ns3::WifiMac::GetEhtConfiguration(), m_dlTidLinkMappingInAssocReq, m_ulTidLinkMappingInAssocReq, ns3::NOT_SUPPORTED, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::SAME_LINK_SET, ns3::TidToLinkMappingValidForNegType1(), and ns3::UPLINK.
Referenced by SendAssociationRequest().
|
static |
Get the type ID.
Definition at line 49 of file sta-wifi-mac.cc.
References ns3::TypeId::ATTR_GET, ns3::TypeId::ATTR_SET, GetActiveProbing(), m_assocLogger, m_assocRequestTimeout, m_beaconArrival, m_beaconInfo, m_deAssocLogger, m_maxMissedBeacons, m_pmModeSwitchTimeout, m_probeDelay, m_probeRequestTimeout, m_setupCanceled, m_setupCompleted, m_waitBeaconTimeout, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakePairAccessor(), ns3::MakePairChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MilliSeconds(), ns3::TypeId::OBSOLETE, ns3::Seconds(), SetActiveProbing(), ns3::TypeId::SetParent(), and SetPowerSaveMode().
bool ns3::StaWifiMac::IsAssociated | ( | ) | const |
Return whether we are associated with an AP.
Definition at line 924 of file sta-wifi-mac.cc.
References ASSOCIATED, and m_state.
Referenced by CanForwardPacketsTo(), GetAssociationId(), GetSetupLinkIds(), NotifyChannelSwitching(), PhyCapabilitiesChanged(), Receive(), ReceiveBeacon(), and SetPowerSaveMode().
bool ns3::StaWifiMac::IsEmlsrLink | ( | uint8_t | linkId | ) | const |
linkId | the ID of the given link |
Definition at line 346 of file sta-wifi-mac.cc.
References ns3::StaWifiMac::StaLinkEntity::emlsrEnabled, and GetLink().
|
private |
Return whether we are waiting for an association response from an AP.
Definition at line 930 of file sta-wifi-mac.cc.
References m_state, and WAIT_ASSOC_RESP.
Referenced by ReceiveBeacon().
|
private |
This method is called after we have not received a beacon from the AP on any link.
Definition at line 853 of file sta-wifi-mac.cc.
References ns3::EventId::Cancel(), Disassociated(), ns3::WifiMac::GetLinks(), ns3::EventId::IsPending(), m_beaconWatchdog, m_beaconWatchdogEnd, MissedBeacons(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by MissedBeacons(), and RestartBeaconWatchdog().
|
overridevirtual |
Notify that channel on the given link has been switched.
linkId | the ID of the given link |
Reimplemented from ns3::WifiMac.
Definition at line 2071 of file sta-wifi-mac.cc.
References Disassociated(), IsAssociated(), ns3::Object::IsInitialized(), m_assocManager, ns3::WifiMac::NotifyChannelSwitching(), and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Allow subclasses to take actions when a packet to enqueue has been dropped.
packet | the dropped packet |
to | the address to which the packet should have been sent |
Reimplemented from ns3::WifiMac.
Definition at line 977 of file sta-wifi-mac.cc.
References NS_LOG_FUNCTION, and TryToEnsureAssociated().
void ns3::StaWifiMac::NotifyEmlsrModeChanged | ( | const std::set< uint8_t > & | linkIds | ) |
Notify the MAC that EMLSR mode has changed on the given set of links.
linkIds | the IDs of the links that are now EMLSR links (EMLSR mode is disabled on other links) |
Definition at line 314 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetLinks(), GetStaLink(), ns3::LOG_FUNCTION, NS_LOG_FUNCTION, ns3::WIFI_PM_ACTIVE, and ns3::WIFI_PM_POWERSAVE.
Notify that the given PHY switched channel to operate on another EMLSR link.
Initial configuration:
phy | the given PHY |
linkId | the ID of the EMLSR link on which the given PHY is operating |
delay | the delay after which the channel switch will be completed |
┌───┬───┬───┐ ┌────┐ ┌───────┐
Link A │FEM│RSM│CAM│◄──────►│Main├──────►│Channel│ │ │ │ │ │PHY │ │ A │ └───┴───┴───┘ └────┘ └───────┘
┌───┬───┬───┐ ┌────┐ ┌───────┐ Link B │FEM│RSM│CAM│ │Aux │ │Channel│ │ │ │ │◄──────►│PHY ├──────►│ B │ └───┴───┴───┘ └────┘ └───────┘
A link switching/swapping is notified by the EMLSR Manager and the Channel Access Manager (CAM) notifies us that a first PHY (i.e., the Main PHY) switches to Channel B. We connect the Main PHY to the MAC stack B:
┌───┬───┬───┐ ┌────┐ ┌───────┐
Link A │FEM│RSM│CAM│ ┌───►│Main├───┐ │Channel│ │ │ │ │ │ │PHY │ │ │ A │ └───┴───┴───┘ │ └────┘ │ └───────┘ │ │ ┌───┬───┬───┐ │ ┌────┐ │ ┌───────┐ Link B │FEM│RSM│CAM│◄──┘ │Aux │ └──►│Channel│ │ │ │ │◄─ ─ ─ ─│PHY ├──────►│ B │ └───┴───┴───┘INACTIVE└────┘ └───────┘
MAC stack B keeps a PHY listener associated with the Aux PHY, even though it is inactive, meaning that the PHY listener will only notify channel switches (no CCA, no RX). If the EMLSR Manager requested a link switching, this configuration will be kept until further requests. If the EMLSR Manager requested a link swapping, link B's CAM will be notified by its (inactive) PHY listener upon the channel switch performed by the Aux PHY. In this case, we remove the inactive PHY listener and connect the Aux PHY to MAC stack A:
┌───┬───┬───┐ ┌────┐ ┌───────┐
Link A │FEM│RSM│CAM│◄─┐ ┌──►│Main├───┐ │Channel│ │ │ │ │ │ │ │PHY │ ┌─┼──►│ A │ └───┴───┴───┘ │ │ └────┘ │ │ └───────┘ │ │ │ │ ┌───┬───┬───┐ │ │ ┌────┐ │ │ ┌───────┐ Link B │FEM│RSM│CAM│◄─┼─┘ │Aux │ │ └──►│Channel│ │ │ │ │ └────►│PHY ├─┘ │ B │ └───┴───┴───┘ └────┘ └───────┘
Definition at line 2015 of file sta-wifi-mac.cc.
References ns3::Time::As(), GetLink(), ns3::WifiMac::GetLinks(), m_emlsrLinkSwitch, m_emlsrManager, NS_ASSERT, NS_LOG_FUNCTION, ns3::WifiMac::LinkEntity::phy, ns3::Simulator::Schedule(), and ns3::Time::US.
|
private |
Indicate that PHY capabilities have changed.
Definition at line 1957 of file sta-wifi-mac.cc.
References IsAssociated(), NS_LOG_DEBUG, NS_LOG_FUNCTION, SendAssociationRequest(), SetState(), and WAIT_ASSOC_RESP.
Referenced by SetWifiPhys().
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has been received on the given link.
The implementation is intended to capture logic that is going to be common to all (or most) derived classes. Specifically, handling of Block Ack management frames is dealt with here.
This method will need, however, to be overridden by derived classes so that they can perform their data handling before invoking the base version.
The given link may be undefined in some cases (e.g., in case of QoS Data frames received in the context of a Block Ack agreement – because the BlockAckManager does not have to record the link each buffered MPDU has been received on); in such a cases, the value of linkId should be WIFI_LINKID_UNDEFINED.
mpdu | the MPDU that has been received. |
linkId | the ID of the given link |
Reimplemented from ns3::WifiMac.
Definition at line 1057 of file sta-wifi-mac.cc.
References ns3::Mac48Address::ConvertFrom(), ns3::WifiMac::DeaggregateAmsduAndForward(), ns3::WifiMac::ForwardUp(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr3(), ns3::WifiMac::GetAddress(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetDevice(), ns3::WifiMac::GetFrameExchangeManager(), GetSetupLinkIds(), ns3::WifiMacHeader::GetType(), ns3::WifiMacHeader::HasData(), IsAssociated(), ns3::WifiMacHeader::IsCtl(), ns3::WifiMacHeader::IsData(), ns3::WifiMacHeader::IsFromDs(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsToDs(), m_emlsrManager, ns3::WifiMac::NotifyRxDrop(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::WifiActionHeader::Peek(), ns3::WifiActionHeader::PROTECTED_EHT, ns3::WifiActionHeader::PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION, ns3::WifiMac::Receive(), ReceiveAssocResp(), ReceiveBeacon(), ReceiveProbeResp(), ns3::WIFI_MAC_MGT_ACTION, ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE, ns3::WIFI_MAC_MGT_BEACON, ns3::WIFI_MAC_MGT_PROBE_REQUEST, ns3::WIFI_MAC_MGT_PROBE_RESPONSE, ns3::WIFI_MAC_MGT_REASSOCIATION_REQUEST, and ns3::WIFI_MAC_MGT_REASSOCIATION_RESPONSE.
Process the (Re)Association Response frame received on the given link.
mpdu | the MPDU containing the (Re)Association Response frame |
linkId | the ID of the given link |
Definition at line 1259 of file sta-wifi-mac.cc.
References ns3::WifiMac::ApplyTidLinkMapping(), ASSOCIATED, ns3::StaWifiMac::StaLinkEntity::bssid, ns3::EventId::Cancel(), ns3::Txop::CHECK_MEDIUM_BUSY, ns3::Txop::DIDNT_HAVE_FRAMES_TO_TRANSMIT, ns3::DOWNLINK, ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), ns3::MgtAssocResponseHeader::GetAssociationId(), GetLink(), ns3::WifiMac::GetLinks(), ns3::WifiMac::GetMldAddress(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetQosTxop(), GetStaLink(), ns3::MgtAssocResponseHeader::GetStatusCode(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::WifiMacHeader::IsAssocResp(), ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsPending(), ns3::WifiMacHeader::IsReassocResp(), ns3::StatusCode::IsSuccess(), m_aid, m_assocLogger, m_assocRequestEvent, m_dlTidLinkMappingInAssocReq, ns3::WifiMac::m_linkUp, m_setupCompleted, m_state, m_ulTidLinkMappingInAssocReq, ns3::NOT_SUPPORTED, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiMac::LinkEntity::phy, REFUSED, ns3::WifiMac::SetBssid(), ns3::WifiPhy::SetOffMode(), SetPmModeAfterAssociation(), SetState(), StartScanning(), UpdateApInfo(), ns3::WifiMac::UpdateTidToLinkMapping(), ns3::UPLINK, WAIT_ASSOC_RESP, and ns3::wifiAcList.
Referenced by Receive().
Process the Beacon frame received on the given link.
mpdu | the MPDU containing the Beacon frame |
linkId | the ID of the given link |
Definition at line 1172 of file sta-wifi-mac.cc.
References ASSOCIATED, ns3::StaWifiMac::StaLinkEntity::bssid, ns3::MgtProbeResponseHeader::Capabilities(), CheckSupportedRates(), ns3::SnrTag::Get(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), GetCurrentChannel(), GetLink(), IsAssociated(), ns3::WifiMacHeader::IsBeacon(), IsWaitAssocResp(), m_assocManager, m_beaconArrival, m_beaconInfo, ns3::StaWifiMac::ApInfo::m_bssid, ns3::StaWifiMac::ApInfo::m_frame, m_maxMissedBeacons, m_state, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, RestartBeaconWatchdog(), and UpdateApInfo().
Referenced by Receive().
Process the Probe Response frame received on the given link.
mpdu | the MPDU containing the Probe Response frame |
linkId | the ID of the given link |
Definition at line 1234 of file sta-wifi-mac.cc.
References CheckSupportedRates(), ns3::SnrTag::Get(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), ns3::WifiMacHeader::IsProbeResp(), m_assocManager, ns3::StaWifiMac::ApInfo::m_bssid, NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by Receive().
|
private |
Restarts the beacon timer.
delay | the delay before the watchdog fires |
Definition at line 911 of file sta-wifi-mac.cc.
References ns3::Simulator::GetDelayLeft(), ns3::EventId::IsExpired(), m_beaconWatchdog, m_beaconWatchdogEnd, MissedBeacons(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by ReceiveBeacon(), and ScanningTimeout().
void ns3::StaWifiMac::ScanningTimeout | ( | const std::optional< ApInfo > & | bestAp | ) |
This method is called after wait beacon timeout or wait probe request timeout has occurred.
This will trigger association process from beacons or probe responses gathered while scanning.
bestAp | the info about the best AP to associate with, if one was found |
Definition at line 776 of file sta-wifi-mac.cc.
References ns3::StaWifiMac::StaLinkEntity::bssid, GetLink(), ns3::WifiMac::GetLinks(), GetStaLink(), ns3::WifiMac::GetWifiRemoteStationManager(), m_maxMissedBeacons, ns3::MicroSeconds(), NS_ABORT_MSG, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, RestartBeaconWatchdog(), ns3::Seconds(), SendAssociationRequest(), ns3::StaWifiMac::StaLinkEntity::sendAssocReq, SetState(), StartScanning(), ns3::WifiMac::SwapLinks(), UpdateApInfo(), and WAIT_ASSOC_RESP.
|
private |
Forward an association or reassociation request packet to the DCF.
The standard is not clear on the correct queue for management frames if QoS is supported. We always use the DCF.
isReassoc | flag whether it is a reassociation request |
Definition at line 613 of file sta-wifi-mac.cc.
References AssocRequestTimeout(), ns3::EventId::Cancel(), ns3::Create(), GetAssociationRequest(), ns3::WifiMac::GetBEQueue(), GetLink(), ns3::WifiMac::GetLinks(), ns3::WifiMac::GetMldAddress(), GetMultiLinkElement(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetQosSupported(), GetStaLink(), GetTidToLinkMappingElements(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetVOQueue(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::EventId::IsPending(), m_assocRequestEvent, m_assocRequestTimeout, ns3::NOT_SUPPORTED, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, ns3::Txop::Queue(), ns3::Simulator::Schedule(), ns3::StaWifiMac::StaLinkEntity::sendAssocReq, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, and ns3::WIFI_MAC_MGT_REASSOCIATION_REQUEST.
Referenced by AssocRequestTimeout(), PhyCapabilitiesChanged(), and ScanningTimeout().
void ns3::StaWifiMac::SendProbeRequest | ( | uint8_t | linkId | ) |
Enqueue a probe request packet for transmission on the given link.
linkId | the ID of the given link |
Definition at line 352 of file sta-wifi-mac.cc.
References ns3::Create(), ns3::WifiMac::GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::WifiMac::GetEhtCapabilities(), ns3::WifiMac::GetEhtSupported(), ns3::WifiMac::GetExtendedCapabilities(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetHe6GhzBandCapabilities(), ns3::WifiMac::GetHeCapabilities(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetHtCapabilities(), ns3::WifiMac::GetHtSupported(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetSsid(), GetSupportedRates(), ns3::WifiMac::GetTxop(), ns3::WifiMac::GetVhtCapabilities(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::GetVOQueue(), ns3::WifiMac::Is6GhzBand(), NS_LOG_FUNCTION, ns3::Txop::Queue(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_MGT_PROBE_REQUEST.
Referenced by ns3::WifiDefaultAssocManager::DoStartScanning().
|
private |
Enable or disable active probing.
enable | enable or disable active probing |
Definition at line 275 of file sta-wifi-mac.cc.
References m_activeProbing, m_state, NS_LOG_DEBUG, NS_LOG_FUNCTION, SCANNING, and StartScanning().
Referenced by GetTypeId().
void ns3::StaWifiMac::SetAssocManager | ( | Ptr< WifiAssocManager > | assocManager | ) |
Set the Association Manager.
assocManager | the Association Manager |
Definition at line 246 of file sta-wifi-mac.cc.
References m_assocManager, and NS_LOG_FUNCTION.
|
private |
Set the EDCA parameters for the given link.
params | the EDCA parameters |
linkId | the ID of the given link |
Definition at line 1937 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetQosTxop().
Referenced by UpdateApInfo().
void ns3::StaWifiMac::SetEmlsrManager | ( | Ptr< EmlsrManager > | emlsrManager | ) |
Set the EMLSR Manager.
emlsrManager | the EMLSR Manager |
Definition at line 254 of file sta-wifi-mac.cc.
References m_emlsrManager, and NS_LOG_FUNCTION.
|
private |
Set the MU EDCA parameters for the given link.
params | the MU EDCA parameters |
linkId | the ID of the given link |
Definition at line 1947 of file sta-wifi-mac.cc.
References ns3::WifiMac::GetQosTxop().
Referenced by UpdateApInfo().
void ns3::StaWifiMac::SetPmModeAfterAssociation | ( | uint8_t | linkId | ) |
Set the Power Management mode of the setup links after association.
linkId | the ID of the link used to establish association |
When a link becomes enabled for a non-AP STA that is affiliated with a non-AP MLD after successful association with an AP MLD with (Re)Association Request/Response frames transmitted on that link [..], the power management mode of the non-AP STA, immediately after the acknowledgement of the (Re)Association Response frame [..], is active mode. (Sec. 35.3.7.1.4 of 802.11be D3.0)
When a link becomes enabled for a non-AP STA that is affiliated with a non-AP MLD after successful association with an AP MLD with (Re)Association Request/Response frames transmitted on another link [..], the power management mode of the non-AP STA, immediately after the acknowledgement of the (Re)Association Response frame [..], is power save mode, and its power state is doze. (Sec. 35.3.7.1.4 of 802.11be D3.0)
Definition at line 1452 of file sta-wifi-mac.cc.
References ns3::WifiPhy::CalculateTxDuration(), GetLink(), ns3::WifiMac::GetLinks(), GetStaLink(), ns3::NanoSeconds(), NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::WifiMac::LinkEntity::phy, ns3::Simulator::Schedule(), SetPowerSaveMode(), ns3::WIFI_PM_ACTIVE, and ns3::WIFI_PM_POWERSAVE.
Referenced by ReceiveAssocResp().
void ns3::StaWifiMac::SetPowerSaveMode | ( | const std::pair< bool, uint8_t > & | enableLinkIdPair | ) |
Enable or disable Power Save mode on the given link.
enableLinkIdPair | a pair indicating whether to enable or not power save mode on the link with the given ID |
Definition at line 1796 of file sta-wifi-mac.cc.
References ns3::AC_BE, ns3::Create(), ns3::WifiMac::GetAddress(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetFrameExchangeManager(), GetLink(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetQosTxop(), ns3::WifiMac::HasFramesToTransmit(), IsAssociated(), m_pmModeSwitchTimeout, ns3::WifiMac::m_txop, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Txop::Queue(), ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsTo(), ns3::WifiMacHeader::SetNoPowerManagement(), ns3::WifiMacHeader::SetPowerManagement(), SetPowerSaveMode(), ns3::WIFI_MAC_DATA_NULL, ns3::WIFI_PM_ACTIVE, ns3::WIFI_PM_POWERSAVE, ns3::WIFI_PM_SWITCHING_TO_ACTIVE, and ns3::WIFI_PM_SWITCHING_TO_PS.
Referenced by GetTypeId(), SetPmModeAfterAssociation(), and SetPowerSaveMode().
|
private |
Set the current MAC state.
value | the new state |
Definition at line 1931 of file sta-wifi-mac.cc.
References m_state.
Referenced by AssocRequestTimeout(), Disassociated(), PhyCapabilitiesChanged(), ReceiveAssocResp(), ScanningTimeout(), and StartScanning().
phys | the physical layers attached to this MAC. |
Reimplemented from ns3::WifiMac.
Definition at line 293 of file sta-wifi-mac.cc.
References ns3::MakeCallback(), NS_LOG_FUNCTION, PhyCapabilitiesChanged(), and ns3::WifiMac::SetWifiPhys().
|
private |
Start the scanning process which trigger active or passive scanning based on the active probing flag.
Definition at line 744 of file sta-wifi-mac.cc.
References ns3::ACTIVE, ns3::WifiScanParams::channelList, ns3::WifiMac::GetLinks(), ns3::WifiMac::GetSsid(), ns3::RandomVariableStream::GetValue(), m_activeProbing, m_assocManager, m_probeDelay, m_probeRequestTimeout, m_waitBeaconTimeout, ns3::WifiScanParams::maxChannelTime, ns3::MicroSeconds(), ns3::WifiScanParams::minChannelTime, NS_ASSERT, NS_LOG_FUNCTION, ns3::PASSIVE, ns3::WifiScanParams::probeDelay, SCANNING, SetState(), ns3::WifiScanParams::ssid, ns3::WifiScanParams::type, and ns3::WIFI_PHY_BAND_UNSPECIFIED.
Referenced by DoInitialize(), ReceiveAssocResp(), ScanningTimeout(), SetActiveProbing(), and TryToEnsureAssociated().
|
private |
Try to ensure that we are associated with an AP by taking an appropriate action depending on the current association status.
Definition at line 708 of file sta-wifi-mac.cc.
References ASSOCIATED, ns3::WifiMac::m_linkDown, m_state, NS_LOG_FUNCTION, REFUSED, SCANNING, StartScanning(), UNASSOCIATED, and WAIT_ASSOC_RESP.
Referenced by Disassociated(), and NotifyDropPacketToEnqueue().
Notify that the MPDU we sent was successfully received by the receiver (i.e.
we received an Ack from the receiver).
mpdu | the MPDU that we successfully sent |
Definition at line 1863 of file sta-wifi-mac.cc.
References GetLink(), ns3::WifiMac::GetLinkIdByAddress(), ns3::WifiMac::GetTxopQueue(), ns3::WifiMacHeader::IsPowerManagement(), NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::WIFI_PM_ACTIVE, ns3::WIFI_PM_POWERSAVE, ns3::WIFI_PM_SWITCHING_TO_ACTIVE, and ns3::WIFI_PM_SWITCHING_TO_PS.
Referenced by DoInitialize().
void ns3::StaWifiMac::UnblockTxOnLink | ( | std::set< uint8_t > | linkIds, |
WifiQueueBlockedReason | reason ) |
Unblock transmissions on the given links for the given reason.
linkIds | the IDs of the given links |
reason | the reason for unblocking transmissions on the given links |
Definition at line 1031 of file sta-wifi-mac.cc.
References ns3::Mac48Address::GetBroadcast(), ns3::WifiMac::GetBssid(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetMacQueueScheduler(), ns3::WifiMac::GetWifiRemoteStationManager(), NS_LOG_FUNCTION, ns3::WifiMac::UnblockUnicastTxOnLinks(), ns3::WIFI_MGT_QUEUE, and ns3::wifiAcList.
|
private |
Update associated AP's information from the given management frame (Beacon, Probe Response or Association Response).
If STA is not associated, this information will be used for the association process.
frame | the body of the given management frame |
apAddr | MAC address of the AP |
bssid | MAC address of BSSID |
linkId | ID of the link the management frame was received over |
Definition at line 1559 of file sta-wifi-mac.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::WifiMac::GetEhtSupported(), ns3::WifiMac::GetErpSupported(), ns3::WifiMac::GetHeConfiguration(), ns3::WifiMac::GetHeSupported(), ns3::WifiMac::GetHtSupported(), ns3::WifiPhy::GetMcsList(), ns3::WifiPhy::GetModeList(), ns3::WifiMac::GetQosSupported(), ns3::WifiMac::GetVhtSupported(), ns3::WifiMac::GetWifiPhy(), ns3::WifiMac::GetWifiRemoteStationManager(), ns3::WifiMac::Is6GhzBand(), m_emlsrManager, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_FUNCTION, SetEdcaParameters(), SetMuEdcaParameters(), ns3::WifiPhy::SetSlot(), ns3::WIFI_MOD_CLASS_HE, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by ReceiveAssocResp(), ReceiveBeacon(), and ScanningTimeout().
|
friend |
Allow test cases to access private members.
Definition at line 136 of file sta-wifi-mac.h.
|
friend |
Allow test cases to access private members.
Definition at line 138 of file sta-wifi-mac.h.
|
private |
active probing
Definition at line 599 of file sta-wifi-mac.h.
Referenced by GetActiveProbing(), SetActiveProbing(), and StartScanning().
|
private |
Association AID.
Definition at line 589 of file sta-wifi-mac.h.
Referenced by Disassociated(), GetAssociationId(), and ReceiveAssocResp().
|
private |
association logger
Definition at line 611 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and ReceiveAssocResp().
|
private |
Association Manager.
Definition at line 590 of file sta-wifi-mac.h.
Referenced by DoDispose(), DoInitialize(), NotifyChannelSwitching(), ReceiveBeacon(), ReceiveProbeResp(), SetAssocManager(), and StartScanning().
|
private |
association request event
Definition at line 595 of file sta-wifi-mac.h.
Referenced by Disassociated(), ReceiveAssocResp(), and SendAssociationRequest().
|
private |
association request timeout
Definition at line 594 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and SendAssociationRequest().
|
private |
beacon arrival logger
Definition at line 615 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and ReceiveBeacon().
|
private |
beacon info logger
Definition at line 616 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and ReceiveBeacon().
|
private |
beacon watchdog
Definition at line 597 of file sta-wifi-mac.h.
Referenced by MissedBeacons(), and RestartBeaconWatchdog().
|
private |
beacon watchdog end
Definition at line 598 of file sta-wifi-mac.h.
Referenced by MissedBeacons(), and RestartBeaconWatchdog().
|
private |
disassociation logger
Definition at line 613 of file sta-wifi-mac.h.
Referenced by Disassociated(), and GetTypeId().
|
private |
store the DL TID-to-Link Mapping included in the Association Request frame
Definition at line 607 of file sta-wifi-mac.h.
Referenced by GetTidToLinkMappingElements(), and ReceiveAssocResp().
|
private |
maps PHY ID to the event scheduled to switch the corresponding PHY to a new EMLSR link
Definition at line 603 of file sta-wifi-mac.h.
Referenced by DoDispose(), and NotifySwitchingEmlsrLink().
|
private |
EMLSR Manager.
Definition at line 591 of file sta-wifi-mac.h.
Referenced by DoDispose(), DoInitialize(), GetEmlsrManager(), GetMultiLinkElement(), NotifySwitchingEmlsrLink(), Receive(), SetEmlsrManager(), and UpdateApInfo().
|
private |
maximum missed beacons
Definition at line 596 of file sta-wifi-mac.h.
Referenced by GetTypeId(), ReceiveBeacon(), and ScanningTimeout().
|
private |
PM mode switch timeout.
Definition at line 602 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and SetPowerSaveMode().
|
private |
RandomVariable used to randomize the time of the first Probe Response on each channel.
Definition at line 600 of file sta-wifi-mac.h.
Referenced by AssignStreams(), GetTypeId(), and StartScanning().
|
private |
probe request timeout
Definition at line 593 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and StartScanning().
|
private |
link setup canceled logger
Definition at line 614 of file sta-wifi-mac.h.
Referenced by GetTypeId().
|
private |
link setup completed logger
Definition at line 612 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and ReceiveAssocResp().
|
private |
MAC state.
Definition at line 588 of file sta-wifi-mac.h.
Referenced by IsAssociated(), IsWaitAssocResp(), ReceiveAssocResp(), ReceiveBeacon(), SetActiveProbing(), SetState(), and TryToEnsureAssociated().
|
private |
store the UL TID-to-Link Mapping included in the Association Request frame
Definition at line 609 of file sta-wifi-mac.h.
Referenced by GetTidToLinkMappingElements(), and ReceiveAssocResp().
|
private |
wait beacon timeout
Definition at line 592 of file sta-wifi-mac.h.
Referenced by GetTypeId(), and StartScanning().