author | Pavel Boyko <boyko@iitp.ru> |
Tue, 16 Jun 2009 17:58:16 +0400 | |
changeset 5074 | 355de6af8ea9 |
parent 4340 | 8a1b890c99cc |
child 6065 | 0f012e7d9128 |
permissions | -rw-r--r-- |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
20 |
#ifndef ARF_WIFI_MANAGER_H |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
21 |
#define ARF_WIFI_MANAGER_H |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
23 |
#include "wifi-remote-station-manager.h" |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
namespace ns3 { |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
2059 | 27 |
/** |
28 |
* \brief ARF Rate control algorithm |
|
29 |
* |
|
30 |
* This class implements the so-called ARF algorithm which was |
|
31 |
* initially described in <i>WaveLAN-II: A High-performance wireless |
|
32 |
* LAN for the unlicensed band</i>, by A. Kamerman and L. Monteban. in |
|
33 |
* Bell Lab Technical Journal, pages 118-133, Summer 1997. |
|
34 |
* |
|
35 |
* This implementation differs from the initial description in that it |
|
36 |
* uses a packet-based timer rather than a time-based timer as described |
|
37 |
* in XXX (I cannot find back the original paper which described how |
|
38 |
* the time-based timer could be easily replaced with a packet-based |
|
39 |
* timer.) |
|
40 |
*/ |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
41 |
class ArfWifiManager : public WifiRemoteStationManager |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
42 |
{ |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
public: |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
44 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
45 |
ArfWifiManager (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
46 |
virtual ~ArfWifiManager (); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
private: |
4340 | 49 |
friend class ArfWifiRemoteStation; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
50 |
virtual class WifiRemoteStation *CreateStation (void); |
2004
59eb6fb7b722
control the rate control algorithms with default values.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1977
diff
changeset
|
51 |
uint32_t m_timerThreshold; |
59eb6fb7b722
control the rate control algorithms with default values.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1977
diff
changeset
|
52 |
uint32_t m_successThreshold; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
}; |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
56 |
class ArfWifiRemoteStation : public WifiRemoteStation |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
{ |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
public: |
4340 | 59 |
ArfWifiRemoteStation (Ptr<ArfWifiManager> manager); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
60 |
virtual ~ArfWifiRemoteStation (); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
62 |
protected: |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
63 |
virtual void DoReportRxOk (double rxSnr, WifiMode txMode); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
64 |
virtual void DoReportRtsFailed (void); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
65 |
virtual void DoReportDataFailed (void); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
66 |
virtual void DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
67 |
virtual void DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
68 |
virtual void DoReportFinalRtsFailed (void); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2524
diff
changeset
|
69 |
virtual void DoReportFinalDataFailed (void); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
71 |
private: |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
72 |
virtual Ptr<WifiRemoteStationManager> GetManager (void) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
73 |
virtual WifiMode DoGetDataMode (uint32_t size); |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
74 |
virtual WifiMode DoGetRtsMode (void); |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1921
diff
changeset
|
75 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
76 |
uint32_t m_timer; |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
77 |
uint32_t m_success; |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
78 |
uint32_t m_failed; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
79 |
bool m_recovery; |
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
80 |
uint32_t m_retry; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
81 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
82 |
uint32_t m_timerTimeout; |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
83 |
uint32_t m_successThreshold; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
84 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
85 |
uint32_t m_rate; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
86 |
|
4340 | 87 |
Ptr<ArfWifiManager> m_manager; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
88 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
89 |
private: |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1921
diff
changeset
|
90 |
// overriden by AarfMacStation. |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
91 |
virtual void ReportRecoveryFailure (void); |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
92 |
virtual void ReportFailure (void); |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
93 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
94 |
uint32_t GetMaxRate (void); |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
95 |
uint32_t GetMinRate (void); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
96 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
97 |
bool NeedRecoveryFallback (void); |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
98 |
bool NeedNormalFallback (void); |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
99 |
|
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
100 |
protected: |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1921
diff
changeset
|
101 |
// called by AarfMacStation. |
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
102 |
uint32_t GetMinTimerTimeout (void); |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
103 |
uint32_t GetMinSuccessThreshold (void); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
104 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
105 |
uint32_t GetTimerTimeout (void); |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
106 |
uint32_t GetSuccessThreshold (void); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
107 |
|
2005
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
108 |
void SetTimerTimeout (uint32_t timerTimeout); |
c15d40b835b5
convert int to uint32_t
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
109 |
void SetSuccessThreshold (uint32_t successThreshold); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
110 |
}; |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
|
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1930
diff
changeset
|
112 |
} // namespace ns3 |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
113 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2269
diff
changeset
|
114 |
#endif /* ARF_WIFI_MANAGER_H */ |