author | Tom Henderson <tomh@tomh.org> |
Fri, 27 Mar 2015 11:28:59 -0700 | |
changeset 11245 | 5c781d7e5a25 |
parent 11189 | c17091a7616e |
child 11387 | ad9b049b9b7a |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7162
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
2 |
/* |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
4 |
* |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
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:
6852
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
7 |
* published by the Free Software Foundation; |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
8 |
* |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
12 |
* GNU General Public License for more details. |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
13 |
* |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
17 |
* |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
19 |
*/ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#include "wifi-mac.h" |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
21 |
#include "dcf.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#include "ns3/uinteger.h" |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
23 |
#include "ns3/trace-source-accessor.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
namespace ns3 { |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
27 |
NS_OBJECT_ENSURE_REGISTERED (WifiMac); |
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10204
diff
changeset
|
28 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
WifiMac::GetDefaultMaxPropagationDelay (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
33 |
// 1000m |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
return Seconds (1000.0 / 300000000.0); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
WifiMac::GetDefaultSlot (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
// 802.11-a specific |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
return MicroSeconds (9); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
WifiMac::GetDefaultSifs (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
// 802.11-a specific |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
return MicroSeconds (16); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
} |
10139 | 48 |
Time |
49 |
WifiMac::GetDefaultRifs (void) |
|
50 |
{ |
|
51 |
//802.11n specific |
|
52 |
return MicroSeconds (2); |
|
53 |
} |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
WifiMac::GetDefaultEifsNoDifs (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
56 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
return GetDefaultSifs () + GetDefaultCtsAckDelay (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
59 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
60 |
WifiMac::GetDefaultCtsAckDelay (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
// 802.11-a specific: 6mb/s |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
return MicroSeconds (44); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
65 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
WifiMac::GetDefaultCtsAckTimeout (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
67 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
68 |
/* Cts_Timeout and Ack_Timeout are specified in the Annex C |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
69 |
(Formal description of MAC operation, see details on the |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
Trsp timer setting at page 346) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
71 |
*/ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
Time ctsTimeout = GetDefaultSifs (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
ctsTimeout += GetDefaultCtsAckDelay (); |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4272
diff
changeset
|
74 |
ctsTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
75 |
ctsTimeout += GetDefaultSlot (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
76 |
return ctsTimeout; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
|
5958 | 79 |
Time |
80 |
WifiMac::GetDefaultBasicBlockAckDelay (void) |
|
81 |
{ |
|
82 |
// This value must be rivisited |
|
83 |
return MicroSeconds (250); |
|
84 |
} |
|
85 |
Time |
|
86 |
WifiMac::GetDefaultCompressedBlockAckDelay (void) |
|
87 |
{ |
|
10139 | 88 |
// This value must be rivisited was 68. |
89 |
//CompressedBlockAckSize 32* 8*time it takes to transfer at the lowest rate (6Mb/s)+ aPhy-StartDelay(33) |
|
90 |
return MicroSeconds (76); |
|
5958 | 91 |
} |
92 |
Time |
|
93 |
WifiMac::GetDefaultBasicBlockAckTimeout (void) |
|
94 |
{ |
|
95 |
Time blockAckTimeout = GetDefaultSifs (); |
|
96 |
blockAckTimeout += GetDefaultBasicBlockAckDelay (); |
|
97 |
blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2); |
|
98 |
blockAckTimeout += GetDefaultSlot (); |
|
99 |
return blockAckTimeout; |
|
100 |
} |
|
101 |
Time |
|
102 |
WifiMac::GetDefaultCompressedBlockAckTimeout (void) |
|
103 |
{ |
|
104 |
Time blockAckTimeout = GetDefaultSifs (); |
|
105 |
blockAckTimeout += GetDefaultCompressedBlockAckDelay (); |
|
106 |
blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2); |
|
107 |
blockAckTimeout += GetDefaultSlot (); |
|
108 |
return blockAckTimeout; |
|
109 |
} |
|
110 |
||
111 |
void |
|
112 |
WifiMac::SetBasicBlockAckTimeout (Time blockAckTimeout) |
|
113 |
{ |
|
114 |
//this method must be implemented by QoS WifiMacs |
|
115 |
} |
|
116 |
||
117 |
Time |
|
118 |
WifiMac::GetBasicBlockAckTimeout (void) const |
|
119 |
{ |
|
120 |
//this method must be implemented by QoS WifiMacs |
|
121 |
return MicroSeconds (0); |
|
122 |
} |
|
123 |
||
124 |
void |
|
125 |
WifiMac::SetCompressedBlockAckTimeout (Time blockAckTimeout) |
|
126 |
{ |
|
127 |
//this methos must be implemented by QoS WifiMacs |
|
128 |
} |
|
129 |
||
130 |
Time |
|
131 |
WifiMac::GetCompressedBlockAckTimeout (void) const |
|
132 |
{ |
|
133 |
//this method must be implemented by QoS WifiMacs |
|
134 |
return MicroSeconds (0); |
|
135 |
} |
|
136 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
137 |
TypeId |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
WifiMac::GetTypeId (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
140 |
static TypeId tid = TypeId ("ns3::WifiMac") |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
141 |
.SetParent<Object> () |
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11189
diff
changeset
|
142 |
.SetGroupName ("Wifi") |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
143 |
.AddAttribute ("CtsTimeout", "When this timeout expires, the RTS/CTS handshake has failed.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
144 |
TimeValue (GetDefaultCtsAckTimeout ()), |
3747
789e9a21ecbe
bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3599
diff
changeset
|
145 |
MakeTimeAccessor (&WifiMac::SetCtsTimeout, |
789e9a21ecbe
bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3599
diff
changeset
|
146 |
&WifiMac::GetCtsTimeout), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
MakeTimeChecker ()) |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
148 |
.AddAttribute ("AckTimeout", "When this timeout expires, the DATA/ACK handshake has failed.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
149 |
TimeValue (GetDefaultCtsAckTimeout ()), |
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
150 |
MakeTimeAccessor (&WifiMac::GetAckTimeout, |
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
151 |
&WifiMac::SetAckTimeout), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
152 |
MakeTimeChecker ()) |
5958 | 153 |
.AddAttribute ("BasicBlockAckTimeout", "When this timeout expires, the BASIC_BLOCK_ACK_REQ/BASIC_BLOCK_ACK handshake has failed.", |
154 |
TimeValue (GetDefaultBasicBlockAckTimeout ()), |
|
155 |
MakeTimeAccessor (&WifiMac::GetBasicBlockAckTimeout, |
|
156 |
&WifiMac::SetBasicBlockAckTimeout), |
|
157 |
MakeTimeChecker ()) |
|
158 |
.AddAttribute ("CompressedBlockAckTimeout", "When this timeout expires, the COMPRESSED_BLOCK_ACK_REQ/COMPRESSED_BLOCK_ACK handshake has failed.", |
|
159 |
TimeValue (GetDefaultCompressedBlockAckTimeout ()), |
|
160 |
MakeTimeAccessor (&WifiMac::GetCompressedBlockAckTimeout, |
|
161 |
&WifiMac::SetCompressedBlockAckTimeout), |
|
162 |
MakeTimeChecker ()) |
|
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
163 |
.AddAttribute ("Sifs", "The value of the SIFS constant.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
164 |
TimeValue (GetDefaultSifs ()), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
165 |
MakeTimeAccessor (&WifiMac::SetSifs, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
166 |
&WifiMac::GetSifs), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
167 |
MakeTimeChecker ()) |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
168 |
.AddAttribute ("EifsNoDifs", "The value of EIFS-DIFS", |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
169 |
TimeValue (GetDefaultEifsNoDifs ()), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
170 |
MakeTimeAccessor (&WifiMac::SetEifsNoDifs, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
171 |
&WifiMac::GetEifsNoDifs), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
172 |
MakeTimeChecker ()) |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
173 |
.AddAttribute ("Slot", "The duration of a Slot.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
174 |
TimeValue (GetDefaultSlot ()), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
175 |
MakeTimeAccessor (&WifiMac::SetSlot, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
176 |
&WifiMac::GetSlot), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
177 |
MakeTimeChecker ()) |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
178 |
.AddAttribute ("Pifs", "The value of the PIFS constant.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
179 |
TimeValue (GetDefaultSifs () + GetDefaultSlot ()), |
3599
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3596
diff
changeset
|
180 |
MakeTimeAccessor (&WifiMac::SetPifs, |
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3596
diff
changeset
|
181 |
&WifiMac::GetPifs), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
182 |
MakeTimeChecker ()) |
10139 | 183 |
.AddAttribute ("Rifs", "The value of the RIFS constant.", |
184 |
TimeValue (GetDefaultRifs ()), |
|
185 |
MakeTimeAccessor (&WifiMac::SetRifs, |
|
186 |
&WifiMac::GetRifs), |
|
187 |
MakeTimeChecker ()) |
|
188 |
||
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
189 |
.AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused for now.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2686
diff
changeset
|
190 |
TimeValue (GetDefaultMaxPropagationDelay ()), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
191 |
MakeTimeAccessor (&WifiMac::m_maxPropagationDelay), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
192 |
MakeTimeChecker ()) |
3212
0c00342d6a73
improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
193 |
.AddAttribute ("Ssid", "The ssid we want to belong to.", |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
194 |
SsidValue (Ssid ("default")), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
195 |
MakeSsidAccessor (&WifiMac::GetSsid, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
196 |
&WifiMac::SetSsid), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
197 |
MakeSsidChecker ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
198 |
.AddTraceSource ("MacTx", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
199 |
"A packet has been received from higher layers and is being processed in preparation for " |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
200 |
"queueing for transmission.", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
201 |
MakeTraceSourceAccessor (&WifiMac::m_macTxTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
202 |
"ns3::Packet::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
203 |
.AddTraceSource ("MacTxDrop", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
204 |
"A packet has been dropped in the MAC layer before being queued for transmission.", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
205 |
MakeTraceSourceAccessor (&WifiMac::m_macTxDropTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
206 |
"ns3::Packet::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
207 |
.AddTraceSource ("MacPromiscRx", |
4272
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
208 |
"A packet has been received by this device, has been passed up from the physical layer " |
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
209 |
"and is being forwarded up the local protocol stack. This is a promiscuous trace,", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
210 |
MakeTraceSourceAccessor (&WifiMac::m_macPromiscRxTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
211 |
"ns3::Packet::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
212 |
.AddTraceSource ("MacRx", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
213 |
"A packet has been received by this device, has been passed up from the physical layer " |
4272
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
214 |
"and is being forwarded up the local protocol stack. This is a non-promiscuous trace,", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
215 |
MakeTraceSourceAccessor (&WifiMac::m_macRxTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
216 |
"ns3::Packet::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
217 |
.AddTraceSource ("MacRxDrop", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
218 |
"A packet has been dropped in the MAC layer after it has been passed up from the physical " |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
219 |
"layer.", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
220 |
MakeTraceSourceAccessor (&WifiMac::m_macRxDropTrace), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
221 |
"ns3::Packet::TracedCallback") |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
222 |
#if 0 |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
223 |
// Not currently implemented in this device |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
224 |
.AddTraceSource ("Sniffer", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
225 |
"Trace source simulating a non-promiscuous packet sniffer attached to the device", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
226 |
MakeTraceSourceAccessor (&WifiMac::m_snifferTrace)) |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
227 |
#endif |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
228 |
; |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
229 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
230 |
return tid; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
231 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
232 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
233 |
void |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
234 |
WifiMac::SetMaxPropagationDelay (Time delay) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
235 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
236 |
m_maxPropagationDelay = delay; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
237 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
238 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
239 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
240 |
WifiMac::GetMsduLifetime (void) const |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
241 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
242 |
return Seconds (10); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
243 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
244 |
Time |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
245 |
WifiMac::GetMaxPropagationDelay (void) const |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
246 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
247 |
return m_maxPropagationDelay; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
248 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
249 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
250 |
void |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
251 |
WifiMac::NotifyTx (Ptr<const Packet> packet) |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
252 |
{ |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
253 |
m_macTxTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
254 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
255 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
256 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
257 |
WifiMac::NotifyTxDrop (Ptr<const Packet> packet) |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
258 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
259 |
m_macTxDropTrace (packet); |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
260 |
} |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3749
diff
changeset
|
261 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
262 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
263 |
WifiMac::NotifyRx (Ptr<const Packet> packet) |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
264 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
265 |
m_macRxTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
266 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
267 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
268 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
269 |
WifiMac::NotifyPromiscRx (Ptr<const Packet> packet) |
4272
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
270 |
{ |
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
271 |
m_macPromiscRxTrace (packet); |
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
272 |
} |
b40ce56e0247
Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents:
4264
diff
changeset
|
273 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
274 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
275 |
WifiMac::NotifyRxDrop (Ptr<const Packet> packet) |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
276 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
277 |
m_macRxDropTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
278 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
279 |
|
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
280 |
void |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
281 |
WifiMac::ConfigureStandard (enum WifiPhyStandard standard) |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
282 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
283 |
switch (standard) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
284 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
285 |
case WIFI_PHY_STANDARD_80211a: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
286 |
Configure80211a (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
287 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
288 |
case WIFI_PHY_STANDARD_80211b: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
289 |
Configure80211b (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
290 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
291 |
case WIFI_PHY_STANDARD_80211g: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
292 |
Configure80211g (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
293 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
294 |
case WIFI_PHY_STANDARD_80211_10MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
295 |
Configure80211_10Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
296 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
297 |
case WIFI_PHY_STANDARD_80211_5MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
298 |
Configure80211_5Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
299 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
300 |
case WIFI_PHY_STANDARD_holland: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
301 |
Configure80211a (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
302 |
break; |
10139 | 303 |
case WIFI_PHY_STANDARD_80211n_2_4GHZ: |
304 |
Configure80211n_2_4Ghz (); |
|
305 |
break; |
|
306 |
case WIFI_PHY_STANDARD_80211n_5GHZ: |
|
307 |
Configure80211n_5Ghz (); |
|
308 |
break; |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
309 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
310 |
NS_ASSERT (false); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
311 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
312 |
} |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
313 |
FinishConfigureStandard (standard); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
314 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
315 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
316 |
void |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
317 |
WifiMac::Configure80211a (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
318 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
319 |
SetSifs (MicroSeconds (16)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
320 |
SetSlot (MicroSeconds (9)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
321 |
SetEifsNoDifs (MicroSeconds (16 + 44)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
322 |
SetPifs (MicroSeconds (16 + 9)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
323 |
SetCtsTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
324 |
SetAckTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
325 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
326 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
327 |
void |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
328 |
WifiMac::Configure80211b (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
329 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
330 |
SetSifs (MicroSeconds (10)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
331 |
SetSlot (MicroSeconds (20)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
332 |
SetEifsNoDifs (MicroSeconds (10 + 304)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
333 |
SetPifs (MicroSeconds (10 + 20)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
334 |
SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
335 |
SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
336 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
337 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
338 |
void |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
339 |
WifiMac::Configure80211g (void) |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
340 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
341 |
SetSifs (MicroSeconds (10)); |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
342 |
// Note no support for Short Slot Time as yet |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
343 |
SetSlot (MicroSeconds (20)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
344 |
SetEifsNoDifs (MicroSeconds (10 + 304)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
345 |
SetPifs (MicroSeconds (10 + 20)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
346 |
SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
347 |
SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
348 |
} |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
349 |
|
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
350 |
void |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
351 |
WifiMac::Configure80211_10Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
352 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
353 |
SetSifs (MicroSeconds (32)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
354 |
SetSlot (MicroSeconds (13)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
355 |
SetEifsNoDifs (MicroSeconds (32 + 88)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
356 |
SetPifs (MicroSeconds (32 + 13)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
357 |
SetCtsTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
358 |
SetAckTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
359 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
360 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
361 |
void |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
362 |
WifiMac::Configure80211_5Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
363 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
364 |
SetSifs (MicroSeconds (64)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
365 |
SetSlot (MicroSeconds (21)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
366 |
SetEifsNoDifs (MicroSeconds (64 + 176)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
367 |
SetPifs (MicroSeconds (64 + 21)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
368 |
SetCtsTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
369 |
SetAckTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
370 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4509
diff
changeset
|
371 |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
372 |
void |
10139 | 373 |
WifiMac::Configure80211n_2_4Ghz (void) |
374 |
{ |
|
375 |
Configure80211g (); |
|
376 |
SetRifs(MicroSeconds (2)); |
|
377 |
SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
|
378 |
SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
|
11189
c17091a7616e
bug 2046: set Block Ack timeout when SetStandard is called
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
379 |
SetBasicBlockAckTimeout (GetSifs () + GetSlot () + GetDefaultBasicBlockAckDelay () + GetDefaultMaxPropagationDelay () * 2); |
c17091a7616e
bug 2046: set Block Ack timeout when SetStandard is called
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
380 |
SetCompressedBlockAckTimeout (GetSifs () + GetSlot () + GetDefaultCompressedBlockAckDelay () + GetDefaultMaxPropagationDelay () * 2); |
10139 | 381 |
} |
382 |
void |
|
383 |
WifiMac::Configure80211n_5Ghz (void) |
|
384 |
{ |
|
385 |
Configure80211a (); |
|
386 |
SetRifs(MicroSeconds (2)); |
|
387 |
SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
|
388 |
SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2)); |
|
11189
c17091a7616e
bug 2046: set Block Ack timeout when SetStandard is called
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
389 |
SetBasicBlockAckTimeout (GetSifs () + GetSlot () + GetDefaultBasicBlockAckDelay () + GetDefaultMaxPropagationDelay () * 2); |
c17091a7616e
bug 2046: set Block Ack timeout when SetStandard is called
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
390 |
SetCompressedBlockAckTimeout (GetSifs () + GetSlot () + GetDefaultCompressedBlockAckDelay () + GetDefaultMaxPropagationDelay () * 2); |
10139 | 391 |
} |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
392 |
|
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
393 |
void |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6183
diff
changeset
|
394 |
WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac) |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
395 |
{ |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
396 |
/* see IEE802.11 section 7.3.2.29 */ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
397 |
switch (ac) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
398 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
399 |
case AC_VO: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
400 |
dcf->SetMinCw ((cwmin + 1) / 4 - 1); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
401 |
dcf->SetMaxCw ((cwmin + 1) / 2 - 1); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
402 |
dcf->SetAifsn (2); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
403 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
404 |
case AC_VI: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
405 |
dcf->SetMinCw ((cwmin + 1) / 2 - 1); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
406 |
dcf->SetMaxCw (cwmin); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
407 |
dcf->SetAifsn (2); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
408 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
409 |
case AC_BE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
410 |
dcf->SetMinCw (cwmin); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
411 |
dcf->SetMaxCw (cwmax); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
412 |
dcf->SetAifsn (3); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
413 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
414 |
case AC_BK: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
415 |
dcf->SetMinCw (cwmin); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
416 |
dcf->SetMaxCw (cwmax); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
417 |
dcf->SetAifsn (7); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
418 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
419 |
case AC_BE_NQOS: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
420 |
dcf->SetMinCw (cwmin); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
421 |
dcf->SetMaxCw (cwmax); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
422 |
dcf->SetAifsn (2); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
423 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
424 |
case AC_UNDEF: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
425 |
NS_FATAL_ERROR ("I don't know what to do with this"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
426 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
427 |
} |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4680
diff
changeset
|
428 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
429 |
} // namespace ns3 |