Abstract class for PHY entities. More...
#include "phy-entity.h"
Classes | |
struct | PhyFieldRxStatus |
Status of the reception of the PPDU field. More... | |
struct | SnrPer |
A struct for both SNR and PER. More... | |
Public Types | |
typedef std::pair< std::pair< Time, Time >, WifiMode > | PhyHeaderChunkInfo |
A pair containing information on the PHY header chunk, namely the start and stop times of the chunk and the WifiMode used. | |
typedef std::map< WifiPpduField, PhyHeaderChunkInfo > | PhyHeaderSections |
A map of PhyHeaderChunkInfo elements per PPDU field. | |
enum | PhyRxFailureAction { DROP = 0 , ABORT , IGNORE } |
Action to perform in case of RX failure. More... | |
Public Member Functions | |
virtual | ~PhyEntity () |
Destructor for PHY entity. | |
std::list< WifiMode >::const_iterator | begin () const |
Return a const iterator to the first WifiMode. | |
virtual Ptr< WifiPpdu > | BuildPpdu (const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) |
Build amendment-specific PPDU. | |
Time | CalculatePhyPreambleAndHeaderDuration (const WifiTxVector &txVector) const |
virtual Time | CalculateTxDuration (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, WifiPhyBand band) const |
virtual void | CancelAllEvents () |
Cancel and clear all running events. | |
void | CancelRunningEndPreambleDetectionEvents () |
Cancel all end preamble detection events. | |
virtual bool | CanStartRx (Ptr< const WifiPpdu > ppdu) const |
Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a given PPDU. | |
std::list< WifiMode >::const_iterator | end () const |
Return a const iterator to past-the-last WifiMode. | |
void | EndReceiveField (WifiPpduField field, Ptr< Event > event) |
End receiving a given field. | |
void | EndReceivePayload (Ptr< Event > event) |
The last symbol of the PPDU has arrived. | |
virtual Ptr< const WifiPsdu > | GetAddressedPsduInPpdu (Ptr< const WifiPpdu > ppdu) const |
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU). | |
virtual dBm_u | GetCcaThreshold (const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const |
Return the CCA threshold for a given channel type. | |
virtual Time | GetDuration (WifiPpduField field, const WifiTxVector &txVector) const |
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmission parameters. | |
Time | GetDurationUpToField (WifiPpduField field, const WifiTxVector &txVector) const |
Get the duration of the PPDU up to (but excluding) the given field. | |
virtual Time | GetMaxDelayPpduSameUid (const WifiTxVector &txVector) |
Obtain the maximum time between two PPDUs with the same UID to consider they are identical and their power can be added construtively. | |
virtual uint32_t | GetMaxPsduSize () const =0 |
Get the maximum PSDU size in bytes. | |
virtual WifiMode | GetMcs (uint8_t index) const |
Get the WifiMode corresponding to the given MCS index. | |
WifiPpduField | GetNextField (WifiPpduField currentField, WifiPreamble preamble) const |
Return the field following the provided one. | |
virtual uint8_t | GetNumModes () const |
virtual Time | GetPayloadDuration (uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols, uint16_t staId) const =0 |
PhyHeaderSections | GetPhyHeaderSections (const WifiTxVector &txVector, Time ppduStart) const |
Return a map of PHY header chunk information per PPDU field. | |
Time | GetRemainingDurationAfterField (Ptr< const WifiPpdu > ppdu, WifiPpduField field) const |
Get the remaining duration of the PPDU after the end of the given field. | |
virtual Ptr< const WifiPpdu > | GetRxPpduFromTxPpdu (Ptr< const WifiPpdu > ppdu) |
The WifiPpdu from the TX PHY is received by each RX PHY attached to the same channel. | |
virtual WifiMode | GetSigMode (WifiPpduField field, const WifiTxVector &txVector) const |
Get the WifiMode for the SIG field specified by the PPDU field. | |
virtual uint16_t | GetStaId (const Ptr< const WifiPpdu > ppdu) const |
Return the STA ID that has been assigned to the station this PHY belongs to. | |
virtual WifiConstPsduMap | GetWifiConstPsduMap (Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) const |
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU. | |
virtual bool | HandlesMcsModes () const |
Check if the WifiModes handled by this PHY are MCSs. | |
virtual bool | IsMcsSupported (uint8_t index) const |
Check if the WifiMode corresponding to the given MCS index is supported. | |
virtual bool | IsModeSupported (WifiMode mode) const |
Check if the WifiMode is supported. | |
bool | NoEndPreambleDetectionEvents () const |
virtual void | NotifyCcaBusy (const Ptr< const WifiPpdu > ppdu, Time duration, WifiChannelListType channelType) |
Notify PHY state helper to switch to CCA busy state,. | |
virtual uint64_t | ObtainNextUid (const WifiTxVector &txVector) |
Obtain the next UID for the PPDU to transmit. | |
void | ResetReceive (Ptr< Event > event) |
Reset PHY at the end of the PPDU under reception after it has failed the PHY header. | |
void | SetOwner (Ptr< WifiPhy > wifiPhy) |
Set the WifiPhy owning this PHY entity. | |
void | StartReceiveField (WifiPpduField field, Ptr< Event > event) |
Start receiving a given field. | |
virtual void | StartReceivePreamble (Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration) |
Start receiving the PHY preamble of a PPDU (i.e. | |
virtual void | StartTx (Ptr< const WifiPpdu > ppdu) |
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actions. | |
virtual void | SwitchMaybeToCcaBusy (const Ptr< const WifiPpdu > ppdu) |
Check if PHY state should move to CCA busy state based on current state of interference tracker. | |
void | Transmit (Time txDuration, Ptr< const WifiPpdu > ppdu, dBm_u txPower, Ptr< SpectrumValue > txPowerSpectrum, const std::string &type) |
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPhy's Transmit method. | |
Public Member Functions inherited from ns3::SimpleRefCount< PhyEntity > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Protected Types | |
using | CcaIndication |
CCA end time and its corresponding channel list type (can be std::nullopt if IDLE) | |
typedef std::pair< WifiCodeRate, uint16_t > | CodeRateConstellationSizePair |
A pair to hold modulation information: code rate and constellation size. | |
typedef std::map< std::string, CodeRateConstellationSizePair > | ModulationLookupTable |
A modulation lookup table using unique name of modulation as key. | |
typedef std::map< WifiPreamble, std::vector< WifiPpduField > > | PpduFormats |
A map of PPDU field elements per preamble type. | |
typedef std::pair< uint64_t, uint16_t > | UidStaIdPair |
A pair of a UID and STA_ID. | |
Protected Member Functions | |
void | AbortCurrentReception (WifiPhyRxfailureReason reason) |
Abort the current reception. | |
void | AddPreambleEvent (Ptr< Event > event) |
Add an entry to the map of current preamble events (stored in WifiPhy). | |
Ptr< Event > | CreateInterferenceEvent (Ptr< const WifiPpdu > ppdu, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartHePortionRxing=false) |
Create an event using WifiPhy's InterferenceHelper class. | |
virtual void | DoAbortCurrentReception (WifiPhyRxfailureReason reason) |
Perform amendment-specific actions before aborting the current reception. | |
virtual PhyFieldRxStatus | DoEndReceiveField (WifiPpduField field, Ptr< Event > event) |
End receiving a given field, perform amendment-specific actions, and provide the status of the reception. | |
virtual void | DoEndReceivePayload (Ptr< const WifiPpdu > ppdu) |
Perform amendment-specific actions at the end of the reception of the payload. | |
virtual PhyFieldRxStatus | DoEndReceivePreamble (Ptr< Event > event) |
End receiving the preamble, perform amendment-specific actions, and provide the status of the reception. | |
virtual Ptr< Event > | DoGetEvent (Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW) |
Get the event corresponding to the incoming PPDU. | |
virtual void | DoResetReceive (Ptr< Event > event) |
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after it has failed the PHY header. | |
virtual bool | DoStartReceiveField (WifiPpduField field, Ptr< Event > event) |
Start receiving a given field, perform amendment-specific actions, and signify if it is supported. | |
virtual Time | DoStartReceivePayload (Ptr< Event > event) |
Start receiving the PSDU (i.e. | |
void | DropPreambleEvent (Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason, Time endRx) |
Drop the PPDU and the corresponding preamble detection event, but keep CCA busy state after the completion of the currently processed event. | |
void | EndOfMpdu (Ptr< Event > event, Ptr< WifiMpdu > mpdu, size_t mpduIndex, Time relativeStart, Time mpduDuration) |
The last symbol of an MPDU in an A-MPDU has arrived. | |
void | EndPreambleDetectionPeriod (Ptr< Event > event) |
End the preamble detection period. | |
void | ErasePreambleEvent (Ptr< const WifiPpdu > ppdu, Time rxDuration) |
Erase the event corresponding to the PPDU from the list of preamble events, but consider it as noise after the completion of the current event. | |
virtual CcaIndication | GetCcaIndication (const Ptr< const WifiPpdu > ppdu) |
Get CCA end time and its corresponding channel list type when a new signal has been received by the PHY. | |
virtual std::pair< MHz_u, WifiSpectrumBandInfo > | GetChannelWidthAndBand (const WifiTxVector &txVector, uint16_t staId) const |
Get the channel width and band to use (will be overloaded by child classes). | |
Ptr< const Event > | GetCurrentEvent () const |
Get the pointer to the current event (stored in WifiPhy). | |
const std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & | GetCurrentPreambleEvents () const |
Get the map of current preamble events (stored in WifiPhy). | |
Time | GetDelayUntilCcaEnd (dBm_u threshold, const WifiSpectrumBandInfo &band) |
Return the delay until CCA busy is ended for a given sensitivity threshold and a given band. | |
MHz_u | GetGuardBandwidth (MHz_u currentChannelWidth) const |
virtual MHz_u | GetMeasurementChannelWidth (const Ptr< const WifiPpdu > ppdu) const =0 |
Return the channel width used to measure the RSSI. | |
SnrPer | GetPhyHeaderSnrPer (WifiPpduField field, Ptr< Event > event) const |
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class. | |
virtual const PpduFormats & | GetPpduFormats () const =0 |
Return the PPDU formats of the PHY. | |
WifiSpectrumBandInfo | GetPrimaryBand (MHz_u bandWidth) const |
If the operating channel width is a multiple of 20 MHz, return the info corresponding to the primary channel of the given bandwidth (which must be a multiple of 20 MHz and not exceed the operating channel width). | |
double | GetRandomValue () const |
Obtain a random value from the WifiPhy's generator. | |
std::pair< bool, SignalNoiseDbm > | GetReceptionStatus (Ptr< WifiMpdu > mpdu, Ptr< Event > event, uint16_t staId, Time relativeMpduStart, Time mpduDuration) |
Get the reception status for the provided MPDU and notify. | |
virtual MHz_u | GetRxChannelWidth (const WifiTxVector &txVector) const |
Return the channel width used in the reception spectrum model. | |
Watt_u | GetRxPowerForPpdu (Ptr< Event > event) const |
Obtain the received power for a given band. | |
WifiSpectrumBandInfo | GetSecondaryBand (MHz_u bandWidth) const |
If the channel bonding is used, return the info corresponding to the secondary channel of the given bandwidth (which must be a multiple of 20 MHz and not exceed the operating channel width). | |
std::tuple< dBr_u, dBr_u, dBr_u > | GetTxMaskRejectionParams () const |
virtual Ptr< SpectrumValue > | GetTxPowerSpectralDensity (Watt_u txPower, Ptr< const WifiPpdu > ppdu) const =0 |
virtual void | HandleRxPpduWithSameContent (Ptr< Event > event, Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPower) |
Handle reception of a PPDU that carries the same content of another PPDU. | |
virtual bool | IsConfigSupported (Ptr< const WifiPpdu > ppdu) const |
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY. | |
void | NotifyInterferenceRxEndAndClear (bool reset) |
Notify WifiPhy's InterferenceHelper of the end of the reception, clear maps and end of MPDU event, and eventually reset WifiPhy. | |
void | NotifyPayloadBegin (const WifiTxVector &txVector, const Time &payloadDuration) |
Fire the trace indicating that the PHY is starting to receive the payload of a PPDU. | |
virtual void | RxPayloadFailed (Ptr< const WifiPsdu > psdu, double snr, const WifiTxVector &txVector) |
Perform amendment-specific actions when the payload is unsuccessfuly received. | |
virtual void | RxPayloadSucceeded (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, uint16_t staId, const std::vector< bool > &statusPerMpdu) |
Perform amendment-specific actions when the payload is successfully received. | |
void | ScheduleEndOfMpdus (Ptr< Event > event) |
Schedule end of MPDUs events. | |
void | StartPreambleDetectionPeriod (Ptr< Event > event) |
Start the preamble detection period. | |
void | StartReceivePayload (Ptr< Event > event) |
Start receiving the PSDU (i.e. | |
Protected Attributes | |
std::vector< EventId > | m_endOfMacHdrEvents |
the end of MAC header events | |
std::vector< EventId > | m_endOfMpduEvents |
the end of MPDU events (only used for A-MPDUs) | |
std::vector< EventId > | m_endPreambleDetectionEvents |
the end of preamble detection events | |
std::vector< EventId > | m_endRxPayloadEvents |
the end of receive events (only one unless UL MU reception) | |
std::list< WifiMode > | m_modeList |
the list of supported modes | |
std::map< UidStaIdPair, SignalNoiseDbm > | m_signalNoiseMap |
Map of the latest signal power and noise power in dBm (noise power includes the noise figure) | |
Ptr< WifiPhyStateHelper > | m_state |
Pointer to WifiPhyStateHelper of the WifiPhy (to make it reachable for child classes) | |
std::map< UidStaIdPair, std::vector< bool > > | m_statusPerMpduMap |
Map of the current reception status per MPDU that is filled in as long as MPDUs are being processed by the PHY in case of an A-MPDU. | |
Ptr< WifiPhy > | m_wifiPhy |
Pointer to the owning WifiPhy. | |
Static Protected Attributes | |
static uint64_t | m_globalPpduUid = 0 |
Global counter of the PPDU UID. | |
Abstract class for PHY entities.
This class enables to have a unique set of APIs to be used by each PHY entity, corresponding to the different amendments of the IEEE 802.11 standard.
Definition at line 63 of file phy-entity.h.
|
protected |
CCA end time and its corresponding channel list type (can be std::nullopt if IDLE)
Definition at line 924 of file phy-entity.h.
|
protected |
A pair to hold modulation information: code rate and constellation size.
Definition at line 534 of file phy-entity.h.
|
protected |
A modulation lookup table using unique name of modulation as key.
Definition at line 539 of file phy-entity.h.
typedef std::pair<std::pair<Time , Time >, WifiMode> ns3::PhyEntity::PhyHeaderChunkInfo |
A pair containing information on the PHY header chunk, namely the start and stop times of the chunk and the WifiMode used.
Definition at line 289 of file phy-entity.h.
typedef std::map<WifiPpduField, PhyHeaderChunkInfo> ns3::PhyEntity::PhyHeaderSections |
A map of PhyHeaderChunkInfo elements per PPDU field.
Definition at line 294 of file phy-entity.h.
|
protected |
A map of PPDU field elements per preamble type.
This corresponds to the different PPDU formats introduced by each amendment.
Definition at line 529 of file phy-entity.h.
|
protected |
A pair of a UID and STA_ID.
Definition at line 955 of file phy-entity.h.
Action to perform in case of RX failure.
Enumerator | |
---|---|
DROP | drop PPDU and set CCA_BUSY |
ABORT | abort reception of PPDU |
IGNORE | ignore the reception |
Definition at line 69 of file phy-entity.h.
|
virtual |
Destructor for PHY entity.
Definition at line 74 of file phy-entity.cc.
References CancelAllEvents(), m_modeList, and NS_LOG_FUNCTION.
|
protected |
Abort the current reception.
reason | the reason the reception is aborted |
Definition at line 1175 of file phy-entity.cc.
References ns3::WifiPhy::AbortCurrentReception(), DoAbortCurrentReception(), m_wifiPhy, and NS_LOG_FUNCTION.
Referenced by EndReceiveField(), and StartReceivePreamble().
Add an entry to the map of current preamble events (stored in WifiPhy).
Wrapper used by child classes.
event | the event holding incoming PPDU's information |
Definition at line 861 of file phy-entity.cc.
References ns3::WifiPhy::m_currentPreambleEvents, m_wifiPhy, and NS_LOG_FUNCTION.
Referenced by ns3::HePhy::DoGetEvent(), and DoGetEvent().
std::list< WifiMode >::const_iterator ns3::PhyEntity::begin | ( | ) | const |
Return a const iterator to the first WifiMode.
Definition at line 131 of file phy-entity.cc.
References m_modeList.
|
virtual |
Build amendment-specific PPDU.
psdus | the PHY payloads (PSDUs) |
txVector | the TXVECTOR that was used for the PPDU |
ppduDuration | the transmission duration of the PPDU |
Reimplemented in ns3::DsssPhy, ns3::EhtPhy, ns3::ErpOfdmPhy, ns3::HePhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
Definition at line 234 of file phy-entity.cc.
References ns3::Create(), ns3::WifiPhy::GetOperatingChannel(), m_wifiPhy, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Time ns3::PhyEntity::CalculatePhyPreambleAndHeaderDuration | ( | const WifiTxVector & | txVector | ) | const |
txVector | the transmission parameters |
Definition at line 193 of file phy-entity.cc.
References GetDuration(), ns3::WIFI_PPDU_FIELD_DATA, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by ns3::HePhy::DoStartReceivePayload(), DoStartReceivePayload(), EndReceivePayload(), GetDurationUpToField(), ScheduleEndOfMpdus(), and ns3::HePhy::StartReceiveMuPayload().
|
virtual |
psduMap | the PSDU(s) to transmit indexed by STA-ID |
txVector | the TXVECTOR used for the transmission of the PPDU |
band | the frequency band being used |
Reimplemented in ns3::HePhy.
Definition at line 1391 of file phy-entity.cc.
References ns3::WifiPhy::CalculateTxDuration(), and NS_ASSERT.
|
virtual |
Cancel and clear all running events.
Reimplemented in ns3::HePhy.
Definition at line 1136 of file phy-entity.cc.
References CancelRunningEndPreambleDetectionEvents(), m_endOfMacHdrEvents, m_endOfMpduEvents, m_endRxPayloadEvents, and NS_LOG_FUNCTION.
Referenced by ~PhyEntity(), and ns3::HePhy::CancelAllEvents().
void ns3::PhyEntity::CancelRunningEndPreambleDetectionEvents | ( | ) |
Cancel all end preamble detection events.
Definition at line 1164 of file phy-entity.cc.
References m_endPreambleDetectionEvents, and NS_LOG_FUNCTION.
Referenced by CancelAllEvents().
Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a given PPDU.
ppdu | the PPDU |
Reimplemented in ns3::HePhy.
Definition at line 1401 of file phy-entity.cc.
References ns3::WifiPhy::GetChannelWidth(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency(), and m_wifiPhy.
Referenced by ns3::HePhy::CanStartRx().
|
protected |
Create an event using WifiPhy's InterferenceHelper class.
Wrapper used by child classes.
ppdu | the PPDU |
duration | the PPDU duration |
rxPower | received power per band (W) |
isStartHePortionRxing | flag whether the event corresponds to the start of the OFDMA payload reception (only used for UL-OFDMA) |
Definition at line 890 of file phy-entity.cc.
References ns3::WifiPhy::GetCurrentFrequencyRange(), ns3::WifiPhy::m_interference, and m_wifiPhy.
Referenced by ns3::HePhy::DoGetEvent(), DoGetEvent(), HandleRxPpduWithSameContent(), and ns3::HePhy::StartReceivePreamble().
|
protectedvirtual |
Perform amendment-specific actions before aborting the current reception.
reason | the reason the reception is aborted |
Reimplemented in ns3::HePhy.
Definition at line 1183 of file phy-entity.cc.
References ns3::WifiPhy::m_currentEvent, m_endOfMacHdrEvents, m_endOfMpduEvents, m_wifiPhy, and NS_LOG_FUNCTION.
Referenced by AbortCurrentReception(), and ns3::HePhy::DoAbortCurrentReception().
|
protectedvirtual |
End receiving a given field, perform amendment-specific actions, and provide the status of the reception.
field | the ending PPDU field |
event | the event holding incoming PPDU's information |
Reimplemented in ns3::DsssPhy, ns3::EhtPhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
Definition at line 378 of file phy-entity.cc.
References DoEndReceivePreamble(), NS_ASSERT, NS_LOG_FUNCTION, ns3::WIFI_PPDU_FIELD_DATA, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by ns3::DsssPhy::DoEndReceiveField(), ns3::OfdmPhy::DoEndReceiveField(), and EndReceiveField().
Perform amendment-specific actions at the end of the reception of the payload.
ppdu | the incoming PPDU |
Reimplemented in ns3::HePhy.
Definition at line 792 of file phy-entity.cc.
References ns3::WifiPhy::GetLastRxEndTime(), ns3::WifiPhy::m_currentEvent, ns3::WifiPhy::m_currentPreambleEvents, m_endRxPayloadEvents, m_wifiPhy, NotifyInterferenceRxEndAndClear(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::HePhy::DoEndReceivePayload(), and EndReceivePayload().
|
protectedvirtual |
End receiving the preamble, perform amendment-specific actions, and provide the status of the reception.
event | the event holding incoming PPDU's information |
Definition at line 957 of file phy-entity.cc.
References ns3::WifiPhy::m_currentPreambleEvents, m_wifiPhy, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by DoEndReceiveField().
|
protectedvirtual |
Get the event corresponding to the incoming PPDU.
We store all incoming preamble events, perform amendment-specific actions, and a decision is made at the end of the preamble detection window.
ppdu | the incoming PPDU |
rxPowersW | the receive power in W per band |
Reimplemented in ns3::HePhy.
Definition at line 869 of file phy-entity.cc.
References AddPreambleEvent(), CreateInterferenceEvent(), GetCurrentPreambleEvents(), HandleRxPpduWithSameContent(), and NS_LOG_DEBUG.
Referenced by ns3::HePhy::DoGetEvent(), and StartReceivePreamble().
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after it has failed the PHY header.
event | the event holding incoming PPDU's information |
Reimplemented in ns3::HePhy.
Definition at line 1216 of file phy-entity.cc.
References ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ResetReceive().
|
protectedvirtual |
Start receiving a given field, perform amendment-specific actions, and signify if it is supported.
field | the starting PPDU field |
event | the event holding incoming PPDU's information |
true
if the field is supported, false
otherwise Definition at line 359 of file phy-entity.cc.
References GetPpduFormats(), NS_ASSERT, NS_LOG_FUNCTION, ns3::WIFI_PPDU_FIELD_DATA, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by StartReceiveField().
Start receiving the PSDU (i.e.
the first symbol of the PSDU has arrived) and perform amendment-specific actions.
event | the event holding incoming PPDU's information |
Reimplemented in ns3::HePhy.
Definition at line 563 of file phy-entity.cc.
References CalculatePhyPreambleAndHeaderDuration(), EndReceivePayload(), GetStaId(), m_endRxPayloadEvents, ns3::WifiPhy::m_phyRxPayloadBeginTrace, m_signalNoiseMap, m_statusPerMpduMap, m_wifiPhy, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ScheduleEndOfMpdus().
Referenced by ns3::HePhy::DoStartReceivePayload(), and StartReceivePayload().
|
protected |
Drop the PPDU and the corresponding preamble detection event, but keep CCA busy state after the completion of the currently processed event.
ppdu | the incoming PPDU |
reason | the reason the PPDU is dropped |
endRx | the end of the incoming PPDU's reception |
Definition at line 508 of file phy-entity.cc.
References ns3::WifiPhy::IsStateOff(), ns3::WifiPhy::IsStateSleep(), ns3::WifiPhy::m_currentPreambleEvents, m_state, m_wifiPhy, ns3::WifiPhy::NotifyRxPpduDrop(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and ns3::WifiPhy::SwitchMaybeToCcaBusy().
Referenced by EndPreambleDetectionPeriod(), and StartReceivePreamble().
std::list< WifiMode >::const_iterator ns3::PhyEntity::end | ( | ) | const |
Return a const iterator to past-the-last WifiMode.
Definition at line 137 of file phy-entity.cc.
References m_modeList.
Referenced by grid.TimelinesRenderer::draw_events(), and grid.TimelinesRenderer::draw_ranges().
|
protected |
The last symbol of an MPDU in an A-MPDU has arrived.
event | the event holding incoming PPDU's information |
mpdu | the arriving MPDU |
mpduIndex | the index of the MPDU within the A-MPDU |
relativeStart | the relative start time of the MPDU within the A-MPDU. |
mpduDuration | the duration of the MPDU |
Definition at line 674 of file phy-entity.cc.
References ns3::Time::As(), ns3::Create(), ns3::DbToRatio(), GetAddressedPsduInPpdu(), GetReceptionStatus(), GetStaId(), m_signalNoiseMap, m_state, m_statusPerMpduMap, ns3::Time::NS, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::RxSignalInfo::rssi, and ns3::RxSignalInfo::snr.
Referenced by ScheduleEndOfMpdus().
End the preamble detection period.
The PHY will focus on the strongest PPDU and drop others. In addition, in case of successful detection, the end of the preamble reception is triggered (
event | the event holding incoming PPDU's information |
Definition at line 985 of file phy-entity.cc.
References ns3::BUSY_DECODING_PREAMBLE, ns3::EventId::Cancel(), DropPreambleEvent(), EndReceiveField(), GetAddressedPsduInPpdu(), ns3::WifiPhy::GetCurrentFrequencyRange(), GetDuration(), GetMeasurementChannelWidth(), ns3::WifiPhy::GetPreambleDetectionDuration(), GetPrimaryBand(), ns3::EventId::IsExpired(), ns3::WifiPhy::IsStateRx(), ns3::WifiPhy::m_currentEvent, ns3::WifiPhy::m_currentPreambleEvents, ns3::WifiPhy::m_endPhyRxEvent, ns3::WifiPhy::m_interference, ns3::WifiPhy::m_phyEntities, ns3::WifiPhy::m_preambleDetectionModel, ns3::WifiPhy::m_timeLastPreambleDetected, m_wifiPhy, ns3::WifiPhy::NotifyCcaBusy(), ns3::WifiPhy::NotifyRxBegin(), ns3::WifiPhy::NotifyRxPpduDrop(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PREAMBLE_DETECT_FAILURE, ns3::PREAMBLE_DETECTION_PACKET_SWITCH, ns3::RatioToDb(), ns3::Simulator::Schedule(), ns3::WIFI_PPDU_FIELD_PREAMBLE, and ns3::WToDbm().
Referenced by StartPreambleDetectionPeriod().
void ns3::PhyEntity::EndReceiveField | ( | WifiPpduField | field, |
Ptr< Event > | event ) |
End receiving a given field.
This method will call the DoEndReceiveField to obtain the outcome of the reception. In case of success, reception of the next field is triggered. In case of failure, the indications in the returned
field | the ending PPDU field |
event | the event holding incoming PPDU's information |
Definition at line 299 of file phy-entity.cc.
References ABORT, AbortCurrentReception(), ns3::PhyEntity::PhyFieldRxStatus::actionIfFailure, DoEndReceiveField(), DROP, ns3::FILTERED, GetNextField(), GetRemainingDurationAfterField(), IGNORE, ns3::EventId::IsExpired(), ns3::PhyEntity::PhyFieldRxStatus::isSuccess, ns3::WifiPhy::m_endPhyRxEvent, m_endRxPayloadEvents, ns3::WifiPhy::m_phyRxPayloadBeginTrace, m_state, m_wifiPhy, ns3::NanoSeconds(), ns3::WifiPhy::NotifyCcaBusy(), ns3::WifiPhy::NotifyRxPpduDrop(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::PhyEntity::PhyFieldRxStatus::reason, ResetReceive(), ns3::Simulator::Schedule(), StartReceiveField(), and ns3::WifiPhy::SwitchMaybeToCcaBusy().
Referenced by EndPreambleDetectionPeriod(), and StartReceiveField().
The last symbol of the PPDU has arrived.
event | the event holding incoming PPDU's information |
Definition at line 711 of file phy-entity.cc.
References CalculatePhyPreambleAndHeaderDuration(), DoEndReceivePayload(), GetAddressedPsduInPpdu(), GetChannelWidthAndBand(), ns3::WifiPhy::GetFrequency(), GetStaId(), ns3::WifiPhy::m_interference, ns3::WifiPhy::m_previouslyRxPpduUid, m_signalNoiseMap, m_state, m_statusPerMpduMap, m_wifiPhy, ns3::WifiPhy::NotifyMonitorSniffRx(), ns3::WifiPhy::NotifyRxEnd(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::RxSignalInfo::rssi, RxPayloadFailed(), RxPayloadSucceeded(), ns3::RxSignalInfo::snr, and ns3::WifiPhy::SwitchMaybeToCcaBusy().
Referenced by DoStartReceivePayload(), and ns3::HePhy::StartReceiveMuPayload().
Erase the event corresponding to the PPDU from the list of preamble events, but consider it as noise after the completion of the current event.
ppdu | the incoming PPDU |
rxDuration | the duration of the PPDU |
Definition at line 526 of file phy-entity.cc.
References ns3::WifiPhy::m_currentPreambleEvents, m_state, m_wifiPhy, NS_LOG_FUNCTION, ns3::WifiPhy::Reset(), and ns3::WifiPhy::SwitchMaybeToCcaBusy().
Referenced by ns3::HePhy::StartReceivePreamble().
|
virtual |
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
ppdu | the PPDU to extract the PSDU from |
Reimplemented in ns3::HePhy.
Definition at line 210 of file phy-entity.cc.
Referenced by EndOfMpdu(), EndPreambleDetectionPeriod(), EndReceivePayload(), ns3::HePhy::GetAddressedPsduInPpdu(), and ScheduleEndOfMpdus().
|
protectedvirtual |
Get CCA end time and its corresponding channel list type when a new signal has been received by the PHY.
ppdu | the incoming PPDU or nullptr for any signal |
Reimplemented in ns3::HtPhy, and ns3::VhtPhy.
Definition at line 1302 of file phy-entity.cc.
References GetCcaThreshold(), GetDelayUntilCcaEnd(), GetMeasurementChannelWidth(), GetPrimaryBand(), ns3::Time::IsStrictlyPositive(), NS_LOG_FUNCTION, and ns3::WIFI_CHANLIST_PRIMARY.
Referenced by ns3::HtPhy::GetCcaIndication(), and SwitchMaybeToCcaBusy().
|
virtual |
Return the CCA threshold for a given channel type.
If the channel type is not provided, the default CCA threshold is returned.
ppdu | the PPDU that is being received |
channelType | the channel type |
Reimplemented in ns3::HePhy, ns3::OfdmPhy, and ns3::VhtPhy.
Definition at line 1266 of file phy-entity.cc.
References ns3::WifiPhy::GetCcaEdThreshold(), ns3::WifiPhy::GetCcaSensitivityThreshold(), and m_wifiPhy.
Referenced by GetCcaIndication(), and ns3::OfdmPhy::GetCcaThreshold().
|
protectedvirtual |
Get the channel width and band to use (will be overloaded by child classes).
txVector | the transmission parameters |
staId | the station ID of the PSDU |
Reimplemented in ns3::HePhy.
Definition at line 848 of file phy-entity.cc.
References GetPrimaryBand(), and GetRxChannelWidth().
Referenced by EndReceivePayload(), ns3::HePhy::GetChannelWidthAndBand(), GetReceptionStatus(), and ScheduleEndOfMpdus().
Get the pointer to the current event (stored in WifiPhy).
Wrapper used by child classes.
Definition at line 1235 of file phy-entity.cc.
References ns3::WifiPhy::m_currentEvent, and m_wifiPhy.
Referenced by ns3::HePhy::HandleRxPpduWithSameContent(), ns3::HePhy::StartReceiveMuPayload(), and ns3::HePhy::StartReceivePreamble().
|
protected |
Get the map of current preamble events (stored in WifiPhy).
Wrapper used by child classes.
Definition at line 855 of file phy-entity.cc.
References ns3::WifiPhy::m_currentPreambleEvents, and m_wifiPhy.
Referenced by ns3::HePhy::DoGetEvent(), and DoGetEvent().
|
protected |
Return the delay until CCA busy is ended for a given sensitivity threshold and a given band.
threshold | the CCA sensitivity threshold |
band | identify the requested band |
Definition at line 1273 of file phy-entity.cc.
References ns3::DbmToW(), ns3::WifiPhy::m_interference, and m_wifiPhy.
Referenced by ns3::HtPhy::GetCcaIndication(), GetCcaIndication(), ns3::VhtPhy::GetCcaIndication(), and ns3::HePhy::GetPer20MHzDurations().
|
virtual |
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmission parameters.
field | the PPDU field (or group of fields) |
txVector | the transmission parameters |
Reimplemented in ns3::DsssPhy, ns3::EhtPhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
Definition at line 183 of file phy-entity.cc.
References NS_FATAL_ERROR, and ns3::WIFI_PPDU_FIELD_EHT_SIG.
Referenced by CalculatePhyPreambleAndHeaderDuration(), EndPreambleDetectionPeriod(), ns3::DsssPhy::GetDuration(), ns3::OfdmPhy::GetDuration(), GetPhyHeaderSections(), GetRemainingDurationAfterField(), and StartReceiveField().
Time ns3::PhyEntity::GetDurationUpToField | ( | WifiPpduField | field, |
const WifiTxVector & | txVector ) const |
Get the duration of the PPDU up to (but excluding) the given field.
field | the considered PPDU field |
txVector | the transmission parameters |
Definition at line 245 of file phy-entity.cc.
References CalculatePhyPreambleAndHeaderDuration(), GetPhyHeaderSections(), NS_ASSERT, and ns3::WIFI_PPDU_FIELD_DATA.
Referenced by GetRemainingDurationAfterField().
currentChannelWidth | channel width of the current transmission |
Wrapper method used by child classes for PSD generation. Note that this method is necessary for testing UL OFDMA.
Definition at line 1379 of file phy-entity.cc.
References ns3::WifiPhy::GetGuardBandwidth(), and m_wifiPhy.
Referenced by ns3::HePhy::GetNonOfdmaBand(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), ns3::DsssPhy::GetTxPowerSpectralDensity(), ns3::HePhy::GetTxPowerSpectralDensity(), ns3::HtPhy::GetTxPowerSpectralDensity(), and ns3::OfdmPhy::GetTxPowerSpectralDensity().
|
virtual |
Obtain the maximum time between two PPDUs with the same UID to consider they are identical and their power can be added construtively.
txVector | the TXVECTOR used for the transmission of the PPDUs |
Reimplemented in ns3::HePhy.
Definition at line 1333 of file phy-entity.cc.
References ns3::Seconds().
|
pure virtual |
Get the maximum PSDU size in bytes.
Implemented in ns3::DsssPhy, ns3::ErpOfdmPhy, ns3::HePhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
|
virtual |
Get the WifiMode corresponding to the given MCS index.
index | the index of the MCS |
This method should be used only for HtPhy and child classes.
Reimplemented in ns3::HtPhy.
Definition at line 109 of file phy-entity.cc.
References NS_ABORT_MSG.
|
protectedpure virtual |
Return the channel width used to measure the RSSI.
ppdu | the PPDU that is being received |
Implemented in ns3::DsssPhy, ns3::HePhy, and ns3::OfdmPhy.
Referenced by EndPreambleDetectionPeriod(), GetCcaIndication(), GetPhyHeaderSnrPer(), and GetRxPowerForPpdu().
WifiPpduField ns3::PhyEntity::GetNextField | ( | WifiPpduField | currentField, |
WifiPreamble | preamble ) const |
Return the field following the provided one.
currentField | the considered PPDU field |
preamble | the preamble indicating the PPDU format |
Definition at line 152 of file phy-entity.cc.
References GetPpduFormats(), NS_FATAL_ERROR, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by EndReceiveField(), and GetPhyHeaderSections().
|
virtual |
Definition at line 103 of file phy-entity.cc.
References m_modeList.
|
pure virtual |
size | the number of bytes in the packet to send |
txVector | the TXVECTOR used for the transmission of this packet |
band | the frequency band |
mpdutype | the type of the MPDU as defined in WifiPhy::MpduType. |
incFlag | this flag is used to indicate that the variables need to be update or not This function is called a couple of times for the same packet so variables should not be increased each time. |
totalAmpduSize | the total size of the previously transmitted MPDUs for the concerned A-MPDU. If incFlag is set, this parameter will be updated. |
totalAmpduNumSymbols | the number of symbols previously transmitted for the MPDUs in the concerned A-MPDU, used for the computation of the number of symbols needed for the last MPDU. If incFlag is set, this parameter will be updated. |
staId | the STA-ID of the PSDU (only used for MU PPDUs) |
Implemented in ns3::DsssPhy, ns3::HtPhy, and ns3::OfdmPhy.
PhyEntity::PhyHeaderSections ns3::PhyEntity::GetPhyHeaderSections | ( | const WifiTxVector & | txVector, |
Time | ppduStart ) const |
Return a map of PHY header chunk information per PPDU field.
This map will contain the PPDU fields that are actually present based on the txVector
information.
txVector | the transmission parameters |
ppduStart | the time at which the PPDU started |
Definition at line 216 of file phy-entity.cc.
References GetDuration(), GetNextField(), ns3::WifiTxVector::GetPreambleType(), GetSigMode(), ns3::WIFI_PPDU_FIELD_DATA, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by GetDurationUpToField().
|
protected |
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
Wrapper used by child classes.
field | the PPDU field |
event | the event holding incoming PPDU's information |
Definition at line 261 of file phy-entity.cc.
References GetMeasurementChannelWidth(), GetPrimaryBand(), ns3::WifiPhy::m_interference, and m_wifiPhy.
Referenced by ns3::DsssPhy::EndReceiveHeader(), ns3::OfdmPhy::EndReceiveHeader(), ns3::HtPhy::EndReceiveHtSig(), and ns3::VhtPhy::EndReceiveSig().
|
protectedpure virtual |
Return the PPDU formats of the PHY.
Implemented in ns3::DsssPhy, ns3::EhtPhy, ns3::HePhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
Referenced by DoStartReceiveField(), and GetNextField().
|
protected |
If the operating channel width is a multiple of 20 MHz, return the info corresponding to the primary channel of the given bandwidth (which must be a multiple of 20 MHz and not exceed the operating channel width).
Otherwise, this call is equivalent to GetBand with bandIndex equal to zero.
bandWidth | the width of the band to be returned |
Definition at line 1241 of file phy-entity.cc.
References ns3::WifiPhy::GetBand(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhyOperatingChannel::GetPrimaryChannelIndex(), and m_wifiPhy.
Referenced by EndPreambleDetectionPeriod(), ns3::HtPhy::GetCcaIndication(), GetCcaIndication(), ns3::VhtPhy::GetCcaIndication(), GetChannelWidthAndBand(), GetPhyHeaderSnrPer(), and GetRxPowerForPpdu().
|
protected |
Obtain a random value from the WifiPhy's generator.
Wrapper used by child classes.
Definition at line 1223 of file phy-entity.cc.
References ns3::WifiPhy::m_random, and m_wifiPhy.
Referenced by ns3::DsssPhy::EndReceiveHeader(), ns3::OfdmPhy::EndReceiveHeader(), ns3::HtPhy::EndReceiveHtSig(), ns3::VhtPhy::EndReceiveSig(), GetReceptionStatus(), and ScheduleEndOfMpdus().
|
protected |
Get the reception status for the provided MPDU and notify.
mpdu | the arriving MPDU |
event | the event holding incoming PPDU's information |
staId | the station ID of the PSDU (only used for MU) |
relativeMpduStart | the relative start time of the MPDU within the A-MPDU. 0 for normal MPDUs |
mpduDuration | the duration of the MPDU |
Definition at line 804 of file phy-entity.cc.
References ns3::Time::As(), GetChannelWidthAndBand(), ns3::WifiMode::GetDataRate(), GetRandomValue(), ns3::WifiPhy::m_interference, ns3::WifiPhy::m_postReceptionErrorModel, m_wifiPhy, ns3::SignalNoiseDbm::noise, ns3::Time::NS, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PhyEntity::SnrPer::per, ns3::RatioToDb(), ns3::SignalNoiseDbm::signal, ns3::PhyEntity::SnrPer::snr, and ns3::WToDbm().
Referenced by EndOfMpdu().
Time ns3::PhyEntity::GetRemainingDurationAfterField | ( | Ptr< const WifiPpdu > | ppdu, |
WifiPpduField | field ) const |
Get the remaining duration of the PPDU after the end of the given field.
field | the considered PPDU field |
ppdu | the received PPDU |
Definition at line 351 of file phy-entity.cc.
References GetDuration(), and GetDurationUpToField().
Referenced by EndReceiveField().
|
protectedvirtual |
Return the channel width used in the reception spectrum model.
txVector | the TXVECTOR of the PPDU that is being received |
Reimplemented in ns3::DsssPhy.
Definition at line 1260 of file phy-entity.cc.
References ns3::WifiPhy::GetChannelWidth(), ns3::WifiTxVector::GetChannelWidth(), and m_wifiPhy.
Referenced by ns3::OfdmPhy::GetCcaThreshold(), GetChannelWidthAndBand(), ns3::OfdmPhy::GetMeasurementChannelWidth(), and ns3::DsssPhy::GetRxChannelWidth().
Obtain the received power for a given band.
Wrapper used by child classes.
event | the event holding incoming PPDU's information |
Definition at line 1229 of file phy-entity.cc.
References GetMeasurementChannelWidth(), and GetPrimaryBand().
Referenced by ns3::HePhy::ProcessSigA(), and StartPreambleDetectionPeriod().
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.
ppdu | the WifiPpdu transmitted by the TX PHY |
Reimplemented in ns3::HePhy, and ns3::OfdmPhy.
Definition at line 1428 of file phy-entity.cc.
Referenced by ns3::OfdmPhy::GetRxPpduFromTxPpdu().
|
protected |
If the channel bonding is used, return the info corresponding to the secondary channel of the given bandwidth (which must be a multiple of 20 MHz and not exceed the operating channel width).
bandWidth | the width of the band to be returned |
Definition at line 1252 of file phy-entity.cc.
References ns3::WifiPhy::GetBand(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhyOperatingChannel::GetSecondaryChannelIndex(), m_wifiPhy, and NS_ASSERT.
Referenced by ns3::HtPhy::GetCcaIndication(), and ns3::VhtPhy::GetCcaIndication().
|
virtual |
Get the WifiMode for the SIG field specified by the PPDU field.
field | the PPDU field |
txVector | the transmission parameters |
Reimplemented in ns3::DsssPhy, ns3::EhtPhy, ns3::HePhy, ns3::HtPhy, ns3::OfdmPhy, and ns3::VhtPhy.
Definition at line 143 of file phy-entity.cc.
References NS_FATAL_ERROR.
Referenced by GetPhyHeaderSections(), ns3::DsssPhy::GetSigMode(), and ns3::OfdmPhy::GetSigMode().
Return the STA ID that has been assigned to the station this PHY belongs to.
This is typically called for MU PPDUs, in order to pick the correct PSDU.
ppdu | the PPDU for which the STA ID is requested |
Reimplemented in MuMimoTestHePhy, ns3::HePhy, and OfdmaTestHePhy.
Definition at line 547 of file phy-entity.cc.
References ns3::SU_STA_ID.
Referenced by DoStartReceivePayload(), EndOfMpdu(), EndReceivePayload(), ns3::HePhy::GetStaId(), and ScheduleEndOfMpdus().
Wrapper method used by child classes for PSD generation.
Definition at line 1385 of file phy-entity.cc.
References ns3::WifiPhy::GetTxMaskRejectionParams(), and m_wifiPhy.
Referenced by ns3::HePhy::GetTxPowerSpectralDensity(), ns3::HtPhy::GetTxPowerSpectralDensity(), and ns3::OfdmPhy::GetTxPowerSpectralDensity().
|
protectedpure virtual |
txPower | power to spread across the bands |
ppdu | the PPDU that will be transmitted |
This is a helper function to create the right TX PSD corresponding to the amendment of this PHY.
Implemented in ns3::DsssPhy, ns3::HePhy, ns3::HtPhy, and ns3::OfdmPhy.
Referenced by StartTx().
|
virtual |
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
The STA-ID value is properly determined based on whether the given PSDU has to be transmitted as a DL or UL frame.
psdu | the given PSDU |
txVector | the TXVECTOR to use to send the PSDU |
Reimplemented in ns3::HePhy.
Definition at line 204 of file phy-entity.cc.
References ns3::SU_STA_ID.
|
protectedvirtual |
Handle reception of a PPDU that carries the same content of another PPDU.
This is typically called upon reception of preambles of HE MU PPDUs or reception of non-HT duplicate control frames that carries the exact same content sent from different STAs. If the delay between the PPDU and the first PPDU carrying the same content is small enough, PPDU can be decoded and its power is added constructively, and the TXVECTOR is updated accordingly. Otherwise, a new interference event is created and PPDU is dropped by the PHY.
event | the event of the ongoing reception |
ppdu | the newly received PPDU (UL MU or non-HT duplicate) |
rxPower | the received power (W) per band of the newly received PPDU |
Reimplemented in ns3::HePhy.
Definition at line 903 of file phy-entity.cc.
References CreateInterferenceEvent(), ns3::WifiPhy::GetPhyEntityForPpdu(), ns3::WifiPhy::m_interference, m_wifiPhy, ns3::WifiPhy::NotifyRxPpduDrop(), ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::PPDU_TOO_LATE.
Referenced by DoGetEvent(), and ns3::HePhy::HandleRxPpduWithSameContent().
|
virtual |
Check if the WifiModes handled by this PHY are MCSs.
Reimplemented in ns3::HtPhy.
Definition at line 125 of file phy-entity.cc.
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
ppdu | the received PPDU |
true
if supported, false
otherwise Reimplemented in ns3::HePhy, and ns3::HtPhy.
Definition at line 1123 of file phy-entity.cc.
References IsModeSupported(), and NS_LOG_DEBUG.
Referenced by ns3::DsssPhy::EndReceiveHeader(), and ns3::OfdmPhy::IsAllConfigSupported().
|
virtual |
Check if the WifiMode corresponding to the given MCS index is supported.
index | the index of the MCS |
Will return false for non-MCS modes.
Reimplemented in ns3::HtPhy.
Definition at line 117 of file phy-entity.cc.
References NS_ABORT_MSG.
|
virtual |
Check if the WifiMode is supported.
mode | the WifiMode to check |
Definition at line 90 of file phy-entity.cc.
References m_modeList.
Referenced by ns3::HePhy::IsConfigSupported(), ns3::HtPhy::IsConfigSupported(), and IsConfigSupported().
bool ns3::PhyEntity::NoEndPreambleDetectionEvents | ( | ) | const |
true
if there is no end preamble detection event running, false
otherwise Definition at line 1158 of file phy-entity.cc.
References m_endPreambleDetectionEvents.
|
virtual |
Notify PHY state helper to switch to CCA busy state,.
ppdu | the incoming PPDU or nullptr for any signal |
duration | the duration of the CCA state |
channelType | the channel type for which the CCA busy state is reported. |
Reimplemented in ns3::HePhy.
Definition at line 1316 of file phy-entity.cc.
References ns3::Time::As(), m_state, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Time::S.
|
protected |
Notify WifiPhy's InterferenceHelper of the end of the reception, clear maps and end of MPDU event, and eventually reset WifiPhy.
reset | whether to reset WifiPhy |
Definition at line 935 of file phy-entity.cc.
References ns3::WifiPhy::GetCurrentFrequencyRange(), m_endOfMacHdrEvents, m_endOfMpduEvents, ns3::WifiPhy::m_interference, m_signalNoiseMap, m_statusPerMpduMap, m_wifiPhy, ns3::Simulator::Now(), NS_ASSERT, and ns3::WifiPhy::Reset().
Referenced by ns3::HePhy::DoEndReceivePayload(), and DoEndReceivePayload().
|
protected |
Fire the trace indicating that the PHY is starting to receive the payload of a PPDU.
txVector | the TXVECTOR used to transmit the PPDU |
payloadDuration | the TX duration of the PPDU payload |
Definition at line 1339 of file phy-entity.cc.
References ns3::WifiPhy::m_phyRxPayloadBeginTrace, and m_wifiPhy.
Referenced by ns3::HePhy::DoStartReceivePayload(), and ns3::HePhy::StartReceiveMuPayload().
|
virtual |
Obtain the next UID for the PPDU to transmit.
Note that the global UID counter could be incremented.
txVector | the transmission parameters |
Reimplemented in ns3::HePhy.
Definition at line 1326 of file phy-entity.cc.
References m_globalPpduUid, and NS_LOG_FUNCTION.
Referenced by ns3::DsssPhy::BuildPpdu(), ns3::HtPhy::BuildPpdu(), and ns3::VhtPhy::BuildPpdu().
Reset PHY at the end of the PPDU under reception after it has failed the PHY header.
event | the event holding incoming PPDU's information |
Definition at line 1202 of file phy-entity.cc.
References DoResetReceive(), ns3::WifiPhy::GetCurrentFrequencyRange(), ns3::WifiPhy::IsStateRx(), ns3::WifiPhy::m_currentEvent, ns3::WifiPhy::m_currentPreambleEvents, m_endRxPayloadEvents, ns3::WifiPhy::m_interference, m_wifiPhy, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::WifiPhy::SwitchMaybeToCcaBusy().
Referenced by ns3::HePhy::DoStartReceivePayload(), and EndReceiveField().
|
protectedvirtual |
Perform amendment-specific actions when the payload is unsuccessfuly received.
psdu | the PSDU that we failed to received |
snr | the SNR of the received PSDU in linear scale |
txVector | TXVECTOR of the PSDU |
Reimplemented in ns3::HePhy.
Definition at line 785 of file phy-entity.cc.
References m_state, and NS_LOG_FUNCTION.
Referenced by EndReceivePayload().
|
protectedvirtual |
Perform amendment-specific actions when the payload is successfully received.
psdu | the successfully received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TXVECTOR of the PSDU |
staId | the station ID of the PSDU (only used for MU) |
statusPerMpdu | reception status per MPDU |
Reimplemented in ns3::HePhy.
Definition at line 774 of file phy-entity.cc.
References m_state, and NS_LOG_FUNCTION.
Referenced by EndReceivePayload().
Schedule end of MPDUs events.
event | the event holding incoming PPDU's information |
Definition at line 585 of file phy-entity.cc.
References ns3::Time::As(), ns3::DataRate::CalculateBytesTxTime(), CalculatePhyPreambleAndHeaderDuration(), EndOfMpdu(), ns3::FIRST_MPDU_IN_AGGREGATE, GetAddressedPsduInPpdu(), GetChannelWidthAndBand(), ns3::WifiPhy::GetPayloadDuration(), ns3::WifiPhy::GetPhyBand(), GetRandomValue(), GetStaId(), ns3::Time::IsZero(), ns3::LAST_MPDU_IN_AGGREGATE, m_endOfMacHdrEvents, m_endOfMpduEvents, ns3::WifiPhy::m_interference, ns3::WifiPhy::m_notifyRxMacHeaderEnd, ns3::WifiPhy::m_phyRxMacHeaderEndTrace, m_wifiPhy, ns3::MIDDLE_MPDU_IN_AGGREGATE, ns3::NORMAL_MPDU, ns3::Time::NS, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Simulator::Schedule(), and ns3::SINGLE_MPDU.
Referenced by DoStartReceivePayload(), and ns3::HePhy::StartReceiveMuPayload().
Set the WifiPhy owning this PHY entity.
wifiPhy | the WifiPhy owning this PHY entity |
Definition at line 82 of file phy-entity.cc.
References m_state, ns3::WifiPhy::m_state, m_wifiPhy, and NS_LOG_FUNCTION.
Referenced by MuMimoSpectrumWifiPhy::MuMimoSpectrumWifiPhy(), MuRtsCtsSpectrumWifiPhy::MuRtsCtsSpectrumWifiPhy(), and OfdmaSpectrumWifiPhy::OfdmaSpectrumWifiPhy().
Start the preamble detection period.
event | the event holding incoming PPDU's information |
Definition at line 967 of file phy-entity.cc.
References EndPreambleDetectionPeriod(), ns3::WifiPhy::GetCurrentFrequencyRange(), ns3::WifiPhy::GetPreambleDetectionDuration(), GetRxPowerForPpdu(), m_endPreambleDetectionEvents, ns3::WifiPhy::m_interference, m_wifiPhy, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::WToDbm().
Referenced by StartReceivePreamble().
void ns3::PhyEntity::StartReceiveField | ( | WifiPpduField | field, |
Ptr< Event > | event ) |
Start receiving a given field.
This method will call the DoStartReceiveField. EndReceiveField is also scheduled after the duration of the field (except for the special case of preambles
field | the starting PPDU field |
event | the event holding incoming PPDU's information |
Definition at line 272 of file phy-entity.cc.
References DoStartReceiveField(), EndReceiveField(), GetDuration(), ns3::EventId::IsExpired(), ns3::WifiPhy::m_endPhyRxEvent, m_wifiPhy, ns3::WifiPhy::NotifyCcaBusy(), NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), StartReceivePayload(), ns3::WIFI_PPDU_FIELD_DATA, and ns3::WIFI_PPDU_FIELD_PREAMBLE.
Referenced by EndReceiveField().
Start receiving the PSDU (i.e.
the first symbol of the PSDU has arrived).
event | the event holding incoming PPDU's information |
Definition at line 553 of file phy-entity.cc.
References DoStartReceivePayload(), ns3::EventId::IsExpired(), ns3::WifiPhy::m_endPhyRxEvent, m_state, m_wifiPhy, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by StartReceiveField().
|
virtual |
Start receiving the PHY preamble of a PPDU (i.e.
the first bit of the preamble has arrived).
This method triggers the start of the preamble detection period (
ppdu | the arriving PPDU |
rxPowersW | the receive power in W per band |
rxDuration | the duration of the PPDU |
Reimplemented in ns3::HePhy.
Definition at line 390 of file phy-entity.cc.
References AbortCurrentReception(), ns3::BUSY_DECODING_PREAMBLE, ns3::CCA_BUSY, ns3::CHANNEL_SWITCHING, DoGetEvent(), DropPreambleEvent(), ns3::FRAME_CAPTURE_PACKET_SWITCH, ns3::IDLE, ns3::WifiPhy::m_currentEvent, ns3::WifiPhy::m_currentPreambleEvents, ns3::WifiPhy::m_frameCaptureModel, m_state, ns3::WifiPhy::m_timeLastPreambleDetected, m_wifiPhy, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::OFF, ns3::POWERED_OFF, ns3::RX, ns3::RXING, ns3::SLEEP, ns3::SLEEPING, StartPreambleDetectionPeriod(), ns3::SWITCHING, ns3::WifiPhy::SwitchMaybeToCcaBusy(), ns3::TRUNCATED_TX, ns3::TX, and ns3::TXING.
Referenced by ns3::HePhy::StartReceivePreamble().
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actions.
ppdu | the PPDU to send |
Reimplemented in ns3::HePhy.
Definition at line 1345 of file phy-entity.cc.
References ns3::DbmToW(), ns3::WifiPhy::GetTxGain(), ns3::WifiPhy::GetTxPowerForTransmission(), GetTxPowerSpectralDensity(), m_wifiPhy, NS_LOG_FUNCTION, and Transmit().
Referenced by ns3::HePhy::StartTx().
Check if PHY state should move to CCA busy state based on current state of interference tracker.
ppdu | the incoming PPDU or nullptr for any signal |
Reimplemented in ns3::HePhy.
Definition at line 1279 of file phy-entity.cc.
References GetCcaIndication(), m_state, NS_LOG_DEBUG, ns3::Time::S, and SwitchMaybeToCcaBusy().
Referenced by SwitchMaybeToCcaBusy().
void ns3::PhyEntity::Transmit | ( | Time | txDuration, |
Ptr< const WifiPpdu > | ppdu, | ||
dBm_u | txPower, | ||
Ptr< SpectrumValue > | txPowerSpectrum, | ||
const std::string & | type ) |
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPhy's Transmit method.
txDuration | the duration of the transmission |
ppdu | the PPDU to send |
txPower | the total TX power |
txPowerSpectrum | the TX PSD |
type | the type of transmission (for logging) |
Definition at line 1355 of file phy-entity.cc.
References ns3::Create(), ns3::DynamicCast(), ns3::WifiPhy::GetChannelNumber(), ns3::Integral(), m_wifiPhy, ns3::Time::MS, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WToDbm().
Referenced by ns3::HePhy::StartTx(), StartTx(), and ns3::HePhy::StartTxHePortion().
|
protected |
the end of MAC header events
Definition at line 947 of file phy-entity.h.
Referenced by CancelAllEvents(), DoAbortCurrentReception(), NotifyInterferenceRxEndAndClear(), and ScheduleEndOfMpdus().
|
protected |
the end of MPDU events (only used for A-MPDUs)
Definition at line 946 of file phy-entity.h.
Referenced by CancelAllEvents(), ns3::HePhy::DoAbortCurrentReception(), DoAbortCurrentReception(), NotifyInterferenceRxEndAndClear(), and ScheduleEndOfMpdus().
|
protected |
the end of preamble detection events
Definition at line 945 of file phy-entity.h.
Referenced by CancelRunningEndPreambleDetectionEvents(), NoEndPreambleDetectionEvents(), and StartPreambleDetectionPeriod().
|
protected |
the end of receive events (only one unless UL MU reception)
Definition at line 950 of file phy-entity.h.
Referenced by CancelAllEvents(), ns3::HePhy::DoEndReceivePayload(), DoEndReceivePayload(), ns3::HePhy::DoStartReceivePayload(), DoStartReceivePayload(), EndReceiveField(), ResetReceive(), and ns3::HePhy::StartReceiveMuPayload().
|
staticprotected |
Global counter of the PPDU UID.
Definition at line 964 of file phy-entity.h.
Referenced by ns3::HePhy::ObtainNextUid(), ObtainNextUid(), MuMimoTestHePhy::SetGlobalPpduUid(), and OfdmaTestHePhy::SetGlobalPpduUid().
|
protected |
the list of supported modes
Definition at line 943 of file phy-entity.h.
Referenced by ns3::DsssPhy::DsssPhy(), ns3::ErpOfdmPhy::ErpOfdmPhy(), ns3::OfdmPhy::OfdmPhy(), ~PhyEntity(), begin(), ns3::EhtPhy::BuildModeList(), ns3::HePhy::BuildModeList(), ns3::HtPhy::BuildModeList(), ns3::VhtPhy::BuildModeList(), end(), ns3::HtPhy::GetMcs(), GetNumModes(), ns3::HtPhy::IsMcsSupported(), IsModeSupported(), ns3::HtPhy::SetMaxSupportedMcsIndexPerSs(), and ns3::HtPhy::SetMaxSupportedNss().
|
protected |
Map of the latest signal power and noise power in dBm (noise power includes the noise figure)
Definition at line 961 of file phy-entity.h.
Referenced by ns3::HePhy::DoStartReceivePayload(), DoStartReceivePayload(), EndOfMpdu(), EndReceivePayload(), NotifyInterferenceRxEndAndClear(), and ns3::HePhy::StartReceiveMuPayload().
|
protected |
Pointer to WifiPhyStateHelper of the WifiPhy (to make it reachable for child classes)
Definition at line 940 of file phy-entity.h.
Referenced by ns3::HePhy::DoEndReceivePayload(), DropPreambleEvent(), EndOfMpdu(), EndReceiveField(), EndReceivePayload(), ErasePreambleEvent(), ns3::HePhy::NotifyCcaBusy(), NotifyCcaBusy(), ns3::HePhy::RxPayloadFailed(), RxPayloadFailed(), ns3::HePhy::RxPayloadSucceeded(), RxPayloadSucceeded(), SetOwner(), StartReceivePayload(), StartReceivePreamble(), and SwitchMaybeToCcaBusy().
|
protected |
Map of the current reception status per MPDU that is filled in as long as MPDUs are being processed by the PHY in case of an A-MPDU.
Definition at line 958 of file phy-entity.h.
Referenced by ns3::HePhy::DoStartReceivePayload(), DoStartReceivePayload(), EndOfMpdu(), EndReceivePayload(), NotifyInterferenceRxEndAndClear(), and ns3::HePhy::StartReceiveMuPayload().
Pointer to the owning WifiPhy.
Definition at line 939 of file phy-entity.h.
Referenced by AbortCurrentReception(), AddPreambleEvent(), ns3::DsssPhy::BuildPpdu(), ns3::EhtPhy::BuildPpdu(), ns3::ErpOfdmPhy::BuildPpdu(), ns3::HePhy::BuildPpdu(), ns3::HtPhy::BuildPpdu(), ns3::OfdmPhy::BuildPpdu(), BuildPpdu(), ns3::VhtPhy::BuildPpdu(), ns3::HePhy::CanStartRx(), CanStartRx(), CreateInterferenceEvent(), DoAbortCurrentReception(), ns3::HePhy::DoEndReceivePayload(), DoEndReceivePayload(), DoEndReceivePreamble(), ns3::HePhy::DoStartReceivePayload(), DoStartReceivePayload(), DropPreambleEvent(), EndPreambleDetectionPeriod(), EndReceiveField(), EndReceivePayload(), ErasePreambleEvent(), ns3::HePhy::GetBssColor(), ns3::HtPhy::GetCcaIndication(), ns3::VhtPhy::GetCcaIndication(), ns3::OfdmPhy::GetCcaThreshold(), GetCcaThreshold(), ns3::VhtPhy::GetCcaThreshold(), ns3::HePhy::GetCenterFrequenciesForNonHePart(), GetCurrentEvent(), GetCurrentPreambleEvents(), GetDelayUntilCcaEnd(), GetGuardBandwidth(), ns3::HePhy::GetMaxDelayPpduSameUid(), ns3::OfdmPhy::GetMeasurementChannelWidth(), ns3::HePhy::GetNonOfdmaBand(), ns3::HePhy::GetPer20MHzDurations(), GetPhyHeaderSnrPer(), GetPrimaryBand(), GetRandomValue(), GetReceptionStatus(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), ns3::DsssPhy::GetRxChannelWidth(), GetRxChannelWidth(), ns3::OfdmPhy::GetRxPpduFromTxPpdu(), GetSecondaryBand(), ns3::EhtPhy::GetSigBSize(), ns3::HePhy::GetSigBSize(), ns3::HePhy::GetStaId(), GetTxMaskRejectionParams(), ns3::HePhy::GetTxPowerSpectralDensity(), ns3::HePhy::HandleRxPpduWithSameContent(), HandleRxPpduWithSameContent(), ns3::OfdmPhy::IsChannelWidthSupported(), ns3::HePhy::IsConfigSupported(), ns3::HtPhy::IsConfigSupported(), NotifyInterferenceRxEndAndClear(), NotifyPayloadBegin(), ns3::HePhy::ObtainNextUid(), ResetReceive(), ScheduleEndOfMpdus(), SetOwner(), ns3::HePhy::SetTrigVector(), StartPreambleDetectionPeriod(), StartReceiveField(), StartReceivePayload(), StartReceivePreamble(), ns3::HePhy::StartTx(), StartTx(), and Transmit().