author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 06 Jan 2010 16:26:07 +0100 | |
changeset 6065 | 0f012e7d9128 |
parent 5166 | 9d48acef10b3 |
child 6067 | ccbdc2b19ea5 |
permissions | -rw-r--r-- |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
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 |
d72388b06b22
add MacStations 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 |
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 |
*/ |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
21 |
#include "wifi-remote-station-manager.h" |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
22 |
#include "ns3/assert.h" |
1980
3fa3bac40b5b
add asserts and some debug log
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1975
diff
changeset
|
23 |
#include "ns3/log.h" |
3041
a624276a897b
mtag -> tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3040
diff
changeset
|
24 |
#include "ns3/tag.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
25 |
#include "ns3/boolean.h" |
6065 | 26 |
#include "ns3/double.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
27 |
#include "ns3/uinteger.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
28 |
#include "ns3/wifi-phy.h" |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
29 |
#include "ns3/trace-source-accessor.h" |
6065 | 30 |
#include "wifi-mac-header.h" |
1980
3fa3bac40b5b
add asserts and some debug log
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1975
diff
changeset
|
31 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
32 |
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
34 |
|
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
35 |
/*************************************************************** |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
36 |
* Packet Mode Tagger |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
37 |
***************************************************************/ |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
38 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
39 |
namespace ns3 { |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
40 |
|
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
41 |
class TxModeTag : public Tag |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
42 |
{ |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
43 |
public: |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
44 |
TxModeTag (); |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
45 |
TxModeTag (WifiMode rtsMode, WifiMode dataMode); |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
46 |
WifiMode GetRtsMode (void) const; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
47 |
WifiMode GetDataMode (void) const; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
48 |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
49 |
static TypeId GetTypeId (void); |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
50 |
virtual TypeId GetInstanceTypeId (void) const; |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
51 |
virtual uint32_t GetSerializedSize (void) const; |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
52 |
virtual void Serialize (TagBuffer i) const; |
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
53 |
virtual void Deserialize (TagBuffer i); |
3208
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
54 |
virtual void Print (std::ostream &os) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
55 |
private: |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
56 |
WifiMode m_rtsMode; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
57 |
WifiMode m_dataMode; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
58 |
}; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
59 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
60 |
TxModeTag::TxModeTag () |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
61 |
{} |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
62 |
TxModeTag::TxModeTag (WifiMode rtsMode, WifiMode dataMode) |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
63 |
: m_rtsMode (rtsMode), |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
64 |
m_dataMode (dataMode) |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
65 |
{} |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
66 |
WifiMode |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
67 |
TxModeTag::GetRtsMode (void) const |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
68 |
{ |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
69 |
return m_rtsMode; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
70 |
} |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
71 |
WifiMode |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
72 |
TxModeTag::GetDataMode (void) const |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
73 |
{ |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
74 |
return m_dataMode; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
75 |
} |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
76 |
TypeId |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
77 |
TxModeTag::GetTypeId (void) |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
78 |
{ |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
79 |
static TypeId tid = TypeId ("ns3::TxModeTag") |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
80 |
.SetParent<Tag> () |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
81 |
.AddConstructor<TxModeTag> () |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
82 |
.AddAttribute ("RtsTxMode", |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
83 |
"Tx mode of rts to use later", |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
84 |
EmptyAttributeValue (), |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
85 |
MakeWifiModeAccessor (&TxModeTag::GetRtsMode), |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
86 |
MakeWifiModeChecker ()) |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
87 |
.AddAttribute ("DataTxMode", |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
88 |
"Tx mode of data to use later", |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
89 |
EmptyAttributeValue (), |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
90 |
MakeWifiModeAccessor (&TxModeTag::GetDataMode), |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
91 |
MakeWifiModeChecker ()) |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
92 |
; |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
93 |
return tid; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
94 |
} |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
95 |
TypeId |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
96 |
TxModeTag::GetInstanceTypeId (void) const |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
97 |
{ |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
98 |
return GetTypeId (); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
99 |
} |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
100 |
uint32_t |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
101 |
TxModeTag::GetSerializedSize (void) const |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
102 |
{ |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
103 |
return sizeof (WifiMode) * 2; |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
104 |
} |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
105 |
void |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
106 |
TxModeTag::Serialize (TagBuffer i) const |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
107 |
{ |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
108 |
i.Write ((uint8_t *)&m_rtsMode, sizeof (WifiMode)); |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
109 |
i.Write ((uint8_t *)&m_dataMode, sizeof (WifiMode)); |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
110 |
} |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
111 |
void |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
112 |
TxModeTag::Deserialize (TagBuffer i) |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
113 |
{ |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
114 |
i.Read ((uint8_t *)&m_rtsMode, sizeof (WifiMode)); |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
115 |
i.Read ((uint8_t *)&m_dataMode, sizeof (WifiMode)); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
116 |
} |
3208
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
117 |
void |
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
118 |
TxModeTag::Print (std::ostream &os) const |
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
119 |
{ |
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
120 |
os << "Rts=" << m_rtsMode << ", Data=" << m_dataMode; |
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
121 |
} |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
122 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
123 |
} // namespace ns3 |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
124 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
125 |
|
6065 | 126 |
namespace ns3 { |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
127 |
|
6065 | 128 |
NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
129 |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
130 |
TypeId |
6065 | 131 |
WifiRemoteStationManager::GetTypeId (void) |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
132 |
{ |
6065 | 133 |
static TypeId tid = TypeId ("ns3::WifiRemoteStationManager") |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
134 |
.SetParent<Object> () |
6065 | 135 |
.AddAttribute ("IsLowLatency", "If true, we attempt to modelize a so-called low-latency device: a device" |
136 |
" where decisions about tx parameters can be made on a per-packet basis and feedback about the" |
|
137 |
" transmission of each packet is obtained before sending the next. Otherwise, we modelize a " |
|
138 |
" high-latency device, that is a device where we cannot update our decision about tx parameters" |
|
139 |
" after every packet transmission.", |
|
140 |
BooleanValue (true), |
|
141 |
MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency), |
|
142 |
MakeBooleanChecker ()) |
|
143 |
.AddAttribute ("MaxSsrc", "The maximum number of retransmission attempts for an RTS. This value" |
|
144 |
" will not have any effect on some rate control algorithms.", |
|
145 |
UintegerValue (7), |
|
146 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSsrc), |
|
147 |
MakeUintegerChecker<uint32_t> ()) |
|
148 |
.AddAttribute ("MaxSlrc", "The maximum number of retransmission attempts for a DATA packet. This value" |
|
149 |
" will not have any effect on some rate control algorithms.", |
|
150 |
UintegerValue (7), |
|
151 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSlrc), |
|
152 |
MakeUintegerChecker<uint32_t> ()) |
|
153 |
.AddAttribute ("RtsCtsThreshold", "If a data packet is bigger than this value, we use an RTS/CTS handshake" |
|
154 |
" before sending the data. This value will not have any effect on some rate control algorithms.", |
|
155 |
UintegerValue (1500), |
|
156 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_rtsCtsThreshold), |
|
157 |
MakeUintegerChecker<uint32_t> ()) |
|
158 |
.AddAttribute ("FragmentationThreshold", "If a data packet is bigger than this value, we fragment it such that" |
|
159 |
" the size of the fragments are equal or smaller than this value. This value will not have any effect" |
|
160 |
" on some rate control algorithms.", |
|
161 |
UintegerValue (1500), |
|
162 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_fragmentationThreshold), |
|
163 |
MakeUintegerChecker<uint32_t> ()) |
|
164 |
.AddAttribute ("NonUnicastMode", "Wifi mode used for non-unicast transmissions.", |
|
165 |
WifiModeValue (), |
|
166 |
MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicastMode), |
|
167 |
MakeWifiModeChecker ()) |
|
168 |
.AddTraceSource ("MacTxRtsFailed", |
|
169 |
"The transmission of a RTS by the MAC layer has failed", |
|
170 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxRtsFailed)) |
|
171 |
.AddTraceSource ("MacTxDataFailed", |
|
172 |
"The transmission of a data packet by the MAC layer has failed", |
|
173 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxDataFailed)) |
|
174 |
.AddTraceSource ("MacTxFinalRtsFailed", |
|
175 |
"The transmission of a RTS has exceeded the maximum number of attempts", |
|
176 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxFinalRtsFailed)) |
|
177 |
.AddTraceSource ("MacTxFinalDataFailed", |
|
178 |
"The transmission of a data packet has exceeded the maximum number of attempts", |
|
179 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxFinalDataFailed)) |
|
180 |
.AddAttribute("AvgSlrcCoefficient", "The weigh of the slrc count in the slrc avg calculation", |
|
181 |
DoubleValue (0.9), |
|
182 |
MakeDoubleAccessor (&WifiRemoteStationManager::m_avgSlrcCoefficient), |
|
183 |
MakeDoubleChecker<double> ()) |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
184 |
; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
185 |
return tid; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
186 |
} |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
187 |
|
6065 | 188 |
WifiRemoteStationManager::WifiRemoteStationManager () |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
189 |
{} |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
190 |
|
6065 | 191 |
WifiRemoteStationManager::~WifiRemoteStationManager () |
192 |
{ |
|
193 |
} |
|
194 |
void |
|
195 |
WifiRemoteStationManager::DoDispose (void) |
|
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
196 |
{ |
6065 | 197 |
for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++) |
198 |
{ |
|
199 |
delete (*i); |
|
200 |
} |
|
201 |
m_states.clear (); |
|
202 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
|
203 |
{ |
|
204 |
delete (*i); |
|
205 |
} |
|
206 |
m_stations.clear (); |
|
207 |
} |
|
208 |
void |
|
209 |
WifiRemoteStationManager::SetupPhy (Ptr<WifiPhy> phy) |
|
210 |
{ |
|
211 |
m_defaultTxMode = phy->GetMode (0); |
|
212 |
Reset (); |
|
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
213 |
} |
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
214 |
|
6065 | 215 |
uint32_t |
216 |
WifiRemoteStationManager::GetMaxSsrc (void) const |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
217 |
{ |
6065 | 218 |
return m_maxSsrc; |
219 |
} |
|
220 |
uint32_t |
|
221 |
WifiRemoteStationManager::GetMaxSlrc (void) const |
|
222 |
{ |
|
223 |
return m_maxSlrc; |
|
224 |
} |
|
225 |
uint32_t |
|
226 |
WifiRemoteStationManager::GetRtsCtsThreshold (void) const |
|
227 |
{ |
|
228 |
return m_rtsCtsThreshold; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
229 |
} |
6065 | 230 |
uint32_t |
231 |
WifiRemoteStationManager::GetFragmentationThreshold (void) const |
|
232 |
{ |
|
233 |
return m_fragmentationThreshold; |
|
234 |
} |
|
235 |
void |
|
236 |
WifiRemoteStationManager::SetMaxSsrc (uint32_t maxSsrc) |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
237 |
{ |
6065 | 238 |
m_maxSsrc = maxSsrc; |
239 |
} |
|
240 |
void |
|
241 |
WifiRemoteStationManager::SetMaxSlrc (uint32_t maxSlrc) |
|
242 |
{ |
|
243 |
m_maxSlrc = maxSlrc; |
|
244 |
} |
|
245 |
void |
|
246 |
WifiRemoteStationManager::SetRtsCtsThreshold (uint32_t threshold) |
|
247 |
{ |
|
248 |
m_rtsCtsThreshold = threshold; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
249 |
} |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
250 |
void |
6065 | 251 |
WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold) |
252 |
{ |
|
253 |
m_fragmentationThreshold = threshold; |
|
254 |
} |
|
255 |
||
256 |
void |
|
257 |
WifiRemoteStationManager::Reset (Mac48Address address) |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
258 |
{ |
6065 | 259 |
NS_ASSERT (!address.IsGroup ()); |
260 |
WifiRemoteStationState *state = LookupState (address); |
|
261 |
state->m_modes.clear (); |
|
262 |
AddSupportedMode (address, GetDefaultMode ()); |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
263 |
} |
6065 | 264 |
void |
265 |
WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode) |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
266 |
{ |
6065 | 267 |
NS_ASSERT (!address.IsGroup ()); |
268 |
WifiRemoteStationState *state = LookupState (address); |
|
269 |
for (WifiRemoteStationState::SupportedModes::const_iterator i = state->m_modes.begin (); i != state->m_modes.end (); i++) |
|
270 |
{ |
|
271 |
if ((*i) == mode) |
|
272 |
{ |
|
273 |
// already in. |
|
274 |
return; |
|
275 |
} |
|
276 |
} |
|
277 |
state->m_modes.push_back (mode); |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
278 |
} |
6065 | 279 |
bool |
280 |
WifiRemoteStationManager::IsBrandNew (Mac48Address address) const |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
281 |
{ |
6065 | 282 |
if (address.IsGroup ()) |
283 |
{ |
|
284 |
return false; |
|
285 |
} |
|
286 |
return LookupState (address)->m_state == WifiRemoteStationState::BRAND_NEW; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
287 |
} |
6065 | 288 |
bool |
289 |
WifiRemoteStationManager::IsAssociated (Mac48Address address) const |
|
290 |
{ |
|
291 |
if (address.IsGroup ()) |
|
292 |
{ |
|
293 |
return true; |
|
294 |
} |
|
295 |
return LookupState (address)->m_state == WifiRemoteStationState::GOT_ASSOC_TX_OK; |
|
296 |
} |
|
297 |
bool |
|
298 |
WifiRemoteStationManager::IsWaitAssocTxOk (Mac48Address address) const |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
299 |
{ |
6065 | 300 |
if (address.IsGroup ()) |
301 |
{ |
|
302 |
return false; |
|
303 |
} |
|
304 |
return LookupState (address)->m_state == WifiRemoteStationState::WAIT_ASSOC_TX_OK; |
|
305 |
} |
|
306 |
void |
|
307 |
WifiRemoteStationManager::RecordWaitAssocTxOk (Mac48Address address) |
|
308 |
{ |
|
309 |
NS_ASSERT (!address.IsGroup ()); |
|
310 |
LookupState (address)->m_state = WifiRemoteStationState::WAIT_ASSOC_TX_OK; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
311 |
} |
6065 | 312 |
void |
313 |
WifiRemoteStationManager::RecordGotAssocTxOk (Mac48Address address) |
|
314 |
{ |
|
315 |
NS_ASSERT (!address.IsGroup ()); |
|
316 |
LookupState (address)->m_state = WifiRemoteStationState::GOT_ASSOC_TX_OK; |
|
317 |
} |
|
318 |
void |
|
319 |
WifiRemoteStationManager::RecordGotAssocTxFailed (Mac48Address address) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
320 |
{ |
6065 | 321 |
NS_ASSERT (!address.IsGroup ()); |
322 |
LookupState (address)->m_state = WifiRemoteStationState::DISASSOC; |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
323 |
} |
6065 | 324 |
void |
325 |
WifiRemoteStationManager::RecordDisassociated (Mac48Address address) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
326 |
{ |
6065 | 327 |
NS_ASSERT (!address.IsGroup ()); |
328 |
LookupState (address)->m_state = WifiRemoteStationState::DISASSOC; |
|
329 |
} |
|
330 |
void |
|
331 |
WifiRemoteStationManager::PrepareForQueue (Mac48Address address, const WifiMacHeader *header, |
|
332 |
Ptr<const Packet> packet, uint32_t fullPacketSize) |
|
333 |
{ |
|
334 |
if (IsLowLatency () || address.IsGroup ()) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
335 |
{ |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
336 |
return; |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
337 |
} |
6065 | 338 |
TxModeTag tag = TxModeTag (GetRtsMode (address, header, packet), |
339 |
GetDataMode (address, header, packet, fullPacketSize)); |
|
340 |
packet->AddPacketTag (tag); |
|
341 |
} |
|
342 |
WifiMode |
|
343 |
WifiRemoteStationManager::GetDataMode (Mac48Address address, const WifiMacHeader *header, |
|
344 |
Ptr<const Packet> packet, uint32_t fullPacketSize) |
|
345 |
{ |
|
346 |
if (address.IsGroup ()) |
|
347 |
{ |
|
348 |
return GetNonUnicastMode (); |
|
349 |
} |
|
350 |
if (!IsLowLatency ()) |
|
351 |
{ |
|
352 |
// Note: removing the packet below is wrong: what happens in case of retransmissions ??? |
|
353 |
TxModeTag tag; |
|
354 |
bool found; |
|
355 |
found = ConstCast<Packet> (packet)->RemovePacketTag (tag); |
|
356 |
NS_ASSERT (found); |
|
357 |
return tag.GetDataMode (); |
|
358 |
} |
|
359 |
return DoGetDataMode (Lookup (address, header), fullPacketSize); |
|
360 |
} |
|
361 |
WifiMode |
|
362 |
WifiRemoteStationManager::GetRtsMode (Mac48Address address, const WifiMacHeader *header, |
|
363 |
Ptr<const Packet> packet) |
|
364 |
{ |
|
365 |
NS_ASSERT (!address.IsGroup ()); |
|
366 |
if (!IsLowLatency ()) |
|
367 |
{ |
|
368 |
TxModeTag tag; |
|
369 |
bool found; |
|
370 |
found = ConstCast<Packet> (packet)->RemovePacketTag (tag); |
|
371 |
NS_ASSERT (found); |
|
372 |
return tag.GetRtsMode (); |
|
373 |
} |
|
374 |
return DoGetRtsMode (Lookup (address, header)); |
|
375 |
} |
|
376 |
void |
|
377 |
WifiRemoteStationManager::ReportRtsFailed (Mac48Address address, const WifiMacHeader *header) |
|
378 |
{ |
|
379 |
NS_ASSERT (!address.IsGroup ()); |
|
380 |
WifiRemoteStation *station = Lookup (address, header); |
|
381 |
station->m_ssrc++; |
|
382 |
m_macTxRtsFailed (address); |
|
383 |
DoReportRtsFailed (station); |
|
384 |
} |
|
385 |
void |
|
386 |
WifiRemoteStationManager::ReportDataFailed (Mac48Address address, const WifiMacHeader *header) |
|
387 |
{ |
|
388 |
NS_ASSERT (!address.IsGroup ()); |
|
389 |
WifiRemoteStation *station = Lookup (address, header); |
|
390 |
station->m_slrc++; |
|
391 |
m_macTxDataFailed (address); |
|
392 |
DoReportDataFailed (station); |
|
393 |
} |
|
394 |
void |
|
395 |
WifiRemoteStationManager::ReportRtsOk (Mac48Address address, const WifiMacHeader *header, |
|
396 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) |
|
397 |
{ |
|
398 |
NS_ASSERT (!address.IsGroup ()); |
|
399 |
WifiRemoteStation *station = Lookup (address, header); |
|
400 |
station->m_ssrc = 0; |
|
401 |
DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr); |
|
402 |
} |
|
403 |
void |
|
404 |
WifiRemoteStationManager::ReportDataOk (Mac48Address address, const WifiMacHeader *header, |
|
405 |
double ackSnr, WifiMode ackMode, double dataSnr) |
|
406 |
{ |
|
407 |
NS_ASSERT (!address.IsGroup ()); |
|
408 |
WifiRemoteStation *station = Lookup (address, header); |
|
409 |
station->m_avgSlrc = station->m_avgSlrc * m_avgSlrcCoefficient + (double) station->m_slrc * (1 - m_avgSlrcCoefficient); |
|
410 |
station->m_slrc = 0; |
|
411 |
DoReportDataOk (station, ackSnr, ackMode, dataSnr); |
|
412 |
} |
|
413 |
void |
|
414 |
WifiRemoteStationManager::ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header) |
|
415 |
{ |
|
416 |
NS_ASSERT (!address.IsGroup ()); |
|
417 |
WifiRemoteStation *station = Lookup (address, header); |
|
418 |
station->m_ssrc = 0; |
|
419 |
m_macTxFinalRtsFailed (address); |
|
420 |
DoReportFinalRtsFailed (station); |
|
421 |
} |
|
422 |
void |
|
423 |
WifiRemoteStationManager::ReportFinalDataFailed (Mac48Address address, const WifiMacHeader *header) |
|
424 |
{ |
|
425 |
NS_ASSERT (!address.IsGroup ()); |
|
426 |
WifiRemoteStation *station = Lookup (address, header); |
|
427 |
station->m_slrc = 0; |
|
428 |
m_macTxFinalDataFailed (address); |
|
429 |
DoReportFinalDataFailed (station); |
|
430 |
} |
|
431 |
void |
|
432 |
WifiRemoteStationManager::ReportRxOk (Mac48Address address, const WifiMacHeader *header, |
|
433 |
double rxSnr, WifiMode txMode) |
|
434 |
{ |
|
435 |
if (address.IsGroup ()) |
|
436 |
{ |
|
437 |
return; |
|
438 |
} |
|
439 |
WifiRemoteStation *station = Lookup (address, header); |
|
440 |
DoReportRxOk (station, rxSnr, txMode); |
|
441 |
} |
|
442 |
bool |
|
443 |
WifiRemoteStationManager::NeedRts (Mac48Address address, const WifiMacHeader *header, |
|
444 |
Ptr<const Packet> packet) |
|
445 |
{ |
|
446 |
if (address.IsGroup ()) |
|
447 |
{ |
|
448 |
return false; |
|
449 |
} |
|
450 |
bool normally = packet->GetSize () > GetRtsCtsThreshold (); |
|
451 |
return DoNeedRts (Lookup (address, header), packet, normally); |
|
452 |
} |
|
453 |
bool |
|
454 |
WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header, |
|
455 |
Ptr<const Packet> packet) |
|
456 |
{ |
|
457 |
NS_ASSERT (!address.IsGroup ()); |
|
458 |
WifiRemoteStation *station = Lookup (address, header); |
|
459 |
bool normally = station->m_ssrc < GetMaxSsrc (); |
|
460 |
return DoNeedRtsRetransmission (station, packet, normally); |
|
461 |
} |
|
462 |
bool |
|
463 |
WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header, |
|
464 |
Ptr<const Packet> packet) |
|
465 |
{ |
|
466 |
NS_ASSERT (!address.IsGroup ()); |
|
467 |
WifiRemoteStation *station = Lookup (address, header); |
|
468 |
bool normally = station->m_slrc < GetMaxSlrc (); |
|
469 |
return DoNeedDataRetransmission (station, packet, normally); |
|
470 |
} |
|
471 |
bool |
|
472 |
WifiRemoteStationManager::NeedFragmentation (Mac48Address address, const WifiMacHeader *header, |
|
473 |
Ptr<const Packet> packet) |
|
474 |
{ |
|
475 |
if (address.IsGroup ()) |
|
476 |
{ |
|
477 |
return false; |
|
478 |
} |
|
479 |
WifiRemoteStation *station = Lookup (address, header); |
|
480 |
bool normally = packet->GetSize () > GetFragmentationThreshold (); |
|
481 |
return DoNeedFragmentation (station, packet, normally); |
|
482 |
} |
|
483 |
uint32_t |
|
484 |
WifiRemoteStationManager::GetNFragments (Ptr<const Packet> packet) |
|
485 |
{ |
|
486 |
uint32_t nFragments = packet->GetSize () / GetFragmentationThreshold () + 1; |
|
487 |
return nFragments; |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
488 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
489 |
|
6065 | 490 |
uint32_t |
491 |
WifiRemoteStationManager::GetFragmentSize (Mac48Address address, const WifiMacHeader *header, |
|
492 |
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
|
493 |
{ |
6065 | 494 |
NS_ASSERT (!address.IsGroup ()); |
495 |
uint32_t nFragment = GetNFragments (packet); |
|
496 |
if (fragmentNumber >= nFragment) |
|
497 |
{ |
|
498 |
return 0; |
|
499 |
} |
|
500 |
if (fragmentNumber == nFragment - 1) |
|
501 |
{ |
|
502 |
uint32_t lastFragmentSize = packet->GetSize () % GetFragmentationThreshold (); |
|
503 |
return lastFragmentSize; |
|
504 |
} |
|
505 |
else |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
506 |
{ |
6065 | 507 |
return GetFragmentationThreshold (); |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
508 |
} |
6065 | 509 |
} |
510 |
uint32_t |
|
511 |
WifiRemoteStationManager::GetFragmentOffset (Mac48Address address, const WifiMacHeader *header, |
|
512 |
Ptr<const Packet> packet, uint32_t fragmentNumber) |
|
513 |
{ |
|
514 |
NS_ASSERT (!address.IsGroup ()); |
|
515 |
NS_ASSERT (fragmentNumber < GetNFragments (packet)); |
|
516 |
uint32_t fragmentOffset = fragmentNumber * GetFragmentationThreshold (); |
|
517 |
return fragmentOffset; |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
518 |
} |
6065 | 519 |
bool |
520 |
WifiRemoteStationManager::IsLastFragment (Mac48Address address, const WifiMacHeader *header, |
|
521 |
Ptr<const Packet> packet, uint32_t fragmentNumber) |
|
522 |
{ |
|
523 |
NS_ASSERT (!address.IsGroup ()); |
|
524 |
bool isLast = fragmentNumber == (GetNFragments (packet) - 1); |
|
525 |
return isLast; |
|
526 |
} |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
527 |
WifiMode |
6065 | 528 |
WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode reqMode) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
529 |
{ |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
530 |
/** |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
531 |
* see ieee 802.11e, section 9.6: |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
532 |
* |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
533 |
* To allow the transmitting STA to calculate the contents of |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
534 |
* the Duration/ID field, a STA responding to a received frame |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
535 |
* shall transmit its Control Response frame (either CTS or ACK) |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
536 |
* frames, other than the Block-Ack control frame, at the highest |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
537 |
* rate in the BSSBasicRateSet parameter that is less than or equal |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
538 |
* to the rate of the immediately previous frame in the frame |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
539 |
* exchange sequence (as defined in 9.79.12) and that is of the |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
540 |
* same modulation type as the received frame. If no rate in the |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
541 |
* basic rate set meets these conditions, then the control frame |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
542 |
* sent in response to a received frame shall be transmitted at |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
543 |
* the highest mandatory rate of the PHY that is less than or equal |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
544 |
* to the rate of the received frame, and that is of the same |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
545 |
* modulation type as the received frame. In addition, the Control |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
546 |
* Response frame shall be sent using the same PHY options as the |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
547 |
* received frame, unless they conflict with the requirement to use |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
548 |
* the BSSBasicRateSet parameter. |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
549 |
*/ |
6065 | 550 |
WifiMode mode = GetDefaultMode (); |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
551 |
|
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
552 |
// First, search the BSS Basic Rate set |
6065 | 553 |
for (WifiRemoteStationManager::BasicModesIterator i = BeginBasicModes (); i != EndBasicModes (); i++) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
554 |
{ |
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
|
555 |
if (i->GetPhyRate () > mode.GetPhyRate () && |
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
|
556 |
i->GetPhyRate () <= reqMode.GetPhyRate () && |
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
|
557 |
i->GetModulationType () == reqMode.GetModulationType ()) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
558 |
{ |
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
|
559 |
mode = *i; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
560 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
561 |
} |
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
|
562 |
// no need to search Mandatory rate set because it is included |
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
|
563 |
// within the Basic rate set. |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
564 |
return mode; |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
565 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
566 |
|
6065 | 567 |
WifiMode |
568 |
WifiRemoteStationManager::GetCtsMode (Mac48Address address, WifiMode rtsMode) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
569 |
{ |
6065 | 570 |
NS_ASSERT (!address.IsGroup ()); |
571 |
return GetControlAnswerMode (address, rtsMode); |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
572 |
} |
6065 | 573 |
WifiMode |
574 |
WifiRemoteStationManager::GetAckMode (Mac48Address address, WifiMode dataMode) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
575 |
{ |
6065 | 576 |
NS_ASSERT (!address.IsGroup ()); |
577 |
return GetControlAnswerMode (address, dataMode); |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
578 |
} |
4692
f4cd995f1718
Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents:
4502
diff
changeset
|
579 |
double |
6065 | 580 |
WifiRemoteStationManager::GetAvgSlrc (Mac48Address address) const |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
581 |
{ |
6065 | 582 |
NS_FATAL_ERROR ("XXX"); |
583 |
NS_ASSERT (!address.IsGroup ()); |
|
584 |
WifiRemoteStation *station = Lookup (address, (uint8_t)0); |
|
585 |
return station->m_avgSlrc; |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
586 |
} |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
587 |
|
6065 | 588 |
WifiRemoteStationState * |
589 |
WifiRemoteStationManager::LookupState (Mac48Address address) const |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
590 |
{ |
6065 | 591 |
for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++) |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
592 |
{ |
6065 | 593 |
if ((*i)->m_address == address) |
594 |
{ |
|
595 |
return (*i); |
|
596 |
} |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
597 |
} |
6065 | 598 |
WifiRemoteStationState *state = new WifiRemoteStationState (); |
599 |
state->m_state = WifiRemoteStationState::BRAND_NEW; |
|
600 |
state->m_address = address; |
|
601 |
state->m_modes.push_back (GetDefaultMode ()); |
|
602 |
return state; |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
603 |
} |
6065 | 604 |
WifiRemoteStation * |
605 |
WifiRemoteStationManager::Lookup (Mac48Address address, const WifiMacHeader *header) const |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
606 |
{ |
6065 | 607 |
uint8_t tid; |
608 |
if (header->IsQosData ()) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
609 |
{ |
6065 | 610 |
tid = header->GetQosTid (); |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
611 |
} |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
612 |
else |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
613 |
{ |
6065 | 614 |
tid = 0; |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
615 |
} |
6065 | 616 |
return Lookup (address, tid); |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
617 |
} |
6065 | 618 |
WifiRemoteStation * |
619 |
WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const |
|
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
620 |
{ |
6065 | 621 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
622 |
{ |
|
623 |
if ((*i)->m_tid == tid && |
|
624 |
(*i)->m_state->m_address == address) |
|
625 |
{ |
|
626 |
return (*i); |
|
627 |
} |
|
628 |
} |
|
629 |
WifiRemoteStationState *state = LookupState (address); |
|
630 |
||
631 |
WifiRemoteStation *station = DoCreateStation (); |
|
632 |
station->m_state = state; |
|
633 |
station->m_ssrc = 0; |
|
634 |
station->m_slrc = 0; |
|
635 |
station->m_avgSlrc = 0; |
|
636 |
// XXX |
|
637 |
const_cast<WifiRemoteStationManager *> (this)->m_stations.push_back (station); |
|
638 |
return station; |
|
639 |
||
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
640 |
} |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
641 |
|
6065 | 642 |
WifiMode |
643 |
WifiRemoteStationManager::GetDefaultMode (void) const |
|
644 |
{ |
|
645 |
return m_defaultTxMode; |
|
646 |
} |
|
647 |
void |
|
648 |
WifiRemoteStationManager::Reset (void) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
649 |
{ |
6065 | 650 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
651 |
{ |
|
652 |
delete (*i); |
|
653 |
} |
|
654 |
m_stations.clear (); |
|
655 |
m_basicModes.clear (); |
|
656 |
m_basicModes.push_back (m_defaultTxMode); |
|
657 |
NS_ASSERT (m_defaultTxMode.IsMandatory ()); |
|
658 |
} |
|
659 |
void |
|
660 |
WifiRemoteStationManager::AddBasicMode (WifiMode mode) |
|
661 |
{ |
|
662 |
for (uint32_t i = 0; i < GetNBasicModes (); i++) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
663 |
{ |
6065 | 664 |
if (GetBasicMode (i) == mode) |
665 |
{ |
|
666 |
return; |
|
667 |
} |
|
668 |
} |
|
669 |
m_basicModes.push_back (mode); |
|
670 |
} |
|
671 |
uint32_t |
|
672 |
WifiRemoteStationManager::GetNBasicModes (void) const |
|
673 |
{ |
|
674 |
return m_basicModes.size (); |
|
675 |
} |
|
676 |
WifiMode |
|
677 |
WifiRemoteStationManager::GetBasicMode (uint32_t i) const |
|
678 |
{ |
|
679 |
NS_ASSERT (i < m_basicModes.size ()); |
|
680 |
return m_basicModes[i]; |
|
681 |
} |
|
682 |
WifiRemoteStationManager::BasicModesIterator |
|
683 |
WifiRemoteStationManager::BeginBasicModes (void) const |
|
684 |
{ |
|
685 |
return m_basicModes.begin (); |
|
686 |
} |
|
687 |
WifiRemoteStationManager::BasicModesIterator |
|
688 |
WifiRemoteStationManager::EndBasicModes (void) const |
|
689 |
{ |
|
690 |
return m_basicModes.end (); |
|
691 |
} |
|
692 |
||
693 |
WifiMode |
|
694 |
WifiRemoteStationManager::GetNonUnicastMode (void) const |
|
695 |
{ |
|
696 |
if (m_nonUnicastMode == WifiMode ()) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
697 |
{ |
6065 | 698 |
return GetBasicMode(0); |
699 |
} |
|
700 |
else |
|
701 |
{ |
|
702 |
return m_nonUnicastMode; |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
703 |
} |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
704 |
} |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
705 |
|
6065 | 706 |
bool |
707 |
WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station, |
|
708 |
Ptr<const Packet> packet, bool normally) |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
709 |
{ |
6065 | 710 |
return normally; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
711 |
} |
6065 | 712 |
bool |
713 |
WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station, |
|
714 |
Ptr<const Packet> packet, bool normally) |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
715 |
{ |
6065 | 716 |
return normally; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
717 |
} |
6065 | 718 |
bool |
719 |
WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station, |
|
720 |
Ptr<const Packet> packet, bool normally) |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
721 |
{ |
6065 | 722 |
return normally; |
723 |
} |
|
724 |
bool |
|
725 |
WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, |
|
726 |
Ptr<const Packet> packet, bool normally) |
|
727 |
{ |
|
728 |
return normally; |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
729 |
} |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
730 |
|
6065 | 731 |
WifiMode |
732 |
WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
733 |
{ |
6065 | 734 |
NS_ASSERT (i < GetNSupported (station)); |
735 |
return station->m_state->m_modes[i]; |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
736 |
} |
6065 | 737 |
uint32_t |
738 |
WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
739 |
{ |
6065 | 740 |
return station->m_state->m_modes.size (); |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
741 |
} |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
742 |
|
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
743 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
744 |
} // namespace ns3 |