|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #include "ns3/event-id.h"
33 #include "ns3/simple-ref-count.h"
34 #include "ns3/nstime.h"
35 #include "ns3/wifi-spectrum-value-helper.h"
220 std::list<WifiMode>::const_iterator
begin (
void)
const;
226 std::list<WifiMode>::const_iterator
end (
void)
const;
271 bool incFlag, uint32_t &totalAmpduSize,
double &totalAmpduNumSymbols,
272 uint16_t staId)
const = 0;
477 typedef std::map<WifiPreamble, std::vector<WifiPpduField> >
PpduFormats;
624 Time relativeMpduStart,
double noise
noise power in dBm
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
virtual uint16_t GetRxChannelWidth(const WifiTxVector &txVector) const
Return the channel width used in the reception spectrum model.
PhyHeaderSections GetPhyHeaderSections(const WifiTxVector &txVector, Time ppduStart) const
Return a map of PHY header chunk information per PPDU field.
void StartPreambleDetectionPeriod(Ptr< Event > event)
Start the preamble detection period.
Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector) const
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 ...
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 recepti...
std::list< WifiMode > m_modeList
the list of supported modes
void EndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field.
virtual void DoResetReceive(Ptr< Event > event)
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after ...
std::map< UidStaIdPair, SignalNoiseDbm > m_signalNoiseMap
Map of the latest signal power and noise power in dBm (noise power includes the noise figure)
uint16_t GetCenterFrequencyForChannelWidth(const WifiTxVector &txVector) const
Get the center frequency of the channel corresponding the current TxVector rather than that of the su...
void EndPreambleDetectionPeriod(Ptr< Event > event)
End the preamble detection period.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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 b...
std::pair< bool, SignalNoiseDbm > GetReceptionStatus(Ptr< const WifiPsdu > psdu, Ptr< Event > event, uint16_t staId, Time relativeMpduStart, Time mpduDuration)
Get the reception status for the provided MPDU and notify.
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
double snr
SNR in linear scale.
void EndReceivePayload(Ptr< Event > event)
The last symbol of the PPDU has arrived.
std::list< WifiMode >::const_iterator begin(void) const
Return a const iterator to the first WifiMode.
virtual Time CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector &txVector, WifiPhyBand band) const
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
virtual bool IsModeSupported(WifiMode mode) const
Check if the WifiMode is supported.
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Ptr< Event > CreateInterferenceEvent(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartOfdmaRxing=false)
Create an event using WifiPhy's InterferenceHelper class.
A template-based reference counting class.
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.
handles interference calculations
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.
double GetRxPowerWForPpdu(Ptr< Event > event) const
Obtain the received power (W) for a given band.
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
@ ABORT
abort reception of PPDU
virtual Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW)
Get the event corresponding to the incoming PPDU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
void CancelRunningEndPreambleDetectionEvents(bool clear=false)
Cancel and eventually clear all end preamble detection events.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
virtual void StartTx(Ptr< WifiPpdu > ppdu)
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
void AddPreambleEvent(Ptr< Event > event)
Add an entry to the map of current preamble events (stored in WifiPhy).
void Transmit(Time txDuration, Ptr< WifiPpdu > ppdu, std::string type)
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPh...
SignalNoiseDbm structure.
std::map< WifiPpduField, PhyHeaderChunkInfo > PhyHeaderSections
A map of PhyHeaderChunkInfo elements per PPDU field.
virtual Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const =0
uint32_t mpduRefNumber
MPDU ref number.
std::pair< uint64_t, uint16_t > UidStaIdPair
A pair of a UID and STA_ID.
std::list< WifiMode >::const_iterator end(void) const
Return a const iterator to past-the-last WifiMode.
virtual uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const
Return the channel width used to measure the RSSI.
This objects implements the PHY state machine of the Wifi device.
virtual bool IsMcsSupported(uint8_t index) const
Check if the WifiMode corresponding to the given MCS index is supported.
@ IGNORE
ignore the reception
const std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & GetCurrentPreambleEvents(void) const
Get the map of current preamble events (stored in WifiPhy).
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Ptr< const Event > GetCurrentEvent(void) const
Get the pointer to the current event (stored in WifiPhy).
SnrPer(double s, double p)
Constructor for SnrPer.
represent a single transmission mode
WifiPhyRxfailureReason reason
failure reason
Status of the reception of the PPDU field.
void StartReceiveField(WifiPpduField field, Ptr< Event > event)
Start receiving a given field.
void EndOfMpdu(Ptr< Event > event, Ptr< const WifiPsdu > psdu, size_t mpduIndex, Time relativeStart, Time mpduDuration)
The last symbol of an MPDU in an A-MPDU has arrived.
void DropPreambleEvent(Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason, Time endRx, uint16_t measurementChannelWidth)
Drop the PPDU and the corresponding preamble detection event, but keep CCA busy state after the compl...
virtual void DoAbortCurrentReception(WifiPhyRxfailureReason reason)
Perform amendment-specific actions before aborting the current reception.
virtual std::pair< uint16_t, WifiSpectrumBand > GetChannelWidthAndBand(const WifiTxVector &txVector, uint16_t staId) const
Get the channel width and band to use (will be overloaded by child classes).
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
std::vector< EventId > m_endOfMpduEvents
the end of MPDU events (only used for A-MPDUs)
WifiPpduField GetNextField(WifiPpduField currentField, WifiPreamble preamble) const
Return the field following the provided one.
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.
virtual bool DoStartReceiveField(WifiPpduField field, Ptr< Event > event)
Start receiving a given field, perform amendment-specific actions, and signify if it is supported.
Simulation virtual time values and global simulation resolution.
virtual uint32_t GetMaxPsduSize(void) const =0
Get the maximum PSDU size in bytes.
Time GetDurationUpToField(WifiPpduField field, const WifiTxVector &txVector) const
Get the duration of the PPDU up to (but excluding) the given field.
virtual PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
std::pair< WifiCodeRate, uint16_t > CodeRateConstellationSizePair
A pair to hold modulation information: code rate and constellation size.
WifiPpduField
The type of PPDU field (grouped for convenience)
bool isSuccess
outcome (true if success) of the reception
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
bool NoEndPreambleDetectionEvents(void) const
double GetRandomValue(void) const
Obtain a random value from the WifiPhy's generator.
virtual Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration)
Build amendment-specific PPDU.
SnrPer GetPhyHeaderSnrPer(WifiPpduField field, Ptr< Event > event) const
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
SnrPer()
Default constructor.
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper of the WifiPhy (to make it reachable for child classes)
virtual bool HandlesMcsModes(void) const
Check if the WifiModes handled by this PHY are MCSs.
double snr
SNR in linear scale.
virtual void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Abort the current reception.
RxSignalInfo structure containing info on the received signal.
PhyFieldRxStatus(bool s, WifiPhyRxfailureReason r, PhyRxFailureAction a)
Constructor.
virtual uint8_t GetNumModes(void) const
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 transmissio...
void NotifyInterferenceRxEndAndClear(bool reset)
Notify WifiPhy's InterferenceHelper of the end of the reception, clear maps and end of MPDU event,...
Time GetRemainingDurationAfterField(Ptr< const WifiPpdu > ppdu, WifiPpduField field) const
Get the remaining duration of the PPDU after the end of the given field.
virtual WifiMode GetMcs(uint8_t index) const
Get the WifiMode corresponding to the given MCS index.
virtual void CancelAllEvents(void)
Cancel and clear all running events.
virtual Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
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 a...
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the PPDU under reception after it has failed the PHY header.
std::vector< EventId > m_endPreambleDetectionEvents
the end of preamble detection events
virtual void DoStartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
A struct for both SNR and PER.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
WifiPhyBand
Identifies the PHY band.
MpduType type
type of MPDU
double signal
signal strength in dBm
virtual WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const
Get the WifiMode for the SIG field specified by the PPDU field.
std::vector< EventId > m_endRxPayloadEvents
the end of receive events (only one unless UL MU reception)
virtual bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Abstract class for PHY entities.
std::tuple< double, double, double > GetTxMaskRejectionParams(void) 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
PhyRxFailureAction
Action to perform in case of RX failure.
virtual const PpduFormats & GetPpduFormats(void) const =0
Return the PPDU formats of the PHY.
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
void UpdateInterferenceEvent(Ptr< Event > event, const RxPowerWattPerChannelBand &rxPower)
Update an event in WifiPhy's InterferenceHelper class.
PhyFieldRxStatus(bool s)
Constructor setting outcome of reception.
handles interference calculations
@ DROP
drop PPDU and set CCA_BUSY
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
virtual ~PhyEntity()
Destructor for PHY entity.
MpduType
The type of an MPDU.