a non-QoS STA state machine More...
#include <nqsta-wifi-mac.h>
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.
anonymous enum [private] |
Definition at line 133 of file nqsta-wifi-mac.h.
ns3::NqstaWifiMac::NqstaWifiMac | ( | ) |
Definition at line 91 of file nqsta-wifi-mac.cc.
References m_dca, m_dcfManager, m_low, m_rxMiddle, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::MacRxMiddle::Receive(), Receive(), ns3::MacRxMiddle::SetForwardCallback(), and ns3::DcfManager::SetupLowListener().
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] |
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] |
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] |
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] |
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] |
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] |
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] |
Implements ns3::WifiMac.
Definition at line 188 of file nqsta-wifi-mac.cc.
References m_low.
Time ns3::NqstaWifiMac::GetEifsNoDifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 178 of file nqsta-wifi-mac.cc.
References m_eifsNoDifs.
Time ns3::NqstaWifiMac::GetPifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 193 of file nqsta-wifi-mac.cc.
References m_low.
Time ns3::NqstaWifiMac::GetSifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 173 of file nqsta-wifi-mac.cc.
References m_low.
Time ns3::NqstaWifiMac::GetSlot | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 168 of file nqsta-wifi-mac.cc.
References m_low.
Ssid ns3::NqstaWifiMac::GetSsid | ( | void | ) | const [virtual] |
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] |
Definition at line 603 of file nqsta-wifi-mac.cc.
References ns3::SupportedRates::AddSupportedRate(), ns3::WifiMode::GetDataRate(), and m_phy.
Referenced by SendAssociationRequest(), and SendProbeRequest().
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:
Attributes defined for this type:
Attributes defined in parent class ns3::WifiMac:
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.
void ns3::NqstaWifiMac::MissedBeacons | ( | void | ) | [private] |
Definition at line 411 of file nqsta-wifi-mac.cc.
References BEACON_MISSED, m_beaconWatchdog, m_beaconWatchdogEnd, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and TryToEnsureAssociated().
Referenced by RestartBeaconWatchdog().
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] |
Definition at line 474 of file nqsta-wifi-mac.cc.
References ns3::WifiRemoteStation::AddSupportedMode(), ASSOCIATED, BEACON_MISSED, ns3::EventId::Cancel(), ForwardUp(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), GetAddress(), ns3::MgtProbeResponseHeader::GetBeaconIntervalUs(), GetBssid(), ns3::WifiMode::GetDataRate(), ns3::MgtProbeResponseHeader::GetSsid(), GetSsid(), ns3::MgtAssocResponseHeader::GetStatusCode(), ns3::MgtAssocResponseHeader::GetSupportedRates(), IsAssociated(), ns3::WifiMacHeader::IsAssocReq(), ns3::WifiMacHeader::IsAssocResp(), ns3::SupportedRates::IsBasicRate(), ns3::WifiMacHeader::IsBeacon(), ns3::Mac48Address::IsBroadcast(), ns3::WifiMacHeader::IsCtl(), ns3::WifiMacHeader::IsData(), ns3::Ssid::IsEqual(), ns3::WifiMacHeader::IsFromDs(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::WifiMacHeader::IsProbeReq(), ns3::WifiMacHeader::IsProbeResp(), ns3::EventId::IsRunning(), ns3::StatusCode::IsSuccess(), ns3::SupportedRates::IsSupportedRate(), ns3::WifiMacHeader::IsToDs(), m_assocRequestEvent, m_linkUp, m_maxMissedBeacons, m_phy, m_probeRequestEvent, m_state, m_stationManager, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, REFUSED, RestartBeaconWatchdog(), SendAssociationRequest(), SetBssid(), WAIT_ASSOC_RESP, and WAIT_PROBE_RESP.
Referenced by NqstaWifiMac().
void ns3::NqstaWifiMac::RestartBeaconWatchdog | ( | Time | delay | ) | [private] |
Definition at line 425 of file nqsta-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 Receive().
void ns3::NqstaWifiMac::SendAssociationRequest | ( | void | ) | [private] |
Definition at line 335 of file nqsta-wifi-mac.cc.
References AssocRequestTimeout(), GetAddress(), GetBssid(), GetSsid(), GetSupportedRates(), m_assocRequestEvent, m_assocRequestTimeout, m_dca, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetAssocReq(), ns3::WifiMacHeader::SetDsNotFrom(), and ns3::WifiMacHeader::SetDsNotTo().
Referenced by AssocRequestTimeout(), and Receive().
void ns3::NqstaWifiMac::SendProbeRequest | ( | void | ) | [private] |
Definition at line 312 of file nqsta-wifi-mac.cc.
References GetAddress(), GetBroadcastBssid(), GetSsid(), GetSupportedRates(), m_dca, m_probeRequestEvent, m_probeRequestTimeout, NS_LOG_FUNCTION, ProbeRequestTimeout(), ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), and ns3::WifiMacHeader::SetProbeReq().
Referenced by ProbeRequestTimeout(), and TryToEnsureAssociated().
void ns3::NqstaWifiMac::SetAckTimeout | ( | Time | ackTimeout | ) | [virtual] |
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] |
Definition at line 293 of file nqsta-wifi-mac.cc.
References ns3::EventId::Cancel(), m_probeRequestEvent, NS_LOG_FUNCTION, and TryToEnsureAssociated().
Referenced by GetTypeId().
void ns3::NqstaWifiMac::SetAddress | ( | Mac48Address | address | ) | [virtual] |
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 | ) |
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] |
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] |
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] |
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] |
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] |
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 | ) |
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] |
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 | ) |
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] |
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] |
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] |
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.
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] |
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] |
Definition at line 357 of file nqsta-wifi-mac.cc.
References ASSOCIATED, BEACON_MISSED, m_linkDown, m_state, NS_LOG_FUNCTION, REFUSED, SendProbeRequest(), WAIT_ASSOC_RESP, and WAIT_PROBE_RESP.
Referenced by Enqueue(), MissedBeacons(), SetActiveProbing(), and StartActiveAssociation().
Definition at line 143 of file nqsta-wifi-mac.h.
Referenced by Receive(), and SendAssociationRequest().
Time ns3::NqstaWifiMac::m_assocRequestTimeout [private] |
Definition at line 141 of file nqsta-wifi-mac.h.
Referenced by GetTypeId(), SendAssociationRequest(), and SetAssocRequestTimeout().
EventId ns3::NqstaWifiMac::m_beaconWatchdog [private] |
Definition at line 148 of file nqsta-wifi-mac.h.
Referenced by MissedBeacons(), and RestartBeaconWatchdog().
Time ns3::NqstaWifiMac::m_beaconWatchdogEnd [private] |
Definition at line 149 of file nqsta-wifi-mac.h.
Referenced by MissedBeacons(), and RestartBeaconWatchdog().
Ptr<DcaTxop> ns3::NqstaWifiMac::m_dca [private] |
Definition at line 147 of file nqsta-wifi-mac.h.
Referenced by DoDispose(), Enqueue(), NqstaWifiMac(), SendAssociationRequest(), SendProbeRequest(), and SetWifiRemoteStationManager().
DcfManager* ns3::NqstaWifiMac::m_dcfManager [private] |
Definition at line 154 of file nqsta-wifi-mac.h.
Referenced by DoDispose(), NqstaWifiMac(), SetEifsNoDifs(), SetSifs(), SetSlot(), and SetWifiPhy().
Time ns3::NqstaWifiMac::m_eifsNoDifs [private] |
Definition at line 158 of file nqsta-wifi-mac.h.
Referenced by GetEifsNoDifs(), and SetEifsNoDifs().
Callback<void, Ptr<Packet>, Mac48Address, Mac48Address> ns3::NqstaWifiMac::m_forwardUp [private] |
Definition at line 144 of file nqsta-wifi-mac.h.
Referenced by ForwardUp(), and SetForwardUpCallback().
Callback<void> ns3::NqstaWifiMac::m_linkDown [private] |
Definition at line 146 of file nqsta-wifi-mac.h.
Referenced by SetLinkDownCallback(), and TryToEnsureAssociated().
Callback<void> ns3::NqstaWifiMac::m_linkUp [private] |
Definition at line 145 of file nqsta-wifi-mac.h.
Referenced by Receive(), and SetLinkUpCallback().
Ptr<MacLow> ns3::NqstaWifiMac::m_low [private] |
Definition at line 156 of file nqsta-wifi-mac.h.
Referenced by DoDispose(), Enqueue(), GetAckTimeout(), GetAddress(), GetBssid(), GetCtsTimeout(), GetPifs(), GetSifs(), GetSlot(), NqstaWifiMac(), SetAckTimeout(), SetAddress(), SetBssid(), SetCtsTimeout(), SetPifs(), SetSifs(), SetSlot(), SetWifiPhy(), and SetWifiRemoteStationManager().
uint32_t ns3::NqstaWifiMac::m_maxMissedBeacons [private] |
Definition at line 150 of file nqsta-wifi-mac.h.
Referenced by GetTypeId(), Receive(), and SetMaxMissedBeacons().
Ptr<WifiPhy> ns3::NqstaWifiMac::m_phy [private] |
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().
Time ns3::NqstaWifiMac::m_probeRequestTimeout [private] |
Definition at line 140 of file nqsta-wifi-mac.h.
Referenced by GetTypeId(), SendProbeRequest(), and SetProbeRequestTimeout().
MacRxMiddle* ns3::NqstaWifiMac::m_rxMiddle [private] |
Definition at line 155 of file nqsta-wifi-mac.h.
Referenced by DoDispose(), and NqstaWifiMac().
Ssid ns3::NqstaWifiMac::m_ssid [private] |
Definition at line 157 of file nqsta-wifi-mac.h.
enum { ... } ns3::NqstaWifiMac::m_state [private] |
Referenced by AssocRequestTimeout(), IsAssociated(), MissedBeacons(), ProbeRequestTimeout(), Receive(), and TryToEnsureAssociated().
Definition at line 153 of file nqsta-wifi-mac.h.
Referenced by Receive(), and SetWifiRemoteStationManager().