A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
minstrel-wifi-manager.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 Duy Nguyen
4
*
5
* 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
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Duy Nguyen <duy@soe.ucsc.edu>
19
*/
20
21
22
23
#ifndef MINSTREL_WIFI_MANAGER_H
24
#define MINSTREL_WIFI_MANAGER_H
25
26
#include "
wifi-remote-station-manager.h
"
27
#include "
wifi-mode.h
"
28
#include "ns3/nstime.h"
29
#include "ns3/random-variable-stream.h"
30
31
namespace
ns3 {
32
33
struct
MinstrelWifiRemoteStation;
34
38
struct
RateInfo
39
{
44
Time
perfectTxTime
;
45
46
47
uint32_t
retryCount
;
48
uint32_t
adjustedRetryCount
;
49
uint32_t
numRateAttempt
;
50
uint32_t
numRateSuccess
;
51
uint32_t
prob
;
52
57
uint32_t
ewmaProb
;
58
59
uint32_t
prevNumRateAttempt
;
60
uint32_t
prevNumRateSuccess
;
61
uint64_t
successHist
;
62
uint64_t
attemptHist
;
63
uint32_t
throughput
;
64
};
65
70
typedef
std::vector<struct RateInfo>
MinstrelRate
;
71
76
typedef
std::vector<std::vector<uint32_t> >
SampleRate
;
77
78
87
class
MinstrelWifiManager
:
public
WifiRemoteStationManager
88
{
89
90
public
:
91
static
TypeId
GetTypeId
(
void
);
92
MinstrelWifiManager
();
93
virtual
~MinstrelWifiManager
();
94
95
virtual
void
SetupPhy
(
Ptr<WifiPhy>
phy);
96
105
int64_t
AssignStreams
(int64_t stream);
106
107
private
:
108
// overriden from base class
109
virtual
WifiRemoteStation
*
DoCreateStation
(
void
)
const
;
110
virtual
void
DoReportRxOk
(
WifiRemoteStation
*station,
111
double
rxSnr,
WifiMode
txMode);
112
virtual
void
DoReportRtsFailed
(
WifiRemoteStation
*station);
113
virtual
void
DoReportDataFailed
(
WifiRemoteStation
*station);
114
virtual
void
DoReportRtsOk
(
WifiRemoteStation
*station,
115
double
ctsSnr,
WifiMode
ctsMode,
double
rtsSnr);
116
virtual
void
DoReportDataOk
(
WifiRemoteStation
*station,
117
double
ackSnr,
WifiMode
ackMode,
double
dataSnr);
118
virtual
void
DoReportFinalRtsFailed
(
WifiRemoteStation
*station);
119
virtual
void
DoReportFinalDataFailed
(
WifiRemoteStation
*station);
120
virtual
WifiMode
DoGetDataMode
(
WifiRemoteStation
*station, uint32_t size);
121
virtual
WifiMode
DoGetRtsMode
(
WifiRemoteStation
*station);
122
virtual
bool
IsLowLatency
(
void
)
const
;
123
125
Time
GetCalcTxTime
(
WifiMode
mode)
const
;
126
void
AddCalcTxTime
(
WifiMode
mode,
Time
t);
127
129
void
UpdateRetry
(
MinstrelWifiRemoteStation
*station);
130
132
uint32_t
GetNextSample
(
MinstrelWifiRemoteStation
*station);
133
135
uint32_t
FindRate
(
MinstrelWifiRemoteStation
*station);
136
138
void
UpdateStats
(
MinstrelWifiRemoteStation
*station);
139
141
void
RateInit
(
MinstrelWifiRemoteStation
*station);
142
144
void
InitSampleTable
(
MinstrelWifiRemoteStation
*station);
145
147
void
PrintSampleTable
(
MinstrelWifiRemoteStation
*station);
148
150
void
PrintTable
(
MinstrelWifiRemoteStation
*station);
151
152
void
CheckInit
(
MinstrelWifiRemoteStation
*station);
153
154
155
typedef
std::vector<std::pair<Time,WifiMode> >
TxTime
;
156
MinstrelRate
m_minstrelTable
;
157
SampleRate
m_sampleTable
;
158
159
160
TxTime
m_calcTxTime
;
161
Time
m_updateStats
;
162
double
m_lookAroundRate
;
163
double
m_ewmaLevel
;
164
uint32_t
m_segmentSize
;
165
uint32_t
m_sampleCol
;
166
uint32_t
m_pktLen
;
167
uint32_t
m_nsupported
;
168
170
Ptr<UniformRandomVariable>
m_uniformRandomVariable
;
171
};
172
173
}
// namespace ns3
174
175
#endif
/* MINSTREL_WIFI_MANAGER_H */
src
wifi
model
minstrel-wifi-manager.h
Generated on Fri Dec 21 2012 19:00:49 for ns-3 by
1.8.1.2