wifi: Add transport of 802.11ax BSS coloring field (with contributions from Tom Henderson)
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "wifi-phy.h"
|
||||
#include "wifi-net-device.h"
|
||||
#include "ht-configuration.h"
|
||||
#include "he-configuration.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -564,8 +565,6 @@ ApWifiMac::GetHtOperation (void) const
|
||||
HtOperation operation;
|
||||
if (GetHtSupported ())
|
||||
{
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
|
||||
operation.SetHtSupported (1);
|
||||
operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
|
||||
operation.SetRifsMode (GetRifsMode ());
|
||||
@@ -593,7 +592,7 @@ ApWifiMac::GetHtOperation (void) const
|
||||
}
|
||||
uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
|
||||
NS_ASSERT (nss > 0 && nss < 5);
|
||||
uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), htConfiguration->GetShortGuardIntervalSupported () ? 400 : 800, nss);
|
||||
uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), GetHtConfiguration ()->GetShortGuardIntervalSupported () ? 400 : 800, nss);
|
||||
if (dataRate > maxSupportedRate)
|
||||
{
|
||||
maxSupportedRate = dataRate;
|
||||
@@ -718,6 +717,9 @@ ApWifiMac::GetHeOperation (void) const
|
||||
{
|
||||
operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
|
||||
}
|
||||
UintegerValue bssColor;
|
||||
GetHeConfiguration ()->GetAttribute ("BssColor", bssColor);
|
||||
operation.SetBssColor (bssColor.Get ());
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
@@ -1588,9 +1590,7 @@ ApWifiMac::GetRifsMode (void) const
|
||||
rifsMode = true;
|
||||
}
|
||||
}
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
|
||||
if (htConfiguration && htConfiguration->GetRifsSupported () && rifsMode)
|
||||
if (GetHtSupported () && GetHtConfiguration ()->GetRifsSupported () && rifsMode)
|
||||
{
|
||||
m_stationManager->SetRifsPermitted (true);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ HeConfiguration::GetTypeId (void)
|
||||
MakeTimeAccessor (&HeConfiguration::GetGuardInterval,
|
||||
&HeConfiguration::SetGuardInterval),
|
||||
MakeTimeChecker (NanoSeconds (800), NanoSeconds (3200)))
|
||||
.AddAttribute ("BssColor", "BSS color",
|
||||
UintegerValue (0),
|
||||
MakeUintegerAccessor (&HeConfiguration::m_bssColor),
|
||||
MakeUintegerChecker<uint8_t> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
private:
|
||||
Time m_guardInterval; //!< Supported HE guard interval
|
||||
uint8_t m_bssColor; //!< BSS color
|
||||
};
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
@@ -119,6 +119,20 @@ HeOperation::GetBasicHeMcsAndNssSet (void) const
|
||||
return m_basicHeMcsAndNssSet;
|
||||
}
|
||||
|
||||
void
|
||||
HeOperation::SetBssColor (uint8_t bssColor)
|
||||
{
|
||||
NS_ABORT_UNLESS (bssColor < 64); // 6 bits
|
||||
m_bssColor = bssColor;
|
||||
m_bssColorDisabled = 0;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
HeOperation::GetBssColor (void) const
|
||||
{
|
||||
return m_bssColor;
|
||||
}
|
||||
|
||||
Buffer::Iterator
|
||||
HeOperation::Serialize (Buffer::Iterator i) const
|
||||
{
|
||||
|
||||
@@ -72,6 +72,16 @@ public:
|
||||
* \return the Basic HE-MCS And Nss field in the HE Operation information element
|
||||
*/
|
||||
uint16_t GetBasicHeMcsAndNssSet (void) const;
|
||||
/**
|
||||
* Set the BSS color
|
||||
* \param bssColor the BSS color value
|
||||
*/
|
||||
void SetBssColor (uint8_t bssColor);
|
||||
/**
|
||||
* Get the BSS color
|
||||
* \return the BSS color value
|
||||
*/
|
||||
uint8_t GetBssColor (void) const;
|
||||
|
||||
/**
|
||||
* Return the element ID.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "snr-tag.h"
|
||||
#include "wifi-net-device.h"
|
||||
#include "ht-configuration.h"
|
||||
#include "he-configuration.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -804,9 +805,7 @@ StaWifiMac::UpdateApInfoFromBeacon (MgtBeaconHeader beacon, Mac48Address apAddr,
|
||||
{
|
||||
m_stationManager->SetUseGreenfieldProtection (false);
|
||||
}
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
|
||||
if (!GetVhtSupported () && htConfiguration && htConfiguration->GetRifsSupported () && htOperation.GetRifsMode ())
|
||||
if (!GetVhtSupported () && GetHtConfiguration ()->GetRifsSupported () && htOperation.GetRifsMode ())
|
||||
{
|
||||
m_stationManager->SetRifsPermitted (true);
|
||||
}
|
||||
@@ -1005,9 +1004,7 @@ StaWifiMac::UpdateApInfoFromAssocResp (MgtAssocResponseHeader assocResp, Mac48Ad
|
||||
{
|
||||
m_stationManager->SetUseGreenfieldProtection (false);
|
||||
}
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
|
||||
if (!GetVhtSupported () && htConfiguration && htConfiguration->GetRifsSupported () && htOperation.GetRifsMode ())
|
||||
if (!GetVhtSupported () && GetHtConfiguration ()->GetRifsSupported () && htOperation.GetRifsMode ())
|
||||
{
|
||||
m_stationManager->SetRifsPermitted (true);
|
||||
}
|
||||
@@ -1033,6 +1030,7 @@ StaWifiMac::UpdateApInfoFromAssocResp (MgtAssocResponseHeader assocResp, Mac48Ad
|
||||
//todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
|
||||
m_stationManager->AddStationHeCapabilities (apAddr, hecapabilities);
|
||||
HeOperation heOperation = assocResp.GetHeOperation ();
|
||||
GetHeConfiguration ()->SetAttribute ("BssColor", UintegerValue (heOperation.GetBssColor ()));
|
||||
}
|
||||
for (uint8_t i = 0; i < m_phy->GetNModes (); i++)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "wifi-mac.h"
|
||||
#include "txop.h"
|
||||
#include "ssid.h"
|
||||
#include "wifi-net-device.h"
|
||||
#include "ht-configuration.h"
|
||||
#include "he-configuration.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -470,5 +473,19 @@ WifiMac::ConfigureDcf (Ptr<Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDss
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<HtConfiguration>
|
||||
WifiMac::GetHtConfiguration (void) const
|
||||
{
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
return device->GetHtConfiguration ();
|
||||
}
|
||||
|
||||
Ptr<HeConfiguration>
|
||||
WifiMac::GetHeConfiguration (void) const
|
||||
{
|
||||
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
|
||||
return device->GetHeConfiguration ();
|
||||
}
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace ns3 {
|
||||
|
||||
class Ssid;
|
||||
class Txop;
|
||||
class HtConfiguration;
|
||||
class HeConfiguration;
|
||||
|
||||
/**
|
||||
* \brief base class for all MAC-level wifi objects.
|
||||
@@ -323,6 +325,15 @@ protected:
|
||||
*/
|
||||
void ConfigureDcf (Ptr<Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac);
|
||||
|
||||
/**
|
||||
* \return pointer to HtConfiguration if it exists
|
||||
*/
|
||||
Ptr<HtConfiguration> GetHtConfiguration (void) const;
|
||||
/**
|
||||
* \return pointer to HeConfiguration if it exists
|
||||
*/
|
||||
Ptr<HeConfiguration> GetHeConfiguration (void) const;
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user