wifi: Hold TX center frequency in WifiPpdu

This commit is contained in:
Sebastien Deronne
2022-05-15 15:41:57 +02:00
parent 9f1648814d
commit 1f3e89f6fa
27 changed files with 103 additions and 83 deletions

View File

@@ -341,7 +341,9 @@ HePhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector,
{
flag = HePpdu::PSD_NON_HE_TB;
}
return Create<HePpdu> (psdus, txVector, ppduDuration, m_wifiPhy->GetPhyBand (),
return Create<HePpdu> (psdus, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
ppduDuration, m_wifiPhy->GetPhyBand (),
ObtainNextUid (txVector), flag,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelIndex (20));
}

View File

@@ -47,11 +47,11 @@ std::ostream& operator<< (std::ostream& os, const HePpdu::TxPsdFlag &flag)
}
}
HePpdu::HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index)
: OfdmPpdu (psdus.begin ()->second, txVector, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
HePpdu::HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index)
: OfdmPpdu (psdus.begin ()->second, txVector, txCenterFreq, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
{
NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration << band << uid << flag);
NS_LOG_FUNCTION (this << psdus << txVector << txCenterFreq << ppduDuration << band << uid << flag);
//overwrite with map (since only first element used by OfdmPpdu)
m_psdus.begin ()->second = 0;
@@ -72,11 +72,11 @@ HePpdu::HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Ti
SetTxPsdFlag (flag);
}
HePpdu::HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
HePpdu::HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, txCenterFreq, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
{
NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << band << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << ppduDuration << band << uid);
NS_ASSERT (!IsMu ());
SetPhyHeaders (txVector, ppduDuration);
SetTxPsdFlag (PSD_NON_HE_TB);
@@ -259,16 +259,15 @@ HePpdu::GetTransmissionChannelWidth (void) const
}
bool
HePpdu::CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq, uint16_t p20MaxFreq) const
HePpdu::CanBeReceived (uint16_t p20MinFreq, uint16_t p20MaxFreq) const
{
NS_LOG_FUNCTION (this << txCenterFreq << p20MinFreq << p20MaxFreq);
NS_LOG_FUNCTION (this << p20MinFreq << p20MaxFreq);
if (IsUlMu ())
{
// APs are able to receive TB PPDUs sent on a band other than the primary20 channel
return true;
}
return OfdmPpdu::CanBeReceived (txCenterFreq, p20MinFreq, p20MaxFreq);
return OfdmPpdu::CanBeReceived (p20MinFreq, p20MaxFreq);
}
HePpdu::TxPsdFlag

View File

@@ -167,12 +167,13 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param ppduDuration the transmission duration of this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU
*/
HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid);
HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid);
/**
* Create an MU HE PPDU, storing a map of PSDUs.
*
@@ -180,14 +181,15 @@ public:
*
* \param psdus the PHY payloads (PSDUs)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param ppduDuration the transmission duration of this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU or of the triggering PPDU if this is an HE TB PPDU
* \param flag the flag indicating the type of Tx PSD to build
* \param p20Index the index of the primary 20 MHz channel
*/
HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index);
HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index);
/**
* Destructor for HePpdu.
*/
@@ -198,8 +200,7 @@ public:
WifiPpduType GetType (void) const override;
uint16_t GetStaId (void) const override;
uint16_t GetTransmissionChannelWidth (void) const override;
bool CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq,
uint16_t p20MaxFreq) const override;
bool CanBeReceived (uint16_t p20MinFreq, uint16_t p20MaxFreq) const override;
/**
* Get the payload of the PPDU.

View File

@@ -358,7 +358,9 @@ Ptr<WifiPpdu>
HtPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration)
{
NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration);
return Create<HtPpdu> (psdus.begin ()->second, txVector, ppduDuration, m_wifiPhy->GetPhyBand (),
return Create<HtPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
ppduDuration, m_wifiPhy->GetPhyBand (),
ObtainNextUid (txVector));
}

View File

@@ -31,11 +31,11 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("HtPpdu");
HtPpdu::HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
HtPpdu::HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq, Time ppduDuration,
WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
: OfdmPpdu (psdu, txVector, txCenterFreq, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
{
NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << band << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << ppduDuration << band << uid);
uint8_t sigExtension = 0;
if (m_band == WIFI_PHY_BAND_2_4GHZ)
{
@@ -79,7 +79,7 @@ HtPpdu::GetTxDuration (void) const
Ptr<WifiPpdu>
HtPpdu::Copy (void) const
{
return Create<HtPpdu> (GetPsdu (), GetTxVector (), GetTxDuration (), m_band, m_uid);
return Create<HtPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq, GetTxDuration (), m_band, m_uid);
}
HtPpdu::HtSigHeader::HtSigHeader ()

View File

@@ -141,12 +141,13 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param ppduDuration the transmission duration of this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU
*/
HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid);
HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid);
/**
* Destructor for HtPpdu.
*/

View File

@@ -224,7 +224,7 @@ InterferenceHelper::AddForeignSignal (Time duration, RxPowerWattPerChannelBand&
hdr.SetType (WIFI_MAC_QOSDATA);
hdr.SetQosTid (0);
Ptr<WifiPpdu> fakePpdu = Create<WifiPpdu> (Create<WifiPsdu> (Create<Packet> (0), hdr),
WifiTxVector ());
WifiTxVector (), 0);
Add (fakePpdu, WifiTxVector (), duration, rxPowerW);
}

View File

@@ -182,8 +182,9 @@ Ptr<WifiPpdu>
DsssPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration)
{
NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration);
return Create<DsssPpdu> (psdus.begin ()->second, txVector, ppduDuration,
ObtainNextUid (txVector));
return Create<DsssPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
ppduDuration, ObtainNextUid (txVector));
}
PhyEntity::PhyFieldRxStatus

View File

@@ -30,10 +30,11 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("DsssPpdu");
DsssPpdu::DsssPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration, uint64_t uid)
: WifiPpdu (psdu, txVector, uid)
DsssPpdu::DsssPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
uint16_t txCenterFreq, Time ppduDuration, uint64_t uid)
: WifiPpdu (psdu, txVector, txCenterFreq, uid)
{
NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << ppduDuration << uid);
m_dsssSig.SetRate (txVector.GetMode ().GetDataRate (22));
Time psduDuration = ppduDuration - WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
m_dsssSig.SetLength (psduDuration.GetMicroSeconds ());
@@ -65,7 +66,7 @@ DsssPpdu::GetTxDuration (void) const
Ptr<WifiPpdu>
DsssPpdu::Copy (void) const
{
return Create<DsssPpdu> (GetPsdu (), GetTxVector (), GetTxDuration (), m_uid);
return Create<DsssPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq, GetTxDuration (), m_uid);
}
DsssPpdu::DsssSigHeader::DsssSigHeader ()

View File

@@ -103,10 +103,12 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param ppduDuration the transmission duration of this PPDU
* \param uid the unique ID of this PPDU
*/
DsssPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration, uint64_t uid);
DsssPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
uint16_t txCenterFreq, Time ppduDuration, uint64_t uid);
/**
* Destructor for DsssPpdu.
*/

View File

@@ -106,8 +106,9 @@ Ptr<WifiPpdu>
ErpOfdmPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time /* ppduDuration */)
{
NS_LOG_FUNCTION (this << psdus << txVector);
return Create<ErpOfdmPpdu> (psdus.begin ()->second, txVector, m_wifiPhy->GetPhyBand (),
ObtainNextUid (txVector));
return Create<ErpOfdmPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
m_wifiPhy->GetPhyBand (), ObtainNextUid (txVector));
}
void

View File

@@ -29,10 +29,10 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("ErpOfdmPpdu");
ErpOfdmPpdu::ErpOfdmPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, band, uid, true) //instantiate LSigHeader of OfdmPpdu
uint16_t txCenterFreq, WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, txCenterFreq, band, uid, true) //instantiate LSigHeader of OfdmPpdu
{
NS_LOG_FUNCTION (this << psdu << txVector << band << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << band << uid);
}
ErpOfdmPpdu::~ErpOfdmPpdu ()
@@ -53,7 +53,7 @@ ErpOfdmPpdu::DoGetTxVector (void) const
Ptr<WifiPpdu>
ErpOfdmPpdu::Copy (void) const
{
return Create<ErpOfdmPpdu> (GetPsdu (), GetTxVector (), m_band, m_uid);
return Create<ErpOfdmPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq, m_band, m_uid);
}
} //namespace ns3

View File

@@ -49,11 +49,12 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU
*/
ErpOfdmPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
WifiPhyBand band, uint64_t uid);
uint16_t txCenterFreq, WifiPhyBand band, uint64_t uid);
/**
* Destructor for ErpOfdmPpdu.
*/

View File

@@ -275,8 +275,9 @@ Ptr<WifiPpdu>
OfdmPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time /* ppduDuration */)
{
NS_LOG_FUNCTION (this << psdus << txVector);
return Create<OfdmPpdu> (psdus.begin ()->second, txVector, m_wifiPhy->GetPhyBand (),
ObtainNextUid (txVector));
return Create<OfdmPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
m_wifiPhy->GetPhyBand (), ObtainNextUid (txVector));
}
PhyEntity::PhyFieldRxStatus

View File

@@ -31,13 +31,13 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("OfdmPpdu");
OfdmPpdu::OfdmPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
WifiPhyBand band, uint64_t uid,
bool instantiateLSig /* = true */)
: WifiPpdu (psdu, txVector, uid),
uint16_t txCenterFreq, WifiPhyBand band,
uint64_t uid, bool instantiateLSig /* = true */)
: WifiPpdu (psdu, txVector, txCenterFreq, uid),
m_band (band),
m_channelWidth (txVector.GetChannelWidth ())
{
NS_LOG_FUNCTION (this << psdu << txVector << band << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << band << uid);
if (instantiateLSig)
{
m_lSig.SetRate (txVector.GetMode ().GetDataRate (txVector), m_channelWidth);
@@ -73,7 +73,7 @@ OfdmPpdu::GetTxDuration (void) const
Ptr<WifiPpdu>
OfdmPpdu::Copy (void) const
{
return Create<OfdmPpdu> (GetPsdu (), GetTxVector (), m_band, m_uid);
return Create<OfdmPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq, m_band, m_uid);
}
OfdmPpdu::LSigHeader::LSigHeader ()

View File

@@ -107,12 +107,14 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU
* \param instantiateLSig flag used to instantiate LSigHeader (set LSigHeader's
* rate and length), should be disabled by child classes
*/
OfdmPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, WifiPhyBand band, uint64_t uid,
OfdmPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector,
uint16_t txCenterFreq, WifiPhyBand band, uint64_t uid,
bool instantiateLSig = true);
/**
* Destructor for OfdmPpdu.

View File

@@ -231,7 +231,8 @@ PhyEntity::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVect
{
NS_LOG_FUNCTION (this << psdus << txVector);
NS_FATAL_ERROR ("This method is unsupported for the base PhyEntity class. Use the overloaded version in the amendment-specific subclasses instead!");
return Create<WifiPpdu> (psdus.begin ()->second, txVector); //should be overloaded
return Create<WifiPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ())); //should be overloaded
}
Time

View File

@@ -364,7 +364,7 @@ SpectrumWifiPhy::StartRx (Ptr<SpectrumSignalParameters> rxParams)
uint16_t p20MaxFreq =
GetOperatingChannel ().GetPrimaryChannelCenterFrequency (width) + width / 2;
if (!wifiRxParams->ppdu->CanBeReceived (wifiRxParams->txCenterFreq, p20MinFreq, p20MaxFreq))
if (!wifiRxParams->ppdu->CanBeReceived (p20MinFreq, p20MaxFreq))
{
NS_LOG_INFO ("Cannot receive the PPDU, consider it as interference");
m_interference->Add (wifiRxParams->ppdu, wifiRxParams->ppdu->GetTxVector (),

View File

@@ -229,7 +229,9 @@ Ptr<WifiPpdu>
VhtPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration)
{
NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration);
return Create<VhtPpdu> (psdus.begin ()->second, txVector, ppduDuration, m_wifiPhy->GetPhyBand (),
return Create<VhtPpdu> (psdus.begin ()->second, txVector,
m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()),
ppduDuration, m_wifiPhy->GetPhyBand (),
ObtainNextUid (txVector));
}

View File

@@ -30,11 +30,11 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("VhtPpdu");
VhtPpdu::VhtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
VhtPpdu::VhtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid)
: OfdmPpdu (psdu, txVector, txCenterFreq, band, uid, false) //don't instantiate LSigHeader of OfdmPpdu
{
NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << band << uid);
NS_LOG_FUNCTION (this << psdu << txVector << txCenterFreq << ppduDuration << band << uid);
uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000)) / 1000) / 4.0) * 3) - 3);
m_lSig.SetLength (length);
m_vhtSig.SetMuFlag (m_preamble == WIFI_PREAMBLE_VHT_MU);
@@ -86,7 +86,7 @@ VhtPpdu::GetTxDuration (void) const
Ptr<WifiPpdu>
VhtPpdu::Copy (void) const
{
return Create<VhtPpdu> (GetPsdu (), GetTxVector (), GetTxDuration (), m_band, m_uid);
return Create<VhtPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq, GetTxDuration (), m_band, m_uid);
}
WifiPpduType

View File

@@ -155,12 +155,13 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param ppduDuration the transmission duration of this PPDU
* \param band the WifiPhyBand used for the transmission of this PPDU
* \param uid the unique ID of this PPDU
*/
VhtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
WifiPhyBand band, uint64_t uid);
VhtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
Time ppduDuration, WifiPhyBand band, uint64_t uid);
/**
* Destructor for VhtPpdu.
*/

View File

@@ -27,26 +27,28 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("WifiPpdu");
WifiPpdu::WifiPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint64_t uid /* = UINT64_MAX */)
WifiPpdu::WifiPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq, uint64_t uid /* = UINT64_MAX */)
: m_preamble (txVector.GetPreambleType ()),
m_modulation (txVector.IsValid () ? txVector.GetModulationClass () : WIFI_MOD_CLASS_UNKNOWN),
m_txCenterFreq (txCenterFreq),
m_uid (uid),
m_truncatedTx (false),
m_txPowerLevel (txVector.GetTxPowerLevel ())
{
NS_LOG_FUNCTION (this << *psdu << txVector << uid);
NS_LOG_FUNCTION (this << *psdu << txVector << txCenterFreq << uid);
m_psdus.insert (std::make_pair (SU_STA_ID, psdu));
}
WifiPpdu::WifiPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint64_t uid)
WifiPpdu::WifiPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint16_t txCenterFreq, uint64_t uid)
: m_preamble (txVector.GetPreambleType ()),
m_modulation (txVector.IsValid () ? txVector.GetMode (psdus.begin()->first).GetModulationClass () : WIFI_MOD_CLASS_UNKNOWN),
m_txCenterFreq (txCenterFreq),
m_uid (uid),
m_truncatedTx (false),
m_txPowerLevel (txVector.GetTxPowerLevel ()),
m_txAntennas (txVector.GetNTx ())
{
NS_LOG_FUNCTION (this << psdus << txVector << uid);
NS_LOG_FUNCTION (this << psdus << txVector << txCenterFreq << uid);
m_psdus = psdus;
}
@@ -107,14 +109,13 @@ WifiPpdu::GetTransmissionChannelWidth (void) const
}
bool
WifiPpdu::CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq,
uint16_t p20MaxFreq) const
WifiPpdu::CanBeReceived (uint16_t p20MinFreq, uint16_t p20MaxFreq) const
{
NS_LOG_FUNCTION (this << txCenterFreq << p20MinFreq << p20MaxFreq);
NS_LOG_FUNCTION (this << m_txCenterFreq << p20MinFreq << p20MaxFreq);
uint16_t txChannelWidth = GetTxVector ().GetChannelWidth ();
uint16_t minTxFreq = txCenterFreq - txChannelWidth / 2;
uint16_t maxTxFreq = txCenterFreq + txChannelWidth / 2;
uint16_t minTxFreq = m_txCenterFreq - txChannelWidth / 2;
uint16_t maxTxFreq = m_txCenterFreq + txChannelWidth / 2;
if (minTxFreq > p20MinFreq || maxTxFreq < p20MaxFreq)
{
@@ -179,7 +180,7 @@ Ptr<WifiPpdu>
WifiPpdu::Copy (void) const
{
NS_FATAL_ERROR ("This method should not be called for the base WifiPpdu class. Use the overloaded version in the amendment-specific PPDU subclasses instead!");
return Create<WifiPpdu> (GetPsdu (), GetTxVector ());
return Create<WifiPpdu> (GetPsdu (), GetTxVector (), m_txCenterFreq);
}
std::ostream & operator << (std::ostream &os, const Ptr<const WifiPpdu> &ppdu)

View File

@@ -56,17 +56,19 @@ public:
*
* \param psdu the PHY payload (PSDU)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param uid the unique ID of this PPDU
*/
WifiPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint64_t uid = UINT64_MAX);
WifiPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq, uint64_t uid = UINT64_MAX);
/**
* Create a PPDU storing a map of PSDUs.
*
* \param psdus the PHY payloads (PSDUs)
* \param txVector the TXVECTOR that was used for this PPDU
* \param txCenterFreq the center frequency (MHz) that was used for this PPDU
* \param uid the unique ID of this PPDU
*/
WifiPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint64_t uid);
WifiPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint16_t txCenterFreq, uint64_t uid);
/**
* Destructor for WifiPpdu.
*/
@@ -116,14 +118,11 @@ public:
* channel. Normally, a PPDU can be received if it is transmitted over a
* channel that overlaps the primary20 channel of a PHY entity.
*
* \param txCenterFreq the center frequency (MHz) of the channel over which the
* PPDU is transmitted
* \param p20MinFreq the minimum frequency (MHz) of the primary channel
* \param p20MaxFreq the maximum frequency (MHz) of the primary channel
* \return true if this PPDU can be received, false otherwise
*/
virtual bool CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq,
uint16_t p20MaxFreq) const;
virtual bool CanBeReceived (uint16_t p20MinFreq, uint16_t p20MaxFreq) const;
/**
* Get the modulation used for the PPDU.
@@ -177,6 +176,7 @@ protected:
WifiPreamble m_preamble; //!< the PHY preamble
WifiModulationClass m_modulation; //!< the modulation used for the transmission of this PPDU
WifiConstPsduMap m_psdus; //!< the PSDUs contained in this PPDU
uint16_t m_txCenterFreq; //!< the center frequency (MHz) used for the transmission of this PPDU
uint64_t m_uid; //!< the unique ID of this PPDU
private:

View File

@@ -132,7 +132,7 @@ SpectrumWifiPhyBasicTest::MakeSignal (double txPowerWatts)
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<OfdmPpdu> (psdu, txVector, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<OfdmPpdu> (psdu, txVector, FREQUENCY, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, txPowerWatts, GUARD_WIDTH);
Ptr<WifiSpectrumSignalParameters> txParams = Create<WifiSpectrumSignalParameters> ();

View File

@@ -1491,7 +1491,8 @@ TestMultipleHeTbPreambles::RxHeTbPpdu (uint64_t uid, uint16_t staId, double txPo
psdus.insert (std::make_pair (staId, psdu));
Time ppduDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand (), staId);
Ptr<HePpdu> ppdu = Create<HePpdu> (psdus, txVector, ppduDuration, WIFI_PHY_BAND_5GHZ, uid,
Ptr<HePpdu> ppdu = Create<HePpdu> (psdus, txVector, DEFAULT_FREQUENCY,
ppduDuration, WIFI_PHY_BAND_5GHZ, uid,
HePpdu::PSD_HE_TB_NON_OFDMA_PORTION, 0);
//Send non-OFDMA part

View File

@@ -142,7 +142,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket (double rxPowerDbm
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, DbmToW (rxPowerDbm), GUARD_WIDTH);
@@ -510,7 +510,7 @@ TestThresholdPreambleDetectionWithFrameCapture::SendPacket (double rxPowerDbm)
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, DbmToW (rxPowerDbm), GUARD_WIDTH);
@@ -1032,7 +1032,7 @@ TestSimpleFrameCaptureModel::SendPacket (double rxPowerDbm, uint32_t packetSize)
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, DbmToW (rxPowerDbm), GUARD_WIDTH);
@@ -1249,7 +1249,7 @@ TestPhyHeadersReception::SendPacket (double rxPowerDbm)
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, DbmToW (rxPowerDbm), GUARD_WIDTH);
@@ -1770,7 +1770,7 @@ TestAmpduReception::SendAmpduWithThreeMpdus (double rxPowerDbm, uint32_t referen
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<WifiPpdu> ppdu = Create<HePpdu> (psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, DbmToW (rxPowerDbm), GUARD_WIDTH);

View File

@@ -151,7 +151,7 @@ WifiPhyThresholdsTest::MakeWifiSignal (double txPowerWatts)
Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
Time txDuration = m_phy->CalculateTxDuration (psdu->GetSize (), txVector, m_phy->GetPhyBand ());
Ptr<WifiPpdu> ppdu = Create<OfdmPpdu> (psdu, txVector, WIFI_PHY_BAND_5GHZ, 0);
Ptr<WifiPpdu> ppdu = Create<OfdmPpdu> (psdu, txVector, FREQUENCY, WIFI_PHY_BAND_5GHZ, 0);
Ptr<SpectrumValue> txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (FREQUENCY, CHANNEL_WIDTH, txPowerWatts, CHANNEL_WIDTH);
Ptr<WifiSpectrumSignalParameters> txParams = Create<WifiSpectrumSignalParameters> ();