author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 9165 | 7b219a73b844 |
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; -*- */ |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
1912
028e1945d5b2
fix copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1911
diff
changeset
|
3 |
* Copyright (c) 2005,2006,2007 INRIA |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
d72388b06b22
add MacStations 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 |
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 |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
d72388b06b22
add MacStations 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, |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
d72388b06b22
add MacStations 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 |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
d72388b06b22
add MacStations 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 |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
d72388b06b22
add MacStations 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:
2508
diff
changeset
|
20 |
#ifndef WIFI_REMOTE_STATION_MANAGER_H |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
21 |
#define WIFI_REMOTE_STATION_MANAGER_H |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
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:
1913
diff
changeset
|
23 |
#include <vector> |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <utility> |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include "ns3/mac48-address.h" |
6065 | 26 |
#include "ns3/traced-callback.h" |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
27 |
#include "ns3/packet.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
28 |
#include "ns3/object.h" |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6065
diff
changeset
|
29 |
#include "ns3/nstime.h" |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
30 |
#include "wifi-mode.h" |
10139 | 31 |
#include "wifi-tx-vector.h" |
32 |
#include "ht-capabilities.h" |
|
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
|
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
namespace ns3 { |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
|
6339 | 36 |
struct WifiRemoteStation; |
37 |
struct WifiRemoteStationState; |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
38 |
class WifiPhy; |
6065 | 39 |
class WifiMacHeader; |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
|
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
41 |
/** |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
42 |
* \brief Tid independent remote station statistics |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
43 |
* |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
44 |
* Structure is similar to struct sta_info in Linux kernel (see |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
45 |
* net/mac80211/sta_info.h) |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
46 |
*/ |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
47 |
class WifiRemoteStationInfo |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
48 |
{ |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
49 |
public: |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
50 |
WifiRemoteStationInfo (); |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
51 |
/** |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
52 |
* \brief Updates average frame error rate when data or RTS |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
53 |
* was transmitted successfully. |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
54 |
* \param retryCounter is slrc or ssrc value at the moment of |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
55 |
* success transmission. |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
56 |
*/ |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
57 |
void NotifyTxSuccess (uint32_t retryCounter); |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
58 |
/// Updates average frame error rate when final data or RTS has failed. |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
59 |
void NotifyTxFailed (); |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
60 |
/// Returns frame error rate (probability that frame is corrupted due to transmission error). |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
61 |
double GetFrameErrorRate () const; |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
62 |
private: |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
63 |
/** |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
64 |
* \brief Calculate averaging coefficient for frame error rate. Depends on time of the last update. |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
65 |
* \attention Calling this method twice gives different results, |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
66 |
* because it resets time of last update. |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
67 |
*/ |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
68 |
double CalculateAveragingCoefficient (); |
7600
57ba46094a0d
fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
69 |
/// averaging coefficient depends on the memory time |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
70 |
Time m_memoryTime; |
7600
57ba46094a0d
fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
71 |
/// when last update has occured |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
72 |
Time m_lastUpdate; |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
73 |
/// moving percentage of failed frames |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
74 |
double m_failAvg; |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
75 |
}; |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
76 |
|
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
77 |
/** |
7600
57ba46094a0d
fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
78 |
* \ingroup wifi |
3154 | 79 |
* \brief hold a list of per-remote-station state. |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
80 |
* |
3154 | 81 |
* \sa ns3::WifiRemoteStation. |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
82 |
*/ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
83 |
class WifiRemoteStationManager : public Object |
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:
1913
diff
changeset
|
84 |
{ |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
85 |
public: |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
86 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
87 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
88 |
WifiRemoteStationManager (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
89 |
virtual ~WifiRemoteStationManager (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
90 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
91 |
virtual void SetupPhy (Ptr<WifiPhy> phy); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
92 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
93 |
uint32_t GetMaxSsrc (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
94 |
uint32_t GetMaxSlrc (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
95 |
uint32_t GetRtsCtsThreshold (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
96 |
uint32_t GetFragmentationThreshold (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
97 |
void SetMaxSsrc (uint32_t maxSsrc); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
98 |
void SetMaxSlrc (uint32_t maxSlrc); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
99 |
void SetRtsCtsThreshold (uint32_t threshold); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
100 |
void SetFragmentationThreshold (uint32_t threshold); |
10139 | 101 |
void AddStationHtCapabilities (Mac48Address from,HtCapabilities htcapabilities); |
102 |
void SetHtSupported (bool enable); |
|
103 |
bool HasHtSupported (void) const; |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
104 |
|
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:
1913
diff
changeset
|
105 |
// Invoked in a STA upon dis-association |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
106 |
// or in an AP upon reboot |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
107 |
void Reset (void); |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
108 |
// Invoked in a STA upon association to store |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
109 |
// the set of rates which belong to the |
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:
1913
diff
changeset
|
110 |
// BSSBasicRateSet of the associated AP |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
111 |
// and which are supported locally. |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
112 |
// Invoked in an AP to configure the BSSBasicRateSet |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
113 |
void AddBasicMode (WifiMode mode); |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
114 |
|
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
115 |
WifiMode GetDefaultMode (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
116 |
uint32_t GetNBasicModes (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
117 |
WifiMode GetBasicMode (uint32_t i) const; |
10139 | 118 |
bool GetGreenfieldSupported (Mac48Address address) const; |
119 |
void AddBasicMcs (uint8_t mcs); |
|
120 |
||
121 |
uint8_t GetDefaultMcs (void) const; |
|
122 |
uint32_t GetNBasicMcs (void) const; |
|
123 |
uint8_t GetBasicMcs (uint32_t i) const; |
|
124 |
void AddSupportedMcs (Mac48Address address, uint8_t mcs); |
|
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:
1913
diff
changeset
|
125 |
|
4324
951aec5a7b9a
bug 531: Adds NonUnicastMode attribute to WifiRemoteStationManager
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
3745
diff
changeset
|
126 |
WifiMode GetNonUnicastMode (void) const; |
951aec5a7b9a
bug 531: Adds NonUnicastMode attribute to WifiRemoteStationManager
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
3745
diff
changeset
|
127 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
128 |
|
3154 | 129 |
/** |
130 |
* Invoked in an AP upon disassociation of a |
|
131 |
* specific STA. |
|
132 |
*/ |
|
6065 | 133 |
void Reset (Mac48Address address); |
3154 | 134 |
/** |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
135 |
* Invoked in a STA or AP to store the set of |
3154 | 136 |
* modes supported by a destination which is |
137 |
* also supported locally. |
|
138 |
* The set of supported modes includes |
|
139 |
* the BSSBasicRateSet. |
|
140 |
*/ |
|
6065 | 141 |
void AddSupportedMode (Mac48Address address, WifiMode mode); |
10139 | 142 |
//void AddBssMembershipParameters(Mac48Address address, uint32_t selector); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
143 |
|
6065 | 144 |
bool IsBrandNew (Mac48Address address) const; |
145 |
bool IsAssociated (Mac48Address address) const; |
|
146 |
bool IsWaitAssocTxOk (Mac48Address address) const; |
|
147 |
void RecordWaitAssocTxOk (Mac48Address address); |
|
148 |
void RecordGotAssocTxOk (Mac48Address address); |
|
149 |
void RecordGotAssocTxFailed (Mac48Address address); |
|
150 |
void RecordDisassociated (Mac48Address address); |
|
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
151 |
|
3154 | 152 |
/** |
6166 | 153 |
* \param address remote address |
154 |
* \param header MAC header |
|
3154 | 155 |
* \param packet the packet to queue |
156 |
* \param fullPacketSize the size of the packet after its 802.11 MAC header has been added. |
|
157 |
* |
|
158 |
* This method is typically invoked just before queuing a packet for transmission. |
|
159 |
* It is a no-op unless the IsLowLatency attribute of the attached ns3::WifiRemoteStationManager |
|
160 |
* is set to false, in which case, the tx parameters of the packet are calculated and stored in |
|
161 |
* the packet as a tag. These tx parameters are later retrieved from GetDadaMode and GetRtsMode. |
|
162 |
*/ |
|
6065 | 163 |
void PrepareForQueue (Mac48Address address, const WifiMacHeader *header, |
164 |
Ptr<const Packet> packet, uint32_t fullPacketSize); |
|
10139 | 165 |
|
3154 | 166 |
/** |
6166 | 167 |
* \param address remote address |
168 |
* \param header MAC header |
|
3154 | 169 |
* \param packet the packet to send |
170 |
* \param fullPacketSize the size of the packet after its 802.11 MAC header has been added. |
|
171 |
* \returns the transmission mode to use to send this packet |
|
172 |
*/ |
|
10139 | 173 |
WifiTxVector GetDataTxVector (Mac48Address address, const WifiMacHeader *header, |
6065 | 174 |
Ptr<const Packet> packet, uint32_t fullPacketSize); |
3154 | 175 |
/** |
6166 | 176 |
* \param address remote address |
177 |
* \param header MAC header |
|
3154 | 178 |
* \param packet the packet to send |
179 |
* \returns the transmission mode to use to send the RTS prior to the |
|
180 |
* transmission of the data packet itself. |
|
181 |
*/ |
|
10139 | 182 |
WifiTxVector GetRtsTxVector (Mac48Address address, const WifiMacHeader *header, |
183 |
Ptr<const Packet> packet); |
|
184 |
||
185 |
WifiTxVector GetCtsToSelfTxVector (const WifiMacHeader *header, |
|
6065 | 186 |
Ptr<const Packet> packet); |
10139 | 187 |
|
188 |
//Since CTS to Self parameters don't depened on the station it is implemented in wifiremote station manager |
|
189 |
WifiTxVector DoGetCtsToSelfTxVector (void); |
|
190 |
||
191 |
||
3154 | 192 |
/** |
193 |
* Should be invoked whenever the RtsTimeout associated to a transmission |
|
194 |
* attempt expires. |
|
195 |
*/ |
|
6065 | 196 |
void ReportRtsFailed (Mac48Address address, const WifiMacHeader *header); |
3154 | 197 |
/** |
198 |
* Should be invoked whenever the AckTimeout associated to a transmission |
|
199 |
* attempt expires. |
|
200 |
*/ |
|
6065 | 201 |
void ReportDataFailed (Mac48Address address, const WifiMacHeader *header); |
3154 | 202 |
/** |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
203 |
* Should be invoked whenever we receive the Cts associated to an RTS |
3154 | 204 |
* we just sent. |
205 |
*/ |
|
6065 | 206 |
void ReportRtsOk (Mac48Address address, const WifiMacHeader *header, |
207 |
double ctsSnr, WifiMode ctsMode, double rtsSnr); |
|
3154 | 208 |
/** |
209 |
* Should be invoked whenever we receive the Ack associated to a data packet |
|
210 |
* we just sent. |
|
211 |
*/ |
|
6065 | 212 |
void ReportDataOk (Mac48Address address, const WifiMacHeader *header, |
213 |
double ackSnr, WifiMode ackMode, double dataSnr); |
|
3154 | 214 |
/** |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
215 |
* Should be invoked after calling ReportRtsFailed if |
3154 | 216 |
* NeedRtsRetransmission returns false |
217 |
*/ |
|
6065 | 218 |
void ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header); |
3154 | 219 |
/** |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
220 |
* Should be invoked after calling ReportDataFailed if |
3154 | 221 |
* NeedDataRetransmission returns false |
222 |
*/ |
|
6065 | 223 |
void ReportFinalDataFailed (Mac48Address address, const WifiMacHeader *header); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
224 |
|
3154 | 225 |
/** |
6166 | 226 |
* \param address remote address |
227 |
* \param header MAC header |
|
3154 | 228 |
* \param rxSnr the snr of the packet received |
229 |
* \param txMode the transmission mode used for the packet received. |
|
230 |
* |
|
231 |
* Should be invoked whenever a packet is successfully received. |
|
232 |
*/ |
|
6065 | 233 |
void ReportRxOk (Mac48Address address, const WifiMacHeader *header, |
234 |
double rxSnr, WifiMode txMode); |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
235 |
|
3154 | 236 |
/** |
6166 | 237 |
* \param address remote address |
238 |
* \param header MAC header |
|
3154 | 239 |
* \param packet the packet to send |
240 |
* \returns true if we want to use an RTS/CTS handshake for this |
|
241 |
* packet before sending it, false otherwise. |
|
242 |
*/ |
|
6065 | 243 |
bool NeedRts (Mac48Address address, const WifiMacHeader *header, |
244 |
Ptr<const Packet> packet); |
|
10139 | 245 |
bool NeedCtsToSelf (WifiTxVector txVector); |
246 |
||
3154 | 247 |
/** |
6166 | 248 |
* \param address remote address |
249 |
* \param header MAC header |
|
3154 | 250 |
* \param packet the packet to send |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
251 |
* \returns true if we want to restart a failed RTS/CTS |
3154 | 252 |
* handshake, false otherwise. |
253 |
*/ |
|
6065 | 254 |
bool NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header, |
255 |
Ptr<const Packet> packet); |
|
3154 | 256 |
/** |
6166 | 257 |
* \param address remote address |
258 |
* \param header MAC header |
|
3154 | 259 |
* \param packet the packet to send |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
260 |
* \returns true if we want to resend a packet |
3154 | 261 |
* after a failed transmission attempt, false otherwise. |
262 |
*/ |
|
6065 | 263 |
bool NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header, |
264 |
Ptr<const Packet> packet); |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
265 |
|
3154 | 266 |
/** |
6166 | 267 |
* \param address remote address |
268 |
* \param header MAC header |
|
3185
c859e129a934
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3154
diff
changeset
|
269 |
* \param packet the packet to send |
3154 | 270 |
* \returns true if this packet should be fragmented, false otherwise. |
271 |
*/ |
|
6065 | 272 |
bool NeedFragmentation (Mac48Address address, const WifiMacHeader *header, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
273 |
Ptr<const Packet> packet); |
3154 | 274 |
/** |
6166 | 275 |
* \param address remote address |
276 |
* \param header MAC header |
|
3185
c859e129a934
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3154
diff
changeset
|
277 |
* \param packet the packet to send |
3154 | 278 |
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero). |
279 |
* \returns the size of the corresponding fragment. |
|
280 |
*/ |
|
6065 | 281 |
uint32_t GetFragmentSize (Mac48Address address, const WifiMacHeader *header, |
282 |
Ptr<const Packet> packet, uint32_t fragmentNumber); |
|
3154 | 283 |
/** |
6166 | 284 |
* \param address remote address |
285 |
* \param header MAC header |
|
3185
c859e129a934
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3154
diff
changeset
|
286 |
* \param packet the packet to send |
3154 | 287 |
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero). |
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3185
diff
changeset
|
288 |
* \returns the offset within the original packet where this fragment starts. |
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3185
diff
changeset
|
289 |
*/ |
6065 | 290 |
uint32_t GetFragmentOffset (Mac48Address address, const WifiMacHeader *header, |
291 |
Ptr<const Packet> packet, uint32_t fragmentNumber); |
|
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3185
diff
changeset
|
292 |
/** |
6166 | 293 |
* \param address remote address |
294 |
* \param header MAC header |
|
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3185
diff
changeset
|
295 |
* \param packet the packet to send |
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3185
diff
changeset
|
296 |
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero). |
3154 | 297 |
* \returns true if this is the last fragment, false otherwise. |
298 |
*/ |
|
6065 | 299 |
bool IsLastFragment (Mac48Address address, const WifiMacHeader *header, |
300 |
Ptr<const Packet> packet, uint32_t fragmentNumber); |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
301 |
|
3154 | 302 |
/** |
6166 | 303 |
* \param address remote address |
3154 | 304 |
* \param rtsMode the transmission mode used to send an RTS we just received |
305 |
* \returns the transmission mode to use for the CTS to complete the RTS/CTS |
|
306 |
* handshake. |
|
307 |
*/ |
|
10139 | 308 |
WifiTxVector GetCtsTxVector (Mac48Address address, WifiMode rtsMode); |
309 |
/** |
|
310 |
* \param address |
|
311 |
* \param dataMode the transmission mode used to send an ACK we just received |
|
312 |
* \returns the transmission mode to use for the ACK to complete the data/ACK |
|
313 |
* handshake. |
|
314 |
*/ |
|
315 |
WifiTxVector GetAckTxVector (Mac48Address address, WifiMode dataMode); |
|
3154 | 316 |
/** |
6166 | 317 |
* \param address |
3185
c859e129a934
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3154
diff
changeset
|
318 |
* \param dataMode the transmission mode used to send an ACK we just received |
3154 | 319 |
* \returns the transmission mode to use for the ACK to complete the data/ACK |
320 |
* handshake. |
|
321 |
*/ |
|
10139 | 322 |
WifiTxVector GetBlockAckTxVector (Mac48Address address, WifiMode dataMode); |
323 |
/** |
|
324 |
* \returns the default transmission power |
|
325 |
*/ |
|
326 |
uint8_t GetDefaultTxPowerLevel (void) const; |
|
327 |
/** |
|
328 |
* \param address of the remote station |
|
329 |
* \returns information regarding the remote station associated with the given address |
|
330 |
*/ |
|
331 |
WifiRemoteStationInfo GetInfo (Mac48Address address); |
|
332 |
/** |
|
333 |
* Set the default transmission power level |
|
334 |
*/ |
|
335 |
void SetDefaultTxPowerLevel (uint8_t txPower); |
|
336 |
/** |
|
337 |
* \returns the number of transmit antennas supported by the phy layer |
|
338 |
*/ |
|
339 |
uint32_t GetNumberOfTransmitAntennas (void); |
|
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
340 |
|
10139 | 341 |
protected: |
6065 | 342 |
virtual void DoDispose (void); |
343 |
// for convenience |
|
344 |
WifiMode GetSupported (const WifiRemoteStation *station, uint32_t i) const; |
|
345 |
uint32_t GetNSupported (const WifiRemoteStation *station) const; |
|
10139 | 346 |
uint8_t GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const; |
347 |
uint32_t GetNMcsSupported (const WifiRemoteStation *station) const; |
|
348 |
||
349 |
bool GetShortGuardInterval (const WifiRemoteStation *station) const; |
|
350 |
bool GetStbc (const WifiRemoteStation *station) const; |
|
351 |
bool GetGreenfield (const WifiRemoteStation *station) const; |
|
352 |
uint32_t GetNumberOfReceiveAntennas (const WifiRemoteStation *station) const; |
|
353 |
uint32_t GetNumberOfTransmitAntennas (const WifiRemoteStation *station) const; |
|
354 |
uint32_t GetLongRetryCount (const WifiRemoteStation *station) const; |
|
355 |
uint32_t GetShortRetryCount (const WifiRemoteStation *station) const; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
356 |
private: |
6065 | 357 |
/** |
358 |
* \param station the station with which we need to communicate |
|
359 |
* \param packet the packet to send |
|
360 |
* \param normally indicates whether the normal 802.11 rts enable mechanism would |
|
361 |
* request that the rts is sent or not. |
|
362 |
* \returns true if we want to use an RTS/CTS handshake for this |
|
363 |
* packet before sending it, false otherwise. |
|
364 |
* |
|
365 |
* Note: This method is called before a unicast packet is sent on the medium. |
|
366 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
367 |
virtual bool DoNeedRts (WifiRemoteStation *station, |
6065 | 368 |
Ptr<const Packet> packet, bool normally); |
369 |
/** |
|
370 |
* \param station the station with which we need to communicate |
|
371 |
* \param packet the packet to send |
|
372 |
* \param normally indicates whether the normal 802.11 rts enable mechanism would |
|
373 |
* request that the rts is retransmitted or not. |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
374 |
* \returns true if we want to restart a failed RTS/CTS |
6065 | 375 |
* handshake, false otherwise. |
376 |
* |
|
377 |
* Note: This method is called after an rts/cts handshake has been attempted |
|
378 |
* and has failed. |
|
379 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
380 |
virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station, |
6065 | 381 |
Ptr<const Packet> packet, bool normally); |
382 |
/** |
|
383 |
* \param station the station with which we need to communicate |
|
384 |
* \param packet the packet to send |
|
385 |
* \param normally indicates whether the normal 802.11 data retransmission mechanism |
|
386 |
* would request that the data is retransmitted or not. |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
387 |
* \returns true if we want to resend a packet |
6065 | 388 |
* after a failed transmission attempt, false otherwise. |
389 |
* |
|
390 |
* Note: This method is called after a unicast packet transmission has been attempted |
|
391 |
* and has failed. |
|
392 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
393 |
virtual bool DoNeedDataRetransmission (WifiRemoteStation *station, |
6065 | 394 |
Ptr<const Packet> packet, bool normally); |
395 |
||
396 |
/** |
|
397 |
* \param station the station with which we need to communicate |
|
398 |
* \param packet the packet to send |
|
399 |
* \param normally indicates whether the normal 802.11 data fragmentation mechanism |
|
400 |
* would request that the data packet is fragmented or not. |
|
401 |
* \returns true if this packet should be fragmented, false otherwise. |
|
402 |
* |
|
403 |
* Note: This method is called before sending a unicast packet. |
|
404 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
405 |
virtual bool DoNeedFragmentation (WifiRemoteStation *station, |
6065 | 406 |
Ptr<const Packet> packet, bool normally); |
407 |
/** |
|
408 |
* \returns whether this manager is a manager designed to work in low-latency |
|
409 |
* environments. |
|
410 |
* |
|
411 |
* Note: In this context, low vs high latency is defined in <i>IEEE 802.11 Rate Adaptation: |
|
412 |
* A Practical Approach</i>, by M. Lacage, M.H. Manshaei, and T. Turletti. |
|
413 |
*/ |
|
414 |
virtual bool IsLowLatency (void) const = 0; |
|
415 |
/** |
|
416 |
* \return a new station data structure |
|
417 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
418 |
virtual WifiRemoteStation* DoCreateStation (void) const = 0; |
10139 | 419 |
/** |
6065 | 420 |
* \param station the station with which we need to communicate |
421 |
* \param size size of the packet or fragment we want to send |
|
422 |
* \returns the transmission mode to use to send a packet to the station |
|
423 |
* |
|
424 |
* Note: This method is called before sending a unicast packet or a fragment |
|
425 |
* of a unicast packet to decide which transmission mode to use. |
|
426 |
*/ |
|
10139 | 427 |
virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, |
6065 | 428 |
uint32_t size) = 0; |
429 |
/** |
|
430 |
* \param station the station with which we need to communicate |
|
431 |
* \returns the transmission mode to use to send an rts to the station |
|
432 |
* |
|
433 |
* Note: This method is called before sending an rts to a station |
|
434 |
* to decide which transmission mode to use for the rts. |
|
435 |
*/ |
|
10139 | 436 |
virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) = 0; |
437 |
||
438 |
||
439 |
/** |
|
440 |
* \param address the address of the recipient of the CTS |
|
441 |
* \param ctsMode the mode to be used for the CTS |
|
442 |
* |
|
443 |
* \return the power level to be used to send the CTS |
|
444 |
*/ |
|
445 |
virtual uint8_t DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode); |
|
446 |
||
447 |
/** |
|
448 |
* \param address the address of the recipient of the ACK |
|
449 |
* \param ctsMode the mode to be used for the ACK |
|
450 |
* |
|
451 |
* \return the power level to be used to send the ACK |
|
452 |
*/ |
|
453 |
virtual uint8_t DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode); |
|
454 |
||
455 |
/** |
|
456 |
* \param address the address of the recipient of the Block ACK |
|
457 |
* \param ctsMode the mode to be used for the Block ACK |
|
458 |
* |
|
459 |
* \return the power level to be used to send the Block ACK |
|
460 |
*/ |
|
461 |
virtual uint8_t DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode); |
|
462 |
||
463 |
virtual bool DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode); |
|
464 |
||
465 |
virtual uint8_t DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode); |
|
466 |
virtual uint8_t DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode); |
|
467 |
virtual bool DoGetCtsTxStbc(Mac48Address address, WifiMode ctsMode); |
|
468 |
virtual bool DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode); |
|
469 |
virtual uint8_t DoGetAckTxNss(Mac48Address address, WifiMode ackMode); |
|
470 |
virtual uint8_t DoGetAckTxNess(Mac48Address address, WifiMode ackMode); |
|
471 |
virtual bool DoGetAckTxStbc(Mac48Address address, WifiMode ackMode); |
|
472 |
virtual bool DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode); |
|
473 |
virtual uint8_t DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode); |
|
474 |
virtual uint8_t DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode); |
|
475 |
virtual bool DoGetBlockAckTxStbc(Mac48Address address, WifiMode blockAckMode); |
|
476 |
||
6065 | 477 |
virtual void DoReportRtsFailed (WifiRemoteStation *station) = 0; |
478 |
virtual void DoReportDataFailed (WifiRemoteStation *station) = 0; |
|
479 |
virtual void DoReportRtsOk (WifiRemoteStation *station, |
|
480 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) = 0; |
|
481 |
virtual void DoReportDataOk (WifiRemoteStation *station, |
|
482 |
double ackSnr, WifiMode ackMode, double dataSnr) = 0; |
|
483 |
virtual void DoReportFinalRtsFailed (WifiRemoteStation *station) = 0; |
|
484 |
virtual void DoReportFinalDataFailed (WifiRemoteStation *station) = 0; |
|
485 |
virtual void DoReportRxOk (WifiRemoteStation *station, |
|
486 |
double rxSnr, WifiMode txMode) = 0; |
|
487 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
488 |
WifiRemoteStationState* LookupState (Mac48Address address) const; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
489 |
WifiRemoteStation* Lookup (Mac48Address address, uint8_t tid) const; |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
490 |
/// Find a remote station by its remote address and TID taken from MAC header |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
491 |
WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const; |
6065 | 492 |
WifiMode GetControlAnswerMode (Mac48Address address, WifiMode reqMode); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7600
diff
changeset
|
493 |
|
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7600
diff
changeset
|
494 |
void DoSetFragmentationThreshold (uint32_t threshold); |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7600
diff
changeset
|
495 |
uint32_t DoGetFragmentationThreshold (void) const; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7600
diff
changeset
|
496 |
uint32_t GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet); |
6065 | 497 |
|
498 |
typedef std::vector <WifiRemoteStation *> Stations; |
|
499 |
typedef std::vector <WifiRemoteStationState *> StationStates; |
|
500 |
||
501 |
StationStates m_states; |
|
502 |
Stations m_stations; |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
503 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
504 |
* This is a pointer to the WifiPhy associated with this |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
505 |
* WifiRemoteStationManager that is set on call to |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
506 |
* WifiRemoteStationManager::SetupPhy(). Through this pointer the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
507 |
* station manager can determine PHY characteristics, such as the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
508 |
* set of all transmission rates that may be supported (the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
509 |
* "DeviceRateSet"). |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
510 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
511 |
Ptr<WifiPhy> m_wifiPhy; |
6065 | 512 |
WifiMode m_defaultTxMode; |
10139 | 513 |
uint8_t m_defaultTxMcs; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
514 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
515 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
516 |
* This member is the list of WifiMode objects that comprise the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
517 |
* BSSBasicRateSet parameter. This list is constructed through calls |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
518 |
* to WifiRemoteStationManager::AddBasicMode(), and an API that |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
519 |
* allows external access to it is available through |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
520 |
* WifiRemoteStationManager::GetNBasicModes() and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
521 |
* WifiRemoteStationManager::GetBasicMode(). |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
522 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
523 |
WifiModeList m_bssBasicRateSet; |
10139 | 524 |
WifiMcsList m_bssBasicMcsSet; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
525 |
|
10139 | 526 |
bool m_htSupported; |
6065 | 527 |
bool m_isLowLatency; |
528 |
uint32_t m_maxSsrc; |
|
529 |
uint32_t m_maxSlrc; |
|
530 |
uint32_t m_rtsCtsThreshold; |
|
531 |
uint32_t m_fragmentationThreshold; |
|
10139 | 532 |
uint8_t m_defaultTxPowerLevel; |
6065 | 533 |
WifiMode m_nonUnicastMode; |
534 |
double m_avgSlrcCoefficient; |
|
535 |
/** |
|
536 |
* The trace source fired when the transmission of a single RTS has failed |
|
537 |
*/ |
|
538 |
TracedCallback<Mac48Address> m_macTxRtsFailed; |
|
539 |
/** |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
540 |
* The trace source fired when the transmission of a single data packet has failed |
6065 | 541 |
*/ |
542 |
TracedCallback<Mac48Address> m_macTxDataFailed; |
|
543 |
/** |
|
544 |
* The trace source fired when the transmission of a RTS has |
|
545 |
* exceeded the maximum number of attempts |
|
546 |
*/ |
|
547 |
TracedCallback<Mac48Address> m_macTxFinalRtsFailed; |
|
548 |
/** |
|
549 |
* The trace source fired when the transmission of a data packet has |
|
550 |
* exceeded the maximum number of attempts |
|
551 |
*/ |
|
552 |
TracedCallback<Mac48Address> m_macTxFinalDataFailed; |
|
553 |
||
554 |
}; |
|
555 |
||
556 |
struct WifiRemoteStationState |
|
557 |
{ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
558 |
enum |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
559 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
560 |
BRAND_NEW, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
561 |
DISASSOC, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
562 |
WAIT_ASSOC_TX_OK, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
563 |
GOT_ASSOC_TX_OK |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
564 |
} m_state; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
565 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
566 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
567 |
* This member is the list of WifiMode objects that comprise the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
568 |
* OperationalRateSet parameter for this remote station. This list |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
569 |
* is constructed through calls to |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
570 |
* WifiRemoteStationManager::AddSupportedMode(), and an API that |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
571 |
* allows external access to it is available through |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
572 |
* WifiRemoteStationManager::GetNSupported() and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
573 |
* WifiRemoteStationManager::GetSupported(). |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
574 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6339
diff
changeset
|
575 |
WifiModeList m_operationalRateSet; |
10139 | 576 |
WifiMcsList m_operationalMcsSet; |
4733
96a3881940c4
new trace sources for WifiRemoteStationManager
Nicola Baldo <nbaldo@cttc.es>
parents:
4692
diff
changeset
|
577 |
Mac48Address m_address; |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6065
diff
changeset
|
578 |
WifiRemoteStationInfo m_info; |
10139 | 579 |
bool m_shortGuardInterval; |
580 |
uint32_t m_rx; |
|
581 |
uint32_t m_tx; |
|
582 |
bool m_stbc; |
|
583 |
bool m_greenfield; |
|
584 |
||
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
585 |
}; |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
586 |
|
6065 | 587 |
/** |
588 |
* \brief hold per-remote-station state. |
|
589 |
* |
|
590 |
* The state in this class is used to keep track |
|
591 |
* of association status if we are in an infrastructure |
|
592 |
* network and to perform the selection of tx parameters |
|
593 |
* on a per-packet basis. |
|
594 |
*/ |
|
595 |
struct WifiRemoteStation |
|
596 |
{ |
|
6339 | 597 |
WifiRemoteStationState *m_state; |
6065 | 598 |
uint32_t m_ssrc; |
599 |
uint32_t m_slrc; |
|
600 |
uint8_t m_tid; |
|
601 |
}; |
|
602 |
||
603 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
604 |
} // namespace ns3 |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
605 |
|
6065 | 606 |
#endif /* WIFI_REMOTE_STATION_MANAGER_H */ |