22 #include "ns3/abort.h"
23 #include "ns3/wifi-protection.h"
24 #include "ns3/wifi-acknowledgment.h"
38 static TypeId tid =
TypeId (
"ns3::WaveFrameExchangeManager")
40 .AddConstructor<WaveFrameExchangeManager> ()
41 .SetGroupName (
"Wave")
70 found = ConstCast<Packet> (item->GetPacket ())->PeekPacketTag (datatag);
75 return m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ());
88 WifiTxVector txMac =
m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ());
127 if (queue->IsEmpty ())
140 if (!mpdu->IsFragment () && !mpdu->GetHeader ().IsRetry ())
142 uint16_t sequence =
m_txMiddle->GetNextSequenceNumberFor (&mpdu->GetHeader ());
143 mpdu->GetHeader ().SetSequenceNumber (sequence);
150 if (!
TryAddMpdu (mpdu, txParams, remainingTime))
154 NS_LOG_DEBUG (
"Because the required transmission time exceeds the remainingTime = "
156 <<
", 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
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
WifiTxTimer m_txTimer
the timer set upon frame transmission
void SendMpduWithProtection(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
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.
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
WifiTxVector GetTxVector(void) const
bool IsAdaptable(void) const
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
bool TryAddMpdu(Ptr< const WifiMacQueueItem > 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 enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
virtual void NotifyChannelReleased(void)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
virtual void NotifyChannelAccessed(Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
WaveFrameExchangeManager()
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the DATA frame given the destination.
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoDispose(void)
Destructor implementation.
Ptr< ChannelCoordinator > m_coordinator
the channel coordinator
Ptr< ChannelScheduler > m_scheduler
the channel scheduler
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
virtual ~WaveFrameExchangeManager()
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
Ptr< ChannelScheduler > GetChannelScheduler(void) const
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
uint8_t GetChannelNumber(void) const
Return current channel number.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void Cancel(void)
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.
uint8_t GetTxPowerLevel(void) const
WifiPreamble GetPreambleType(void) const
uint16_t GetChannelWidth(void) 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.