handle RTS/CTS/Data/Ack transactions. More...
#include "mac-low.h"
Classes | |
struct | CfAckInfo |
A struct that holds information about Ack piggybacking (CF-Ack). More... | |
Public Types | |
typedef Callback< void, Ptr< WifiMacQueueItem > > | 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 ¶ms, uint32_t fragmentSize=0) const |
Time | CalculateOverheadTxTime (Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters ¶ms) const |
Time | CalculateTransmissionTime (Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters ¶meters) 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< WifiPsdu > 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... | |
Mac48Address | GetAddress (void) const |
Return the MAC address of this MacLow. More... | |
Time | GetBeaconInterval (void) const |
Mac48Address | GetBssid (void) const |
Return the Basic Service Set Identification. More... | |
Time | GetCfpMaxDuration (void) const |
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< QosTxop > | GetEdca (uint8_t tid) const |
Ptr< MpduAggregator > | GetMpduAggregator (void) const |
Returns the aggregator used to construct A-MPDU subframes. More... | |
Ptr< MsduAggregator > | GetMsduAggregator (void) const |
Returns the aggregator used to construct A-MSDU subframes. More... | |
Ptr< WifiPhy > | GetPhy (void) const |
Time | GetPifs (void) const |
Return PCF Interframe Space (PIFS) of this MacLow. More... | |
Time | GetRemainingCfpDuration (void) const |
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 Simulator::Now is in 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< WifiPsdu > psdu) |
void | ReceiveOk (Ptr< WifiMacQueueItem > mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe) |
void | RegisterChannelAccessManager (Ptr< ChannelAccessManager > channelAccessManager) |
void | RegisterEdcaForAc (AcIndex ac, Ptr< QosTxop > edca) |
void | ResetPhy (void) |
Remove WifiPhy associated with this MacLow. More... | |
void | RxStartIndication (WifiTxVector txVector, Time psduDuration) |
void | SetAddress (Mac48Address ad) |
Set MAC address of this MacLow. More... | |
void | SetBeaconInterval (Time interval) |
void | SetBssid (Mac48Address ad) |
Set the Basic Service Set Identification. More... | |
void | SetCfpMaxDuration (Time duration) |
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 | SetPromisc (void) |
Enable promiscuous mode. More... | |
void | SetRxCallback (Callback< void, Ptr< WifiMacQueueItem >> callback) |
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) |
![]() | |
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... | |
template<> | |
Ptr< Object > | GetObject () const |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
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... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
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, AgreementValue > | Agreements |
agreements More... | |
typedef std::map< AgreementKey, AgreementValue >::iterator | AgreementsI |
agreements iterator More... | |
typedef std::pair< BlockAckAgreement, std::list< Ptr< WifiMacQueueItem > > > | AgreementValue |
agreement value typedef More... | |
typedef std::map< AgreementKey, BlockAckCache > | BlockAckCaches |
block ack caches typedef More... | |
typedef std::map< AgreementKey, BlockAckCache >::iterator | BlockAckCachesI |
block ack caches iterator typedef More... | |
typedef std::list< Ptr< WifiMacQueueItem > >::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 BlockAck 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 BlockAck 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 BlockAck to the specified address given the TXVECTOR of the BAR (including preamble and FCS). More... | |
Time | GetBlockAckRequestDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const |
Return the time required to transmit the BlockAckRequest to the specified address given the TXVECTOR (including preamble and FCS). More... | |
WifiTxVector | GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const |
Return a TXVECTOR for the BlockAck 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... | |
Time | GetResponseDuration (const MacLowTransmissionParameters ¶ms, WifiTxVector dataTxVector, Mac48Address receiver) const |
Return the time required to transmit the response frames (Ack or BAR+BA following the policy configured in the transmit parameters). 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... | |
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< WifiMacQueueItem > mpdu) |
void | RemovePhyMacLowListener (Ptr< WifiPhy > phy) |
Remove current WifiPhy listener for this MacLow. More... | |
void | ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement) |
Every time that a BlockAckRequest 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 BlockAckRequest has been received. More... | |
void | SendBlockAckResponse (const CtrlBAckResponseHeader *blockAck, Mac48Address originator, bool immediate, Time duration, WifiMode blockAckReqTxMode, double rxSnr) |
This method creates BlockAck 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< WifiMacQueueItem > mpdu) |
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 | |
Agreements | m_bAckAgreements |
block ack agreements More... | |
BlockAckCaches | m_bAckCaches |
block ack caches More... | |
Time | m_beaconInterval |
Expected interval between two beacon transmissions. More... | |
EventId | m_blockAckTimeoutEvent |
BlockAck 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... | |
EventId | m_ctsTimeoutEvent |
CTS timeout event. More... | |
bool | m_ctsToSelfSupported |
Flag whether CTS-to-self is supported. More... | |
Ptr< WifiPsdu > | m_currentPacket |
Current packet transmitted/to be transmitted. More... | |
Ptr< Txop > | m_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< WifiMac > | m_mac |
Pointer to WifiMac (to fetch configuration) More... | |
Ptr< MpduAggregator > | m_mpduAggregator |
A-MPDU aggregator. More... | |
Ptr< MsduAggregator > | m_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< WifiPhy > | m_phy |
Pointer to WifiPhy (actually send/receives frames) More... | |
class PhyMacLowListener * | m_phyMacLowListener |
Listener needed to monitor when a channel switching occurs. More... | |
bool | m_promisc |
Flag if the device is operating in promiscuous mode. 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... | |
Ptr< WifiRemoteStationManager > | m_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 | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
typedef for a list of ChannelAccessManager.
|
private |
typedef for an iterator for a list of ChannelAccessManager.
typedef Callback<void, Ptr<WifiMacQueueItem> > ns3::MacLow::MacLowRxCallback |
|
private |
ns3::MacLow::MacLow | ( | ) |
Definition at line 116 of file mac-low.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 142 of file mac-low.cc.
References NS_LOG_FUNCTION.
|
private |
Event handler when BlockAck timeout occurs.
Definition at line 1714 of file mac-low.cc.
References m_currentPacket, m_currentTxop, ns3::Txop::MissedBlockAck(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by RxStartIndication(), and StartDataTxTimers().
Time ns3::MacLow::CalculateOverallTxTime | ( | Ptr< const Packet > | packet, |
const WifiMacHeader * | hdr, | ||
const MacLowTransmissionParameters & | params, | ||
uint32_t | fragmentSize = 0 |
||
) | const |
packet | to send (does not include the 802.11 MAC header and checksum) |
hdr | header associated to the packet to send. |
params | transmission parameters of packet. |
fragmentSize | the packet fragment size (if fragmentation is used) in bytes |
This transmission time does not include the time required for the next packet transmission if one was selected.
Definition at line 1430 of file mac-low.cc.
References CalculateOverheadTxTime(), ns3::WifiPhy::CalculateTxDuration(), GetDataTxVector(), ns3::WifiPhy::GetPhyBand(), ns3::GetSize(), m_currentPacket, and m_phy.
Referenced by CalculateTransmissionTime().
Time ns3::MacLow::CalculateOverheadTxTime | ( | Ptr< const WifiMacQueueItem > | item, |
const MacLowTransmissionParameters & | params | ||
) | const |
item | packet to send (does not include the 802.11 MAC header and checksum) |
params | transmission parameters of packet. |
This transmission time only includes the time for the RTS/CTS exchange (if any) and for the Ack frame (if any).
Definition at line 1452 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), GetCtsDuration(), GetDataTxVector(), ns3::WifiPhy::GetPhyBand(), GetResponseDuration(), ns3::GetRtsSize(), GetRtsTxVector(), GetSifs(), m_phy, ns3::MacLowTransmissionParameters::MustSendRts(), and ns3::Seconds().
Referenced by CalculateOverallTxTime(), and StartTransmission().
Time ns3::MacLow::CalculateTransmissionTime | ( | Ptr< const Packet > | packet, |
const WifiMacHeader * | hdr, | ||
const MacLowTransmissionParameters & | parameters | ||
) | const |
packet | to send (does not include the 802.11 MAC header and checksum) |
hdr | header associated to the packet to send. |
parameters | transmission parameters of packet. |
This transmission time includes the time required for the next packet transmission if one was selected.
Definition at line 1469 of file mac-low.cc.
References CalculateOverallTxTime(), ns3::WifiPhy::CalculateTxDuration(), GetDataTxVector(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), ns3::WifiPhy::GetPhyBand(), GetSifs(), ns3::MacLowTransmissionParameters::HasNextPacket(), and m_phy.
Referenced by ns3::WaveMacLow::StartTransmission().
|
private |
Cancel all scheduled events.
Called before beginning a transmission or switching channel.
Definition at line 201 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().
bool ns3::MacLow::CanTransmitNextCfFrame | ( | void | ) | const |
This function decides if a CF frame can be transmitted in the current CFP.
Definition at line 2584 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), GetCfEndSize(), ns3::WifiPhy::GetPhyBand(), GetRemainingCfpDuration(), ns3::WifiMacTrailer::GetSerializedSize(), ns3::WifiMacHeader::GetSerializedSize(), GetSifs(), IsCfPeriod(), m_currentTxVector, m_phy, ns3::MAX_MSDU_SIZE, NS_ASSERT, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_DATA.
|
private |
Event handler when CF-Poll timeout occurs.
Definition at line 1661 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().
void ns3::MacLow::CreateBlockAckAgreement | ( | const MgtAddBaResponseHeader * | respHdr, |
Mac48Address | originator, | ||
uint16_t | startingSeq | ||
) |
respHdr | Add block ack response from originator (action frame). |
originator | Address of peer station involved in block ack mechanism. |
startingSeq | Sequence 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 2140 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.
|
private |
Event handler when CTS timeout occurs.
Definition at line 1679 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 RxStartIndication(), and SendRtsForPacket().
void ns3::MacLow::DeaggregateAmpduAndReceive | ( | Ptr< WifiPsdu > | aggregatedPacket, |
double | rxSnr, | ||
WifiTxVector | txVector, | ||
std::vector< bool > | statusPerMpdu | ||
) |
aggregatedPacket | which is the current A-MPDU |
rxSnr | SNR of packet received in linear scale |
txVector | TXVECTOR of packet received |
statusPerMpdu | reception status per MPDU |
This function de-aggregates an A-MPDU and decide if each MPDU is received correctly or not
Definition at line 2466 of file mac-low.cc.
References GetSifs(), ns3::WifiTxVector::IsAggregation(), ns3::EventId::IsRunning(), m_bAckAgreements, m_self, m_sendAckEvent, sample-rng-plot::n, 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().
void ns3::MacLow::DestroyBlockAckAgreement | ( | Mac48Address | originator, |
uint8_t | tid | ||
) |
originator | Address of peer participating in block ack mechanism. |
tid | TID 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 2182 of file mac-low.cc.
References m_bAckAgreements, m_bAckCaches, NS_ASSERT, NS_LOG_FUNCTION, RxCompleteBufferedPacketsUntilFirstLost(), and RxCompleteBufferedPacketsWithSmallerSequence().
|
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 178 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.
|
private |
Reset NAV with the given duration.
duration | the duration to set |
Definition at line 1529 of file mac-low.cc.
References m_channelAccessManagers, m_lastNavDuration, m_lastNavStart, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by NotifyNav().
bool ns3::MacLow::DoNavStartNow | ( | Time | duration | ) |
Start NAV with the given duration.
duration | the duration |
Definition at line 1541 of file mac-low.cc.
References m_channelAccessManagers, m_lastNavDuration, m_lastNavStart, and ns3::Simulator::Now().
Referenced by NotifyNav().
|
private |
A transmission that does not require an Ack has completed.
Definition at line 2023 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().
|
private |
Forward a PSDU down to WifiPhy for transmission.
psdu | the PSDU |
txVector | the transmit vector |
Definition at line 1595 of file mac-low.cc.
References ns3::MacLow::CfAckInfo::appendCfAck, ns3::WifiPhy::CalculateTxDuration(), CfPollTimeout(), ns3::MacLow::CfAckInfo::expectCfAck, ns3::WifiTxVector::GetMode(), ns3::WifiRemoteStationManager::GetPcfSupported(), ns3::WifiPhy::GetPhyBand(), GetPifs(), ns3::WifiTxVector::GetPreambleType(), IsCfPeriod(), m_beaconInterval, m_cfAckInfo, m_cfpForeshortening, m_cfpStart, m_edca, m_lastBeacon, m_phy, m_stationManager, ns3::NanoSeconds(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PeekPointer(), ns3::QosUtilsMapTidToAc(), ns3::Simulator::Schedule(), ns3::WifiPhy::Send(), and ns3::WifiTxVector::SetAggregation().
Referenced by SendAckAfterData(), SendBlockAckResponse(), SendCtsAfterRts(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), and SendRtsForPacket().
|
private |
Return the time required to transmit the Ack (including preamble and FCS).
ackTxVector | the TXVECTOR used to transmit the Ack |
Definition at line 1151 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::GetAckSize(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), ns3::WifiPhy::GetPhyBand(), m_phy, NS_ASSERT, and ns3::WIFI_MOD_CLASS_HT.
Referenced by GetAckDuration(), GetResponseDuration(), SendAckAfterData(), and SendBlockAckResponse().
|
private |
Return the time required to transmit the Ack to the specified address given the TXVECTOR of the Data (including preamble and FCS).
to | the receiver MAC address |
dataTxVector | the TXVECTOR used to transmit the Data |
Definition at line 1144 of file mac-low.cc.
References GetAckDuration(), GetAckTxVectorForData(), and ns3::WifiTxVector::GetMode().
|
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.
to | the MAC address of the Ack receiver |
dataTxMode | the mode of the Data used by the sender |
Definition at line 1386 of file mac-low.cc.
References ns3::ConvertGuardIntervalToNanoSeconds(), ns3::WifiPhy::GetChannelWidth(), ns3::GetChannelWidthForTransmission(), GetControlAnswerMode(), ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel(), ns3::WifiPhy::GetDevice(), ns3::GetPreambleForTransmission(), 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(), SendAckAfterData(), and StartDataTxTimers().
|
private |
Return a TXVECTOR for the BlockAck 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.
to | the MAC address of the BlockAck receiver |
dataTxMode | the mode of the Data used by the sender |
Definition at line 1424 of file mac-low.cc.
References GetAckTxVector().
Referenced by GetAckDuration().
Mac48Address ns3::MacLow::GetAddress | ( | void | ) | const |
Return the MAC address of this MacLow.
Definition at line 367 of file mac-low.cc.
References m_self.
Referenced by SendBlockAckResponse().
Time ns3::MacLow::GetBeaconInterval | ( | void | ) | const |
Definition at line 397 of file mac-low.cc.
References m_beaconInterval.
|
private |
Return the time required to transmit the BlockAck to the specified address given the TXVECTOR of the BAR (including preamble and FCS).
blockAckReqTxVector | the TXVECTOR used to transmit the BAR |
type | the BlockAck type |
Definition at line 1158 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::GetBlockAckSize(), ns3::WifiPhy::GetPhyBand(), and m_phy.
Referenced by GetResponseDuration(), and SendBlockAckResponse().
|
private |
Return the time required to transmit the BlockAckRequest to the specified address given the TXVECTOR (including preamble and FCS).
blockAckReqTxVector | the TX vector used to transmit the BAR |
type | the BlockAckRequest type |
Definition at line 1168 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::GetBlockAckRequestSize(), ns3::WifiPhy::GetPhyBand(), and m_phy.
Referenced by GetResponseDuration().
|
private |
Return a TXVECTOR for the BlockAck 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.
to | the MAC address of the BlockAck receiver |
dataTxMode | the mode of the Data used by the sender |
Definition at line 1402 of file mac-low.cc.
References ns3::ConvertGuardIntervalToNanoSeconds(), ns3::WifiPhy::GetChannelWidth(), ns3::GetChannelWidthForTransmission(), GetControlAnswerMode(), ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel(), ns3::WifiPhy::GetDevice(), ns3::GetPreambleForTransmission(), 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 GetResponseDuration(), SendBlockAckAfterAmpdu(), SendBlockAckResponse(), and StartDataTxTimers().
Mac48Address ns3::MacLow::GetBssid | ( | void | ) | const |
Return the Basic Service Set Identification.
Definition at line 391 of file mac-low.cc.
References m_bssid.
|
private |
Return the total CF-END size (including FCS trailer).
Definition at line 1129 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().
Time ns3::MacLow::GetCfpMaxDuration | ( | void | ) | const |
Definition at line 403 of file mac-low.cc.
References m_cfpMaxDuration.
Get control answer mode function.
reqMode | request 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.
If we still haven't found a suitable rate for the response then someone has messed up the simulation configuration. 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 1228 of file mac-low.cc.
References ns3::WifiRemoteStationManager::GetBasicMcs(), ns3::WifiRemoteStationManager::GetBasicMode(), ns3::WifiRemoteStationManager::GetDefaultMcs(), ns3::WifiRemoteStationManager::GetDefaultMode(), 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::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().
|
private |
Return the time required to transmit the CTS (including preamble and FCS).
ctsTxVector | the TXVECTOR used to transmit the CTS |
Definition at line 1181 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::GetCtsSize(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), ns3::WifiPhy::GetPhyBand(), m_phy, NS_ASSERT, and ns3::WIFI_MOD_CLASS_HT.
Referenced by CalculateOverheadTxTime(), GetCtsDuration(), SendCtsAfterRts(), and SendRtsForPacket().
|
private |
Return the time required to transmit the CTS to the specified address given the TXVECTOR of the RTS (including preamble and FCS).
to | the receiver MAC address |
rtsTxVector | the TXVECTOR used to transmit the RTS |
Definition at line 1174 of file mac-low.cc.
References GetCtsDuration(), GetCtsTxVectorForRts(), and ns3::WifiTxVector::GetMode().
bool ns3::MacLow::GetCtsToSelfSupported | ( | void | ) | const |
Return whether CTS-to-self capability is supported.
Definition at line 337 of file mac-low.cc.
References m_ctsToSelfSupported.
|
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.
to | the MAC address of the CTS receiver |
rtsTxMode | the mode of the RTS used by the sender |
Definition at line 1370 of file mac-low.cc.
References ns3::ConvertGuardIntervalToNanoSeconds(), ns3::WifiPhy::GetChannelWidth(), ns3::GetChannelWidthForTransmission(), GetControlAnswerMode(), ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel(), ns3::WifiPhy::GetDevice(), ns3::GetPreambleForTransmission(), 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().
|
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.
to | the MAC address of the CTS receiver |
rtsTxMode | the mode of the RTS used by the sender |
Definition at line 1418 of file mac-low.cc.
References GetCtsTxVector().
Referenced by GetCtsDuration().
|
virtual |
Return a TXVECTOR for the Data frame given the destination.
The function consults WifiRemoteStationManager, which controls the rate to different destinations.
item | the item being asked for TXVECTOR |
Reimplemented in ns3::WaveMacLow.
Definition at line 1194 of file mac-low.cc.
References ns3::WifiRemoteStationManager::GetDataTxVector(), and m_stationManager.
Referenced by CalculateOverallTxTime(), CalculateOverheadTxTime(), CalculateTransmissionTime(), ns3::WaveMacLow::GetDataTxVector(), NeedCtsToSelf(), SendDataPacket(), and StartTransmission().
tid | the Traffic ID |
Definition at line 279 of file mac-low.cc.
References m_edca, NS_ASSERT, and ns3::QosUtilsMapTidToAc().
Ptr< MpduAggregator > ns3::MacLow::GetMpduAggregator | ( | void | ) | const |
Returns the aggregator used to construct A-MPDU subframes.
Definition at line 305 of file mac-low.cc.
References m_mpduAggregator.
Referenced by IsWithinSizeAndTimeLimits().
Ptr< MsduAggregator > ns3::MacLow::GetMsduAggregator | ( | void | ) | const |
Returns the aggregator used to construct A-MSDU subframes.
Definition at line 299 of file mac-low.cc.
References m_msduAggregator.
Definition at line 263 of file mac-low.cc.
References m_phy.
Referenced by ns3::WaveMacLow::StartTransmission().
Time ns3::MacLow::GetPifs | ( | void | ) | const |
Return PCF Interframe Space (PIFS) of this MacLow.
Definition at line 385 of file mac-low.cc.
References ns3::WifiPhy::GetPifs(), and m_phy.
Referenced by ForwardDown().
Time ns3::MacLow::GetRemainingCfpDuration | ( | void | ) | const |
Definition at line 2569 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().
|
private |
Return the time required to transmit the response frames (Ack or BAR+BA following the policy configured in the transmit parameters).
params | the transmission parameters |
dataTxVector | the TX vector used to transmit the data frame |
receiver | the station from which a response is expected |
Definition at line 1200 of file mac-low.cc.
References GetAckDuration(), GetBlockAckDuration(), GetBlockAckRequestDuration(), ns3::MacLowTransmissionParameters::GetBlockAckRequestType(), GetBlockAckTxVector(), ns3::MacLowTransmissionParameters::GetBlockAckType(), ns3::WifiTxVector::GetMode(), GetSifs(), m_self, ns3::MacLowTransmissionParameters::MustSendBlockAckRequest(), ns3::MacLowTransmissionParameters::MustWaitBlockAck(), ns3::MacLowTransmissionParameters::MustWaitNormalAck(), NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by CalculateOverheadTxTime(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), and SendRtsForPacket().
|
private |
Return a TXVECTOR for the RTS frame given the destination.
The function consults WifiRemoteStationManager, which controls the rate to different destinations.
item | the item being asked for RTS TXVECTOR |
Definition at line 1188 of file mac-low.cc.
References ns3::WifiRemoteStationManager::GetRtsTxVector(), and m_stationManager.
Referenced by CalculateOverheadTxTime(), NotifyNav(), SendCtsToSelf(), SendRtsForPacket(), and StartTransmission().
Time ns3::MacLow::GetSifs | ( | void | ) | const |
Return Short Interframe Space (SIFS) of this MacLow.
Definition at line 373 of file mac-low.cc.
References ns3::WifiPhy::GetSifs(), and m_phy.
Referenced by CalculateOverheadTxTime(), CalculateTransmissionTime(), CanTransmitNextCfFrame(), DeaggregateAmpduAndReceive(), GetResponseDuration(), NotifyNav(), ReceiveOk(), SendAckAfterData(), SendBlockAckResponse(), SendCtsAfterRts(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), and StartDataTxTimers().
Time ns3::MacLow::GetSlotTime | ( | void | ) | const |
Return slot duration of this MacLow.
Definition at line 379 of file mac-low.cc.
References ns3::WifiPhy::GetSlot(), and m_phy.
Referenced by NotifyNav(), SendRtsForPacket(), and StartDataTxTimers().
|
static |
Register this type.
Definition at line 149 of file mac-low.cc.
References ns3::TypeId::SetParent().
|
virtual |
This function indicates whether Simulator::Now is in the CF period.
Reimplemented in MacLowStub.
Definition at line 2578 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().
|
private |
Check if NAV is zero.
Definition at line 1899 of file mac-low.cc.
References m_lastNavDuration, m_lastNavStart, and ns3::Simulator::Now().
Referenced by ReceiveOk().
bool ns3::MacLow::IsPromisc | ( | void | ) | const |
Check if MacLow is operating in promiscuous mode.
Definition at line 409 of file mac-low.cc.
References m_promisc.
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.
mpdu | the MPDU. |
txVector | the TX vector used to transmit the MPDU |
ampduSize | the size of the existing A-MPDU in bytes, if any |
ppduDurationLimit | the limit on the PPDU duration |
Definition at line 586 of file mac-low.cc.
References NS_ASSERT.
Referenced by StartTransmission().
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).
mpduSize | the MPDU size. |
receiver | the receiver |
tid | the TID |
txVector | the TX vector used to transmit the MPDU |
ampduSize | the size of the existing A-MPDU in bytes, if any |
ppduDurationLimit | the limit on the PPDU duration |
Definition at line 597 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), GetMpduAggregator(), ns3::WifiPhy::GetPhyBand(), ns3::GetPpduMaxTime(), ns3::WifiTxVector::GetPreambleType(), ns3::Time::IsNegative(), ns3::Time::IsStrictlyPositive(), m_phy, ns3::Time::Min(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WIFI_MOD_CLASS_VHT.
|
private |
Check if CTS-to-self mechanism should be used for the current packet.
Definition at line 579 of file mac-low.cc.
References GetDataTxVector(), m_currentPacket, m_stationManager, and ns3::WifiRemoteStationManager::NeedCtsToSelf().
Referenced by StartTransmission().
|
private |
Event handler when normal Ack timeout occurs.
Definition at line 1701 of file mac-low.cc.
References m_currentTxop, ns3::Txop::MissedAck(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by RxStartIndication(), and StartDataTxTimers().
|
private |
Notify ChannelAccessManager that Ack timer should be reset.
Definition at line 1568 of file mac-low.cc.
References m_channelAccessManagers.
Referenced by ReceiveOk(), and RxStartIndication().
|
private |
Notify ChannelAccessManager that Ack timer should be started for the given duration.
duration | the duration of the timer |
Definition at line 1559 of file mac-low.cc.
References m_channelAccessManagers.
Referenced by StartDataTxTimers().
|
private |
Notify ChannelAccessManager that CTS timer should be reset.
Definition at line 1586 of file mac-low.cc.
References m_channelAccessManagers.
Referenced by ReceiveOk(), and RxStartIndication().
|
private |
Notify ChannelAccessManager that CTS timer should be started for the given duration.
duration | the duration of the timer |
Definition at line 1577 of file mac-low.cc.
References m_channelAccessManagers.
Referenced by SendRtsForPacket().
|
private |
Notify NAV function.
packet | the packet |
hdr | the 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) + aRxPHYStartDelay + (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 1484 of file mac-low.cc.
References ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::WifiPhy::CalculateTxDuration(), DoNavResetNow(), DoNavStartNow(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetDuration(), ns3::WifiPhy::GetPhyBand(), 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, ns3::Simulator::Now(), NS_ASSERT, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_CTS.
Referenced by ReceiveOk().
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 742 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().
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 727 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().
void ns3::MacLow::NotifySwitchingStartNow | ( | Time | duration | ) |
duration | switching 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 711 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().
psdu | PSDU received. |
This method is typically invoked by the lower PHY layer to notify the MAC layer that a PSDU was unsuccessfully received.
Definition at line 690 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().
|
private |
mpdu | the MPDU |
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 BlockAck)
Definition at line 2072 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, NS_ASSERT, ns3::QosUtilsIsOldPacket(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), and StoreMpduIfNeeded().
Referenced by ReceiveOk().
void ns3::MacLow::ReceiveOk | ( | Ptr< WifiMacQueueItem > | mpdu, |
double | rxSnr, | ||
WifiTxVector | txVector, | ||
bool | ampduSubframe | ||
) |
mpdu | MPDU received |
rxSnr | snr of MPDU received in linear scale |
txVector | TXVECTOR of MPDU received |
ampduSubframe | true 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 an MPDU was successfully received.
Definition at line 757 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::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetDuration(), ns3::WifiTxVector::GetMode(), ns3::WifiMacHeader::GetQosTid(), GetSifs(), ns3::CtrlBAckRequestHeader::GetStartingSequence(), ns3::CtrlBAckRequestHeader::GetTidInfo(), ns3::Txop::GetTxopLimit(), ns3::Txop::GetTxopRemaining(), ns3::WifiMacHeader::GetTypeString(), ns3::Txop::GotAck(), ns3::Txop::GotBlockAck(), ns3::Txop::GotCfEnd(), ns3::WifiMacHeader::HasData(), ns3::MacLowTransmissionParameters::HasNextPacket(), ns3::WifiMacHeader::IsAck(), ns3::WifiMacHeader::IsBeacon(), ns3::WifiMacHeader::IsBlockAck(), ns3::WifiMacHeader::IsBlockAckReq(), ns3::WifiMacHeader::IsCfAck(), ns3::WifiMacHeader::IsCfEnd(), IsCfPeriod(), ns3::WifiMacHeader::IsCfPoll(), ns3::WifiMacHeader::IsCtl(), ns3::WifiMacHeader::IsCts(), ns3::WifiMacHeader::IsData(), ns3::EventId::IsExpired(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsMgt(), ns3::CtrlBAckRequestHeader::IsMultiTid(), IsNavZero(), ns3::WifiMacHeader::IsProbeResp(), ns3::WifiMacHeader::IsQosAck(), ns3::WifiMacHeader::IsQosBlockAck(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsQosNoAck(), ns3::Txop::IsQosTxop(), ns3::WifiMacHeader::IsRts(), ns3::EventId::IsRunning(), ns3::Time::IsStrictlyPositive(), m_bAckAgreements, m_bAckCaches, m_blockAckTimeoutEvent, m_cfAckInfo, m_cfpStart, m_ctsTimeoutEvent, m_currentPacket, m_currentTxop, m_currentTxVector, 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::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().
void ns3::MacLow::RegisterChannelAccessManager | ( | Ptr< ChannelAccessManager > | channelAccessManager | ) |
channelAccessManager | pointer to ChannelAccessManager in order to listen to NAV events for every incoming and outgoing packet. |
Definition at line 421 of file mac-low.cc.
References m_channelAccessManagers.
ac | Access class managed by the queue. |
edca | the 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 2460 of file mac-low.cc.
References m_edca.
Remove current WifiPhy listener for this MacLow.
Definition at line 167 of file mac-low.cc.
References m_phyMacLowListener, and third::phy.
Referenced by ResetPhy().
|
private |
Every time that a BlockAckRequest 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.
agreement | the BA agreement |
Definition at line 2444 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().
void ns3::MacLow::ResetPhy | ( | void | ) |
Remove WifiPhy associated with this MacLow.
Definition at line 269 of file mac-low.cc.
References m_phy, ns3::MakeCallback(), ns3::MakeNullCallback(), RemovePhyMacLowListener(), RxStartIndication(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), and ns3::ObjectBase::TraceDisconnectWithoutContext().
|
private |
originator | Address of peer participating in block ack mechanism. |
tid | TID 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 2261 of file mac-low.cc.
References m_bAckAgreements, and m_rxCallback.
Referenced by DestroyBlockAckAgreement(), ReceiveMpdu(), ReceiveOk(), and SendBlockAckAfterBlockAckRequest().
|
private |
originator | Address of peer participating in block ack mechanism. |
tid | TID for which block ack was created. |
seq | Starting sequence control |
This function forward up all completed "old" packets with sequence number smaller than seq. All comparison are performed circularly modulo 4096.
Definition at line 2198 of file mac-low.cc.
References m_bAckAgreements, m_rxCallback, and ns3::QosUtilsMapSeqControlToUniqueInteger().
Referenced by DestroyBlockAckAgreement(), ReceiveMpdu(), ReceiveOk(), and SendBlockAckAfterBlockAckRequest().
void ns3::MacLow::RxStartIndication | ( | WifiTxVector | txVector, |
Time | psduDuration | ||
) |
txVector | the TXVECTOR decoded from PHY header. |
psduDuration | the duration of the PSDU that is about to be received. |
This method is typically invoked by the lower PHY layer to notify the MAC layer that the reception of a PSDU is starting. This is equivalent to the PHY-RXSTART primitive. If the reception is correct for at least one MPDU of the PSDU the DeaggregateAmpduAndReceive will be called after psduDuration
. Otherwise, ReceiveError will be called after the same duration.
Definition at line 648 of file mac-low.cc.
References BlockAckTimeout(), ns3::EventId::Cancel(), CtsTimeout(), ns3::EventId::IsRunning(), ns3::Time::IsStrictlyPositive(), m_blockAckTimeoutEvent, m_ctsTimeoutEvent, m_navCounterResetCtsMissed, m_normalAckTimeoutEvent, ns3::NanoSeconds(), NormalAckTimeout(), NotifyAckTimeoutResetNow(), NotifyCtsTimeoutResetNow(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, PSDU_DURATION_SAFEGUARD, ns3::Simulator::Schedule(), ns3::Time::ToDouble(), and ns3::Time::US.
Referenced by ResetPhy(), and SetPhy().
|
private |
Send Ack after receiving Data.
source | the transmitter of the Data |
duration | the NAV of the Data |
dataTxMode | the TXVECTOR used to transmit the Data |
dataSnr | the SNR of the Data in linear scale |
Definition at line 2042 of file mac-low.cc.
References ns3::Packet::AddPacketTag(), ForwardDown(), GetAckDuration(), GetAckTxVector(), GetSifs(), ns3::Time::IsPositive(), NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::SnrTag::Set(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetDuration(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_ACK.
Referenced by ReceiveOk().
|
private |
Invoked after an A-MPDU has been received.
Looks for corresponding block ack agreement and creates a block ack bitmap on a received packets basis.
tid | the Traffic ID |
originator | the originator MAC address |
duration | the remaining NAV duration |
blockAckReqTxVector | the transmit vector |
rxSnr | the receive SNR in linear scale |
Definition at line 2339 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().
|
private |
Invoked after that a BlockAckRequest has been received.
Looks for corresponding block ack agreement and creates a block ack bitmap on a received packets basis.
reqHdr | the BAR header |
originator | the transmitter of the BAR |
duration | the NAV of the BAR |
blockAckReqTxMode | the TXVECTOR used to transmit the BAR |
rxSnr | the SNR of the BAR in linear scale |
Definition at line 2378 of file mac-low.cc.
References ns3::BASIC_BLOCK_ACK, ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, ns3::WifiRemoteStationManager::GetHeSupported(), ns3::WifiRemoteStationManager::GetHtSupported(), ns3::CtrlBAckRequestHeader::GetStartingSequence(), ns3::CtrlBAckRequestHeader::GetStartingSequenceControl(), ns3::CtrlBAckRequestHeader::GetTidInfo(), ns3::WifiRemoteStationManager::GetVhtSupported(), ns3::CtrlBAckRequestHeader::IsBasic(), ns3::CtrlBAckRequestHeader::IsCompressed(), ns3::CtrlBAckRequestHeader::IsExtendedCompressed(), ns3::CtrlBAckRequestHeader::IsMultiTid(), m_bAckAgreements, m_bAckCaches, m_stationManager, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosUtilsIsOldPacket(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), SendBlockAckResponse(), ns3::CtrlBAckResponseHeader::SetStartingSequence(), ns3::CtrlBAckResponseHeader::SetTidInfo(), and ns3::CtrlBAckResponseHeader::SetType().
Referenced by ReceiveOk().
|
private |
This method creates BlockAck frame with header equals to blockAck and start its transmission.
blockAck | the BA response header to send |
originator | the station to send a BA to |
immediate | use immediate BA policy if true |
duration | the NAV duration |
blockAckReqTxMode | the TXVECTOR used to transmit the BAR |
rxSnr | the received SNR in linear scale |
Definition at line 2291 of file mac-low.cc.
References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::MacLowTransmissionParameters::DisableAck(), ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::EnableAck(), ForwardDown(), GetAckDuration(), GetAddress(), GetBlockAckDuration(), GetBlockAckTxVector(), GetSifs(), ns3::CtrlBAckResponseHeader::GetType(), ns3::Time::IsPositive(), m_txParams, NS_ASSERT, NS_LOG_FUNCTION, ns3::SnrTag::Set(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetDuration(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), StartDataTxTimers(), and ns3::WIFI_MAC_CTL_BACKRESP.
Referenced by SendBlockAckAfterAmpdu(), and SendBlockAckAfterBlockAckRequest().
|
private |
Send CTS after receiving RTS.
source | the transmitter of the RTS |
duration | the NAV of the RTS |
rtsTxVector | the TXVECTOR used to transmit the RTS |
rtsSnr | the SNR of the RTS in linear scale |
Definition at line 1944 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().
|
private |
Send CTS for a CTS-to-self mechanism.
Definition at line 1905 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ForwardDown(), ns3::GetCtsSize(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), ns3::WifiPhy::GetPhyBand(), GetResponseDuration(), GetRtsTxVector(), GetSifs(), ns3::MacLowTransmissionParameters::HasNextPacket(), ns3::EventId::IsExpired(), m_currentPacket, m_currentTxVector, m_phy, m_self, m_sendDataEvent, m_txParams, NS_ASSERT, ns3::Simulator::Schedule(), ns3::Seconds(), SendDataAfterCts(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetDuration(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_CTS.
Referenced by StartTransmission().
|
private |
Send Data after receiving CTS.
duration | the NAV of the CTS |
Definition at line 1974 of file mac-low.cc.
References ns3::WifiPhy::CalculateTxDuration(), ForwardDown(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), ns3::WifiPhy::GetPhyBand(), GetResponseDuration(), GetSifs(), ns3::MacLowTransmissionParameters::HasNextPacket(), ns3::Time::IsPositive(), m_currentPacket, m_currentTxop, m_currentTxVector, m_phy, m_txParams, max, ns3::MacLowTransmissionParameters::MustSendBlockAckRequest(), NS_ASSERT, NS_LOG_FUNCTION, ns3::QosTxop::PrepareBlockAckRequest(), ns3::QosTxop::ScheduleBar(), and StartDataTxTimers().
Referenced by ReceiveOk(), and SendCtsToSelf().
|
private |
Send Data packet, which can be Data-Ack or RTS-CTS-Data-Ack transaction.
Definition at line 1816 of file mac-low.cc.
References ns3::MacLow::CfAckInfo::address, ns3::MacLow::CfAckInfo::appendCfAck, ns3::WifiPhy::CalculateTxDuration(), ForwardDown(), ns3::WifiMode::GetDataRate(), GetDataTxVector(), ns3::WifiTxVector::GetMode(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), ns3::WifiPhy::GetPhyBand(), GetResponseDuration(), GetSifs(), ns3::MacLowTransmissionParameters::HasNextPacket(), IsCfPeriod(), m_cfAckInfo, m_currentPacket, m_currentTxop, m_currentTxVector, m_phy, m_txParams, ns3::MacLowTransmissionParameters::MustSendBlockAckRequest(), NS_ASSERT, NS_LOG_FUNCTION, ns3::QosTxop::PrepareBlockAckRequest(), ns3::QosTxop::ScheduleBar(), ns3::WifiMacHeader::SetAddr1(), StartDataTxTimers(), ns3::WIFI_MAC_CTL_END, ns3::WIFI_MAC_CTL_END_ACK, ns3::WIFI_MAC_DATA, ns3::WIFI_MAC_DATA_CFACK, ns3::WIFI_MAC_DATA_CFACK_CFPOLL, ns3::WIFI_MAC_DATA_CFPOLL, ns3::WIFI_MAC_DATA_NULL, ns3::WIFI_MAC_DATA_NULL_CFACK, ns3::WIFI_MAC_DATA_NULL_CFACK_CFPOLL, and ns3::WIFI_MAC_DATA_NULL_CFPOLL.
Referenced by StartTransmission().
|
private |
Send RTS to begin RTS-CTS-Data-Ack transaction.
Definition at line 1724 of file mac-low.cc.
References ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::WifiPhy::CalculateTxDuration(), CtsTimeout(), ForwardDown(), GetCtsDuration(), ns3::MacLowTransmissionParameters::GetNextPacketSize(), ns3::WifiPhy::GetPhyBand(), GetResponseDuration(), ns3::GetRtsSize(), GetRtsTxVector(), GetSifs(), GetSlotTime(), ns3::MacLowTransmissionParameters::HasNextPacket(), ns3::EventId::IsExpired(), m_ctsTimeoutEvent, m_currentPacket, m_currentTxVector, m_phy, m_self, m_txParams, NotifyCtsTimeoutStartNow(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetDuration(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_RTS.
Referenced by StartTransmission().
void ns3::MacLow::SetAddress | ( | Mac48Address | ad | ) |
Set MAC address of this MacLow.
ad | Mac48Address of this MacLow |
Definition at line 325 of file mac-low.cc.
References m_self.
void ns3::MacLow::SetBeaconInterval | ( | Time | interval | ) |
interval | the expected interval between two beacon transmissions. |
Definition at line 343 of file mac-low.cc.
References m_beaconInterval.
void ns3::MacLow::SetBssid | ( | Mac48Address | ad | ) |
Set the Basic Service Set Identification.
ad | the BSSID |
Definition at line 355 of file mac-low.cc.
References m_bssid.
void ns3::MacLow::SetCfpMaxDuration | ( | Time | duration | ) |
duration | the maximum duration for the CF period. |
Definition at line 349 of file mac-low.cc.
References m_cfpMaxDuration.
void ns3::MacLow::SetCtsToSelfSupported | ( | bool | enable | ) |
Enable or disable CTS-to-self capability.
enable | Enable or disable CTS-to-self capability |
Definition at line 331 of file mac-low.cc.
References m_ctsToSelfSupported.
Set up WifiMac associated with this MacLow.
Definition at line 287 of file mac-low.cc.
References m_mac, and third::mac.
void ns3::MacLow::SetMpduAggregator | ( | const Ptr< MpduAggregator > | aggr | ) |
Set the aggregator used to construct A-MPDU subframes.
aggr | pointer to the MPDU aggregator. |
Definition at line 318 of file mac-low.cc.
References m_mpduAggregator, and NS_LOG_FUNCTION.
void ns3::MacLow::SetMsduAggregator | ( | const Ptr< MsduAggregator > | aggr | ) |
Set the aggregator used to construct A-MSDU subframes.
aggr | pointer to the MSDU aggregator. |
Definition at line 311 of file mac-low.cc.
References m_msduAggregator, and NS_LOG_FUNCTION.
Set up WifiPhy associated with this MacLow.
Definition at line 253 of file mac-low.cc.
References DeaggregateAmpduAndReceive(), m_phy, ns3::MakeCallback(), third::phy, ReceiveError(), RxStartIndication(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), SetupPhyMacLowListener(), and ns3::ObjectBase::TraceConnectWithoutContext().
void ns3::MacLow::SetPromisc | ( | void | ) |
void ns3::MacLow::SetRxCallback | ( | Callback< void, Ptr< WifiMacQueueItem >> | callback | ) |
callback | the callback which receives every incoming packet. |
This callback typically forwards incoming packets to an instance of ns3::MacRxMiddle.
Definition at line 415 of file mac-low.cc.
References m_rxCallback.
Set up WifiPhy listener for this MacLow.
Definition at line 160 of file mac-low.cc.
References m_phyMacLowListener, and third::phy.
Referenced by SetPhy().
void ns3::MacLow::SetWifiRemoteStationManager | ( | const Ptr< WifiRemoteStationManager > | manager | ) |
Set up WifiRemoteStationManager associated with this MacLow.
manager | WifiRemoteStationManager associated with this MacLow |
Definition at line 293 of file mac-low.cc.
References m_stationManager.
|
private |
Start a Data timer by scheduling appropriate Ack timeout.
dataTxVector | the TXVECTOR used to transmit the Data |
Definition at line 1767 of file mac-low.cc.
References BlockAckTimeout(), ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::WifiPhy::CalculateTxDuration(), EndTxNoAck(), GetAckTxVector(), GetBlockAckTxVector(), ns3::WifiTxVector::GetMode(), ns3::WifiPhy::GetPhyBand(), GetSifs(), GetSlotTime(), ns3::Txop::GetTxopLimit(), ns3::Txop::GetTxopRemaining(), ns3::MacLowTransmissionParameters::HasNextPacket(), IsCfPeriod(), ns3::EventId::IsExpired(), ns3::Txop::IsQosTxop(), ns3::Time::IsStrictlyPositive(), m_blockAckTimeoutEvent, m_currentPacket, m_currentTxop, m_endTxNoAckEvent, m_normalAckTimeoutEvent, m_phy, m_txParams, m_waitIfsEvent, ns3::MacLowTransmissionParameters::MustWaitBlockAck(), ns3::MacLowTransmissionParameters::MustWaitNormalAck(), NormalAckTimeout(), NotifyAckTimeoutStartNow(), NS_ASSERT, ns3::Simulator::Schedule(), WaitIfsAfterEndTxFragment(), and WaitIfsAfterEndTxPacket().
Referenced by SendBlockAckResponse(), SendDataAfterCts(), and SendDataPacket().
|
virtual |
mpdu | packet to send |
parameters | the transmission parameters to use for this packet. |
txop | pointer to the calling Txop. |
Start the transmission of the input packet and notify the listener of transmission events.
Reimplemented in ns3::WaveMacLow.
Definition at line 427 of file mac-low.cc.
References CalculateOverheadTxTime(), CancelAllEvents(), ns3::QosTxop::DequeuePeekedFrame(), ns3::MacLow::CfAckInfo::expectCfAck, ns3::QosTxop::GetAckPolicySelector(), GetDataTxVector(), ns3::WifiTxVector::GetMode(), ns3::WifiMode::GetModulationClass(), GetRtsTxVector(), ns3::Txop::GetTxopLimit(), ns3::Txop::GetTxopRemaining(), ns3::WifiRemoteStationManager::GetUseNonErpProtection(), ns3::Time::IsPositive(), ns3::WifiPhy::IsStateOff(), ns3::WifiPhy::IsStateTx(), ns3::Time::IsStrictlyPositive(), IsWithinSizeAndTimeLimits(), m_cfAckInfo, m_ctsToSelfSupported, m_currentPacket, m_currentTxop, m_currentTxVector, m_edca, m_mpduAggregator, m_phy, m_stationManager, m_txParams, ns3::Time::Min(), ns3::MacLowTransmissionParameters::MustSendRts(), NeedCtsToSelf(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosTxop::PeekNextFrame(), ns3::QosUtilsMapTidToAc(), SendCtsToSelf(), SendDataPacket(), SendRtsForPacket(), ns3::QosTxop::SetAmpduExist(), ns3::QosTxop::UpdateCurrentPacket(), ns3::WIFI_MOD_CLASS_HE, and ns3::WIFI_MOD_CLASS_VHT.
Referenced by ns3::WaveMacLow::StartTransmission().
|
private |
mpdu | the MPDU |
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 2113 of file mac-low.cc.
References ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceControl(), m_bAckAgreements, m_bAckCaches, NS_ASSERT, and ns3::QosUtilsMapSeqControlToUniqueInteger().
Referenced by ReceiveMpdu().
|
private |
Event handler that is usually scheduled to fired at the appropriate time after completing transmissions.
Definition at line 2009 of file mac-low.cc.
References m_currentTxop, NS_LOG_FUNCTION, and ns3::Txop::StartNextFragment().
Referenced by ReceiveOk(), and StartDataTxTimers().
|
private |
Event handler that is usually scheduled to fired at the appropriate time after sending a packet.
Definition at line 2016 of file mac-low.cc.
References m_currentTxop, NS_LOG_FUNCTION, and ns3::Txop::StartNextPacket().
Referenced by ReceiveOk(), and StartDataTxTimers().
|
private |
block ack agreements
Definition at line 899 of file mac-low.h.
Referenced by CreateBlockAckAgreement(), DeaggregateAmpduAndReceive(), DestroyBlockAckAgreement(), ReceiveMpdu(), ReceiveOk(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), SendBlockAckAfterAmpdu(), SendBlockAckAfterBlockAckRequest(), and StoreMpduIfNeeded().
|
private |
block ack caches
Definition at line 900 of file mac-low.h.
Referenced by CreateBlockAckAgreement(), DestroyBlockAckAgreement(), ReceiveOk(), SendBlockAckAfterAmpdu(), SendBlockAckAfterBlockAckRequest(), and StoreMpduIfNeeded().
|
private |
Expected interval between two beacon transmissions.
Definition at line 871 of file mac-low.h.
Referenced by ForwardDown(), GetBeaconInterval(), and SetBeaconInterval().
|
private |
BlockAck timeout event.
Definition at line 856 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), RxStartIndication(), and StartDataTxTimers().
|
private |
BSSID address (Mac48Address)
Definition at line 869 of file mac-low.h.
Referenced by GetBssid(), NotifyNav(), and SetBssid().
|
private |
Info about piggyback Acks used in PCF.
Definition at line 908 of file mac-low.h.
Referenced by CfPollTimeout(), EndTxNoAck(), ForwardDown(), GetCfEndSize(), ReceiveError(), ReceiveOk(), SendDataPacket(), and StartTransmission().
|
private |
The delay the current CF period should be foreshortened.
Definition at line 879 of file mac-low.h.
Referenced by ForwardDown(), and GetRemainingCfpDuration().
|
private |
CFP max duration.
Definition at line 872 of file mac-low.h.
Referenced by GetCfpMaxDuration(), GetRemainingCfpDuration(), and SetCfpMaxDuration().
|
private |
The time when the latest CF period started.
Definition at line 877 of file mac-low.h.
Referenced by EndTxNoAck(), ForwardDown(), GetRemainingCfpDuration(), IsCfPeriod(), and ReceiveOk().
|
private |
List of ChannelAccessManager.
Definition at line 850 of file mac-low.h.
Referenced by CfPollTimeout(), DoNavResetNow(), DoNavStartNow(), NotifyAckTimeoutResetNow(), NotifyAckTimeoutStartNow(), NotifyCtsTimeoutResetNow(), NotifyCtsTimeoutStartNow(), and RegisterChannelAccessManager().
|
private |
CTS timeout event.
Definition at line 857 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), RxStartIndication(), and SendRtsForPacket().
|
private |
Flag whether CTS-to-self is supported.
Definition at line 905 of file mac-low.h.
Referenced by GetCtsToSelfSupported(), SetCtsToSelfSupported(), and StartTransmission().
Current packet transmitted/to be transmitted.
Definition at line 865 of file mac-low.h.
Referenced by BlockAckTimeout(), CalculateOverallTxTime(), CtsTimeout(), EndTxNoAck(), NeedCtsToSelf(), NotifyOffNow(), NotifySleepNow(), NotifySwitchingStartNow(), ReceiveError(), ReceiveOk(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), StartDataTxTimers(), and StartTransmission().
Current TXOP.
Definition at line 866 of file mac-low.h.
Referenced by BlockAckTimeout(), CancelAllEvents(), CfPollTimeout(), CtsTimeout(), EndTxNoAck(), NormalAckTimeout(), NotifyOffNow(), NotifySleepNow(), NotifySwitchingStartNow(), ReceiveError(), ReceiveOk(), SendDataAfterCts(), SendDataPacket(), StartDataTxTimers(), StartTransmission(), WaitIfsAfterEndTxFragment(), and WaitIfsAfterEndTxPacket().
|
private |
TXVECTOR used for the current packet transmission.
Definition at line 906 of file mac-low.h.
Referenced by CanTransmitNextCfFrame(), ReceiveOk(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), and StartTransmission().
|
private |
EDCA queues.
Definition at line 903 of file mac-low.h.
Referenced by CreateBlockAckAgreement(), ForwardDown(), GetEdca(), ReceiveOk(), RegisterEdcaForAc(), ResetBlockAckInactivityTimerIfNeeded(), and StartTransmission().
|
private |
Event for finishing transmission that does not require Ack.
Definition at line 862 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), and StartDataTxTimers().
|
private |
The time when the last beacon frame transmission started.
Definition at line 878 of file mac-low.h.
Referenced by ForwardDown().
|
private |
The duration of the latest NAV.
Definition at line 875 of file mac-low.h.
Referenced by DoNavResetNow(), DoNavStartNow(), IsNavZero(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().
|
private |
The time when the latest NAV started.
Definition at line 874 of file mac-low.h.
Referenced by DoNavResetNow(), DoNavStartNow(), IsNavZero(), NotifyNav(), NotifyOffNow(), NotifySleepNow(), and NotifySwitchingStartNow().
|
private |
A-MPDU aggregator.
Definition at line 853 of file mac-low.h.
Referenced by DoDispose(), GetMpduAggregator(), SetMpduAggregator(), and StartTransmission().
|
private |
A-MSDU aggregator.
Definition at line 852 of file mac-low.h.
Referenced by DoDispose(), GetMsduAggregator(), and SetMsduAggregator().
|
private |
Event to reset NAV when CTS is not received.
Definition at line 863 of file mac-low.h.
Referenced by NotifyNav(), NotifyOffNow(), NotifySleepNow(), NotifySwitchingStartNow(), and RxStartIndication().
|
private |
Normal Ack timeout event.
Definition at line 855 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), RxStartIndication(), and StartDataTxTimers().
Pointer to WifiPhy (actually send/receives frames)
Definition at line 827 of file mac-low.h.
Referenced by CalculateOverallTxTime(), CalculateOverheadTxTime(), CalculateTransmissionTime(), CanTransmitNextCfFrame(), DoDispose(), ForwardDown(), GetAckDuration(), GetAckTxVector(), GetBlockAckDuration(), GetBlockAckRequestDuration(), GetBlockAckTxVector(), GetControlAnswerMode(), GetCtsDuration(), GetCtsTxVector(), GetPhy(), GetPifs(), GetSifs(), GetSlotTime(), IsWithinSizeAndTimeLimits(), NotifyNav(), ResetPhy(), SendBlockAckAfterAmpdu(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), SetPhy(), StartDataTxTimers(), and StartTransmission().
|
private |
Listener needed to monitor when a channel switching occurs.
Definition at line 883 of file mac-low.h.
Referenced by DoDispose(), RemovePhyMacLowListener(), and SetupPhyMacLowListener().
|
private |
Flag if the device is operating in promiscuous mode.
Definition at line 881 of file mac-low.h.
Referenced by IsPromisc(), ReceiveOk(), and SetPromisc().
|
private |
Callback to pass packet up.
Definition at line 830 of file mac-low.h.
Referenced by ReceiveOk(), RxCompleteBufferedPacketsUntilFirstLost(), RxCompleteBufferedPacketsWithSmallerSequence(), and SetRxCallback().
|
private |
Address of this MacLow (Mac48Address)
Definition at line 868 of file mac-low.h.
Referenced by DeaggregateAmpduAndReceive(), GetAddress(), GetResponseDuration(), NotifyNav(), ReceiveOk(), SendCtsToSelf(), SendRtsForPacket(), and SetAddress().
|
private |
Event to send Ack.
Definition at line 859 of file mac-low.h.
Referenced by CancelAllEvents(), DeaggregateAmpduAndReceive(), DoDispose(), and ReceiveOk().
|
private |
Event to send CTS.
Definition at line 858 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), and ReceiveOk().
|
private |
Event to send Data.
Definition at line 860 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and SendCtsToSelf().
|
private |
Pointer to WifiRemoteStationManager (rate control)
Definition at line 829 of file mac-low.h.
Referenced by CtsTimeout(), DoDispose(), EndTxNoAck(), ForwardDown(), GetAckTxVector(), GetBlockAckTxVector(), GetControlAnswerMode(), GetCtsTxVector(), GetDataTxVector(), GetRtsTxVector(), IsCfPeriod(), NeedCtsToSelf(), NotifySwitchingStartNow(), ReceiveMpdu(), ReceiveOk(), SendBlockAckAfterBlockAckRequest(), SetWifiRemoteStationManager(), and StartTransmission().
|
private |
Transmission parameters of the current packet.
Definition at line 867 of file mac-low.h.
Referenced by ReceiveOk(), SendBlockAckResponse(), SendCtsToSelf(), SendDataAfterCts(), SendDataPacket(), SendRtsForPacket(), StartDataTxTimers(), and StartTransmission().
|
private |
Wait for IFS event.
Definition at line 861 of file mac-low.h.
Referenced by CancelAllEvents(), DoDispose(), ReceiveOk(), and StartDataTxTimers().