ns3::NqstaWifiMac Class Reference

a non-QoS STA state machine More...

#include <nqsta-wifi-mac.h>

Inheritance diagram for ns3::NqstaWifiMac:
Inheritance graph
[legend]
Collaboration diagram for ns3::NqstaWifiMac:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NqstaWifiMac ()
 ~NqstaWifiMac ()
virtual void SetSlot (Time slotTime)
virtual void SetSifs (Time sifs)
virtual void SetEifsNoDifs (Time eifsNoDifs)
virtual void SetAckTimeout (Time ackTimeout)
virtual void SetCtsTimeout (Time ctsTimeout)
virtual void SetPifs (Time pifs)
virtual Time GetSlot (void) const
virtual Time GetSifs (void) const
virtual Time GetEifsNoDifs (void) const
virtual Time GetAckTimeout (void) const
virtual Time GetCtsTimeout (void) const
virtual Time GetPifs (void) const
virtual void SetWifiPhy (Ptr< WifiPhy > phy)
virtual void SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager)
virtual void Enqueue (Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
virtual void Enqueue (Ptr< const Packet > packet, Mac48Address to)
virtual bool SupportsSendFrom (void) const
virtual void SetForwardUpCallback (Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > upCallback)
virtual void SetLinkUpCallback (Callback< void > linkUp)
virtual void SetLinkDownCallback (Callback< void > linkDown)
virtual Mac48Address GetAddress (void) const
virtual Ssid GetSsid (void) const
virtual void SetAddress (Mac48Address address)
virtual void SetSsid (Ssid ssid)
virtual Mac48Address GetBssid (void) const
void SetMaxMissedBeacons (uint32_t missed)
void SetProbeRequestTimeout (Time timeout)
void SetAssocRequestTimeout (Time timeout)
void StartActiveAssociation (void)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::NqstaWifiMac.

Private Types

enum  {
  ASSOCIATED, WAIT_PROBE_RESP, WAIT_ASSOC_RESP, BEACON_MISSED,
  REFUSED
}

Private Member Functions

void SetBssid (Mac48Address bssid)
void SetActiveProbing (bool enable)
bool GetActiveProbing (void) const
void ForwardUp (Ptr< Packet > packet, Mac48Address from, Mac48Address to)
void Receive (Ptr< Packet > packet, WifiMacHeader const *hdr)
Mac48Address GetBroadcastBssid (void)
void SendProbeRequest (void)
void SendAssociationRequest (void)
void TryToEnsureAssociated (void)
void AssocRequestTimeout (void)
void ProbeRequestTimeout (void)
bool IsAssociated (void)
void MissedBeacons (void)
void RestartBeaconWatchdog (Time delay)
SupportedRates GetSupportedRates (void) const
virtual void DoDispose (void)
 NqstaWifiMac (const NqstaWifiMac &ctor_arg)
NqstaWifiMacoperator= (const NqstaWifiMac &ctor_arg)

Private Attributes

enum ns3::NqstaWifiMac:: { ... }  m_state
Time m_probeRequestTimeout
Time m_assocRequestTimeout
EventId m_probeRequestEvent
EventId m_assocRequestEvent
Callback< void, Ptr< Packet >
, Mac48Address, Mac48Address
m_forwardUp
Callback< void > m_linkUp
Callback< void > m_linkDown
Ptr< DcaTxopm_dca
EventId m_beaconWatchdog
Time m_beaconWatchdogEnd
uint32_t m_maxMissedBeacons
Ptr< WifiPhym_phy
Ptr< WifiRemoteStationManagerm_stationManager
DcfManagerm_dcfManager
MacRxMiddlem_rxMiddle
Ptr< MacLowm_low
Ssid m_ssid
Time m_eifsNoDifs

Detailed Description

a non-QoS STA state machine

This state machine handles association, disassociation, authentication and beacon monitoring. It does not perform channel scanning. If the station detects a certain number of missed beacons while associated, it automatically attempts a new association sequence.

Definition at line 53 of file nqsta-wifi-mac.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
ASSOCIATED 
WAIT_PROBE_RESP 
WAIT_ASSOC_RESP 
BEACON_MISSED 
REFUSED 

Definition at line 133 of file nqsta-wifi-mac.h.


Constructor & Destructor Documentation

ns3::NqstaWifiMac::NqstaWifiMac (  ) 
ns3::NqstaWifiMac::~NqstaWifiMac (  ) 

Definition at line 112 of file nqsta-wifi-mac.cc.

References NS_LOG_FUNCTION.

ns3::NqstaWifiMac::NqstaWifiMac ( const NqstaWifiMac ctor_arg  )  [private]

Member Function Documentation

void ns3::NqstaWifiMac::AssocRequestTimeout ( void   )  [private]

Definition at line 397 of file nqsta-wifi-mac.cc.

References m_state, NS_LOG_FUNCTION, SendAssociationRequest(), and WAIT_ASSOC_RESP.

Referenced by SendAssociationRequest().

void ns3::NqstaWifiMac::DoDispose ( void   )  [private, virtual]

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

Subclasses are expected to implement their real destruction code in an overriden 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.

Reimplemented from ns3::Object.

Definition at line 118 of file nqsta-wifi-mac.cc.

References m_dca, m_dcfManager, m_low, m_phy, m_rxMiddle, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::Enqueue ( Ptr< const Packet packet,
Mac48Address  to 
) [virtual]
Parameters:
packet the packet to send.
to the address to which the packet should be sent.

The packet should be enqueued in a tx queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC.

Implements ns3::WifiMac.

Definition at line 448 of file nqsta-wifi-mac.cc.

References GetBssid(), IsAssociated(), m_dca, m_low, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsTo(), ns3::WifiMacHeader::SetTypeData(), and TryToEnsureAssociated().

void ns3::NqstaWifiMac::Enqueue ( Ptr< const Packet packet,
Mac48Address  to,
Mac48Address  from 
) [virtual]
Parameters:
packet the packet to send.
to the address to which the packet should be sent.
from the address from which the packet should be sent.

The packet should be enqueued in a tx queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC. The extra parameter "from" allows this device to operate in a bridged mode, forwarding received frames without altering the source addresss.

Implements ns3::WifiMac.

Definition at line 443 of file nqsta-wifi-mac.cc.

References NS_FATAL_ERROR.

void ns3::NqstaWifiMac::ForwardUp ( Ptr< Packet packet,
Mac48Address  from,
Mac48Address  to 
) [private]

Definition at line 306 of file nqsta-wifi-mac.cc.

References m_forwardUp, and NS_LOG_FUNCTION.

Referenced by Receive().

Time ns3::NqstaWifiMac::GetAckTimeout ( void   )  const [virtual]
Returns:
the current ACK timeout duration.

Implements ns3::WifiMac.

Definition at line 183 of file nqsta-wifi-mac.cc.

References m_low.

bool ns3::NqstaWifiMac::GetActiveProbing ( void   )  const [private]
Mac48Address ns3::NqstaWifiMac::GetAddress ( void   )  const [virtual]
Returns:
the MAC address associated to this MAC layer.

Implements ns3::WifiMac.

Definition at line 228 of file nqsta-wifi-mac.cc.

References m_low.

Referenced by Receive(), SendAssociationRequest(), and SendProbeRequest().

Mac48Address ns3::NqstaWifiMac::GetBroadcastBssid ( void   )  [private]

Definition at line 281 of file nqsta-wifi-mac.cc.

References ns3::Mac48Address::GetBroadcast().

Referenced by SendProbeRequest().

Mac48Address ns3::NqstaWifiMac::GetBssid ( void   )  const [virtual]
Returns:
the bssid of the network this device belongs to.

Implements ns3::WifiMac.

Definition at line 238 of file nqsta-wifi-mac.cc.

References m_low.

Referenced by Enqueue(), Receive(), and SendAssociationRequest().

Time ns3::NqstaWifiMac::GetCtsTimeout ( void   )  const [virtual]
Returns:
the current CTS timeout duration.

Implements ns3::WifiMac.

Definition at line 188 of file nqsta-wifi-mac.cc.

References m_low.

Time ns3::NqstaWifiMac::GetEifsNoDifs ( void   )  const [virtual]
Returns:
the current EIFS minus DIFS duration

Implements ns3::WifiMac.

Definition at line 178 of file nqsta-wifi-mac.cc.

References m_eifsNoDifs.

Time ns3::NqstaWifiMac::GetPifs ( void   )  const [virtual]
Returns:
the current PIFS duration.

Implements ns3::WifiMac.

Definition at line 193 of file nqsta-wifi-mac.cc.

References m_low.

Time ns3::NqstaWifiMac::GetSifs ( void   )  const [virtual]
Returns:
the current SIFS duration.

Implements ns3::WifiMac.

Definition at line 173 of file nqsta-wifi-mac.cc.

References m_low.

Time ns3::NqstaWifiMac::GetSlot ( void   )  const [virtual]
Returns:
the current slot duration.

Implements ns3::WifiMac.

Definition at line 168 of file nqsta-wifi-mac.cc.

References m_low.

Ssid ns3::NqstaWifiMac::GetSsid ( void   )  const [virtual]
Returns:
the ssid which this MAC layer is going to try to stay in.

Implements ns3::WifiMac.

Definition at line 233 of file nqsta-wifi-mac.cc.

References m_ssid.

Referenced by Receive(), SendAssociationRequest(), and SendProbeRequest().

SupportedRates ns3::NqstaWifiMac::GetSupportedRates ( void   )  const [private]
TypeId ns3::NqstaWifiMac::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::NqstaWifiMac.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3WifiNetDevice/Mac/$ns3NqstaWifiMac

Attributes defined for this type:

  • ProbeRequestTimeout: The interval between two consecutive probe request attempts.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 50000000ns
    • Flags: construct write read
  • AssocRequestTimeout: The interval between two consecutive assoc request attempts.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 500000000ns
    • Flags: construct write read
  • MaxMissedBeacons: Number of beacons which much be consecutively missed before we attempt to restart association.
  • ActiveProbing: If true, we send probe requests. If false, we don't.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write

Attributes defined in parent class ns3::WifiMac:

  • CtsTimeout: When this timeout expires, the RTS/CTS handshake has failed.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 75666ns
    • Flags: construct write read
  • AckTimeout: When this timeout expires, the DATA/ACK handshake has failed.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 75666ns
    • Flags: construct write read
  • Sifs: The value of the SIFS constant.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 16000ns
    • Flags: construct write read
  • EifsNoDifs: The value of EIFS-DIFS
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 60000ns
    • Flags: construct write read
  • Slot: The duration of a Slot.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 9000ns
    • Flags: construct write read
  • Pifs: The value of the PIFS constant.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 25000ns
    • Flags: construct write read
  • MaxPropagationDelay: The maximum propagation delay. Unused for now.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 3333ns
    • Flags: construct write read
  • MaxMsduSize: The maximum size of an MSDU accepted by the MAC layer.This value conforms to the specification.
  • Ssid: The ssid we want to belong to.
    • Set with class: SsidValue
    • Underlying type: Ssid
    • Initial value: default
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::WifiMac.

Definition at line 63 of file nqsta-wifi-mac.cc.

References ns3::TypeId::AddAttribute(), m_assocRequestTimeout, m_maxMissedBeacons, m_probeRequestTimeout, ns3::Seconds(), SetActiveProbing(), and ns3::TypeId::SetParent().

bool ns3::NqstaWifiMac::IsAssociated ( void   )  [private]

Definition at line 437 of file nqsta-wifi-mac.cc.

References ASSOCIATED, and m_state.

Referenced by Enqueue(), and Receive().

void ns3::NqstaWifiMac::MissedBeacons ( void   )  [private]
NqstaWifiMac& ns3::NqstaWifiMac::operator= ( const NqstaWifiMac ctor_arg  )  [private]
void ns3::NqstaWifiMac::ProbeRequestTimeout ( void   )  [private]

Definition at line 404 of file nqsta-wifi-mac.cc.

References m_state, NS_LOG_FUNCTION, SendProbeRequest(), and WAIT_PROBE_RESP.

Referenced by SendProbeRequest().

void ns3::NqstaWifiMac::Receive ( Ptr< Packet packet,
WifiMacHeader const *  hdr 
) [private]
void ns3::NqstaWifiMac::RestartBeaconWatchdog ( Time  delay  )  [private]
void ns3::NqstaWifiMac::SendAssociationRequest ( void   )  [private]
void ns3::NqstaWifiMac::SendProbeRequest ( void   )  [private]
void ns3::NqstaWifiMac::SetAckTimeout ( Time  ackTimeout  )  [virtual]
Parameters:
ackTimeout the duration of an ACK timeout.

Implements ns3::WifiMac.

Definition at line 153 of file nqsta-wifi-mac.cc.

References m_low.

void ns3::NqstaWifiMac::SetActiveProbing ( bool  enable  )  [private]
void ns3::NqstaWifiMac::SetAddress ( Mac48Address  address  )  [virtual]
Parameters:
address the current address of this MAC layer.

Implements ns3::WifiMac.

Definition at line 243 of file nqsta-wifi-mac.cc.

References m_low, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::SetAssocRequestTimeout ( Time  timeout  ) 
Parameters:
timeout If no association response is received within the specified timeout, the station sends a new association request.

Definition at line 267 of file nqsta-wifi-mac.cc.

References m_assocRequestTimeout, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::SetBssid ( Mac48Address  bssid  )  [private]

Definition at line 287 of file nqsta-wifi-mac.cc.

References m_low, and NS_LOG_FUNCTION.

Referenced by Receive().

void ns3::NqstaWifiMac::SetCtsTimeout ( Time  ctsTimeout  )  [virtual]
Parameters:
ctsTimeout the duration of a CTS timeout.

Implements ns3::WifiMac.

Definition at line 158 of file nqsta-wifi-mac.cc.

References m_low.

void ns3::NqstaWifiMac::SetEifsNoDifs ( Time  eifsNoDifs  )  [virtual]
Parameters:
eifsNoDifs the duration of an EIFS minus DIFS.

This value is used to calculate the EIFS depending on AIFSN.

Implements ns3::WifiMac.

Definition at line 146 of file nqsta-wifi-mac.cc.

References m_dcfManager, m_eifsNoDifs, NS_LOG_FUNCTION, and ns3::DcfManager::SetEifsNoDifs().

void ns3::NqstaWifiMac::SetForwardUpCallback ( Callback< void, Ptr< Packet >, Mac48Address, Mac48Address upCallback  )  [virtual]
Parameters:
upCallback the callback to invoke when a packet must be forwarded up the stack.

Implements ns3::WifiMac.

Definition at line 213 of file nqsta-wifi-mac.cc.

References m_forwardUp.

void ns3::NqstaWifiMac::SetLinkDownCallback ( Callback< void >  linkDown  )  [virtual]
Parameters:
linkDown the callback to invoke when the link becomes down.

Implements ns3::WifiMac.

Definition at line 223 of file nqsta-wifi-mac.cc.

References m_linkDown.

void ns3::NqstaWifiMac::SetLinkUpCallback ( Callback< void >  linkUp  )  [virtual]
Parameters:
linkUp the callback to invoke when the link becomes up.

Implements ns3::WifiMac.

Definition at line 218 of file nqsta-wifi-mac.cc.

References m_linkUp.

void ns3::NqstaWifiMac::SetMaxMissedBeacons ( uint32_t  missed  ) 
Parameters:
missed the number of beacons which must be missed before a new association sequence is started.

Definition at line 255 of file nqsta-wifi-mac.cc.

References m_maxMissedBeacons, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::SetPifs ( Time  pifs  )  [virtual]
Parameters:
pifs the pifs duration.

Implements ns3::WifiMac.

Definition at line 163 of file nqsta-wifi-mac.cc.

References m_low.

void ns3::NqstaWifiMac::SetProbeRequestTimeout ( Time  timeout  ) 
Parameters:
timeout If no probe response is received within the specified timeout, the station sends a new probe request.

Definition at line 261 of file nqsta-wifi-mac.cc.

References m_probeRequestTimeout, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::SetSifs ( Time  sifs  )  [virtual]
Parameters:
sifs the sifs duration

Implements ns3::WifiMac.

Definition at line 139 of file nqsta-wifi-mac.cc.

References m_dcfManager, m_low, NS_LOG_FUNCTION, and ns3::DcfManager::SetSifs().

void ns3::NqstaWifiMac::SetSlot ( Time  slotTime  )  [virtual]
Parameters:
slotTime the slot duration

Implements ns3::WifiMac.

Definition at line 132 of file nqsta-wifi-mac.cc.

References m_dcfManager, m_low, NS_LOG_FUNCTION, and ns3::DcfManager::SetSlot().

void ns3::NqstaWifiMac::SetSsid ( Ssid  ssid  )  [virtual]
Parameters:
ssid the current ssid of this MAC layer.

Implements ns3::WifiMac.

Definition at line 249 of file nqsta-wifi-mac.cc.

References m_ssid, and NS_LOG_FUNCTION.

void ns3::NqstaWifiMac::SetWifiPhy ( Ptr< WifiPhy phy  )  [virtual]
Parameters:
phy the physical layer attached to this MAC.

Implements ns3::WifiMac.

Definition at line 199 of file nqsta-wifi-mac.cc.

References m_dcfManager, m_low, m_phy, and ns3::DcfManager::SetupPhyListener().

void ns3::NqstaWifiMac::SetWifiRemoteStationManager ( Ptr< WifiRemoteStationManager stationManager  )  [virtual]
Parameters:
stationManager the station manager attached to this MAC.

Implements ns3::WifiMac.

Definition at line 206 of file nqsta-wifi-mac.cc.

References m_dca, m_low, and m_stationManager.

void ns3::NqstaWifiMac::StartActiveAssociation ( void   ) 

Start an active association sequence immediately.

Definition at line 274 of file nqsta-wifi-mac.cc.

References NS_LOG_FUNCTION, and TryToEnsureAssociated().

bool ns3::NqstaWifiMac::SupportsSendFrom ( void   )  const [virtual]

Implements ns3::WifiMac.

Definition at line 467 of file nqsta-wifi-mac.cc.

void ns3::NqstaWifiMac::TryToEnsureAssociated ( void   )  [private]

Member Data Documentation

Definition at line 143 of file nqsta-wifi-mac.h.

Referenced by Receive(), and SendAssociationRequest().

Definition at line 141 of file nqsta-wifi-mac.h.

Referenced by GetTypeId(), SendAssociationRequest(), and SetAssocRequestTimeout().

Definition at line 148 of file nqsta-wifi-mac.h.

Referenced by MissedBeacons(), and RestartBeaconWatchdog().

Definition at line 149 of file nqsta-wifi-mac.h.

Referenced by MissedBeacons(), and RestartBeaconWatchdog().

Definition at line 154 of file nqsta-wifi-mac.h.

Referenced by DoDispose(), NqstaWifiMac(), SetEifsNoDifs(), SetSifs(), SetSlot(), and SetWifiPhy().

Definition at line 158 of file nqsta-wifi-mac.h.

Referenced by GetEifsNoDifs(), and SetEifsNoDifs().

Definition at line 144 of file nqsta-wifi-mac.h.

Referenced by ForwardUp(), and SetForwardUpCallback().

Definition at line 146 of file nqsta-wifi-mac.h.

Referenced by SetLinkDownCallback(), and TryToEnsureAssociated().

Definition at line 145 of file nqsta-wifi-mac.h.

Referenced by Receive(), and SetLinkUpCallback().

Definition at line 150 of file nqsta-wifi-mac.h.

Referenced by GetTypeId(), Receive(), and SetMaxMissedBeacons().

Definition at line 152 of file nqsta-wifi-mac.h.

Referenced by DoDispose(), GetSupportedRates(), Receive(), and SetWifiPhy().

Definition at line 142 of file nqsta-wifi-mac.h.

Referenced by Receive(), SendProbeRequest(), and SetActiveProbing().

Definition at line 140 of file nqsta-wifi-mac.h.

Referenced by GetTypeId(), SendProbeRequest(), and SetProbeRequestTimeout().

Definition at line 155 of file nqsta-wifi-mac.h.

Referenced by DoDispose(), and NqstaWifiMac().

Definition at line 157 of file nqsta-wifi-mac.h.

Referenced by GetSsid(), and SetSsid().

enum { ... } ns3::NqstaWifiMac::m_state [private]

Definition at line 153 of file nqsta-wifi-mac.h.

Referenced by Receive(), and SetWifiRemoteStationManager().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:15 2009 for NS-3 by  doxygen 1.6.3