A Discrete-Event Network Simulator
API
ns3::MacLow Class Reference

handle RTS/CTS/DATA/ACK transactions. More...

#include "mac-low.h"

+ Inheritance diagram for ns3::MacLow:
+ Collaboration diagram for ns3::MacLow:

Classes

struct  CfAckInfo
 A struct that holds information about ACK piggybacking (CF-ACK). More...
 

Public Types

typedef Callback< void, Ptr< Packet >, const WifiMacHeader * > MacLowRxCallback
 typedef for a callback for MacLowRx More...
 

Public Member Functions

 MacLow ()
 
virtual ~MacLow ()
 
Time CalculateOverallTxTime (Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
 
Time CalculateOverheadTxTime (Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters &params) const
 
Time CalculateTransmissionTime (Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
 
bool CanTransmitNextCfFrame (void) const
 This function decides if a CF frame can be transmitted in the current CFP. More...
 
void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
 
void DeaggregateAmpduAndReceive (Ptr< Packet > aggregatedPacket, double rxSnr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 
void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid)
 
bool DoNavStartNow (Time duration)
 Start NAV with the given duration. More...
 
Time GetAckTimeout (void) const
 Return ACK timeout of this MacLow. More...
 
Mac48Address GetAddress (void) const
 Return the MAC address of this MacLow. More...
 
Time GetBasicBlockAckTimeout (void) const
 Return Basic Block ACK timeout of this MacLow. More...
 
Time GetBeaconInterval (void) const
 
Mac48Address GetBssid (void) const
 Return the Basic Service Set Identification. More...
 
Time GetCfpMaxDuration (void) const
 
Time GetCompressedBlockAckTimeout (void) const
 Return Compressed Block ACK timeout of this MacLow. More...
 
Time GetCtsTimeout (void) const
 Return CTS timeout of this MacLow. More...
 
bool GetCtsToSelfSupported (void) const
 Return whether CTS-to-self capability is supported. More...
 
virtual WifiTxVector GetDataTxVector (Ptr< const WifiMacQueueItem > item) const
 Return a TXVECTOR for the DATA frame given the destination. More...
 
Ptr< MpduAggregatorGetMpduAggregator (void) const
 Returns the aggregator used to construct A-MPDU subframes. More...
 
Ptr< MsduAggregatorGetMsduAggregator (void) const
 Returns the aggregator used to construct A-MSDU subframes. More...
 
Ptr< WifiPhyGetPhy (void) const
 
Time GetPifs (void) const
 Return PCF Interframe Space (PIFS) of this MacLow. More...
 
Time GetRemainingCfpDuration (void) const
 
Time GetRifs (void) const
 Return Reduced Interframe Space (RIFS) of this MacLow. More...
 
Time GetSifs (void) const
 Return Short Interframe Space (SIFS) of this MacLow. More...
 
Time GetSlotTime (void) const
 Return slot duration of this MacLow. More...
 
virtual bool IsCfPeriod (void) const
 This function indicates whether it is the CF period. More...
 
bool IsPromisc (void) const
 Check if MacLow is operating in promiscuous mode. More...
 
bool IsWithinSizeAndTimeLimits (Ptr< const WifiMacQueueItem > mpdu, WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit)
 Check whether the given MPDU, if transmitted according to the given TX vector, meets the constraint on the maximum A-MPDU size (by assuming that the frame has to be aggregated to an existing A-MPDU of the given size) and its transmission time exceeds neither the max PPDU duration (depending on the PPDU format) nor the given PPDU duration limit (if strictly positive). More...
 
bool IsWithinSizeAndTimeLimits (uint32_t mpduSize, Mac48Address receiver, uint8_t tid, WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit)
 Check whether an MPDU of the given size, destined to the given receiver and belonging to the given TID, if transmitted according to the given TX vector, meets the constraint on the maximum A-MPDU size (by assuming that the frame has to be aggregated to an existing A-MPDU of the given size) and its transmission time exceeds neither the max PPDU duration (depending on the PPDU format) nor the given PPDU duration limit (if strictly positive). More...
 
void NotifyOffNow (void)
 This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has been put into off mode. More...
 
void NotifySleepNow (void)
 This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has been put into sleep mode. More...
 
void NotifySwitchingStartNow (Time duration)
 
void ReceiveError (Ptr< Packet > packet)
 
void ReceiveOk (Ptr< Packet > packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
 
void RegisterDcf (Ptr< ChannelAccessManager > dcf)
 
void RegisterEdcaForAc (AcIndex ac, Ptr< QosTxop > edca)
 
void ResetPhy (void)
 Remove WifiPhy associated with this MacLow. More...
 
void SetAckTimeout (Time ackTimeout)
 Set ACK timeout of this MacLow. More...
 
void SetAddress (Mac48Address ad)
 Set MAC address of this MacLow. More...
 
void SetBasicBlockAckTimeout (Time blockAckTimeout)
 Set Basic Block ACK timeout of this MacLow. More...
 
void SetBeaconInterval (Time interval)
 
void SetBssid (Mac48Address ad)
 Set the Basic Service Set Identification. More...
 
void SetCfpMaxDuration (Time duration)
 
void SetCompressedBlockAckTimeout (Time blockAckTimeout)
 Set Compressed Block ACK timeout of this MacLow. More...
 
void SetCtsTimeout (Time ctsTimeout)
 Set CTS timeout of this MacLow. More...
 
void SetCtsToSelfSupported (bool enable)
 Enable or disable CTS-to-self capability. More...
 
void SetMac (const Ptr< WifiMac > mac)
 Set up WifiMac associated with this MacLow. More...
 
void SetMpduAggregator (const Ptr< MpduAggregator > aggr)
 Set the aggregator used to construct A-MPDU subframes. More...
 
void SetMsduAggregator (const Ptr< MsduAggregator > aggr)
 Set the aggregator used to construct A-MSDU subframes. More...
 
void SetPhy (const Ptr< WifiPhy > phy)
 Set up WifiPhy associated with this MacLow. More...
 
void SetPifs (Time pifs)
 Set PCF Interframe Space (PIFS) of this MacLow. More...
 
void SetPromisc (void)
 Enable promiscuous mode. More...
 
void SetRifs (Time rifs)
 Set Reduced Interframe Space (RIFS) of this MacLow. More...
 
void SetRxCallback (Callback< void, Ptr< Packet >, const WifiMacHeader *> callback)
 
void SetSifs (Time sifs)
 Set Short Interframe Space (SIFS) of this MacLow. More...
 
void SetSlotTime (Time slotTime)
 Set slot duration of this MacLow. More...
 
void SetWifiRemoteStationManager (const Ptr< WifiRemoteStationManager > manager)
 Set up WifiRemoteStationManager associated with this MacLow. More...
 
virtual void StartTransmission (Ptr< WifiMacQueueItem > mpdu, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Types

typedef std::pair< Mac48Address, uint8_t > AgreementKey
 agreement key typedef More...
 
typedef std::map< AgreementKey, AgreementValueAgreements
 agreements More...
 
typedef std::map< AgreementKey, AgreementValue >::iterator AgreementsI
 agreements iterator More...
 
typedef std::pair< BlockAckAgreement, std::list< BufferedPacket > > AgreementValue
 agreement value typedef More...
 
typedef std::map< AgreementKey, BlockAckCacheBlockAckCaches
 block ack caches typedef More...
 
typedef std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
 block ack caches iterator typedef More...
 
typedef std::pair< Ptr< Packet >, WifiMacHeaderBufferedPacket
 buffered packet typedef More...
 
typedef std::list< BufferedPacket >::iterator BufferedPacketI
 buffered packet iterator typedef More...
 
typedef std::vector< Ptr< ChannelAccessManager > > ChannelAccessManagers
 typedef for a list of ChannelAccessManager. More...
 
typedef std::vector< Ptr< ChannelAccessManager > >::const_iterator ChannelAccessManagersCI
 typedef for an iterator for a list of ChannelAccessManager. More...
 
typedef std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
 EDCA queues typedef. More...
 

Private Member Functions

void BlockAckTimeout (void)
 Event handler when block ACK timeout occurs. More...
 
void CancelAllEvents (void)
 Cancel all scheduled events. More...
 
void CfPollTimeout (void)
 Event handler when CF-POLL timeout occurs. More...
 
void CtsTimeout (void)
 Event handler when CTS timeout occurs. More...
 
void DoDispose (void)
 Destructor implementation. More...
 
void DoNavResetNow (Time duration)
 Reset NAV with the given duration. More...
 
void EndTxNoAck (void)
 A transmission that does not require an ACK has completed. More...
 
void ForwardDown (Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
 Forward a PSDU down to WifiPhy for transmission. More...
 
Time GetAckDuration (WifiTxVector ackTxVector) const
 Return the time required to transmit the ACK (including preamble and FCS). More...
 
Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const
 Return the time required to transmit the ACK to the specified address given the TXVECTOR of the DATA (including preamble and FCS). More...
 
WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const
 Return a TXVECTOR for the ACK frame given the destination and the mode of the DATA used by the sender. More...
 
WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const
 Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA used by the sender. More...
 
Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const
 Return the time required to transmit the Block ACK to the specified address given the TXVECTOR of the BAR (including preamble and FCS). More...
 
WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const
 Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA used by the sender. More...
 
uint32_t GetCfEndSize (void) const
 Return the total CF-END size (including FCS trailer). More...
 
WifiMode GetControlAnswerMode (WifiMode reqMode) const
 Get control answer mode function. More...
 
Time GetCtsDuration (WifiTxVector ctsTxVector) const
 Return the time required to transmit the CTS (including preamble and FCS). More...
 
Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const
 Return the time required to transmit the CTS to the specified address given the TXVECTOR of the RTS (including preamble and FCS). More...
 
WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const
 Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender. More...
 
WifiTxVector GetCtsTxVectorForRts (Mac48Address to, WifiMode rtsTxMode) const
 Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender. More...
 
WifiTxVector GetRtsTxVector (Ptr< const WifiMacQueueItem > item) const
 Return a TXVECTOR for the RTS frame given the destination. More...
 
bool IsNavZero (void) const
 Check if NAV is zero. More...
 
void NavCounterResetCtsMissed (Time rtsEndRxTime)
 Reset NAV after CTS was missed when the NAV was set with RTS. More...
 
bool NeedCtsToSelf (void) const
 Check if CTS-to-self mechanism should be used for the current packet. More...
 
void NormalAckTimeout (void)
 Event handler when normal ACK timeout occurs. More...
 
void NotifyAckTimeoutResetNow (void)
 Notify ChannelAccessManager that ACK timer should be reset. More...
 
void NotifyAckTimeoutStartNow (Time duration)
 Notify ChannelAccessManager that ACK timer should be started for the given duration. More...
 
void NotifyCtsTimeoutResetNow (void)
 Notify ChannelAccessManager that CTS timer should be reset. More...
 
void NotifyCtsTimeoutStartNow (Time duration)
 Notify ChannelAccessManager that CTS timer should be started for the given duration. More...
 
void NotifyNav (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 Notify NAV function. More...
 
bool ReceiveMpdu (Ptr< Packet > packet, WifiMacHeader hdr)
 
void RemovePhyMacLowListener (Ptr< WifiPhy > phy)
 Remove current WifiPhy listener for this MacLow. More...
 
void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement)
 Every time that a block ack request or a packet with ack policy equals to block ack are received, if a relative block ack agreement exists and the value of inactivity timeout is not 0, the timer is reset. More...
 
void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid)
 
void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid)
 
void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
 Send ACK after receiving DATA. More...
 
void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr)
 Invoked after an A-MPDU has been received. More...
 
void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac48Address originator, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
 Invoked after that a block ack request has been received. More...
 
void SendBlockAckResponse (const CtrlBAckResponseHeader *blockAck, Mac48Address originator, bool immediate, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
 This method creates block ack frame with header equals to blockAck and start its transmission. More...
 
void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
 Send CTS after receiving RTS. More...
 
void SendCtsToSelf (void)
 Send CTS for a CTS-to-self mechanism. More...
 
void SendDataAfterCts (Time duration)
 Send DATA after receiving CTS. More...
 
void SendDataPacket (void)
 Send DATA packet, which can be DATA-ACK or RTS-CTS-DATA-ACK transaction. More...
 
void SendRtsForPacket (void)
 Send RTS to begin RTS-CTS-DATA-ACK transaction. More...
 
void SetupPhyMacLowListener (const Ptr< WifiPhy > phy)
 Set up WifiPhy listener for this MacLow. More...
 
void StartDataTxTimers (WifiTxVector dataTxVector)
 Start a DATA timer by scheduling appropriate ACK timeout. More...
 
bool StoreMpduIfNeeded (Ptr< Packet > packet, WifiMacHeader hdr)
 
void WaitIfsAfterEndTxFragment (void)
 Event handler that is usually scheduled to fired at the appropriate time after completing transmissions. More...
 
void WaitIfsAfterEndTxPacket (void)
 Event handler that is usually scheduled to fired at the appropriate time after sending a packet. More...
 

Private Attributes

Time m_ackTimeout
 ACK timeout duration. More...
 
Agreements m_bAckAgreements
 block ack agreements More...
 
BlockAckCaches m_bAckCaches
 block ack caches More...
 
Time m_basicBlockAckTimeout
 Basic block ACK timeout duration. More...
 
Time m_beaconInterval
 Expected interval between two beacon transmissions. More...
 
EventId m_blockAckTimeoutEvent
 Block ACK timeout event. More...
 
Mac48Address m_bssid
 BSSID address (Mac48Address) More...
 
CfAckInfo m_cfAckInfo
 Info about piggyback ACKs used in PCF. More...
 
Time m_cfpForeshortening
 The delay the current CF period should be foreshortened. More...
 
Time m_cfpMaxDuration
 CFP max duration. More...
 
Time m_cfpStart
 The time when the latest CF period started. More...
 
ChannelAccessManagers m_channelAccessManagers
 List of ChannelAccessManager. More...
 
Time m_compressedBlockAckTimeout
 Compressed block ACK timeout duration. More...
 
Time m_ctsTimeout
 CTS timeout duration. More...
 
EventId m_ctsTimeoutEvent
 CTS timeout event. More...
 
bool m_ctsToSelfSupported
 Flag whether CTS-to-self is supported. More...
 
Ptr< WifiPsdum_currentPacket
 Current packet transmitted/to be transmitted. More...
 
Ptr< Txopm_currentTxop
 Current TXOP. More...
 
WifiTxVector m_currentTxVector
 TXVECTOR used for the current packet transmission. More...
 
QueueEdcas m_edca
 EDCA queues. More...
 
EventId m_endTxNoAckEvent
 Event for finishing transmission that does not require ACK. More...
 
Time m_lastBeacon
 The time when the last beacon frame transmission started. More...
 
Time m_lastNavDuration
 The duration of the latest NAV. More...
 
Time m_lastNavStart
 The time when the latest NAV started. More...
 
Ptr< WifiMacm_mac
 Pointer to WifiMac (to fetch configuration) More...
 
Ptr< MpduAggregatorm_mpduAggregator
 A-MPDU aggregator. More...
 
Ptr< MsduAggregatorm_msduAggregator
 A-MSDU aggregator. More...
 
EventId m_navCounterResetCtsMissed
 Event to reset NAV when CTS is not received. More...
 
EventId m_normalAckTimeoutEvent
 Normal ACK timeout event. More...
 
Ptr< WifiPhym_phy
 Pointer to WifiPhy (actually send/receives frames) More...
 
class PhyMacLowListenerm_phyMacLowListener
 Listener needed to monitor when a channel switching occurs. More...
 
Time m_pifs
 PCF Interframe Space (PIFS) duration. More...
 
bool m_promisc
 Flag if the device is operating in promiscuous mode. More...
 
Time m_rifs
 Reduced Interframe Space (RIFS) duration. More...
 
MacLowRxCallback m_rxCallback
 Callback to pass packet up. More...
 
Mac48Address m_self
 Address of this MacLow (Mac48Address) More...
 
EventId m_sendAckEvent
 Event to send ACK. More...
 
EventId m_sendCtsEvent
 Event to send CTS. More...
 
EventId m_sendDataEvent
 Event to send DATA. More...
 
Time m_sifs
 Short Interframe Space (SIFS) duration. More...
 
Time m_slotTime
 Slot duration. More...
 
Ptr< WifiRemoteStationManagerm_stationManager
 Pointer to WifiRemoteStationManager (rate control) More...
 
MacLowTransmissionParameters m_txParams
 Transmission parameters of the current packet. More...
 
EventId m_waitIfsEvent
 Wait for IFS event. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

handle RTS/CTS/DATA/ACK transactions.


Introspection did not find any typical Config paths.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 18446744073709551615 bytes (on a 64-bit architecture).

Definition at line 59 of file mac-low.h.

Member Typedef Documentation

◆ AgreementKey

typedef std::pair<Mac48Address, uint8_t> ns3::MacLow::AgreementKey
private

agreement key typedef

Definition at line 940 of file mac-low.h.

◆ Agreements

agreements

Definition at line 943 of file mac-low.h.

◆ AgreementsI

typedef std::map<AgreementKey, AgreementValue>::iterator ns3::MacLow::AgreementsI
private

agreements iterator

Definition at line 944 of file mac-low.h.

◆ AgreementValue

agreement value typedef

Definition at line 941 of file mac-low.h.

◆ BlockAckCaches

block ack caches typedef

Definition at line 946 of file mac-low.h.

◆ BlockAckCachesI

typedef std::map<AgreementKey, BlockAckCache>::iterator ns3::MacLow::BlockAckCachesI
private

block ack caches iterator typedef

Definition at line 947 of file mac-low.h.

◆ BufferedPacket

typedef std::pair<Ptr<Packet>, WifiMacHeader> ns3::MacLow::BufferedPacket
private

buffered packet typedef

Definition at line 937 of file mac-low.h.

◆ BufferedPacketI

buffered packet iterator typedef

Definition at line 938 of file mac-low.h.

◆ ChannelAccessManagers

typedef for a list of ChannelAccessManager.

Definition at line 890 of file mac-low.h.

◆ ChannelAccessManagersCI

typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ns3::MacLow::ChannelAccessManagersCI
private

typedef for an iterator for a list of ChannelAccessManager.

Definition at line 886 of file mac-low.h.

◆ MacLowRxCallback

typedef for a callback for MacLowRx

Definition at line 66 of file mac-low.h.

◆ QueueEdcas

typedef std::map<AcIndex, Ptr<QosTxop> > ns3::MacLow::QueueEdcas
private

EDCA queues typedef.

Definition at line 952 of file mac-low.h.

Constructor & Destructor Documentation

◆ MacLow()

ns3::MacLow::MacLow ( )

Definition at line 110 of file mac-low.cc.

References NS_LOG_FUNCTION.

◆ ~MacLow()

ns3::MacLow::~MacLow ( )
virtual

Definition at line 136 of file mac-low.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ BlockAckTimeout()

void ns3::MacLow::BlockAckTimeout ( void  )
private

Event handler when block ACK timeout occurs.

Definition at line 1720 of file mac-low.cc.

References m_currentPacket, m_currentTxop, ns3::Txop::MissedBlockAck(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateOverallTxTime()

Time ns3::MacLow::CalculateOverallTxTime ( Ptr< const Packet packet,
const WifiMacHeader hdr,
const MacLowTransmissionParameters params,
uint32_t  fragmentSize = 0 
) const
Parameters
packetto send (does not include the 802.11 MAC header and checksum)
hdrheader associated to the packet to send.
paramstransmission parameters of packet.
fragmentSizethe packet fragment size (if fragmentation is used)
Returns
the transmission time that includes the time for the next packet transmission

This transmission time does not include the time required for the next packet transmission if one was selected.

Definition at line 1413 of file mac-low.cc.

References CalculateOverheadTxTime(), ns3::WifiPhy::CalculateTxDuration(), GetDataTxVector(), ns3::WifiPhy::GetFrequency(), ns3::GetSize(), m_currentPacket, and m_phy.

Referenced by CalculateTransmissionTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateOverheadTxTime()

Time ns3::MacLow::CalculateOverheadTxTime ( Ptr< const WifiMacQueueItem item,
const MacLowTransmissionParameters params 
) const
Parameters
itempacket to send (does not include the 802.11 MAC header and checksum)
paramstransmission parameters of packet.

This transmission time does not include the time required to transmit the frame. It only includes the time for the RTS/CTS exchange (if any) and for the Ack frame (if any).

Definition at line 1435 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), GetAckDuration(), GetBlockAckDuration(), GetBlockAckTxVector(), ns3::MacLowTransmissionParameters::GetBlockAckType(), GetCtsDuration(), GetDataTxVector(), ns3::WifiPhy::GetFrequency(), ns3::WifiTxVector::GetMode(), ns3::GetRtsSize(), GetRtsTxVector(), GetSifs(), m_phy, ns3::MacLowTransmissionParameters::MustSendRts(), ns3::MacLowTransmissionParameters::MustWaitBlockAck(), ns3::MacLowTransmissionParameters::MustWaitNormalAck(), and ns3::Seconds().

Referenced by CalculateOverallTxTime(), and StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateTransmissionTime()

Time ns3::MacLow::CalculateTransmissionTime ( Ptr< const Packet packet,
const WifiMacHeader hdr,
const MacLowTransmissionParameters parameters 
) const
Parameters
packetto send (does not include the 802.11 MAC header and checksum)
hdrheader associated to the packet to send.
parameterstransmission parameters of packet.
Returns
the transmission time that includes the time for the next packet transmission

This transmission time includes the time required for the next packet transmission if one was selected.

Definition at line 1463 of file mac-low.cc.

References CalculateOverallTxTime(), ns3::WifiPhy::CalculateTxDuration(), GetDataTxVector(), ns3::WifiPhy::GetFrequency(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), GetSifs(), ns3::MacLowTransmissionParameters::HasNextPacket(), and m_phy.

Referenced by ns3::WaveMacLow::StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CancelAllEvents()

void ns3::MacLow::CancelAllEvents ( void  )
private

Cancel all scheduled events.

Called before beginning a transmission or switching channel.

Definition at line 195 of file mac-low.cc.

References ns3::EventId::Cancel(), ns3::Txop::Cancel(), ns3::EventId::IsRunning(), m_blockAckTimeoutEvent, m_ctsTimeoutEvent, m_currentTxop, m_endTxNoAckEvent, m_normalAckTimeoutEvent, m_sendAckEvent, m_sendCtsEvent, m_sendDataEvent, m_waitIfsEvent, and NS_LOG_FUNCTION.

Referenced by NotifyOffNow(), NotifySleepNow(), NotifySwitchingStartNow(), and StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanTransmitNextCfFrame()

bool ns3::MacLow::CanTransmitNextCfFrame ( void  ) const

◆ CfPollTimeout()

void ns3::MacLow::CfPollTimeout ( void  )
private

Event handler when CF-POLL timeout occurs.

Definition at line 1667 of file mac-low.cc.

References ns3::MacLow::CfAckInfo::expectCfAck, m_cfAckInfo, m_channelAccessManagers, m_currentTxop, ns3::Txop::MissedCfPollResponse(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ForwardDown().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateBlockAckAgreement()

void ns3::MacLow::CreateBlockAckAgreement ( const MgtAddBaResponseHeader respHdr,
Mac48Address  originator,
uint16_t  startingSeq 
)
Parameters
respHdrAdd block ack response from originator (action frame).
originatorAddress of peer station involved in block ack mechanism.
startingSeqSequence number of the first MPDU of all packets for which block ack was negotiated.

This function is typically invoked only by ns3::RegularWifiMac when the STA (which may be non-AP in ESS, or in an IBSS) has received an ADDBA Request frame and is transmitting an ADDBA Response frame. At this point MacLow must allocate buffers to collect all correctly received packets belonging to the category for which Block Ack was negotiated.

Definition at line 2233 of file mac-low.cc.

References ns3::MgtAddBaResponseHeader::GetBufferSize(), ns3::BlockAckAgreement::GetTid(), ns3::MgtAddBaResponseHeader::GetTid(), ns3::BlockAckAgreement::GetTimeout(), ns3::MgtAddBaResponseHeader::GetTimeout(), ns3::BlockAckCache::Init(), ns3::MgtAddBaResponseHeader::IsAmsduSupported(), ns3::MgtAddBaResponseHeader::IsImmediateBlockAck(), m_bAckAgreements, m_bAckCaches, m_edca, ns3::MicroSeconds(), NS_LOG_FUNCTION, ns3::QosUtilsMapTidToAc(), ns3::Simulator::Schedule(), ns3::QosTxop::SendDelbaFrame(), ns3::BlockAckAgreement::SetAmsduSupport(), ns3::BlockAckAgreement::SetBufferSize(), ns3::BlockAckAgreement::SetDelayedBlockAck(), ns3::BlockAckAgreement::SetImmediateBlockAck(), ns3::BlockAckAgreement::SetStartingSequence(), ns3::BlockAckAgreement::SetTimeout(), and timeout.

+ Here is the call graph for this function:

◆ CtsTimeout()

void ns3::MacLow::CtsTimeout ( void  )
private

Event handler when CTS timeout occurs.

Todo:
should check that there was no rx start before now. we should restart a new cts timeout now until the expected end of rx if there was a rx start before now.

Definition at line 1685 of file mac-low.cc.

References list, m_currentPacket, m_currentTxop, m_stationManager, ns3::Txop::MissedCts(), ns3::QosTxop::NotifyMissedCts(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WifiRemoteStationManager::ReportRtsFailed().

Referenced by SendRtsForPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeaggregateAmpduAndReceive()

void ns3::MacLow::DeaggregateAmpduAndReceive ( Ptr< Packet aggregatedPacket,
double  rxSnr,
WifiTxVector  txVector,
std::vector< bool >  statusPerMpdu 
)
Parameters
aggregatedPacketwhich is the current A-MPDU
rxSnrsnr of packet received
txVectorTXVECTOR of packet received
statusPerMpdureception status per MPDU

This function de-aggregates an A-MPDU and decide if each MPDU is received correctly or not

Definition at line 2561 of file mac-low.cc.

References ns3::MpduAggregator::Deaggregate(), GetSifs(), ns3::WifiTxVector::IsAggregation(), ns3::EventId::IsRunning(), m_bAckAgreements, m_self, m_sendAckEvent, sample-rng-plot::n, NotifyNav(), NS_ABORT_MSG_IF, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ReceiveOk(), ResetBlockAckInactivityTimerIfNeeded(), ns3::Simulator::Schedule(), and SendBlockAckAfterAmpdu().

Referenced by SetPhy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DestroyBlockAckAgreement()

void ns3::MacLow::DestroyBlockAckAgreement ( Mac48Address  originator,
uint8_t  tid 
)
Parameters
originatorAddress of peer participating in Block Ack mechanism.
tidTID for which Block Ack was created.

Checks if exists an established block ack agreement with originator for tid tid. If the agreement exists, tears down it. This function is typically invoked when a DELBA frame is received from originator.

Definition at line 2275 of file mac-low.cc.

References m_bAckAgreements, m_bAckCaches, NS_ASSERT, NS_LOG_FUNCTION, RxCompleteBufferedPacketsUntilFirstLost(), and RxCompleteBufferedPacketsWithSmallerSequence().

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::MacLow::DoDispose ( void  )
privatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 172 of file mac-low.cc.

References ns3::EventId::Cancel(), m_blockAckTimeoutEvent, m_ctsTimeoutEvent, m_endTxNoAckEvent, m_mpduAggregator, m_msduAggregator, m_normalAckTimeoutEvent, m_phy, m_phyMacLowListener, m_sendAckEvent, m_sendCtsEvent, m_sendDataEvent, m_stationManager, m_waitIfsEvent, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoNavResetNow()

void ns3::MacLow::DoNavResetNow ( Time  duration)
private

Reset NAV with the given duration.

Parameters
duration

Definition at line 1531 of file mac-low.cc.

References m_channelAccessManagers, m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by NavCounterResetCtsMissed(), and NotifyNav().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoNavStartNow()

bool ns3::MacLow::DoNavStartNow ( Time  duration)

Start NAV with the given duration.

Parameters
durationthe duration
Returns
true if NAV is reset

Definition at line 1543 of file mac-low.cc.

References m_channelAccessManagers, m_lastNavDuration, m_lastNavStart, and ns3::Simulator::Now().

Referenced by NotifyNav().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndTxNoAck()

void ns3::MacLow::EndTxNoAck ( void  )
private

A transmission that does not require an ACK has completed.

Definition at line 2111 of file mac-low.cc.

References ns3::Txop::EndTxNoAck(), ns3::MacLow::CfAckInfo::expectCfAck, ns3::WifiRemoteStationManager::GetPcfSupported(), IsCfPeriod(), m_cfAckInfo, m_cfpStart, m_currentPacket, m_currentTxop, m_stationManager, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForwardDown()

◆ GetAckDuration() [1/2]

Time ns3::MacLow::GetAckDuration ( WifiTxVector  ackTxVector) const
private

Return the time required to transmit the ACK (including preamble and FCS).

Parameters
ackTxVector
Returns
the time required to transmit the ACK (including preamble and FCS)

Definition at line 1166 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::GetAckSize(), ns3::WifiPhy::GetFrequency(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), m_phy, NS_ASSERT, and ns3::WIFI_MOD_CLASS_HT.

Referenced by CalculateOverheadTxTime(), GetAckDuration(), SendAckAfterData(), SendBlockAckResponse(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), and SendRtsForPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAckDuration() [2/2]

Time ns3::MacLow::GetAckDuration ( Mac48Address  to,
WifiTxVector  dataTxVector 
) const
private

Return the time required to transmit the ACK to the specified address given the TXVECTOR of the DATA (including preamble and FCS).

Parameters
to
dataTxVector
Returns
the time required to transmit the ACK (including preamble and FCS)

Definition at line 1159 of file mac-low.cc.

References GetAckDuration(), GetAckTxVectorForData(), and ns3::WifiTxVector::GetMode().

+ Here is the call graph for this function:

◆ GetAckTimeout()

Time ns3::MacLow::GetAckTimeout ( void  ) const

Return ACK timeout of this MacLow.

Returns
ACK timeout

Definition at line 405 of file mac-low.cc.

References m_ackTimeout.

Referenced by StartDataTxTimers().

+ Here is the caller graph for this function:

◆ GetAckTxVector()

WifiTxVector ns3::MacLow::GetAckTxVector ( Mac48Address  to,
WifiMode  dataTxMode 
) const
private

Return a TXVECTOR for the ACK frame given the destination and the mode of the DATA used by the sender.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
tothe MAC address of the ACK receiver
dataTxModethe mode of the DATA used by the sender
Returns
TXVECTOR for the ACK

Definition at line 1369 of file mac-low.cc.

References ns3::ConvertGuardIntervalToNanoSeconds(), ns3::WifiPhy::GetChannelWidth(), ns3::GetChannelWidthForTransmission(), GetControlAnswerMode(), ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel(), ns3::WifiPhy::GetGuardInterval(), ns3::GetPreambleForTransmission(), ns3::WifiPhy::GetShortGuardInterval(), ns3::WifiRemoteStationManager::GetShortPreambleEnabled(), ns3::Mac48Address::IsGroup(), m_phy, m_stationManager, NS_ASSERT, ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetPreambleType(), ns3::WifiTxVector::SetTxPowerLevel(), and ns3::WifiRemoteStationManager::UseGreenfieldForDestination().

Referenced by GetAckTxVectorForData(), and SendAckAfterData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAckTxVectorForData()

WifiTxVector ns3::MacLow::GetAckTxVectorForData ( Mac48Address  to,
WifiMode  dataTxMode 
) const
private

Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA used by the sender.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
tothe MAC address of the Block ACK receiver
dataTxModethe mode of the DATA used by the sender
Returns
TXVECTOR for the Block ACK

Definition at line 1407 of file mac-low.cc.

References GetAckTxVector().

Referenced by GetAckDuration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAddress()

Mac48Address ns3::MacLow::GetAddress ( void  ) const

Return the MAC address of this MacLow.

Returns
Mac48Address of this MacLow

Definition at line 399 of file mac-low.cc.

References m_self.

Referenced by SendBlockAckResponse().

+ Here is the caller graph for this function:

◆ GetBasicBlockAckTimeout()

Time ns3::MacLow::GetBasicBlockAckTimeout ( void  ) const

Return Basic Block ACK timeout of this MacLow.

Returns
Basic Block ACK timeout

Definition at line 411 of file mac-low.cc.

References m_basicBlockAckTimeout.

Referenced by StartDataTxTimers().

+ Here is the caller graph for this function:

◆ GetBeaconInterval()

Time ns3::MacLow::GetBeaconInterval ( void  ) const
Returns
the expected interval between two beacon transmissions.

Definition at line 459 of file mac-low.cc.

References m_beaconInterval.

◆ GetBlockAckDuration()

Time ns3::MacLow::GetBlockAckDuration ( WifiTxVector  blockAckReqTxVector,
BlockAckType  type 
) const
private

Return the time required to transmit the Block ACK to the specified address given the TXVECTOR of the BAR (including preamble and FCS).

Parameters
blockAckReqTxVector
typethe Block ACK type
Returns
the time required to transmit the Block ACK (including preamble and FCS)

Definition at line 1173 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::GetBlockAckSize(), ns3::WifiPhy::GetFrequency(), and m_phy.

Referenced by CalculateOverheadTxTime(), SendBlockAckResponse(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), and SendRtsForPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBlockAckTxVector()

WifiTxVector ns3::MacLow::GetBlockAckTxVector ( Mac48Address  to,
WifiMode  dataTxMode 
) const
private

◆ GetBssid()

Mac48Address ns3::MacLow::GetBssid ( void  ) const

Return the Basic Service Set Identification.

Returns
BSSID

Definition at line 453 of file mac-low.cc.

References m_bssid.

◆ GetCfEndSize()

uint32_t ns3::MacLow::GetCfEndSize ( void  ) const
private

Return the total CF-END size (including FCS trailer).

Returns
the total CF-END size

Definition at line 1144 of file mac-low.cc.

References ns3::MacLow::CfAckInfo::appendCfAck, ns3::MacLow::CfAckInfo::expectCfAck, ns3::WifiMacHeader::GetSize(), m_cfAckInfo, ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_CTL_END, and ns3::WIFI_MAC_CTL_END_ACK.

Referenced by CanTransmitNextCfFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCfpMaxDuration()

Time ns3::MacLow::GetCfpMaxDuration ( void  ) const
Returns
the maximum duration for the CF period.

Definition at line 465 of file mac-low.cc.

References m_cfpMaxDuration.

◆ GetCompressedBlockAckTimeout()

Time ns3::MacLow::GetCompressedBlockAckTimeout ( void  ) const

Return Compressed Block ACK timeout of this MacLow.

Returns
Compressed Block ACK timeout

Definition at line 417 of file mac-low.cc.

References m_compressedBlockAckTimeout.

Referenced by StartDataTxTimers().

+ Here is the caller graph for this function:

◆ GetControlAnswerMode()

WifiMode ns3::MacLow::GetControlAnswerMode ( WifiMode  reqMode) const
private

Get control answer mode function.

Parameters
reqModerequest mode
Returns
control answer mode

The standard has relatively unambiguous rules for selecting a control response rate (the below is quoted from IEEE 802.11-2012, Section 9.7):

To allow the transmitting STA to calculate the contents of the Duration/ID field, a STA responding to a received frame shall transmit its Control Response frame (either CTS or ACK), other than the BlockAck control frame, at the highest rate in the BSSBasicRateSet parameter that is less than or equal to the rate of the immediately previous frame in the frame exchange sequence (as defined in Annex G) and that is of the same modulation class (see Section 9.7.8) as the received frame...

If no suitable basic rate was found, we search the mandatory rates. The standard (IEEE 802.11-2007, Section 9.6) says:

...If no rate contained in the BSSBasicRateSet parameter meets these conditions, then the control frame sent in response to a received frame shall be transmitted at the highest mandatory rate of the PHY that is less than or equal to the rate of the received frame, and that is of the same modulation class as the received frame. In addition, the Control Response frame shall be sent using the same PHY options as the received frame, unless they conflict with the requirement to use the BSSBasicRateSet parameter.

Todo:
Note that we're ignoring the last sentence for now, because there is not yet any manipulation here of PHY options.

If we still haven't found a suitable rate for the response then someone has messed up the simulation config. This probably means that the WifiPhyStandard is not set correctly, or that a rate that is not supported by the PHY has been explicitly requested.

Either way, it is serious - we can either disobey the standard or fail, and I have chosen to do the latter...

Definition at line 1211 of file mac-low.cc.

References ns3::WifiRemoteStationManager::GetBasicMcs(), ns3::WifiRemoteStationManager::GetBasicMode(), ns3::WifiRemoteStationManager::GetDefaultMcs(), ns3::WifiRemoteStationManager::GetDefaultMode(), ns3::WifiRemoteStationManager::GetHeSupported(), ns3::WifiRemoteStationManager::GetHtSupported(), ns3::WifiPhy::GetMcs(), ns3::WifiPhy::GetMode(), ns3::WifiMode::GetModulationClass(), ns3::WifiRemoteStationManager::GetNBasicMcs(), ns3::WifiRemoteStationManager::GetNBasicModes(), ns3::WifiPhy::GetNMcs(), ns3::WifiPhy::GetNModes(), ns3::WifiRemoteStationManager::GetVhtSupported(), ns3::IsAllowedControlAnswerModulationClass(), ns3::WifiMode::IsHigherCodeRate(), ns3::WifiMode::IsHigherDataRate(), ns3::WifiMode::IsMandatory(), m_phy, m_stationManager, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by GetAckTxVector(), GetBlockAckTxVector(), and GetCtsTxVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCtsDuration() [1/2]

Time ns3::MacLow::GetCtsDuration ( WifiTxVector  ctsTxVector) const
private

Return the time required to transmit the CTS (including preamble and FCS).

Parameters
ctsTxVector
Returns
the time required to transmit the CTS (including preamble and FCS)

Definition at line 1190 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::GetCtsSize(), ns3::WifiPhy::GetFrequency(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), m_phy, NS_ASSERT, and ns3::WIFI_MOD_CLASS_HT.

Referenced by CalculateOverheadTxTime(), GetCtsDuration(), SendCtsAfterRts(), and SendRtsForPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCtsDuration() [2/2]

Time ns3::MacLow::GetCtsDuration ( Mac48Address  to,
WifiTxVector  rtsTxVector 
) const
private

Return the time required to transmit the CTS to the specified address given the TXVECTOR of the RTS (including preamble and FCS).

Parameters
to
rtsTxVector
Returns
the time required to transmit the CTS (including preamble and FCS)

Definition at line 1183 of file mac-low.cc.

References GetCtsDuration(), GetCtsTxVectorForRts(), and ns3::WifiTxVector::GetMode().

+ Here is the call graph for this function:

◆ GetCtsTimeout()

Time ns3::MacLow::GetCtsTimeout ( void  ) const

Return CTS timeout of this MacLow.

Returns
CTS timeout

Definition at line 423 of file mac-low.cc.

References m_ctsTimeout.

Referenced by SendRtsForPacket().

+ Here is the caller graph for this function:

◆ GetCtsToSelfSupported()

bool ns3::MacLow::GetCtsToSelfSupported ( void  ) const

Return whether CTS-to-self capability is supported.

Returns
true if CTS-to-self is supported, false otherwise

Definition at line 339 of file mac-low.cc.

References m_ctsToSelfSupported.

◆ GetCtsTxVector()

WifiTxVector ns3::MacLow::GetCtsTxVector ( Mac48Address  to,
WifiMode  rtsTxMode 
) const
private

Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
tothe MAC address of the CTS receiver
rtsTxModethe mode of the RTS used by the sender
Returns
TXVECTOR for the CTS

Definition at line 1353 of file mac-low.cc.

References ns3::ConvertGuardIntervalToNanoSeconds(), ns3::WifiPhy::GetChannelWidth(), ns3::GetChannelWidthForTransmission(), GetControlAnswerMode(), ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel(), ns3::WifiPhy::GetGuardInterval(), ns3::GetPreambleForTransmission(), ns3::WifiPhy::GetShortGuardInterval(), ns3::WifiRemoteStationManager::GetShortPreambleEnabled(), ns3::Mac48Address::IsGroup(), m_phy, m_stationManager, NS_ASSERT, ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetPreambleType(), ns3::WifiTxVector::SetTxPowerLevel(), and ns3::WifiRemoteStationManager::UseGreenfieldForDestination().

Referenced by GetCtsTxVectorForRts(), and SendCtsAfterRts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCtsTxVectorForRts()

WifiTxVector ns3::MacLow::GetCtsTxVectorForRts ( Mac48Address  to,
WifiMode  rtsTxMode 
) const
private

Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
tothe MAC address of the CTS receiver
rtsTxModethe mode of the RTS used by the sender
Returns
TXVECTOR for the CTS

Definition at line 1401 of file mac-low.cc.

References GetCtsTxVector().

Referenced by GetCtsDuration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDataTxVector()

WifiTxVector ns3::MacLow::GetDataTxVector ( Ptr< const WifiMacQueueItem item) const
virtual

Return a TXVECTOR for the DATA frame given the destination.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
itemthe item being asked for TXVECTOR
Returns
TXVECTOR for the given item

Reimplemented in ns3::WaveMacLow.

Definition at line 1204 of file mac-low.cc.

References ns3::WifiRemoteStationManager::GetDataTxVector(), and m_stationManager.

Referenced by CalculateOverallTxTime(), CalculateOverheadTxTime(), CalculateTransmissionTime(), ns3::WaveMacLow::GetDataTxVector(), NeedCtsToSelf(), SendDataPacket(), and StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMpduAggregator()

Ptr< MpduAggregator > ns3::MacLow::GetMpduAggregator ( void  ) const

Returns the aggregator used to construct A-MPDU subframes.

Returns
the aggregator used to construct A-MPDU subframes.

Definition at line 289 of file mac-low.cc.

References m_mpduAggregator.

Referenced by IsWithinSizeAndTimeLimits().

+ Here is the caller graph for this function:

◆ GetMsduAggregator()

Ptr< MsduAggregator > ns3::MacLow::GetMsduAggregator ( void  ) const

Returns the aggregator used to construct A-MSDU subframes.

Returns
the aggregator used to construct A-MSDU subframes.

Definition at line 283 of file mac-low.cc.

References m_msduAggregator.

◆ GetPhy()

Ptr< WifiPhy > ns3::MacLow::GetPhy ( void  ) const
Returns
current attached PHY device

Definition at line 256 of file mac-low.cc.

References m_phy.

Referenced by ns3::WaveMacLow::StartTransmission().

+ Here is the caller graph for this function:

◆ GetPifs()

Time ns3::MacLow::GetPifs ( void  ) const

Return PCF Interframe Space (PIFS) of this MacLow.

Returns
PIFS

Definition at line 447 of file mac-low.cc.

References m_pifs.

Referenced by ForwardDown().

+ Here is the caller graph for this function:

◆ GetRemainingCfpDuration()

Time ns3::MacLow::GetRemainingCfpDuration ( void  ) const
Returns
the remaining duration for the CF period.

Definition at line 2660 of file mac-low.cc.

References ns3::Time::IsPositive(), m_cfpForeshortening, m_cfpMaxDuration, m_cfpStart, min, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by CanTransmitNextCfFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRifs()

Time ns3::MacLow::GetRifs ( void  ) const

Return Reduced Interframe Space (RIFS) of this MacLow.

Returns
RIFS

Definition at line 435 of file mac-low.cc.

References m_rifs.

Referenced by ReceiveOk(), SendDataAfterCts(), SendDataPacket(), and StartDataTxTimers().

+ Here is the caller graph for this function:

◆ GetRtsTxVector()

WifiTxVector ns3::MacLow::GetRtsTxVector ( Ptr< const WifiMacQueueItem item) const
private

Return a TXVECTOR for the RTS frame given the destination.

The function consults WifiRemoteStationManager, which controls the rate to different destinations.

Parameters
itemthe item being asked for RTS TXVECTOR
Returns
TXVECTOR for the RTS of the given item

Definition at line 1197 of file mac-low.cc.

References ns3::WifiRemoteStationManager::GetRtsTxVector(), and m_stationManager.

Referenced by CalculateOverheadTxTime(), NotifyNav(), SendCtsToSelf(), SendRtsForPacket(), and StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSifs()

Time ns3::MacLow::GetSifs ( void  ) const

◆ GetSlotTime()

Time ns3::MacLow::GetSlotTime ( void  ) const

Return slot duration of this MacLow.

Returns
slot duration

Definition at line 441 of file mac-low.cc.

References m_slotTime.

Referenced by NotifyNav().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::MacLow::GetTypeId ( void  )
static

Register this type.

Returns
The TypeId.

Definition at line 143 of file mac-low.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsCfPeriod()

bool ns3::MacLow::IsCfPeriod ( void  ) const
virtual

This function indicates whether it is the CF period.

Reimplemented in MacLowStub.

Definition at line 2669 of file mac-low.cc.

References ns3::WifiRemoteStationManager::GetPcfSupported(), ns3::Time::IsStrictlyPositive(), m_cfpStart, and m_stationManager.

Referenced by CanTransmitNextCfFrame(), EndTxNoAck(), ForwardDown(), ReceiveError(), ReceiveOk(), SendDataPacket(), and StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsNavZero()

bool ns3::MacLow::IsNavZero ( void  ) const
private

Check if NAV is zero.

Returns
true if NAV is zero, false otherwise

Definition at line 1944 of file mac-low.cc.

References m_lastNavDuration, m_lastNavStart, and ns3::Simulator::Now().

Referenced by ReceiveOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsPromisc()

bool ns3::MacLow::IsPromisc ( void  ) const

Check if MacLow is operating in promiscuous mode.

Returns
true if MacLow is operating in promiscuous mode, false otherwise

Definition at line 471 of file mac-low.cc.

References m_promisc.

◆ IsWithinSizeAndTimeLimits() [1/2]

bool ns3::MacLow::IsWithinSizeAndTimeLimits ( Ptr< const WifiMacQueueItem mpdu,
WifiTxVector  txVector,
uint32_t  ampduSize,
Time  ppduDurationLimit 
)

Check whether the given MPDU, if transmitted according to the given TX vector, meets the constraint on the maximum A-MPDU size (by assuming that the frame has to be aggregated to an existing A-MPDU of the given size) and its transmission time exceeds neither the max PPDU duration (depending on the PPDU format) nor the given PPDU duration limit (if strictly positive).

The given MPDU needs to be a QoS Data frame.

Parameters
mpduthe MPDU.
txVectorthe TX vector used to transmit the MPDU
ampduSizethe size of the existing A-MPDU, if any
ppduDurationLimitthe limit on the PPDU duration
Returns
true if constraints on size and duration limit are met.

Definition at line 620 of file mac-low.cc.

References NS_ASSERT.

◆ IsWithinSizeAndTimeLimits() [2/2]

bool ns3::MacLow::IsWithinSizeAndTimeLimits ( uint32_t  mpduSize,
Mac48Address  receiver,
uint8_t  tid,
WifiTxVector  txVector,
uint32_t  ampduSize,
Time  ppduDurationLimit 
)

Check whether an MPDU of the given size, destined to the given receiver and belonging to the given TID, if transmitted according to the given TX vector, meets the constraint on the maximum A-MPDU size (by assuming that the frame has to be aggregated to an existing A-MPDU of the given size) and its transmission time exceeds neither the max PPDU duration (depending on the PPDU format) nor the given PPDU duration limit (if strictly positive).

Parameters
mpduSizethe MPDU size.
receiverthe receiver
tidthe TID
txVectorthe TX vector used to transmit the MPDU
ampduSizethe size of the existing A-MPDU, if any
ppduDurationLimitthe limit on the PPDU duration
Returns
true if constraints on size and duration limit are met.

Definition at line 631 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiPhy::GetFrequency(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), GetMpduAggregator(), ns3::GetPpduMaxTime(), ns3::WifiTxVector::GetPreambleType(), ns3::Time::IsStrictlyPositive(), m_phy, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WIFI_MOD_CLASS_HE, and ns3::WIFI_MOD_CLASS_VHT.

+ Here is the call graph for this function:

◆ NavCounterResetCtsMissed()

void ns3::MacLow::NavCounterResetCtsMissed ( Time  rtsEndRxTime)
private

Reset NAV after CTS was missed when the NAV was set with RTS.

Parameters
rtsEndRxTime

Definition at line 1522 of file mac-low.cc.

References DoNavResetNow(), ns3::WifiPhy::GetLastRxStartTime(), m_phy, and ns3::Seconds().

Referenced by NotifyNav().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NeedCtsToSelf()

bool ns3::MacLow::NeedCtsToSelf ( void  ) const
private

Check if CTS-to-self mechanism should be used for the current packet.

Returns
true if CTS-to-self mechanism should be used for the current packet, false otherwise

Definition at line 613 of file mac-low.cc.

References GetDataTxVector(), m_currentPacket, m_stationManager, and ns3::WifiRemoteStationManager::NeedCtsToSelf().

Referenced by StartTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalAckTimeout()

void ns3::MacLow::NormalAckTimeout ( void  )
private

Event handler when normal ACK timeout occurs.

Todo:
should check that there was no rx start before now. we should restart a new ack timeout now until the expected end of rx if there was a rx start before now.

Definition at line 1707 of file mac-low.cc.

References m_currentTxop, ns3::Txop::MissedAck(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyAckTimeoutResetNow()

void ns3::MacLow::NotifyAckTimeoutResetNow ( void  )
private

Notify ChannelAccessManager that ACK timer should be reset.

Definition at line 1570 of file mac-low.cc.

References m_channelAccessManagers.

Referenced by ReceiveOk().

+ Here is the caller graph for this function:

◆ NotifyAckTimeoutStartNow()

void ns3::MacLow::NotifyAckTimeoutStartNow ( Time  duration)
private

Notify ChannelAccessManager that ACK timer should be started for the given duration.

Parameters
durationthe duration

Definition at line 1561 of file mac-low.cc.

References m_channelAccessManagers.

Referenced by StartDataTxTimers().

+ Here is the caller graph for this function:

◆ NotifyCtsTimeoutResetNow()

void ns3::MacLow::NotifyCtsTimeoutResetNow ( void  )
private

Notify ChannelAccessManager that CTS timer should be reset.

Definition at line 1588 of file mac-low.cc.

References m_channelAccessManagers.

Referenced by ReceiveOk().

+ Here is the caller graph for this function:

◆ NotifyCtsTimeoutStartNow()

void ns3::MacLow::NotifyCtsTimeoutStartNow ( Time  duration)
private

Notify ChannelAccessManager that CTS timer should be started for the given duration.

Parameters
duration

Definition at line 1579 of file mac-low.cc.

References m_channelAccessManagers.

Referenced by SendRtsForPacket().

+ Here is the caller graph for this function:

◆ NotifyNav()

void ns3::MacLow::NotifyNav ( Ptr< const Packet packet,
const WifiMacHeader hdr 
)
private

Notify NAV function.

Parameters
packetthe packet
hdrthe header

A STA that used information from an RTS frame as the most recent basis to update its NAV setting is permitted to reset its NAV if no PHY-RXSTART.indication is detected from the PHY during a period with a duration of (2 * aSIFSTime) + (CTS_Time) + (2 * aSlotTime) starting at the PHY-RXEND.indication corresponding to the detection of the RTS frame. The “CTS_Time” shall be calculated using the length of the CTS frame and the data rate at which the RTS frame used for the most recent NAV update was received.

Definition at line 1478 of file mac-low.cc.

References ns3::WifiPhy::CalculateTxDuration(), DoNavResetNow(), DoNavStartNow(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetDuration(), ns3::WifiPhy::GetFrequency(), ns3::WifiMacHeader::GetRawDuration(), GetRtsTxVector(), ns3::WifiMacHeader::GetSerializedSize(), GetSifs(), GetSlotTime(), ns3::WifiMacHeader::IsCfEnd(), ns3::WifiMacHeader::IsRts(), m_bssid, m_lastNavStart, m_navCounterResetCtsMissed, m_phy, m_self, NavCounterResetCtsMissed(), ns3::Simulator::Now(), NS_ASSERT, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_CTS.

Referenced by DeaggregateAmpduAndReceive(), and ReceiveOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyOffNow()

void ns3::MacLow::NotifyOffNow ( void  )

This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has been put into off mode.

When the device is put into off mode, pending MAC transmissions (RTS, CTS, DATA and ACK) are cancelled.

Definition at line 729 of file mac-low.cc.

References ns3::EventId::Cancel(), CancelAllEvents(), ns3::EventId::IsRunning(), m_currentPacket, m_currentTxop, m_lastNavDuration, m_lastNavStart, m_navCounterResetCtsMissed, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Seconds().

Referenced by ns3::PhyMacLowListener::NotifyOff().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifySleepNow()

void ns3::MacLow::NotifySleepNow ( void  )

This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has been put into sleep mode.

When the device is put into sleep mode, pending MAC transmissions (RTS, CTS, DATA and ACK) are cancelled.

Definition at line 714 of file mac-low.cc.

References ns3::EventId::Cancel(), CancelAllEvents(), ns3::EventId::IsRunning(), m_currentPacket, m_currentTxop, m_lastNavDuration, m_lastNavStart, m_navCounterResetCtsMissed, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Seconds().

Referenced by ns3::PhyMacLowListener::NotifySleep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifySwitchingStartNow()

void ns3::MacLow::NotifySwitchingStartNow ( Time  duration)
Parameters
durationswitching delay duration.

This method is typically invoked by the PhyMacLowListener to notify the MAC layer that a channel switching occurred. When a channel switching occurs, pending MAC transmissions (RTS, CTS, DATA and ACK) are cancelled.

Definition at line 698 of file mac-low.cc.

References ns3::EventId::Cancel(), CancelAllEvents(), ns3::EventId::IsRunning(), m_currentPacket, m_currentTxop, m_lastNavDuration, m_lastNavStart, m_navCounterResetCtsMissed, m_stationManager, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::WifiRemoteStationManager::Reset(), and ns3::Seconds().

Referenced by ns3::PhyMacLowListener::NotifySwitchingStart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceiveError()

void ns3::MacLow::ReceiveError ( Ptr< Packet packet)
Parameters
packetpacket received.

This method is typically invoked by the lower PHY layer to notify the MAC layer that a packet was unsuccessfully received.

Definition at line 677 of file mac-low.cc.

References ns3::MacLow::CfAckInfo::expectCfAck, IsCfPeriod(), m_cfAckInfo, m_currentPacket, m_currentTxop, ns3::Txop::MissedAck(), ns3::Txop::MissedCfPollResponse(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by SetPhy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceiveMpdu()

bool ns3::MacLow::ReceiveMpdu ( Ptr< Packet packet,
WifiMacHeader  hdr 
)
private
Parameters
packetthe packet
hdrthe header
Returns
true if MPDU received

This method updates the reorder buffer and the scoreboard when an MPDU is received in an HT station and stores the MPDU if needed when an MPDU is received in an non-HT Station (implements HT immediate block Ack)

Definition at line 2160 of file mac-low.cc.

References ns3::WifiMacHeader::GetAddr2(), ns3::WifiRemoteStationManager::GetHeSupported(), ns3::WifiRemoteStationManager::GetHtSupported(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiRemoteStationManager::GetVhtSupported(), ns3::IsInWindow(), ns3::WifiMacHeader::IsQosData(), m_bAckAgreements, m_stationManager, ns3::QosUtilsIsOldPacket(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), and StoreMpduIfNeeded().

Referenced by ReceiveOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceiveOk()

void ns3::MacLow::ReceiveOk ( Ptr< Packet packet,
double  rxSnr,
WifiTxVector  txVector,
bool  ampduSubframe 
)
Parameters
packetpacket received
rxSnrsnr of packet received
txVectorTXVECTOR of packet received
ampduSubframetrue if this MPDU is part of an A-MPDU

This method is typically invoked by the lower PHY layer to notify the MAC layer that a packet was successfully received.

Definition at line 744 of file mac-low.cc.

References ns3::Packet::AddPacketTag(), ns3::MacLow::CfAckInfo::address, ns3::MacLow::CfAckInfo::appendCfAck, ns3::EventId::Cancel(), ns3::MacLow::CfAckInfo::expectCfAck, ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetPreambleType(), GetRifs(), ns3::WifiRemoteStationManager::GetRifsPermitted(), GetSifs(), ns3::CtrlBAckRequestHeader::GetStartingSequence(), ns3::CtrlBAckRequestHeader::GetTidInfo(), ns3::Txop::GetTxopLimit(), ns3::Txop::GetTxopRemaining(), ns3::Txop::GotAck(), ns3::Txop::GotBlockAck(), ns3::Txop::GotCfEnd(), ns3::MacLowTransmissionParameters::HasNextPacket(), IsCfPeriod(), ns3::EventId::IsExpired(), ns3::CtrlBAckRequestHeader::IsMultiTid(), IsNavZero(), ns3::Txop::IsQosTxop(), ns3::EventId::IsRunning(), ns3::Time::IsStrictlyPositive(), m_bAckAgreements, m_bAckCaches, m_blockAckTimeoutEvent, m_cfAckInfo, m_cfpStart, m_ctsTimeoutEvent, m_currentPacket, m_currentTxop, m_edca, m_normalAckTimeoutEvent, m_promisc, m_rxCallback, m_self, m_sendAckEvent, m_sendCtsEvent, m_sendDataEvent, m_stationManager, m_txParams, m_waitIfsEvent, ns3::Txop::MissedAck(), ns3::MacLowTransmissionParameters::MustWaitBlockAck(), ns3::MacLowTransmissionParameters::MustWaitNormalAck(), ns3::NanoSeconds(), NotifyAckTimeoutResetNow(), NotifyCtsTimeoutResetNow(), NotifyNav(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosUtilsMapTidToAc(), ReceiveMpdu(), ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), ns3::Packet::RemoveTrailer(), ns3::WifiRemoteStationManager::ReportDataOk(), ns3::WifiRemoteStationManager::ReportRtsOk(), ns3::WifiRemoteStationManager::ReportRxOk(), ResetBlockAckInactivityTimerIfNeeded(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), ns3::Simulator::Schedule(), SendAckAfterData(), SendBlockAckAfterBlockAckRequest(), SendCtsAfterRts(), SendDataAfterCts(), ns3::SnrTag::Set(), ns3::Txop::TerminateTxop(), WaitIfsAfterEndTxFragment(), and WaitIfsAfterEndTxPacket().

Referenced by DeaggregateAmpduAndReceive().

+ Here is the caller graph for this function:

◆ RegisterDcf()

void ns3::MacLow::RegisterDcf ( Ptr< ChannelAccessManager dcf)
Parameters
dcflisten to NAV events for every incoming and outgoing packet.

Definition at line 483 of file mac-low.cc.

References m_channelAccessManagers.

◆ RegisterEdcaForAc()

void ns3::MacLow::RegisterEdcaForAc ( AcIndex  ac,
Ptr< QosTxop edca 
)
Parameters
acAccess class managed by the queue.
edcathe QosTxop for the queue.

The lifetime of the registered QosTxop is typically equal to the lifetime of the queue associated to this AC.

Definition at line 2555 of file mac-low.cc.

References m_edca.

◆ RemovePhyMacLowListener()

void ns3::MacLow::RemovePhyMacLowListener ( Ptr< WifiPhy phy)
private

Remove current WifiPhy listener for this MacLow.

Parameters
phythe WifiPhy this MacLow is connected to

Definition at line 161 of file mac-low.cc.

References m_phyMacLowListener, and third::phy.

Referenced by ResetPhy().

+ Here is the caller graph for this function:

◆ ResetBlockAckInactivityTimerIfNeeded()

void ns3::MacLow::ResetBlockAckInactivityTimerIfNeeded ( BlockAckAgreement agreement)
private

Every time that a block ack request or a packet with ack policy equals to block ack are received, if a relative block ack agreement exists and the value of inactivity timeout is not 0, the timer is reset.

see section 11.5.3 in IEEE 802.11e for more details.

Parameters
agreement

Definition at line 2539 of file mac-low.cc.

References ns3::EventId::Cancel(), ns3::BlockAckAgreement::GetPeer(), ns3::BlockAckAgreement::GetTid(), ns3::BlockAckAgreement::GetTimeout(), ns3::EventId::IsRunning(), m_edca, ns3::BlockAckAgreement::m_inactivityEvent, ns3::MicroSeconds(), NS_ASSERT, ns3::QosUtilsMapTidToAc(), ns3::Simulator::Schedule(), ns3::QosTxop::SendDelbaFrame(), and timeout.

Referenced by DeaggregateAmpduAndReceive(), and ReceiveOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetPhy()

void ns3::MacLow::ResetPhy ( void  )

Remove WifiPhy associated with this MacLow.

Definition at line 262 of file mac-low.cc.

References m_phy, ns3::MakeNullCallback(), RemovePhyMacLowListener(), ns3::WifiPhy::SetReceiveErrorCallback(), and ns3::WifiPhy::SetReceiveOkCallback().

+ Here is the call graph for this function:

◆ RxCompleteBufferedPacketsUntilFirstLost()

void ns3::MacLow::RxCompleteBufferedPacketsUntilFirstLost ( Mac48Address  originator,
uint8_t  tid 
)
private
Parameters
originatorAddress of peer participating in Block Ack mechanism.
tidTID for which Block Ack was created.

This method is typically invoked when a MPDU with ack policy subfield set to Normal Ack is received and a block ack agreement for that packet exists. This happens when the originator of block ack has only few MPDUs to send. All completed MSDUs starting with starting sequence number of block ack agreement are forward up to WifiMac until there is an incomplete or missing MSDU. See section 9.10.4 in IEEE 802.11 standard for more details.

Definition at line 2354 of file mac-low.cc.

References m_bAckAgreements, and m_rxCallback.

Referenced by DestroyBlockAckAgreement(), ReceiveMpdu(), ReceiveOk(), and SendBlockAckAfterBlockAckRequest().

+ Here is the caller graph for this function:

◆ RxCompleteBufferedPacketsWithSmallerSequence()

void ns3::MacLow::RxCompleteBufferedPacketsWithSmallerSequence ( uint16_t  seq,
Mac48Address  originator,
uint8_t  tid 
)
private
Parameters
originatorAddress of peer participating in Block Ack mechanism.
tidTID for which Block Ack was created.
seqStarting sequence control

This function forward up all completed "old" packets with sequence number smaller than seq. All comparison are performed circularly mod 4096.

Definition at line 2291 of file mac-low.cc.

References m_bAckAgreements, m_rxCallback, and ns3::QosUtilsMapSeqControlToUniqueInteger().

Referenced by DestroyBlockAckAgreement(), ReceiveMpdu(), ReceiveOk(), and SendBlockAckAfterBlockAckRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendAckAfterData()

void ns3::MacLow::SendAckAfterData ( Mac48Address  source,
Time  duration,
WifiMode  dataTxMode,
double  dataSnr 
)
private

◆ SendBlockAckAfterAmpdu()

void ns3::MacLow::SendBlockAckAfterAmpdu ( uint8_t  tid,
Mac48Address  originator,
Time  duration,
WifiTxVector  blockAckReqTxVector,
double  rxSnr 
)
private

Invoked after an A-MPDU has been received.

Looks for corresponding block ack agreement and creates block ack bitmap on a received packets basis.

Parameters
tidthe Traffic ID
originatorthe originator MAC address
durationthe remaining NAV duration
blockAckReqTxVectorthe transmit vector
rxSnrthe receive SNR

Definition at line 2432 of file mac-low.cc.

References ns3::Time::As(), ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, GetBlockAckTxVector(), ns3::WifiTxVector::GetMode(), ns3::WifiPhy::IsStateRx(), ns3::WifiPhy::IsStateTx(), m_bAckAgreements, m_bAckCaches, m_phy, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Time::S, and SendBlockAckResponse().

Referenced by DeaggregateAmpduAndReceive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendBlockAckAfterBlockAckRequest()

void ns3::MacLow::SendBlockAckAfterBlockAckRequest ( const CtrlBAckRequestHeader  reqHdr,
Mac48Address  originator,
Time  duration,
WifiMode  blockAckReqTxMode,
double  rxSnr 
)
private

◆ SendBlockAckResponse()

◆ SendCtsAfterRts()

void ns3::MacLow::SendCtsAfterRts ( Mac48Address  source,
Time  duration,
WifiTxVector  rtsTxVector,
double  rtsSnr 
)
private

Send CTS after receiving RTS.

Parameters
source
duration
rtsTxVector
rtsSnr

Definition at line 2011 of file mac-low.cc.

References ns3::Packet::AddPacketTag(), ForwardDown(), GetCtsDuration(), GetCtsTxVector(), ns3::WifiTxVector::GetMode(), GetSifs(), ns3::Time::IsPositive(), NS_ASSERT, NS_LOG_FUNCTION, ns3::SnrTag::Set(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_CTS.

Referenced by ReceiveOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendCtsToSelf()

◆ SendDataAfterCts()

◆ SendDataPacket()

◆ SendRtsForPacket()

◆ SetAckTimeout()

void ns3::MacLow::SetAckTimeout ( Time  ackTimeout)

Set ACK timeout of this MacLow.

Parameters
ackTimeoutACK timeout of this MacLow

Definition at line 315 of file mac-low.cc.

References m_ackTimeout.

◆ SetAddress()

void ns3::MacLow::SetAddress ( Mac48Address  ad)

Set MAC address of this MacLow.

Parameters
adMac48Address of this MacLow

Definition at line 309 of file mac-low.cc.

References m_self.

◆ SetBasicBlockAckTimeout()

void ns3::MacLow::SetBasicBlockAckTimeout ( Time  blockAckTimeout)

Set Basic Block ACK timeout of this MacLow.

Parameters
blockAckTimeoutBasic Block ACK timeout of this MacLow

Definition at line 321 of file mac-low.cc.

References m_basicBlockAckTimeout.

◆ SetBeaconInterval()

void ns3::MacLow::SetBeaconInterval ( Time  interval)
Parameters
intervalthe expected interval between two beacon transmissions.

Definition at line 375 of file mac-low.cc.

References m_beaconInterval.

◆ SetBssid()

void ns3::MacLow::SetBssid ( Mac48Address  ad)

Set the Basic Service Set Identification.

Parameters
adthe BSSID

Definition at line 387 of file mac-low.cc.

References m_bssid.

◆ SetCfpMaxDuration()

void ns3::MacLow::SetCfpMaxDuration ( Time  duration)
Parameters
durationthe maximum duration for the CF period.

Definition at line 381 of file mac-low.cc.

References m_cfpMaxDuration.

◆ SetCompressedBlockAckTimeout()

void ns3::MacLow::SetCompressedBlockAckTimeout ( Time  blockAckTimeout)

Set Compressed Block ACK timeout of this MacLow.

Parameters
blockAckTimeoutCompressed Block ACK timeout of this MacLow

Definition at line 327 of file mac-low.cc.

References m_compressedBlockAckTimeout.

◆ SetCtsTimeout()

void ns3::MacLow::SetCtsTimeout ( Time  ctsTimeout)

Set CTS timeout of this MacLow.

Parameters
ctsTimeoutCTS timeout of this MacLow

Definition at line 345 of file mac-low.cc.

References m_ctsTimeout.

◆ SetCtsToSelfSupported()

void ns3::MacLow::SetCtsToSelfSupported ( bool  enable)

Enable or disable CTS-to-self capability.

Parameters
enableEnable or disable CTS-to-self capability

Definition at line 333 of file mac-low.cc.

References m_ctsToSelfSupported.

◆ SetMac()

void ns3::MacLow::SetMac ( const Ptr< WifiMac mac)

Set up WifiMac associated with this MacLow.

Parameters
macWifiMac associated with this MacLow

Definition at line 271 of file mac-low.cc.

References m_mac, and third::mac.

◆ SetMpduAggregator()

void ns3::MacLow::SetMpduAggregator ( const Ptr< MpduAggregator aggr)

Set the aggregator used to construct A-MPDU subframes.

Parameters
aggrpointer to the MPDU aggregator.

Definition at line 302 of file mac-low.cc.

References m_mpduAggregator, and NS_LOG_FUNCTION.

◆ SetMsduAggregator()

void ns3::MacLow::SetMsduAggregator ( const Ptr< MsduAggregator aggr)

Set the aggregator used to construct A-MSDU subframes.

Parameters
aggrpointer to the MSDU aggregator.

Definition at line 295 of file mac-low.cc.

References m_msduAggregator, and NS_LOG_FUNCTION.

◆ SetPhy()

void ns3::MacLow::SetPhy ( const Ptr< WifiPhy phy)

Set up WifiPhy associated with this MacLow.

Parameters
phyWifiPhy associated with this MacLow

Definition at line 247 of file mac-low.cc.

References DeaggregateAmpduAndReceive(), m_phy, ns3::MakeCallback(), third::phy, ReceiveError(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), and SetupPhyMacLowListener().

+ Here is the call graph for this function:

◆ SetPifs()

void ns3::MacLow::SetPifs ( Time  pifs)

Set PCF Interframe Space (PIFS) of this MacLow.

Parameters
pifsPIFS of this MacLow

Definition at line 363 of file mac-low.cc.

References m_pifs.

◆ SetPromisc()

void ns3::MacLow::SetPromisc ( void  )

Enable promiscuous mode.

Definition at line 393 of file mac-low.cc.

References m_promisc.

◆ SetRifs()

void ns3::MacLow::SetRifs ( Time  rifs)

Set Reduced Interframe Space (RIFS) of this MacLow.

Parameters
rifsRIFS of this MacLow

Definition at line 369 of file mac-low.cc.

References m_rifs.

◆ SetRxCallback()

void ns3::MacLow::SetRxCallback ( Callback< void, Ptr< Packet >, const WifiMacHeader *>  callback)
Parameters
callbackthe callback which receives every incoming packet.

This callback typically forwards incoming packets to an instance of ns3::MacRxMiddle.

Definition at line 477 of file mac-low.cc.

References m_rxCallback.

◆ SetSifs()

void ns3::MacLow::SetSifs ( Time  sifs)

Set Short Interframe Space (SIFS) of this MacLow.

Parameters
sifsSIFS of this MacLow

Definition at line 351 of file mac-low.cc.

References m_sifs.

◆ SetSlotTime()

void ns3::MacLow::SetSlotTime ( Time  slotTime)

Set slot duration of this MacLow.

Parameters
slotTimeslot duration of this MacLow

Definition at line 357 of file mac-low.cc.

References m_slotTime.

◆ SetupPhyMacLowListener()

void ns3::MacLow::SetupPhyMacLowListener ( const Ptr< WifiPhy phy)
private

Set up WifiPhy listener for this MacLow.

Parameters
phythe WifiPhy this MacLow is connected to

Definition at line 154 of file mac-low.cc.

References m_phyMacLowListener, and third::phy.

Referenced by SetPhy().

+ Here is the caller graph for this function:

◆ SetWifiRemoteStationManager()

void ns3::MacLow::SetWifiRemoteStationManager ( const Ptr< WifiRemoteStationManager manager)

Set up WifiRemoteStationManager associated with this MacLow.

Parameters
managerWifiRemoteStationManager associated with this MacLow

Definition at line 277 of file mac-low.cc.

References m_stationManager.

◆ StartDataTxTimers()

◆ StartTransmission()

void ns3::MacLow::StartTransmission ( Ptr< WifiMacQueueItem mpdu,
MacLowTransmissionParameters  parameters,
Ptr< Txop txop 
)
virtual

◆ StoreMpduIfNeeded()

bool ns3::MacLow::StoreMpduIfNeeded ( Ptr< Packet packet,
WifiMacHeader  hdr 
)
private
Parameters
packetthe packet
hdrthe header
Returns
true if the MPDU stored

This method checks if exists a valid established block ack agreement. If there is, store the packet without pass it up to WifiMac. The packet is buffered in order of increasing sequence control field. All comparison are performed circularly modulo 2^12.

Definition at line 2204 of file mac-low.cc.

References ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceControl(), m_bAckAgreements, m_bAckCaches, NS_ASSERT, ns3::QosUtilsMapSeqControlToUniqueInteger(), and ns3::Packet::RemoveTrailer().

Referenced by ReceiveMpdu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WaitIfsAfterEndTxFragment()

void ns3::MacLow::WaitIfsAfterEndTxFragment ( void  )
private

Event handler that is usually scheduled to fired at the appropriate time after completing transmissions.

Definition at line 2097 of file mac-low.cc.

References m_currentTxop, NS_LOG_FUNCTION, and ns3::Txop::StartNextFragment().

Referenced by ReceiveOk(), and StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WaitIfsAfterEndTxPacket()

void ns3::MacLow::WaitIfsAfterEndTxPacket ( void  )
private

Event handler that is usually scheduled to fired at the appropriate time after sending a packet.

Definition at line 2104 of file mac-low.cc.

References m_currentTxop, NS_LOG_FUNCTION, and ns3::Txop::StartNextPacket().

Referenced by ReceiveOk(), and StartDataTxTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ackTimeout

Time ns3::MacLow::m_ackTimeout
private

ACK timeout duration.

Definition at line 911 of file mac-low.h.

Referenced by GetAckTimeout(), and SetAckTimeout().

◆ m_bAckAgreements

◆ m_bAckCaches

BlockAckCaches ns3::MacLow::m_bAckCaches
private

◆ m_basicBlockAckTimeout

Time ns3::MacLow::m_basicBlockAckTimeout
private

Basic block ACK timeout duration.

Definition at line 912 of file mac-low.h.

Referenced by GetBasicBlockAckTimeout(), and SetBasicBlockAckTimeout().

◆ m_beaconInterval

Time ns3::MacLow::m_beaconInterval
private

Expected interval between two beacon transmissions.

Definition at line 920 of file mac-low.h.

Referenced by ForwardDown(), GetBeaconInterval(), and SetBeaconInterval().

◆ m_blockAckTimeoutEvent

EventId ns3::MacLow::m_blockAckTimeoutEvent
private

Block ACK timeout event.

Definition at line 897 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and StartDataTxTimers().

◆ m_bssid

Mac48Address ns3::MacLow::m_bssid
private

BSSID address (Mac48Address)

Definition at line 910 of file mac-low.h.

Referenced by GetBssid(), NotifyNav(), and SetBssid().

◆ m_cfAckInfo

CfAckInfo ns3::MacLow::m_cfAckInfo
private

Info about piggyback ACKs used in PCF.

Definition at line 958 of file mac-low.h.

Referenced by CfPollTimeout(), EndTxNoAck(), ForwardDown(), GetCfEndSize(), ReceiveError(), ReceiveOk(), SendDataPacket(), and StartTransmission().

◆ m_cfpForeshortening

Time ns3::MacLow::m_cfpForeshortening
private

The delay the current CF period should be foreshortened.

Definition at line 928 of file mac-low.h.

Referenced by ForwardDown(), and GetRemainingCfpDuration().

◆ m_cfpMaxDuration

Time ns3::MacLow::m_cfpMaxDuration
private

CFP max duration.

Definition at line 921 of file mac-low.h.

Referenced by GetCfpMaxDuration(), GetRemainingCfpDuration(), and SetCfpMaxDuration().

◆ m_cfpStart

Time ns3::MacLow::m_cfpStart
private

The time when the latest CF period started.

Definition at line 926 of file mac-low.h.

Referenced by EndTxNoAck(), ForwardDown(), GetRemainingCfpDuration(), IsCfPeriod(), and ReceiveOk().

◆ m_channelAccessManagers

◆ m_compressedBlockAckTimeout

Time ns3::MacLow::m_compressedBlockAckTimeout
private

Compressed block ACK timeout duration.

Definition at line 913 of file mac-low.h.

Referenced by GetCompressedBlockAckTimeout(), and SetCompressedBlockAckTimeout().

◆ m_ctsTimeout

Time ns3::MacLow::m_ctsTimeout
private

CTS timeout duration.

Definition at line 914 of file mac-low.h.

Referenced by GetCtsTimeout(), and SetCtsTimeout().

◆ m_ctsTimeoutEvent

EventId ns3::MacLow::m_ctsTimeoutEvent
private

CTS timeout event.

Definition at line 898 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and SendRtsForPacket().

◆ m_ctsToSelfSupported

bool ns3::MacLow::m_ctsToSelfSupported
private

Flag whether CTS-to-self is supported.

Definition at line 955 of file mac-low.h.

Referenced by GetCtsToSelfSupported(), SetCtsToSelfSupported(), and StartTransmission().

◆ m_currentPacket

◆ m_currentTxop

◆ m_currentTxVector

WifiTxVector ns3::MacLow::m_currentTxVector
private

TXVECTOR used for the current packet transmission.

Definition at line 956 of file mac-low.h.

Referenced by CanTransmitNextCfFrame(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), and StartTransmission().

◆ m_edca

QueueEdcas ns3::MacLow::m_edca
private

◆ m_endTxNoAckEvent

EventId ns3::MacLow::m_endTxNoAckEvent
private

Event for finishing transmission that does not require ACK.

Definition at line 903 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), and StartDataTxTimers().

◆ m_lastBeacon

Time ns3::MacLow::m_lastBeacon
private

The time when the last beacon frame transmission started.

Definition at line 927 of file mac-low.h.

Referenced by ForwardDown().

◆ m_lastNavDuration

Time ns3::MacLow::m_lastNavDuration
private

The duration of the latest NAV.

Definition at line 924 of file mac-low.h.

Referenced by DoNavResetNow(), DoNavStartNow(), IsNavZero(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().

◆ m_lastNavStart

Time ns3::MacLow::m_lastNavStart
private

The time when the latest NAV started.

Definition at line 923 of file mac-low.h.

Referenced by DoNavResetNow(), DoNavStartNow(), IsNavZero(), NotifyNav(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().

◆ m_mac

Ptr<WifiMac> ns3::MacLow::m_mac
private

Pointer to WifiMac (to fetch configuration)

Definition at line 869 of file mac-low.h.

Referenced by SetMac().

◆ m_mpduAggregator

Ptr<MpduAggregator> ns3::MacLow::m_mpduAggregator
private

A-MPDU aggregator.

Definition at line 894 of file mac-low.h.

Referenced by DoDispose(), GetMpduAggregator(), SetMpduAggregator(), and StartTransmission().

◆ m_msduAggregator

Ptr<MsduAggregator> ns3::MacLow::m_msduAggregator
private

A-MSDU aggregator.

Definition at line 893 of file mac-low.h.

Referenced by DoDispose(), GetMsduAggregator(), and SetMsduAggregator().

◆ m_navCounterResetCtsMissed

EventId ns3::MacLow::m_navCounterResetCtsMissed
private

Event to reset NAV when CTS is not received.

Definition at line 904 of file mac-low.h.

Referenced by NotifyNav(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().

◆ m_normalAckTimeoutEvent

EventId ns3::MacLow::m_normalAckTimeoutEvent
private

Normal ACK timeout event.

Definition at line 896 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and StartDataTxTimers().

◆ m_phy

◆ m_phyMacLowListener

class PhyMacLowListener* ns3::MacLow::m_phyMacLowListener
private

Listener needed to monitor when a channel switching occurs.

Definition at line 932 of file mac-low.h.

Referenced by DoDispose(), RemovePhyMacLowListener(), and SetupPhyMacLowListener().

◆ m_pifs

Time ns3::MacLow::m_pifs
private

PCF Interframe Space (PIFS) duration.

Definition at line 917 of file mac-low.h.

Referenced by GetPifs(), and SetPifs().

◆ m_promisc

bool ns3::MacLow::m_promisc
private

Flag if the device is operating in promiscuous mode.

Definition at line 930 of file mac-low.h.

Referenced by IsPromisc(), ReceiveOk(), and SetPromisc().

◆ m_rifs

Time ns3::MacLow::m_rifs
private

Reduced Interframe Space (RIFS) duration.

Definition at line 918 of file mac-low.h.

Referenced by GetRifs(), and SetRifs().

◆ m_rxCallback

MacLowRxCallback ns3::MacLow::m_rxCallback
private

◆ m_self

Mac48Address ns3::MacLow::m_self
private

◆ m_sendAckEvent

EventId ns3::MacLow::m_sendAckEvent
private

Event to send ACK.

Definition at line 900 of file mac-low.h.

Referenced by CancelAllEvents(), DeaggregateAmpduAndReceive(), DoDispose(), and ReceiveOk().

◆ m_sendCtsEvent

EventId ns3::MacLow::m_sendCtsEvent
private

Event to send CTS.

Definition at line 899 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), and ReceiveOk().

◆ m_sendDataEvent

EventId ns3::MacLow::m_sendDataEvent
private

Event to send DATA.

Definition at line 901 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and SendCtsToSelf().

◆ m_sifs

Time ns3::MacLow::m_sifs
private

Short Interframe Space (SIFS) duration.

Definition at line 915 of file mac-low.h.

Referenced by GetSifs(), and SetSifs().

◆ m_slotTime

Time ns3::MacLow::m_slotTime
private

Slot duration.

Definition at line 916 of file mac-low.h.

Referenced by GetSlotTime(), and SetSlotTime().

◆ m_stationManager

◆ m_txParams

MacLowTransmissionParameters ns3::MacLow::m_txParams
private

Transmission parameters of the current packet.

Definition at line 908 of file mac-low.h.

Referenced by ReceiveOk(), SendBlockAckResponse(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), StartDataTxTimers(), and StartTransmission().

◆ m_waitIfsEvent

EventId ns3::MacLow::m_waitIfsEvent
private

Wait for IFS event.

Definition at line 902 of file mac-low.h.

Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and StartDataTxTimers().


The documentation for this class was generated from the following files: