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

Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MSDU) and block ack sessions, for a given access class. More...

#include "qos-txop.h"

+ Inheritance diagram for ns3::QosTxop:
+ Collaboration diagram for ns3::QosTxop:

Public Member Functions

 QosTxop ()
 
virtual ~QosTxop ()
 
void BaTxFailed (const WifiMacHeader &hdr)
 The packet we sent was successfully received by the receiver. More...
 
void BaTxOk (const WifiMacHeader &hdr)
 The packet we sent was successfully received by the receiver. More...
 
void CompleteConfig (void)
 Complete block ACK configuration. More...
 
void CompleteMpduTx (Ptr< WifiMacQueueItem > mpdu)
 Stores an MPDU (part of an A-MPDU) in blockackagreement (i.e. More...
 
Ptr< WifiMacQueueItemDequeuePeekedFrame (Ptr< const WifiMacQueueItem > peekedItem, WifiTxVector txVector, bool aggregate=true, uint32_t ampduSize=0, Time ppduDurationLimit=Seconds(0))
 Dequeue the frame that has been previously peeked by calling PeekNextFrame or PeekNextFrameByTidAndAddress. More...
 
void EndTxNoAck (void)
 Event handler when a transmission that does not require an ACK has completed. More...
 
Time GetAddBaResponseTimeout (void) const
 Get the timeout for ADDBA response. More...
 
bool GetAmpduExist (Mac48Address dest) const
 Return whether A-MPDU is used to transmit data to a peer station. More...
 
bool GetBaAgreementEstablished (Mac48Address address, uint8_t tid) const
 
uint16_t GetBaBufferSize (Mac48Address address, uint8_t tid) const
 
uint16_t GetBaStartingSequence (Mac48Address address, uint8_t tid) const
 
uint8_t GetBlockAckThreshold (void) const
 Return the current threshold for block ACK mechanism. More...
 
Time GetFailedAddBaTimeout (void) const
 Get the timeout for failed BA agreement. More...
 
Ptr< PacketGetFragmentPacket (WifiMacHeader *hdr)
 Get the next fragment from the packet with appropriate Wifi header for the fragment. More...
 
uint16_t GetNextSequenceNumberFor (const WifiMacHeader *hdr)
 Return the next sequence number for the given header. More...
 
MacLowTransmissionParameters GetTransmissionParameters (Ptr< const WifiMacQueueItem > frame) const
 Compute the MacLow transmission parameters for the given frame. More...
 
TypeOfStation GetTypeOfStation (void) const
 Return type of station. More...
 
void GotAck (void)
 Event handler when an ACK is received. More...
 
void GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
 Event handler when an ADDBA response is received. More...
 
void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
 Event handler when a Block ACK is received. More...
 
void GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
 Event handler when a DELBA frame is received. More...
 
bool IsQosTxop (void) const
 Check for QoS TXOP. More...
 
Mac48Address MapDestAddressForAggregation (const WifiMacHeader &hdr)
 This functions are used only to correctly set destination address in A-MSDU subframes. More...
 
Mac48Address MapSrcAddressForAggregation (const WifiMacHeader &hdr)
 This functions are used only to correctly set source address in A-MSDU subframes. More...
 
void MissedAck (void)
 Event handler when an ACK is missed. More...
 
void MissedBlockAck (uint8_t nMpdus)
 Event handler when a Block ACK timeout has occurred. More...
 
bool NeedBarRetransmission (void)
 Check if Block ACK Request should be re-transmitted. More...
 
bool NeedFragmentation (void) const
 Check if the current packet should be fragmented. More...
 
void NotifyAccessGranted (void)
 Notify the EDCAF that access has been granted. More...
 
void NotifyCollision (void)
 Notify the EDCAF that collision has occurred. More...
 
void NotifyInternalCollision (void)
 Notify the EDCAF that internal collision has occurred. More...
 
void NotifyMissedCts (std::list< Ptr< WifiMacQueueItem >> mpduList)
 Event handler when a CTS timeout has occurred. More...
 
Ptr< const WifiMacQueueItemPeekNextFrame (uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast())
 Peek the next frame to transmit to the given receiver and of the given TID from the Block Ack manager retransmit queue first and, if not found, from the EDCA queue. More...
 
uint16_t PeekNextSequenceNumberFor (const WifiMacHeader *hdr)
 Return the next sequence number for the Traffic ID and destination, but do not pick it (i.e. More...
 
void PushFront (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 
void RestartAccessIfNeeded (void)
 Restart access request if needed. More...
 
void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator)
 Sends DELBA frame to cancel a block ack agreement with sta addressed by addr for tid tid. More...
 
void SetAccessCategory (AcIndex ac)
 Set the access category of this EDCAF. More...
 
void SetAddBaResponseTimeout (Time addBaResponseTimeout)
 Set the timeout to wait for ADDBA response. More...
 
void SetAmpduExist (Mac48Address dest, bool enableAmpdu)
 Set indication whether A-MPDU is used to transmit data to a peer station. More...
 
void SetBlockAckInactivityTimeout (uint16_t timeout)
 Set the Block Ack inactivity timeout. More...
 
void SetBlockAckThreshold (uint8_t threshold)
 Set threshold for block ACK mechanism. More...
 
void SetFailedAddBaTimeout (Time failedAddBaTimeout)
 Set the timeout for failed BA agreement. More...
 
void SetTypeOfStation (TypeOfStation type)
 Set type of station with the given type. More...
 
void SetWifiRemoteStationManager (const Ptr< WifiRemoteStationManager > remoteManager)
 Set WifiRemoteStationsManager this QosTxop is associated to. More...
 
void StartAccessIfNeeded (void)
 Request access from DCF manager if needed. More...
 
void StartNextPacket (void)
 Start transmission for the next packet if allowed by the TxopLimit. More...
 
- Public Member Functions inherited from ns3::Txop
 Txop ()
 
virtual ~Txop ()
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
virtual void Cancel (void)
 Cancel the transmission. More...
 
bool CanStartNextPolling (void) const
 Check if the next PCF transmission can fit in the remaining CFP duration. More...
 
uint8_t GetAifsn (void) const
 Return the number of slots that make up an AIFS. More...
 
Ptr< MacLowGetLow (void) const
 Return the MacLow associated with this Txop. More...
 
uint32_t GetMaxCw (void) const
 Return the maximum contention window size. More...
 
uint32_t GetMinCw (void) const
 Return the minimum contention window size. More...
 
Time GetTxopLimit (void) const
 Return the TXOP limit. More...
 
Ptr< WifiMacQueueGetWifiMacQueue () const
 Return the packet queue associated with this Txop. More...
 
void GotCfEnd (void)
 Event handler when a CF-END frame is received. More...
 
virtual bool IsAccessRequested (void) const
 
void MissedCfPollResponse (bool expectedCfAck)
 Event handler when a response to a CF-POLL frame is missed. More...
 
virtual void MissedCts (void)
 Event handler when a CTS timeout has occurred. More...
 
virtual void NotifyChannelSwitching (void)
 When a channel switching occurs, enqueued packets are removed. More...
 
virtual void NotifyOff (void)
 When off operation occurs, the queue gets cleaned up. More...
 
virtual void NotifyOn (void)
 When on operation occurs, channel access will be started. More...
 
virtual void NotifySleep (void)
 When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the front of the queue. More...
 
virtual void NotifyWakeUp (void)
 When wake up operation occurs, channel access will be restarted. More...
 
virtual void Queue (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 
void SendCfFrame (WifiMacType frameType, Mac48Address addr)
 Sends CF frame to sta with address addr. More...
 
void SetAifsn (uint8_t aifsn)
 Set the number of slots that make up an AIFS. More...
 
void SetChannelAccessManager (const Ptr< ChannelAccessManager > manager)
 Set ChannelAccessManager this Txop is associated to. More...
 
void SetMacLow (const Ptr< MacLow > low)
 Set MacLow associated with this Txop. More...
 
void SetMaxCw (uint32_t maxCw)
 Set the maximum contention window size. More...
 
void SetMinCw (uint32_t minCw)
 Set the minimum contention window size. More...
 
void SetTxDroppedCallback (TxDropped callback)
 
void SetTxFailedCallback (TxFailed callback)
 
void SetTxMiddle (const Ptr< MacTxMiddle > txMiddle)
 Set MacTxMiddle this Txop is associated to. More...
 
void SetTxOkCallback (TxOk callback)
 
void SetTxopLimit (Time txopLimit)
 Set the TXOP limit. More...
 
void StartBackoffNow (uint32_t nSlots)
 
virtual void StartNextFragment (void)
 Start transmission for the next fragment. More...
 
- 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)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Txop
static TypeId GetTypeId (void)
 Get the type ID. 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...
 

Public Attributes

std::map< Mac48Address, bool > m_aMpduEnabled
 list containing flags whether A-MPDU is enabled for a given destination address More...
 

Private Member Functions

void AddBaResponseTimeout (Mac48Address recipient, uint8_t tid)
 Callback when ADDBA response is not received after timeout. More...
 
void CompleteTx (void)
 For now is typically invoked to complete transmission of a packets sent with ack policy Block Ack: the packet is buffered and dcf is reset. More...
 
void DoDispose (void)
 Destructor implementation. More...
 
void DoInitialize (void)
 Initialize() implementation. More...
 
uint32_t GetFragmentOffset (void) const
 Calculate the offset for the current fragment. More...
 
uint32_t GetFragmentSize (void) const
 Calculate the size of the current fragment. More...
 
uint32_t GetNextFragmentSize (void) const
 Calculate the size of the next fragment. More...
 
uint32_t GetNextTxopFragmentSize (uint32_t fragmentNumber) const
 Calculate the size of the next TXOP fragment. More...
 
uint32_t GetNTxopFragment (void) const
 Calculate the number of TXOP fragments needed for the transmission of the current packet. More...
 
uint32_t GetTxopFragmentOffset (uint32_t fragmentNumber) const
 Calculate the offset for the fragment. More...
 
uint32_t GetTxopFragmentSize (void) const
 Calculate the size of the current TXOP fragment. More...
 
Time GetTxopRemaining (void) const
 Return the remaining duration in the current TXOP. More...
 
bool IsLastFragment (void) const
 Check if the current fragment is the last fragment. More...
 
bool IsQosOldPacket (Ptr< const WifiMacQueueItem > mpdu)
 Check if the given MPDU is to be considered old according to the current starting sequence number of the transmit window, provided that a block ack agreement has been established with the recipient for the given TID. More...
 
bool IsTxopFragmentation (void) const
 Check if the current packet is fragmented because of an exceeded TXOP duration. More...
 
void ResetBa (Mac48Address recipient, uint8_t tid)
 Reset BA agreement after BA negotiation failed. More...
 
void SendAddBaRequest (Mac48Address recipient, uint8_t tid, uint16_t startSeq, uint16_t timeout, bool immediateBAck)
 Sends an ADDBA Request to establish a block ack agreement with sta addressed by recipient for tid tid. More...
 
void SendBlockAckRequest (const Bar &bar)
 After that all packets, for which a block ack agreement was established, have been transmitted, we have to send a block ack request. More...
 
bool SetupBlockAckIfNeeded (void)
 If number of packets in the queue reaches m_blockAckThreshold value, an ADDBA Request frame is sent to destination in order to setup a block ack. More...
 
void TerminateTxop (void)
 Update backoff and restart access if needed. More...
 
void VerifyBlockAck (void)
 Verifies if dequeued packet has to be transmitted with ack policy Block Ack. More...
 

Private Attributes

AcIndex m_ac
 the access category More...
 
Time m_addBaResponseTimeout
 timeout for ADDBA response More...
 
Ptr< BlockAckManagerm_baManager
 the Block ACK manager More...
 
uint16_t m_blockAckInactivityTimeout
 the Block ACK inactivity timeout More...
 
uint8_t m_blockAckThreshold
 the Block ACK threshold More...
 
BlockAckType m_blockAckType
 the Block ACK type More...
 
Bar m_currentBar
 the current BAR More...
 
bool m_currentIsFragmented
 flag whether current packet is fragmented More...
 
Time m_currentPacketTimestamp
 the current packet timestamp More...
 
Time m_failedAddBaTimeout
 timeout after failed BA agreement More...
 
bool m_isAccessRequestedForRts
 flag whether access is requested to transmit a RTS frame More...
 
Ptr< QosBlockedDestinationsm_qosBlockedDestinations
 QOS blocked destinations. More...
 
Time m_startTxop
 the start TXOP time More...
 
TracedCallback< Time, Timem_txopTrace
 TXOP trace callback. More...
 
TypeOfStation m_typeOfStation
 the type of station More...
 
bool m_useExplicitBarAfterMissedBlockAck
 flag whether explicit Block Ack Request should be sent upon missed Block Ack Response More...
 

Friends

class ::AmpduAggregationTest
 Allow test cases to access private members. More...
 
class ::HeAggregationTest
 
class ::TwoLevelAggregationTest
 
class AggregationCapableTransmissionListener
 allow AggregationCapableTransmissionListener class access More...
 

Additional Inherited Members

- Public Types inherited from ns3::Txop
typedef Callback< void, Ptr< const Packet > > TxDropped
 typedef for a callback to invoke when a packet is dropped. More...
 
typedef Callback< void, const WifiMacHeader & > TxFailed
 typedef for a callback to invoke when a packet transmission was failed. More...
 
typedef Callback< void, const WifiMacHeader & > TxOk
 typedef for a callback to invoke when a packet transmission was completed successfully. More...
 
- Protected Member Functions inherited from ns3::Txop
uint32_t GetBackoffSlots (void) const
 Return the current number of backoff slots. More...
 
Time GetBackoffStart (void) const
 Return the time when the backoff procedure started. More...
 
uint32_t GetCw (void) const
 
bool NeedDataRetransmission (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 Check if DATA should be re-transmitted if ACK was missed. More...
 
bool NeedRtsRetransmission (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 Check if RTS should be re-transmitted if CTS was missed. More...
 
void NextFragment (void)
 Continue to the next fragment. More...
 
virtual void NotifyAccessRequested (void)
 Notify that access request has been received. More...
 
void ResetCw (void)
 Update the value of the CW variable to take into account a transmission success or a transmission abort (stop transmission of a packet after the maximum number of retransmissions has been reached). More...
 
void TxDroppedPacket (Ptr< const WifiMacQueueItem > item)
 Pass the packet included in the wifi MAC queue item to the packet dropped callback. More...
 
void UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound)
 Update backoff slots that nSlots has passed. More...
 
void UpdateFailedCw (void)
 Update the value of the CW variable to take into account a transmission failure. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. 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...
 
- Protected Attributes inherited from ns3::Txop
bool m_accessRequested
 flag whether channel access is already requested More...
 
uint8_t m_aifsn
 the AIFSN More...
 
uint32_t m_backoff
 the current backoff More...
 
uint32_t m_backoffSlots
 the backoff slots More...
 
Time m_backoffStart
 the backoffStart variable is used to keep track of the time at which a backoff was started or the time at which the backoff counter was last updated. More...
 
TracedCallback< uint32_t > m_backoffTrace
 backoff trace value More...
 
Ptr< ChannelAccessManagerm_channelAccessManager
 the channel access manager More...
 
WifiMacHeader m_currentHdr
 the current header More...
 
Ptr< const Packetm_currentPacket
 the current packet More...
 
MacLowTransmissionParameters m_currentParams
 current transmission parameters More...
 
uint32_t m_cw
 the current CW More...
 
uint32_t m_cwMax
 the CW maximum More...
 
uint32_t m_cwMin
 the CW minimum More...
 
TracedValue< uint32_t > m_cwTrace
 CW trace value. More...
 
uint8_t m_fragmentNumber
 the fragment number More...
 
Ptr< MacLowm_low
 the MacLow More...
 
Ptr< WifiMacQueuem_queue
 the wifi MAC queue More...
 
Ptr< UniformRandomVariablem_rng
 the random stream More...
 
Ptr< WifiRemoteStationManagerm_stationManager
 the wifi remote station manager More...
 
TxDropped m_txDroppedCallback
 the packet dropped callback More...
 
TxFailed m_txFailedCallback
 the transmit failed callback More...
 
Ptr< MacTxMiddlem_txMiddle
 the MacTxMiddle More...
 
TxOk m_txOkCallback
 the transmit OK callback More...
 
Time m_txopLimit
 the txop limit time More...
 

Detailed Description

Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MSDU) and block ack sessions, for a given access class.


This class implements the packet fragmentation and retransmission policy for QoS data frames. It uses the ns3::MacLow and ns3::ChannelAccessManager helper classes to respectively send packets and decide when to send them. Packets are stored in a ns3::WifiMacQueue until they can be sent.

This queue contains packets for a particular access class. Possibles access classes are:

  • AC_VO : voice, tid = 6,7
  • AC_VI : video, tid = 4,5
  • AC_BE : best-effort, tid = 0,3
  • AC_BK : background, tid = 1,2

This class also implements block ack sessions and MSDU aggregation (A-MSDU). If A-MSDU is enabled for that access class, it picks several packets from the queue instead of a single one and sends the aggregated packet to ns3::MacLow.

The fragmentation policy currently implemented uses a simple threshold: any packet bigger than this threshold is fragmented in fragments whose size is smaller than the threshold.

The retransmission policy is also very simple: every packet is retransmitted until it is either successfully transmitted or it has been retransmitted up until the ssrc or slrc thresholds.

The rts/cts policy is similar to the fragmentation policy: when a packet is bigger than a threshold, the rts/cts protocol is used.

Config Paths

ns3::QosTxop is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/Txop/$ns3::QosTxop"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VO_Txop"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VI_Txop"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BE_Txop"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_Txop"

Attributes

  • UseExpliciteBarAfterMissedBlockAck: Specify whether explicit Block Ack Request should be sent upon missed Block Ack Response.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • AddBaResponseTimeout: The timeout to wait for ADDBA response after the ACK to ADDBA request is received.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +1000000.0ns
    • Flags: construct write read
  • FailedAddBaTimeout: The timeout after a failed BA agreement. During this timeout, the originator resumes sending packets using normal MPDU. After that, BA agreement is reset and the originator will retry BA negotiation.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +200000000.0ns
    • Flags: construct write read
  • BlockAckManager: The BlockAckManager object.

Attributes defined in parent class ns3::Txop

  • MinCw: The minimum value of the contention window.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 15
    • Flags: construct write read
  • MaxCw: The maximum value of the contention window.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1023
    • Flags: construct write read
  • Aifsn: The AIFSN: the default value conforms to non-QOS.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 2
    • Flags: construct write read
  • TxopLimit: The TXOP limit: the default value conforms to non-QoS.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read
  • Queue: The WifiMacQueue object

TraceSources

TraceSources defined in parent class ns3::Txop

Size of this type is 440 bytes (on a 64-bit architecture).

Definition at line 91 of file qos-txop.h.

Constructor & Destructor Documentation

◆ QosTxop()

◆ ~QosTxop()

ns3::QosTxop::~QosTxop ( )
virtual

Definition at line 110 of file qos-txop.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddBaResponseTimeout()

void ns3::QosTxop::AddBaResponseTimeout ( Mac48Address  recipient,
uint8_t  tid 
)
private

Callback when ADDBA response is not received after timeout.

Parameters
recipientMAC address of recipient
tidtraffic ID

Definition at line 1723 of file qos-txop.cc.

References ns3::Txop::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Txop::m_backoff, ns3::Txop::m_backoffTrace, m_baManager, m_failedAddBaTimeout, ns3::Txop::m_rng, NS_LOG_FUNCTION, ns3::OriginatorBlockAckAgreement::PENDING, ResetBa(), RestartAccessIfNeeded(), ns3::Simulator::Schedule(), and ns3::Txop::StartBackoffNow().

Referenced by GotAck().

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

◆ BaTxFailed()

void ns3::QosTxop::BaTxFailed ( const WifiMacHeader hdr)

The packet we sent was successfully received by the receiver.

Parameters
hdrthe header of the packet that we failed to sent.

Definition at line 1713 of file qos-txop.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::Txop::m_currentHdr, ns3::Txop::m_txFailedCallback, and NS_LOG_FUNCTION.

Referenced by QosTxop().

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

◆ BaTxOk()

void ns3::QosTxop::BaTxOk ( const WifiMacHeader hdr)

The packet we sent was successfully received by the receiver.

Parameters
hdrthe header of the packet that we successfully sent.

Definition at line 1703 of file qos-txop.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::Txop::m_currentHdr, ns3::Txop::m_txOkCallback, and NS_LOG_FUNCTION.

Referenced by QosTxop().

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

◆ CompleteConfig()

void ns3::QosTxop::CompleteConfig ( void  )

Complete block ACK configuration.

Definition at line 1563 of file qos-txop.cc.

References m_ac, m_baManager, ns3::Txop::m_low, ns3::Txop::m_txMiddle, ns3::MakeCallback(), NS_LOG_FUNCTION, and SendDelbaFrame().

+ Here is the call graph for this function:

◆ CompleteMpduTx()

void ns3::QosTxop::CompleteMpduTx ( Ptr< WifiMacQueueItem mpdu)

Stores an MPDU (part of an A-MPDU) in blockackagreement (i.e.

the sender is waiting for a blockack containing the sequence number of this MPDU). It also calls NotifyMpdu transmission that updates the status of OriginatorBlockAckAgreement.

Parameters
mpdureceived MPDU.

Definition at line 1509 of file qos-txop.cc.

References m_baManager, ns3::Txop::m_txMiddle, ns3::WifiMacHeader::NORMAL_ACK, and NS_ASSERT.

◆ CompleteTx()

void ns3::QosTxop::CompleteTx ( void  )
private

For now is typically invoked to complete transmission of a packets sent with ack policy Block Ack: the packet is buffered and dcf is reset.

Definition at line 1492 of file qos-txop.cc.

References ns3::WifiMacHeader::BLOCK_ACK, ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::IsQosBlockAck(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsRetry(), m_baManager, ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, m_currentPacketTimestamp, ns3::Txop::m_txMiddle, and NS_LOG_FUNCTION.

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

◆ DequeuePeekedFrame()

Ptr< WifiMacQueueItem > ns3::QosTxop::DequeuePeekedFrame ( Ptr< const WifiMacQueueItem peekedItem,
WifiTxVector  txVector,
bool  aggregate = true,
uint32_t  ampduSize = 0,
Time  ppduDurationLimit = Seconds (0) 
)

Dequeue the frame that has been previously peeked by calling PeekNextFrame or PeekNextFrameByTidAndAddress.

If the peeked frame is a QoS Data frame, it is actually dequeued if it 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 does not exceed the given PPDU duration limit (if strictly positive). If the peeked frame is a unicast QoS Data frame stored in the EDCA queue, attempt to perform A-MSDU aggregation (while meeting the constraints mentioned above) if aggregate is true and assign a sequence number to the dequeued frame.

Parameters
peekedItemthe peeked frame.
txVectorthe TX vector used to transmit the peeked frame
ampduSizethe size of the existing A-MPDU, if any
ppduDurationLimitthe limit on the PPDU duration
Returns
the dequeued frame.

Definition at line 267 of file qos-txop.cc.

References GetBaAgreementEstablished(), GetBaBufferSize(), GetBaStartingSequence(), ns3::Mac48Address::IsBroadcast(), ns3::IsInWindow(), m_baManager, ns3::Txop::m_low, m_qosBlockedDestinations, ns3::Txop::m_queue, ns3::Txop::m_txMiddle, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::QosUtilsIsOldPacket().

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

◆ DoDispose()

void ns3::QosTxop::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::Txop.

Definition at line 116 of file qos-txop.cc.

References ns3::Txop::DoDispose(), m_baManager, m_qosBlockedDestinations, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::QosTxop::DoInitialize ( void  )
privatevirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Txop.

Definition at line 1692 of file qos-txop.cc.

References ns3::Txop::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Txop::m_backoff, ns3::Txop::m_backoffTrace, ns3::Txop::m_cwTrace, ns3::Txop::m_rng, NS_LOG_FUNCTION, ns3::Txop::ResetCw(), and ns3::Txop::StartBackoffNow().

+ Here is the call graph for this function:

◆ EndTxNoAck()

void ns3::QosTxop::EndTxNoAck ( void  )
virtual

Event handler when a transmission that does not require an ACK has completed.

Reimplemented from ns3::Txop.

Definition at line 1145 of file qos-txop.cc.

References ns3::Txop::m_currentPacket, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Txop::ResetCw(), and TerminateTxop().

+ Here is the call graph for this function:

◆ GetAddBaResponseTimeout()

Time ns3::QosTxop::GetAddBaResponseTimeout ( void  ) const

Get the timeout for ADDBA response.

Returns
the timeout to wait for ADDBA response

Definition at line 1756 of file qos-txop.cc.

References m_addBaResponseTimeout.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetAmpduExist()

bool ns3::QosTxop::GetAmpduExist ( Mac48Address  dest) const

Return whether A-MPDU is used to transmit data to a peer station.

Parameters
destaddress of peer station
Returns
true if A-MPDU is used by the peer station

Definition at line 1474 of file qos-txop.cc.

References m_aMpduEnabled, and NS_LOG_FUNCTION.

Referenced by MissedAck(), MissedBlockAck(), NeedFragmentation(), NotifyAccessGranted(), and StartNextPacket().

+ Here is the caller graph for this function:

◆ GetBaAgreementEstablished()

bool ns3::QosTxop::GetBaAgreementEstablished ( Mac48Address  address,
uint8_t  tid 
) const
Parameters
addressrecipient address of the peer station
tidtraffic ID.
Returns
true if a block ack agreement is established, false otherwise.

Checks if a block ack agreement is established with station addressed by recipient for tid tid.

Definition at line 125 of file qos-txop.cc.

References first::address, ns3::OriginatorBlockAckAgreement::ESTABLISHED, and m_baManager.

Referenced by DequeuePeekedFrame(), GetTransmissionParameters(), GotAck(), IsQosOldPacket(), MissedAck(), NeedFragmentation(), NotifyMissedCts(), and PeekNextFrame().

+ Here is the caller graph for this function:

◆ GetBaBufferSize()

uint16_t ns3::QosTxop::GetBaBufferSize ( Mac48Address  address,
uint8_t  tid 
) const
Parameters
addressrecipient address of the peer station
tidtraffic ID.
Returns
the negociated buffer size during ADDBA handshake.

Returns the negociated buffer size during ADDBA handshake with station addressed by recipient for tid tid.

Definition at line 131 of file qos-txop.cc.

References first::address, and m_baManager.

Referenced by DequeuePeekedFrame(), GetTransmissionParameters(), and PeekNextFrame().

+ Here is the caller graph for this function:

◆ GetBaStartingSequence()

uint16_t ns3::QosTxop::GetBaStartingSequence ( Mac48Address  address,
uint8_t  tid 
) const
Parameters
addressrecipient address of the peer station
tidtraffic ID.
Returns
the starting sequence number of the originator transmit window.

Returns the current starting sequence number of the transmit window on the originator (WinStartO) of the Block Ack agreement established with the given recipient for the given TID.

Definition at line 137 of file qos-txop.cc.

References first::address, and m_baManager.

Referenced by DequeuePeekedFrame(), IsQosOldPacket(), and PeekNextFrame().

+ Here is the caller graph for this function:

◆ GetBlockAckThreshold()

uint8_t ns3::QosTxop::GetBlockAckThreshold ( void  ) const

Return the current threshold for block ACK mechanism.

Returns
the current threshold for block ACK mechanism.

Definition at line 1587 of file qos-txop.cc.

References m_blockAckThreshold, and NS_LOG_FUNCTION.

Referenced by NotifyAccessGranted(), and SetupBlockAckIfNeeded().

+ Here is the caller graph for this function:

◆ GetFailedAddBaTimeout()

Time ns3::QosTxop::GetFailedAddBaTimeout ( void  ) const

Get the timeout for failed BA agreement.

Returns
the timeout for failed BA agreement

Definition at line 1769 of file qos-txop.cc.

References m_failedAddBaTimeout.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetFragmentOffset()

uint32_t ns3::QosTxop::GetFragmentOffset ( void  ) const
privatevirtual

Calculate the offset for the current fragment.

Returns
the offset for the current fragment.

Reimplemented from ns3::Txop.

Definition at line 1317 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentOffset(), GetTxopFragmentOffset(), IsTxopFragmentation(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_fragmentNumber, and ns3::Txop::m_stationManager.

Referenced by GetFragmentPacket().

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

◆ GetFragmentPacket()

Ptr< Packet > ns3::QosTxop::GetFragmentPacket ( WifiMacHeader hdr)
virtual

Get the next fragment from the packet with appropriate Wifi header for the fragment.

Parameters
hdrWi-Fi header.
Returns
the fragment with the current fragment number.

Reimplemented from ns3::Txop.

Definition at line 1349 of file qos-txop.cc.

References ns3::Packet::CreateFragment(), GetFragmentOffset(), GetFragmentSize(), IsLastFragment(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_fragmentNumber, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetFragmentNumber(), ns3::WifiMacHeader::SetMoreFragments(), and ns3::WifiMacHeader::SetNoMoreFragments().

Referenced by NotifyAccessGranted().

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

◆ GetFragmentSize()

uint32_t ns3::QosTxop::GetFragmentSize ( void  ) const
privatevirtual

Calculate the size of the current fragment.

Returns
the size of the current fragment.

Reimplemented from ns3::Txop.

Definition at line 1287 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentSize(), GetNextTxopFragmentSize(), IsTxopFragmentation(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_fragmentNumber, and ns3::Txop::m_stationManager.

Referenced by GetFragmentPacket().

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

◆ GetNextFragmentSize()

uint32_t ns3::QosTxop::GetNextFragmentSize ( void  ) const
privatevirtual

Calculate the size of the next fragment.

Returns
the size of the next fragment.

Reimplemented from ns3::Txop.

Definition at line 1302 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentSize(), GetNextTxopFragmentSize(), IsTxopFragmentation(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_fragmentNumber, and ns3::Txop::m_stationManager.

Referenced by NotifyAccessGranted().

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

◆ GetNextSequenceNumberFor()

uint16_t ns3::QosTxop::GetNextSequenceNumberFor ( const WifiMacHeader hdr)

Return the next sequence number for the given header.

Parameters
hdrWi-Fi header.
Returns
the next sequence number.

Definition at line 164 of file qos-txop.cc.

References ns3::Txop::m_txMiddle.

◆ GetNextTxopFragmentSize()

uint32_t ns3::QosTxop::GetNextTxopFragmentSize ( uint32_t  fragmentNumber) const
private

Calculate the size of the next TXOP fragment.

Parameters
fragmentNumbernumber of the next fragment
Returns
the next TXOP fragment size

Definition at line 1268 of file qos-txop.cc.

References GetNTxopFragment(), ns3::Packet::GetSize(), GetTxopFragmentSize(), ns3::Txop::m_currentPacket, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by GetFragmentSize(), and GetNextFragmentSize().

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

◆ GetNTxopFragment()

uint32_t ns3::QosTxop::GetNTxopFragment ( void  ) const
private

Calculate the number of TXOP fragments needed for the transmission of the current packet.

Returns
the number of TXOP fragments needed for the transmission of the current packet

Definition at line 1229 of file qos-txop.cc.

References ns3::Packet::GetSize(), GetTxopFragmentSize(), ns3::Txop::m_currentPacket, and NS_LOG_DEBUG.

Referenced by GetNextTxopFragmentSize(), and IsLastFragment().

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

◆ GetTransmissionParameters()

◆ GetTxopFragmentOffset()

uint32_t ns3::QosTxop::GetTxopFragmentOffset ( uint32_t  fragmentNumber) const
private

Calculate the offset for the fragment.

Parameters
fragmentNumbernumber of the fragment
Returns
the TXOP fragment offset

Definition at line 1242 of file qos-txop.cc.

References ns3::Packet::GetSize(), GetTxopFragmentSize(), ns3::Txop::m_currentPacket, NS_ASSERT, and NS_LOG_DEBUG.

Referenced by GetFragmentOffset().

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

◆ GetTxopFragmentSize()

uint32_t ns3::QosTxop::GetTxopFragmentSize ( void  ) const
private

Calculate the size of the current TXOP fragment.

Returns
the size of the current TXOP fragment

Definition at line 1196 of file qos-txop.cc.

References ns3::Txop::GetLow(), ns3::Packet::GetSize(), ns3::Txop::GetTxopLimit(), ns3::Time::IsZero(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_currentParams, and NS_ASSERT.

Referenced by GetNextTxopFragmentSize(), GetNTxopFragment(), GetTxopFragmentOffset(), and IsTxopFragmentation().

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

◆ GetTxopRemaining()

Time ns3::QosTxop::GetTxopRemaining ( void  ) const
privatevirtual

Return the remaining duration in the current TXOP.

Returns
the remaining duration in the current TXOP.

Reimplemented from ns3::Txop.

Definition at line 1132 of file qos-txop.cc.

References ns3::Txop::GetTxopLimit(), ns3::Time::IsStrictlyNegative(), m_startTxop, ns3::Simulator::Now(), NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

◆ GetTypeId()

◆ GetTypeOfStation()

TypeOfStation ns3::QosTxop::GetTypeOfStation ( void  ) const

Return type of station.

Returns
type of station.

Definition at line 158 of file qos-txop.cc.

References m_typeOfStation.

Referenced by MapDestAddressForAggregation(), and MapSrcAddressForAggregation().

+ Here is the caller graph for this function:

◆ GotAck()

◆ GotAddBaResponse()

void ns3::QosTxop::GotAddBaResponse ( const MgtAddBaResponseHeader respHdr,
Mac48Address  recipient 
)

Event handler when an ADDBA response is received.

Parameters
respHdrADDBA response header.
recipientaddress of the recipient.

Definition at line 1419 of file qos-txop.cc.

References ns3::MgtAddBaResponseHeader::GetStatusCode(), ns3::MgtAddBaResponseHeader::GetTid(), ns3::StatusCode::IsSuccess(), m_baManager, NS_LOG_DEBUG, NS_LOG_FUNCTION, and RestartAccessIfNeeded().

+ Here is the call graph for this function:

◆ GotBlockAck()

void ns3::QosTxop::GotBlockAck ( const CtrlBAckResponseHeader blockAck,
Mac48Address  recipient,
double  rxSnr,
WifiMode  txMode,
double  dataSnr 
)
virtual

Event handler when a Block ACK is received.

Parameters
blockAckblock ack.
recipientaddress of the recipient.
rxSnrSNR of the block ack itself.
txModewifi mode.
dataSnrreported data SNR from the peer.

Reimplemented from ns3::Txop.

Definition at line 1445 of file qos-txop.cc.

References ns3::WifiMode::GetUniqueName(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_baManager, ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_txOkCallback, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Txop::ResetCw().

+ Here is the call graph for this function:

◆ GotDelBaFrame()

void ns3::QosTxop::GotDelBaFrame ( const MgtDelBaHeader delBaHdr,
Mac48Address  recipient 
)

Event handler when a DELBA frame is received.

Parameters
delBaHdrDELBA header.
recipientaddress of the recipient.

Definition at line 1437 of file qos-txop.cc.

References ns3::MgtDelBaHeader::GetTid(), m_baManager, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsLastFragment()

bool ns3::QosTxop::IsLastFragment ( void  ) const
privatevirtual

Check if the current fragment is the last fragment.

Returns
true if the current fragment is the last fragment, false otherwise.

Reimplemented from ns3::Txop.

Definition at line 1333 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), GetNTxopFragment(), ns3::WifiRemoteStationManager::IsLastFragment(), IsTxopFragmentation(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_fragmentNumber, and ns3::Txop::m_stationManager.

Referenced by GetFragmentPacket(), and NotifyAccessGranted().

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

◆ IsQosOldPacket()

bool ns3::QosTxop::IsQosOldPacket ( Ptr< const WifiMacQueueItem mpdu)
private

Check if the given MPDU is to be considered old according to the current starting sequence number of the transmit window, provided that a block ack agreement has been established with the recipient for the given TID.

Parameters
mpduthe given MPDU
Returns
true if the MPDU is to be considered old, false otherwise

Definition at line 176 of file qos-txop.cc.

References GetBaAgreementEstablished(), GetBaStartingSequence(), NS_LOG_FUNCTION, and ns3::QosUtilsIsOldPacket().

Referenced by PeekNextFrame().

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

◆ IsQosTxop()

bool ns3::QosTxop::IsQosTxop ( void  ) const
virtual

Check for QoS TXOP.

Returns
true if QoS TXOP.

Reimplemented from ns3::Txop.

Definition at line 1775 of file qos-txop.cc.

◆ IsTxopFragmentation()

bool ns3::QosTxop::IsTxopFragmentation ( void  ) const
private

Check if the current packet is fragmented because of an exceeded TXOP duration.

Returns
true if the current packet is fragmented because of an exceeded TXOP duration, false otherwise

Definition at line 1181 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentSize(), GetTxopFragmentSize(), ns3::Txop::GetTxopLimit(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_stationManager, and ns3::WifiRemoteStationManager::NeedFragmentation().

Referenced by GetFragmentOffset(), GetFragmentSize(), GetNextFragmentSize(), and IsLastFragment().

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

◆ MapDestAddressForAggregation()

Mac48Address ns3::QosTxop::MapDestAddressForAggregation ( const WifiMacHeader hdr)

This functions are used only to correctly set destination address in A-MSDU subframes.

If aggregating sta is a STA (in an infrastructured network): DA = Address3 If aggregating sta is an AP DA = Address1

Parameters
hdrWi-Fi header
Returns
Mac48Address

Definition at line 1393 of file qos-txop.cc.

References ns3::ADHOC_STA, ns3::AP, ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr3(), GetTypeOfStation(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ MapSrcAddressForAggregation()

Mac48Address ns3::QosTxop::MapSrcAddressForAggregation ( const WifiMacHeader hdr)

This functions are used only to correctly set source address in A-MSDU subframes.

If aggregating sta is a STA (in an infrastructured network): SA = Address2 If aggregating sta is an AP SA = Address3

Parameters
hdrWi-Fi header
Returns
Mac48Address

Definition at line 1377 of file qos-txop.cc.

References ns3::ADHOC_STA, ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), GetTypeOfStation(), NS_LOG_FUNCTION, and ns3::STA.

+ Here is the call graph for this function:

◆ MissedAck()

◆ MissedBlockAck()

◆ NeedBarRetransmission()

bool ns3::QosTxop::NeedBarRetransmission ( void  )

◆ NeedFragmentation()

◆ NotifyAccessGranted()

void ns3::QosTxop::NotifyAccessGranted ( void  )
virtual

Notify the EDCAF that access has been granted.

Reimplemented from ns3::Txop.

Definition at line 460 of file qos-txop.cc.

References ns3::BASIC_BLOCK_ACK, CompleteTx(), DequeuePeekedFrame(), ns3::MacLowTransmissionParameters::DisableAck(), ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::DisableRts(), ns3::MacLowTransmissionParameters::EnableNextData(), ns3::WifiMacHeader::GetAddr1(), GetAmpduExist(), GetBlockAckThreshold(), GetFragmentPacket(), GetNextFragmentSize(), ns3::WifiRemoteStationManager::GetQosSupported(), ns3::WifiMacHeader::GetQosTid(), ns3::Packet::GetSize(), GetTransmissionParameters(), ns3::Txop::GetTxopLimit(), GetTxopRemaining(), ns3::WifiMacHeader::GetType(), ns3::Mac48Address::IsBroadcast(), ns3::WifiMacHeader::IsData(), ns3::Mac48Address::IsGroup(), IsLastFragment(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), ns3::Time::IsStrictlyPositive(), ns3::Txop::m_accessRequested, m_baManager, m_blockAckType, m_currentBar, ns3::Txop::m_currentHdr, m_currentIsFragmented, ns3::Txop::m_currentPacket, m_currentPacketTimestamp, ns3::Txop::m_currentParams, ns3::Txop::m_fragmentNumber, m_isAccessRequestedForRts, ns3::Txop::m_low, ns3::Txop::m_queue, m_startTxop, ns3::Txop::m_stationManager, NeedFragmentation(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, PeekNextFrame(), ns3::OriginatorBlockAckAgreement::RESET, ns3::Seconds(), SendBlockAckRequest(), SetupBlockAckIfNeeded(), ns3::WifiRemoteStationManager::UpdateFragmentationThreshold(), VerifyBlockAck(), and ns3::WIFI_MAC_CTL_BACKREQ.

+ Here is the call graph for this function:

◆ NotifyCollision()

void ns3::QosTxop::NotifyCollision ( void  )
virtual

Notify the EDCAF that collision has occurred.

Reimplemented from ns3::Txop.

Definition at line 675 of file qos-txop.cc.

References ns3::Txop::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Txop::m_backoff, ns3::Txop::m_backoffTrace, ns3::Txop::m_rng, NS_LOG_FUNCTION, RestartAccessIfNeeded(), and ns3::Txop::StartBackoffNow().

+ Here is the call graph for this function:

◆ NotifyInternalCollision()

◆ NotifyMissedCts()

◆ PeekNextFrame()

Ptr< const WifiMacQueueItem > ns3::QosTxop::PeekNextFrame ( uint8_t  tid = 8,
Mac48Address  recipient = Mac48Address::GetBroadcast () 
)

Peek the next frame to transmit to the given receiver and of the given TID from the Block Ack manager retransmit queue first and, if not found, from the EDCA queue.

If tid is equal to 8 (invalid value) and recipient is the broadcast address, the first available frame is returned. Note that A-MSDU aggregation is never attempted (this is relevant if the frame is peeked from the EDCA queue). If the frame is peeked from the EDCA queue, it is assigned a sequence number peeked from MacTxMiddle.

Parameters
tidtraffic ID.
recipientthe receiver station address.
Returns
the peeked frame.

Definition at line 202 of file qos-txop.cc.

References ns3::WifiMacQueue::EMPTY, GetBaAgreementEstablished(), GetBaBufferSize(), GetBaStartingSequence(), ns3::IsInWindow(), IsQosOldPacket(), m_baManager, m_qosBlockedDestinations, ns3::Txop::m_queue, ns3::Txop::m_txMiddle, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetFragmentNumber(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), and ns3::WifiMacHeader::SetSequenceNumber().

Referenced by NotifyAccessGranted(), NotifyInternalCollision(), RestartAccessIfNeeded(), StartAccessIfNeeded(), and StartNextPacket().

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

◆ PeekNextSequenceNumberFor()

uint16_t ns3::QosTxop::PeekNextSequenceNumberFor ( const WifiMacHeader hdr)

Return the next sequence number for the Traffic ID and destination, but do not pick it (i.e.

the current sequence number remains unchanged).

Parameters
hdrWi-Fi header.
Returns
the next sequence number.

Definition at line 170 of file qos-txop.cc.

References ns3::Txop::m_txMiddle.

◆ PushFront()

void ns3::QosTxop::PushFront ( Ptr< const Packet packet,
const WifiMacHeader hdr 
)
Parameters
packetpacket to send.
hdrheader of packet to send.

Store the packet in the front of the internal queue until it can be sent safely.

Definition at line 1409 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::Txop::m_queue, ns3::Txop::m_stationManager, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::PrepareForQueue(), and StartAccessIfNeeded().

Referenced by SendDelbaFrame().

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

◆ ResetBa()

void ns3::QosTxop::ResetBa ( Mac48Address  recipient,
uint8_t  tid 
)
private

Reset BA agreement after BA negotiation failed.

Parameters
recipientMAC address of recipient
tidtraffic ID

Definition at line 1739 of file qos-txop.cc.

References ns3::OriginatorBlockAckAgreement::ESTABLISHED, m_baManager, and NS_LOG_FUNCTION.

Referenced by AddBaResponseTimeout(), MissedAck(), and MissedBlockAck().

+ Here is the caller graph for this function:

◆ RestartAccessIfNeeded()

◆ SendAddBaRequest()

void ns3::QosTxop::SendAddBaRequest ( Mac48Address  recipient,
uint8_t  tid,
uint16_t  startSeq,
uint16_t  timeout,
bool  immediateBAck 
)
private

Sends an ADDBA Request to establish a block ack agreement with sta addressed by recipient for tid tid.

Parameters
recipientaddress of the recipient.
tidtraffic ID.
startSeqstarting sequence.
timeouttimeout value.
immediateBAckflag to indicate whether immediate block ack is used.

Definition at line 1594 of file qos-txop.cc.

References ns3::Packet::AddHeader(), ns3::WifiActionHeader::BLOCK_ACK, ns3::WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST, ns3::WifiActionHeader::ActionValue::blockAck, ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::DisableRts(), ns3::MacLowTransmissionParameters::EnableAck(), m_baManager, ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_currentParams, ns3::Txop::m_low, ns3::Txop::m_stationManager, ns3::Txop::m_txMiddle, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiActionHeader::SetAction(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::MgtAddBaRequestHeader::SetAmsduSupport(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetFragmentNumber(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), timeout, ns3::WifiRemoteStationManager::UpdateFragmentationThreshold(), and ns3::WIFI_MAC_MGT_ACTION.

Referenced by SetupBlockAckIfNeeded().

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

◆ SendBlockAckRequest()

void ns3::QosTxop::SendBlockAckRequest ( const Bar bar)
private

After that all packets, for which a block ack agreement was established, have been transmitted, we have to send a block ack request.

Parameters
barthe block ack request.

Definition at line 1540 of file qos-txop.cc.

References ns3::Bar::bar, GetTransmissionParameters(), ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_currentParams, ns3::Txop::m_low, NS_LOG_FUNCTION, ns3::Bar::recipient, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_CTL_BACKREQ.

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

◆ SendDelbaFrame()

void ns3::QosTxop::SendDelbaFrame ( Mac48Address  addr,
uint8_t  tid,
bool  byOriginator 
)

◆ SetAccessCategory()

void ns3::QosTxop::SetAccessCategory ( AcIndex  ac)

Set the access category of this EDCAF.

Parameters
acaccess category.

Definition at line 1370 of file qos-txop.cc.

References m_ac, and NS_LOG_FUNCTION.

◆ SetAddBaResponseTimeout()

void ns3::QosTxop::SetAddBaResponseTimeout ( Time  addBaResponseTimeout)

Set the timeout to wait for ADDBA response.

Parameters
addBaResponseTimeoutthe timeout to wait for ADDBA response

Definition at line 1749 of file qos-txop.cc.

References m_addBaResponseTimeout, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetAmpduExist()

void ns3::QosTxop::SetAmpduExist ( Mac48Address  dest,
bool  enableAmpdu 
)

Set indication whether A-MPDU is used to transmit data to a peer station.

Parameters
destaddress of peer station.
enableAmpduflag whether A-MPDU is used or not.

Definition at line 1485 of file qos-txop.cc.

References m_aMpduEnabled, and NS_LOG_FUNCTION.

◆ SetBlockAckInactivityTimeout()

void ns3::QosTxop::SetBlockAckInactivityTimeout ( uint16_t  timeout)

Set the Block Ack inactivity timeout.

Parameters
timeoutthe Block Ack inactivity timeout.

Definition at line 1580 of file qos-txop.cc.

References m_blockAckInactivityTimeout, NS_LOG_FUNCTION, and timeout.

Referenced by ns3::RegularWifiMac::SetBeBlockAckInactivityTimeout(), ns3::RegularWifiMac::SetBkBlockAckInactivityTimeout(), ns3::RegularWifiMac::SetViBlockAckInactivityTimeout(), and ns3::RegularWifiMac::SetVoBlockAckInactivityTimeout().

+ Here is the caller graph for this function:

◆ SetBlockAckThreshold()

void ns3::QosTxop::SetBlockAckThreshold ( uint8_t  threshold)

Set threshold for block ACK mechanism.

If number of packets in the queue reaches the threshold, block ACK mechanism is used.

Parameters
thresholdblock ack threshold value.

Definition at line 1572 of file qos-txop.cc.

References m_baManager, m_blockAckThreshold, and NS_LOG_FUNCTION.

Referenced by ns3::RegularWifiMac::SetBeBlockAckThreshold(), ns3::RegularWifiMac::SetBkBlockAckThreshold(), ns3::RegularWifiMac::SetViBlockAckThreshold(), and ns3::RegularWifiMac::SetVoBlockAckThreshold().

+ Here is the caller graph for this function:

◆ SetFailedAddBaTimeout()

void ns3::QosTxop::SetFailedAddBaTimeout ( Time  failedAddBaTimeout)

Set the timeout for failed BA agreement.

During the timeout period, all packets will be transmitted using normal MPDU.

Parameters
failedAddBaTimeoutthe timeout for failed BA agreement

Definition at line 1762 of file qos-txop.cc.

References m_failedAddBaTimeout, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetTypeOfStation()

void ns3::QosTxop::SetTypeOfStation ( TypeOfStation  type)

Set type of station with the given type.

Parameters
typethe type of station.

Definition at line 151 of file qos-txop.cc.

References m_typeOfStation, and NS_LOG_FUNCTION.

◆ SetupBlockAckIfNeeded()

bool ns3::QosTxop::SetupBlockAckIfNeeded ( void  )
private

If number of packets in the queue reaches m_blockAckThreshold value, an ADDBA Request frame is sent to destination in order to setup a block ack.

Returns
true if we tried to set up block ACK, false otherwise.

Definition at line 1520 of file qos-txop.cc.

References ns3::WifiMacHeader::GetAddr1(), GetBlockAckThreshold(), ns3::WifiRemoteStationManager::GetHeSupported(), ns3::Txop::GetLow(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiRemoteStationManager::GetVhtSupported(), m_blockAckInactivityTimeout, ns3::Txop::m_currentHdr, ns3::Txop::m_queue, ns3::Txop::m_stationManager, ns3::Txop::m_txMiddle, NS_LOG_FUNCTION, SendAddBaRequest(), and ns3::WIFI_MOD_CLASS_HT.

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

◆ SetWifiRemoteStationManager()

void ns3::QosTxop::SetWifiRemoteStationManager ( const Ptr< WifiRemoteStationManager remoteManager)
virtual

Set WifiRemoteStationsManager this QosTxop is associated to.

Parameters
remoteManagerWifiRemoteStationManager.

Reimplemented from ns3::Txop.

Definition at line 143 of file qos-txop.cc.

References m_baManager, ns3::Txop::m_stationManager, NS_LOG_FUNCTION, and ns3::Txop::SetWifiRemoteStationManager().

+ Here is the call graph for this function:

◆ StartAccessIfNeeded()

void ns3::QosTxop::StartAccessIfNeeded ( void  )
virtual

◆ StartNextPacket()

◆ TerminateTxop()

void ns3::QosTxop::TerminateTxop ( void  )
privatevirtual

Update backoff and restart access if needed.

Reimplemented from ns3::Txop.

Definition at line 1116 of file qos-txop.cc.

References ns3::Txop::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Txop::GetTxopLimit(), ns3::Txop::m_backoff, ns3::Txop::m_backoffTrace, ns3::Txop::m_cwTrace, ns3::Txop::m_rng, m_startTxop, m_txopTrace, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, RestartAccessIfNeeded(), and ns3::Txop::StartBackoffNow().

Referenced by EndTxNoAck(), and StartNextPacket().

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

◆ VerifyBlockAck()

void ns3::QosTxop::VerifyBlockAck ( void  )
private

Verifies if dequeued packet has to be transmitted with ack policy Block Ack.

This happens if an established block ack agreement exists with the receiver.

Definition at line 1459 of file qos-txop.cc.

References ns3::WifiMacHeader::BLOCK_ACK, ns3::OriginatorBlockAckAgreement::ESTABLISHED, ns3::WifiMacHeader::GetAddr1(), ns3::Txop::GetLow(), ns3::WifiMacHeader::GetQosTid(), m_baManager, ns3::Txop::m_currentHdr, ns3::Txop::m_currentPacket, ns3::Txop::m_low, NS_LOG_FUNCTION, and ns3::WifiMacHeader::SetQosAckPolicy().

Referenced by NotifyAccessGranted(), and StartNextPacket().

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

Friends And Related Function Documentation

◆ ::AmpduAggregationTest

friend class ::AmpduAggregationTest
friend

Allow test cases to access private members.

Definition at line 95 of file qos-txop.h.

◆ ::HeAggregationTest

friend class ::HeAggregationTest
friend

Definition at line 97 of file qos-txop.h.

◆ ::TwoLevelAggregationTest

friend class ::TwoLevelAggregationTest
friend

Definition at line 96 of file qos-txop.h.

◆ AggregationCapableTransmissionListener

friend class AggregationCapableTransmissionListener
friend

allow AggregationCapableTransmissionListener class access

Definition at line 467 of file qos-txop.h.

Member Data Documentation

◆ m_ac

AcIndex ns3::QosTxop::m_ac
private

the access category

Definition at line 602 of file qos-txop.h.

Referenced by CompleteConfig(), and SetAccessCategory().

◆ m_addBaResponseTimeout

Time ns3::QosTxop::m_addBaResponseTimeout
private

timeout for ADDBA response

Definition at line 614 of file qos-txop.h.

Referenced by GetAddBaResponseTimeout(), GotAck(), and SetAddBaResponseTimeout().

◆ m_aMpduEnabled

std::map<Mac48Address, bool> ns3::QosTxop::m_aMpduEnabled

list containing flags whether A-MPDU is enabled for a given destination address

Definition at line 99 of file qos-txop.h.

Referenced by GetAmpduExist(), and SetAmpduExist().

◆ m_baManager

◆ m_blockAckInactivityTimeout

uint16_t ns3::QosTxop::m_blockAckInactivityTimeout
private

the Block ACK inactivity timeout

Definition at line 609 of file qos-txop.h.

Referenced by SetBlockAckInactivityTimeout(), and SetupBlockAckIfNeeded().

◆ m_blockAckThreshold

uint8_t ns3::QosTxop::m_blockAckThreshold
private

the Block ACK threshold

Definition at line 606 of file qos-txop.h.

Referenced by GetBlockAckThreshold(), and SetBlockAckThreshold().

◆ m_blockAckType

BlockAckType ns3::QosTxop::m_blockAckType
private

the Block ACK type

Definition at line 607 of file qos-txop.h.

Referenced by GetTransmissionParameters(), NotifyAccessGranted(), and QosTxop().

◆ m_currentBar

Bar ns3::QosTxop::m_currentBar
private

the current BAR

Definition at line 610 of file qos-txop.h.

Referenced by NotifyAccessGranted(), and StartNextPacket().

◆ m_currentIsFragmented

bool ns3::QosTxop::m_currentIsFragmented
private

flag whether current packet is fragmented

Definition at line 613 of file qos-txop.h.

Referenced by GotAck(), and NotifyAccessGranted().

◆ m_currentPacketTimestamp

Time ns3::QosTxop::m_currentPacketTimestamp
private

the current packet timestamp

Definition at line 608 of file qos-txop.h.

Referenced by CompleteTx(), GotAck(), MissedAck(), NotifyAccessGranted(), and StartNextPacket().

◆ m_failedAddBaTimeout

Time ns3::QosTxop::m_failedAddBaTimeout
private

timeout after failed BA agreement

Definition at line 615 of file qos-txop.h.

Referenced by AddBaResponseTimeout(), GetFailedAddBaTimeout(), MissedAck(), MissedBlockAck(), and SetFailedAddBaTimeout().

◆ m_isAccessRequestedForRts

bool ns3::QosTxop::m_isAccessRequestedForRts
private

flag whether access is requested to transmit a RTS frame

Definition at line 612 of file qos-txop.h.

Referenced by NotifyAccessGranted(), NotifyInternalCollision(), RestartAccessIfNeeded(), and StartAccessIfNeeded().

◆ m_qosBlockedDestinations

Ptr<QosBlockedDestinations> ns3::QosTxop::m_qosBlockedDestinations
private

QOS blocked destinations.

Definition at line 604 of file qos-txop.h.

Referenced by DequeuePeekedFrame(), DoDispose(), PeekNextFrame(), and QosTxop().

◆ m_startTxop

Time ns3::QosTxop::m_startTxop
private

the start TXOP time

Definition at line 611 of file qos-txop.h.

Referenced by GetTxopRemaining(), NotifyAccessGranted(), and TerminateTxop().

◆ m_txopTrace

TracedCallback<Time, Time> ns3::QosTxop::m_txopTrace
private

TXOP trace callback.

Definition at line 618 of file qos-txop.h.

Referenced by GetTypeId(), and TerminateTxop().

◆ m_typeOfStation

TypeOfStation ns3::QosTxop::m_typeOfStation
private

the type of station

Definition at line 603 of file qos-txop.h.

Referenced by GetTypeOfStation(), and SetTypeOfStation().

◆ m_useExplicitBarAfterMissedBlockAck

bool ns3::QosTxop::m_useExplicitBarAfterMissedBlockAck
private

flag whether explicit Block Ack Request should be sent upon missed Block Ack Response

Definition at line 616 of file qos-txop.h.

Referenced by GetTypeId(), and MissedBlockAck().


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