author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 7385 | 10beb0e53130 |
child 10218 | 97da49da2d6c |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7141
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
4334
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
2 |
/* |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
4 |
* |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
4334
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
8 |
* |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
13 |
* |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
17 |
* |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
18 |
* Author: Federico Maguolo <maguolof@dei.unipd.it> |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
19 |
*/ |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
20 |
#ifndef AARFCD_WIFI_MANAGER_H |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
21 |
#define AARFCD_WIFI_MANAGER_H |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
22 |
|
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
23 |
#include "wifi-remote-station-manager.h" |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
24 |
|
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
25 |
namespace ns3 { |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
26 |
|
6340 | 27 |
struct AarfcdWifiRemoteStation; |
6065 | 28 |
|
4339
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
29 |
/** |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
30 |
* \brief an implementation of the AARF-CD algorithm |
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
31 |
* \ingroup wifi |
4339
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
32 |
* |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
33 |
* This algorithm was first described in "Efficient Collision Detection for Auto Rate Fallback Algorithm". |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
34 |
* The implementation available here was done by Federico Maguolo for a very early development |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
35 |
* version of ns-3. Federico died before merging this work in ns-3 itself so his code was ported |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
36 |
* to ns-3 later without his supervision. |
dd889b47f446
add reference to paper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4338
diff
changeset
|
37 |
*/ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
38 |
class AarfcdWifiManager : public WifiRemoteStationManager |
4334
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
39 |
{ |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
40 |
public: |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
41 |
static TypeId GetTypeId (void); |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
42 |
AarfcdWifiManager (); |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
43 |
virtual ~AarfcdWifiManager (); |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
44 |
|
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
45 |
private: |
6065 | 46 |
// overriden from base class |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
47 |
virtual WifiRemoteStation * DoCreateStation (void) const; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
48 |
virtual void DoReportRxOk (WifiRemoteStation *station, |
6065 | 49 |
double rxSnr, WifiMode txMode); |
50 |
virtual void DoReportRtsFailed (WifiRemoteStation *station); |
|
51 |
virtual void DoReportDataFailed (WifiRemoteStation *station); |
|
52 |
virtual void DoReportRtsOk (WifiRemoteStation *station, |
|
53 |
double ctsSnr, WifiMode ctsMode, double rtsSnr); |
|
54 |
virtual void DoReportDataOk (WifiRemoteStation *station, |
|
55 |
double ackSnr, WifiMode ackMode, double dataSnr); |
|
56 |
virtual void DoReportFinalRtsFailed (WifiRemoteStation *station); |
|
57 |
virtual void DoReportFinalDataFailed (WifiRemoteStation *station); |
|
10139 | 58 |
virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint32_t size); |
59 |
virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
60 |
virtual bool DoNeedRts (WifiRemoteStation *station, |
6065 | 61 |
Ptr<const Packet> packet, bool normally); |
62 |
virtual bool IsLowLatency (void) const; |
|
63 |
||
64 |
void CheckRts (AarfcdWifiRemoteStation *station); |
|
65 |
void IncreaseRtsWnd (AarfcdWifiRemoteStation *station); |
|
66 |
void ResetRtsWnd (AarfcdWifiRemoteStation *station); |
|
67 |
void TurnOffRts (AarfcdWifiRemoteStation *station); |
|
68 |
void TurnOnRts (AarfcdWifiRemoteStation *station); |
|
69 |
||
70 |
// aarf fields below |
|
4334
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
71 |
uint32_t m_minTimerThreshold; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
72 |
uint32_t m_minSuccessThreshold; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
73 |
double m_successK; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
74 |
uint32_t m_maxSuccessThreshold; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
75 |
double m_timerK; |
6065 | 76 |
|
77 |
// aarf-cd fields below |
|
4334
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
78 |
uint32_t m_minRtsWnd; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
79 |
uint32_t m_maxRtsWnd; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
80 |
bool m_rtsFailsAsDataFails; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
81 |
bool m_turnOffRtsAfterRateDecrease; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
82 |
bool m_turnOnRtsAfterRateIncrease; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
83 |
}; |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
84 |
|
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
85 |
} // namespace ns3 |
12b3fcf84fc5
bug 536: aarf-cd rate control
Federico Maguolo <maguolof@dei.unipd.it>
parents:
diff
changeset
|
86 |
|
6065 | 87 |
#endif /* AARFCD_WIFI_MANAGER_H */ |