24 #include "ns3/abort.h"
26 #include "ns3/qos-blocked-destinations.h"
27 #include "ns3/wifi-acknowledgment.h"
28 #include "ns3/wifi-protection.h"
40 static TypeId tid =
TypeId(
"ns3::WaveFrameExchangeManager")
42 .AddConstructor<WaveFrameExchangeManager>()
43 .SetGroupName(
"Wave");
71 found = ConstCast<Packet>(item->GetPacket())->PeekPacketTag(datatag);
132 if (queue->IsEmpty())
145 if (!mpdu->IsFragment() && !mpdu->GetHeader().IsRetry())
147 uint16_t sequence =
m_txMiddle->GetNextSequenceNumberFor(&mpdu->GetHeader());
148 mpdu->GetHeader().SetSequenceNumber(sequence);
155 if (!
TryAddMpdu(mpdu, txParams, remainingTime))
159 NS_LOG_DEBUG(
"Because the required transmission time exceeds the remainingTime = "
161 <<
", currently this packet will not be transmitted.");
Time NeedTimeToGuardInterval(Time duration=Seconds(0.0)) const
Ptr< WifiMac > m_mac
the MAC layer on this station
void SendMpduWithProtection(Ptr< WifiMpdu > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
uint16_t m_allowedWidth
the allowed width in MHz for the current transmission
WifiTxTimer m_txTimer
the timer set upon frame transmission
Ptr< Txop > m_dcf
the DCF/EDCAF that gained channel access
Ptr< WifiPhy > m_phy
the PHY layer on this station
void DoDispose() override
Destructor implementation.
virtual bool StartTransmission(Ptr< Txop > dcf, uint16_t allowedWidth)
Request the FrameExchangeManager to start a frame exchange sequence.
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
WifiTxVector GetTxVector() const
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
bool TryAddMpdu(Ptr< const WifiMpdu > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
virtual void NotifyChannelReleased(uint8_t linkId)
Called by the FrameExchangeManager to notify the completion of the transmissions.
virtual void NotifyChannelAccessed(uint8_t linkId, Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted on the given link f...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
WaveFrameExchangeManager()
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
~WaveFrameExchangeManager() override
static TypeId GetTypeId()
Get the type ID.
Ptr< ChannelCoordinator > m_coordinator
the channel coordinator
bool StartTransmission(Ptr< Txop > dcf, uint16_t allowedWidth) override
Request the FrameExchangeManager to start a frame exchange sequence.
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMpdu > item) const
Return a TXVECTOR for the DATA frame given the destination.
Ptr< ChannelScheduler > m_scheduler
the channel scheduler
void DoDispose() override
Destructor implementation.
Ptr< ChannelScheduler > GetChannelScheduler() const
Ptr< ChannelCoordinator > GetChannelCoordinator() const
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
uint8_t GetChannelNumber() const
Return current channel number.
WifiTxVector GetDataTxVector(const WifiMacHeader &header, uint16_t allowedWidth)
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void Cancel()
Cancel the timer.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
WifiPreamble GetPreambleType() const
uint8_t GetTxPowerLevel() const
uint16_t GetChannelWidth() const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.