View | Details | Raw Unified | Return to bug 3010
Collapse All | Expand All

(-)a/examples/wireless/examples-to-run.py (-3 / +3 lines)
 Lines 41-50   cpp_examples = [ Link Here 
41
    ("ht-wifi-network --simulationTime=0.1 --frequency=5 --useRts=1 --minExpectedThroughput=5 --maxExpectedThroughput=130", "True", "True"),
41
    ("ht-wifi-network --simulationTime=0.1 --frequency=5 --useRts=1 --minExpectedThroughput=5 --maxExpectedThroughput=130", "True", "True"),
42
    ("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=132", "True", "True"),
42
    ("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=132", "True", "True"),
43
    ("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=1 --minExpectedThroughput=4.5 --maxExpectedThroughput=128", "True", "True"),
43
    ("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=1 --minExpectedThroughput=4.5 --maxExpectedThroughput=128", "True", "True"),
44
    ("vht-wifi-network --simulationTime=0.1 --useRts=0  --minExpectedThroughput=5 --maxExpectedThroughput=555", "True", "True"),
44
    ("vht-wifi-network --simulationTime=0.1 --useRts=0  --minExpectedThroughput=5 --maxExpectedThroughput=607", "True", "True"),
45
    ("vht-wifi-network --simulationTime=0.2 --useRts=1", "True", "True"),
45
    ("vht-wifi-network --simulationTime=0.2 --useRts=1", "True", "True"),
46
    ("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0  --minExpectedThroughput=6 --maxExpectedThroughput=754", "True", "True"),
46
    ("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0  --minExpectedThroughput=6 --maxExpectedThroughput=844", "True", "True"),
47
    ("he-wifi-network --simulationTime=0.3 --frequency=5 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=639", "True", "True"),
47
    ("he-wifi-network --simulationTime=0.3 --frequency=5 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=745", "True", "True"),
48
    ("he-wifi-network --simulationTime=0.25 --frequency=2.4 --useRts=0 --minExpectedThroughput=6 --maxExpectedThroughput=238", "True", "True"),
48
    ("he-wifi-network --simulationTime=0.25 --frequency=2.4 --useRts=0 --minExpectedThroughput=6 --maxExpectedThroughput=238", "True", "True"),
49
    ("he-wifi-network --simulationTime=0.3 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=224", "True", "True"),
49
    ("he-wifi-network --simulationTime=0.3 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=224", "True", "True"),
50
    ("simple-ht-hidden-stations --simulationTime=1 --enableRts=0 --nMpdus=32 --minExpectedThroughput=59 --maxExpectedThroughput=60", "True", "True"),
50
    ("simple-ht-hidden-stations --simulationTime=1 --enableRts=0 --nMpdus=32 --minExpectedThroughput=59 --maxExpectedThroughput=60", "True", "True"),
(-)a/examples/wireless/he-wifi-network.cc (-1 / +4 lines)
 Lines 62-67   int main (int argc, char *argv[]) Link Here 
62
{
62
{
63
  bool udp = true;
63
  bool udp = true;
64
  bool useRts = false;
64
  bool useRts = false;
65
  bool useExtendedBlockAck = false;
65
  double simulationTime = 10; //seconds
66
  double simulationTime = 10; //seconds
66
  double distance = 1.0; //meters
67
  double distance = 1.0; //meters
67
  double frequency = 5.0; //whether 2.4 or 5.0 GHz
68
  double frequency = 5.0; //whether 2.4 or 5.0 GHz
 Lines 75-80   int main (int argc, char *argv[]) Link Here 
75
  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
76
  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
76
  cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
77
  cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
77
  cmd.AddValue ("useRts", "Enable/disable RTS/CTS", useRts);
78
  cmd.AddValue ("useRts", "Enable/disable RTS/CTS", useRts);
79
  cmd.AddValue ("useExtendedBlockAck", "Enable/disable use of extended BACK", useExtendedBlockAck);
78
  cmd.AddValue ("mcs", "if set, limit testing to a specific MCS (0-7)", mcs);
80
  cmd.AddValue ("mcs", "if set, limit testing to a specific MCS (0-7)", mcs);
79
  cmd.AddValue ("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput);
81
  cmd.AddValue ("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput);
80
  cmd.AddValue ("maxExpectedThroughput", "if set, simulation fails if the highest throughput is above this value", maxExpectedThroughput);
82
  cmd.AddValue ("maxExpectedThroughput", "if set, simulation fails if the highest throughput is above this value", maxExpectedThroughput);
 Lines 164-172   int main (int argc, char *argv[]) Link Here 
164
              NetDeviceContainer apDevice;
166
              NetDeviceContainer apDevice;
165
              apDevice = wifi.Install (phy, mac, wifiApNode);
167
              apDevice = wifi.Install (phy, mac, wifiApNode);
166
168
167
              // Set channel width and guard interval
169
              // Set channel width, guard interval and MPDU buffer size
168
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
170
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
169
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/GuardInterval", TimeValue (NanoSeconds (gi)));
171
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/GuardInterval", TimeValue (NanoSeconds (gi)));
172
              Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/MpduBufferSize", UintegerValue (useExtendedBlockAck ? 256 : 64));
170
173
171
              // mobility.
174
              // mobility.
172
              MobilityHelper mobility;
175
              MobilityHelper mobility;
(-)a/examples/wireless/wifi-aggregation.cc (-19 / +58 lines)
 Lines 32-37    Link Here 
32
#include "ns3/udp-client-server-helper.h"
32
#include "ns3/udp-client-server-helper.h"
33
#include "ns3/packet-sink-helper.h"
33
#include "ns3/packet-sink-helper.h"
34
#include "ns3/yans-wifi-channel.h"
34
#include "ns3/yans-wifi-channel.h"
35
#include "ns3/wifi-net-device.h"
36
#include "ns3/ht-configuration.h"
35
37
36
// This is an example that illustrates how 802.11n aggregation is configured.
38
// This is an example that illustrates how 802.11n aggregation is configured.
37
// It defines 4 independent Wi-Fi networks (working on different channels).
39
// It defines 4 independent Wi-Fi networks (working on different channels).
 Lines 109-115   int main (int argc, char *argv[]) Link Here 
109
  NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD;
111
  NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD;
110
  Ssid ssid;
112
  Ssid ssid;
111
113
112
  //Network A
114
  // Network A
113
  ssid = Ssid ("network-A");
115
  ssid = Ssid ("network-A");
114
  phy.Set ("ChannelNumber", UintegerValue (36));
116
  phy.Set ("ChannelNumber", UintegerValue (36));
115
  mac.SetType ("ns3::StaWifiMac",
117
  mac.SetType ("ns3::StaWifiMac",
 Lines 121-181   int main (int argc, char *argv[]) Link Here 
121
               "EnableBeaconJitter", BooleanValue (false));
123
               "EnableBeaconJitter", BooleanValue (false));
122
  apDeviceA = wifi.Install (phy, mac, wifiApNodes.Get (0));
124
  apDeviceA = wifi.Install (phy, mac, wifiApNodes.Get (0));
123
125
124
  //Network B
126
  // Network B
125
  ssid = Ssid ("network-B");
127
  ssid = Ssid ("network-B");
126
  phy.Set ("ChannelNumber", UintegerValue (40));
128
  phy.Set ("ChannelNumber", UintegerValue (40));
127
  mac.SetType ("ns3::StaWifiMac",
129
  mac.SetType ("ns3::StaWifiMac",
128
               "Ssid", SsidValue (ssid),
130
               "Ssid", SsidValue (ssid));
129
               "BE_MaxAmpduSize", UintegerValue (0)); //Disable A-MPDU
130
131
131
  staDeviceB = wifi.Install (phy, mac, wifiStaNodes.Get (1));
132
  staDeviceB = wifi.Install (phy, mac, wifiStaNodes.Get (1));
133
  
134
  // Disable A-MPDU
135
  Ptr<NetDevice> dev = wifiStaNodes.Get (1)->GetDevice (0);
136
  Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
137
  Ptr<HtConfiguration> htConfiguration = wifi_dev->GetHtConfiguration ();
138
  htConfiguration->SetBeMaxAmpduSize (0);
132
139
133
  mac.SetType ("ns3::ApWifiMac",
140
  mac.SetType ("ns3::ApWifiMac",
134
               "Ssid", SsidValue (ssid),
141
               "Ssid", SsidValue (ssid),
135
               "EnableBeaconJitter", BooleanValue (false));
142
               "EnableBeaconJitter", BooleanValue (false));
136
  apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1));
143
  apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1));
137
144
  
138
  //Network C
145
  // Disable A-MPDU
146
  dev = wifiApNodes.Get (1)->GetDevice (0);
147
  wifi_dev = DynamicCast<WifiNetDevice> (dev);
148
  htConfiguration = wifi_dev->GetHtConfiguration ();
149
  htConfiguration->SetBeMaxAmpduSize (0);
150
151
  // Network C
139
  ssid = Ssid ("network-C");
152
  ssid = Ssid ("network-C");
140
  phy.Set ("ChannelNumber", UintegerValue (44));
153
  phy.Set ("ChannelNumber", UintegerValue (44));
141
  mac.SetType ("ns3::StaWifiMac",
154
  mac.SetType ("ns3::StaWifiMac",
142
               "Ssid", SsidValue (ssid),
155
               "Ssid", SsidValue (ssid));
143
               "BE_MaxAmpduSize", UintegerValue (0), //Disable A-MPDU
144
               "BE_MaxAmsduSize", UintegerValue (7935)); //Enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
145
156
146
  staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2));
157
  staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2));
147
158
159
  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
160
  dev = wifiStaNodes.Get (2)->GetDevice (0);
161
  wifi_dev = DynamicCast<WifiNetDevice> (dev);
162
  htConfiguration = wifi_dev->GetHtConfiguration ();
163
  htConfiguration->SetBeMaxAmpduSize (0);
164
  htConfiguration->SetBeMaxAmsduSize (7935);
165
148
  mac.SetType ("ns3::ApWifiMac",
166
  mac.SetType ("ns3::ApWifiMac",
149
               "Ssid", SsidValue (ssid),
167
               "Ssid", SsidValue (ssid),
150
               "EnableBeaconJitter", BooleanValue (false));
168
               "EnableBeaconJitter", BooleanValue (false));
151
  apDeviceC = wifi.Install (phy, mac, wifiApNodes.Get (2));
169
  apDeviceC = wifi.Install (phy, mac, wifiApNodes.Get (2));
152
170
153
  //Network D
171
  // Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
172
  dev = wifiApNodes.Get (2)->GetDevice (0);
173
  wifi_dev = DynamicCast<WifiNetDevice> (dev);
174
  htConfiguration = wifi_dev->GetHtConfiguration ();
175
  htConfiguration->SetBeMaxAmpduSize (0);
176
  htConfiguration->SetBeMaxAmsduSize (7935);
177
178
  // Network D
154
  ssid = Ssid ("network-D");
179
  ssid = Ssid ("network-D");
155
  phy.Set ("ChannelNumber", UintegerValue (48));
180
  phy.Set ("ChannelNumber", UintegerValue (48));
156
  mac.SetType ("ns3::StaWifiMac",
181
  mac.SetType ("ns3::StaWifiMac",
157
               "Ssid", SsidValue (ssid),
182
               "Ssid", SsidValue (ssid));
158
               "BE_MaxAmpduSize", UintegerValue (32768), //Enable A-MPDU with a smaller size than the default one
159
               "BE_MaxAmsduSize", UintegerValue (3839)); //Enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
160
183
161
  staDeviceD = wifi.Install (phy, mac, wifiStaNodes.Get (3));
184
  staDeviceD = wifi.Install (phy, mac, wifiStaNodes.Get (3));
162
185
186
  // Enable A-MPDU with a smaller size than the default one and
187
  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
188
  dev = wifiStaNodes.Get (3)->GetDevice (0);
189
  wifi_dev = DynamicCast<WifiNetDevice> (dev);
190
  htConfiguration = wifi_dev->GetHtConfiguration ();
191
  htConfiguration->SetBeMaxAmpduSize (32768);
192
  htConfiguration->SetBeMaxAmsduSize (3839);
193
163
  mac.SetType ("ns3::ApWifiMac",
194
  mac.SetType ("ns3::ApWifiMac",
164
               "Ssid", SsidValue (ssid),
195
               "Ssid", SsidValue (ssid),
165
               "EnableBeaconJitter", BooleanValue (false));
196
               "EnableBeaconJitter", BooleanValue (false));
166
  apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3));
197
  apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3));
167
198
168
  /* Setting mobility model */
199
  // Enable A-MPDU with a smaller size than the default one and
200
  // enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
201
  dev = wifiApNodes.Get (3)->GetDevice (0);
202
  wifi_dev = DynamicCast<WifiNetDevice> (dev);
203
  htConfiguration = wifi_dev->GetHtConfiguration ();
204
  htConfiguration->SetBeMaxAmpduSize (32768);
205
  htConfiguration->SetBeMaxAmsduSize (3839);
206
207
  // Setting mobility model
169
  MobilityHelper mobility;
208
  MobilityHelper mobility;
170
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
209
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
171
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
210
  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
172
211
173
  //Set position for APs
212
  // Set position for APs
174
  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
213
  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
175
  positionAlloc->Add (Vector (10.0, 0.0, 0.0));
214
  positionAlloc->Add (Vector (10.0, 0.0, 0.0));
176
  positionAlloc->Add (Vector (20.0, 0.0, 0.0));
215
  positionAlloc->Add (Vector (20.0, 0.0, 0.0));
177
  positionAlloc->Add (Vector (30.0, 0.0, 0.0));
216
  positionAlloc->Add (Vector (30.0, 0.0, 0.0));
178
  //Set position for STAs
217
  // Set position for STAs
179
  positionAlloc->Add (Vector (distance, 0.0, 0.0));
218
  positionAlloc->Add (Vector (distance, 0.0, 0.0));
180
  positionAlloc->Add (Vector (10 + distance, 0.0, 0.0));
219
  positionAlloc->Add (Vector (10 + distance, 0.0, 0.0));
181
  positionAlloc->Add (Vector (20 + distance, 0.0, 0.0));
220
  positionAlloc->Add (Vector (20 + distance, 0.0, 0.0));
 Lines 185-191   int main (int argc, char *argv[]) Link Here 
185
  mobility.Install (wifiApNodes);
224
  mobility.Install (wifiApNodes);
186
  mobility.Install (wifiStaNodes);
225
  mobility.Install (wifiStaNodes);
187
226
188
  /* Internet stack */
227
  // Internet stack
189
  InternetStackHelper stack;
228
  InternetStackHelper stack;
190
  stack.Install (wifiApNodes);
229
  stack.Install (wifiApNodes);
191
  stack.Install (wifiStaNodes);
230
  stack.Install (wifiStaNodes);
 Lines 215-221   int main (int argc, char *argv[]) Link Here 
215
  Ipv4InterfaceContainer ApInterfaceD;
254
  Ipv4InterfaceContainer ApInterfaceD;
216
  ApInterfaceD = address.Assign (apDeviceD);
255
  ApInterfaceD = address.Assign (apDeviceD);
217
256
218
  /* Setting applications */
257
  // Setting applications
219
  uint16_t port = 9;
258
  uint16_t port = 9;
220
  UdpServerHelper serverA (port);
259
  UdpServerHelper serverA (port);
221
  ApplicationContainer serverAppA = serverA.Install (wifiStaNodes.Get (0));
260
  ApplicationContainer serverAppA = serverA.Install (wifiStaNodes.Get (0));
 Lines 288-294   int main (int argc, char *argv[]) Link Here 
288
  Simulator::Stop (Seconds (simulationTime + 1));
327
  Simulator::Stop (Seconds (simulationTime + 1));
289
  Simulator::Run ();
328
  Simulator::Run ();
290
329
291
  /* Show results */
330
  // Show results
292
  uint64_t totalPacketsThroughA = DynamicCast<UdpServer> (serverAppA.Get (0))->GetReceived ();
331
  uint64_t totalPacketsThroughA = DynamicCast<UdpServer> (serverAppA.Get (0))->GetReceived ();
293
  uint64_t totalPacketsThroughB = DynamicCast<UdpServer> (serverAppB.Get (0))->GetReceived ();
332
  uint64_t totalPacketsThroughB = DynamicCast<UdpServer> (serverAppB.Get (0))->GetReceived ();
294
  uint64_t totalPacketsThroughC = DynamicCast<UdpServer> (serverAppC.Get (0))->GetReceived ();
333
  uint64_t totalPacketsThroughC = DynamicCast<UdpServer> (serverAppC.Get (0))->GetReceived ();
(-)a/src/wifi/model/he-configuration.cc (+160 lines)
 Lines 57-62   HeConfiguration::GetTypeId (void) Link Here 
57
                   MakeUintegerAccessor (&HeConfiguration::GetMpduBufferSize,
57
                   MakeUintegerAccessor (&HeConfiguration::GetMpduBufferSize,
58
                                         &HeConfiguration::SetMpduBufferSize),
58
                                         &HeConfiguration::SetMpduBufferSize),
59
                   MakeUintegerChecker<uint16_t> (64, 256))
59
                   MakeUintegerChecker<uint16_t> (64, 256))
60
    .AddAttribute ("VO_MaxAmsduSize",
61
                   "Maximum length in bytes of an A-MSDU for AC_VO access class. "
62
                   "Value 0 means A-MSDU is disabled for that AC.",
63
                   UintegerValue (0),
64
                   MakeUintegerAccessor (&HeConfiguration::SetVoMaxAmsduSize,
65
                                         &HeConfiguration::GetVoMaxAmsduSize),
66
                   MakeUintegerChecker<uint16_t> (0, 11454))
67
    .AddAttribute ("VI_MaxAmsduSize",
68
                   "Maximum length in bytes of an A-MSDU for AC_VI access class."
69
                   "Value 0 means A-MSDU is disabled for that AC.",
70
                   UintegerValue (0),
71
                   MakeUintegerAccessor (&HeConfiguration::SetViMaxAmsduSize,
72
                                         &HeConfiguration::GetViMaxAmsduSize),
73
                   MakeUintegerChecker<uint16_t> (0, 11454))
74
    .AddAttribute ("BE_MaxAmsduSize",
75
                   "Maximum length in bytes of an A-MSDU for AC_BE access class."
76
                   "Value 0 means A-MSDU is disabled for that AC.",
77
                   UintegerValue (0),
78
                   MakeUintegerAccessor (&HeConfiguration::SetBeMaxAmsduSize,
79
                                         &HeConfiguration::GetBeMaxAmsduSize),
80
                   MakeUintegerChecker<uint16_t> (0, 11454))
81
    .AddAttribute ("BK_MaxAmsduSize",
82
                   "Maximum length in bytes of an A-MSDU for AC_BK access class."
83
                   "Value 0 means A-MSDU is disabled for that AC.",
84
                   UintegerValue (0),
85
                   MakeUintegerAccessor (&HeConfiguration::SetBkMaxAmsduSize,
86
                                         &HeConfiguration::GetBkMaxAmsduSize),
87
                   MakeUintegerChecker<uint16_t> (0, 11454))
88
    .AddAttribute ("VO_MaxAmpduSize",
89
                   "Maximum length in bytes of an A-MPDU for AC_VO access class."
90
                   "Value 0 means A-MPDU is disabled for that AC.",
91
                   UintegerValue (0),
92
                   MakeUintegerAccessor (&HeConfiguration::SetVoMaxAmpduSize,
93
                                         &HeConfiguration::GetVoMaxAmpduSize),
94
                   MakeUintegerChecker<uint32_t> (0, 4194303))
95
    .AddAttribute ("VI_MaxAmpduSize",
96
                   "Maximum length in bytes of an A-MPDU for AC_VI access class."
97
                   "Value 0 means A-MPDU is disabled for that AC.",
98
                   UintegerValue (4194303),
99
                   MakeUintegerAccessor (&HeConfiguration::SetViMaxAmpduSize,
100
                                         &HeConfiguration::GetViMaxAmpduSize),
101
                   MakeUintegerChecker<uint32_t> (0, 4194303))
102
    .AddAttribute ("BE_MaxAmpduSize",
103
                   "Maximum length in bytes of an A-MPDU for AC_BE access class."
104
                   "Value 0 means A-MPDU is disabled for that AC.",
105
                   UintegerValue (4194303),
106
                   MakeUintegerAccessor (&HeConfiguration::SetBeMaxAmpduSize,
107
                                         &HeConfiguration::GetBeMaxAmpduSize),
108
                   MakeUintegerChecker<uint32_t> (0, 4194303))
109
    .AddAttribute ("BK_MaxAmpduSize",
110
                   "Maximum length in bytes of an A-MPDU for AC_BK access class."
111
                   "Value 0 means A-MPDU is disabled for that AC.",
112
                   UintegerValue (0),
113
                   MakeUintegerAccessor (&HeConfiguration::SetBkMaxAmpduSize,
114
                                         &HeConfiguration::GetBkMaxAmpduSize),
115
                   MakeUintegerChecker<uint32_t> (0, 4194303))
60
    ;
116
    ;
61
    return tid;
117
    return tid;
62
}
118
}
 Lines 88-91   HeConfiguration::GetMpduBufferSize (void) const Link Here 
88
  return m_mpduBufferSize;
144
  return m_mpduBufferSize;
89
}
145
}
90
146
147
void
148
HeConfiguration::SetVoMaxAmsduSize (uint16_t size)
149
{
150
  NS_LOG_FUNCTION (this << size);
151
  m_voMaxAmsduSize = size;
152
}
153
154
uint16_t
155
HeConfiguration::GetVoMaxAmsduSize (void) const
156
{
157
  return m_voMaxAmsduSize;
158
}
159
160
void
161
HeConfiguration::SetViMaxAmsduSize (uint16_t size)
162
{
163
  NS_LOG_FUNCTION (this << size);
164
  m_viMaxAmsduSize = size;
165
}
166
167
uint16_t
168
HeConfiguration::GetViMaxAmsduSize (void) const
169
{
170
  return m_viMaxAmsduSize;
171
}
172
173
void
174
HeConfiguration::SetBeMaxAmsduSize (uint16_t size)
175
{
176
  NS_LOG_FUNCTION (this << size);
177
  m_beMaxAmsduSize = size;
178
}
179
180
uint16_t
181
HeConfiguration::GetBeMaxAmsduSize (void) const
182
{
183
  return m_beMaxAmsduSize;
184
}
185
186
void
187
HeConfiguration::SetBkMaxAmsduSize (uint16_t size)
188
{
189
  NS_LOG_FUNCTION (this << size);
190
  m_bkMaxAmsduSize = size;
191
}
192
193
uint16_t
194
HeConfiguration::GetBkMaxAmsduSize (void) const
195
{
196
  return m_bkMaxAmsduSize;
197
}
198
199
void
200
HeConfiguration::SetVoMaxAmpduSize (uint32_t size)
201
{
202
  NS_LOG_FUNCTION (this << size);
203
  m_voMaxAmpduSize = size;
204
}
205
206
uint32_t
207
HeConfiguration::GetVoMaxAmpduSize (void) const
208
{
209
  return m_voMaxAmpduSize;
210
}
211
212
void
213
HeConfiguration::SetViMaxAmpduSize (uint32_t size)
214
{
215
  NS_LOG_FUNCTION (this << size);
216
  m_viMaxAmpduSize = size;
217
}
218
219
uint32_t
220
HeConfiguration::GetViMaxAmpduSize (void) const
221
{
222
  return m_viMaxAmpduSize;
223
}
224
225
void
226
HeConfiguration::SetBeMaxAmpduSize (uint32_t size)
227
{
228
  NS_LOG_FUNCTION (this << size);
229
  m_beMaxAmpduSize = size;
230
}
231
232
uint32_t
233
HeConfiguration::GetBeMaxAmpduSize (void) const
234
{
235
  return m_beMaxAmpduSize;
236
}
237
238
void
239
HeConfiguration::SetBkMaxAmpduSize (uint32_t size)
240
{
241
  NS_LOG_FUNCTION (this << size);
242
  m_bkMaxAmpduSize = size;
243
}
244
245
uint32_t
246
HeConfiguration::GetBkMaxAmpduSize (void) const
247
{
248
  return m_bkMaxAmpduSize;
249
}
250
91
} //namespace ns3
251
} //namespace ns3
(-)a/src/wifi/model/he-configuration.h (+90 lines)
 Lines 54-65   public: Link Here 
54
   * \return the MPDU buffer size to receive A-MPDUs
54
   * \return the MPDU buffer size to receive A-MPDUs
55
   */
55
   */
56
  uint16_t GetMpduBufferSize (void) const;
56
  uint16_t GetMpduBufferSize (void) const;
57
  /**
58
   * Set the maximum A-MSDU size for AC_VO.
59
   *
60
   * \param size the maximum A-MSDU size for AC_VO.
61
   */
62
  void SetVoMaxAmsduSize (uint16_t size);
63
  /**
64
   * \return the maximum A-MSDU size for AC_VO.
65
   */
66
  uint16_t GetVoMaxAmsduSize (void) const;
67
  /**
68
   * Set the maximum A-MSDU size for AC_VI.
69
   *
70
   * \param size the maximum A-MSDU size for AC_VI.
71
   */
72
  void SetViMaxAmsduSize (uint16_t size);
73
  /**
74
   * \return the maximum A-MSDU size for AC_VI.
75
   */
76
  uint16_t GetViMaxAmsduSize (void) const;
77
  /**
78
   * Set the maximum A-MSDU size for AC_BE.
79
   *
80
   * \param size the maximum A-MSDU size for AC_BE.
81
   */
82
  void SetBeMaxAmsduSize (uint16_t size);
83
  /**
84
   * \return the maximum A-MSDU size for AC_BE.
85
   */
86
  uint16_t GetBeMaxAmsduSize (void) const;
87
  /**
88
   * Set the maximum A-MSDU size for AC_BK.
89
   *
90
   * \param size the maximum A-MSDU size for AC_BK.
91
   */
92
  void SetBkMaxAmsduSize (uint16_t size);
93
  /**
94
   * \return the maximum A-MSDU size for AC_BK.
95
   */
96
  uint16_t GetBkMaxAmsduSize (void) const;
97
  /**
98
   * Set the maximum A-MPDU size for AC_VO.
99
   *
100
   * \param size the maximum A-MPDU size for AC_VO.
101
   */
102
  void SetVoMaxAmpduSize (uint32_t size);
103
  /**
104
   * \return the maximum A-MPDU size for AC_VO.
105
   */
106
  uint32_t GetVoMaxAmpduSize (void) const;
107
  /**
108
   * Set the maximum A-MPDU size for AC_VI.
109
   *
110
   * \param size the maximum A-MPDU size for AC_VI.
111
   */
112
  void SetViMaxAmpduSize (uint32_t size);
113
  /**
114
   * \return the maximum A-MPDU size for AC_VI.
115
   */
116
  uint32_t GetViMaxAmpduSize (void) const;
117
  /**
118
   * Set the maximum A-MPDU size for AC_BE.
119
   *
120
   * \param size the maximum A-MPDU size for AC_BE.
121
   */
122
  void SetBeMaxAmpduSize (uint32_t size);
123
  /**
124
   * \return the maximum A-MPDU size for AC_BE.
125
   */
126
  uint32_t GetBeMaxAmpduSize (void) const;
127
  /**
128
   * Set the maximum A-MPDU size for AC_BK.
129
   *
130
   * \param size the maximum A-MPDU size for AC_BK.
131
   */
132
  void SetBkMaxAmpduSize (uint32_t size);
133
  /**
134
   * \return the maximum A-MPDU size for AC_BK.
135
   */
136
  uint32_t GetBkMaxAmpduSize (void) const;
57
137
58
138
59
private:
139
private:
60
  Time m_guardInterval;      //!< Supported HE guard interval
140
  Time m_guardInterval;      //!< Supported HE guard interval
61
  uint8_t m_bssColor;        //!< BSS color
141
  uint8_t m_bssColor;        //!< BSS color
62
  uint16_t m_mpduBufferSize; //!< MPDU buffer size
142
  uint16_t m_mpduBufferSize; //!< MPDU buffer size
143
144
  uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
145
  uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
146
  uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
147
  uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
148
149
  uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
150
  uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
151
  uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
152
  uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
63
};
153
};
64
154
65
} //namespace ns3
155
} //namespace ns3
(-)a/src/wifi/model/ht-configuration.cc (+161 lines)
 Lines 20-25    Link Here 
20
20
21
#include "ns3/log.h"
21
#include "ns3/log.h"
22
#include "ns3/boolean.h"
22
#include "ns3/boolean.h"
23
#include "ns3/uinteger.h"
23
#include "ht-configuration.h"
24
#include "ht-configuration.h"
24
25
25
namespace ns3 {
26
namespace ns3 {
 Lines 63-68   HtConfiguration::GetTypeId (void) Link Here 
63
                   MakeBooleanAccessor (&HtConfiguration::SetRifsSupported,
64
                   MakeBooleanAccessor (&HtConfiguration::SetRifsSupported,
64
                                        &HtConfiguration::GetRifsSupported),
65
                                        &HtConfiguration::GetRifsSupported),
65
                   MakeBooleanChecker ())
66
                   MakeBooleanChecker ())
67
    .AddAttribute ("VO_MaxAmsduSize",
68
                   "Maximum length in bytes of an A-MSDU for AC_VO access class. "
69
                   "Value 0 means A-MSDU is disabled for that AC.",
70
                   UintegerValue (0),
71
                   MakeUintegerAccessor (&HtConfiguration::SetVoMaxAmsduSize,
72
                                         &HtConfiguration::GetVoMaxAmsduSize),
73
                   MakeUintegerChecker<uint16_t> (0, 7935))
74
    .AddAttribute ("VI_MaxAmsduSize",
75
                   "Maximum length in bytes of an A-MSDU for AC_VI access class."
76
                   "Value 0 means A-MSDU is disabled for that AC.",
77
                   UintegerValue (0),
78
                   MakeUintegerAccessor (&HtConfiguration::SetViMaxAmsduSize,
79
                                         &HtConfiguration::GetViMaxAmsduSize),
80
                   MakeUintegerChecker<uint16_t> (0, 7935))
81
    .AddAttribute ("BE_MaxAmsduSize",
82
                   "Maximum length in bytes of an A-MSDU for AC_BE access class."
83
                   "Value 0 means A-MSDU is disabled for that AC.",
84
                   UintegerValue (0),
85
                   MakeUintegerAccessor (&HtConfiguration::SetBeMaxAmsduSize,
86
                                         &HtConfiguration::GetBeMaxAmsduSize),
87
                   MakeUintegerChecker<uint16_t> (0, 7935))
88
    .AddAttribute ("BK_MaxAmsduSize",
89
                   "Maximum length in bytes of an A-MSDU for AC_BK access class."
90
                   "Value 0 means A-MSDU is disabled for that AC.",
91
                   UintegerValue (0),
92
                   MakeUintegerAccessor (&HtConfiguration::SetBkMaxAmsduSize,
93
                                         &HtConfiguration::GetBkMaxAmsduSize),
94
                   MakeUintegerChecker<uint16_t> (0, 7935))
95
    .AddAttribute ("VO_MaxAmpduSize",
96
                   "Maximum length in bytes of an A-MPDU for AC_VO access class."
97
                   "Value 0 means A-MPDU is disabled for that AC.",
98
                   UintegerValue (0),
99
                   MakeUintegerAccessor (&HtConfiguration::SetVoMaxAmpduSize,
100
                                         &HtConfiguration::GetVoMaxAmpduSize),
101
                   MakeUintegerChecker<uint32_t> (0, 65535))
102
    .AddAttribute ("VI_MaxAmpduSize",
103
                   "Maximum length in bytes of an A-MPDU for AC_VI access class."
104
                   "Value 0 means A-MPDU is disabled for that AC.",
105
                   UintegerValue (65535),
106
                   MakeUintegerAccessor (&HtConfiguration::SetViMaxAmpduSize,
107
                                         &HtConfiguration::GetViMaxAmpduSize),
108
                   MakeUintegerChecker<uint32_t> (0, 65535))
109
    .AddAttribute ("BE_MaxAmpduSize",
110
                   "Maximum length in bytes of an A-MPDU for AC_BE access class."
111
                   "Value 0 means A-MPDU is disabled for that AC.",
112
                   UintegerValue (65535),
113
                   MakeUintegerAccessor (&HtConfiguration::SetBeMaxAmpduSize,
114
                                         &HtConfiguration::GetBeMaxAmpduSize),
115
                   MakeUintegerChecker<uint32_t> (0, 65535))
116
    .AddAttribute ("BK_MaxAmpduSize",
117
                   "Maximum length in bytes of an A-MPDU for AC_BK access class."
118
                   "Value 0 means A-MPDU is disabled for that AC.",
119
                   UintegerValue (0),
120
                   MakeUintegerAccessor (&HtConfiguration::SetBkMaxAmpduSize,
121
                                         &HtConfiguration::GetBkMaxAmpduSize),
122
                   MakeUintegerChecker<uint32_t> (0, 65535))
66
    ;
123
    ;
67
    return tid;
124
    return tid;
68
}
125
}
 Lines 106-109   HtConfiguration::GetRifsSupported (void) const Link Here 
106
  return m_rifsSupported;
163
  return m_rifsSupported;
107
}
164
}
108
165
166
void
167
HtConfiguration::SetVoMaxAmsduSize (uint16_t size)
168
{
169
  NS_LOG_FUNCTION (this << size);
170
  m_voMaxAmsduSize = size;
171
}
172
173
uint16_t
174
HtConfiguration::GetVoMaxAmsduSize (void) const
175
{
176
  return m_voMaxAmsduSize;
177
}
178
179
void
180
HtConfiguration::SetViMaxAmsduSize (uint16_t size)
181
{
182
  NS_LOG_FUNCTION (this << size);
183
  m_viMaxAmsduSize = size;
184
}
185
186
uint16_t
187
HtConfiguration::GetViMaxAmsduSize (void) const
188
{
189
  return m_viMaxAmsduSize;
190
}
191
192
void
193
HtConfiguration::SetBeMaxAmsduSize (uint16_t size)
194
{
195
  NS_LOG_FUNCTION (this << size);
196
  m_beMaxAmsduSize = size;
197
}
198
199
uint16_t
200
HtConfiguration::GetBeMaxAmsduSize (void) const
201
{
202
  return m_beMaxAmsduSize;
203
}
204
205
void
206
HtConfiguration::SetBkMaxAmsduSize (uint16_t size)
207
{
208
  NS_LOG_FUNCTION (this << size);
209
  m_bkMaxAmsduSize = size;
210
}
211
212
uint16_t
213
HtConfiguration::GetBkMaxAmsduSize (void) const
214
{
215
  return m_bkMaxAmsduSize;
216
}
217
218
void
219
HtConfiguration::SetVoMaxAmpduSize (uint32_t size)
220
{
221
  NS_LOG_FUNCTION (this << size);
222
  m_voMaxAmpduSize = size;
223
}
224
225
uint32_t
226
HtConfiguration::GetVoMaxAmpduSize (void) const
227
{
228
  return m_voMaxAmpduSize;
229
}
230
231
void
232
HtConfiguration::SetViMaxAmpduSize (uint32_t size)
233
{
234
  NS_LOG_FUNCTION (this << size);
235
  m_viMaxAmpduSize = size;
236
}
237
238
uint32_t
239
HtConfiguration::GetViMaxAmpduSize (void) const
240
{
241
  return m_viMaxAmpduSize;
242
}
243
244
void
245
HtConfiguration::SetBeMaxAmpduSize (uint32_t size)
246
{
247
  NS_LOG_FUNCTION (this << size);
248
  m_beMaxAmpduSize = size;
249
}
250
251
uint32_t
252
HtConfiguration::GetBeMaxAmpduSize (void) const
253
{
254
  return m_beMaxAmpduSize;
255
}
256
257
void
258
HtConfiguration::SetBkMaxAmpduSize (uint32_t size)
259
{
260
  NS_LOG_FUNCTION (this << size);
261
  m_bkMaxAmpduSize = size;
262
}
263
264
uint32_t
265
HtConfiguration::GetBkMaxAmpduSize (void) const
266
{
267
  return m_bkMaxAmpduSize;
268
}
269
109
} //namespace ns3
270
} //namespace ns3
(-)a/src/wifi/model/ht-configuration.h (-4 / +92 lines)
 Lines 55-61   public: Link Here 
55
   *         false otherwise.
55
   *         false otherwise.
56
   */
56
   */
57
  bool GetShortGuardIntervalSupported (void) const;
57
  bool GetShortGuardIntervalSupported (void) const;
58
59
  /**
58
  /**
60
   * Enable or disable Greenfield support.
59
   * Enable or disable Greenfield support.
61
   *
60
   *
 Lines 70-76   public: Link Here 
70
   *         false otherwise.
69
   *         false otherwise.
71
   */
70
   */
72
  bool GetGreenfieldSupported (void) const;
71
  bool GetGreenfieldSupported (void) const;
73
74
  /**
72
  /**
75
   * Enable or disable RIFS support.
73
   * Enable or disable RIFS support.
76
   *
74
   *
 Lines 85-96   public: Link Here 
85
   *         false otherwise.
83
   *         false otherwise.
86
   */
84
   */
87
  bool GetRifsSupported (void) const;
85
  bool GetRifsSupported (void) const;
86
  /**
87
   * Set the maximum A-MSDU size for AC_VO.
88
   *
89
   * \param size the maximum A-MSDU size for AC_VO.
90
   */
91
  void SetVoMaxAmsduSize (uint16_t size);
92
  /**
93
   * \return the maximum A-MSDU size for AC_VO.
94
   */
95
  uint16_t GetVoMaxAmsduSize (void) const;
96
  /**
97
   * Set the maximum A-MSDU size for AC_VI.
98
   *
99
   * \param size the maximum A-MSDU size for AC_VI.
100
   */
101
  void SetViMaxAmsduSize (uint16_t size);
102
  /**
103
   * \return the maximum A-MSDU size for AC_VI.
104
   */
105
  uint16_t GetViMaxAmsduSize (void) const;
106
  /**
107
   * Set the maximum A-MSDU size for AC_BE.
108
   *
109
   * \param size the maximum A-MSDU size for AC_BE.
110
   */
111
  void SetBeMaxAmsduSize (uint16_t size);
112
  /**
113
   * \return the maximum A-MSDU size for AC_BE.
114
   */
115
  uint16_t GetBeMaxAmsduSize (void) const;
116
  /**
117
   * Set the maximum A-MSDU size for AC_BK.
118
   *
119
   * \param size the maximum A-MSDU size for AC_BK.
120
   */
121
  void SetBkMaxAmsduSize (uint16_t size);
122
  /**
123
   * \return the maximum A-MSDU size for AC_BK.
124
   */
125
  uint16_t GetBkMaxAmsduSize (void) const;
126
  /**
127
   * Set the maximum A-MPDU size for AC_VO.
128
   *
129
   * \param size the maximum A-MPDU size for AC_VO.
130
   */
131
  void SetVoMaxAmpduSize (uint32_t size);
132
  /**
133
   * \return the maximum A-MPDU size for AC_VO.
134
   */
135
  uint32_t GetVoMaxAmpduSize (void) const;
136
  /**
137
   * Set the maximum A-MPDU size for AC_VI.
138
   *
139
   * \param size the maximum A-MPDU size for AC_VI.
140
   */
141
  void SetViMaxAmpduSize (uint32_t size);
142
  /**
143
   * \return the maximum A-MPDU size for AC_VI.
144
   */
145
  uint32_t GetViMaxAmpduSize (void) const;
146
  /**
147
   * Set the maximum A-MPDU size for AC_BE.
148
   *
149
   * \param size the maximum A-MPDU size for AC_BE.
150
   */
151
  void SetBeMaxAmpduSize (uint32_t size);
152
  /**
153
   * \return the maximum A-MPDU size for AC_BE.
154
   */
155
  uint32_t GetBeMaxAmpduSize (void) const;
156
  /**
157
   * Set the maximum A-MPDU size for AC_BK.
158
   *
159
   * \param size the maximum A-MPDU size for AC_BK.
160
   */
161
  void SetBkMaxAmpduSize (uint32_t size);
162
  /**
163
   * \return the maximum A-MPDU size for AC_BK.
164
   */
165
  uint32_t GetBkMaxAmpduSize (void) const;
88
166
89
167
90
private:
168
private:
91
  bool m_sgiSupported; ///< flag whether short guard interval is supported
169
  bool m_sgiSupported;        ///< flag whether short guard interval is supported
92
  bool m_rifsSupported; ///< flag whether RIFS is supported
170
  bool m_rifsSupported;       ///< flag whether RIFS is supported
93
  bool m_greenfieldSupported; ///< flag whether Greenfield is supported
171
  bool m_greenfieldSupported; ///< flag whether Greenfield is supported
172
173
  uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
174
  uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
175
  uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
176
  uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
177
178
  uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
179
  uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
180
  uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
181
  uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
94
};
182
};
95
183
96
} //namespace ns3
184
} //namespace ns3
(-)a/src/wifi/model/mac-low.cc (-8 / +174 lines)
 Lines 39-44    Link Here 
39
#include "wifi-mac-trailer.h"
39
#include "wifi-mac-trailer.h"
40
#include "wifi-phy.h"
40
#include "wifi-phy.h"
41
#include "wifi-net-device.h"
41
#include "wifi-net-device.h"
42
#include "wifi-mac.h"
43
#include "ht-configuration.h"
44
#include "vht-configuration.h"
45
#include "he-configuration.h"
42
46
43
#undef NS_LOG_APPEND_CONTEXT
47
#undef NS_LOG_APPEND_CONTEXT
44
#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
48
#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
 Lines 271-276   MacLow::ResetPhy (void) Link Here 
271
}
275
}
272
276
273
void
277
void
278
MacLow::SetMac (const Ptr<WifiMac> mac)
279
{
280
  m_mac = mac;
281
}
282
283
void
274
MacLow::SetWifiRemoteStationManager (const Ptr<WifiRemoteStationManager> manager)
284
MacLow::SetWifiRemoteStationManager (const Ptr<WifiRemoteStationManager> manager)
275
{
285
{
276
  m_stationManager = manager;
286
  m_stationManager = manager;
 Lines 555-561   MacLow::StartTransmission (Ptr<const Packet> packet, Link Here 
555
          Ptr<Packet> newPacket = (m_txPackets[GetTid (packet, *hdr)].at (i).packet)->Copy ();
565
          Ptr<Packet> newPacket = (m_txPackets[GetTid (packet, *hdr)].at (i).packet)->Copy ();
556
          newPacket->AddHeader (m_txPackets[GetTid (packet, *hdr)].at (i).hdr);
566
          newPacket->AddHeader (m_txPackets[GetTid (packet, *hdr)].at (i).hdr);
557
          AddWifiMacTrailer (newPacket);
567
          AddWifiMacTrailer (newPacket);
558
          edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, aggregatedPacket);
568
          edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, aggregatedPacket, GetMaxAmpduSize (ac));
559
        }
569
        }
560
      m_currentPacket = aggregatedPacket;
570
      m_currentPacket = aggregatedPacket;
561
      m_currentHdr = (m_txPackets[GetTid (packet, *hdr)].at (0).hdr);
571
      m_currentHdr = (m_txPackets[GetTid (packet, *hdr)].at (0).hdr);
 Lines 2377-2383   MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time durat Link Here 
2377
      blockAck.SetStartingSequence (seqNumber);
2387
      blockAck.SetStartingSequence (seqNumber);
2378
      blockAck.SetTidInfo (tid);
2388
      blockAck.SetTidInfo (tid);
2379
      immediate = (*it).second.first.IsImmediateBlockAck ();
2389
      immediate = (*it).second.first.IsImmediateBlockAck ();
2380
      if (nMpdus > 64)
2390
      if (nMpdus > 63)
2381
        {
2391
        {
2382
          blockAck.SetType (EXTENDED_COMPRESSED_BLOCK_ACK);
2392
          blockAck.SetType (EXTENDED_COMPRESSED_BLOCK_ACK);
2383
        }
2393
        }
 Lines 2601-2607   MacLow::StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peeke Link Here 
2601
      return true;
2611
      return true;
2602
    }
2612
    }
2603
2613
2604
  if (!edcaIt->second->GetMpduAggregator ()->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, blockAckSize))
2614
  if (!edcaIt->second->GetMpduAggregator ()->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, blockAckSize, GetMaxAmpduSize (ac)))
2605
    {
2615
    {
2606
      NS_LOG_DEBUG ("no more packets can be aggregated because the maximum A-MPDU size has been reached");
2616
      NS_LOG_DEBUG ("no more packets can be aggregated because the maximum A-MPDU size has been reached");
2607
      return true;
2617
      return true;
 Lines 2670-2676   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
2670
                  newPacket->AddHeader (peekedHdr);
2680
                  newPacket->AddHeader (peekedHdr);
2671
                  AddWifiMacTrailer (newPacket);
2681
                  AddWifiMacTrailer (newPacket);
2672
2682
2673
                  aggregated = edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2683
                  aggregated = edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket, GetMaxAmpduSize (ac));
2674
2684
2675
                  if (aggregated)
2685
                  if (aggregated)
2676
                    {
2686
                    {
 Lines 2744-2750   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
2744
2754
2745
                  newPacket->AddHeader (peekedHdr);
2755
                  newPacket->AddHeader (peekedHdr);
2746
                  AddWifiMacTrailer (newPacket);
2756
                  AddWifiMacTrailer (newPacket);
2747
                  aggregated = edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2757
                  aggregated = edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket, GetMaxAmpduSize (ac));
2748
                  if (aggregated)
2758
                  if (aggregated)
2749
                    {
2759
                    {
2750
                      m_aggregateQueue[tid]->Enqueue (Create<WifiMacQueueItem> (aggPacket, peekedHdr));
2760
                      m_aggregateQueue[tid]->Enqueue (Create<WifiMacQueueItem> (aggPacket, peekedHdr));
 Lines 2852-2858   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
2852
                      m_aggregateQueue[tid]->Enqueue (Create<WifiMacQueueItem> (aggPacket, peekedHdr));
2862
                      m_aggregateQueue[tid]->Enqueue (Create<WifiMacQueueItem> (aggPacket, peekedHdr));
2853
                      newPacket->AddHeader (peekedHdr);
2863
                      newPacket->AddHeader (peekedHdr);
2854
                      AddWifiMacTrailer (newPacket);
2864
                      AddWifiMacTrailer (newPacket);
2855
                      edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2865
                      edcaIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket, GetMaxAmpduSize (ac));
2856
                      currentAggregatedPacket->AddHeader (blockAckReq);
2866
                      currentAggregatedPacket->AddHeader (blockAckReq);
2857
                    }
2867
                    }
2858
2868
 Lines 2963-2969   MacLow::PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Ti Link Here 
2963
2973
2964
  edcaIt->second->GetMsduAggregator ()->Aggregate (packet, currentAmsduPacket,
2974
  edcaIt->second->GetMsduAggregator ()->Aggregate (packet, currentAmsduPacket,
2965
                                                   edcaIt->second->MapSrcAddressForAggregation (*hdr),
2975
                                                   edcaIt->second->MapSrcAddressForAggregation (*hdr),
2966
                                                   edcaIt->second->MapDestAddressForAggregation (*hdr));
2976
                                                   edcaIt->second->MapDestAddressForAggregation (*hdr),
2977
                                                   GetMaxAmsduSize (ac));
2967
2978
2968
  peekedItem = queue->PeekByTidAndAddress (hdr->GetQosTid (), hdr->GetAddr1 ());
2979
  peekedItem = queue->PeekByTidAndAddress (hdr->GetQosTid (), hdr->GetAddr1 ());
2969
  while (peekedItem != 0)
2980
  while (peekedItem != 0)
 Lines 2974-2980   MacLow::PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Ti Link Here 
2974
2985
2975
      msduAggregation = edcaIt->second->GetMsduAggregator ()->Aggregate (peekedItem->GetPacket (), tempPacket,
2986
      msduAggregation = edcaIt->second->GetMsduAggregator ()->Aggregate (peekedItem->GetPacket (), tempPacket,
2976
                                                                         edcaIt->second->MapSrcAddressForAggregation (*hdr),
2987
                                                                         edcaIt->second->MapSrcAddressForAggregation (*hdr),
2977
                                                                         edcaIt->second->MapDestAddressForAggregation (*hdr));
2988
                                                                         edcaIt->second->MapDestAddressForAggregation (*hdr),
2989
                                                                         GetMaxAmsduSize (ac));
2978
2990
2979
      if (msduAggregation && !StopMpduAggregation (tempPacket, *hdr, currentAmpduPacket, blockAckSize))
2991
      if (msduAggregation && !StopMpduAggregation (tempPacket, *hdr, currentAmpduPacket, blockAckSize))
2980
        {
2992
        {
 Lines 3035-3038   MacLow::CanTransmitNextCfFrame (void) const Link Here 
3035
  return ((GetRemainingCfpDuration () - nextTransmission).IsPositive ());
3047
  return ((GetRemainingCfpDuration () - nextTransmission).IsPositive ());
3036
}
3048
}
3037
3049
3050
uint16_t
3051
MacLow::GetMaxAmsduSize (AcIndex ac) const
3052
{
3053
  uint16_t size = 0;
3054
  WifiModulationClass modulation = GetDataTxVector (m_currentPacket, &m_currentHdr).GetMode ().GetModulationClass ();
3055
  if (modulation == WIFI_MOD_CLASS_HT)
3056
    {
3057
      Ptr<HtConfiguration> htConfiguration = m_mac->GetHtConfiguration ();
3058
      NS_ASSERT (htConfiguration); //If modulation to transmit A-MSDU is HT, we should have a HT configuration attached
3059
      switch (ac)
3060
        {
3061
          case AC_BE:
3062
            size = htConfiguration->GetBeMaxAmsduSize ();
3063
            break;
3064
          case AC_BK:
3065
            size = htConfiguration->GetBkMaxAmsduSize ();
3066
            break;
3067
          case AC_VI:
3068
            size = htConfiguration->GetViMaxAmsduSize ();
3069
            break;
3070
          case AC_VO:
3071
            size = htConfiguration->GetVoMaxAmsduSize ();
3072
            break;
3073
          default:
3074
            NS_ASSERT (false);
3075
            break;
3076
        }
3077
    }
3078
  else if (modulation == WIFI_MOD_CLASS_VHT)
3079
    {
3080
      Ptr<VhtConfiguration> vhtConfiguration = m_mac->GetVhtConfiguration ();
3081
      NS_ASSERT (vhtConfiguration); //If modulation to transmit A-MSDU is VHT, we should have a VHT configuration attached
3082
      switch (ac)
3083
        {
3084
          case AC_BE:
3085
            size = vhtConfiguration->GetBeMaxAmsduSize ();
3086
            break;
3087
          case AC_BK:
3088
            size = vhtConfiguration->GetBkMaxAmsduSize ();
3089
            break;
3090
          case AC_VI:
3091
            size = vhtConfiguration->GetViMaxAmsduSize ();
3092
            break;
3093
          case AC_VO:
3094
            size = vhtConfiguration->GetVoMaxAmsduSize ();
3095
            break;
3096
          default:
3097
            NS_ASSERT (false);
3098
            break;
3099
        }
3100
    }
3101
  else if (modulation == WIFI_MOD_CLASS_HE)
3102
    {
3103
      Ptr<HeConfiguration> heConfiguration = m_mac->GetHeConfiguration ();
3104
      NS_ASSERT (heConfiguration); //If modulation to transmit A-MSDU is HE, we should have a HE configuration attached
3105
      switch (ac)
3106
        {
3107
          case AC_BE:
3108
            size = heConfiguration->GetBeMaxAmsduSize ();
3109
            break;
3110
          case AC_BK:
3111
            size = heConfiguration->GetBkMaxAmsduSize ();
3112
            break;
3113
          case AC_VI:
3114
            size = heConfiguration->GetViMaxAmsduSize ();
3115
            break;
3116
          case AC_VO:
3117
            size = heConfiguration->GetVoMaxAmsduSize ();
3118
            break;
3119
          default:
3120
            NS_ASSERT (false);
3121
            break;
3122
        }
3123
    }
3124
  return size;
3125
}
3126
3127
uint32_t
3128
MacLow::GetMaxAmpduSize (AcIndex ac) const
3129
{
3130
  uint32_t size = 0;
3131
  WifiModulationClass modulation = GetDataTxVector (m_currentPacket, &m_currentHdr).GetMode ().GetModulationClass ();
3132
  if (modulation == WIFI_MOD_CLASS_HT)
3133
    {
3134
      Ptr<HtConfiguration> htConfiguration = m_mac->GetHtConfiguration ();
3135
      NS_ASSERT (htConfiguration); //If modulation to transmit A-MPDU is HT, we should have a HT configuration attached
3136
      switch (ac)
3137
        {
3138
          case AC_BE:
3139
            size = htConfiguration->GetBeMaxAmpduSize ();
3140
            break;
3141
          case AC_BK:
3142
            size = htConfiguration->GetBkMaxAmpduSize ();
3143
            break;
3144
          case AC_VI:
3145
            size = htConfiguration->GetViMaxAmpduSize ();
3146
            break;
3147
          case AC_VO:
3148
            size = htConfiguration->GetVoMaxAmpduSize ();
3149
            break;
3150
          default:
3151
            NS_ASSERT (false);
3152
            break;
3153
        }
3154
    }
3155
  else if (modulation == WIFI_MOD_CLASS_VHT)
3156
    {
3157
      Ptr<VhtConfiguration> vhtConfiguration = m_mac->GetVhtConfiguration ();
3158
      NS_ASSERT (vhtConfiguration); //If modulation to transmit A-MPDU is VHT, we should have a VHT configuration attached
3159
      switch (ac)
3160
        {
3161
          case AC_BE:
3162
            size = vhtConfiguration->GetBeMaxAmpduSize ();
3163
            break;
3164
          case AC_BK:
3165
            size = vhtConfiguration->GetBkMaxAmpduSize ();
3166
            break;
3167
          case AC_VI:
3168
            size = vhtConfiguration->GetViMaxAmpduSize ();
3169
            break;
3170
          case AC_VO:
3171
            size = vhtConfiguration->GetVoMaxAmpduSize ();
3172
            break;
3173
          default:
3174
            NS_ASSERT (false);
3175
            break;
3176
        }
3177
    }
3178
  else if (modulation == WIFI_MOD_CLASS_HE)
3179
    {
3180
      Ptr<HeConfiguration> heConfiguration = m_mac->GetHeConfiguration ();
3181
      NS_ASSERT (heConfiguration); //If modulation to transmit A-MPDU is HE, we should have a HE configuration attached
3182
      switch (ac)
3183
        {
3184
          case AC_BE:
3185
            size = heConfiguration->GetBeMaxAmpduSize ();
3186
            break;
3187
          case AC_BK:
3188
            size = heConfiguration->GetBkMaxAmpduSize ();
3189
            break;
3190
          case AC_VI:
3191
            size = heConfiguration->GetViMaxAmpduSize ();
3192
            break;
3193
          case AC_VO:
3194
            size = heConfiguration->GetVoMaxAmpduSize ();
3195
            break;
3196
          default:
3197
            NS_ASSERT (false);
3198
            break;
3199
        }
3200
    }
3201
  return size;
3202
}
3203
3038
} //namespace ns3
3204
} //namespace ns3
(-)a/src/wifi/model/mac-low.h (+12 lines)
 Lines 41-46   class HeAggregationTest; Link Here 
41
41
42
namespace ns3 {
42
namespace ns3 {
43
43
44
class WifiMac;
44
class WifiPhy;
45
class WifiPhy;
45
class Txop;
46
class Txop;
46
class QosTxop;
47
class QosTxop;
 Lines 93-98   public: Link Here 
93
   */
94
   */
94
  void ResetPhy (void);
95
  void ResetPhy (void);
95
  /**
96
  /**
97
   * Set up WifiMac associated with this MacLow.
98
   *
99
   * \param mac WifiMac associated with this MacLow
100
   */
101
  void SetMac (const Ptr<WifiMac> mac);
102
  /**
96
   * Set up WifiRemoteStationManager associated with this MacLow.
103
   * Set up WifiRemoteStationManager associated with this MacLow.
97
   *
104
   *
98
   * \param manager WifiRemoteStationManager associated with this MacLow
105
   * \param manager WifiRemoteStationManager associated with this MacLow
 Lines 437-442   public: Link Here 
437
   * This function decides if a CF frame can be transmitted in the current CFP.
444
   * This function decides if a CF frame can be transmitted in the current CFP.
438
   */
445
   */
439
  bool CanTransmitNextCfFrame (void) const;
446
  bool CanTransmitNextCfFrame (void) const;
447
  //TODO
448
  uint16_t GetMaxAmsduSize (AcIndex ac) const;
449
  //TODO
450
  uint32_t GetMaxAmpduSize (AcIndex ac) const;
440
451
441
452
442
private:
453
private:
 Lines 860-865   private: Link Here 
860
  Ptr<Packet> PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Time *tstamp, Ptr<Packet> currentAmpduPacket, uint8_t blockAckSize);
871
  Ptr<Packet> PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Time *tstamp, Ptr<Packet> currentAmpduPacket, uint8_t blockAckSize);
861
872
862
  Ptr<WifiPhy> m_phy; //!< Pointer to WifiPhy (actually send/receives frames)
873
  Ptr<WifiPhy> m_phy; //!< Pointer to WifiPhy (actually send/receives frames)
874
  Ptr<WifiMac> m_mac; //!< Pointer to WifiMac (to fetch configuration)
863
  Ptr<WifiRemoteStationManager> m_stationManager; //!< Pointer to WifiRemoteStationManager (rate control)
875
  Ptr<WifiRemoteStationManager> m_stationManager; //!< Pointer to WifiRemoteStationManager (rate control)
864
  MacLowRxCallback m_rxCallback; //!< Callback to pass packet up
876
  MacLowRxCallback m_rxCallback; //!< Callback to pass packet up
865
877
(-)a/src/wifi/model/mpdu-aggregator.cc (-16 / +4 lines)
 Lines 48-67   MpduAggregator::~MpduAggregator () Link Here 
48
{
48
{
49
}
49
}
50
50
51
void
52
MpduAggregator::SetMaxAmpduSize (uint32_t maxSize)
53
{
54
  m_maxAmpduLength = maxSize;
55
}
56
57
uint32_t
58
MpduAggregator::GetMaxAmpduSize (void) const
59
{
60
  return m_maxAmpduLength;
61
}
62
63
bool
51
bool
64
MpduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket) const
52
MpduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket, uint32_t maxAmpduSize) const
65
{
53
{
66
  NS_LOG_FUNCTION (this);
54
  NS_LOG_FUNCTION (this);
67
  Ptr<Packet> currentPacket;
55
  Ptr<Packet> currentPacket;
 Lines 70-76   MpduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacke Link Here 
70
  uint8_t padding = CalculatePadding (aggregatedPacket);
58
  uint8_t padding = CalculatePadding (aggregatedPacket);
71
  uint32_t actualSize = aggregatedPacket->GetSize ();
59
  uint32_t actualSize = aggregatedPacket->GetSize ();
72
60
73
  if ((4 + packet->GetSize () + actualSize + padding) <= GetMaxAmpduSize ())
61
  if ((4 + packet->GetSize () + actualSize + padding) <= maxAmpduSize)
74
    {
62
    {
75
      if (padding)
63
      if (padding)
76
        {
64
        {
 Lines 134-140   MpduAggregator::AddHeaderAndPad (Ptr<Packet> packet, bool last, bool isSingleMpd Link Here 
134
}
122
}
135
123
136
bool
124
bool
137
MpduAggregator::CanBeAggregated (uint32_t packetSize, Ptr<Packet> aggregatedPacket, uint8_t blockAckSize) const
125
MpduAggregator::CanBeAggregated (uint32_t packetSize, Ptr<Packet> aggregatedPacket, uint8_t blockAckSize, uint32_t maxAmpduSize) const
138
{
126
{
139
  uint8_t padding = CalculatePadding (aggregatedPacket);
127
  uint8_t padding = CalculatePadding (aggregatedPacket);
140
  uint32_t actualSize = aggregatedPacket->GetSize ();
128
  uint32_t actualSize = aggregatedPacket->GetSize ();
 Lines 142-148   MpduAggregator::CanBeAggregated (uint32_t packetSize, Ptr<Packet> aggregatedPack Link Here 
142
    {
130
    {
143
      blockAckSize = blockAckSize + 4 + padding;
131
      blockAckSize = blockAckSize + 4 + padding;
144
    }
132
    }
145
  if ((4 + packetSize + actualSize + padding + blockAckSize) <= GetMaxAmpduSize ())
133
  if ((4 + packetSize + actualSize + padding + blockAckSize) <= maxAmpduSize)
146
    {
134
    {
147
      return true;
135
      return true;
148
    }
136
    }
(-)a/src/wifi/model/mpdu-aggregator.h (-19 / +4 lines)
 Lines 55-84   public: Link Here 
55
  virtual ~MpduAggregator ();
55
  virtual ~MpduAggregator ();
56
56
57
  /**
57
  /**
58
   * Sets the maximum A-MPDU size in bytes.
59
   * Value 0 means that MPDU aggregation is disabled.
60
   *
61
   * \param maxSize the maximum A-MPDU size in bytes.
62
   */
63
  void SetMaxAmpduSize (uint32_t maxSize);
64
  /**
65
   * Returns the maximum A-MPDU size in bytes.
66
   * Value 0 means that MPDU aggregation is disabled.
67
   *
68
   * \return the maximum A-MPDU size in bytes.
69
   */
70
  uint32_t GetMaxAmpduSize (void) const;
71
72
  /**
73
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
58
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
74
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible.
59
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible.
60
   * \param maxAmpduSize the maximum A-MPDU size.
75
   *
61
   *
76
   * \return true if <i>packet</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
62
   * \return true if <i>packet</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
77
   *
63
   *
78
   * Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
64
   * Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
79
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>.
65
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>.
80
   */
66
   */
81
  bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket) const;
67
  bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket, uint32_t maxAmpduSize) const;
82
  /**
68
  /**
83
   * \param packet the packet we want to insert into <i>aggregatedPacket</i>.
69
   * \param packet the packet we want to insert into <i>aggregatedPacket</i>.
84
   * \param aggregatedPacket packet that will contain the packet of size <i>packetSize</i>, if aggregation is possible.
70
   * \param aggregatedPacket packet that will contain the packet of size <i>packetSize</i>, if aggregation is possible.
 Lines 98-109   public: Link Here 
98
   * \param packetSize size of the packet we want to insert into <i>aggregatedPacket</i>.
84
   * \param packetSize size of the packet we want to insert into <i>aggregatedPacket</i>.
99
   * \param aggregatedPacket packet that will contain the packet of size <i>packetSize</i>, if aggregation is possible.
85
   * \param aggregatedPacket packet that will contain the packet of size <i>packetSize</i>, if aggregation is possible.
100
   * \param blockAckSize size of the piggybacked block ack request
86
   * \param blockAckSize size of the piggybacked block ack request
87
   * \param maxAmpduSize the maximum A-MPDU size.
101
   *
88
   *
102
   * \return true if the packet of size <i>packetSize</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
89
   * \return true if the packet of size <i>packetSize</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
103
   *
90
   *
104
   * This method is used to determine if a packet could be aggregated to an A-MPDU without exceeding the maximum packet size.
91
   * This method is used to determine if a packet could be aggregated to an A-MPDU without exceeding the maximum packet size.
105
   */
92
   */
106
  bool CanBeAggregated (uint32_t packetSize, Ptr<Packet> aggregatedPacket, uint8_t blockAckSize) const;
93
  bool CanBeAggregated (uint32_t packetSize, Ptr<Packet> aggregatedPacket, uint8_t blockAckSize, uint32_t maxAmpduSize) const;
107
94
108
  /**
95
  /**
109
   * Deaggregates an A-MPDU by removing the A-MPDU subframe header and padding.
96
   * Deaggregates an A-MPDU by removing the A-MPDU subframe header and padding.
 Lines 123-130   private: Link Here 
123
   * Each A-MPDU subframe is padded so that its length is multiple of 4 octets.
110
   * Each A-MPDU subframe is padded so that its length is multiple of 4 octets.
124
   */
111
   */
125
  uint8_t CalculatePadding (Ptr<const Packet> packet) const;
112
  uint8_t CalculatePadding (Ptr<const Packet> packet) const;
126
127
  uint32_t m_maxAmpduLength; //!< Maximum length in bytes of A-MPDUs
128
};
113
};
129
114
130
}  //namespace ns3
115
}  //namespace ns3
(-)a/src/wifi/model/msdu-aggregator.cc (-14 / +2 lines)
 Lines 48-68   MsduAggregator::~MsduAggregator () Link Here 
48
{
48
{
49
}
49
}
50
50
51
void
52
MsduAggregator::SetMaxAmsduSize (uint16_t maxSize)
53
{
54
  m_maxAmsduLength = maxSize;
55
}
56
57
uint16_t
58
MsduAggregator::GetMaxAmsduSize (void) const
59
{
60
  return m_maxAmsduLength;
61
}
62
63
bool
51
bool
64
MsduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
52
MsduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
65
                           Mac48Address src, Mac48Address dest) const
53
                           Mac48Address src, Mac48Address dest, uint16_t maxAmsduSize) const
66
{
54
{
67
  NS_LOG_FUNCTION (this);
55
  NS_LOG_FUNCTION (this);
68
  Ptr<Packet> currentPacket;
56
  Ptr<Packet> currentPacket;
 Lines 71-77   MsduAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacke Link Here 
71
  uint8_t padding = CalculatePadding (aggregatedPacket);
59
  uint8_t padding = CalculatePadding (aggregatedPacket);
72
  uint32_t actualSize = aggregatedPacket->GetSize ();
60
  uint32_t actualSize = aggregatedPacket->GetSize ();
73
61
74
  if ((14 + packet->GetSize () + actualSize + padding) <= GetMaxAmsduSize ())
62
  if ((14 + packet->GetSize () + actualSize + padding) <= maxAmsduSize)
75
    {
63
    {
76
      if (padding)
64
      if (padding)
77
        {
65
        {
(-)a/src/wifi/model/msdu-aggregator.h (-18 / +2 lines)
 Lines 51-71   public: Link Here 
51
  virtual ~MsduAggregator ();
51
  virtual ~MsduAggregator ();
52
52
53
  /**
53
  /**
54
   * Sets the maximum A-MSDU size in bytes.
55
   * Value 0 means that MSDU aggregation is disabled.
56
   *
57
   * \param maxSize the maximum A-MSDU size in bytes.
58
   */
59
  void SetMaxAmsduSize (uint16_t maxSize);
60
  /**
61
   * Returns the maximum A-MSDU size in bytes.
62
   * Value 0 means that MSDU aggregation is disabled.
63
   *
64
   * \return the maximum A-MSDU size in bytes.
65
   */
66
  uint16_t GetMaxAmsduSize (void) const;
67
68
  /**
69
   * Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
54
   * Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
70
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>. If <i>packet</i>
55
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>. If <i>packet</i>
71
   * can be added returns true, false otherwise.
56
   * can be added returns true, false otherwise.
 Lines 74-83   public: Link Here 
74
   * \param aggregatedPacket the aggregated packet.
59
   * \param aggregatedPacket the aggregated packet.
75
   * \param src the source address.
60
   * \param src the source address.
76
   * \param dest the destination address
61
   * \param dest the destination address
62
   * \param maxAmsduSize the maximum A-MSDU size.
77
   * \return true if successful.
63
   * \return true if successful.
78
   */
64
   */
79
  bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
65
  bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
80
                  Mac48Address src, Mac48Address dest) const;
66
                  Mac48Address src, Mac48Address dest, uint16_t maxAmsduSize) const;
81
67
82
  /**
68
  /**
83
   *
69
   *
 Lines 98-105   private: Link Here 
98
   * \return the number of octets required for padding
84
   * \return the number of octets required for padding
99
   */
85
   */
100
  uint8_t CalculatePadding (Ptr<const Packet> packet) const;
86
  uint8_t CalculatePadding (Ptr<const Packet> packet) const;
101
102
  uint16_t m_maxAmsduLength; ///< maximum AMSDU length
103
};
87
};
104
88
105
} //namespace ns3
89
} //namespace ns3
(-)a/src/wifi/model/qos-txop.cc (-5 / +7 lines)
 Lines 289-295   QosTxop::NotifyAccessGranted (void) Link Here 
289
              Ptr<Packet> currentAggregatedPacket = Create<Packet> ();
289
              Ptr<Packet> currentAggregatedPacket = Create<Packet> ();
290
              m_msduAggregator->Aggregate (m_currentPacket, currentAggregatedPacket,
290
              m_msduAggregator->Aggregate (m_currentPacket, currentAggregatedPacket,
291
                                           MapSrcAddressForAggregation (peekedHdr),
291
                                           MapSrcAddressForAggregation (peekedHdr),
292
                                           MapDestAddressForAggregation (peekedHdr));
292
                                           MapDestAddressForAggregation (peekedHdr),
293
                                           GetLow ()->GetMaxAmsduSize (QosUtilsMapTidToAc (m_currentHdr.GetQosTid ())));
293
              bool aggregated = false;
294
              bool aggregated = false;
294
              bool isAmsdu = false;
295
              bool isAmsdu = false;
295
              Ptr<const WifiMacQueueItem> peekedItem = m_queue->PeekByTidAndAddress (m_currentHdr.GetQosTid (),
296
              Ptr<const WifiMacQueueItem> peekedItem = m_queue->PeekByTidAndAddress (m_currentHdr.GetQosTid (),
 Lines 299-305   QosTxop::NotifyAccessGranted (void) Link Here 
299
                  peekedHdr = peekedItem->GetHeader ();
300
                  peekedHdr = peekedItem->GetHeader ();
300
                  aggregated = m_msduAggregator->Aggregate (peekedItem->GetPacket (), currentAggregatedPacket,
301
                  aggregated = m_msduAggregator->Aggregate (peekedItem->GetPacket (), currentAggregatedPacket,
301
                                                            MapSrcAddressForAggregation (peekedHdr),
302
                                                            MapSrcAddressForAggregation (peekedHdr),
302
                                                            MapDestAddressForAggregation (peekedHdr));
303
                                                            MapDestAddressForAggregation (peekedHdr),
304
                                                            GetLow ()->GetMaxAmsduSize (QosUtilsMapTidToAc (m_currentHdr.GetQosTid ())));
303
                  if (aggregated)
305
                  if (aggregated)
304
                    {
306
                    {
305
                      isAmsdu = true;
307
                      isAmsdu = true;
 Lines 962-968   QosTxop::NeedFragmentation (void) const Link Here 
962
      || (m_stationManager->GetHtSupported ()
964
      || (m_stationManager->GetHtSupported ()
963
          && m_currentHdr.IsQosData ()
965
          && m_currentHdr.IsQosData ()
964
          && GetBaAgreementExists (m_currentHdr.GetAddr1 (), GetTid (m_currentPacket, m_currentHdr))
966
          && GetBaAgreementExists (m_currentHdr.GetAddr1 (), GetTid (m_currentPacket, m_currentHdr))
965
          && GetMpduAggregator ()->GetMaxAmpduSize () >= m_currentPacket->GetSize ()))
967
          && GetLow ()->GetMaxAmpduSize (QosUtilsMapTidToAc (GetTid (m_currentPacket, m_currentHdr))) >= m_currentPacket->GetSize ()))
966
    {
968
    {
967
      //MSDU is not fragmented when it is transmitted using an HT-immediate or
969
      //MSDU is not fragmented when it is transmitted using an HT-immediate or
968
      //HT-delayed Block Ack agreement or when it is carried in an A-MPDU.
970
      //HT-delayed Block Ack agreement or when it is carried in an A-MPDU.
 Lines 1295-1301   QosTxop::VerifyBlockAck (void) Link Here 
1295
      m_baManager->SwitchToBlockAckIfNeeded (recipient, tid, sequence);
1297
      m_baManager->SwitchToBlockAckIfNeeded (recipient, tid, sequence);
1296
    }
1298
    }
1297
  if ((m_baManager->ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
1299
  if ((m_baManager->ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
1298
      && (GetMpduAggregator () == 0 || GetMpduAggregator ()->GetMaxAmpduSize () == 0))
1300
      && (GetMpduAggregator () == 0 || GetLow ()->GetMaxAmpduSize (QosUtilsMapTidToAc (tid)) == 0))
1299
    {
1301
    {
1300
      m_currentHdr.SetQosAckPolicy (WifiMacHeader::BLOCK_ACK);
1302
      m_currentHdr.SetQosAckPolicy (WifiMacHeader::BLOCK_ACK);
1301
    }
1303
    }
 Lines 1352-1358   QosTxop::SetupBlockAckIfNeeded (void) Link Here 
1352
  Mac48Address recipient = m_currentHdr.GetAddr1 ();
1354
  Mac48Address recipient = m_currentHdr.GetAddr1 ();
1353
  uint32_t packets = m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1355
  uint32_t packets = m_queue->GetNPacketsByTidAndAddress (tid, recipient);
1354
  if ((GetBlockAckThreshold () > 0 && packets >= GetBlockAckThreshold ())
1356
  if ((GetBlockAckThreshold () > 0 && packets >= GetBlockAckThreshold ())
1355
      || (m_mpduAggregator != 0 && m_mpduAggregator->GetMaxAmpduSize () > 0 && packets > 1)
1357
      || (m_mpduAggregator != 0 && GetLow ()->GetMaxAmpduSize (QosUtilsMapTidToAc (tid)) > 0 && packets > 1)
1356
      || m_stationManager->GetVhtSupported ()
1358
      || m_stationManager->GetVhtSupported ()
1357
      || m_stationManager->GetHeSupported ())
1359
      || m_stationManager->GetHeSupported ())
1358
    {
1360
    {
(-)a/src/wifi/model/regular-wifi-mac.cc (-70 / +103 lines)
 Lines 55-60   RegularWifiMac::RegularWifiMac () Link Here 
55
55
56
  m_low = CreateObject<MacLow> ();
56
  m_low = CreateObject<MacLow> ();
57
  m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle));
57
  m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle));
58
  m_low->SetMac (this);
58
59
59
  m_channelAccessManager = CreateObject<ChannelAccessManager> ();
60
  m_channelAccessManager = CreateObject<ChannelAccessManager> ();
60
  m_channelAccessManager->SetupLow (m_low);
61
  m_channelAccessManager->SetupLow (m_low);
 Lines 159-166   RegularWifiMac::GetHtCapabilities (void) const Link Here 
159
  HtCapabilities capabilities;
160
  HtCapabilities capabilities;
160
  if (GetHtSupported ())
161
  if (GetHtSupported ())
161
    {
162
    {
162
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
163
      Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
163
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
164
      bool greenfieldSupported = htConfiguration->GetGreenfieldSupported ();
164
      bool greenfieldSupported = htConfiguration->GetGreenfieldSupported ();
165
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
165
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
166
      capabilities.SetHtSupported (1);
166
      capabilities.SetHtSupported (1);
 Lines 172-178   RegularWifiMac::GetHtCapabilities (void) const Link Here 
172
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
172
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
173
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
173
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
174
      capabilities.SetLSigProtectionSupport (!greenfieldSupported);
174
      capabilities.SetLSigProtectionSupport (!greenfieldSupported);
175
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
175
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (htConfiguration->GetBeMaxAmpduSize (), htConfiguration->GetBkMaxAmpduSize ()), std::max (htConfiguration->GetVoMaxAmpduSize (), htConfiguration->GetViMaxAmpduSize ()))
176
                                                                      + 1.0)
176
                                                                      + 1.0)
177
                                                            / std::log (2.0))
177
                                                            / std::log (2.0))
178
                                                           - 13.0),
178
                                                           - 13.0),
 Lines 214-221   RegularWifiMac::GetVhtCapabilities (void) const Link Here 
214
  VhtCapabilities capabilities;
214
  VhtCapabilities capabilities;
215
  if (GetVhtSupported ())
215
  if (GetVhtSupported ())
216
    {
216
    {
217
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
217
      Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
218
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
218
      Ptr<VhtConfiguration> vhtConfiguration = GetVhtConfiguration ();
219
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
219
      bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
220
      capabilities.SetVhtSupported (1);
220
      capabilities.SetVhtSupported (1);
221
      if (m_phy->GetChannelWidth () == 160)
221
      if (m_phy->GetChannelWidth () == 160)
 Lines 231-237   RegularWifiMac::GetVhtCapabilities (void) const Link Here 
231
      capabilities.SetRxLdpc (0);
231
      capabilities.SetRxLdpc (0);
232
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
232
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
233
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
233
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
234
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) + 1.0) / std::log (2.0)) - 13.0), 0.0);
234
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (vhtConfiguration->GetBeMaxAmpduSize (), vhtConfiguration->GetBkMaxAmpduSize ()), std::max (vhtConfiguration->GetVoMaxAmpduSize (), vhtConfiguration->GetViMaxAmpduSize ())) + 1.0) / std::log (2.0)) - 13.0), 0.0);
235
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
235
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
236
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
236
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
237
      uint8_t maxMcs = 0;
237
      uint8_t maxMcs = 0;
 Lines 283-290   RegularWifiMac::GetHeCapabilities (void) const Link Here 
283
  HeCapabilities capabilities;
283
  HeCapabilities capabilities;
284
  if (GetHeSupported ())
284
  if (GetHeSupported ())
285
    {
285
    {
286
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
286
      Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
287
      Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
288
      capabilities.SetHeSupported (1);
287
      capabilities.SetHeSupported (1);
289
      uint8_t channelWidthSet = 0;
288
      uint8_t channelWidthSet = 0;
290
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
289
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
 Lines 311-320   RegularWifiMac::GetHeCapabilities (void) const Link Here 
311
          gi |= 0x02;
310
          gi |= 0x02;
312
        }
311
        }
313
      capabilities.SetHeLtfAndGiForHePpdus (gi);
312
      capabilities.SetHeLtfAndGiForHePpdus (gi);
314
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
313
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (heConfiguration->GetBeMaxAmpduSize (), heConfiguration->GetBkMaxAmpduSize ()), std::max (heConfiguration->GetVoMaxAmpduSize (), heConfiguration->GetViMaxAmpduSize ()))
315
                                                                      + 1.0)
314
                                                                      + 1.0)
316
                                                            / std::log (2.0))
315
                                                            / std::log (2.0))
317
                                                           - 13.0),
316
                                                           - 20.0),
318
                                                0.0);
317
                                                0.0);
319
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
318
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
320
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
319
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
 Lines 338-401   void Link Here 
338
RegularWifiMac::SetVoMaxAmsduSize (uint16_t size)
337
RegularWifiMac::SetVoMaxAmsduSize (uint16_t size)
339
{
338
{
340
  NS_LOG_FUNCTION (this << size);
339
  NS_LOG_FUNCTION (this << size);
340
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
341
  if (device)
342
    {
343
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
344
      if (htConfiguration)
345
        {
346
          htConfiguration->SetVoMaxAmsduSize (size);
347
        }
348
    }
341
  m_voMaxAmsduSize = size;
349
  m_voMaxAmsduSize = size;
342
  ConfigureAggregation ();
343
}
350
}
344
351
345
void
352
void
346
RegularWifiMac::SetViMaxAmsduSize (uint16_t size)
353
RegularWifiMac::SetViMaxAmsduSize (uint16_t size)
347
{
354
{
348
  NS_LOG_FUNCTION (this << size);
355
  NS_LOG_FUNCTION (this << size);
356
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
357
  if (device)
358
    {
359
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
360
      if (htConfiguration)
361
        {
362
          htConfiguration->SetViMaxAmsduSize (size);
363
        }
364
    }
349
  m_viMaxAmsduSize = size;
365
  m_viMaxAmsduSize = size;
350
  ConfigureAggregation ();
351
}
366
}
352
367
353
void
368
void
354
RegularWifiMac::SetBeMaxAmsduSize (uint16_t size)
369
RegularWifiMac::SetBeMaxAmsduSize (uint16_t size)
355
{
370
{
356
  NS_LOG_FUNCTION (this << size);
371
  NS_LOG_FUNCTION (this << size);
372
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
373
  if (device)
374
    {
375
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
376
      if (htConfiguration)
377
        {
378
          htConfiguration->SetBeMaxAmsduSize (size);
379
        }
380
    }
357
  m_beMaxAmsduSize = size;
381
  m_beMaxAmsduSize = size;
358
  ConfigureAggregation ();
359
}
382
}
360
383
361
void
384
void
362
RegularWifiMac::SetBkMaxAmsduSize (uint16_t size)
385
RegularWifiMac::SetBkMaxAmsduSize (uint16_t size)
363
{
386
{
364
  NS_LOG_FUNCTION (this << size);
387
  NS_LOG_FUNCTION (this << size);
388
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
389
  if (device)
390
    {
391
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
392
      if (htConfiguration)
393
        {
394
          htConfiguration->SetBkMaxAmsduSize (size);
395
        }
396
    }
365
  m_bkMaxAmsduSize = size;
397
  m_bkMaxAmsduSize = size;
366
  ConfigureAggregation ();
367
}
398
}
368
399
369
void
400
void
370
RegularWifiMac::SetVoMaxAmpduSize (uint32_t size)
401
RegularWifiMac::SetVoMaxAmpduSize (uint32_t size)
371
{
402
{
372
  NS_LOG_FUNCTION (this << size);
403
  NS_LOG_FUNCTION (this << size);
404
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
405
  if (device)
406
    {
407
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
408
      if (htConfiguration)
409
        {
410
          htConfiguration->SetVoMaxAmpduSize (size);
411
        }
412
    }
373
  m_voMaxAmpduSize = size;
413
  m_voMaxAmpduSize = size;
374
  ConfigureAggregation ();
375
}
414
}
376
415
377
void
416
void
378
RegularWifiMac::SetViMaxAmpduSize (uint32_t size)
417
RegularWifiMac::SetViMaxAmpduSize (uint32_t size)
379
{
418
{
380
  NS_LOG_FUNCTION (this << size);
419
  NS_LOG_FUNCTION (this << size);
420
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
421
  if (device)
422
    {
423
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
424
      if (htConfiguration)
425
        {
426
          htConfiguration->SetViMaxAmpduSize (size);
427
        }
428
    }
381
  m_viMaxAmpduSize = size;
429
  m_viMaxAmpduSize = size;
382
  ConfigureAggregation ();
383
}
430
}
384
431
385
void
432
void
386
RegularWifiMac::SetBeMaxAmpduSize (uint32_t size)
433
RegularWifiMac::SetBeMaxAmpduSize (uint32_t size)
387
{
434
{
388
  NS_LOG_FUNCTION (this << size);
435
  NS_LOG_FUNCTION (this << size);
436
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
437
  if (device)
438
    {
439
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
440
      if (htConfiguration)
441
        {
442
          htConfiguration->SetBeMaxAmpduSize (size);
443
        }
444
    }
389
  m_beMaxAmpduSize = size;
445
  m_beMaxAmpduSize = size;
390
  ConfigureAggregation ();
391
}
446
}
392
447
393
void
448
void
394
RegularWifiMac::SetBkMaxAmpduSize (uint32_t size)
449
RegularWifiMac::SetBkMaxAmpduSize (uint32_t size)
395
{
450
{
396
  NS_LOG_FUNCTION (this << size);
451
  NS_LOG_FUNCTION (this << size);
452
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
453
  if (device)
454
    {
455
      Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
456
      if (htConfiguration)
457
        {
458
          htConfiguration->SetBkMaxAmpduSize (size);
459
        }
460
    }
397
  m_bkMaxAmpduSize = size;
461
  m_bkMaxAmpduSize = size;
398
  ConfigureAggregation ();
399
}
462
}
400
463
401
void
464
void
 Lines 596-603   RegularWifiMac::SetHeSupported (bool enable) Link Here 
596
bool
659
bool
597
RegularWifiMac::GetHtSupported () const
660
RegularWifiMac::GetHtSupported () const
598
{
661
{
599
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
662
  if (GetHtConfiguration ())
600
  if (device->GetHtConfiguration ())
601
    {
663
    {
602
      return true;
664
      return true;
603
    }
665
    }
 Lines 607-614   RegularWifiMac::GetHtSupported () const Link Here 
607
bool
669
bool
608
RegularWifiMac::GetVhtSupported () const
670
RegularWifiMac::GetVhtSupported () const
609
{
671
{
610
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
672
  if (GetVhtConfiguration ())
611
  if (device->GetVhtConfiguration ())
612
    {
673
    {
613
      return true;
674
      return true;
614
    }
675
    }
 Lines 618-625   RegularWifiMac::GetVhtSupported () const Link Here 
618
bool
679
bool
619
RegularWifiMac::GetHeSupported () const
680
RegularWifiMac::GetHeSupported () const
620
{
681
{
621
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
682
  if (GetHeConfiguration ())
622
  if (device->GetHeConfiguration ())
623
    {
683
    {
624
      return true;
684
      return true;
625
    }
685
    }
 Lines 1037-1044   RegularWifiMac::SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Link Here 
1037
    }
1097
    }
1038
  respHdr.SetTid (reqHdr->GetTid ());
1098
  respHdr.SetTid (reqHdr->GetTid ());
1039
1099
1040
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1100
  Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
1041
  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
1042
  if (heConfiguration && heConfiguration->GetMpduBufferSize () > 64)
1101
  if (heConfiguration && heConfiguration->GetMpduBufferSize () > 64)
1043
    {
1102
    {
1044
      respHdr.SetBufferSize (255);
1103
      respHdr.SetBufferSize (255);
 Lines 1278-1288   RegularWifiMac::FinishConfigureStandard (WifiPhyStandard standard) Link Here 
1278
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1337
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1279
      {
1338
      {
1280
        EnableAggregation ();
1339
        EnableAggregation ();
1281
        //To be removed once deprecated RifsSupported attribute is removed
1340
        //To be removed once deprecated attributes are removed
1282
        Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1341
        Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
1283
        Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1284
        NS_ASSERT (htConfiguration);
1342
        NS_ASSERT (htConfiguration);
1285
        htConfiguration->SetRifsSupported (m_rifsSupported);
1343
        htConfiguration->SetRifsSupported (m_rifsSupported);
1344
        htConfiguration->SetBeMaxAmpduSize (m_beMaxAmpduSize);
1345
        htConfiguration->SetBkMaxAmpduSize (m_bkMaxAmpduSize);
1346
        htConfiguration->SetViMaxAmpduSize (m_viMaxAmpduSize);
1347
        htConfiguration->SetVoMaxAmpduSize (m_voMaxAmpduSize);
1348
        htConfiguration->SetBeMaxAmsduSize (m_beMaxAmsduSize);
1349
        htConfiguration->SetBkMaxAmsduSize (m_bkMaxAmsduSize);
1350
        htConfiguration->SetViMaxAmsduSize (m_viMaxAmsduSize);
1351
        htConfiguration->SetVoMaxAmsduSize (m_voMaxAmsduSize);
1286
        SetQosSupported (true);
1352
        SetQosSupported (true);
1287
        cwmin = 15;
1353
        cwmin = 15;
1288
        cwmax = 1023;
1354
        cwmax = 1023;
 Lines 1293-1302   RegularWifiMac::FinishConfigureStandard (WifiPhyStandard standard) Link Here 
1293
      {
1359
      {
1294
        EnableAggregation ();
1360
        EnableAggregation ();
1295
        //To be removed once deprecated RifsSupported attribute is removed
1361
        //To be removed once deprecated RifsSupported attribute is removed
1296
        Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
1362
        Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
1297
        Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
1298
        NS_ASSERT (htConfiguration);
1363
        NS_ASSERT (htConfiguration);
1299
        htConfiguration->SetRifsSupported (m_rifsSupported);
1364
        htConfiguration->SetRifsSupported (m_rifsSupported);
1365
        htConfiguration->SetBeMaxAmpduSize (m_beMaxAmpduSize);
1366
        htConfiguration->SetViMaxAmpduSize (m_viMaxAmpduSize);
1367
        htConfiguration->SetVoMaxAmpduSize (m_voMaxAmpduSize);
1368
        htConfiguration->SetBeMaxAmsduSize (m_beMaxAmsduSize);
1369
        htConfiguration->SetBkMaxAmsduSize (m_bkMaxAmsduSize);
1370
        htConfiguration->SetViMaxAmsduSize (m_viMaxAmsduSize);
1371
        htConfiguration->SetVoMaxAmsduSize (m_voMaxAmsduSize);
1300
        SetQosSupported (true);
1372
        SetQosSupported (true);
1301
      }
1373
      }
1302
    case WIFI_PHY_STANDARD_80211g:
1374
    case WIFI_PHY_STANDARD_80211g:
 Lines 1350-1393   RegularWifiMac::TxFailed (const WifiMacHeader &hdr) Link Here 
1350
}
1422
}
1351
1423
1352
void
1424
void
1353
RegularWifiMac::ConfigureAggregation (void)
1354
{
1355
  NS_LOG_FUNCTION (this);
1356
  if (GetVOQueue ()->GetMsduAggregator () != 0)
1357
    {
1358
      GetVOQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (m_voMaxAmsduSize);
1359
    }
1360
  if (GetVIQueue ()->GetMsduAggregator () != 0)
1361
    {
1362
      GetVIQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (m_viMaxAmsduSize);
1363
    }
1364
  if (GetBEQueue ()->GetMsduAggregator () != 0)
1365
    {
1366
      GetBEQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (m_beMaxAmsduSize);
1367
    }
1368
  if (GetBKQueue ()->GetMsduAggregator () != 0)
1369
    {
1370
      GetBKQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (m_bkMaxAmsduSize);
1371
    }
1372
  if (GetVOQueue ()->GetMpduAggregator () != 0)
1373
    {
1374
      GetVOQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (m_voMaxAmpduSize);
1375
    }
1376
  if (GetVIQueue ()->GetMpduAggregator () != 0)
1377
    {
1378
      GetVIQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (m_viMaxAmpduSize);
1379
    }
1380
  if (GetBEQueue ()->GetMpduAggregator () != 0)
1381
    {
1382
      GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (m_beMaxAmpduSize);
1383
    }
1384
  if (GetBKQueue ()->GetMpduAggregator () != 0)
1385
    {
1386
      GetBKQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (m_bkMaxAmpduSize);
1387
    }
1388
}
1389
1390
void
1391
RegularWifiMac::EnableAggregation (void)
1425
RegularWifiMac::EnableAggregation (void)
1392
{
1426
{
1393
  NS_LOG_FUNCTION (this);
1427
  NS_LOG_FUNCTION (this);
 Lines 1404-1410   RegularWifiMac::EnableAggregation (void) Link Here 
1404
          i->second->SetMpduAggregator (mpduAggregator);
1438
          i->second->SetMpduAggregator (mpduAggregator);
1405
        }
1439
        }
1406
    }
1440
    }
1407
  ConfigureAggregation ();
1408
}
1441
}
1409
1442
1410
void
1443
void
(-)a/src/wifi/model/regular-wifi-mac.h (-2 lines)
 Lines 660-667   private: Link Here 
660
   */
660
   */
661
  bool m_dsssSupported;
661
  bool m_dsssSupported;
662
662
663
  /// Configure aggregation function
664
  void ConfigureAggregation (void);
665
  /// Enable aggregation function
663
  /// Enable aggregation function
666
  void EnableAggregation (void);
664
  void EnableAggregation (void);
667
  /// Disable aggregation function
665
  /// Disable aggregation function
(-)a/src/wifi/model/vht-configuration.cc (+161 lines)
 Lines 19-24    Link Here 
19
 */
19
 */
20
20
21
#include "ns3/log.h"
21
#include "ns3/log.h"
22
#include "ns3/uinteger.h"
22
#include "vht-configuration.h"
23
#include "vht-configuration.h"
23
24
24
namespace ns3 {
25
namespace ns3 {
 Lines 44-51   VhtConfiguration::GetTypeId (void) Link Here 
44
    .SetParent<Object> ()
45
    .SetParent<Object> ()
45
    .SetGroupName ("Wifi")
46
    .SetGroupName ("Wifi")
46
    .AddConstructor<VhtConfiguration> ()
47
    .AddConstructor<VhtConfiguration> ()
48
    .AddAttribute ("VO_MaxAmsduSize",
49
                   "Maximum length in bytes of an A-MSDU for AC_VO access class. "
50
                   "Value 0 means A-MSDU is disabled for that AC.",
51
                   UintegerValue (0),
52
                   MakeUintegerAccessor (&VhtConfiguration::SetVoMaxAmsduSize,
53
                                         &VhtConfiguration::GetVoMaxAmsduSize),
54
                   MakeUintegerChecker<uint16_t> (0, 11454))
55
    .AddAttribute ("VI_MaxAmsduSize",
56
                   "Maximum length in bytes of an A-MSDU for AC_VI access class."
57
                   "Value 0 means A-MSDU is disabled for that AC.",
58
                   UintegerValue (0),
59
                   MakeUintegerAccessor (&VhtConfiguration::SetViMaxAmsduSize,
60
                                         &VhtConfiguration::GetViMaxAmsduSize),
61
                   MakeUintegerChecker<uint16_t> (0, 11454))
62
    .AddAttribute ("BE_MaxAmsduSize",
63
                   "Maximum length in bytes of an A-MSDU for AC_BE access class."
64
                   "Value 0 means A-MSDU is disabled for that AC.",
65
                   UintegerValue (0),
66
                   MakeUintegerAccessor (&VhtConfiguration::SetBeMaxAmsduSize,
67
                                         &VhtConfiguration::GetBeMaxAmsduSize),
68
                   MakeUintegerChecker<uint16_t> (0, 11454))
69
    .AddAttribute ("BK_MaxAmsduSize",
70
                   "Maximum length in bytes of an A-MSDU for AC_BK access class."
71
                   "Value 0 means A-MSDU is disabled for that AC.",
72
                   UintegerValue (0),
73
                   MakeUintegerAccessor (&VhtConfiguration::SetBkMaxAmsduSize,
74
                                         &VhtConfiguration::GetBkMaxAmsduSize),
75
                   MakeUintegerChecker<uint16_t> (0, 11454))
76
    .AddAttribute ("VO_MaxAmpduSize",
77
                   "Maximum length in bytes of an A-MPDU for AC_VO access class."
78
                   "Value 0 means A-MPDU is disabled for that AC.",
79
                   UintegerValue (0),
80
                   MakeUintegerAccessor (&VhtConfiguration::SetVoMaxAmpduSize,
81
                                         &VhtConfiguration::GetVoMaxAmpduSize),
82
                   MakeUintegerChecker<uint32_t> (0, 1048575))
83
    .AddAttribute ("VI_MaxAmpduSize",
84
                   "Maximum length in bytes of an A-MPDU for AC_VI access class."
85
                   "Value 0 means A-MPDU is disabled for that AC.",
86
                   UintegerValue (1048575),
87
                   MakeUintegerAccessor (&VhtConfiguration::SetViMaxAmpduSize,
88
                                         &VhtConfiguration::GetViMaxAmpduSize),
89
                   MakeUintegerChecker<uint32_t> (0, 1048575))
90
    .AddAttribute ("BE_MaxAmpduSize",
91
                   "Maximum length in bytes of an A-MPDU for AC_BE access class."
92
                   "Value 0 means A-MPDU is disabled for that AC.",
93
                   UintegerValue (1048575),
94
                   MakeUintegerAccessor (&VhtConfiguration::SetBeMaxAmpduSize,
95
                                         &VhtConfiguration::GetBeMaxAmpduSize),
96
                   MakeUintegerChecker<uint32_t> (0, 1048575))
97
    .AddAttribute ("BK_MaxAmpduSize",
98
                   "Maximum length in bytes of an A-MPDU for AC_BK access class."
99
                   "Value 0 means A-MPDU is disabled for that AC.",
100
                   UintegerValue (0),
101
                   MakeUintegerAccessor (&VhtConfiguration::SetBkMaxAmpduSize,
102
                                         &VhtConfiguration::GetBkMaxAmpduSize),
103
                   MakeUintegerChecker<uint32_t> (0, 1048575))
47
    ;
104
    ;
48
    return tid;
105
    return tid;
49
}
106
}
50
107
108
void
109
VhtConfiguration::SetVoMaxAmsduSize (uint16_t size)
110
{
111
  NS_LOG_FUNCTION (this << size);
112
  m_voMaxAmsduSize = size;
113
}
114
115
uint16_t
116
VhtConfiguration::GetVoMaxAmsduSize (void) const
117
{
118
  return m_voMaxAmsduSize;
119
}
120
121
void
122
VhtConfiguration::SetViMaxAmsduSize (uint16_t size)
123
{
124
  NS_LOG_FUNCTION (this << size);
125
  m_viMaxAmsduSize = size;
126
}
127
128
uint16_t
129
VhtConfiguration::GetViMaxAmsduSize (void) const
130
{
131
  return m_viMaxAmsduSize;
132
}
133
134
void
135
VhtConfiguration::SetBeMaxAmsduSize (uint16_t size)
136
{
137
  NS_LOG_FUNCTION (this << size);
138
  m_beMaxAmsduSize = size;
139
}
140
141
uint16_t
142
VhtConfiguration::GetBeMaxAmsduSize (void) const
143
{
144
  return m_beMaxAmsduSize;
145
}
146
147
void
148
VhtConfiguration::SetBkMaxAmsduSize (uint16_t size)
149
{
150
  NS_LOG_FUNCTION (this << size);
151
  m_bkMaxAmsduSize = size;
152
}
153
154
uint16_t
155
VhtConfiguration::GetBkMaxAmsduSize (void) const
156
{
157
  return m_bkMaxAmsduSize;
158
}
159
160
void
161
VhtConfiguration::SetVoMaxAmpduSize (uint32_t size)
162
{
163
  NS_LOG_FUNCTION (this << size);
164
  m_voMaxAmpduSize = size;
165
}
166
167
uint32_t
168
VhtConfiguration::GetVoMaxAmpduSize (void) const
169
{
170
  return m_voMaxAmpduSize;
171
}
172
173
void
174
VhtConfiguration::SetViMaxAmpduSize (uint32_t size)
175
{
176
  NS_LOG_FUNCTION (this << size);
177
  m_viMaxAmpduSize = size;
178
}
179
180
uint32_t
181
VhtConfiguration::GetViMaxAmpduSize (void) const
182
{
183
  return m_viMaxAmpduSize;
184
}
185
186
void
187
VhtConfiguration::SetBeMaxAmpduSize (uint32_t size)
188
{
189
  NS_LOG_FUNCTION (this << size);
190
  m_beMaxAmpduSize = size;
191
}
192
193
uint32_t
194
VhtConfiguration::GetBeMaxAmpduSize (void) const
195
{
196
  return m_beMaxAmpduSize;
197
}
198
199
void
200
VhtConfiguration::SetBkMaxAmpduSize (uint32_t size)
201
{
202
  NS_LOG_FUNCTION (this << size);
203
  m_bkMaxAmpduSize = size;
204
}
205
206
uint32_t
207
VhtConfiguration::GetBkMaxAmpduSize (void) const
208
{
209
  return m_bkMaxAmpduSize;
210
}
211
51
} //namespace ns3
212
} //namespace ns3
(-)a/src/wifi/model/vht-configuration.h (+93 lines)
 Lines 40-45   public: Link Here 
40
  virtual ~VhtConfiguration ();
40
  virtual ~VhtConfiguration ();
41
41
42
  static TypeId GetTypeId (void);
42
  static TypeId GetTypeId (void);
43
44
  /**
45
   * Set the maximum A-MSDU size for AC_VO.
46
   *
47
   * \param size the maximum A-MSDU size for AC_VO.
48
   */
49
  void SetVoMaxAmsduSize (uint16_t size);
50
  /**
51
   * \return the maximum A-MSDU size for AC_VO.
52
   */
53
  uint16_t GetVoMaxAmsduSize (void) const;
54
  /**
55
   * Set the maximum A-MSDU size for AC_VI.
56
   *
57
   * \param size the maximum A-MSDU size for AC_VI.
58
   */
59
  void SetViMaxAmsduSize (uint16_t size);
60
  /**
61
   * \return the maximum A-MSDU size for AC_VI.
62
   */
63
  uint16_t GetViMaxAmsduSize (void) const;
64
  /**
65
   * Set the maximum A-MSDU size for AC_BE.
66
   *
67
   * \param size the maximum A-MSDU size for AC_BE.
68
   */
69
  void SetBeMaxAmsduSize (uint16_t size);
70
  /**
71
   * \return the maximum A-MSDU size for AC_BE.
72
   */
73
  uint16_t GetBeMaxAmsduSize (void) const;
74
  /**
75
   * Set the maximum A-MSDU size for AC_BK.
76
   *
77
   * \param size the maximum A-MSDU size for AC_BK.
78
   */
79
  void SetBkMaxAmsduSize (uint16_t size);
80
  /**
81
   * \return the maximum A-MSDU size for AC_BK.
82
   */
83
  uint16_t GetBkMaxAmsduSize (void) const;
84
  /**
85
   * Set the maximum A-MPDU size for AC_VO.
86
   *
87
   * \param size the maximum A-MPDU size for AC_VO.
88
   */
89
  void SetVoMaxAmpduSize (uint32_t size);
90
  /**
91
   * \return the maximum A-MPDU size for AC_VO.
92
   */
93
  uint32_t GetVoMaxAmpduSize (void) const;
94
  /**
95
   * Set the maximum A-MPDU size for AC_VI.
96
   *
97
   * \param size the maximum A-MPDU size for AC_VI.
98
   */
99
  void SetViMaxAmpduSize (uint32_t size);
100
  /**
101
   * \return the maximum A-MPDU size for AC_VI.
102
   */
103
  uint32_t GetViMaxAmpduSize (void) const;
104
  /**
105
   * Set the maximum A-MPDU size for AC_BE.
106
   *
107
   * \param size the maximum A-MPDU size for AC_BE.
108
   */
109
  void SetBeMaxAmpduSize (uint32_t size);
110
  /**
111
   * \return the maximum A-MPDU size for AC_BE.
112
   */
113
  uint32_t GetBeMaxAmpduSize (void) const;
114
  /**
115
   * Set the maximum A-MPDU size for AC_BK.
116
   *
117
   * \param size the maximum A-MPDU size for AC_BK.
118
   */
119
  void SetBkMaxAmpduSize (uint32_t size);
120
  /**
121
   * \return the maximum A-MPDU size for AC_BK.
122
   */
123
  uint32_t GetBkMaxAmpduSize (void) const;
124
125
126
private:
127
  uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
128
  uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
129
  uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
130
  uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
131
132
  uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
133
  uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
134
  uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
135
  uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
43
};
136
};
44
137
45
} //namespace ns3
138
} //namespace ns3
(-)a/src/wifi/model/wifi-mac.cc (+8 lines)
 Lines 25-30    Link Here 
25
#include "ssid.h"
25
#include "ssid.h"
26
#include "wifi-net-device.h"
26
#include "wifi-net-device.h"
27
#include "ht-configuration.h"
27
#include "ht-configuration.h"
28
#include "vht-configuration.h"
28
#include "he-configuration.h"
29
#include "he-configuration.h"
29
30
30
namespace ns3 {
31
namespace ns3 {
 Lines 480-485   WifiMac::GetHtConfiguration (void) const Link Here 
480
      return device->GetHtConfiguration ();
481
      return device->GetHtConfiguration ();
481
}
482
}
482
483
484
Ptr<VhtConfiguration>
485
WifiMac::GetVhtConfiguration (void) const
486
{
487
      Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
488
      return device->GetVhtConfiguration ();
489
}
490
483
Ptr<HeConfiguration>
491
Ptr<HeConfiguration>
484
WifiMac::GetHeConfiguration (void) const
492
WifiMac::GetHeConfiguration (void) const
485
{
493
{
(-)a/src/wifi/model/wifi-mac.h (-9 / +14 lines)
 Lines 31-36   namespace ns3 { Link Here 
31
class Ssid;
31
class Ssid;
32
class Txop;
32
class Txop;
33
class HtConfiguration;
33
class HtConfiguration;
34
class VhtConfiguration;
34
class HeConfiguration;
35
class HeConfiguration;
35
36
36
/**
37
/**
 Lines 312-317   public: Link Here 
312
   */
313
   */
313
  void ConfigureStandard (WifiPhyStandard standard);
314
  void ConfigureStandard (WifiPhyStandard standard);
314
315
316
  /**
317
   * \return pointer to HtConfiguration if it exists
318
   */
319
  Ptr<HtConfiguration> GetHtConfiguration (void) const;
320
  /**
321
   * \return pointer to VhtConfiguration if it exists
322
   */
323
  Ptr<VhtConfiguration> GetVhtConfiguration (void) const;
324
  /**
325
   * \return pointer to HeConfiguration if it exists
326
   */
327
  Ptr<HeConfiguration> GetHeConfiguration (void) const;
328
315
329
316
protected:
330
protected:
317
  /**
331
  /**
 Lines 325-339   protected: Link Here 
325
   */
339
   */
326
  void ConfigureDcf (Ptr<Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac);
340
  void ConfigureDcf (Ptr<Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac);
327
341
328
  /**
329
   * \return pointer to HtConfiguration if it exists
330
   */
331
  Ptr<HtConfiguration> GetHtConfiguration (void) const;
332
  /**
333
   * \return pointer to HeConfiguration if it exists
334
   */
335
  Ptr<HeConfiguration> GetHeConfiguration (void) const;
336
337
342
338
private:
343
private:
339
  /**
344
  /**
(-)a/src/wifi/test/wifi-aggregation-test.cc (-10 / +5 lines)
 Lines 102-108   AmpduAggregationTest::DoRun (void) Link Here 
102
  /*
102
  /*
103
   * Configure MPDU aggregation.
103
   * Configure MPDU aggregation.
104
   */
104
   */
105
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
105
  htConfiguration->SetBeMaxAmpduSize (65535);
106
106
107
  /*
107
  /*
108
   * Create a dummy packet of 1500 bytes and fill mac header fields.
108
   * Create a dummy packet of 1500 bytes and fill mac header fields.
 Lines 307-314   TwoLevelAggregationTest::DoRun (void) Link Here 
307
  /*
307
  /*
308
   * Configure aggregation.
308
   * Configure aggregation.
309
   */
309
   */
310
  m_mac->GetBEQueue ()->GetMsduAggregator ()->SetMaxAmsduSize (4095);
310
  htConfiguration->SetBeMaxAmsduSize (4095);
311
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
311
  htConfiguration->SetBeMaxAmpduSize (65535);
312
312
313
  /*
313
  /*
314
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
314
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
 Lines 356-362   TwoLevelAggregationTest::DoRun (void) Link Here 
356
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
356
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
357
   * This test is needed to ensure that no packets are removed from the queue in MacLow::PerformMsduAggregation, since aggregation will no occur in MacLow::AggregateToAmpdu.
357
   * This test is needed to ensure that no packets are removed from the queue in MacLow::PerformMsduAggregation, since aggregation will no occur in MacLow::AggregateToAmpdu.
358
   */
358
   */
359
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (65535);
359
  htConfiguration->SetBeMaxAmpduSize (65535);
360
360
361
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
361
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
362
  packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
362
  packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
 Lines 371-377   TwoLevelAggregationTest::DoRun (void) Link Here 
371
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
371
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
372
   * This test is needed to ensure that there is no issue when the queue is empty.
372
   * This test is needed to ensure that there is no issue when the queue is empty.
373
   */
373
   */
374
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (4095);
374
  htConfiguration->SetBeMaxAmpduSize (4095);
375
375
376
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
376
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
377
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
377
  m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
 Lines 456-466   HeAggregationTest::DoRunSubTest (uint16_t bufferSize) Link Here 
456
  m_device->SetMac (m_mac);
456
  m_device->SetMac (m_mac);
457
457
458
  /*
458
  /*
459
   * Configure MPDU aggregation.
460
   */
461
  m_mac->GetBEQueue ()->GetMpduAggregator ()->SetMaxAmpduSize (4194304); //Maximum size allowed by 802.11ax
462
463
  /*
464
   * Create a dummy packet of 100 bytes and fill mac header fields.
459
   * Create a dummy packet of 100 bytes and fill mac header fields.
465
   */
460
   */
466
  Ptr<const Packet> pkt = Create<Packet> (100);
461
  Ptr<const Packet> pkt = Create<Packet> (100);

Return to bug 3010