|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef FRAME_EXCHANGE_MANAGER_H
22 #define FRAME_EXCHANGE_MANAGER_H
24 #include "ns3/object.h"
35 #include "ns3/wifi-protection-manager.h"
36 #include "ns3/wifi-ack-manager.h"
42 struct WifiProtection;
43 struct WifiAcknowledgment;
303 const WifiTxVector& txVector,
const std::vector<bool>& perMpduStatus);
469 Time response)
const;
544 virtual void Reset (
void);
virtual void CalculateAcknowledgmentTime(WifiAcknowledgment *acknowledgment) const
Calculate the time required to acknowledge a frame according to the given acknowledgment method.
a unique identifier for an interface.
virtual void RetransmitMpduAfterMissedAck(Ptr< WifiMacQueueItem > mpdu) const
Retransmit an MPDU that was not acknowledged.
virtual void SetChannelAccessManager(const Ptr< ChannelAccessManager > channelAccessManager)
Set the channel access manager to use.
WifiTxTimer m_txTimer
the timer set upon frame transmission
virtual void ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, bool inAmpdu)
This method handles the reception of an MPDU (possibly included in an A-MPDU)
Ptr< WifiPhy > m_phy
the PHY layer on this station
virtual void NotifyInternalCollision(Ptr< Txop > txop)
Notify that an internal collision has occurred for the given Txop.
bool m_moreFragments
true if a fragment has to be sent after a SIFS
virtual void ResetPhy(void)
Remove WifiPhy associated with this FrameExchangeManager.
virtual Time GetRtsDurationId(const WifiTxVector &rtsTxVector, Time txDuration, Time response) const
Compute how to set the Duration/ID field of an RTS frame to send to protect a frame transmitted with ...
An identifier for simulation events.
void SendNormalAck(const WifiMacHeader &hdr, const WifiTxVector &dataTxVector, double dataSnr)
Send Normal Ack.
virtual void SetMacTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set the MAC TX Middle to use.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void SetAckManager(Ptr< WifiAckManager > ackManager)
Set the Acknowledgment Manager to use.
virtual void CalculateProtectionTime(WifiProtection *protection) const
Calculate the time required to protect a frame according to the given protection method.
Ptr< WifiProtectionManager > m_protectionManager
Protection manager.
void SendCtsToSelf(const WifiTxParameters &txParams)
Send CTS for a CTS-to-self mechanism.
virtual void NavResetTimeout(void)
Reset the NAV upon expiration of the NAV reset timer.
virtual void UpdateNav(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Update the NAV, if needed, based on the Duration/ID of the given psdu.
Ptr< ChannelAccessManager > m_channelAccessManager
the channel access manager
Ptr< WifiMacQueueItem > GetNextFragment(void)
Get the next fragment of the current MSDU.
virtual void SetProtectionManager(Ptr< WifiProtectionManager > protectionManager)
Set the Protection Manager to use.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void CtsTimeout(Ptr< WifiMacQueueItem > rts, const WifiTxVector &txVector)
Called when the CTS timeout expires.
void NotifyOffNow(void)
This method is typically invoked by the PhyListener to notify the MAC layer that the device has been ...
Mac48Address m_self
the MAC address of this device
virtual Time GetCtsToSelfDurationId(const WifiTxVector &ctsTxVector, Time txDuration, Time response) const
Compute how to set the Duration/ID field of a CTS-to-self frame to send to protect a frame transmitte...
Callback< void, WifiMacDropReason, Ptr< const WifiMacQueueItem > > DroppedMpdu
typedef for a callback to invoke when an MPDU is dropped.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
virtual void SetMacRxMiddle(const Ptr< MacRxMiddle > rxMiddle)
Set the MAC RX Middle to use.
void NotifySleepNow(void)
This method is typically invoked by the PhyListener to notify the MAC layer that the device has been ...
AckedMpdu m_ackedMpduCallback
the acknowledged MPDU callback
DroppedMpdu m_droppedMpduCallback
the dropped MPDU callback
void DoSendCtsAfterRts(const WifiMacHeader &rtsHdr, WifiTxVector &ctsTxVector, double rtsSnr)
Send CTS after receiving RTS.
void SetAckedMpduCallback(AckedMpdu callback)
Set the callback to invoke when an MPDU is successfully acked.
virtual void NotifyPacketDiscarded(Ptr< const WifiMacQueueItem > mpdu)
Pass the given MPDU, discarded because of the max retry limit was reached, to the MPDU dropped callba...
Ptr< WifiMacQueueItem > GetFirstFragmentIfNeeded(Ptr< WifiMacQueueItem > mpdu)
Fragment the given MPDU if needed.
Ptr< WifiProtectionManager > GetProtectionManager(void) const
Get the Protection Manager used by this node.
void SendRts(const WifiTxParameters &txParams)
Send RTS to begin RTS-CTS-Data-Ack transaction.
virtual void TransmissionSucceeded(void)
Take necessary actions upon a transmission success.
void Receive(Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
This method is intended to be called by the PHY layer every time an MPDU is received and also when th...
WifiTxParameters m_txParams
the TX parameters for the current frame
represent a single transmission mode
bool IsPromisc(void) const
Check if the device is operating in promiscuous mode.
virtual void SetWifiMac(const Ptr< RegularWifiMac > mac)
Set the MAC layer to use.
Callback< void, Ptr< const WifiMacQueueItem > > AckedMpdu
typedef for a callback to invoke when an MPDU is successfully acknowledged.
A base class which provides memory management and object aggregation.
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
Set the callback to invoke when an MPDU is dropped.
virtual Time GetTxDuration(uint32_t ppduPayloadSize, Mac48Address receiver, const WifiTxParameters &txParams) const
Get the updated TX duration of the frame associated with the given TX parameters if the size of the P...
virtual void SetAddress(Mac48Address address)
Set the MAC address.
Ptr< MacRxMiddle > m_rxMiddle
the MAC RX Middle on this station
Ptr< WifiMacQueueItem > m_mpdu
the MPDU being transmitted
virtual void SetWifiPhy(const Ptr< WifiPhy > phy)
Set the PHY layer to use.
Simulation virtual time values and global simulation resolution.
void SetPromisc(void)
Enable promiscuous mode.
WifiProtection is an abstract base struct.
virtual void Reset(void)
Reset this frame exchange manager.
virtual Time GetFrameDurationId(const WifiMacHeader &header, uint32_t size, const WifiTxParameters &txParams, Ptr< Packet > fragmentedPacket) const
Compute how to set the Duration/ID field of a frame being transmitted with the given TX parameters.
Time m_navEnd
NAV expiration time.
Ptr< WifiAckManager > GetAckManager(void) const
Get the Acknowledgment Manager used by this node.
virtual void DequeueMpdu(Ptr< const WifiMacQueueItem > mpdu)
Dequeue the given MPDU from the queue in which it is stored.
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
EventId m_navResetEvent
the event to reset the NAV after an RTS
void NotifySwitchingStartNow(Time duration)
Ptr< WifiAckManager > m_ackManager
Acknowledgment manager.
void UpdateTxDuration(Mac48Address receiver, WifiTxParameters &txParams) const
Update the TX duration field of the given TX parameters after that the PSDU addressed to the given re...
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
RxSignalInfo structure containing info on the received signal.
bool m_promisc
Flag if the device is operating in promiscuous mode.
WifiAcknowledgment is an abstract base struct.
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
virtual void NotifyReceivedNormalAck(Ptr< WifiMacQueueItem > mpdu)
Notify other components that an MPDU was acknowledged.
void SendMpduWithProtection(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
Ptr< RegularWifiMac > m_mac
the MAC layer on this station
Mac48Address m_bssid
BSSID address (Mac48Address)
virtual void TransmissionFailed(void)
Take necessary actions upon a transmission failure.
virtual void ForwardMpduDown(Ptr< WifiMacQueueItem > mpdu, WifiTxVector &txVector)
Forward an MPDU down to the PHY layer.
void DoDispose() override
Destructor implementation.
void RxStartIndication(WifiTxVector txVector, Time psduDuration)
virtual void RetransmitMpduAfterMissedCts(Ptr< WifiMacQueueItem > mpdu) const
Retransmit an MPDU that was not sent because a CTS was not received.
void SendCtsAfterRts(const WifiMacHeader &rtsHdr, WifiMode rtsTxMode, double rtsSnr)
Send CTS after receiving RTS.
virtual ~FrameExchangeManager()
const WifiTxTimer & GetWifiTxTimer(void) const
Get a const reference to the WifiTxTimer object.
virtual void EndReceiveAmpdu(Ptr< const WifiPsdu > psdu, const RxSignalInfo &rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &perMpduStatus)
This method is called when the reception of an A-MPDU including multiple MPDUs is completed.
virtual void ReceivedNormalAck(Ptr< WifiMacQueueItem > mpdu, const WifiTxVector &txVector, const WifiTxVector &ackTxVector, const RxSignalInfo &rxInfo, double snr)
Perform the actions needed when a Normal Ack is received.
virtual void SetBssid(Mac48Address bssid)
Set the Basic Service Set Identification.
virtual void PreProcessFrame(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Perform actions that are possibly needed when receiving any frame, independently of whether the frame...
void SendMpdu(void)
Send the current MPDU, which can be acknowledged by a Normal Ack.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< Packet > m_fragmentedPacket
the MSDU being fragmented
This class is used to handle the timer that a station starts when transmitting a frame that solicits ...
void NormalAckTimeout(Ptr< WifiMacQueueItem > mpdu, const WifiTxVector &txVector)
Called when the Ack timeout expires.
Ptr< Txop > m_dcf
the DCF/EDCAF that gained channel access