A Discrete-Event Network Simulator
API
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 "dsss-parameter-set.h"
34 #include "erp-information.h"
35 #include "edca-parameter-set.h"
36 #include "ns3/random-variable-stream.h"
37 
38 namespace ns3 {
39 
47 class ApWifiMac : public RegularWifiMac
48 {
49 public:
50  static TypeId GetTypeId (void);
51 
52  ApWifiMac ();
53  virtual ~ApWifiMac ();
54 
58  virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
59 
63  virtual void SetLinkUpCallback (Callback<void> linkUp);
64 
73  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
74 
86  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
87 
88  virtual bool SupportsSendFrom (void) const;
89 
93  virtual void SetAddress (Mac48Address address);
97  void SetBeaconInterval (Time interval);
101  Time GetBeaconInterval (void) const;
105  void StartBeaconing (void);
112  bool GetShortSlotTimeEnabled (void) const;
118  bool GetShortPreambleEnabled (void) const;
119 
129  int64_t AssignStreams (int64_t stream);
130 
131 
132 private:
133  virtual void Receive (Ptr<Packet> packet, const WifiMacHeader *hdr);
142  virtual void TxOk (const WifiMacHeader &hdr);
151  virtual void TxFailed (const WifiMacHeader &hdr);
152 
162  virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
163  const WifiMacHeader *hdr);
172  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
181  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
188  void SendProbeResp (Mac48Address to);
196  void SendAssocResp (Mac48Address to, bool success);
200  void SendOneBeacon (void);
212  ErpInformation GetErpInformation (void) const;
224  HtOperations GetHtOperations (void) const;
231  SupportedRates GetSupportedRates (void) const;
243  void SetBeaconGeneration (bool enable);
249  bool GetBeaconGeneration (void) const;
256  bool GetUseNonErpProtection (void) const;
257 
258  virtual void DoDispose (void);
259  virtual void DoInitialize (void);
260 
267  std::list<Mac48Address> m_staList;
268  std::list<Mac48Address> m_nonErpStations;
269  std::list<Mac48Address> m_nonHtStations;
271 };
272 
273 } //namespace ns3
274 
275 #endif /* AP_WIFI_MAC_H */
HtOperations GetHtOperations(void) const
Return the HT operations of the current AP.
Definition: ap-wifi-mac.cc:480
virtual void DoInitialize(void)
Initialize() implementation.
Definition: ap-wifi-mac.cc:996
The HT Operations Information ElementThis class knows how to serialise and deserialise the HT Operati...
Definition: ht-operations.h:54
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set of the current AP.
Definition: ap-wifi-mac.cc:435
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:179
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:197
DsssParameterSet GetDsssParameterSet(void) const
Return the DSSS Parameter Set that we support.
Definition: ap-wifi-mac.cc:393
void SendAssocResp(Mac48Address to, bool success)
Forward an association response packet to the DCF.
Definition: ap-wifi-mac.cc:549
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:339
Ptr< DcaTxop > m_beaconDca
Dedicated DcaTxop for beacons.
Definition: ap-wifi-mac.h:261
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.
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Definition: ap-wifi-mac.h:263
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:329
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:159
base class for all MAC-level wifi objects.
static TypeId GetTypeId(void)
Definition: ap-wifi-mac.cc:46
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:243
bool GetShortPreambleEnabled(void) const
Determine whether short preamble should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:226
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:270
EventId m_beaconEvent
Event to generate one beacon.
Definition: ap-wifi-mac.h:264
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:695
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:970
std::list< Mac48Address > m_staList
List of all stations currently associated to the AP.
Definition: ap-wifi-mac.h:267
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:167
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The EDCA Parameter SetThis class knows how to serialise and deserialise the EDCA Parameter Set...
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:145
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:47
void SendProbeResp(Mac48Address to)
Forward a probe response packet to the DCF.
Definition: ap-wifi-mac.cc:499
The DSSS Parameter SetThis class knows how to serialise and deserialise the DSSS Parameter Set...
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates...
Definition: ap-wifi-mac.cc:346
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:681
void SendOneBeacon(void)
Forward a beacon packet to the beacon special DCF.
Definition: ap-wifi-mac.cc:602
An identifier for simulation events.
Definition: event-id.h:53
virtual void DoDispose(void)
Destructor implementation.
Definition: ap-wifi-mac.cc:110
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:120
ErpInformation GetErpInformation(void) const
Return the ERP information of the current AP.
Definition: ap-wifi-mac.cc:414
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:265
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current AP.
Definition: ap-wifi-mac.cc:405
Time m_beaconInterval
Interval between beacons.
Definition: ap-wifi-mac.h:262
std::list< Mac48Address > m_nonErpStations
List of all non-ERP stations currently associated to the AP.
Definition: ap-wifi-mac.h:268
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:101
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:266
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:152
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:667
std::list< Mac48Address > m_nonHtStations
List of all non-HT stations currently associated to the AP.
Definition: ap-wifi-mac.h:269
bool GetShortSlotTimeEnabled(void) const
Determine whether short slot time should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:205
a unique identifier for an interface.
Definition: type-id.h:58
void StartBeaconing(void)
Start beacon transmission immediately.
Definition: ap-wifi-mac.cc:190
Implements the IEEE 802.11 MAC header.
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:130