src/wifi/model/ap-wifi-mac.cc
author Sébastien Deronne <sebastien.deronne@gmail.com>
Fri, 04 Sep 2015 22:18:00 +0200
changeset 11637 fc5b7dc0a98b
parent 11628 243b71de25a0
child 11641 379503e26f3a
permissions -rw-r--r--
Fix remaining issues with wifimode refactoring
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7141
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     2
/*
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2006, 2009 INRIA
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     4
 * Copyright (c) 2009 MIRKO BANCHI
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     5
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     9
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    13
 * GNU General Public License for more details.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    14
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    18
 *
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    19
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    20
 *          Mirko Banchi <mk.banchi@gmail.com>
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    21
 */
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    22
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    23
#include "ap-wifi-mac.h"
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    24
#include "ns3/assert.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    25
#include "ns3/log.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    26
#include "ns3/simulator.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    27
#include "ns3/string.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    28
#include "ns3/pointer.h"
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 5819
diff changeset
    29
#include "ns3/boolean.h"
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    30
#include "qos-tag.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    31
#include "wifi-phy.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    32
#include "dcf-manager.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    33
#include "mac-rx-middle.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    34
#include "mac-tx-middle.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    35
#include "mgt-headers.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    36
#include "mac-low.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    37
#include "amsdu-subframe-header.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    38
#include "msdu-aggregator.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    39
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10792
diff changeset
    40
namespace ns3 {
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    41
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10792
diff changeset
    42
NS_LOG_COMPONENT_DEFINE ("ApWifiMac");
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    43
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10580
diff changeset
    44
NS_OBJECT_ENSURE_REGISTERED (ApWifiMac);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    45
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    46
TypeId
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    47
ApWifiMac::GetTypeId (void)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    48
{
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    49
  static TypeId tid = TypeId ("ns3::ApWifiMac")
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    50
    .SetParent<RegularWifiMac> ()
11245
5c781d7e5a25 SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents: 10968
diff changeset
    51
    .SetGroupName ("Wifi")
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    52
    .AddConstructor<ApWifiMac> ()
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    53
    .AddAttribute ("BeaconInterval", "Delay between two beacons",
6309
8d46400b959e fixed bug 843
Nicola Baldo <nbaldo@cttc.es>
parents: 6220
diff changeset
    54
                   TimeValue (MicroSeconds (102400)),
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    55
                   MakeTimeAccessor (&ApWifiMac::GetBeaconInterval,
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    56
                                     &ApWifiMac::SetBeaconInterval),
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    57
                   MakeTimeChecker ())
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    58
    .AddAttribute ("BeaconJitter", "A uniform random variable to cause the initial beacon starting time (after simulation time 0) "
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    59
                   "to be distributed between 0 and the BeaconInterval.",
10206
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    60
                   StringValue ("ns3::UniformRandomVariable"),
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    61
                   MakePointerAccessor (&ApWifiMac::m_beaconJitter),
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    62
                   MakePointerChecker<UniformRandomVariable> ())
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    63
    .AddAttribute ("EnableBeaconJitter", "If beacons are enabled, whether to jitter the initial send event.",
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    64
                   BooleanValue (false),
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    65
                   MakeBooleanAccessor (&ApWifiMac::m_enableBeaconJitter),
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
    66
                   MakeBooleanChecker ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    67
    .AddAttribute ("BeaconGeneration", "Whether or not beacons are generated.",
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    68
                   BooleanValue (true),
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    69
                   MakeBooleanAccessor (&ApWifiMac::SetBeaconGeneration,
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    70
                                        &ApWifiMac::GetBeaconGeneration),
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    71
                   MakeBooleanChecker ())
6674
52f8688d6d01 Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents: 6673
diff changeset
    72
  ;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    73
  return tid;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    74
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    75
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    76
ApWifiMac::ApWifiMac ()
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    77
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    78
  NS_LOG_FUNCTION (this);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    79
  m_beaconDca = CreateObject<DcaTxop> ();
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    80
  m_beaconDca->SetAifsn (1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    81
  m_beaconDca->SetMinCw (0);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    82
  m_beaconDca->SetMaxCw (0);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    83
  m_beaconDca->SetLow (m_low);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    84
  m_beaconDca->SetManager (m_dcfManager);
10792
75d257577104 bug 1912: avoid multiple MacTxMiddle instances
l.salameh@cs.ucl.ac.uk
parents: 10652
diff changeset
    85
  m_beaconDca->SetTxMiddle (m_txMiddle);
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4687
diff changeset
    86
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
    87
  //Let the lower layers know that we are acting as an AP.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    88
  SetTypeOfStation (AP);
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
    89
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
    90
  m_enableBeaconGeneration = false;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    91
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    92
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    93
ApWifiMac::~ApWifiMac ()
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    94
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    95
  NS_LOG_FUNCTION (this);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    96
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    97
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    98
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
    99
ApWifiMac::DoDispose ()
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   100
{
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   101
  NS_LOG_FUNCTION (this);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   102
  m_beaconDca = 0;
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   103
  m_enableBeaconGeneration = false;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   104
  m_beaconEvent.Cancel ();
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   105
  RegularWifiMac::DoDispose ();
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   106
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   107
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   108
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   109
ApWifiMac::SetAddress (Mac48Address address)
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   110
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   111
  NS_LOG_FUNCTION (this << address);
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   112
  //As an AP, our MAC address is also the BSSID. Hence we are
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   113
  //overriding this function and setting both in our parent class.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   114
  RegularWifiMac::SetAddress (address);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   115
  RegularWifiMac::SetBssid (address);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   116
}
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   117
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   118
void
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   119
ApWifiMac::SetBeaconGeneration (bool enable)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   120
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   121
  NS_LOG_FUNCTION (this << enable);
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   122
  if (!enable)
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   123
    {
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   124
      m_beaconEvent.Cancel ();
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   125
    }
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   126
  else if (enable && !m_enableBeaconGeneration)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   127
    {
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   128
      m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, this);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   129
    }
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   130
  m_enableBeaconGeneration = enable;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   131
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   132
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   133
bool
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   134
ApWifiMac::GetBeaconGeneration (void) const
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   135
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   136
  NS_LOG_FUNCTION (this);
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   137
  return m_enableBeaconGeneration;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   138
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   139
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   140
Time
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   141
ApWifiMac::GetBeaconInterval (void) const
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   142
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   143
  NS_LOG_FUNCTION (this);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   144
  return m_beaconInterval;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   145
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   146
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   147
void
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   148
ApWifiMac::SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   149
{
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   150
  NS_LOG_FUNCTION (this << stationManager);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   151
  m_beaconDca->SetWifiRemoteStationManager (stationManager);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   152
  RegularWifiMac::SetWifiRemoteStationManager (stationManager);
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5956
diff changeset
   153
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5956
diff changeset
   154
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5956
diff changeset
   155
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   156
ApWifiMac::SetLinkUpCallback (Callback<void> linkUp)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   157
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   158
  NS_LOG_FUNCTION (this << &linkUp);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   159
  RegularWifiMac::SetLinkUpCallback (linkUp);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   160
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   161
  //The approach taken here is that, from the point of view of an AP,
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   162
  //the link is always up, so we immediately invoke the callback if
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   163
  //one is set
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   164
  linkUp ();
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   165
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   166
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   167
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   168
ApWifiMac::SetBeaconInterval (Time interval)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   169
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   170
  NS_LOG_FUNCTION (this << interval);
6309
8d46400b959e fixed bug 843
Nicola Baldo <nbaldo@cttc.es>
parents: 6220
diff changeset
   171
  if ((interval.GetMicroSeconds () % 1024) != 0)
8d46400b959e fixed bug 843
Nicola Baldo <nbaldo@cttc.es>
parents: 6220
diff changeset
   172
    {
10580
2a29a9bd6fd6 Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 10410
diff changeset
   173
      NS_LOG_WARN ("beacon interval should be multiple of 1024us (802.11 time unit), see IEEE Std. 802.11-2012");
6309
8d46400b959e fixed bug 843
Nicola Baldo <nbaldo@cttc.es>
parents: 6220
diff changeset
   174
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   175
  m_beaconInterval = interval;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   176
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   177
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   178
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   179
ApWifiMac::StartBeaconing (void)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   180
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   181
  NS_LOG_FUNCTION (this);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   182
  SendOneBeacon ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   183
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   184
10206
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   185
int64_t
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   186
ApWifiMac::AssignStreams (int64_t stream)
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   187
{
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   188
  NS_LOG_FUNCTION (this << stream);
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   189
  m_beaconJitter->SetStream (stream);
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   190
  return 1;
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   191
}
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   192
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   193
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   194
ApWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from,
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   195
                        Mac48Address to)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   196
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   197
  NS_LOG_FUNCTION (this << packet << from << to);
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   198
  //If we are not a QoS AP then we definitely want to use AC_BE to
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   199
  //transmit the packet. A TID of zero will map to AC_BE (through \c
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   200
  //QosUtilsMapTidToAc()), so we use that as our default here.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   201
  uint8_t tid = 0;
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   202
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   203
  //If we are a QoS AP then we attempt to get a TID for this packet
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   204
  if (m_qosSupported)
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   205
    {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   206
      tid = QosUtilsGetTidForPacket (packet);
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   207
      //Any value greater than 7 is invalid and likely indicates that
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   208
      //the packet had no QoS tag, so we revert to zero, which'll
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   209
      //mean that AC_BE is used.
11426
e2441f5f2c55 Bug 2136 [wifi] - The usage of tid in wifi and wave module shall be if (tid > 7) rather than if (tid >= 7)
Junling Bu <linlinjavaer@gmail.com>
parents: 11384
diff changeset
   210
      if (tid > 7)
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   211
        {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   212
          tid = 0;
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   213
        }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   214
    }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   215
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   216
  ForwardDown (packet, from, to, tid);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   217
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   218
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   219
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   220
ApWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from,
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   221
                        Mac48Address to, uint8_t tid)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   222
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   223
  NS_LOG_FUNCTION (this << packet << from << to << static_cast<uint32_t> (tid));
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   224
  WifiMacHeader hdr;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   225
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   226
  //For now, an AP that supports QoS does not support non-QoS
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   227
  //associations, and vice versa. In future the AP model should
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   228
  //support simultaneously associated QoS and non-QoS STAs, at which
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   229
  //point there will need to be per-association QoS state maintained
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   230
  //by the association state machine, and consulted here.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   231
  if (m_qosSupported)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   232
    {
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   233
      hdr.SetType (WIFI_MAC_QOSDATA);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   234
      hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   235
      hdr.SetQosNoEosp ();
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   236
      hdr.SetQosNoAmsdu ();
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   237
      //Transmission of multiple frames in the same TXOP is not
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   238
      //supported for now
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   239
      hdr.SetQosTxopLimit (0);
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   240
      //Fill in the QoS control field in the MAC header
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   241
      hdr.SetQosTid (tid);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   242
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   243
  else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   244
    {
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   245
      hdr.SetTypeData ();
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   246
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   247
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   248
  if (m_htSupported || m_vhtSupported)
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   249
    {
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   250
      hdr.SetNoOrder ();
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   251
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   252
  hdr.SetAddr1 (to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   253
  hdr.SetAddr2 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   254
  hdr.SetAddr3 (from);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   255
  hdr.SetDsFrom ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   256
  hdr.SetDsNotTo ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   257
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   258
  if (m_qosSupported)
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   259
    {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   260
      //Sanity check that the TID is valid
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   261
      NS_ASSERT (tid < 8);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   262
      m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   263
    }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   264
  else
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   265
    {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   266
      m_dca->Queue (packet, hdr);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   267
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   268
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   269
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   270
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   271
ApWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   272
{
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   273
  NS_LOG_FUNCTION (this << packet << to << from);
6220
393892be322a bug 813 also affects Qap
Nicola Baldo <nbaldo@cttc.es>
parents: 6080
diff changeset
   274
  if (to.IsBroadcast () || m_stationManager->IsAssociated (to))
393892be322a bug 813 also affects Qap
Nicola Baldo <nbaldo@cttc.es>
parents: 6080
diff changeset
   275
    {
393892be322a bug 813 also affects Qap
Nicola Baldo <nbaldo@cttc.es>
parents: 6080
diff changeset
   276
      ForwardDown (packet, from, to);
393892be322a bug 813 also affects Qap
Nicola Baldo <nbaldo@cttc.es>
parents: 6080
diff changeset
   277
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   278
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   279
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   280
void
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   281
ApWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   282
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   283
  NS_LOG_FUNCTION (this << packet << to);
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   284
  //We're sending this packet with a from address that is our own. We
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   285
  //get that address from the lower MAC and make use of the
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   286
  //from-spoofing Enqueue() method to avoid duplicated code.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   287
  Enqueue (packet, to, m_low->GetAddress ());
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   288
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   289
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   290
bool
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   291
ApWifiMac::SupportsSendFrom (void) const
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   292
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   293
  NS_LOG_FUNCTION (this);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   294
  return true;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   295
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   296
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   297
SupportedRates
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   298
ApWifiMac::GetSupportedRates (void) const
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   299
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   300
  NS_LOG_FUNCTION (this);
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   301
  SupportedRates rates;
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   302
  //If it is an HT-AP then add the BSSMembershipSelectorSet
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   303
  //which only includes 127 for HT now. The standard says that the BSSMembershipSelectorSet
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   304
  //must have its MSB set to 1 (must be treated as a Basic Rate)
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   305
  //Also the standard mentioned that at leat 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   306
  if (m_htSupported || m_vhtSupported)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   307
    {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   308
      for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   309
        {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   310
          rates.SetBasicRate (m_phy->GetBssMembershipSelector (i));
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   311
        }
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   312
    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   313
  //Send the set of supported rates and make sure that we indicate
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   314
  //the Basic Rate set in this set of supported rates.
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   315
  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   316
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   317
      WifiMode mode = m_phy->GetMode (i);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   318
      uint32_t channelWidth = m_phy->GetChannelWidth ();
11637
fc5b7dc0a98b Fix remaining issues with wifimode refactoring
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11628
diff changeset
   319
      if (channelWidth >= 40)
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   320
        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   321
          channelWidth = 20;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   322
        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   323
      rates.AddSupportedRate (mode.GetDataRate (channelWidth, false, 1));
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   324
      //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   325
      //here we choose to add the mandatory rates to the BSSBasicRateSet,
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   326
      //exept for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   327
      if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   328
        {
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   329
          m_stationManager->AddBasicMode (mode);
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   330
        }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   331
    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   332
  //set the basic rates
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   333
  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   334
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   335
      WifiMode mode = m_stationManager->GetBasicMode (j);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   336
      uint32_t channelWidth = m_phy->GetChannelWidth ();
11637
fc5b7dc0a98b Fix remaining issues with wifimode refactoring
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11628
diff changeset
   337
      if (channelWidth >= 40)
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   338
        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   339
          channelWidth = 20;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   340
        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   341
      rates.SetBasicRate (mode.GetDataRate (channelWidth, false, 1));
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   342
    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   343
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   344
  return rates;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   345
}
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   346
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   347
HtCapabilities
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   348
ApWifiMac::GetHtCapabilities (void) const
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   349
{
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   350
  HtCapabilities capabilities;
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   351
  capabilities.SetHtSupported (1);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   352
  if (m_htSupported)
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   353
    {
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   354
      capabilities.SetLdpc (m_phy->GetLdpc ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   355
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   356
      capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   357
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () == 40 && m_phy->GetGuardInterval ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   358
      capabilities.SetGreenfield (m_phy->GetGreenfield ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   359
      capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   360
      capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   361
      capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   362
      uint64_t maxSupportedRate = 0; //in bit/s
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   363
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
11496
369ddcce9831 fix, improve and extend HT capabilities information element
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11450
diff changeset
   364
        {
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   365
          WifiMode mcs = m_phy->GetMcs (i);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   366
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   367
          if (mcs.GetDataRate (m_phy->GetGuardInterval (), m_phy->GetGuardInterval (), 1) > maxSupportedRate)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   368
            {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   369
              maxSupportedRate = mcs.GetDataRate (m_phy->GetGuardInterval (), m_phy->GetGuardInterval (), 1);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   370
            }
11496
369ddcce9831 fix, improve and extend HT capabilities information element
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11450
diff changeset
   371
        }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   372
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   373
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   374
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetNumberOfTransmitAntennas ());
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   375
    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   376
  return capabilities;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   377
}
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   378
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   379
VhtCapabilities
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   380
ApWifiMac::GetVhtCapabilities (void) const
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   381
{
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   382
  VhtCapabilities capabilities;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   383
  capabilities.SetVhtSupported (1);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   384
  if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   385
    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   386
      if (m_phy->GetChannelWidth () == 160)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   387
        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   388
          capabilities.SetSupportedChannelWidthSet (1);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   389
        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   390
      else
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   391
        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   392
          capabilities.SetSupportedChannelWidthSet (0);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   393
        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   394
      capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   395
      capabilities.SetRxLdpc (m_phy->GetLdpc ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   396
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetGuardInterval ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   397
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetGuardInterval ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   398
      capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   399
      uint8_t maxMcs = 0;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   400
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   401
        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   402
          WifiMode mcs = m_phy->GetMcs (i);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   403
          if (mcs.GetMcsValue () > maxMcs)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   404
            {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   405
              maxMcs = mcs.GetMcsValue ();
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   406
            }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   407
        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   408
      capabilities.SetRxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   409
      capabilities.SetTxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   410
    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   411
  return capabilities;
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   412
}
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   413
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   414
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   415
ApWifiMac::SendProbeResp (Mac48Address to)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   416
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   417
  NS_LOG_FUNCTION (this << to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   418
  WifiMacHeader hdr;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   419
  hdr.SetProbeResp ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   420
  hdr.SetAddr1 (to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   421
  hdr.SetAddr2 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   422
  hdr.SetAddr3 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   423
  hdr.SetDsNotFrom ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   424
  hdr.SetDsNotTo ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   425
  Ptr<Packet> packet = Create<Packet> ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   426
  MgtProbeResponseHeader probe;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   427
  probe.SetSsid (GetSsid ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   428
  probe.SetSupportedRates (GetSupportedRates ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   429
  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   430
  if (m_htSupported || m_vhtSupported)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   431
    {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   432
      probe.SetHtCapabilities (GetHtCapabilities ());
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   433
      hdr.SetNoOrder ();
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   434
    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   435
  if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   436
    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   437
      probe.SetVhtCapabilities (GetVhtCapabilities ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   438
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   439
  packet->AddHeader (probe);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   440
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   441
  //The standard is not clear on the correct queue for management
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   442
  //frames if we are a QoS AP. The approach taken here is to always
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   443
  //use the DCF for these regardless of whether we have a QoS
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   444
  //association or not.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   445
  m_dca->Queue (packet, hdr);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   446
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   447
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   448
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   449
ApWifiMac::SendAssocResp (Mac48Address to, bool success)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   450
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   451
  NS_LOG_FUNCTION (this << to << success);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   452
  WifiMacHeader hdr;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   453
  hdr.SetAssocResp ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   454
  hdr.SetAddr1 (to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   455
  hdr.SetAddr2 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   456
  hdr.SetAddr3 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   457
  hdr.SetDsNotFrom ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   458
  hdr.SetDsNotTo ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   459
  Ptr<Packet> packet = Create<Packet> ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   460
  MgtAssocResponseHeader assoc;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   461
  StatusCode code;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   462
  if (success)
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   463
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   464
      code.SetSuccess ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   465
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   466
  else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   467
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   468
      code.SetFailure ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   469
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   470
  assoc.SetSupportedRates (GetSupportedRates ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   471
  assoc.SetStatusCode (code);
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   472
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   473
  if (m_htSupported || m_vhtSupported)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   474
    {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   475
      assoc.SetHtCapabilities (GetHtCapabilities ());
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   476
      hdr.SetNoOrder ();
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   477
    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   478
  if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   479
    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   480
      assoc.SetVhtCapabilities (GetVhtCapabilities ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   481
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   482
  packet->AddHeader (assoc);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   483
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   484
  //The standard is not clear on the correct queue for management
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   485
  //frames if we are a QoS AP. The approach taken here is to always
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   486
  //use the DCF for these regardless of whether we have a QoS
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   487
  //association or not.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   488
  m_dca->Queue (packet, hdr);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   489
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   490
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   491
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   492
ApWifiMac::SendOneBeacon (void)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   493
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   494
  NS_LOG_FUNCTION (this);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   495
  WifiMacHeader hdr;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   496
  hdr.SetBeacon ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   497
  hdr.SetAddr1 (Mac48Address::GetBroadcast ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   498
  hdr.SetAddr2 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   499
  hdr.SetAddr3 (GetAddress ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   500
  hdr.SetDsNotFrom ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   501
  hdr.SetDsNotTo ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   502
  Ptr<Packet> packet = Create<Packet> ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   503
  MgtBeaconHeader beacon;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   504
  beacon.SetSsid (GetSsid ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   505
  beacon.SetSupportedRates (GetSupportedRates ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   506
  beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   507
  if (m_htSupported || m_vhtSupported)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   508
    {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   509
      beacon.SetHtCapabilities (GetHtCapabilities ());
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   510
      hdr.SetNoOrder ();
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   511
    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   512
  if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   513
    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   514
      beacon.SetVhtCapabilities (GetVhtCapabilities ());
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   515
    }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   516
  packet->AddHeader (beacon);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   517
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   518
  //The beacon has it's own special queue, so we load it in there
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   519
  m_beaconDca->Queue (packet, hdr);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   520
  m_beaconEvent = Simulator::Schedule (m_beaconInterval, &ApWifiMac::SendOneBeacon, this);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   521
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   522
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   523
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   524
ApWifiMac::TxOk (const WifiMacHeader &hdr)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   525
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   526
  NS_LOG_FUNCTION (this);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   527
  RegularWifiMac::TxOk (hdr);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   528
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   529
  if (hdr.IsAssocResp ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   530
      && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ()))
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   531
    {
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   532
      NS_LOG_DEBUG ("associated with sta=" << hdr.GetAddr1 ());
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 5819
diff changeset
   533
      m_stationManager->RecordGotAssocTxOk (hdr.GetAddr1 ());
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   534
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   535
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   536
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   537
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   538
ApWifiMac::TxFailed (const WifiMacHeader &hdr)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   539
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   540
  NS_LOG_FUNCTION (this);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   541
  RegularWifiMac::TxFailed (hdr);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   542
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   543
  if (hdr.IsAssocResp ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   544
      && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ()))
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   545
    {
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   546
      NS_LOG_DEBUG ("assoc failed with sta=" << hdr.GetAddr1 ());
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 5819
diff changeset
   547
      m_stationManager->RecordGotAssocTxFailed (hdr.GetAddr1 ());
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   548
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   549
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   550
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   551
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   552
ApWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   553
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   554
  NS_LOG_FUNCTION (this << packet << hdr);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   555
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   556
  Mac48Address from = hdr->GetAddr2 ();
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   557
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   558
  if (hdr->IsData ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   559
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   560
      Mac48Address bssid = hdr->GetAddr1 ();
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   561
      if (!hdr->IsFromDs ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   562
          && hdr->IsToDs ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   563
          && bssid == GetAddress ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   564
          && m_stationManager->IsAssociated (from))
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   565
        {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   566
          Mac48Address to = hdr->GetAddr3 ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   567
          if (to == GetAddress ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   568
            {
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   569
              NS_LOG_DEBUG ("frame for me from=" << from);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   570
              if (hdr->IsQosData ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   571
                {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   572
                  if (hdr->IsQosAmsdu ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   573
                    {
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   574
                      NS_LOG_DEBUG ("Received A-MSDU from=" << from << ", size=" << packet->GetSize ());
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   575
                      DeaggregateAmsduAndForward (packet, hdr);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   576
                      packet = 0;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   577
                    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   578
                  else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   579
                    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   580
                      ForwardUp (packet, from, bssid);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   581
                    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   582
                }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   583
              else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   584
                {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   585
                  ForwardUp (packet, from, bssid);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   586
                }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   587
            }
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   588
          else if (to.IsGroup ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   589
                   || m_stationManager->IsAssociated (to))
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   590
            {
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   591
              NS_LOG_DEBUG ("forwarding frame from=" << from << ", to=" << to);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   592
              Ptr<Packet> copy = packet->Copy ();
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   593
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   594
              //If the frame we are forwarding is of type QoS Data,
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   595
              //then we need to preserve the UP in the QoS control
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   596
              //header...
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   597
              if (hdr->IsQosData ())
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   598
                {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   599
                  ForwardDown (packet, from, to, hdr->GetQosTid ());
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   600
                }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   601
              else
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   602
                {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   603
                  ForwardDown (packet, from, to);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   604
                }
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   605
              ForwardUp (copy, from, to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   606
            }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   607
          else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   608
            {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   609
              ForwardUp (packet, from, to);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   610
            }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   611
        }
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   612
      else if (hdr->IsFromDs ()
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   613
               && hdr->IsToDs ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   614
        {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   615
          //this is an AP-to-AP frame
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   616
          //we ignore for now.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   617
          NotifyRxDrop (packet);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   618
        }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   619
      else
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   620
        {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   621
          //we can ignore these frames since
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   622
          //they are not targeted at the AP
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   623
          NotifyRxDrop (packet);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   624
        }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   625
      return;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   626
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   627
  else if (hdr->IsMgt ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   628
    {
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   629
      if (hdr->IsProbeReq ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   630
        {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   631
          NS_ASSERT (hdr->GetAddr1 ().IsBroadcast ());
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   632
          SendProbeResp (from);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   633
          return;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   634
        }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   635
      else if (hdr->GetAddr1 () == GetAddress ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   636
        {
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   637
          if (hdr->IsAssocReq ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   638
            {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   639
              //first, verify that the the station's supported
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   640
              //rate set is compatible with our Basic Rate set
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   641
              MgtAssocRequestHeader assocReq;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   642
              packet->RemoveHeader (assocReq);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   643
              SupportedRates rates = assocReq.GetSupportedRates ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   644
              bool problem = false;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   645
              for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   646
                {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   647
                  WifiMode mode = m_stationManager->GetBasicMode (i);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   648
                  uint32_t channelWidth = m_phy->GetChannelWidth ();
11637
fc5b7dc0a98b Fix remaining issues with wifimode refactoring
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11628
diff changeset
   649
                  if (channelWidth >= 40)
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   650
                    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   651
                      channelWidth = 20;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   652
                    }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   653
                  if (!rates.IsSupportedRate (mode.GetDataRate (channelWidth, false, 1)))
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   654
                    {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   655
                      problem = true;
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   656
                      break;
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   657
                    }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   658
                }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   659
              if (m_htSupported)
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   660
                {
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   661
                  //check that the STA supports all MCSs in Basic MCS Set
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   662
                  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   663
                  for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   664
                    {
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   665
                      WifiMode mcs = m_stationManager->GetBasicMcs (i);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   666
                      if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   667
                        {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   668
                          problem = true;
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   669
                          break;
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   670
                        }
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   671
                    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   672
                }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   673
              if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   674
                {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   675
                  //check that the STA supports all MCSs in Basic MCS Set
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   676
                  VhtCapabilities vhtcapabilities = assocReq.GetVhtCapabilities ();
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   677
                  for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   678
                    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   679
                      WifiMode mcs = m_stationManager->GetBasicMcs (i);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   680
                      if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   681
                        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   682
                          problem = true;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   683
                          break;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   684
                        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   685
                    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   686
                }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   687
              if (problem)
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   688
                {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   689
                  //One of the Basic Rate set mode is not
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   690
                  //supported by the station. So, we return an assoc
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   691
                  //response with an error status.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   692
                  SendAssocResp (hdr->GetAddr2 (), false);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   693
                }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   694
              else
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   695
                {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   696
                  //station supports all rates in Basic Rate Set.
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   697
                  //record all its supported modes in its associated WifiRemoteStation
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   698
                  for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   699
                    {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   700
                      WifiMode mode = m_phy->GetMode (j);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   701
                      uint32_t channelWidth = m_phy->GetChannelWidth ();
11637
fc5b7dc0a98b Fix remaining issues with wifimode refactoring
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11628
diff changeset
   702
                      if (channelWidth >= 40)
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   703
                        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   704
                          channelWidth = 20;
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   705
                        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   706
                      if (rates.IsSupportedRate (mode.GetDataRate (channelWidth, false, 1)))
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   707
                        {
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   708
                          m_stationManager->AddSupportedMode (from, mode);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   709
                        }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   710
                    }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   711
                  if (m_htSupported)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   712
                    {
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   713
                      HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   714
                      m_stationManager->AddStationHtCapabilities (from,htcapabilities);
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   715
                      for (uint32_t j = 0; j < m_phy->GetNMcs (); j++)
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   716
                        {
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   717
                          WifiMode mcs = m_phy->GetMcs (j);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   718
                          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   719
                            {
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   720
                              m_stationManager->AddSupportedMcs (from, mcs);
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   721
                            }
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 9705
diff changeset
   722
                        }
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   723
                    }
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   724
                  if (m_vhtSupported)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   725
                    {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   726
                      VhtCapabilities vhtCapabilities = assocReq.GetVhtCapabilities ();
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   727
                      m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   728
                      for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   729
                        {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   730
                          WifiMode mcs = m_phy->GetMcs (i);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   731
                          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   732
                            {
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   733
                              m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   734
                              //here should add a control to add basic MCS when it is implemented
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   735
                            }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   736
                        }
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   737
                    }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   738
                  m_stationManager->RecordWaitAssocTxOk (from);
11628
243b71de25a0 add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11496
diff changeset
   739
                  // send assoc response with success status.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   740
                  SendAssocResp (hdr->GetAddr2 (), true);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   741
                }
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   742
              return;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   743
            }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   744
          else if (hdr->IsDisassociation ())
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   745
            {
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 5819
diff changeset
   746
              m_stationManager->RecordDisassociated (from);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   747
              return;
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   748
            }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   749
        }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   750
    }
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   751
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   752
  //Invoke the receive handler of our parent class to deal with any
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   753
  //other frames. Specifically, this will handle Block Ack-related
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   754
  //Management Action frames.
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   755
  RegularWifiMac::Receive (packet, hdr);
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   756
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   757
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   758
void
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   759
ApWifiMac::DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   760
                                       const WifiMacHeader *hdr)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   761
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   762
  NS_LOG_FUNCTION (this << aggregatedPacket << hdr);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   763
  MsduAggregator::DeaggregatedMsdus packets =
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   764
    MsduAggregator::Deaggregate (aggregatedPacket);
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   765
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   766
  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   767
       i != packets.end (); ++i)
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   768
    {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   769
      if ((*i).second.GetDestinationAddr () == GetAddress ())
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   770
        {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   771
          ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   772
                     (*i).second.GetDestinationAddr ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   773
        }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   774
      else
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   775
        {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   776
          Mac48Address from = (*i).second.GetSourceAddr ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   777
          Mac48Address to = (*i).second.GetDestinationAddr ();
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   778
          NS_LOG_DEBUG ("forwarding QoS frame from=" << from << ", to=" << to);
6673
ec22aa763e2d Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents: 6597
diff changeset
   779
          ForwardDown ((*i).first, from, to, hdr->GetQosTid ());
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   780
        }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   781
    }
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   782
}
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   783
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   784
void
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   785
ApWifiMac::DoInitialize (void)
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   786
{
9705
43fa2408aa05 Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents: 9703
diff changeset
   787
  NS_LOG_FUNCTION (this);
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   788
  m_beaconDca->Initialize ();
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   789
  m_beaconEvent.Cancel ();
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   790
  if (m_enableBeaconGeneration)
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   791
    {
10206
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   792
      if (m_enableBeaconJitter)
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   793
        {
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   794
          int64_t jitter = m_beaconJitter->GetValue (0, m_beaconInterval.GetMicroSeconds ());
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   795
          NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time " << jitter << " microseconds");
10206
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   796
          m_beaconEvent = Simulator::Schedule (MicroSeconds (jitter), &ApWifiMac::SendOneBeacon, this);
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   797
        }
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   798
      else
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   799
        {
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   800
          NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time 0");
10206
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   801
          m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, this);
ecd136bcb899 Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents: 10139
diff changeset
   802
        }
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   803
    }
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   804
  RegularWifiMac::DoInitialize ();
5524
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   805
}
efed7493f2c1 Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents: 4720
diff changeset
   806
11450
9f4ae69f12b7 cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11426
diff changeset
   807
} //namespace ns3