|
|
| 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) 2005,2006,2007 INRIA |
3 |
* Copyright (c) 2005,2006,2007 INRIA |
|
|
4 |
* Copyright (c) 2009 MIRKO BANCHI |
| 4 |
* |
5 |
* |
| 5 |
* 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 |
| 6 |
* 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 |
|
|
| 16 |
* 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 |
| 17 |
* |
18 |
* |
| 18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
|
20 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
| 19 |
*/ |
21 |
*/ |
| 20 |
#ifndef WIFI_REMOTE_STATION_MANAGER_H |
22 |
#ifndef WIFI_REMOTE_STATION_MANAGER_H |
| 21 |
#define WIFI_REMOTE_STATION_MANAGER_H |
23 |
#define WIFI_REMOTE_STATION_MANAGER_H |
| 22 |
|
24 |
|
| 23 |
#include <vector> |
25 |
#include <vector> |
| 24 |
#include <utility> |
26 |
#include <utility> |
|
|
27 |
#include <map> |
| 25 |
#include "ns3/mac48-address.h" |
28 |
#include "ns3/mac48-address.h" |
| 26 |
#include "ns3/packet.h" |
29 |
#include "ns3/packet.h" |
| 27 |
#include "ns3/object.h" |
30 |
#include "ns3/object.h" |
| 28 |
#include "ns3/traced-value.h" |
31 |
#include "ns3/traced-value.h" |
|
|
32 |
#include "ns3/wifi-mac-header.h" |
| 29 |
#include "wifi-mode.h" |
33 |
#include "wifi-mode.h" |
|
|
34 |
#include "qos-utils.h" |
| 30 |
|
35 |
|
| 31 |
namespace ns3 { |
36 |
namespace ns3 { |
| 32 |
|
37 |
|
|
|
| 224 |
*/ |
229 |
*/ |
| 225 |
WifiMode GetRtsMode (Ptr<const Packet> packet); |
230 |
WifiMode GetRtsMode (Ptr<const Packet> packet); |
| 226 |
/** |
231 |
/** |
|
|
232 |
* \param ac Represents access class of the packet for which a rts was transmitted. |
| 233 |
* |
| 227 |
* Should be invoked whenever the RtsTimeout associated to a transmission |
234 |
* Should be invoked whenever the RtsTimeout associated to a transmission |
| 228 |
* attempt expires. |
235 |
* attempt expires. |
| 229 |
*/ |
236 |
*/ |
| 230 |
void ReportRtsFailed (void); |
237 |
void ReportRtsFailed (enum AccessClass ac = AC_BE_NQOS); |
| 231 |
/** |
238 |
/** |
|
|
239 |
* \param ac Access class which failed data belongs. |
| 240 |
* |
| 232 |
* Should be invoked whenever the AckTimeout associated to a transmission |
241 |
* Should be invoked whenever the AckTimeout associated to a transmission |
| 233 |
* attempt expires. |
242 |
* attempt expires. |
| 234 |
*/ |
243 |
*/ |
| 235 |
void ReportDataFailed (void); |
244 |
void ReportDataFailed (enum AccessClass ac = AC_BE_NQOS); |
| 236 |
/** |
245 |
/** |
|
|
246 |
* \param ac Represents access class of the packet for which the rts was transmitted. |
| 247 |
* |
| 237 |
* Should be invoked whenever we receive the Cts associated to an RTS |
248 |
* Should be invoked whenever we receive the Cts associated to an RTS |
| 238 |
* we just sent. |
249 |
* we just sent. |
| 239 |
*/ |
250 |
*/ |
| 240 |
void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr); |
251 |
void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr, enum AccessClass ac = AC_BE_NQOS); |
| 241 |
/** |
252 |
/** |
|
|
253 |
* \param ac Access class which correct received data belongs. |
| 254 |
* |
| 242 |
* Should be invoked whenever we receive the Ack associated to a data packet |
255 |
* Should be invoked whenever we receive the Ack associated to a data packet |
| 243 |
* we just sent. |
256 |
* we just sent. |
| 244 |
*/ |
257 |
*/ |
| 245 |
void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr); |
258 |
void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr, enum AccessClass ac = AC_BE_NQOS); |
| 246 |
/** |
259 |
/** |
|
|
260 |
* \param ac Represents access class of the packet for which a rts was transmitted. |
| 261 |
* |
| 247 |
* Should be invoked after calling ReportRtsFailed if |
262 |
* Should be invoked after calling ReportRtsFailed if |
| 248 |
* NeedRtsRetransmission returns false |
263 |
* NeedRtsRetransmission returns false |
| 249 |
*/ |
264 |
*/ |
| 250 |
void ReportFinalRtsFailed (void); |
265 |
void ReportFinalRtsFailed (enum AccessClass ac = AC_BE_NQOS); |
| 251 |
/** |
266 |
/** |
|
|
267 |
* \param ac Access class which failed data belongs. |
| 268 |
* |
| 252 |
* Should be invoked after calling ReportDataFailed if |
269 |
* Should be invoked after calling ReportDataFailed if |
| 253 |
* NeedDataRetransmission returns false |
270 |
* NeedDataRetransmission returns false |
| 254 |
*/ |
271 |
*/ |
| 255 |
void ReportFinalDataFailed (void); |
272 |
void ReportFinalDataFailed (enum AccessClass ac = AC_BE_NQOS); |
| 256 |
|
273 |
|
| 257 |
/** |
274 |
/** |
| 258 |
* \param rxSnr the snr of the packet received |
275 |
* \param rxSnr the snr of the packet received |
|
|
| 260 |
* |
277 |
* |
| 261 |
* Should be invoked whenever a packet is successfully received. |
278 |
* Should be invoked whenever a packet is successfully received. |
| 262 |
*/ |
279 |
*/ |
| 263 |
void ReportRxOk (double rxSnr, WifiMode txMode); |
280 |
void ReportRxOk (double rxSnr, WifiMode txMode, enum AccessClass ac = AC_BE_NQOS); |
| 264 |
|
281 |
|
| 265 |
/** |
282 |
/** |
| 266 |
* \param packet the packet to send |
283 |
* \param packet the packet to send |
|
|
| 269 |
*/ |
286 |
*/ |
| 270 |
virtual bool NeedRts (Ptr<const Packet> packet); |
287 |
virtual bool NeedRts (Ptr<const Packet> packet); |
| 271 |
/** |
288 |
/** |
| 272 |
* \param packet the packet to send |
289 |
* \param hdr the header of the packet to send |
| 273 |
* \returns true if we want to restart a failed RTS/CTS |
290 |
* \returns true if we want to restart a failed RTS/CTS |
| 274 |
* handshake, false otherwise. |
291 |
* handshake, false otherwise. |
| 275 |
*/ |
292 |
*/ |
| 276 |
virtual bool NeedRtsRetransmission (Ptr<const Packet> packet); |
293 |
virtual bool NeedRtsRetransmission (const WifiMacHeader *hdr); |
| 277 |
/** |
294 |
/** |
| 278 |
* \param packet the packet to send |
295 |
* \param hdr the header of the packet to send |
| 279 |
* \returns true if we want to resend a packet |
296 |
* \returns true if we want to resend a packet |
| 280 |
* after a failed transmission attempt, false otherwise. |
297 |
* after a failed transmission attempt, false otherwise. |
| 281 |
*/ |
298 |
*/ |
| 282 |
virtual bool NeedDataRetransmission (Ptr<const Packet> packet); |
299 |
virtual bool NeedDataRetransmission (const WifiMacHeader *hdr); |
| 283 |
|
300 |
|
| 284 |
/** |
301 |
/** |
| 285 |
* \param packet the packet to send |
302 |
* \param packet the packet to send |
|
|
| 361 |
SupportedModes m_modes; |
378 |
SupportedModes m_modes; |
| 362 |
TracedValue<uint32_t> m_ssrc; |
379 |
TracedValue<uint32_t> m_ssrc; |
| 363 |
TracedValue<uint32_t> m_slrc; |
380 |
TracedValue<uint32_t> m_slrc; |
|
|
381 |
std::map<AccessClass, TracedValue<uint32_t> > m_qosSsrc; |
| 382 |
std::map<AccessClass, TracedValue<uint32_t> > m_qosSlrc; |
| 364 |
double m_avgSlrcCoefficient; |
383 |
double m_avgSlrcCoefficient; |
| 365 |
double m_avgSlrc; |
384 |
double m_avgSlrc; |
| 366 |
Mac48Address m_address; |
385 |
Mac48Address m_address; |