wifi: Add initial EHT configuration

This commit is contained in:
Sébastien Deronne
2021-02-21 15:18:45 +01:00
committed by Stefano Avallone
parent d6f82d20e0
commit f0e9f13480
6 changed files with 144 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ set(source_files
model/channel-access-manager.cc
model/ctrl-headers.cc
model/edca-parameter-set.cc
model/eht/eht-configuration.cc
model/error-rate-model.cc
model/extended-capabilities.cc
model/frame-capture-model.cc
@@ -159,6 +160,7 @@ set(header_files
model/channel-access-manager.h
model/ctrl-headers.h
model/edca-parameter-set.h
model/eht/eht-configuration.h
model/error-rate-model.h
model/extended-capabilities.h
model/frame-capture-model.h

View File

@@ -36,6 +36,7 @@
#include "ns3/ht-configuration.h"
#include "ns3/vht-configuration.h"
#include "ns3/he-configuration.h"
#include "ns3/eht-configuration.h"
#include "ns3/obss-pd-algorithm.h"
#include "ns3/wifi-mac-trailer.h"
#include "wifi-helper.h"
@@ -718,6 +719,11 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper,
Ptr<HeConfiguration> heConfiguration = CreateObject<HeConfiguration> ();
device->SetHeConfiguration (heConfiguration);
}
if (m_standard >= WIFI_STANDARD_80211be)
{
Ptr<EhtConfiguration> ehtConfiguration = CreateObject<EhtConfiguration> ();
device->SetEhtConfiguration (ehtConfiguration);
}
Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
Ptr<WifiPhy> phy = phyHelper.Create (node, device);
phy->ConfigureStandard (m_standard);

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
*
* 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: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/log.h"
#include "eht-configuration.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("EhtConfiguration");
NS_OBJECT_ENSURE_REGISTERED (EhtConfiguration);
EhtConfiguration::EhtConfiguration ()
{
NS_LOG_FUNCTION (this);
}
EhtConfiguration::~EhtConfiguration ()
{
NS_LOG_FUNCTION (this);
}
TypeId
EhtConfiguration::GetTypeId (void)
{
static ns3::TypeId tid = ns3::TypeId ("ns3::EhtConfiguration")
.SetParent<Object> ()
.SetGroupName ("Wifi")
.AddConstructor<EhtConfiguration> ()
;
return tid;
}
} //namespace ns3

View File

@@ -0,0 +1,52 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
*
* 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: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#ifndef EHT_CONFIGURATION_H
#define EHT_CONFIGURATION_H
#include "ns3/object.h"
namespace ns3 {
/**
* \brief EHT configuration
* \ingroup wifi
*
* This object stores EHT configuration information, for use in modifying
* AP or STA behavior and for constructing EHT-related information elements.
*
*/
class EhtConfiguration : public Object
{
public:
EhtConfiguration ();
virtual ~EhtConfiguration ();
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
};
} //namespace ns3
#endif /* EHT_CONFIGURATION_H */

View File

@@ -30,6 +30,7 @@
#include "ns3/ht-configuration.h"
#include "ns3/vht-configuration.h"
#include "ns3/he-configuration.h"
#include "ns3/eht-configuration.h"
namespace ns3 {
@@ -83,6 +84,11 @@ WifiNetDevice::GetTypeId (void)
PointerValue (),
MakePointerAccessor (&WifiNetDevice::GetHeConfiguration),
MakePointerChecker<HeConfiguration> ())
.AddAttribute ("EhtConfiguration",
"The EhtConfiguration object.",
PointerValue (),
MakePointerAccessor (&WifiNetDevice::GetEhtConfiguration),
MakePointerChecker<EhtConfiguration> ())
;
return tid;
}
@@ -134,6 +140,11 @@ WifiNetDevice::DoDispose (void)
m_heConfiguration->Dispose ();
m_heConfiguration = 0;
}
if (m_ehtConfiguration)
{
m_ehtConfiguration->Dispose ();
m_ehtConfiguration = 0;
}
NetDevice::DoDispose ();
}
@@ -497,4 +508,16 @@ WifiNetDevice::GetHeConfiguration (void) const
return (m_standard >= WIFI_STANDARD_80211ax ? m_heConfiguration : nullptr);
}
void
WifiNetDevice::SetEhtConfiguration (Ptr<EhtConfiguration> ehtConfiguration)
{
m_ehtConfiguration = ehtConfiguration;
}
Ptr<EhtConfiguration>
WifiNetDevice::GetEhtConfiguration (void) const
{
return (m_standard >= WIFI_STANDARD_80211be ? m_ehtConfiguration : nullptr);
}
} //namespace ns3

View File

@@ -33,6 +33,7 @@ class WifiMac;
class HtConfiguration;
class VhtConfiguration;
class HeConfiguration;
class EhtConfiguration;
/// This value conforms to the 802.11 specification
static const uint16_t MAX_MSDU_SIZE = 2304;
@@ -129,6 +130,14 @@ public:
* \return pointer to HeConfiguration if it exists
*/
Ptr<HeConfiguration> GetHeConfiguration (void) const;
/**
* \param ehtConfiguration pointer to EhtConfiguration
*/
void SetEhtConfiguration (Ptr<EhtConfiguration> ehtConfiguration);
/**
* \return pointer to EhtConfiguration if it exists
*/
Ptr<EhtConfiguration> GetEhtConfiguration (void) const;
void SetIfIndex (const uint32_t index) override;
uint32_t GetIfIndex (void) const override;
@@ -193,6 +202,7 @@ private:
Ptr<HtConfiguration> m_htConfiguration; //!< the HtConfiguration
Ptr<VhtConfiguration> m_vhtConfiguration; //!< the VhtConfiguration
Ptr<HeConfiguration> m_heConfiguration; //!< the HeConfiguration
Ptr<EhtConfiguration> m_ehtConfiguration; //!< the EhtConfiguration
NetDevice::ReceiveCallback m_forwardUp; //!< forward up callback
NetDevice::PromiscReceiveCallback m_promiscRx; //!< promiscuous receive callback