handle packet fragmentation and retransmissions. More...
#include "dca-txop.h"
Public Types | |
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... | |
Public Member Functions | |
DcaTxop () | |
virtual | ~DcaTxop () |
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... | |
virtual void | EndTxNoAck (void) |
Event handler when a transmission that does not require an ACK has completed. More... | |
uint32_t | GetAifsn (void) const |
Return the number of slots that make up an AIFS. More... | |
Ptr< MacLow > | GetLow (void) const |
Return the MacLow associated with this DcaTxop. 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... | |
Ptr< WifiMacQueue > | GetQueue () const |
Return the packet queue associated with this DcaTxop. More... | |
Time | GetTxopLimit (void) const |
Return the TXOP limit. More... | |
virtual void | GotAck (void) |
Event handler when an ACK is received. More... | |
virtual void | GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr) |
Event handler when a Block ACK is received. More... | |
virtual bool | HasTxop (void) const |
Check if the station has TXOP granted for the next MPDU. More... | |
virtual bool | IsEdca () |
Check for EDCA. More... | |
virtual void | MissedAck (void) |
Event handler when an ACK is missed. More... | |
virtual void | MissedBlockAck (uint8_t nMpdus) |
Event handler when a Block ACK timeout has occurred. 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 | 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 | SetAifsn (uint32_t aifsn) |
Set the number of slots that make up an AIFS. More... | |
void | SetLow (const Ptr< MacLow > low) |
Set MacLow associated with this DcaTxop. More... | |
void | SetManager (const Ptr< DcfManager > manager) |
Set DcfManager this DcaTxop is associated to. 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 DcaTxop is associated to. More... | |
void | SetTxOkCallback (TxOk callback) |
void | SetTxopLimit (Time txopLimit) |
Set the TXOP limit. More... | |
virtual void | SetWifiRemoteStationManager (const Ptr< WifiRemoteStationManager > remoteManager) |
Set WifiRemoteStationsManager this DcaTxop is associated to. More... | |
virtual void | StartNextFragment (void) |
Start transmission for the next fragment. More... | |
virtual void | StartNextPacket (void) |
Start transmission for the next packet if allowed by the TxopLimit. More... | |
![]() | |
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... | |
![]() | |
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) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual uint32_t | GetFragmentOffset (void) const |
Calculate the offset for the current fragment. More... | |
virtual Ptr< Packet > | GetFragmentPacket (WifiMacHeader *hdr) |
Get the next fragment from the packet with appropriate Wifi header for the fragment. More... | |
virtual uint32_t | GetFragmentSize (void) const |
Calculate the size of the current fragment. More... | |
virtual uint32_t | GetNextFragmentSize (void) const |
Calculate the size of the next fragment. More... | |
virtual bool | IsLastFragment (void) const |
Check if the current fragment is the last fragment. More... | |
bool | NeedDataRetransmission (Ptr< const Packet > packet, const WifiMacHeader &hdr) |
Check if DATA should be re-transmitted if ACK was missed. More... | |
virtual bool | NeedFragmentation (void) const |
Check if the current packet should be fragmented. More... | |
bool | NeedRtsRetransmission (Ptr< const Packet > packet, const WifiMacHeader &hdr) |
Check if RTS should be re-transmitted if CTS was missed. More... | |
virtual bool | NeedsAccess (void) const |
Check if the DCF requires access. More... | |
void | NextFragment (void) |
Continue to the next fragment. More... | |
virtual void | NotifyAccessGranted (void) |
Notify the DCF that access has been granted. More... | |
virtual void | NotifyCollision (void) |
Notify the DCF that collision has occurred. More... | |
virtual void | NotifyInternalCollision (void) |
Notify the DCF that internal collision has occurred. More... | |
virtual void | RestartAccessIfNeeded (void) |
Restart access request if needed. More... | |
virtual void | StartAccessIfNeeded (void) |
Request access from DCF manager if needed. More... | |
void | TxDroppedPacket (Ptr< const WifiMacQueueItem > item) |
Pass the packet included in the wifi MAC queue item to the packet dropped callback. More... | |
![]() | |
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... | |
![]() | |
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 | |
WifiMacHeader | m_currentHdr |
the current header More... | |
Ptr< const Packet > | m_currentPacket |
the current packet More... | |
MacLowTransmissionParameters | m_currentParams |
current transmission parameters More... | |
Ptr< DcfState > | m_dcf |
the DCF state More... | |
uint8_t | m_fragmentNumber |
the fragment number More... | |
Ptr< MacLow > | m_low |
the MacLow More... | |
Ptr< DcfManager > | m_manager |
the DCF manager More... | |
Ptr< WifiMacQueue > | m_queue |
the wifi MAC queue More... | |
Ptr< UniformRandomVariable > | m_rng |
the random stream More... | |
Ptr< WifiRemoteStationManager > | m_stationManager |
the wifi remote station manager More... | |
TxDropped | m_txDroppedCallback |
the packet dropped callback More... | |
TxFailed | m_txFailedCallback |
the transmit failed callback More... | |
Ptr< MacTxMiddle > | m_txMiddle |
the MacTxMiddle More... | |
TxOk | m_txOkCallback |
the transmit OK callback More... | |
Friends | |
class | DcfListener |
allow DcfListener class access More... | |
class | DcfState |
< DcfState associated class More... | |
class | MacLowTransmissionListener |
allow MacLowTransmissionListener class access More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
handle packet fragmentation and retransmissions.
This class implements the packet fragmentation and retransmission policy. It uses the ns3::MacLow and ns3::DcfManager helper classes to respectively send packets and decide when to send them. Packets are stored in a ns3::WifiMacQueue until they can be sent.
The policy currently implemented uses a simple fragmentation 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.
ns3::DcaTxop is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 208 bytes (on a 64-bit architecture).
Definition at line 58 of file dca-txop.h.
typedef Callback<void, Ptr<const Packet> > ns3::DcaTxop::TxDropped |
typedef for a callback to invoke when a packet is dropped.
Definition at line 89 of file dca-txop.h.
typedef Callback<void, const WifiMacHeader&> ns3::DcaTxop::TxFailed |
typedef for a callback to invoke when a packet transmission was failed.
Definition at line 84 of file dca-txop.h.
typedef Callback<void, const WifiMacHeader&> ns3::DcaTxop::TxOk |
typedef for a callback to invoke when a packet transmission was completed successfully.
Definition at line 79 of file dca-txop.h.
ns3::DcaTxop::DcaTxop | ( | ) |
Definition at line 73 of file dca-txop.cc.
References m_dcf, m_queue, m_rng, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 83 of file dca-txop.cc.
References NS_LOG_FUNCTION.
int64_t ns3::DcaTxop::AssignStreams | ( | int64_t | stream | ) |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
stream | first stream index to use. |
Definition at line 228 of file dca-txop.cc.
References m_rng, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
Referenced by ns3::MeshHelper::AssignStreams(), ns3::WaveHelper::AssignStreams(), ns3::WifiHelper::AssignStreams(), and AssignWifiRandomStreams().
|
virtual |
Cancel the transmission.
Definition at line 571 of file dca-txop.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
protectedvirtual |
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 overriden 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.
Reimplemented in ns3::EdcaTxopN, and DcaTxopTest.
Definition at line 89 of file dca-txop.cc.
References m_dcf, m_low, m_queue, m_rng, m_stationManager, m_txMiddle, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::DoDispose().
|
protectedvirtual |
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::Object.
Reimplemented in ns3::EdcaTxopN.
Definition at line 267 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), m_dcf, m_rng, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), and ns3::DcfState::StartBackoffNow().
|
virtual |
Event handler when a transmission that does not require an ACK has completed.
Reimplemented in ns3::EdcaTxopN.
Definition at line 578 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), m_currentPacket, m_dcf, m_rng, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), StartAccessIfNeeded(), and ns3::DcfState::StartBackoffNow().
uint32_t ns3::DcaTxop::GetAifsn | ( | void | ) | const |
Return the number of slots that make up an AIFS.
Definition at line 207 of file dca-txop.cc.
References ns3::DcfState::GetAifsn(), and m_dcf.
Referenced by ns3::ApWifiMac::GetEdcaParameterSet(), and GetTypeId().
|
protectedvirtual |
Calculate the offset for the current fragment.
Reimplemented in ns3::EdcaTxopN.
Definition at line 328 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentOffset(), m_currentHdr, m_currentPacket, m_fragmentNumber, m_stationManager, and NS_LOG_FUNCTION.
Referenced by GetFragmentPacket().
|
protectedvirtual |
Get the next fragment from the packet with appropriate Wifi header for the fragment.
hdr | Wi-Fi header. |
Reimplemented in ns3::EdcaTxopN.
Definition at line 336 of file dca-txop.cc.
References ns3::Packet::CreateFragment(), GetFragmentOffset(), GetFragmentSize(), IsLastFragment(), m_currentHdr, m_currentPacket, m_fragmentNumber, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetFragmentNumber(), ns3::WifiMacHeader::SetMoreFragments(), and ns3::WifiMacHeader::SetNoMoreFragments().
Referenced by NotifyAccessGranted(), and StartNextFragment().
|
protectedvirtual |
Calculate the size of the current fragment.
Reimplemented in ns3::EdcaTxopN.
Definition at line 304 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentSize(), m_currentHdr, m_currentPacket, m_fragmentNumber, m_stationManager, and NS_LOG_FUNCTION.
Referenced by GetFragmentPacket().
Return the MacLow associated with this DcaTxop.
Definition at line 260 of file dca-txop.cc.
References m_low, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::GetTxopFragmentSize(), ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::NeedFragmentation(), NotifyAccessGranted(), StartNextFragment(), and ns3::EdcaTxopN::StartNextPacket().
uint32_t ns3::DcaTxop::GetMaxCw | ( | void | ) | const |
Return the maximum contention window size.
Definition at line 201 of file dca-txop.cc.
References ns3::DcfState::GetCwMax(), and m_dcf.
Referenced by ns3::ApWifiMac::GetEdcaParameterSet(), and GetTypeId().
uint32_t ns3::DcaTxop::GetMinCw | ( | void | ) | const |
Return the minimum contention window size.
Definition at line 195 of file dca-txop.cc.
References ns3::DcfState::GetCwMin(), and m_dcf.
Referenced by ns3::ApWifiMac::GetEdcaParameterSet(), and GetTypeId().
|
protectedvirtual |
Calculate the size of the next fragment.
Reimplemented in ns3::EdcaTxopN.
Definition at line 320 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::GetFragmentSize(), m_currentHdr, m_currentPacket, m_fragmentNumber, m_stationManager, and NS_LOG_FUNCTION.
Referenced by NotifyAccessGranted(), and StartNextFragment().
Ptr< WifiMacQueue > ns3::DcaTxop::GetQueue | ( | void | ) | const |
Return the packet queue associated with this DcaTxop.
Definition at line 160 of file dca-txop.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), and GetTypeId().
Time ns3::DcaTxop::GetTxopLimit | ( | void | ) | const |
Return the TXOP limit.
Definition at line 213 of file dca-txop.cc.
References ns3::DcfState::GetTxopLimit(), and m_dcf.
Referenced by ns3::EdcaTxopN::EndTxNoAck(), ns3::ApWifiMac::GetEdcaParameterSet(), ns3::EdcaTxopN::GetTxopFragmentSize(), ns3::EdcaTxopN::GetTxopRemaining(), GetTypeId(), ns3::EdcaTxopN::GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::IsTxopFragmentation(), ns3::EdcaTxopN::NeedFragmentation(), and ns3::EdcaTxopN::StartNextPacket().
|
static |
Get the type ID.
Definition at line 39 of file dca-txop.cc.
References GetAifsn(), GetMaxCw(), GetMinCw(), GetQueue(), GetTxopLimit(), ns3::MakePointerAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::MilliSeconds(), SetAifsn(), SetMaxCw(), SetMinCw(), ns3::TypeId::SetParent(), and SetTxopLimit().
|
virtual |
Event handler when an ACK is received.
Reimplemented in ns3::EdcaTxopN.
Definition at line 494 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Packet::GetSize(), IsLastFragment(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_currentHdr, m_currentPacket, m_dcf, m_rng, m_txOkCallback, NeedFragmentation(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), RestartAccessIfNeeded(), and ns3::DcfState::StartBackoffNow().
|
virtual |
Event handler when a Block ACK is received.
blockAck | block ack. |
recipient | address of the recipient. |
rxSnr | SNR of the block ack itself. |
txMode | wifi mode. |
dataSnr | reported data SNR from the peer. |
Reimplemented in ns3::EdcaTxopN.
Definition at line 601 of file dca-txop.cc.
References NS_LOG_WARN.
|
virtual |
Check if the station has TXOP granted for the next MPDU.
Reimplemented in ns3::EdcaTxopN.
Definition at line 613 of file dca-txop.cc.
|
virtual |
Check for EDCA.
Reimplemented in ns3::EdcaTxopN.
Definition at line 589 of file dca-txop.cc.
|
protectedvirtual |
Check if the current fragment is the last fragment.
Reimplemented in ns3::EdcaTxopN.
Definition at line 312 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiRemoteStationManager::IsLastFragment(), m_currentHdr, m_currentPacket, m_fragmentNumber, m_stationManager, and NS_LOG_FUNCTION.
Referenced by GetFragmentPacket(), GotAck(), NotifyAccessGranted(), and StartNextFragment().
|
virtual |
Event handler when an ACK is missed.
Reimplemented in ns3::EdcaTxopN.
Definition at line 521 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_currentHdr, m_currentPacket, m_dcf, m_rng, m_stationManager, m_txFailedCallback, NeedDataRetransmission(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::ReportFinalDataFailed(), ns3::DcfState::ResetCw(), RestartAccessIfNeeded(), ns3::WifiMacHeader::SetRetry(), ns3::DcfState::StartBackoffNow(), and ns3::DcfState::UpdateFailedCw().
|
virtual |
Event handler when a Block ACK timeout has occurred.
nMpdus | the number of MPDUs sent in the A-MPDU transmission that results in a Block ACK timeout. |
Reimplemented in ns3::EdcaTxopN.
Definition at line 607 of file dca-txop.cc.
References NS_LOG_WARN.
|
virtual |
Event handler when a CTS timeout has occurred.
Reimplemented in ns3::EdcaTxopN.
Definition at line 469 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_currentHdr, m_currentPacket, m_dcf, m_rng, m_stationManager, m_txFailedCallback, NeedRtsRetransmission(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::ReportFinalRtsFailed(), ns3::DcfState::ResetCw(), RestartAccessIfNeeded(), ns3::DcfState::StartBackoffNow(), and ns3::DcfState::UpdateFailedCw().
|
protected |
Check if DATA should be re-transmitted if ACK was missed.
packet | current packet being transmitted. |
hdr | current header being transmitted. |
Definition at line 282 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_stationManager, ns3::WifiRemoteStationManager::NeedDataRetransmission(), and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::MissedAck(), MissedAck(), and ns3::EdcaTxopN::NotifyInternalCollision().
|
protectedvirtual |
Check if the current packet should be fragmented.
Reimplemented in ns3::EdcaTxopN.
Definition at line 289 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_currentHdr, m_currentPacket, m_stationManager, ns3::WifiRemoteStationManager::NeedFragmentation(), and NS_LOG_FUNCTION.
Referenced by GotAck(), and NotifyAccessGranted().
|
protected |
Check if RTS should be re-transmitted if CTS was missed.
packet | current packet being transmitted. |
hdr | current header being transmitted. |
Definition at line 275 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_stationManager, ns3::WifiRemoteStationManager::NeedRtsRetransmission(), and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::MissedCts(), MissedCts(), and ns3::EdcaTxopN::NotifyInternalCollision().
|
protectedvirtual |
Check if the DCF requires access.
Reimplemented in ns3::EdcaTxopN.
Definition at line 357 of file dca-txop.cc.
References m_currentPacket, m_queue, and NS_LOG_FUNCTION.
|
protected |
Continue to the next fragment.
This method simply increments the internal variable that keep track of the current fragment number.
Definition at line 297 of file dca-txop.cc.
References m_fragmentNumber, and NS_LOG_FUNCTION.
Referenced by StartNextFragment().
|
protectedvirtual |
Notify the DCF that access has been granted.
Reimplemented in ns3::EdcaTxopN, and DcaTxopTest.
Definition at line 364 of file dca-txop.cc.
References ns3::MacLowTransmissionParameters::DisableAck(), ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::DisableOverrideDurationId(), ns3::MacLowTransmissionParameters::DisableRts(), ns3::MacLowTransmissionParameters::EnableAck(), ns3::MacLowTransmissionParameters::EnableNextData(), ns3::WifiMacHeader::GetAddr1(), GetFragmentPacket(), GetLow(), GetNextFragmentSize(), ns3::MacTxMiddle::GetNextSequenceNumberFor(), ns3::WifiMacHeader::GetSequenceControl(), ns3::Packet::GetSize(), ns3::Mac48Address::IsGroup(), IsLastFragment(), m_currentHdr, m_currentPacket, m_currentParams, m_fragmentNumber, m_queue, m_stationManager, m_txMiddle, NeedFragmentation(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetFragmentNumber(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::MacLow::StartTransmission(), and ns3::WifiRemoteStationManager::UpdateFragmentationThreshold().
|
virtual |
When a channel switching occurs, enqueued packets are removed.
Reimplemented in DcaTxopTest.
Definition at line 443 of file dca-txop.cc.
References m_currentPacket, m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::OcbWifiMac::CancleTx().
|
protectedvirtual |
Notify the DCF that collision has occurred.
Reimplemented in ns3::EdcaTxopN, and DcaTxopTest.
Definition at line 435 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomVariableStream::GetInteger(), m_dcf, m_rng, NS_LOG_FUNCTION, RestartAccessIfNeeded(), and ns3::DcfState::StartBackoffNow().
Referenced by NotifyInternalCollision().
|
protectedvirtual |
Notify the DCF that internal collision has occurred.
Reimplemented in ns3::EdcaTxopN, and DcaTxopTest.
Definition at line 428 of file dca-txop.cc.
References NotifyCollision(), and NS_LOG_FUNCTION.
|
virtual |
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the front of the queue.
Reimplemented in DcaTxopTest.
Definition at line 451 of file dca-txop.cc.
References m_currentHdr, m_currentPacket, m_queue, and NS_LOG_FUNCTION.
|
virtual |
When wake up operation occurs, channel access will be restarted.
Reimplemented in DcaTxopTest.
Definition at line 462 of file dca-txop.cc.
References NS_LOG_FUNCTION, and RestartAccessIfNeeded().
|
virtual |
packet | packet to send. |
hdr | header of packet to send. |
Store the packet in the internal queue until it can be sent safely.
Definition at line 219 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_queue, m_stationManager, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::PrepareForQueue(), and StartAccessIfNeeded().
|
protectedvirtual |
Restart access request if needed.
Reimplemented in ns3::EdcaTxopN.
Definition at line 236 of file dca-txop.cc.
References ns3::DcfState::IsAccessRequested(), m_currentPacket, m_dcf, m_manager, m_queue, NS_LOG_FUNCTION, and ns3::DcfManager::RequestAccess().
Referenced by GotAck(), MissedAck(), MissedCts(), NotifyCollision(), and NotifyWakeUp().
void ns3::DcaTxop::SetAifsn | ( | uint32_t | aifsn | ) |
Set the number of slots that make up an AIFS.
aifsn | the number of slots that make up an AIFS. |
Definition at line 181 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetAifsn().
Referenced by GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
Set MacLow associated with this DcaTxop.
low | MacLow. |
Definition at line 115 of file dca-txop.cc.
References m_low, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun(), TwoLevelAggregationTest::DoRun(), and ns3::RegularWifiMac::SetupEdcaQueue().
void ns3::DcaTxop::SetManager | ( | const Ptr< DcfManager > | manager | ) |
Set DcfManager this DcaTxop is associated to.
manager | DcfManager. |
Definition at line 101 of file dca-txop.cc.
References ns3::DcfManager::Add(), m_dcf, m_manager, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun().
void ns3::DcaTxop::SetMaxCw | ( | uint32_t | maxCw | ) |
Set the maximum contention window size.
maxCw | the maximum contention window size. |
Definition at line 174 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetCwMax().
Referenced by GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
void ns3::DcaTxop::SetMinCw | ( | uint32_t | minCw | ) |
Set the minimum contention window size.
minCw | the minimum contention window size. |
Definition at line 167 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetCwMin().
Referenced by GetTypeId(), and ns3::StaWifiMac::SetEdcaParameters().
void ns3::DcaTxop::SetTxDroppedCallback | ( | TxDropped | callback | ) |
callback | the callback to invoke when a packet is dropped. |
Definition at line 143 of file dca-txop.cc.
References m_queue, m_txDroppedCallback, ns3::MakeCallback(), NS_LOG_FUNCTION, and TxDroppedPacket().
void ns3::DcaTxop::SetTxFailedCallback | ( | TxFailed | callback | ) |
callback | the callback to invoke when a packet transmission was completed unsuccessfully. |
Definition at line 136 of file dca-txop.cc.
References m_txFailedCallback, and NS_LOG_FUNCTION.
void ns3::DcaTxop::SetTxMiddle | ( | const Ptr< MacTxMiddle > | txMiddle | ) |
Set MacTxMiddle this DcaTxop is associated to.
txMiddle | MacTxMiddle. |
Definition at line 108 of file dca-txop.cc.
References m_txMiddle, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun().
void ns3::DcaTxop::SetTxOkCallback | ( | TxOk | callback | ) |
callback | the callback to invoke when a packet transmission was completed successfully. |
Definition at line 129 of file dca-txop.cc.
References m_txOkCallback, and NS_LOG_FUNCTION.
void ns3::DcaTxop::SetTxopLimit | ( | Time | txopLimit | ) |
Set the TXOP limit.
txopLimit | the TXOP limit. Value zero corresponds to default DCF. |
Definition at line 188 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetTxopLimit().
Referenced by GetTypeId(), Experiment::Run(), and ns3::StaWifiMac::SetEdcaParameters().
|
virtual |
Set WifiRemoteStationsManager this DcaTxop is associated to.
remoteManager | WifiRemoteStationManager. |
Reimplemented in ns3::EdcaTxopN.
Definition at line 122 of file dca-txop.cc.
References m_stationManager, and NS_LOG_FUNCTION.
Referenced by ns3::EdcaTxopN::SetWifiRemoteStationManager().
|
protectedvirtual |
Request access from DCF manager if needed.
Reimplemented in ns3::EdcaTxopN.
Definition at line 248 of file dca-txop.cc.
References ns3::DcfState::IsAccessRequested(), m_currentPacket, m_dcf, m_manager, m_queue, NS_LOG_FUNCTION, and ns3::DcfManager::RequestAccess().
Referenced by EndTxNoAck(), and Queue().
|
virtual |
Start transmission for the next fragment.
This is called for fragment only.
Definition at line 548 of file dca-txop.cc.
References ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::DisableOverrideDurationId(), ns3::MacLowTransmissionParameters::DisableRts(), ns3::MacLowTransmissionParameters::EnableAck(), ns3::MacLowTransmissionParameters::EnableNextData(), GetFragmentPacket(), GetLow(), GetNextFragmentSize(), IsLastFragment(), m_currentParams, NextFragment(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::MacLow::StartTransmission().
|
virtual |
Start transmission for the next packet if allowed by the TxopLimit.
Reimplemented in ns3::EdcaTxopN.
Definition at line 595 of file dca-txop.cc.
References NS_LOG_WARN.
|
protected |
Pass the packet included in the wifi MAC queue item to the packet dropped callback.
item | the wifi MAC queue item. |
Definition at line 151 of file dca-txop.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), and m_txDroppedCallback.
Referenced by SetTxDroppedCallback().
|
friend |
allow DcfListener class access
Definition at line 62 of file dca-txop.h.
|
friend |
< DcfState associated class
Definition at line 297 of file dca-txop.h.
|
friend |
allow MacLowTransmissionListener class access
Definition at line 64 of file dca-txop.h.
|
protected |
the current header
Definition at line 420 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::BaTxFailed(), ns3::EdcaTxopN::BaTxOk(), ns3::EdcaTxopN::CompleteTx(), AmpduAggregationTest::DoRun(), ns3::EdcaTxopN::EndTxNoAck(), GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentPacket(), GetFragmentPacket(), GetFragmentSize(), ns3::EdcaTxopN::GetFragmentSize(), GetNextFragmentSize(), ns3::EdcaTxopN::GetNextFragmentSize(), ns3::EdcaTxopN::GetTxopFragmentSize(), ns3::EdcaTxopN::GotAck(), GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::HasTxop(), IsLastFragment(), ns3::EdcaTxopN::IsLastFragment(), ns3::EdcaTxopN::IsTxopFragmentation(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), ns3::EdcaTxopN::NeedBarRetransmission(), ns3::EdcaTxopN::NeedFragmentation(), NeedFragmentation(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), ns3::EdcaTxopN::NotifyInternalCollision(), NotifySleep(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::EdcaTxopN::SetupBlockAckIfNeeded(), ns3::EdcaTxopN::StartAccessIfNeeded(), ns3::EdcaTxopN::StartNextPacket(), and ns3::EdcaTxopN::VerifyBlockAck().
the current packet
Definition at line 419 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::CompleteTx(), AmpduAggregationTest::DoRun(), ns3::EdcaTxopN::EndTxNoAck(), EndTxNoAck(), GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentPacket(), GetFragmentPacket(), GetFragmentSize(), ns3::EdcaTxopN::GetFragmentSize(), GetNextFragmentSize(), ns3::EdcaTxopN::GetNextFragmentSize(), ns3::EdcaTxopN::GetNextTxopFragmentSize(), ns3::EdcaTxopN::GetNTxopFragment(), ns3::EdcaTxopN::GetTxopFragmentOffset(), ns3::EdcaTxopN::GetTxopFragmentSize(), ns3::EdcaTxopN::GotAck(), GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::HasTxop(), IsLastFragment(), ns3::EdcaTxopN::IsLastFragment(), ns3::EdcaTxopN::IsTxopFragmentation(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), ns3::EdcaTxopN::NeedBarRetransmission(), ns3::EdcaTxopN::NeedFragmentation(), NeedFragmentation(), ns3::EdcaTxopN::NeedsAccess(), NeedsAccess(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), NotifyChannelSwitching(), ns3::EdcaTxopN::NotifyInternalCollision(), NotifySleep(), ns3::EdcaTxopN::RestartAccessIfNeeded(), RestartAccessIfNeeded(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::EdcaTxopN::StartAccessIfNeeded(), StartAccessIfNeeded(), and ns3::EdcaTxopN::StartNextPacket().
|
protected |
current transmission parameters
Definition at line 421 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::GetTxopFragmentSize(), ns3::EdcaTxopN::GotAck(), ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::NeedFragmentation(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), StartNextFragment(), and ns3::EdcaTxopN::StartNextPacket().
the DCF state
Definition at line 408 of file dca-txop.h.
Referenced by DcaTxop(), DoDispose(), DoInitialize(), ns3::EdcaTxopN::DoInitialize(), ns3::EdcaTxopN::EndTxNoAck(), EndTxNoAck(), GetAifsn(), GetMaxCw(), GetMinCw(), GetTxopLimit(), ns3::EdcaTxopN::GotAck(), GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), ns3::EdcaTxopN::NotifyCollision(), NotifyCollision(), ns3::EdcaTxopN::NotifyInternalCollision(), ns3::EdcaTxopN::RestartAccessIfNeeded(), RestartAccessIfNeeded(), SetAifsn(), SetManager(), SetMaxCw(), SetMinCw(), SetTxopLimit(), ns3::EdcaTxopN::StartAccessIfNeeded(), and StartAccessIfNeeded().
|
protected |
the fragment number
Definition at line 422 of file dca-txop.h.
Referenced by GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentPacket(), GetFragmentPacket(), GetFragmentSize(), ns3::EdcaTxopN::GetFragmentSize(), GetNextFragmentSize(), ns3::EdcaTxopN::GetNextFragmentSize(), ns3::EdcaTxopN::GotAck(), IsLastFragment(), ns3::EdcaTxopN::IsLastFragment(), NextFragment(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), and ns3::EdcaTxopN::StartNextPacket().
the MacLow
Definition at line 415 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::CompleteConfig(), DoDispose(), GetLow(), ns3::EdcaTxopN::GotAck(), ns3::EdcaTxopN::MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::EdcaTxopN::SendDelbaFrame(), SetLow(), and ns3::EdcaTxopN::StartAccessIfNeeded().
|
protected |
the DCF manager
Definition at line 409 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::RestartAccessIfNeeded(), RestartAccessIfNeeded(), SetManager(), ns3::EdcaTxopN::StartAccessIfNeeded(), and StartAccessIfNeeded().
|
protected |
the wifi MAC queue
Definition at line 413 of file dca-txop.h.
Referenced by DcaTxop(), DoDispose(), ns3::EdcaTxopN::EdcaTxopN(), GetQueue(), ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::NeedsAccess(), NeedsAccess(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), NotifyChannelSwitching(), ns3::EdcaTxopN::NotifyInternalCollision(), NotifySleep(), ns3::EdcaTxopN::PushFront(), Queue(), ns3::EdcaTxopN::RestartAccessIfNeeded(), RestartAccessIfNeeded(), SetTxDroppedCallback(), ns3::EdcaTxopN::SetupBlockAckIfNeeded(), ns3::EdcaTxopN::StartAccessIfNeeded(), StartAccessIfNeeded(), and ns3::EdcaTxopN::StartNextPacket().
|
protected |
the random stream
Definition at line 417 of file dca-txop.h.
Referenced by AssignStreams(), DcaTxop(), DoDispose(), DoInitialize(), ns3::EdcaTxopN::DoInitialize(), ns3::EdcaTxopN::EndTxNoAck(), EndTxNoAck(), ns3::EdcaTxopN::GotAck(), GotAck(), ns3::EdcaTxopN::GotBlockAck(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), ns3::EdcaTxopN::NotifyCollision(), NotifyCollision(), and ns3::EdcaTxopN::NotifyInternalCollision().
|
protected |
the wifi remote station manager
Definition at line 416 of file dca-txop.h.
Referenced by DoDispose(), GetFragmentOffset(), ns3::EdcaTxopN::GetFragmentOffset(), GetFragmentSize(), ns3::EdcaTxopN::GetFragmentSize(), GetNextFragmentSize(), ns3::EdcaTxopN::GetNextFragmentSize(), IsLastFragment(), ns3::EdcaTxopN::IsLastFragment(), ns3::EdcaTxopN::IsTxopFragmentation(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedBlockAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), NeedDataRetransmission(), ns3::EdcaTxopN::NeedFragmentation(), NeedFragmentation(), NeedRtsRetransmission(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), ns3::EdcaTxopN::NotifyInternalCollision(), ns3::EdcaTxopN::PushFront(), Queue(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SetupBlockAckIfNeeded(), ns3::EdcaTxopN::SetWifiRemoteStationManager(), SetWifiRemoteStationManager(), ns3::EdcaTxopN::StartAccessIfNeeded(), and ns3::EdcaTxopN::StartNextPacket().
|
protected |
the packet dropped callback
Definition at line 412 of file dca-txop.h.
Referenced by SetTxDroppedCallback(), and TxDroppedPacket().
|
protected |
the transmit failed callback
Definition at line 411 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::BaTxFailed(), ns3::EdcaTxopN::MissedAck(), MissedAck(), ns3::EdcaTxopN::MissedCts(), MissedCts(), ns3::EdcaTxopN::NotifyInternalCollision(), and SetTxFailedCallback().
|
protected |
the MacTxMiddle
Definition at line 414 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::CompleteConfig(), ns3::EdcaTxopN::CompleteMpduTx(), ns3::EdcaTxopN::CompleteTx(), DoDispose(), ns3::EdcaTxopN::GetNextSequenceNumberFor(), ns3::EdcaTxopN::MissedAck(), ns3::EdcaTxopN::MissedCts(), ns3::EdcaTxopN::NotifyAccessGranted(), NotifyAccessGranted(), ns3::EdcaTxopN::PeekNextSequenceNumberFor(), ns3::EdcaTxopN::SendAddBaRequest(), SetTxMiddle(), ns3::EdcaTxopN::SetupBlockAckIfNeeded(), and ns3::EdcaTxopN::StartNextPacket().
|
protected |
the transmit OK callback
Definition at line 410 of file dca-txop.h.
Referenced by ns3::EdcaTxopN::BaTxOk(), ns3::EdcaTxopN::GotAck(), GotAck(), ns3::EdcaTxopN::GotBlockAck(), and SetTxOkCallback().