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

(-)a/examples/wireless/simple-ht-hidden-stations.cc (-25 / +19 lines)
 Lines 52-57    Link Here 
52
  uint32_t payloadSize = 1472; //bytes
52
  uint32_t payloadSize = 1472; //bytes
53
  uint64_t simulationTime = 10; //seconds
53
  uint64_t simulationTime = 10; //seconds
54
  uint32_t nMpdus = 1;
54
  uint32_t nMpdus = 1;
55
  uint32_t maxAmpduSize = 0;
56
  uint16_t blockAckThreshold = 0;
55
  bool enableRts = 0;
57
  bool enableRts = 0;
56
58
57
  CommandLine cmd;
59
  CommandLine cmd;
 Lines 72-77    Link Here 
72
74
73
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
75
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
74
76
77
  if (nMpdus > 1)
78
    {
79
     //enable BlockAck when A-MPDU is used
80
      blockAckThreshold = 2;
81
    }
82
  //Set the maximum size for A-MPDU with regards to the payload size
83
  maxAmpduSize = nMpdus * (payloadSize + 200);
84
75
  // Set the maximum wireless range to 5 meters in order to reproduce a hidden nodes scenario, i.e. the distance between hidden stations is larger than 5 meters
85
  // Set the maximum wireless range to 5 meters in order to reproduce a hidden nodes scenario, i.e. the distance between hidden stations is larger than 5 meters
76
  Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", DoubleValue (5));
86
  Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", DoubleValue (5));
77
87
 Lines 90-129    Link Here 
90
  WifiHelper wifi = WifiHelper::Default ();
100
  WifiHelper wifi = WifiHelper::Default ();
91
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
101
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
92
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
102
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
103
  
93
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
104
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
105
  Ssid ssid = Ssid ("simple-mpdu-aggregation");
106
  NetDeviceContainer staDevices, apDevice;
94
107
95
  Ssid ssid = Ssid ("simple-mpdu-aggregation");
96
  mac.SetType ("ns3::StaWifiMac",
108
  mac.SetType ("ns3::StaWifiMac",
97
               "Ssid", SsidValue (ssid),
109
               "Ssid", SsidValue (ssid),
98
               "ActiveProbing", BooleanValue (false));
110
               "ActiveProbing", BooleanValue (false),
99
111
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
100
  if (nMpdus > 1)
112
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
101
    {
102
      mac.SetBlockAckThresholdForAc (AC_BE, 2);             //enable Block ACK when A-MPDU is enabled
103
104
    }
105
  mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
106
                              "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes,
107
                                                                                             //i.e. nMpdus aggregated packets in an A-MPDU
108
109
  NetDeviceContainer staDevices;
110
  staDevices = wifi.Install (phy, mac, wifiStaNodes);
113
  staDevices = wifi.Install (phy, mac, wifiStaNodes);
111
114
112
  mac.SetType ("ns3::ApWifiMac",
115
  mac.SetType ("ns3::ApWifiMac",
113
               "Ssid", SsidValue (ssid),
116
               "Ssid", SsidValue (ssid),
114
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
117
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
115
               "BeaconGeneration", BooleanValue (true));
118
               "BeaconGeneration", BooleanValue (true),
116
119
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
117
  if (nMpdus > 1)
120
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
118
    {
119
      mac.SetBlockAckThresholdForAc (AC_BE, 2);             //enable Block ACK when A-MPDU is enabled
120
121
    }
122
  mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
123
                              "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes,
124
                                                                                             //i.e. nMpdus aggregated packets in an A-MPDU
125
126
  NetDeviceContainer apDevice;
127
  apDevice = wifi.Install (phy, mac, wifiApNode);
121
  apDevice = wifi.Install (phy, mac, wifiApNode);
128
122
129
  // Setting mobility model
123
  // Setting mobility model
(-)a/examples/wireless/simple-mpdu-aggregation.cc (-23 / +19 lines)
 Lines 55-60    Link Here 
55
  uint32_t payloadSize = 1472; //bytes
55
  uint32_t payloadSize = 1472; //bytes
56
  uint64_t simulationTime = 10; //seconds
56
  uint64_t simulationTime = 10; //seconds
57
  uint32_t nMpdus = 1;
57
  uint32_t nMpdus = 1;
58
  uint32_t maxAmpduSize = 0;
59
  uint16_t blockAckThreshold = 0;
58
  bool enableRts = 0;
60
  bool enableRts = 0;
59
61
60
  CommandLine cmd;
62
  CommandLine cmd;
 Lines 74-79    Link Here 
74
    }
76
    }
75
77
76
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
78
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
79
  
80
  if (nMpdus > 1)
81
    {
82
     //enable BlockAck when A-MPDU is used
83
      blockAckThreshold = 2;
84
    }
85
  //Set the maximum size for A-MPDU with regards to the payload size
86
  maxAmpduSize = nMpdus * (payloadSize + 200);
77
87
78
  NodeContainer wifiStaNode;
88
  NodeContainer wifiStaNode;
79
  wifiStaNode.Create (1);
89
  wifiStaNode.Create (1);
 Lines 88-125    Link Here 
88
  WifiHelper wifi = WifiHelper::Default ();
98
  WifiHelper wifi = WifiHelper::Default ();
89
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
99
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
90
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
100
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
101
  
91
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
102
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
103
  Ssid ssid = Ssid ("simple-mpdu-aggregation");
104
  NetDeviceContainer staDevice, apDevice;
92
105
93
  Ssid ssid = Ssid ("simple-mpdu-aggregation");
94
  mac.SetType ("ns3::StaWifiMac",
106
  mac.SetType ("ns3::StaWifiMac",
95
               "Ssid", SsidValue (ssid),
107
               "Ssid", SsidValue (ssid),
96
               "ActiveProbing", BooleanValue (false));
108
               "ActiveProbing", BooleanValue (false),
97
109
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
98
  if (nMpdus > 1)
110
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
99
    {
100
      mac.SetBlockAckThresholdForAc (AC_BE, 2);             //enable Block ACK when A-MPDU is enabled (i.e. nMpdus > 1)
101
102
    }
103
  mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
104
                              "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes, i.e. nMpdus aggregated packets in an A-MPDU
105
106
  NetDeviceContainer staDevice;
107
  staDevice = wifi.Install (phy, mac, wifiStaNode);
111
  staDevice = wifi.Install (phy, mac, wifiStaNode);
108
112
109
  mac.SetType ("ns3::ApWifiMac",
113
  mac.SetType ("ns3::ApWifiMac",
110
               "Ssid", SsidValue (ssid),
114
               "Ssid", SsidValue (ssid),
111
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
115
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
112
               "BeaconGeneration", BooleanValue (true));
116
               "BeaconGeneration", BooleanValue (true),
113
117
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
114
  if (nMpdus > 1)
118
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
115
    {
116
      mac.SetBlockAckThresholdForAc (AC_BE, 2);             //enable Block ACK when A-MPDU is enabled (i.e. nMpdus > 1)
117
118
    }
119
  mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
120
                              "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes, i.e. nMpdus aggregated packets in an A-MPDU
121
122
  NetDeviceContainer apDevice;
123
  apDevice = wifi.Install (phy, mac, wifiApNode);
119
  apDevice = wifi.Install (phy, mac, wifiApNode);
124
120
125
  /* Setting mobility model */
121
  /* Setting mobility model */
(-)a/examples/wireless/simple-msdu-aggregation.cc (-13 / +11 lines)
 Lines 74-79    Link Here 
74
    }
74
    }
75
75
76
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
76
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
77
  
78
  uint32_t maxAmsduSize = nMsdus * (payloadSize + 100);
77
79
78
  NodeContainer wifiStaNode;
80
  NodeContainer wifiStaNode;
79
  wifiStaNode.Create (1);
81
  wifiStaNode.Create (1);
 Lines 88-113    Link Here 
88
  WifiHelper wifi = WifiHelper::Default ();
90
  WifiHelper wifi = WifiHelper::Default ();
89
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
91
  wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
90
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
92
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"));
93
  
91
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
94
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
92
93
  Ssid ssid = Ssid ("simple-msdu-aggregation");
95
  Ssid ssid = Ssid ("simple-msdu-aggregation");
96
  NetDeviceContainer staDevice, apDevice;
97
  
94
  mac.SetType ("ns3::StaWifiMac",
98
  mac.SetType ("ns3::StaWifiMac",
95
               "Ssid", SsidValue (ssid),
99
               "Ssid", SsidValue (ssid),
96
               "ActiveProbing", BooleanValue (false));
100
               "ActiveProbing", BooleanValue (false),
97
101
  //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
98
  mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
102
               "BE_MaxAmsduSize", UintegerValue (maxAmsduSize));
99
                              "MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
100
101
  NetDeviceContainer staDevice;
102
  staDevice = wifi.Install (phy, mac, wifiStaNode);
103
  staDevice = wifi.Install (phy, mac, wifiStaNode);
103
104
104
  mac.SetType ("ns3::ApWifiMac",
105
  mac.SetType ("ns3::ApWifiMac",
105
               "Ssid", SsidValue (ssid));
106
               "Ssid", SsidValue (ssid),
106
107
  //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
107
  mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
108
               "BE_MaxAmsduSize", UintegerValue (maxAmsduSize));
108
                              "MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
109
110
  NetDeviceContainer apDevice;
111
  apDevice = wifi.Install (phy, mac, wifiApNode);
109
  apDevice = wifi.Install (phy, mac, wifiApNode);
112
110
113
  /* Setting mobility model */
111
  /* Setting mobility model */
(-)a/examples/wireless/simple-two-level-aggregation.cc (-45 / +32 lines)
 Lines 67-72    Link Here 
67
  uint64_t simulationTime = 10; //seconds
67
  uint64_t simulationTime = 10; //seconds
68
  uint32_t nMsdus = 1;
68
  uint32_t nMsdus = 1;
69
  uint32_t nMpdus = 1;
69
  uint32_t nMpdus = 1;
70
  uint16_t blockAckThreshold = 0;
71
  uint32_t maxAmsduSize = 0;
72
  uint32_t maxAmpduSize = 0;
70
  bool enableRts = 0;
73
  bool enableRts = 0;
71
74
72
  CommandLine cmd;
75
  CommandLine cmd;
 Lines 87-92    Link Here 
87
    }
90
    }
88
91
89
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
92
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
93
  
94
  if (nMpdus > 1)
95
    {
96
     //enable BlockAck when A-MPDU is used
97
      blockAckThreshold = 2;
98
    }
99
  if (nMsdus > 0)
100
    {
101
      //Set the maximum size for A-MPDU with regards to the payload size and the number of MSDUs expected in each MPDU.
102
      maxAmpduSize = nMpdus * (nMsdus * (payloadSize + 100));
103
    }
104
  else
105
    {
106
      //Set the maximum size for A-MPDU with regards to the payload size
107
      maxAmpduSize = nMpdus * (payloadSize + 200);
108
    }
109
  //Set the maximum size for A-MSDU with regards to the payload size
110
  maxAmsduSize = nMsdus * (payloadSize + 100);
90
111
91
  NodeContainer wifiStaNode;
112
  NodeContainer wifiStaNode;
92
  wifiStaNode.Create (1);
113
  wifiStaNode.Create (1);
 Lines 104-163    Link Here 
104
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
125
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
105
                                "DataMode", StringValue ("HtMcs7"),
126
                                "DataMode", StringValue ("HtMcs7"),
106
                                "ControlMode", StringValue ("HtMcs0"));
127
                                "ControlMode", StringValue ("HtMcs0"));
128
    
107
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
129
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
130
  Ssid ssid = Ssid ("simple-two-level-aggregation");
131
  NetDeviceContainer staDevice, apDevice;
108
132
109
  Ssid ssid = Ssid ("simple-two-level-aggregation");
110
  mac.SetType ("ns3::StaWifiMac",
133
  mac.SetType ("ns3::StaWifiMac",
111
               "Ssid", SsidValue (ssid),
134
               "Ssid", SsidValue (ssid),
112
               "ActiveProbing", BooleanValue (false));
135
               "ActiveProbing", BooleanValue (false),
113
136
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
114
137
               "BE_MaxAmsduSize", UintegerValue (maxAmsduSize),
115
  //Enable aggregation at the station side
138
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
116
  if (nMpdus > 1)
117
    {
118
      mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable BlockAck when A-MPDU is used
119
    }
120
  if (nMsdus > 0)
121
    {
122
      mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
123
                                  "MaxAmpduSize", UintegerValue (nMpdus * (nMsdus * (payloadSize + 100)))); //Set the maximum size for A-MPDU with regards to the payload size and the number of MSDUs expected in each MPDU.
124
    }
125
  else //MPDU aggregation only (one-level aggregation)
126
    {
127
      mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
128
                                  "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 200))); //Set the maximum size for A-MPDU with regards to the payload size
129
    }
130
  mac.SetMsduAggregatorForAc (AC_BE,"ns3::MsduStandardAggregator",
131
                              "MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //Set the maximum size for A-MSDU with regards to the payload size
132
133
134
  NetDeviceContainer staDevice;
135
  staDevice = wifi.Install (phy, mac, wifiStaNode);
139
  staDevice = wifi.Install (phy, mac, wifiStaNode);
136
140
137
  mac.SetType ("ns3::ApWifiMac",
141
  mac.SetType ("ns3::ApWifiMac",
138
               "Ssid", SsidValue (ssid),
142
               "Ssid", SsidValue (ssid),
139
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
143
               "BeaconInterval", TimeValue (MicroSeconds (102400)),
140
               "BeaconGeneration", BooleanValue (true));
144
               "BeaconGeneration", BooleanValue (true),
141
145
               "BE_BlockAckThreshold", UintegerValue (blockAckThreshold),
142
  //Enable aggregation at the AP side
146
               "BE_MaxAmsduSize", UintegerValue (maxAmsduSize),
143
  if (nMpdus > 1)
147
               "BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
144
    {
145
      mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable BlockAck when A-MPDU is used
146
    }
147
  if (nMsdus > 0)
148
    {
149
      mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
150
                                  "MaxAmpduSize", UintegerValue (nMpdus * (nMsdus * (payloadSize + 100)))); //Set the maximum size for A-MPDU according to the payload size and the number of MSDUs expected in each MPDU.
151
    }
152
  else //MPDU aggregation only (one-level aggregation)
153
    {
154
      mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
155
                                  "MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 200))); //Set the maximum size for A-MPDU with regards to the payload size
156
    }
157
  mac.SetMsduAggregatorForAc (AC_BE,"ns3::MsduStandardAggregator",
158
                              "MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //Set the maximum size for A-MSDU with regards to the payload size
159
160
  NetDeviceContainer apDevice;
161
  apDevice = wifi.Install (phy, mac, wifiApNode);
148
  apDevice = wifi.Install (phy, mac, wifiApNode);
162
149
163
  /* Setting mobility model */
150
  /* Setting mobility model */
(-)a/examples/wireless/wifi-blockack.cc (-6 / +6 lines)
 Lines 71-86    Link Here 
71
71
72
  mac.SetType ("ns3::StaWifiMac",
72
  mac.SetType ("ns3::StaWifiMac",
73
               "Ssid", SsidValue (ssid),
73
               "Ssid", SsidValue (ssid),
74
               "ActiveProbing", BooleanValue (false));
74
               "ActiveProbing", BooleanValue (false),
75
  /* setting blockack threshold for sta's BE queue */
75
  /* setting blockack threshold for sta's BE queue */
76
  mac.SetBlockAckThresholdForAc (AC_BE, 2);
76
               "BE_BlockAckThreshold", UintegerValue (2),
77
  /* setting block inactivity timeout to 3*1024 = 3072 microseconds */ 
77
  /* setting block inactivity timeout to 3*1024 = 3072 microseconds */
78
  //mac.SetBlockAckInactivityTimeoutForAc (AC_BE, 3);
78
               "BE_BlockAckInactivityTimeout", UintegerValue (3));
79
  NetDeviceContainer staDevice = wifi.Install (phy, mac, sta);
79
  NetDeviceContainer staDevice = wifi.Install (phy, mac, sta);
80
80
81
  mac.SetType ("ns3::ApWifiMac",
81
  mac.SetType ("ns3::ApWifiMac",
82
               "Ssid", SsidValue (ssid));
82
               "Ssid", SsidValue (ssid),
83
  mac.SetBlockAckThresholdForAc (AC_BE, 0);
83
               "BE_BlockAckThreshold", UintegerValue (0));
84
  NetDeviceContainer apDevice = wifi.Install (phy, mac, ap);
84
  NetDeviceContainer apDevice = wifi.Install (phy, mac, ap);
85
85
86
  /* Setting mobility model */
86
  /* Setting mobility model */
(-)a/src/test/ns3wifi/wifi-msdu-aggregator-test-suite.cc (-3 / +2 lines)
 Lines 87-95    Link Here 
87
  wifiMac.SetType ("ns3::ApWifiMac",
87
  wifiMac.SetType ("ns3::ApWifiMac",
88
                   "Ssid", SsidValue (ssid),
88
                   "Ssid", SsidValue (ssid),
89
                   "BeaconGeneration", BooleanValue (true),
89
                   "BeaconGeneration", BooleanValue (true),
90
                   "BeaconInterval", TimeValue (MicroSeconds (102400)));
90
                   "BeaconInterval", TimeValue (MicroSeconds (102400)),
91
  wifiMac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
91
                   "BE_MaxAmsduSize", UintegerValue (4000));
92
                                  "MaxAmsduSize", UintegerValue (4000));
93
  NetDeviceContainer apDev = wifi.Install (wifiPhy, wifiMac, ap);
92
  NetDeviceContainer apDev = wifi.Install (wifiPhy, wifiMac, ap);
94
93
95
  // Setup one STA, which will be the sink for traffic in this test.
94
  // Setup one STA, which will be the sink for traffic in this test.
(-)a/src/wave/helper/wave-mac-helper.cc (-2 / +8 lines)
 Lines 100-106    Link Here 
100
                           std::string n4, const AttributeValue &v4,
100
                           std::string n4, const AttributeValue &v4,
101
                           std::string n5, const AttributeValue &v5,
101
                           std::string n5, const AttributeValue &v5,
102
                           std::string n6, const AttributeValue &v6,
102
                           std::string n6, const AttributeValue &v6,
103
                           std::string n7, const AttributeValue &v7)
103
                           std::string n7, const AttributeValue &v7,
104
                           std::string n8, const AttributeValue &v8,
105
                           std::string n9, const AttributeValue &v9,
106
                           std::string n10, const AttributeValue &v10)
104
{
107
{
105
  if (type.compare ("ns3::OcbWifiMac") != 0)
108
  if (type.compare ("ns3::OcbWifiMac") != 0)
106
    {
109
    {
 Lines 114-120    Link Here 
114
                             n4, v4,
117
                             n4, v4,
115
                             n5, v5,
118
                             n5, v5,
116
                             n6, v6,
119
                             n6, v6,
117
                             n7, v7);
120
                             n7, v7,
121
                             n8, v8,
122
                             n9, v9,
123
                             n10, v10);
118
}
124
}
119
125
120
} // namespace ns3
126
} // namespace ns3
(-)a/src/wave/helper/wave-mac-helper.h (-1 / +10 lines)
 Lines 119-124    Link Here 
119
   * \param v6 the value of the attribute to set
119
   * \param v6 the value of the attribute to set
120
   * \param n7 the name of the attribute to set
120
   * \param n7 the name of the attribute to set
121
   * \param v7 the value of the attribute to set
121
   * \param v7 the value of the attribute to set
122
   * \param n8 the value of the attribute to set
123
   * \param v8 the value of the attribute to set
124
   * \param n9 the value of the attribute to set
125
   * \param v9 the value of the attribute to set
126
   * \param n10 the value of the attribute to set
127
   * \param v10 the value of the attribute to set
122
   *
128
   *
123
   * All the attributes specified in this method should exist
129
   * All the attributes specified in this method should exist
124
   * in the requested mac.
130
   * in the requested mac.
 Lines 134-140    Link Here 
134
                        std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
140
                        std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
135
                        std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
141
                        std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
136
                        std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
142
                        std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
137
                        std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
143
                        std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
144
                        std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
145
                        std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (),
146
                        std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ());
138
};
147
};
139
148
140
}
149
}
(-)a/src/wifi/helper/qos-wifi-mac-helper.cc (-97 / +7 lines)
 Lines 19-32    Link Here 
19
 */
19
 */
20
20
21
#include "qos-wifi-mac-helper.h"
21
#include "qos-wifi-mac-helper.h"
22
#include "ns3/msdu-aggregator.h"
23
#include "ns3/wifi-mac.h"
22
#include "ns3/wifi-mac.h"
24
#include "ns3/edca-txop-n.h"
25
#include "ns3/pointer.h"
23
#include "ns3/pointer.h"
26
#include "ns3/boolean.h"
24
#include "ns3/boolean.h"
27
#include "ns3/uinteger.h"
28
#include "ns3/mpdu-aggregator.h"
29
#include "ns3/mac-low.h"
30
25
31
namespace ns3 {
26
namespace ns3 {
32
27
 Lines 61-67    Link Here 
61
                           std::string n4, const AttributeValue &v4,
56
                           std::string n4, const AttributeValue &v4,
62
                           std::string n5, const AttributeValue &v5,
57
                           std::string n5, const AttributeValue &v5,
63
                           std::string n6, const AttributeValue &v6,
58
                           std::string n6, const AttributeValue &v6,
64
                           std::string n7, const AttributeValue &v7)
59
                           std::string n7, const AttributeValue &v7,
60
                           std::string n8, const AttributeValue &v8,
61
                           std::string n9, const AttributeValue &v9,
62
                           std::string n10, const AttributeValue &v10)
65
{
63
{
66
  m_mac.SetTypeId (type);
64
  m_mac.SetTypeId (type);
67
  m_mac.Set (n0, v0);
65
  m_mac.Set (n0, v0);
 Lines 72-174    Link Here 
72
  m_mac.Set (n5, v5);
70
  m_mac.Set (n5, v5);
73
  m_mac.Set (n6, v6);
71
  m_mac.Set (n6, v6);
74
  m_mac.Set (n7, v7);
72
  m_mac.Set (n7, v7);
75
}
73
  m_mac.Set (n8, v8);
76
74
  m_mac.Set (n9, v9);
77
void
75
  m_mac.Set (n10, v10);
78
QosWifiMacHelper::SetMsduAggregatorForAc (AcIndex ac, std::string type,
79
                                          std::string n0, const AttributeValue &v0,
80
                                          std::string n1, const AttributeValue &v1,
81
                                          std::string n2, const AttributeValue &v2,
82
                                          std::string n3, const AttributeValue &v3)
83
{
84
  std::map<AcIndex, ObjectFactory>::iterator it = m_aggregators.find (ac);
85
  if (it != m_aggregators.end ())
86
    {
87
      it->second.SetTypeId (type);
88
      it->second.Set (n0, v0);
89
      it->second.Set (n1, v1);
90
      it->second.Set (n2, v2);
91
      it->second.Set (n3, v3);
92
    }
93
  else
94
    {
95
      ObjectFactory factory;
96
      factory.SetTypeId (type);
97
      factory.Set (n0, v0);
98
      factory.Set (n1, v1);
99
      factory.Set (n2, v2);
100
      factory.Set (n3, v3);
101
      m_aggregators.insert (std::make_pair (ac, factory));
102
    }
103
}
104
105
void
106
QosWifiMacHelper::SetMpduAggregatorForAc (enum AcIndex ac, std::string name,
107
                                          std::string n0, const AttributeValue &v0,
108
                                          std::string n1, const AttributeValue &v1,
109
                                          std::string n2, const AttributeValue &v2,
110
                                          std::string n3, const AttributeValue &v3)
111
{
112
  m_mpduAggregator = ObjectFactory ();
113
  m_mpduAggregator.SetTypeId (name);
114
  m_mpduAggregator.Set (n0, v0);
115
  m_mpduAggregator.Set (n1, v1);
116
  m_mpduAggregator.Set (n2, v2);
117
  m_mpduAggregator.Set (n3, v3);
118
}
119
120
void
121
QosWifiMacHelper::SetBlockAckThresholdForAc (enum AcIndex ac, uint8_t threshold)
122
{
123
  m_bAckThresholds[ac] = threshold;
124
}
125
126
void
127
QosWifiMacHelper::SetBlockAckInactivityTimeoutForAc (enum AcIndex ac, uint16_t timeout)
128
{
129
  m_bAckInactivityTimeouts[ac] = timeout;
130
}
131
132
void
133
QosWifiMacHelper::Setup (Ptr<WifiMac> mac, enum AcIndex ac, std::string dcaAttrName) const
134
{
135
  std::map<AcIndex, ObjectFactory>::const_iterator it = m_aggregators.find (ac);
136
  PointerValue ptr;
137
  mac->GetAttribute (dcaAttrName, ptr);
138
  Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
139
140
  if (m_mpduAggregator.GetTypeId ().GetUid () != 0)
141
    {
142
      Ptr<MpduAggregator> mpduaggregator = m_mpduAggregator.Create<MpduAggregator> ();
143
      Ptr<MacLow> low = edca->Low ();
144
      low->SetMpduAggregator (mpduaggregator);
145
    }
146
  if (it != m_aggregators.end ())
147
    {
148
      ObjectFactory factory = it->second;
149
      Ptr<MsduAggregator> aggregator = factory.Create<MsduAggregator> ();
150
      edca->SetMsduAggregator (aggregator);
151
    }
152
  if (m_bAckThresholds.find (ac) != m_bAckThresholds.end ())
153
    {
154
      edca->SetBlockAckThreshold (m_bAckThresholds.find (ac)->second);
155
    }
156
  if (m_bAckInactivityTimeouts.find (ac) != m_bAckInactivityTimeouts.end ())
157
    {
158
      edca->SetBlockAckInactivityTimeout (m_bAckInactivityTimeouts.find (ac)->second);
159
    }
160
}
76
}
161
77
162
Ptr<WifiMac>
78
Ptr<WifiMac>
163
QosWifiMacHelper::Create (void) const
79
QosWifiMacHelper::Create (void) const
164
{
80
{
165
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
81
  Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
166
167
  Setup (mac, AC_VO, "VO_EdcaTxopN");
168
  Setup (mac, AC_VI, "VI_EdcaTxopN");
169
  Setup (mac, AC_BE, "BE_EdcaTxopN");
170
  Setup (mac, AC_BK, "BK_EdcaTxopN");
171
172
  return mac;
82
  return mac;
173
}
83
}
174
84
(-)a/src/wifi/helper/qos-wifi-mac-helper.h (-80 / +11 lines)
 Lines 72-78    Link Here 
72
   * \param n6 the name of the attribute to set
72
   * \param n6 the name of the attribute to set
73
   * \param v6 the value of the attribute to set
73
   * \param v6 the value of the attribute to set
74
   * \param n7 the name of the attribute to set
74
   * \param n7 the name of the attribute to set
75
   * \param v7 the value of the attribute to set
75
   * \param v7 the name of the attribute to set
76
   * \param n8 the value of the attribute to set
77
   * \param v8 the value of the attribute to set
78
   * \param n9 the value of the attribute to set
79
   * \param v9 the value of the attribute to set
80
   * \param n10 the value of the attribute to set
81
   * \param v10 the value of the attribute to set
76
   *
82
   *
77
   * All the attributes specified in this method should exist
83
   * All the attributes specified in this method should exist
78
   * in the requested mac.
84
   * in the requested mac.
 Lines 85-159    Link Here 
85
                        std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
91
                        std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
86
                        std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
92
                        std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
87
                        std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
93
                        std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
88
                        std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
94
                        std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
89
  /**
95
                        std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
90
   * Set the class, type and attributes for the Msdu aggregator
96
                        std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (),
91
   *
97
                        std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ());
92
   * \param ac access category for which we are setting aggregator.
93
   *        Possibilities are: AC_BK, AC_BE, AC_VI, AC_VO.
94
   * \param type the type of ns3::MsduAggregator to create.
95
   * \param n0 the name of the attribute to set
96
   * \param v0 the value of the attribute to set
97
   * \param n1 the name of the attribute to set
98
   * \param v1 the value of the attribute to set
99
   * \param n2 the name of the attribute to set
100
   * \param v2 the value of the attribute to set
101
   * \param n3 the name of the attribute to set
102
   * \param v3 the value of the attribute to set
103
   *
104
   * All the attributes specified in this method should exist
105
   * in the requested aggregator.
106
   */
107
  void SetMsduAggregatorForAc (AcIndex ac, std::string type,
108
                               std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
109
                               std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
110
                               std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
111
                               std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
112
  /**
113
   * Set the class, type and attributes for the Mpdu aggregator
114
   *
115
   * \param ac access category for which we are setting aggregator.
116
   *        Possibilities are: AC_BK, AC_BE, AC_VI, AC_VO.
117
   * \param type the type of ns3::MsduAggregator to create.
118
   * \param n0 the name of the attribute to set
119
   * \param v0 the value of the attribute to set
120
   * \param n1 the name of the attribute to set
121
   * \param v1 the value of the attribute to set
122
   * \param n2 the name of the attribute to set
123
   * \param v2 the value of the attribute to set
124
   * \param n3 the name of the attribute to set
125
   * \param v3 the value of the attribute to set
126
   *
127
   * All the attributes specified in this method should exist
128
   * in the requested aggregator.
129
   */
130
  void SetMpduAggregatorForAc (enum AcIndex ac, std::string type,
131
                               std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
132
                               std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
133
                               std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
134
                               std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
135
  /**
136
   * This method sets value of block ack threshold for a specific access class.
137
   * If number of packets in the respective queue reaches this value block ack mechanism
138
   * is used.
139
   *
140
   * \param ac access category for which we are setting block ack threshold.
141
   *        Possibilities are: AC_BK, AC_BE, AC_VI, AC_VO.
142
   * \param threshold the threshold (number of packets)
143
   */
144
  void SetBlockAckThresholdForAc (enum AcIndex ac, uint8_t threshold);
145
  /**
146
   * Sets value of block ack inactivity timeout for a specific access class. <i>timeout</i>
147
   * represents number of blocks of 1024 microseconds. When this timer expires the relative
148
   * block ack agreement is teared down. Timer is reset in an recipient station every time
149
   * that a block ack request or a MPDU with ack policy BLOCK ACK is received.
150
   * Timer is reset in a originator station every time that a block ack frame is received.
151
   *
152
   * \param ac access category for which we are setting block ack threshold.
153
   *        Possibilities are: AC_BK, AC_BE, AC_VI, AC_VO.
154
   * \param timeout number of block of 1024 microseconds.
155
   */
156
  void SetBlockAckInactivityTimeoutForAc (enum AcIndex ac, uint16_t timeout);
157
98
158
99
159
protected:
100
protected:
 Lines 167-182    Link Here 
167
   * This method implements the pure virtual method defined in \ref ns3::WifiMacHelper.
108
   * This method implements the pure virtual method defined in \ref ns3::WifiMacHelper.
168
   */
109
   */
169
  virtual Ptr<WifiMac> Create (void) const;
110
  virtual Ptr<WifiMac> Create (void) const;
170
  void Setup (Ptr<WifiMac> mac, enum AcIndex ac, std::string dcaAttrName) const;
171
172
  std::map<AcIndex, ObjectFactory> m_aggregators;
173
  ObjectFactory m_mpduAggregator;
174
  /*
175
   * Next maps contain, for every access category, the values for
176
   * block ack threshold and block ack inactivity timeout.
177
   */
178
  std::map<AcIndex, uint8_t> m_bAckThresholds;
179
  std::map<AcIndex, uint16_t> m_bAckInactivityTimeouts;
180
};
111
};
181
112
182
} //namespace ns3
113
} //namespace ns3
(-)a/src/wifi/model/edca-txop-n.cc (-23 / +28 lines)
 Lines 32-37    Link Here 
32
#include "random-stream.h"
32
#include "random-stream.h"
33
#include "wifi-mac-queue.h"
33
#include "wifi-mac-queue.h"
34
#include "msdu-aggregator.h"
34
#include "msdu-aggregator.h"
35
#include "mpdu-aggregator.h"
35
#include "mgt-headers.h"
36
#include "mgt-headers.h"
36
#include "qos-blocked-destinations.h"
37
#include "qos-blocked-destinations.h"
37
38
 Lines 203-208    Link Here 
203
  {
204
  {
204
    return m_txop->GetMsduAggregator ();
205
    return m_txop->GetMsduAggregator ();
205
  }
206
  }
207
  virtual Ptr<MpduAggregator> GetMpduAggregator (void) const
208
  {
209
    return m_txop->GetMpduAggregator ();
210
  }
206
  virtual Mac48Address GetSrcAddressForAggregation (const WifiMacHeader &hdr)
211
  virtual Mac48Address GetSrcAddressForAggregation (const WifiMacHeader &hdr)
207
  {
212
  {
208
    return m_txop->MapSrcAddressForAggregation (hdr);
213
    return m_txop->MapSrcAddressForAggregation (hdr);
 Lines 225-245    Link Here 
225
    .SetParent<ns3::Dcf> ()
230
    .SetParent<ns3::Dcf> ()
226
    .SetGroupName ("Wifi")
231
    .SetGroupName ("Wifi")
227
    .AddConstructor<EdcaTxopN> ()
232
    .AddConstructor<EdcaTxopN> ()
228
    .AddAttribute ("BlockAckThreshold",
229
                   "If number of packets in this queue reaches this value, "
230
                   "block ack mechanism is used. If this value is 0, block ack is never used.",
231
                   UintegerValue (0),
232
                   MakeUintegerAccessor (&EdcaTxopN::SetBlockAckThreshold,
233
                                         &EdcaTxopN::GetBlockAckThreshold),
234
                   MakeUintegerChecker<uint8_t> (0, 64))
235
    .AddAttribute ("BlockAckInactivityTimeout",
236
                   "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
237
                   "inactivity. If this value isn't equal to 0 a timer start after that a"
238
                   "block ack setup is completed and will be reset every time that a block"
239
                   "ack frame is received. If this value is 0, block ack inactivity timeout won't be used.",
240
                   UintegerValue (0),
241
                   MakeUintegerAccessor (&EdcaTxopN::SetBlockAckInactivityTimeout),
242
                   MakeUintegerChecker<uint16_t> ())
243
    .AddAttribute ("Queue",
233
    .AddAttribute ("Queue",
244
                   "The WifiMacQueue object",
234
                   "The WifiMacQueue object",
245
                   PointerValue (),
235
                   PointerValue (),
 Lines 252-258    Link Here 
252
EdcaTxopN::EdcaTxopN ()
242
EdcaTxopN::EdcaTxopN ()
253
  : m_manager (0),
243
  : m_manager (0),
254
    m_currentPacket (0),
244
    m_currentPacket (0),
255
    m_aggregator (0),
245
    m_msduAggregator (0),
246
    m_mpduAggregator (0),
256
    m_typeOfStation (STA),
247
    m_typeOfStation (STA),
257
    m_blockAckType (COMPRESSED_BLOCK_ACK),
248
    m_blockAckType (COMPRESSED_BLOCK_ACK),
258
    m_ampduExist (false)
249
    m_ampduExist (false)
 Lines 299-305    Link Here 
299
  m_baManager = 0;
290
  m_baManager = 0;
300
  m_blockAckListener = 0;
291
  m_blockAckListener = 0;
301
  m_txMiddle = 0;
292
  m_txMiddle = 0;
302
  m_aggregator = 0;
293
  m_msduAggregator = 0;
294
  m_mpduAggregator = 0;
303
}
295
}
304
296
305
bool
297
bool
 Lines 581-591    Link Here 
581
              && m_queue->PeekByTidAndAddress (&peekedHdr, m_currentHdr.GetQosTid (),
573
              && m_queue->PeekByTidAndAddress (&peekedHdr, m_currentHdr.GetQosTid (),
582
                                               WifiMacHeader::ADDR1, m_currentHdr.GetAddr1 (), &tstamp)
574
                                               WifiMacHeader::ADDR1, m_currentHdr.GetAddr1 (), &tstamp)
583
              && !m_currentHdr.GetAddr1 ().IsBroadcast ()
575
              && !m_currentHdr.GetAddr1 ().IsBroadcast ()
584
              && m_aggregator != 0 && !m_currentHdr.IsRetry ())
576
              && m_msduAggregator != 0 && !m_currentHdr.IsRetry ())
585
            {
577
            {
586
              /* here is performed aggregation */
578
              /* here is performed aggregation */
587
              Ptr<Packet> currentAggregatedPacket = Create<Packet> ();
579
              Ptr<Packet> currentAggregatedPacket = Create<Packet> ();
588
              m_aggregator->Aggregate (m_currentPacket, currentAggregatedPacket,
580
              m_msduAggregator->Aggregate (m_currentPacket, currentAggregatedPacket,
589
                                       MapSrcAddressForAggregation (peekedHdr),
581
                                       MapSrcAddressForAggregation (peekedHdr),
590
                                       MapDestAddressForAggregation (peekedHdr));
582
                                       MapDestAddressForAggregation (peekedHdr));
591
              bool aggregated = false;
583
              bool aggregated = false;
 Lines 595-601    Link Here 
595
                                                                             m_currentHdr.GetAddr1 (), &tstamp);
587
                                                                             m_currentHdr.GetAddr1 (), &tstamp);
596
              while (peekedPacket != 0)
588
              while (peekedPacket != 0)
597
                {
589
                {
598
                  aggregated = m_aggregator->Aggregate (peekedPacket, currentAggregatedPacket,
590
                  aggregated = m_msduAggregator->Aggregate (peekedPacket, currentAggregatedPacket,
599
                                                        MapSrcAddressForAggregation (peekedHdr),
591
                                                        MapSrcAddressForAggregation (peekedHdr),
600
                                                        MapDestAddressForAggregation (peekedHdr));
592
                                                        MapDestAddressForAggregation (peekedHdr));
601
                  if (aggregated)
593
                  if (aggregated)
 Lines 957-963    Link Here 
957
Ptr<MsduAggregator>
949
Ptr<MsduAggregator>
958
EdcaTxopN::GetMsduAggregator (void) const
950
EdcaTxopN::GetMsduAggregator (void) const
959
{
951
{
960
  return m_aggregator;
952
  return m_msduAggregator;
953
}
954
955
Ptr<MpduAggregator>
956
EdcaTxopN::GetMpduAggregator (void) const
957
{
958
  return m_mpduAggregator;
961
}
959
}
962
960
963
void
961
void
 Lines 1189-1195    Link Here 
1189
EdcaTxopN::SetMsduAggregator (Ptr<MsduAggregator> aggr)
1187
EdcaTxopN::SetMsduAggregator (Ptr<MsduAggregator> aggr)
1190
{
1188
{
1191
  NS_LOG_FUNCTION (this << aggr);
1189
  NS_LOG_FUNCTION (this << aggr);
1192
  m_aggregator = aggr;
1190
  m_msduAggregator = aggr;
1191
}
1192
1193
void
1194
EdcaTxopN::SetMpduAggregator (Ptr<MpduAggregator> aggr)
1195
{
1196
  NS_LOG_FUNCTION (this << aggr);
1197
  m_mpduAggregator = aggr;
1193
}
1198
}
1194
1199
1195
void
1200
void
 Lines 1261-1267    Link Here 
1261
    {
1266
    {
1262
      m_baManager->SwitchToBlockAckIfNeeded (recipient, tid, sequence);
1267
      m_baManager->SwitchToBlockAckIfNeeded (recipient, tid, sequence);
1263
    }
1268
    }
1264
  if ((m_baManager->ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) && (m_low->GetMpduAggregator () == 0))
1269
  if ((m_baManager->ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) && (GetMpduAggregator ()->GetMaxAmpduSize () == 0))
1265
    {
1270
    {
1266
      m_currentHdr.SetQosAckPolicy (WifiMacHeader::BLOCK_ACK);
1271
      m_currentHdr.SetQosAckPolicy (WifiMacHeader::BLOCK_ACK);
1267
    }
1272
    }
(-)a/src/wifi/model/edca-txop-n.h (-1 / +6 lines)
 Lines 47-52    Link Here 
47
class RandomStream;
47
class RandomStream;
48
class QosBlockedDestinations;
48
class QosBlockedDestinations;
49
class MsduAggregator;
49
class MsduAggregator;
50
class MpduAggregator;
50
class MgtAddBaResponseHeader;
51
class MgtAddBaResponseHeader;
51
class BlockAckManager;
52
class BlockAckManager;
52
class MgtDelBaHeader;
53
class MgtDelBaHeader;
 Lines 161-166    Link Here 
161
  Ptr<MacLow> Low (void);
162
  Ptr<MacLow> Low (void);
162
163
163
  Ptr<MsduAggregator> GetMsduAggregator (void) const;
164
  Ptr<MsduAggregator> GetMsduAggregator (void) const;
165
  Ptr<MpduAggregator> GetMpduAggregator (void) const;
166
164
  /**
167
  /**
165
   * \param recipient address of the peer station
168
   * \param recipient address of the peer station
166
   * \param tid traffic ID.
169
   * \param tid traffic ID.
 Lines 379-384    Link Here 
379
  void Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
382
  void Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
380
383
381
  void SetMsduAggregator (Ptr<MsduAggregator> aggr);
384
  void SetMsduAggregator (Ptr<MsduAggregator> aggr);
385
  void SetMpduAggregator (Ptr<MpduAggregator> aggr);
382
386
383
  /**
387
  /**
384
   * \param packet packet to send
388
   * \param packet packet to send
 Lines 543-549    Link Here 
543
  Ptr<const Packet> m_currentPacket;
547
  Ptr<const Packet> m_currentPacket;
544
548
545
  WifiMacHeader m_currentHdr;
549
  WifiMacHeader m_currentHdr;
546
  Ptr<MsduAggregator> m_aggregator;
550
  Ptr<MsduAggregator> m_msduAggregator;
551
  Ptr<MpduAggregator> m_mpduAggregator;
547
  TypeOfStation m_typeOfStation;
552
  TypeOfStation m_typeOfStation;
548
  QosBlockedDestinations *m_qosBlockedDestinations;
553
  QosBlockedDestinations *m_qosBlockedDestinations;
549
  BlockAckManager *m_baManager;
554
  BlockAckManager *m_baManager;
(-)a/src/wifi/model/mac-low.cc (-22 / +21 lines)
 Lines 36-42    Link Here 
36
#include "yans-wifi-phy.h"
36
#include "yans-wifi-phy.h"
37
#include "ampdu-tag.h"
37
#include "ampdu-tag.h"
38
#include "wifi-mac-queue.h"
38
#include "wifi-mac-queue.h"
39
#include "mpdu-standard-aggregator.h"
40
39
41
#undef NS_LOG_APPEND_CONTEXT
40
#undef NS_LOG_APPEND_CONTEXT
42
#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
41
#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
 Lines 117-122    Link Here 
117
{
116
{
118
  return 0;
117
  return 0;
119
}
118
}
119
Ptr<MpduAggregator>
120
MacLowAggregationCapableTransmissionListener::GetMpduAggregator (void) const
121
{
122
  return 0;
123
}
120
Mac48Address
124
Mac48Address
121
MacLowAggregationCapableTransmissionListener::GetSrcAddressForAggregation (const WifiMacHeader &hdr)
125
MacLowAggregationCapableTransmissionListener::GetSrcAddressForAggregation (const WifiMacHeader &hdr)
122
{
126
{
 Lines 360-366    Link Here 
360
    m_sendDataEvent (),
364
    m_sendDataEvent (),
361
    m_waitSifsEvent (),
365
    m_waitSifsEvent (),
362
    m_endTxNoAckEvent (),
366
    m_endTxNoAckEvent (),
363
    m_mpduAggregator (0),
364
    m_currentPacket (0),
367
    m_currentPacket (0),
365
    m_listener (0),
368
    m_listener (0),
366
    m_phyMacLowListener (0),
369
    m_phyMacLowListener (0),
 Lines 434-440    Link Here 
434
      delete m_phyMacLowListener;
437
      delete m_phyMacLowListener;
435
      m_phyMacLowListener = 0;
438
      m_phyMacLowListener = 0;
436
    }
439
    }
437
  m_mpduAggregator = 0;
438
  m_sentMpdus = 0;
440
  m_sentMpdus = 0;
439
  m_aggregateQueue = 0;
441
  m_aggregateQueue = 0;
440
  m_ampdu = false;
442
  m_ampdu = false;
 Lines 1623-1629    Link Here 
1623
              last = true;
1625
              last = true;
1624
              mpdutype = LAST_MPDU_IN_AGGREGATE;
1626
              mpdutype = LAST_MPDU_IN_AGGREGATE;
1625
            }
1627
            }
1626
          m_mpduAggregator->AddHeaderAndPad (newPacket, last, vhtSingleMpdu);
1628
1629
          uint8_t tid = GetTid (packet, *hdr);
1630
          AcIndex ac = QosUtilsMapTidToAc (tid);
1631
          std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
1632
          listenerIt->second->GetMpduAggregator ()->AddHeaderAndPad (newPacket, last, vhtSingleMpdu);
1627
1633
1628
          if (hdr->IsBlockAckReq ())
1634
          if (hdr->IsBlockAckReq ())
1629
            {
1635
            {
 Lines 2708-2725    Link Here 
2708
}
2714
}
2709
2715
2710
void
2716
void
2711
MacLow::SetMpduAggregator (Ptr<MpduAggregator> aggregator)
2712
{
2713
  m_mpduAggregator = aggregator;
2714
}
2715
2716
Ptr<MpduAggregator>
2717
MacLow::GetMpduAggregator (void)
2718
{
2719
  return m_mpduAggregator;
2720
}
2721
2722
void
2723
MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector, WifiPreamble preamble)
2717
MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector, WifiPreamble preamble)
2724
{
2718
{
2725
  m_currentTxVector = txVector;
2719
  m_currentTxVector = txVector;
 Lines 2808-2813    Link Here 
2808
{
2802
{
2809
  WifiPreamble preamble;
2803
  WifiPreamble preamble;
2810
  WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
2804
  WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
2805
2806
  uint8_t tid = GetTid (peekedPacket, peekedHdr);
2807
  AcIndex ac = QosUtilsMapTidToAc (tid);
2808
  std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
2809
2811
  if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
2810
  if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
2812
    {
2811
    {
2813
      preamble = WIFI_PREAMBLE_VHT;
2812
      preamble = WIFI_PREAMBLE_VHT;
 Lines 2842-2848    Link Here 
2842
      return true;
2841
      return true;
2843
    }
2842
    }
2844
2843
2845
  if (!m_mpduAggregator->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, size))
2844
  if (!listenerIt->second->GetMpduAggregator ()->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, size))
2846
    {
2845
    {
2847
      NS_LOG_DEBUG ("no more packets can be aggregated because the maximum A-MPDU size has been reached");
2846
      NS_LOG_DEBUG ("no more packets can be aggregated because the maximum A-MPDU size has been reached");
2848
      return true;
2847
      return true;
 Lines 2872-2878    Link Here 
2872
      NS_ASSERT (listenerIt != m_edcaListeners.end ());
2871
      NS_ASSERT (listenerIt != m_edcaListeners.end ());
2873
      queue = listenerIt->second->GetQueue ();
2872
      queue = listenerIt->second->GetQueue ();
2874
2873
2875
      if (!hdr.GetAddr1 ().IsBroadcast () && m_mpduAggregator != 0)
2874
      if (!hdr.GetAddr1 ().IsBroadcast () && listenerIt->second->GetMpduAggregator () != 0)
2876
        {
2875
        {
2877
          //Have to make sure that their exist a block Ack agreement before sending an AMPDU (BlockAck Manager)
2876
          //Have to make sure that their exist a block Ack agreement before sending an AMPDU (BlockAck Manager)
2878
          if (listenerIt->second->GetBlockAckAgreementExists (hdr.GetAddr1 (), tid))
2877
          if (listenerIt->second->GetBlockAckAgreementExists (hdr.GetAddr1 (), tid))
 Lines 2901-2907    Link Here 
2901
                  WifiMacTrailer fcs;
2900
                  WifiMacTrailer fcs;
2902
                  newPacket->AddTrailer (fcs);
2901
                  newPacket->AddTrailer (fcs);
2903
2902
2904
                  aggregated = m_mpduAggregator->Aggregate (newPacket, currentAggregatedPacket);
2903
                  aggregated = listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2905
2904
2906
                  if (aggregated)
2905
                  if (aggregated)
2907
                    {
2906
                    {
 Lines 2972-2978    Link Here 
2972
                  newPacket->AddHeader (peekedHdr);
2971
                  newPacket->AddHeader (peekedHdr);
2973
                  WifiMacTrailer fcs;
2972
                  WifiMacTrailer fcs;
2974
                  newPacket->AddTrailer (fcs);
2973
                  newPacket->AddTrailer (fcs);
2975
                  aggregated = m_mpduAggregator->Aggregate (newPacket, currentAggregatedPacket);
2974
                  aggregated = listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2976
                  if (aggregated)
2975
                  if (aggregated)
2977
                    {
2976
                    {
2978
                      m_aggregateQueue->Enqueue (aggPacket, peekedHdr);
2977
                      m_aggregateQueue->Enqueue (aggPacket, peekedHdr);
 Lines 3074-3080    Link Here 
3074
                      newPacket->AddHeader (peekedHdr);
3073
                      newPacket->AddHeader (peekedHdr);
3075
                      WifiMacTrailer fcs;
3074
                      WifiMacTrailer fcs;
3076
                      newPacket->AddTrailer (fcs);
3075
                      newPacket->AddTrailer (fcs);
3077
                      m_mpduAggregator->Aggregate (newPacket, currentAggregatedPacket);
3076
                      listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
3078
                    }
3077
                    }
3079
                  if (qosPolicy == 0)
3078
                  if (qosPolicy == 0)
3080
                    {
3079
                    {
 Lines 3108-3114    Link Here 
3108
              peekedHdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK);
3107
              peekedHdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK);
3109
3108
3110
              currentAggregatedPacket = Create<Packet> ();
3109
              currentAggregatedPacket = Create<Packet> ();
3111
              m_mpduAggregator->AggregateVhtSingleMpdu (packet, currentAggregatedPacket);
3110
              listenerIt->second->GetMpduAggregator ()->AggregateVhtSingleMpdu (packet, currentAggregatedPacket);
3112
              m_aggregateQueue->Enqueue (packet, peekedHdr);
3111
              m_aggregateQueue->Enqueue (packet, peekedHdr);
3113
              m_sentMpdus = 1;
3112
              m_sentMpdus = 1;
3114
3113
(-)a/src/wifi/model/mac-low.h (-11 / +3 lines)
 Lines 280-285    Link Here 
280
  virtual Ptr<MsduAggregator> GetMsduAggregator (void) const;
280
  virtual Ptr<MsduAggregator> GetMsduAggregator (void) const;
281
  /**
281
  /**
282
   */
282
   */
283
  virtual Ptr<MpduAggregator> GetMpduAggregator (void) const;
284
  /**
285
   */
283
  virtual Mac48Address GetSrcAddressForAggregation (const WifiMacHeader &hdr);
286
  virtual Mac48Address GetSrcAddressForAggregation (const WifiMacHeader &hdr);
284
  /**
287
  /**
285
   */
288
   */
 Lines 525-541    Link Here 
525
   */
528
   */
526
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager);
529
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager);
527
  /**
530
  /**
528
   * Set up MpduAggregator associated with this MacLow.
529
   *
530
   * \param aggregator MpduAggregator associated with this MacLow
531
   */
532
  void SetMpduAggregator (Ptr<MpduAggregator> aggregator);
533
  /**
534
   *
535
   * \return the attached MpduAggregator
536
   */
537
  Ptr<MpduAggregator> GetMpduAggregator (void);
538
  /**
539
   * Set MAC address of this MacLow.
531
   * Set MAC address of this MacLow.
540
   *
532
   *
541
   * \param ad Mac48Address of this MacLow
533
   * \param ad Mac48Address of this MacLow
(-)a/src/wifi/model/mpdu-aggregator.h (+3 lines)
 Lines 48-53    Link Here 
48
  typedef std::list<std::pair<Ptr<Packet>, AmpduSubframeHeader> >::const_iterator DeaggregatedMpdusCI;
48
  typedef std::list<std::pair<Ptr<Packet>, AmpduSubframeHeader> >::const_iterator DeaggregatedMpdusCI;
49
49
50
  static TypeId GetTypeId (void);
50
  static TypeId GetTypeId (void);
51
52
  virtual void SetMaxAmpduSize (uint32_t maxSize) = 0;
53
  virtual uint32_t GetMaxAmpduSize (void) const = 0;
51
  /**
54
  /**
52
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
55
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
53
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible.
56
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible.
(-)a/src/wifi/model/mpdu-standard-aggregator.cc (-4 / +12 lines)
 Lines 36-45    Link Here 
36
    .SetParent<MpduAggregator> ()
36
    .SetParent<MpduAggregator> ()
37
    .SetGroupName ("Wifi")
37
    .SetGroupName ("Wifi")
38
    .AddConstructor<MpduStandardAggregator> ()
38
    .AddConstructor<MpduStandardAggregator> ()
39
    .AddAttribute ("MaxAmpduSize", "Max length in bytes of an A-MPDU",
40
                   UintegerValue (65535),
41
                   MakeUintegerAccessor (&MpduStandardAggregator::m_maxAmpduLength),
42
                   MakeUintegerChecker<uint32_t> ())
43
  ;
39
  ;
44
  return tid;
40
  return tid;
45
}
41
}
 Lines 52-57    Link Here 
52
{
48
{
53
}
49
}
54
50
51
void
52
MpduStandardAggregator::SetMaxAmpduSize (uint32_t maxSize)
53
{
54
  m_maxAmpduLength = maxSize;
55
}
56
57
uint32_t
58
MpduStandardAggregator::GetMaxAmpduSize (void) const
59
{
60
  return m_maxAmpduLength;
61
}
62
55
bool
63
bool
56
MpduStandardAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket)
64
MpduStandardAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket)
57
{
65
{
(-)a/src/wifi/model/mpdu-standard-aggregator.h (+3 lines)
 Lines 36-41    Link Here 
36
  static TypeId GetTypeId (void);
36
  static TypeId GetTypeId (void);
37
  MpduStandardAggregator ();
37
  MpduStandardAggregator ();
38
  ~MpduStandardAggregator ();
38
  ~MpduStandardAggregator ();
39
40
  virtual void SetMaxAmpduSize (uint32_t maxSize);
41
  virtual uint32_t GetMaxAmpduSize (void) const;
39
  /**
42
  /**
40
   * \param packet packet we have to insert into <i>aggregatedPacket</i>.
43
   * \param packet packet we have to insert into <i>aggregatedPacket</i>.
41
   * \param aggregatedPacket packet that will contain <i>packet</i>, if aggregation is possible.
44
   * \param aggregatedPacket packet that will contain <i>packet</i>, if aggregation is possible.
(-)a/src/wifi/model/msdu-aggregator.h (+4 lines)
 Lines 42-47    Link Here 
42
  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
42
  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
43
43
44
  static TypeId GetTypeId (void);
44
  static TypeId GetTypeId (void);
45
46
  virtual void SetMaxAmsduSize (uint32_t maxSize) = 0;
47
  virtual uint32_t GetMaxAmsduSize (void) const = 0;
48
45
  /* Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
49
  /* Adds <i>packet</i> to <i>aggregatedPacket</i>. In concrete aggregator's implementation is
46
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>. If <i>packet</i>
50
   * specified how and if <i>packet</i> can be added to <i>aggregatedPacket</i>. If <i>packet</i>
47
   * can be added returns true, false otherwise.
51
   * can be added returns true, false otherwise.
(-)a/src/wifi/model/msdu-standard-aggregator.cc (-4 / +12 lines)
 Lines 36-45    Link Here 
36
    .SetParent<MsduAggregator> ()
36
    .SetParent<MsduAggregator> ()
37
    .SetGroupName ("Wifi")
37
    .SetGroupName ("Wifi")
38
    .AddConstructor<MsduStandardAggregator> ()
38
    .AddConstructor<MsduStandardAggregator> ()
39
    .AddAttribute ("MaxAmsduSize", "Max length in byte of an A-MSDU",
40
                   UintegerValue (7935),
41
                   MakeUintegerAccessor (&MsduStandardAggregator::m_maxAmsduLength),
42
                   MakeUintegerChecker<uint32_t> ())
43
  ;
39
  ;
44
  return tid;
40
  return tid;
45
}
41
}
 Lines 52-57    Link Here 
52
{
48
{
53
}
49
}
54
50
51
void
52
MsduStandardAggregator::SetMaxAmsduSize (uint32_t maxSize)
53
{
54
  m_maxAmsduLength = maxSize;
55
}
56
57
uint32_t
58
MsduStandardAggregator::GetMaxAmsduSize (void) const
59
{
60
  return m_maxAmsduLength;
61
}
62
55
bool
63
bool
56
MsduStandardAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
64
MsduStandardAggregator::Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
57
                                   Mac48Address src, Mac48Address dest)
65
                                   Mac48Address src, Mac48Address dest)
(-)a/src/wifi/model/msdu-standard-aggregator.h (+3 lines)
 Lines 36-41    Link Here 
36
  static TypeId GetTypeId (void);
36
  static TypeId GetTypeId (void);
37
  MsduStandardAggregator ();
37
  MsduStandardAggregator ();
38
  ~MsduStandardAggregator ();
38
  ~MsduStandardAggregator ();
39
40
  virtual void SetMaxAmsduSize (uint32_t maxSize);
41
  virtual uint32_t GetMaxAmsduSize (void) const;
39
  /**
42
  /**
40
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
43
   * \param packet Packet we have to insert into <i>aggregatedPacket</i>.
41
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible,
44
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible,
(-)a/src/wifi/model/regular-wifi-mac.cc (-3 / +242 lines)
 Lines 30-36    Link Here 
30
#include "dcf.h"
30
#include "dcf.h"
31
#include "dcf-manager.h"
31
#include "dcf-manager.h"
32
#include "wifi-phy.h"
32
#include "wifi-phy.h"
33
#include "msdu-aggregator.h"
33
#include "msdu-standard-aggregator.h"
34
#include "mpdu-standard-aggregator.h"
34
35
35
namespace ns3 {
36
namespace ns3 {
36
37
 Lines 137-142    Link Here 
137
}
138
}
138
139
139
void
140
void
141
RegularWifiMac::SetVoMaxAmsduSize (uint32_t size)
142
{
143
  NS_LOG_FUNCTION (this << size);
144
  if (m_edca.find (AC_VO)->second->GetMsduAggregator () != 0)
145
    {
146
      m_edca.find (AC_VO)->second->GetMsduAggregator ()->SetMaxAmsduSize (size);
147
    }
148
}
149
150
void
151
RegularWifiMac::SetViMaxAmsduSize (uint32_t size)
152
{
153
  NS_LOG_FUNCTION (this << size);
154
  if (m_edca.find (AC_VI)->second->GetMsduAggregator () != 0)
155
    {
156
      m_edca.find (AC_VI)->second->GetMsduAggregator ()->SetMaxAmsduSize (size);
157
    }
158
}
159
160
void
161
RegularWifiMac::SetBeMaxAmsduSize (uint32_t size)
162
{
163
  NS_LOG_FUNCTION (this << size);
164
  if (m_edca.find (AC_BE)->second->GetMsduAggregator () != 0)
165
    {
166
      m_edca.find (AC_BE)->second->GetMsduAggregator ()->SetMaxAmsduSize (size);
167
    }
168
}
169
170
void
171
RegularWifiMac::SetBkMaxAmsduSize (uint32_t size)
172
{
173
  NS_LOG_FUNCTION (this << size);
174
  if (m_edca.find (AC_BK)->second->GetMsduAggregator () != 0)
175
    {
176
      m_edca.find (AC_BK)->second->GetMsduAggregator ()->SetMaxAmsduSize (size);
177
    }
178
}
179
180
void
181
RegularWifiMac::SetVoMaxAmpduSize (uint32_t size)
182
{
183
  NS_LOG_FUNCTION (this << size);
184
  if (m_edca.find (AC_VO)->second->GetMpduAggregator () != 0)
185
    {
186
      m_edca.find (AC_VO)->second->GetMpduAggregator ()->SetMaxAmpduSize (size);
187
    }
188
}
189
190
void
191
RegularWifiMac::SetViMaxAmpduSize (uint32_t size)
192
{
193
  NS_LOG_FUNCTION (this << size);
194
  if (m_edca.find (AC_VI)->second->GetMpduAggregator () != 0)
195
    {
196
      m_edca.find (AC_VI)->second->GetMpduAggregator ()->SetMaxAmpduSize (size);
197
    }
198
}
199
200
void
201
RegularWifiMac::SetBeMaxAmpduSize (uint32_t size)
202
{
203
  NS_LOG_FUNCTION (this << size);
204
  if (m_edca.find (AC_BE)->second->GetMpduAggregator () != 0)
205
    {
206
      m_edca.find (AC_BE)->second->GetMpduAggregator ()->SetMaxAmpduSize (size);
207
    }
208
}
209
210
void
211
RegularWifiMac::SetBkMaxAmpduSize (uint32_t size)
212
{
213
  NS_LOG_FUNCTION (this << size);
214
  if (m_edca.find (AC_BK)->second->GetMpduAggregator () != 0)
215
    {
216
      m_edca.find (AC_BK)->second->GetMpduAggregator ()->SetMaxAmpduSize (size);
217
    }
218
}
219
220
void
221
RegularWifiMac::SetVoBlockAckThreshold (uint8_t threshold)
222
{
223
  NS_LOG_FUNCTION (this << threshold);
224
  m_edca.find (AC_VO)->second->SetBlockAckThreshold (threshold);
225
}
226
227
void
228
RegularWifiMac::SetViBlockAckThreshold (uint8_t threshold)
229
{
230
  NS_LOG_FUNCTION (this << threshold);
231
  m_edca.find (AC_VI)->second->SetBlockAckThreshold (threshold);
232
}
233
234
void
235
RegularWifiMac::SetBeBlockAckThreshold (uint8_t threshold)
236
{
237
  NS_LOG_FUNCTION (this << threshold);
238
  m_edca.find (AC_BE)->second->SetBlockAckThreshold (threshold);
239
}
240
241
void
242
RegularWifiMac::SetBkBlockAckThreshold (uint8_t threshold)
243
{
244
  NS_LOG_FUNCTION (this << threshold);
245
  m_edca.find (AC_BK)->second->SetBlockAckThreshold (threshold);
246
}
247
248
void
249
RegularWifiMac::SetVoBlockAckInactivityTimeout (uint16_t timeout)
250
{
251
  NS_LOG_FUNCTION (this << timeout);
252
  m_edca.find (AC_VO)->second->SetBlockAckInactivityTimeout (timeout);
253
}
254
255
void
256
RegularWifiMac::SetViBlockAckInactivityTimeout (uint16_t timeout)
257
{
258
  NS_LOG_FUNCTION (this << timeout);
259
  m_edca.find (AC_VI)->second->SetBlockAckInactivityTimeout (timeout);
260
}
261
262
void
263
RegularWifiMac::SetBeBlockAckInactivityTimeout (uint16_t timeout)
264
{
265
  NS_LOG_FUNCTION (this << timeout);
266
  m_edca.find (AC_BE)->second->SetBlockAckInactivityTimeout (timeout);
267
}
268
269
void
270
RegularWifiMac::SetBkBlockAckInactivityTimeout (uint16_t timeout)
271
{
272
  NS_LOG_FUNCTION (this << timeout);
273
  m_edca.find (AC_BK)->second->SetBlockAckInactivityTimeout (timeout);
274
}
275
276
void
140
RegularWifiMac::SetupEdcaQueue (enum AcIndex ac)
277
RegularWifiMac::SetupEdcaQueue (enum AcIndex ac)
141
{
278
{
142
  NS_LOG_FUNCTION (this << ac);
279
  NS_LOG_FUNCTION (this << ac);
 Lines 146-158    Link Here 
146
  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
283
  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
147
284
148
  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
285
  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
286
  Ptr<MsduStandardAggregator> msduAggregator = CreateObject<MsduStandardAggregator> ();
287
  Ptr<MpduStandardAggregator> mpduAggregator = CreateObject<MpduStandardAggregator> ();
288
    
149
  edca->SetLow (m_low);
289
  edca->SetLow (m_low);
150
  edca->SetManager (m_dcfManager);
290
  edca->SetManager (m_dcfManager);
151
  edca->SetTxMiddle (m_txMiddle);
291
  edca->SetTxMiddle (m_txMiddle);
152
  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
292
  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
153
  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
293
  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
154
  edca->SetAccessCategory (ac);
294
  edca->SetAccessCategory (ac);
295
  edca->SetMsduAggregator (msduAggregator);
296
  edca->SetMpduAggregator (mpduAggregator);
155
  edca->CompleteConfig ();
297
  edca->CompleteConfig ();
298
156
  m_edca.insert (std::make_pair (ac, edca));
299
  m_edca.insert (std::make_pair (ac, edca));
157
}
300
}
158
301
 Lines 684-689    Link Here 
684
                   MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported,
827
                   MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported,
685
                                        &RegularWifiMac::GetCtsToSelfSupported),
828
                                        &RegularWifiMac::GetCtsToSelfSupported),
686
                   MakeBooleanChecker ())
829
                   MakeBooleanChecker ())
830
    .AddAttribute ("VO_MaxAmsduSize",
831
                   "Maximum length in bytes of an A-MSDU for AC_VO access class",
832
                   UintegerValue (0),
833
                   MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmsduSize),
834
                   MakeUintegerChecker<uint32_t> ())
835
    .AddAttribute ("VI_MaxAmsduSize",
836
                   "Maximum length in bytes of an A-MSDU for AC_VI access class",
837
                   UintegerValue (0),
838
                   MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmsduSize),
839
                   MakeUintegerChecker<uint32_t> ())
840
    .AddAttribute ("BE_MaxAmsduSize",
841
                   "Maximum length in bytes of an A-MSDU for AC_BE access class",
842
                   UintegerValue (0),
843
                   MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmsduSize),
844
                   MakeUintegerChecker<uint32_t> ())
845
    .AddAttribute ("BK_MaxAmsduSize",
846
                   "Maximum length in bytes of an A-MSDU for AC_BK access class",
847
                   UintegerValue (0),
848
                   MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmsduSize),
849
                   MakeUintegerChecker<uint32_t> ())
850
    .AddAttribute ("VO_MaxAmpduSize",
851
                   "Maximum length in bytes of an A-MPDU for AC_VO access class",
852
                   UintegerValue (0),
853
                   MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmpduSize),
854
                   MakeUintegerChecker<uint32_t> ())
855
    .AddAttribute ("VI_MaxAmpduSize",
856
                   "Maximum length in bytes of an A-MPDU for AC_VI access class",
857
                   UintegerValue (0),
858
                   MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmpduSize),
859
                   MakeUintegerChecker<uint32_t> ())
860
    .AddAttribute ("BE_MaxAmpduSize",
861
                   "Maximum length in bytes of an A-MPDU for AC_BE access class",
862
                   UintegerValue (0),
863
                   MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmpduSize),
864
                   MakeUintegerChecker<uint32_t> ())
865
    .AddAttribute ("BK_MaxAmpduSize",
866
                   "Maximum length in bytes of an A-MPDU for AC_BK access class",
867
                   UintegerValue (0),
868
                   MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmpduSize),
869
                   MakeUintegerChecker<uint32_t> ())
870
    .AddAttribute ("VO_BlockAckThreshold",
871
                   "If number of packets in VO queue reaches this value, "
872
                   "block ack mechanism is used. If this value is 0, block ack is never used.",
873
                   UintegerValue (0),
874
                   MakeUintegerAccessor (&RegularWifiMac::SetVoBlockAckThreshold),
875
                   MakeUintegerChecker<uint8_t> (0, 64))
876
    .AddAttribute ("VI_BlockAckThreshold",
877
                   "If number of packets in VI queue reaches this value, "
878
                   "block ack mechanism is used. If this value is 0, block ack is never used.",
879
                   UintegerValue (0),
880
                   MakeUintegerAccessor (&RegularWifiMac::SetViBlockAckThreshold),
881
                   MakeUintegerChecker<uint8_t> (0, 64))
882
    .AddAttribute ("BE_BlockAckThreshold",
883
                   "If number of packets in BE queue reaches this value, "
884
                   "block ack mechanism is used. If this value is 0, block ack is never used.",
885
                   UintegerValue (0),
886
                   MakeUintegerAccessor (&RegularWifiMac::SetBeBlockAckThreshold),
887
                   MakeUintegerChecker<uint8_t> (0, 64))
888
    .AddAttribute ("BK_BlockAckThreshold",
889
                   "If number of packets in BK queue reaches this value, "
890
                   "block ack mechanism is used. If this value is 0, block ack is never used.",
891
                   UintegerValue (0),
892
                   MakeUintegerAccessor (&RegularWifiMac::SetBkBlockAckThreshold),
893
                   MakeUintegerChecker<uint8_t> (0, 64))
894
    .AddAttribute ("VO_BlockAckInactivityTimeout",
895
                   "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
896
                   "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
897
                   "block ack setup is completed and will be reset every time that a block ack"
898
                   "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
899
                   UintegerValue (0),
900
                   MakeUintegerAccessor (&RegularWifiMac::SetVoBlockAckInactivityTimeout),
901
                   MakeUintegerChecker<uint16_t> ())
902
    .AddAttribute ("VI_BlockAckInactivityTimeout",
903
                   "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
904
                   "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
905
                   "block ack setup is completed and will be reset every time that a block ack"
906
                   "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
907
                   UintegerValue (0),
908
                   MakeUintegerAccessor (&RegularWifiMac::SetViBlockAckInactivityTimeout),
909
                   MakeUintegerChecker<uint16_t> ())
910
    .AddAttribute ("BE_BlockAckInactivityTimeout",
911
                   "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
912
                   "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
913
                   "block ack setup is completed and will be reset every time that a block ack"
914
                   "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
915
                   UintegerValue (0),
916
                   MakeUintegerAccessor (&RegularWifiMac::SetBeBlockAckInactivityTimeout),
917
                   MakeUintegerChecker<uint16_t> ())
918
    .AddAttribute ("BK_BlockAckInactivityTimeout",
919
                   "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
920
                   "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
921
                   "block ack setup is completed and will be reset every time that a block ack"
922
                   "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
923
                   UintegerValue (0),
924
                   MakeUintegerAccessor (&RegularWifiMac::SetBkBlockAckInactivityTimeout),
925
                   MakeUintegerChecker<uint16_t> ())
687
    .AddAttribute ("DcaTxop", "The DcaTxop object",
926
    .AddAttribute ("DcaTxop", "The DcaTxop object",
688
                   PointerValue (),
927
                   PointerValue (),
689
                   MakePointerAccessor (&RegularWifiMac::GetDcaTxop),
928
                   MakePointerAccessor (&RegularWifiMac::GetDcaTxop),
 Lines 723-730    Link Here 
723
void
962
void
724
RegularWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
963
RegularWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
725
{
964
{
726
  uint32_t cwmin;
965
  uint32_t cwmin = 0;
727
  uint32_t cwmax;
966
  uint32_t cwmax = 0;
728
967
729
  switch (standard)
968
  switch (standard)
730
    {
969
    {
(-)a/src/wifi/model/regular-wifi-mac.h (+20 lines)
 Lines 469-474    Link Here 
469
   */
469
   */
470
  void SetupEdcaQueue (enum AcIndex ac);
470
  void SetupEdcaQueue (enum AcIndex ac);
471
471
472
  void SetVoMaxAmsduSize (uint32_t size);
473
  void SetViMaxAmsduSize (uint32_t size);
474
  void SetBeMaxAmsduSize (uint32_t size);
475
  void SetBkMaxAmsduSize (uint32_t size);
476
477
  void SetVoMaxAmpduSize (uint32_t size);
478
  void SetViMaxAmpduSize (uint32_t size);
479
  void SetBeMaxAmpduSize (uint32_t size);
480
  void SetBkMaxAmpduSize (uint32_t size);
481
  
482
  void SetVoBlockAckThreshold (uint8_t threshold);
483
  void SetViBlockAckThreshold (uint8_t threshold);
484
  void SetBeBlockAckThreshold (uint8_t threshold);
485
  void SetBkBlockAckThreshold (uint8_t threshold);
486
  
487
  void SetVoBlockAckInactivityTimeout (uint16_t timeout);
488
  void SetViBlockAckInactivityTimeout (uint16_t timeout);
489
  void SetBeBlockAckInactivityTimeout (uint16_t timeout);
490
  void SetBkBlockAckInactivityTimeout (uint16_t timeout);
491
472
  TracedCallback<const WifiMacHeader &> m_txOkCallback;
492
  TracedCallback<const WifiMacHeader &> m_txOkCallback;
473
  TracedCallback<const WifiMacHeader &> m_txErrCallback;
493
  TracedCallback<const WifiMacHeader &> m_txErrCallback;
474
};
494
};
(-)a/src/wifi/test/wifi-aggregation-test.cc (-19 / +14 lines)
 Lines 26-31    Link Here 
26
#include "ns3/mac-low.h"
26
#include "ns3/mac-low.h"
27
#include "ns3/edca-txop-n.h"
27
#include "ns3/edca-txop-n.h"
28
#include "ns3/yans-wifi-phy.h"
28
#include "ns3/yans-wifi-phy.h"
29
#include "ns3/msdu-standard-aggregator.h"
30
#include "ns3/mpdu-standard-aggregator.h"
29
31
30
using namespace ns3;
32
using namespace ns3;
31
33
 Lines 41-48    Link Here 
41
  Ptr<EdcaTxopN> m_edca;
43
  Ptr<EdcaTxopN> m_edca;
42
  Ptr<WifiRemoteStationManager> m_manager;
44
  Ptr<WifiRemoteStationManager> m_manager;
43
  ObjectFactory m_factory;
45
  ObjectFactory m_factory;
44
  Ptr<MpduAggregator> m_mpduAggregator;
46
  Ptr<MsduStandardAggregator> msduAggregator;
45
  Ptr<MsduAggregator> m_msduAggregator;
47
  Ptr<MpduStandardAggregator> mpduAggregator;
46
};
48
};
47
49
48
TwoLevelAggregationTest::TwoLevelAggregationTest ()
50
TwoLevelAggregationTest::TwoLevelAggregationTest ()
 Lines 84-100    Link Here 
84
  /*
86
  /*
85
   * Configure aggregation.
87
   * Configure aggregation.
86
   */
88
   */
87
  m_factory = ObjectFactory ();
89
  msduAggregator = CreateObject<MsduStandardAggregator> ();
88
  m_factory.SetTypeId ("ns3::MsduStandardAggregator");
90
  mpduAggregator = CreateObject<MpduStandardAggregator> ();
89
  m_factory.Set ("MaxAmsduSize", UintegerValue (4095));
91
  
90
  m_msduAggregator = m_factory.Create<MsduAggregator> ();
92
  msduAggregator->SetMaxAmsduSize (4095);
91
  m_edca->SetMsduAggregator (m_msduAggregator);
93
  mpduAggregator->SetMaxAmpduSize (65535);
92
94
93
  m_factory = ObjectFactory ();
95
  m_edca->SetMsduAggregator (msduAggregator);
94
  m_factory.SetTypeId ("ns3::MpduStandardAggregator");
96
  m_edca->SetMpduAggregator (mpduAggregator);
95
  m_factory.Set ("MaxAmpduSize", UintegerValue (65535));
96
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
97
  m_low->SetMpduAggregator (m_mpduAggregator);
98
97
99
  /*
98
  /*
100
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
99
   * Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
 Lines 141-151    Link Here 
141
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
140
   * It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
142
   * 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.
141
   * 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.
143
   */
142
   */
144
  m_factory = ObjectFactory ();
143
  /*m_factory = ObjectFactory ();
145
  m_factory.SetTypeId ("ns3::MpduStandardAggregator");
144
  m_factory.SetTypeId ("ns3::MpduStandardAggregator");
146
  m_factory.Set ("MaxAmpduSize", UintegerValue (0));
145
  m_factory.Set ("MaxAmpduSize", UintegerValue (0));
147
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
146
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
148
  m_low->SetMpduAggregator (m_mpduAggregator);
147
  m_low->SetMpduAggregator (m_mpduAggregator);*/
149
148
150
  m_edca->GetEdcaQueue ()->Enqueue (pkt, hdr);
149
  m_edca->GetEdcaQueue ()->Enqueue (pkt, hdr);
151
  packet = m_low->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
150
  packet = m_low->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
 Lines 160-170    Link Here 
160
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
159
   * It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
161
   * This test is needed to ensure that there is no issue when the queue is empty.
160
   * This test is needed to ensure that there is no issue when the queue is empty.
162
   */
161
   */
163
  m_factory = ObjectFactory ();
162
  mpduAggregator->SetMaxAmpduSize (4095);
164
  m_factory.SetTypeId ("ns3::MpduStandardAggregator");
165
  m_factory.Set ("MaxAmpduSize", UintegerValue (4095));
166
  m_mpduAggregator = m_factory.Create<MpduAggregator> ();
167
  m_low->SetMpduAggregator (m_mpduAggregator);
168
163
169
  m_edca->GetEdcaQueue ()->Remove (pkt);
164
  m_edca->GetEdcaQueue ()->Remove (pkt);
170
  m_edca->GetEdcaQueue ()->Remove (pkt);
165
  m_edca->GetEdcaQueue ()->Remove (pkt);
(-)a/src/wifi/wscript (+1 lines)
 Lines 136-141    Link Here 
136
        'model/edca-txop-n.h',
136
        'model/edca-txop-n.h',
137
        'model/msdu-aggregator.h',
137
        'model/msdu-aggregator.h',
138
        'model/amsdu-subframe-header.h',
138
        'model/amsdu-subframe-header.h',
139
        'model/msdu-standard-aggregator.h',
139
        'model/qos-tag.h',
140
        'model/qos-tag.h',
140
        'model/mgt-headers.h',
141
        'model/mgt-headers.h',
141
        'model/status-code.h',
142
        'model/status-code.h',

Return to bug 2116