25 #include "ns3/simulator.h"
26 #include "ns3/string.h"
27 #include "ns3/pointer.h"
28 #include "ns3/boolean.h"
29 #include "ns3/trace-source-accessor.h"
70 .AddConstructor<StaWifiMac> ()
71 .AddAttribute (
"ProbeRequestTimeout",
"The interval between two consecutive probe request attempts.",
75 .AddAttribute (
"AssocRequestTimeout",
"The interval between two consecutive assoc request attempts.",
79 .AddAttribute (
"MaxMissedBeacons",
80 "Number of beacons which much be consecutively missed before "
81 "we attempt to restart association.",
84 MakeUintegerChecker<uint32_t> ())
85 .AddAttribute (
"ActiveProbing",
"If true, we send probe requests. If false, we don't. NOTE: if more than one STA in your simulation is using active probing, you should enable it at a different simulation time for each STA, otherwise all the STAs will start sending probes at the same time resulting in collisions. See bug 1060 for more info.",
88 MakeBooleanChecker ())
89 .AddTraceSource (
"Assoc",
"Associated with an access point.",
91 .AddTraceSource (
"DeAssoc",
"Association with an access point lost.",
98 : m_state (BEACON_MISSED),
99 m_probeRequestEvent (),
100 m_assocRequestEvent (),
101 m_beaconWatchdogEnd (Seconds (0.0))
184 m_dca->Queue (packet, hdr);
221 m_dca->Queue (packet, hdr);
398 m_dca->Queue (packet, hdr);
423 NS_LOG_LOGIC (
"Received data frame while not associated: ignore");
429 NS_LOG_LOGIC (
"Received data frame not from the DS: ignore");
435 NS_LOG_LOGIC (
"Received data frame not from the BSS we are associated with: ignore");
470 bool goodBeacon =
false;
static Time GetDelayLeft(const EventId &id)
bool IsWaitAssocResp(void) const
uint32_t RemoveHeader(Header &header)
NS_LOG_COMPONENT_DEFINE("StaWifiMac")
TracedCallback< Mac48Address > m_deAssocLogger
void AddSupportedRate(uint32_t bs)
SupportedRates GetSupportedRates(void) const
keep track of time values and allow control of global simulation resolution
Time m_assocRequestTimeout
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
#define NS_LOG_FUNCTION(parameters)
void SendAssociationRequest(void)
void SetGreenfield(uint8_t greenfield)
void SetHtSupported(uint8_t htsupported)
virtual uint32_t GetNModes(void) const =0
void SetRxMcsBitmask(uint8_t index)
void AssocRequestTimeout(void)
Time m_probeRequestTimeout
void SetProbeRequestTimeout(Time timeout)
virtual uint8_t GetNMcs(void) const =0
#define NS_ASSERT(condition)
Callback< void > m_linkUp
The Ht Capabilities Information ElementThis class knows how to serialise and deserialise the Ht Capab...
void NotifyRxDrop(Ptr< const Packet > packet)
virtual bool GetLdpc(void) const =0
bool IsRunning(void) const
virtual uint8_t GetMcs(uint8_t mcs) const =0
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
TracedCallback< Mac48Address > m_assocLogger
EventId m_assocRequestEvent
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
bool IsEqual(const Ssid &o) const
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void SetAssocRequestTimeout(Time timeout)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
virtual void SetBssid(Mac48Address bssid)
void SendProbeRequest(void)
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
void ProbeRequestTimeout(void)
void SetTypeOfStation(TypeOfStation type)
void SetShortGuardInterval20(uint8_t shortguardinterval)
hold objects of type ns3::Time
void NotifyTxDrop(Ptr< const Packet > packet)
Hold an unsigned integer type.
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
AcIndex QosUtilsMapTidToAc(uint8_t tid)
static Mac48Address GetBroadcast(void)
bool IsSupportedMcs(uint8_t mcs)
virtual bool GetGuardInterval(void) const =0
void SetState(enum MacState value)
virtual uint32_t GetNBssMembershipSelectors(void) const =0
#define NS_LOG_LOGIC(msg)
void SetBasicRate(uint32_t bs)
HtCapabilities GetHtCapabilities(void) const
Callback< void > m_linkDown
bool IsBasicRate(uint32_t bs) const
uint32_t m_maxMissedBeacons
void StartActiveAssociation(void)
void SetMaxMissedBeacons(uint32_t missed)
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
static TypeId GetTypeId(void)
virtual WifiMode GetMode(uint32_t mode) const =0
void RestartBeaconWatchdog(Time delay)
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
void TryToEnsureAssociated(void)
void SetActiveProbing(bool enable)
virtual Mac48Address GetBssid(void) const
#define NS_LOG_DEBUG(msg)
virtual Mac48Address GetAddress(void) const
bool IsSuccess(void) const
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
void SetLdpc(uint8_t ldpc)
bool IsSupportedRate(uint32_t bs) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
EventId m_probeRequestEvent
Ptr< WifiRemoteStationManager > m_stationManager
bool IsAssociated(void) const
bool IsExpired(void) const
a unique identifier for an interface.
uint64_t GetDataRate(void) const
TypeId SetParent(TypeId tid)
virtual bool GetGreenfield(void) const =0
void AddHeader(const Header &header)