24 #include "ns3/assert.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
28 #include "ns3/pointer.h"
29 #include "ns3/boolean.h"
52 .AddConstructor<ApWifiMac> ()
53 .AddAttribute (
"BeaconInterval",
"Delay between two beacons",
58 .AddAttribute (
"BeaconJitter",
"A uniform random variable to cause the initial beacon starting time (after simulation time 0) to be distributed between 0 and the BeaconInterval.",
61 MakePointerChecker<UniformRandomVariable> ())
62 .AddAttribute (
"EnableBeaconJitter",
"If beacons are enabled, whether to jitter the initial send event.",
65 MakeBooleanChecker ())
66 .AddAttribute (
"BeaconGeneration",
"Whether or not beacons are generated.",
70 MakeBooleanChecker ())
149 m_beaconDca->SetWifiRemoteStationManager (stationManager);
171 NS_LOG_WARN (
"beacon interval should be multiple of 1024us, see IEEE Std. 802.11-2007, section 11.1.1.1");
221 NS_LOG_FUNCTION (
this << packet << from << to << static_cast<uint32_t> (tid));
262 m_dca->Queue (packet, hdr);
366 m_dca->Queue (packet, hdr);
392 assoc.SetStatusCode (code);
405 m_dca->Queue (packet, hdr);
504 NS_LOG_DEBUG (
"forwarding frame from=" << from <<
", to=" << to);
540 else if (hdr->
IsMgt ())
557 bool problem =
false;
642 i != packets.end (); ++i)
644 if ((*i).second.GetDestinationAddr () ==
GetAddress ())
646 ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
647 (*i).second.GetDestinationAddr ());
653 NS_LOG_DEBUG (
"forwarding QoS frame from=" << from <<
", to=" << to);
670 NS_LOG_DEBUG (
"Scheduling initial beacon for access point " <<
GetAddress() <<
" at time " << jitter <<
" microseconds");
virtual void DoInitialize(void)
uint32_t RemoveHeader(Header &header)
void SetBeaconInterval(Time interval)
void AddSupportedRate(uint32_t bs)
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
HtCapabilities GetHtCapabilities(void) const
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
void SetGreenfield(uint8_t greenfield)
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
hold variables of type string
void SetHtSupported(uint8_t htsupported)
int64_t AssignStreams(int64_t stream)
virtual uint32_t GetNModes(void) const =0
void SetRxMcsBitmask(uint8_t index)
virtual uint8_t GetNMcs(void) const =0
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
The Ht Capabilities Information ElementThis class knows how to serialise and deserialise the Ht Capab...
uint32_t GetSize(void) const
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
bool IsBroadcast(void) const
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
void NotifyRxDrop(Ptr< const Packet > packet)
virtual bool GetLdpc(void) const =0
virtual uint8_t GetMcs(uint8_t mcs) const =0
void SendAssocResp(Mac48Address to, bool success)
virtual bool SupportsSendFrom(void) const
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Ptr< DcaTxop > m_beaconDca
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...
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
bool m_enableBeaconGeneration
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
virtual void SetBssid(Mac48Address bssid)
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
void SetTypeOfStation(TypeOfStation type)
int64_t GetMicroSeconds(void) const
void SetShortGuardInterval20(uint8_t shortguardinterval)
hold objects of type ns3::Time
static TypeId GetTypeId(void)
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
AcIndex QosUtilsMapTidToAc(uint8_t tid)
virtual void SetAddress(Mac48Address address)
static Mac48Address GetBroadcast(void)
bool IsSupportedMcs(uint8_t mcs)
virtual bool GetGuardInterval(void) const =0
virtual uint32_t GetNBssMembershipSelectors(void) const =0
void SetBasicRate(uint32_t bs)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
Ptr< Packet > Copy(void) const
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void SetLinkUpCallback(Callback< void > linkUp)
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
DcfManager * m_dcfManager
virtual WifiMode GetMode(uint32_t mode) const =0
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
bool GetBeaconGeneration(void) const
void SendProbeResp(Mac48Address to)
SupportedRates GetSupportedRates(void) const
virtual void TxFailed(const WifiMacHeader &hdr)
virtual void DoDispose(void)
virtual void SetAddress(Mac48Address address)
#define NS_LOG_DEBUG(msg)
virtual Mac48Address GetAddress(void) const
Ptr< UniformRandomVariable > m_beaconJitter
virtual void DoInitialize()
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.
bool m_enableBeaconJitter
Time GetBeaconInterval(void) const
virtual void TxOk(const WifiMacHeader &hdr)
virtual void TxOk(const WifiMacHeader &hdr)
Ptr< WifiRemoteStationManager > m_stationManager
a unique identifier for an interface.
uint64_t GetDataRate(void) const
TypeId SetParent(TypeId tid)
void StartBeaconing(void)
virtual bool GetGreenfield(void) const =0
void AddHeader(const Header &header)
void SetBeaconGeneration(bool enable)
virtual void TxFailed(const WifiMacHeader &hdr)