A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ap-wifi-mac.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #ifndef AP_WIFI_MAC_H
24 #define AP_WIFI_MAC_H
25 
26 #include "regular-wifi-mac.h"
27 #include "capability-information.h"
28 #include "ht-capabilities.h"
29 #include "ht-operations.h"
30 #include "vht-capabilities.h"
31 #include "amsdu-subframe-header.h"
32 #include "supported-rates.h"
33 #include "erp-information.h"
34 #include "ns3/random-variable-stream.h"
35 
36 namespace ns3 {
37 
45 class ApWifiMac : public RegularWifiMac
46 {
47 public:
48  static TypeId GetTypeId (void);
49 
50  ApWifiMac ();
51  virtual ~ApWifiMac ();
52 
56  virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
57 
61  virtual void SetLinkUpCallback (Callback<void> linkUp);
62 
71  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
72 
84  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
85 
86  virtual bool SupportsSendFrom (void) const;
87 
91  virtual void SetAddress (Mac48Address address);
95  void SetBeaconInterval (Time interval);
99  Time GetBeaconInterval (void) const;
103  void StartBeaconing (void);
110  bool GetShortSlotTimeEnabled (void) const;
116  bool GetShortPreambleEnabled (void) const;
117 
127  int64_t AssignStreams (int64_t stream);
128 
129 
130 private:
131  virtual void Receive (Ptr<Packet> packet, const WifiMacHeader *hdr);
140  virtual void TxOk (const WifiMacHeader &hdr);
149  virtual void TxFailed (const WifiMacHeader &hdr);
150 
160  virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
161  const WifiMacHeader *hdr);
170  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
179  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
186  void SendProbeResp (Mac48Address to);
194  void SendAssocResp (Mac48Address to, bool success);
198  void SendOneBeacon (void);
210  ErpInformation GetErpInformation (void) const;
216  HtOperations GetHtOperations (void) const;
223  SupportedRates GetSupportedRates (void) const;
229  void SetBeaconGeneration (bool enable);
235  bool GetBeaconGeneration (void) const;
242  bool GetUseNonErpProtection (void) const;
243 
244  virtual void DoDispose (void);
245  virtual void DoInitialize (void);
246 
253  std::list<Mac48Address> m_staList;
254  std::list<Mac48Address> m_nonErpStations;
255  std::list<Mac48Address> m_nonHtStations;
257 };
258 
259 } //namespace ns3
260 
261 #endif /* AP_WIFI_MAC_H */
HtOperations GetHtOperations(void) const
Return the HT operations of the current AP.
Definition: ap-wifi-mac.cc:425
virtual void DoInitialize(void)
Initialize() implementation.
Definition: ap-wifi-mac.cc:921
The HT Operations Information ElementThis class knows how to serialise and deserialise the HT Operati...
Definition: ht-operations.h:54
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:180
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: ap-wifi-mac.cc:198
void SendAssocResp(Mac48Address to, bool success)
Forward an association response packet to the DCF.
Definition: ap-wifi-mac.cc:486
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:341
Ptr< DcaTxop > m_beaconDca
Dedicated DcaTxop for beacons.
Definition: ap-wifi-mac.h:247
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Capability information.
bool GetUseNonErpProtection(void) const
Return whether protection for non-ERP stations is used in the BSS.
Definition: ap-wifi-mac.cc:944
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Definition: ap-wifi-mac.h:249
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:331
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:160
base class for all MAC-level wifi objects.
static TypeId GetTypeId(void)
Definition: ap-wifi-mac.cc:47
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet down to DCF/EDCAF (enqueue the packet).
Definition: ap-wifi-mac.cc:244
bool GetShortPreambleEnabled(void) const
Determine whether short preamble should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:227
bool m_enableNonErpProtection
Flag whether protection mechanism is used or not when non-ERP STAs are present within the BSS...
Definition: ap-wifi-mac.h:256
EventId m_beaconEvent
Event to generate one beacon.
Definition: ap-wifi-mac.h:250
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: ap-wifi-mac.cc:620
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
Definition: ap-wifi-mac.cc:895
std::list< Mac48Address > m_staList
List of all stations currently associated to the AP.
Definition: ap-wifi-mac.h:253
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:168
an EUI-48 address
Definition: mac48-address.h:43
bool GetBeaconGeneration(void) const
Return whether the AP is generating beacons.
Definition: ap-wifi-mac.cc:146
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:45
void SendProbeResp(Mac48Address to)
Forward a probe response packet to the DCF.
Definition: ap-wifi-mac.cc:444
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates...
Definition: ap-wifi-mac.cc:348
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:606
void SendOneBeacon(void)
Forward a beacon packet to the beacon special DCF.
Definition: ap-wifi-mac.cc:535
An identifier for simulation events.
Definition: event-id.h:53
virtual void DoDispose(void)
Destructor implementation.
Definition: ap-wifi-mac.cc:111
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:121
ErpInformation GetErpInformation(void) const
Return the ERP information of the current AP.
Definition: ap-wifi-mac.cc:404
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:251
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current AP.
Definition: ap-wifi-mac.cc:395
Time m_beaconInterval
Interval between beacons.
Definition: ap-wifi-mac.h:248
std::list< Mac48Address > m_nonErpStations
List of all non-ERP stations currently associated to the AP.
Definition: ap-wifi-mac.h:254
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:102
The ErpInformation Information ElementThis class knows how to serialise and deserialise the ErpInform...
bool m_enableBeaconJitter
Flag whether the first beacon should be generated at random time.
Definition: ap-wifi-mac.h:252
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:153
tuple address
Definition: first.py:37
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:592
std::list< Mac48Address > m_nonHtStations
List of all non-HT stations currently associated to the AP.
Definition: ap-wifi-mac.h:255
bool GetShortSlotTimeEnabled(void) const
Determine whether short slot time should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:206
a unique identifier for an interface.
Definition: type-id.h:58
void StartBeaconing(void)
Start beacon transmission immediately.
Definition: ap-wifi-mac.cc:191
Implements the IEEE 802.11 MAC header.
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:131