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 "ht-capabilities.h"
28 #include "amsdu-subframe-header.h"
29 #include "supported-rates.h"
30 #include "ns3/random-variable-stream.h"
31 #include "vht-capabilities.h"
32 
33 namespace ns3 {
34 
42 class ApWifiMac : public RegularWifiMac
43 {
44 public:
45  static TypeId GetTypeId (void);
46 
47  ApWifiMac ();
48  virtual ~ApWifiMac ();
49 
53  virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
54 
58  virtual void SetLinkUpCallback (Callback<void> linkUp);
59 
68  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
69 
81  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
82 
83  virtual bool SupportsSendFrom (void) const;
84 
88  virtual void SetAddress (Mac48Address address);
92  void SetBeaconInterval (Time interval);
96  Time GetBeaconInterval (void) const;
100  void StartBeaconing (void);
101 
111  int64_t AssignStreams (int64_t stream);
112 
113 
114 private:
115  virtual void Receive (Ptr<Packet> packet, const WifiMacHeader *hdr);
124  virtual void TxOk (const WifiMacHeader &hdr);
133  virtual void TxFailed (const WifiMacHeader &hdr);
134 
144  virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
145  const WifiMacHeader *hdr);
154  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
163  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
170  void SendProbeResp (Mac48Address to);
178  void SendAssocResp (Mac48Address to, bool success);
182  void SendOneBeacon (void);
188  HtCapabilities GetHtCapabilities (void) const;
194  VhtCapabilities GetVhtCapabilities (void) const;
201  SupportedRates GetSupportedRates (void) const;
207  void SetBeaconGeneration (bool enable);
213  bool GetBeaconGeneration (void) const;
214 
215  virtual void DoDispose (void);
216  virtual void DoInitialize (void);
217 
224 };
225 
226 } //namespace ns3
227 
228 #endif /* AP_WIFI_MAC_H */
virtual void DoInitialize(void)
Initialize() implementation.
Definition: ap-wifi-mac.cc:765
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:168
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
HtCapabilities GetHtCapabilities(void) const
Return the HT capability of the current AP.
Definition: ap-wifi-mac.cc:338
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capability of the current AP.
Definition: ap-wifi-mac.cc:370
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:186
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
void SendAssocResp(Mac48Address to, bool success)
Forward an association response packet to the DCF.
Definition: ap-wifi-mac.cc:439
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:291
Ptr< DcaTxop > m_beaconDca
Dedicated DcaTxop for beacons.
Definition: ap-wifi-mac.h:218
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
bool m_enableBeaconGeneration
Flag if beacons are being generated.
Definition: ap-wifi-mac.h:220
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:281
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:148
base class for all MAC-level wifi objects.
The IEEE 802.11ac VHT Capabilities.
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:194
EventId m_beaconEvent
Event to generate one beacon.
Definition: ap-wifi-mac.h:221
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:542
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:739
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:156
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:134
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:42
void SendProbeResp(Mac48Address to)
Forward a probe response packet to the DCF.
Definition: ap-wifi-mac.cc:405
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates...
Definition: ap-wifi-mac.cc:298
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:528
void SendOneBeacon(void)
Forward a beacon packet to the beacon special DCF.
Definition: ap-wifi-mac.cc:482
An identifier for simulation events.
Definition: event-id.h:53
virtual void DoDispose(void)
Destructor implementation.
Definition: ap-wifi-mac.cc:99
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:109
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:222
Time m_beaconInterval
Interval between beacons.
Definition: ap-wifi-mac.h:219
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:93
bool m_enableBeaconJitter
Flag if the first beacon should be generated at random time.
Definition: ap-wifi-mac.h:223
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:141
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:514
a unique identifier for an interface.
Definition: type-id.h:58
void StartBeaconing(void)
Start beacon transmission immediately.
Definition: ap-wifi-mac.cc:179
Implements the IEEE 802.11 MAC header.
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:119