wifi: Call WifiPpdu::Copy only for APs expecting HE TB PPDUs
This commit is contained in:
committed by
Sebastien Deronne
parent
7bfc04fa6c
commit
9664f53884
@@ -1773,6 +1773,20 @@ HePhy::CanStartRx(Ptr<const WifiPpdu> ppdu) const
|
||||
return PhyEntity::CanStartRx(ppdu);
|
||||
}
|
||||
|
||||
Ptr<const WifiPpdu>
|
||||
HePhy::GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu)
|
||||
{
|
||||
// We only copy if the AP that is expecting a HE TB PPDU, since the content
|
||||
// of the TXVECTOR is reconstructed from the TRIGVECTOR, hence the other RX
|
||||
// PHYs should not have this information.
|
||||
if ((ppdu->GetType() == WIFI_PPDU_TYPE_UL_MU) &&
|
||||
(Simulator::Now() <= m_trigVectorExpirationTime))
|
||||
{
|
||||
return ppdu->Copy();
|
||||
}
|
||||
return PhyEntity::GetRxPpduFromTxPpdu(ppdu);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
namespace
|
||||
|
||||
@@ -115,6 +115,7 @@ class HePhy : public VhtPhy
|
||||
Time duration,
|
||||
WifiChannelListType channelType) override;
|
||||
bool CanStartRx(Ptr<const WifiPpdu> ppdu) const override;
|
||||
Ptr<const WifiPpdu> GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu) override;
|
||||
|
||||
/**
|
||||
* \return the BSS color of this PHY.
|
||||
|
||||
@@ -1352,4 +1352,10 @@ PhyEntity::CanStartRx(Ptr<const WifiPpdu> ppdu) const
|
||||
return ppdu->DoesCoverChannel(p20MinFreq, p20MaxFreq);
|
||||
}
|
||||
|
||||
Ptr<const WifiPpdu>
|
||||
PhyEntity::GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu)
|
||||
{
|
||||
return ppdu;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -527,6 +527,17 @@ class PhyEntity : public SimpleRefCount<PhyEntity>
|
||||
virtual double GetCcaThreshold(const Ptr<const WifiPpdu> ppdu,
|
||||
WifiChannelListType channelType) const;
|
||||
|
||||
/**
|
||||
* The WifiPpdu from the TX PHY is received by each RX PHY attached to the same channel.
|
||||
* By default and for performance reasons, all RX PHYs will work on the same WifiPpdu instance
|
||||
* from TX instead of a copy of it. Child classes can change that behavior and do a copy and/or
|
||||
* change the content of the parameters stored in WifiPpdu.
|
||||
*
|
||||
* \param ppdu the WifiPpdu transmitted by the TX PHY
|
||||
* \return the WifiPpdu to be used by the RX PHY
|
||||
*/
|
||||
virtual Ptr<const WifiPpdu> GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* A map of PPDU field elements per preamble type.
|
||||
|
||||
@@ -392,7 +392,7 @@ SpectrumWifiPhy::StartRx(Ptr<SpectrumSignalParameters> rxParams)
|
||||
// Do no further processing if signal is too weak
|
||||
// Current implementation assumes constant RX power over the PPDU duration
|
||||
// Compare received TX power per MHz to normalized RX sensitivity
|
||||
const auto& ppdu = wifiRxParams->ppdu;
|
||||
const auto& ppdu = GetRxPpduFromTxPpdu(wifiRxParams->ppdu);
|
||||
const auto& txVector = ppdu->GetTxVector();
|
||||
uint16_t txWidth = ppdu->GetTransmissionChannelWidth();
|
||||
if (totalRxPowerW < DbmToW(GetRxSensitivity()) * (txWidth / 20.0))
|
||||
@@ -418,6 +418,12 @@ SpectrumWifiPhy::StartRx(Ptr<SpectrumSignalParameters> rxParams)
|
||||
StartReceivePreamble(ppdu, rxPowerW, rxDuration);
|
||||
}
|
||||
|
||||
Ptr<const WifiPpdu>
|
||||
SpectrumWifiPhy::GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu)
|
||||
{
|
||||
return GetLatestPhyEntity()->GetRxPpduFromTxPpdu(ppdu);
|
||||
}
|
||||
|
||||
Ptr<Object>
|
||||
SpectrumWifiPhy::GetAntenna() const
|
||||
{
|
||||
|
||||
@@ -152,6 +152,14 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
*/
|
||||
void Transmit(Ptr<WifiSpectrumSignalParameters> txParams);
|
||||
|
||||
/**
|
||||
* Determine the WifiPpdu to be used by the RX PHY based on the WifiPpdu sent by the TX PHY.
|
||||
*
|
||||
* \param ppdu the WifiPpdu transmitted by the TX PHY
|
||||
* \return the WifiPpdu to be used by the RX PHY
|
||||
*/
|
||||
Ptr<const WifiPpdu> GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu);
|
||||
|
||||
protected:
|
||||
void DoDispose() override;
|
||||
void DoInitialize() override;
|
||||
|
||||
Reference in New Issue
Block a user