From 5300841931ff57640cf7df4ea513597492366ac2 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 30 Nov 2020 16:30:30 +0100 Subject: [PATCH] wifi: Introduce the VHT Frame Exchange Manager --- src/wifi/helper/wifi-helper.cc | 1 + src/wifi/model/vht-frame-exchange-manager.cc | 61 ++++++++++++++++++++ src/wifi/model/vht-frame-exchange-manager.h | 52 +++++++++++++++++ src/wifi/wscript | 2 + 4 files changed, 116 insertions(+) create mode 100644 src/wifi/model/vht-frame-exchange-manager.cc create mode 100644 src/wifi/model/vht-frame-exchange-manager.h diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 4d6a60e1e..77069094b 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -1006,6 +1006,7 @@ WifiHelper::EnableLogComponents (void) LogComponentEnable ("ThresholdPreambleDetectionModel", LOG_LEVEL_ALL); LogComponentEnable ("Txop", LOG_LEVEL_ALL); LogComponentEnable ("VhtConfiguration", LOG_LEVEL_ALL); + LogComponentEnable ("VhtFrameExchangeManager", LOG_LEVEL_ALL); LogComponentEnable ("WifiAckManager", LOG_LEVEL_ALL); LogComponentEnable ("WifiAckPolicySelector", LOG_LEVEL_ALL); LogComponentEnable ("WifiDefaultAckManager", LOG_LEVEL_ALL); diff --git a/src/wifi/model/vht-frame-exchange-manager.cc b/src/wifi/model/vht-frame-exchange-manager.cc new file mode 100644 index 000000000..cded8207f --- /dev/null +++ b/src/wifi/model/vht-frame-exchange-manager.cc @@ -0,0 +1,61 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Stefano Avallone + */ + +#include "ns3/log.h" +#include "ns3/abort.h" +#include "vht-frame-exchange-manager.h" + +#undef NS_LOG_APPEND_CONTEXT +#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] " + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("VhtFrameExchangeManager"); + +NS_OBJECT_ENSURE_REGISTERED (VhtFrameExchangeManager); + +TypeId +VhtFrameExchangeManager::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::VhtFrameExchangeManager") + .SetParent () + .AddConstructor () + .SetGroupName ("Wifi") + ; + return tid; +} + +VhtFrameExchangeManager::VhtFrameExchangeManager () +{ + NS_LOG_FUNCTION (this); +} + +VhtFrameExchangeManager::~VhtFrameExchangeManager () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +Ptr +VhtFrameExchangeManager::GetWifiPsdu (Ptr mpdu, const WifiTxVector& txVector) const +{ + return Create (mpdu, txVector.GetModulationClass () >= WIFI_MOD_CLASS_VHT); +} + +} //namespace ns3 diff --git a/src/wifi/model/vht-frame-exchange-manager.h b/src/wifi/model/vht-frame-exchange-manager.h new file mode 100644 index 000000000..a2ee69011 --- /dev/null +++ b/src/wifi/model/vht-frame-exchange-manager.h @@ -0,0 +1,52 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Stefano Avallone + */ + +#ifndef VHT_FRAME_EXCHANGE_MANAGER_H +#define VHT_FRAME_EXCHANGE_MANAGER_H + +#include "ht-frame-exchange-manager.h" + +namespace ns3 { + +/** + * \ingroup wifi + * + * VhtFrameExchangeManager handles the frame exchange sequences + * for VHT stations. + */ +class VhtFrameExchangeManager : public HtFrameExchangeManager +{ +public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ + static TypeId GetTypeId (void); + VhtFrameExchangeManager (); + virtual ~VhtFrameExchangeManager (); + +protected: + // Overridden from HtFrameExchangeManager + virtual Ptr GetWifiPsdu (Ptr mpdu, const WifiTxVector& txVector) const override; +}; + +} //namespace ns3 + +#endif /* VHT_FRAME_EXCHANGE_MANAGER_H */ diff --git a/src/wifi/wscript b/src/wifi/wscript index 75fed46d7..e128ae426 100644 --- a/src/wifi/wscript +++ b/src/wifi/wscript @@ -35,6 +35,7 @@ def build(bld): 'model/frame-exchange-manager.cc', 'model/qos-frame-exchange-manager.cc', 'model/ht-frame-exchange-manager.cc', + 'model/vht-frame-exchange-manager.cc', 'model/mac-low.cc', 'model/mac-low-transmission-parameters.cc', 'model/wifi-mac-queue.cc', @@ -219,6 +220,7 @@ def build(bld): 'model/frame-exchange-manager.h', 'model/qos-frame-exchange-manager.h', 'model/ht-frame-exchange-manager.h', + 'model/vht-frame-exchange-manager.h', 'model/mac-low.h', 'model/mac-low-transmission-parameters.h', 'model/originator-block-ack-agreement.h',