OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006, 2009 INRIA | 3 * Copyright (c) 2006, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 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 | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. | 13 * GNU General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License | 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 | 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 | 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 * | 18 * |
19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
20 * Mirko Banchi <mk.banchi@gmail.com> | 20 * Mirko Banchi <mk.banchi@gmail.com> |
21 */ | 21 */ |
22 | 22 |
23 #ifndef AP_WIFI_MAC_H | 23 #ifndef AP_WIFI_MAC_H |
24 #define AP_WIFI_MAC_H | 24 #define AP_WIFI_MAC_H |
25 | 25 |
26 #include "regular-wifi-mac.h" | 26 #include "infrastructure-wifi-mac.h" |
27 #include "capability-information.h" | 27 #include "capability-information.h" |
28 #include "supported-rates.h" | 28 #include "supported-rates.h" |
29 #include "dsss-parameter-set.h" | 29 #include "dsss-parameter-set.h" |
30 #include "erp-information.h" | 30 #include "erp-information.h" |
31 #include "edca-parameter-set.h" | 31 #include "edca-parameter-set.h" |
| 32 #include "cf-parameter-set.h" |
32 #include "ns3/random-variable-stream.h" | 33 #include "ns3/random-variable-stream.h" |
33 | 34 |
34 namespace ns3 { | 35 namespace ns3 { |
35 | 36 |
36 /** | 37 /** |
37 * \brief Wi-Fi AP state machine | 38 * \brief Wi-Fi AP state machine |
38 * \ingroup wifi | 39 * \ingroup wifi |
39 * | 40 * |
40 * Handle association, dis-association and authentication, | 41 * Handle association, dis-association and authentication, |
41 * of STAs within an infrastructure BSS. | 42 * of STAs within an infrastructure BSS. |
42 */ | 43 */ |
43 class ApWifiMac : public RegularWifiMac | 44 class ApWifiMac : public InfrastructureWifiMac |
44 { | 45 { |
45 public: | 46 public: |
46 /** | 47 /** |
47 * \brief Get the type ID. | 48 * \brief Get the type ID. |
48 * \return the object TypeId | 49 * \return the object TypeId |
49 */ | 50 */ |
50 static TypeId GetTypeId (void); | 51 static TypeId GetTypeId (void); |
51 | 52 |
52 ApWifiMac (); | 53 ApWifiMac (); |
53 virtual ~ApWifiMac (); | 54 virtual ~ApWifiMac (); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void SetAddress (Mac48Address address); | 94 void SetAddress (Mac48Address address); |
94 /** | 95 /** |
95 * \param interval the interval between two beacon transmissions. | 96 * \param interval the interval between two beacon transmissions. |
96 */ | 97 */ |
97 void SetBeaconInterval (Time interval); | 98 void SetBeaconInterval (Time interval); |
98 /** | 99 /** |
99 * \return the interval between two beacon transmissions. | 100 * \return the interval between two beacon transmissions. |
100 */ | 101 */ |
101 Time GetBeaconInterval (void) const; | 102 Time GetBeaconInterval (void) const; |
102 /** | 103 /** |
| 104 * \param duration the maximum duration for the CF period. |
| 105 */ |
| 106 void SetCfpMaxDuration (Time duration); |
| 107 /** |
| 108 * \return the maximum duration for the CF period. |
| 109 */ |
| 110 Time GetCfpMaxDuration (void) const; |
| 111 /** |
103 * Determine whether short slot time should be enabled or not in the BSS. | 112 * Determine whether short slot time should be enabled or not in the BSS. |
104 * Typically, true is returned only when there is no non-erp stations associat
ed | 113 * Typically, true is returned only when there is no non-erp stations associat
ed |
105 * to the AP, and that short slot time is supported by the AP and by all other | 114 * to the AP, and that short slot time is supported by the AP and by all other |
106 * ERP stations that are associated to the AP. Otherwise, false is returned. | 115 * ERP stations that are associated to the AP. Otherwise, false is returned. |
107 * | 116 * |
108 * \returns whether short slot time should be enabled or not in the BSS. | 117 * \returns whether short slot time should be enabled or not in the BSS. |
109 */ | 118 */ |
110 bool GetShortSlotTimeEnabled (void) const; | 119 bool GetShortSlotTimeEnabled (void) const; |
111 /** | 120 /** |
112 * Determine whether short preamble should be enabled or not in the BSS. | 121 * Determine whether short preamble should be enabled or not in the BSS. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 * \param to the address of the STA we are sending an association response to | 215 * \param to the address of the STA we are sending an association response to |
207 * \param success indicates whether the association was successful or not | 216 * \param success indicates whether the association was successful or not |
208 * \param isReassoc indicates whether it is a reassociation response | 217 * \param isReassoc indicates whether it is a reassociation response |
209 */ | 218 */ |
210 void SendAssocResp (Mac48Address to, bool success, bool isReassoc); | 219 void SendAssocResp (Mac48Address to, bool success, bool isReassoc); |
211 /** | 220 /** |
212 * Forward a beacon packet to the beacon special DCF. | 221 * Forward a beacon packet to the beacon special DCF. |
213 */ | 222 */ |
214 void SendOneBeacon (void); | 223 void SendOneBeacon (void); |
215 /** | 224 /** |
| 225 * Determine what is the next PCF frame and trigger its transmission. |
| 226 */ |
| 227 void SendNextCfFrame (void); |
| 228 /** |
| 229 * Send a CF-Poll packet to the next polling STA. |
| 230 */ |
| 231 void SendCfPoll (void); |
| 232 /** |
| 233 * Send a CF-End packet. |
| 234 */ |
| 235 void SendCfEnd (void); |
| 236 |
| 237 /** |
216 * Return the Capability information of the current AP. | 238 * Return the Capability information of the current AP. |
217 * | 239 * |
218 * \return the Capability information that we support | 240 * \return the Capability information that we support |
219 */ | 241 */ |
220 CapabilityInformation GetCapabilities (void) const; | 242 CapabilityInformation GetCapabilities (void) const; |
221 /** | 243 /** |
222 * Return the ERP information of the current AP. | 244 * Return the ERP information of the current AP. |
223 * | 245 * |
224 * \return the ERP information that we support | 246 * \return the ERP information that we support |
225 */ | 247 */ |
226 ErpInformation GetErpInformation (void) const; | 248 ErpInformation GetErpInformation (void) const; |
227 /** | 249 /** |
228 * Return the EDCA Parameter Set of the current AP. | 250 * Return the EDCA Parameter Set of the current AP. |
229 * | 251 * |
230 * \return the EDCA Parameter Set that we support | 252 * \return the EDCA Parameter Set that we support |
231 */ | 253 */ |
232 EdcaParameterSet GetEdcaParameterSet (void) const; | 254 EdcaParameterSet GetEdcaParameterSet (void) const; |
233 /** | 255 /** |
| 256 * Return the CF parameter set of the current AP. |
| 257 * |
| 258 * \return the CF parameter set that we support |
| 259 */ |
| 260 CfParameterSet GetCfParameterSet (void) const; |
| 261 /** |
234 * Return the HT operation of the current AP. | 262 * Return the HT operation of the current AP. |
235 * | 263 * |
236 * \return the HT operation that we support | 264 * \return the HT operation that we support |
237 */ | 265 */ |
238 HtOperation GetHtOperation (void) const; | 266 HtOperation GetHtOperation (void) const; |
239 /** | 267 /** |
240 * Return the VHT operation of the current AP. | 268 * Return the VHT operation of the current AP. |
241 * | 269 * |
242 * \return the VHT operation that we support | 270 * \return the VHT operation that we support |
243 */ | 271 */ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 * false otherwise | 308 * false otherwise |
281 */ | 309 */ |
282 bool GetUseNonErpProtection (void) const; | 310 bool GetUseNonErpProtection (void) const; |
283 /** | 311 /** |
284 * Return whether RIFS is allowed in the BSS. | 312 * Return whether RIFS is allowed in the BSS. |
285 * | 313 * |
286 * \return true if RIFS is allowed in the BSS, | 314 * \return true if RIFS is allowed in the BSS, |
287 * false otherwise | 315 * false otherwise |
288 */ | 316 */ |
289 bool GetRifsMode (void) const; | 317 bool GetRifsMode (void) const; |
| 318 /** |
| 319 * Increment the PCF polling list iterator to indicate |
| 320 * that the next polling station can be polled. |
| 321 */ |
| 322 void IncrementPollingListIterator (void); |
290 | 323 |
291 void DoDispose (void); | 324 void DoDispose (void); |
292 void DoInitialize (void); | 325 void DoInitialize (void); |
293 | 326 |
294 /** | 327 /** |
295 * \return the next Association ID to be allocated by the AP | 328 * \return the next Association ID to be allocated by the AP |
296 */ | 329 */ |
297 uint16_t GetNextAssociationId (void); | 330 uint16_t GetNextAssociationId (void); |
298 | 331 |
299 Ptr<DcaTxop> m_beaconDca; //!< Dedicated DcaTxop for beacons | 332 Ptr<Txop> m_beaconTxop; //!< Dedicated Txop for beacons |
300 Time m_beaconInterval; //!< Interval between beacons | |
301 bool m_enableBeaconGeneration; //!< Flag whether beacons are being
generated | 333 bool m_enableBeaconGeneration; //!< Flag whether beacons are being
generated |
302 EventId m_beaconEvent; //!< Event to generate one beacon | 334 EventId m_beaconEvent; //!< Event to generate one beacon |
| 335 EventId m_cfpEvent; //!< Event to generate one PCF fram
e |
303 Ptr<UniformRandomVariable> m_beaconJitter; //!< UniformRandomVariable used to
randomize the time of the first beacon | 336 Ptr<UniformRandomVariable> m_beaconJitter; //!< UniformRandomVariable used to
randomize the time of the first beacon |
304 bool m_enableBeaconJitter; //!< Flag whether the first beacon
should be generated at random time | 337 bool m_enableBeaconJitter; //!< Flag whether the first beacon
should be generated at random time |
305 std::map<uint16_t, Mac48Address> m_staList; //!< Map of all stations currently
associated to the AP with their association ID | 338 std::map<uint16_t, Mac48Address> m_staList; //!< Map of all stations currently
associated to the AP with their association ID |
306 std::list<Mac48Address> m_nonErpStations; //!< List of all non-ERP stations c
urrently associated to the AP | 339 std::list<Mac48Address> m_nonErpStations; //!< List of all non-ERP stations c
urrently associated to the AP |
307 std::list<Mac48Address> m_nonHtStations; //!< List of all non-HT stations cu
rrently associated to the AP | 340 std::list<Mac48Address> m_nonHtStations; //!< List of all non-HT stations cu
rrently associated to the AP |
| 341 std::list<Mac48Address> m_cfPollingList; //!< List of all PCF stations curre
ntly associated to the AP |
| 342 std::list<Mac48Address>::iterator m_itCfPollingList; //!< Iterator to the list
of all PCF stations currently associated to the AP |
308 bool m_enableNonErpProtection; //!< Flag whether protection mechan
ism is used or not when non-ERP STAs are present within the BSS | 343 bool m_enableNonErpProtection; //!< Flag whether protection mechan
ism is used or not when non-ERP STAs are present within the BSS |
309 bool m_disableRifs; //!< Flag whether to force RIFS to
be disabled within the BSS If non-HT STAs are detected | 344 bool m_disableRifs; //!< Flag whether to force RIFS to
be disabled within the BSS If non-HT STAs are detected |
310 }; | 345 }; |
311 | 346 |
312 } //namespace ns3 | 347 } //namespace ns3 |
313 | 348 |
314 #endif /* AP_WIFI_MAC_H */ | 349 #endif /* AP_WIFI_MAC_H */ |
OLD | NEW |