handle packet fragmentation and retransmissions. More...
#include "dca-txop.h"
Classes | |
class | Dcf |
class | TransmissionListener |
Listener for MacLow events. More... | |
Public Types | |
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 () | |
~DcaTxop () | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
virtual uint32_t | GetAifsn (void) const |
Return the number of slots that make up an AIFS. More... | |
virtual uint32_t | GetMaxCw (void) const |
Return the maximum congestion window size. More... | |
virtual uint32_t | GetMinCw (void) const |
Return the minimum congestion window size. More... | |
Ptr< WifiMacQueue > | GetQueue () const |
Return the packet queue associated with this DcaTxop. More... | |
void | Queue (Ptr< const Packet > packet, const WifiMacHeader &hdr) |
virtual void | SetAifsn (uint32_t aifsn) |
void | SetLow (Ptr< MacLow > low) |
Set MacLow associated with this DcaTxop. More... | |
void | SetManager (DcfManager *manager) |
Set DcfManager this DcaTxop is associated to. More... | |
virtual void | SetMaxCw (uint32_t maxCw) |
Set the maximum congestion window size. More... | |
virtual void | SetMinCw (uint32_t minCw) |
Set the minimum congestion window size. More... | |
void | SetTxFailedCallback (TxFailed callback) |
void | SetTxMiddle (MacTxMiddle *txMiddle) |
Set MacTxMiddle this DcaTxop is associated to. More... | |
void | SetTxOkCallback (TxOk callback) |
void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > remoteManager) |
Set WifiRemoteStationsManager this DcaTxop is associated to. 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 |
Implement the GetInstanceTypeId method defined in ObjectBase. 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... | |
![]() | |
SimpleRefCount () | |
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. 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) |
![]() | |
static TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
DcaTxop (const DcaTxop &o) | |
void | Cancel (void) |
Cancel the transmission. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
void | DoInitialize () |
Initialize() implementation. More... | |
void | EndTxNoAck (void) |
Event handler when a transmission that does not require an ACK has completed. More... | |
uint32_t | GetFragmentOffset (void) |
Calculate the offset for the current fragment. More... | |
Ptr< Packet > | GetFragmentPacket (WifiMacHeader *hdr) |
Get the next fragment from the packet with appropriate Wifi header for the fragment. More... | |
uint32_t | GetFragmentSize (void) |
Calculate the size of the current fragment. More... | |
uint32_t | GetNextFragmentSize (void) |
Calculate the size of the next fragment. More... | |
void | GotAck (double snr, WifiMode txMode) |
Event handler when an ACK is received. More... | |
void | GotCts (double snr, WifiMode txMode) |
Event handler when a CTS is received. More... | |
bool | IsLastFragment (void) |
Check if the curren fragment is the last fragment. More... | |
Ptr< MacLow > | Low (void) |
Return the MacLow associated with this DcaTxop. More... | |
void | MissedAck (void) |
Event handler when an ACK is missed. More... | |
void | MissedCts (void) |
Event handler when a CTS timeout has occurred. More... | |
bool | NeedDataRetransmission (void) |
Check if DATA should be re-transmitted if ACK was missed. More... | |
bool | NeedFragmentation (void) |
Check if the current packet should be fragmented. More... | |
bool | NeedRts (Ptr< const Packet > packet, const WifiMacHeader *header) |
Check if the current packet should be sent with a RTS protection. More... | |
bool | NeedRtsRetransmission (void) |
Check if RTS should be re-transmitted if CTS was missed. More... | |
bool | NeedsAccess (void) const |
Check if the DCF requires access. More... | |
void | NextFragment (void) |
Continue to the next fragment. More... | |
void | NotifyAccessGranted (void) |
Notify the DCF that access has been granted. More... | |
void | NotifyChannelSwitching (void) |
When a channel switching occurs, enqueued packets are removed. More... | |
void | NotifyCollision (void) |
Notify the DCF that collision has occurred. More... | |
void | NotifyInternalCollision (void) |
Notify the DCF that internal collision has occurred. More... | |
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... | |
void | NotifyWakeUp (void) |
When wake up operation occurs, channel access will be restarted. More... | |
DcaTxop & | operator= (const DcaTxop &) |
void | RestartAccessIfNeeded (void) |
Restart access request if needed. More... | |
void | StartAccessIfNeeded (void) |
Request access from DCF manager if needed. More... | |
void | StartNext (void) |
Start transmission for the next fragment. More... | |
Private Attributes | |
bool | m_accessOngoing |
WifiMacHeader | m_currentHdr |
Ptr< const Packet > | m_currentPacket |
Dcf * | m_dcf |
uint8_t | m_fragmentNumber |
Ptr< MacLow > | m_low |
DcfManager * | m_manager |
Ptr< WifiMacQueue > | m_queue |
RandomStream * | m_rng |
Ptr< WifiRemoteStationManager > | m_stationManager |
TransmissionListener * | m_transmissionListener |
TxFailed | m_txFailedCallback |
MacTxMiddle * | m_txMiddle |
TxOk | m_txOkCallback |
Friends | |
class | Dcf |
class | TransmissionListener |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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 192 bytes (on a 64-bit architecture).
Definition at line 67 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 81 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 76 of file dca-txop.h.
ns3::DcaTxop::DcaTxop | ( | ) |
Definition at line 153 of file dca-txop.cc.
References Dcf, m_dcf, m_queue, m_rng, m_transmissionListener, NS_LOG_FUNCTION, and TransmissionListener.
ns3::DcaTxop::~DcaTxop | ( | ) |
Definition at line 164 of file dca-txop.cc.
References NS_LOG_FUNCTION.
|
private |
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 288 of file dca-txop.cc.
References ns3::RandomStream::AssignStreams(), m_rng, and NS_LOG_FUNCTION.
Referenced by AssignWifiRandomStreams().
|
private |
Cancel the transmission.
This happens in only one case: in an AP, you have two DcaTxop:
If the normal queue tries to send a unicast data frame, but if the tx fails (ack timeout), it starts a backoff. If the beacon queue gets a tx oportunity during this backoff, it will trigger a call to this Cancel function.
Since we are already doing a backoff, we will get access to the medium when we can, we have nothing to do here. We just ignore the cancel event and wait until we are given again a tx oportunity.
Note that this is really non-trivial because each of these frames is assigned a sequence number from the same sequence counter (because this is a non-802.11e device) so, the scheme described here fails to ensure in-order delivery of frames at the receiving side. This, however, does not matter in this case because we assume that the receiving side does not update its <seq,ad> tupple for packets whose destination address is a broadcast address.
Definition at line 671 of file dca-txop.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::DcaTxop::TransmissionListener::Cancel().
|
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 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.
Definition at line 170 of file dca-txop.cc.
References m_dcf, m_low, m_queue, m_rng, m_stationManager, m_transmissionListener, m_txMiddle, and NS_LOG_FUNCTION.
|
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::Object.
Definition at line 335 of file dca-txop.cc.
References ns3::Object::DoInitialize(), ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), m_dcf, m_rng, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), and ns3::DcfState::StartBackoffNow().
|
private |
Event handler when a transmission that does not require an ACK has completed.
Definition at line 703 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), m_currentPacket, m_dcf, m_rng, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::DcfState::ResetCw(), StartAccessIfNeeded(), and ns3::DcfState::StartBackoffNow().
Referenced by ns3::DcaTxop::TransmissionListener::EndTxNoAck().
|
virtual |
Return the number of slots that make up an AIFS.
Implements ns3::Dcf.
Definition at line 269 of file dca-txop.cc.
References ns3::DcfState::GetAifsn(), m_dcf, and NS_LOG_FUNCTION.
|
private |
Calculate the offset for the current fragment.
Definition at line 399 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().
|
private |
Get the next fragment from the packet with appropriate Wifi header for the fragment.
hdr |
Definition at line 407 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 StartNext().
|
private |
Calculate the size of the current fragment.
Definition at line 375 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().
|
virtual |
Return the maximum congestion window size.
Implements ns3::Dcf.
Definition at line 262 of file dca-txop.cc.
References ns3::DcfState::GetCwMax(), m_dcf, and NS_LOG_FUNCTION.
|
virtual |
Return the minimum congestion window size.
Implements ns3::Dcf.
Definition at line 255 of file dca-txop.cc.
References ns3::DcfState::GetCwMin(), m_dcf, and NS_LOG_FUNCTION.
|
private |
Calculate the size of the next fragment.
Definition at line 391 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 StartNext().
Ptr< WifiMacQueue > ns3::DcaTxop::GetQueue | ( | void | ) | const |
Return the packet queue associated with this DcaTxop.
Definition at line 227 of file dca-txop.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
static |
Definition at line 139 of file dca-txop.cc.
References GetQueue(), ns3::MakePointerAccessor(), and ns3::TypeId::SetParent().
|
private |
Event handler when an ACK is received.
snr | |
txMode |
Definition at line 593 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), 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().
Referenced by ns3::DcaTxop::TransmissionListener::GotAck().
|
private |
Event handler when a CTS is received.
snr | |
txMode |
Definition at line 561 of file dca-txop.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::DcaTxop::TransmissionListener::GotCts().
|
private |
Check if the curren fragment is the last fragment.
Definition at line 383 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 StartNext().
Return the MacLow associated with this DcaTxop.
Definition at line 320 of file dca-txop.cc.
References m_low, and NS_LOG_FUNCTION.
Referenced by NotifyAccessGranted(), and StartNext().
|
private |
Event handler when an ACK is missed.
Definition at line 620 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), 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().
Referenced by ns3::DcaTxop::TransmissionListener::MissedAck().
|
private |
Event handler when a CTS timeout has occurred.
Definition at line 568 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), 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().
Referenced by ns3::DcaTxop::TransmissionListener::MissedCts().
|
private |
Check if DATA should be re-transmitted if ACK was missed.
Definition at line 352 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_currentHdr, m_currentPacket, m_stationManager, ns3::WifiRemoteStationManager::NeedDataRetransmission(), and NS_LOG_FUNCTION.
Referenced by MissedAck().
|
private |
Check if the current packet should be fragmented.
Definition at line 360 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().
|
private |
Check if the current packet should be sent with a RTS protection.
packet | |
header |
Definition at line 327 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_stationManager, ns3::WifiRemoteStationManager::NeedRts(), and NS_LOG_FUNCTION.
Referenced by NotifyAccessGranted().
|
private |
Check if RTS should be re-transmitted if CTS was missed.
Definition at line 344 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), m_currentHdr, m_currentPacket, m_stationManager, ns3::WifiRemoteStationManager::NeedRtsRetransmission(), and NS_LOG_FUNCTION.
Referenced by MissedCts().
|
private |
Check if the DCF requires access.
Definition at line 428 of file dca-txop.cc.
References m_currentPacket, m_queue, and NS_LOG_FUNCTION.
|
private |
Continue to the next fragment.
This method simply increments the internal variable that keep track of the current fragment number.
Definition at line 368 of file dca-txop.cc.
References m_fragmentNumber, and NS_LOG_FUNCTION.
Referenced by StartNext().
|
private |
Notify the DCF that access has been granted.
Definition at line 434 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::MacLowTransmissionParameters::EnableRts(), ns3::WifiMacHeader::GetAddr1(), GetFragmentPacket(), GetNextFragmentSize(), ns3::MacTxMiddle::GetNextSequenceNumberfor(), ns3::WifiMacHeader::GetSequenceControl(), ns3::Packet::GetSize(), ns3::Mac48Address::IsGroup(), IsLastFragment(), Low(), m_currentHdr, m_currentPacket, m_fragmentNumber, m_queue, m_stationManager, m_transmissionListener, m_txMiddle, NeedFragmentation(), NeedRts(), 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().
Referenced by ns3::DcaTxop::Dcf::DoNotifyAccessGranted().
|
private |
When a channel switching occurs, enqueued packets are removed.
Definition at line 535 of file dca-txop.cc.
References m_currentPacket, m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::DcaTxop::Dcf::DoNotifyChannelSwitching().
|
private |
Notify the DCF that collision has occurred.
Definition at line 526 of file dca-txop.cc.
References ns3::DcfState::GetCw(), ns3::RandomStream::GetNext(), m_dcf, m_rng, NS_LOG_DEBUG, NS_LOG_FUNCTION, RestartAccessIfNeeded(), and ns3::DcfState::StartBackoffNow().
Referenced by ns3::DcaTxop::Dcf::DoNotifyCollision(), and NotifyInternalCollision().
|
private |
Notify the DCF that internal collision has occurred.
Definition at line 519 of file dca-txop.cc.
References NotifyCollision(), and NS_LOG_FUNCTION.
Referenced by ns3::DcaTxop::Dcf::DoNotifyInternalCollision().
|
private |
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the front of the queue.
Definition at line 543 of file dca-txop.cc.
References m_currentHdr, m_currentPacket, m_queue, and NS_LOG_FUNCTION.
Referenced by ns3::DcaTxop::Dcf::DoNotifySleep().
|
private |
When wake up operation occurs, channel access will be restarted.
Definition at line 554 of file dca-txop.cc.
References NS_LOG_FUNCTION, and RestartAccessIfNeeded().
Referenced by ns3::DcaTxop::Dcf::DoNotifyWakeUp().
void ns3::DcaTxop::Queue | ( | Ptr< const Packet > | packet, |
const WifiMacHeader & | hdr | ||
) |
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 276 of file dca-txop.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacTrailer::GetSerializedSize(), ns3::WifiMacHeader::GetSerializedSize(), ns3::Packet::GetSize(), m_queue, m_stationManager, NS_LOG_FUNCTION, ns3::WifiRemoteStationManager::PrepareForQueue(), and StartAccessIfNeeded().
|
private |
Restart access request if needed.
Definition at line 296 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().
|
virtual |
aifsn | the number of slots which make up an AIFS for a specific DCF. a DIFS corresponds to an AIFSN = 2. |
Calling this method after DcfManager::Add has been called is not recommended.
Implements ns3::Dcf.
Definition at line 248 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetAifsn().
Set MacLow associated with this DcaTxop.
low | MacLow |
Definition at line 199 of file dca-txop.cc.
References m_low, and NS_LOG_FUNCTION.
void ns3::DcaTxop::SetManager | ( | DcfManager * | manager | ) |
Set DcfManager this DcaTxop is associated to.
manager | DcfManager |
Definition at line 186 of file dca-txop.cc.
References ns3::DcfManager::Add(), m_dcf, m_manager, and NS_LOG_FUNCTION.
|
virtual |
Set the maximum congestion window size.
maxCw | the maximum congestion window size |
Implements ns3::Dcf.
Definition at line 241 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetCwMax().
|
virtual |
Set the minimum congestion window size.
minCw | the minimum congestion window size |
Implements ns3::Dcf.
Definition at line 234 of file dca-txop.cc.
References m_dcf, NS_LOG_FUNCTION, and ns3::DcfState::SetCwMin().
void ns3::DcaTxop::SetTxFailedCallback | ( | TxFailed | callback | ) |
callback | the callback to invoke when a packet transmission was completed unsuccessfully. |
Definition at line 220 of file dca-txop.cc.
References m_txFailedCallback, and NS_LOG_FUNCTION.
void ns3::DcaTxop::SetTxMiddle | ( | MacTxMiddle * | txMiddle | ) |
Set MacTxMiddle this DcaTxop is associated to.
txMiddle | MacTxMiddle |
Definition at line 193 of file dca-txop.cc.
References m_txMiddle.
void ns3::DcaTxop::SetTxOkCallback | ( | TxOk | callback | ) |
callback | the callback to invoke when a packet transmission was completed successfully. |
Definition at line 213 of file dca-txop.cc.
References m_txOkCallback, and NS_LOG_FUNCTION.
void ns3::DcaTxop::SetWifiRemoteStationManager | ( | Ptr< WifiRemoteStationManager > | remoteManager | ) |
Set WifiRemoteStationsManager this DcaTxop is associated to.
remoteManager | WifiRemoteStationManager |
Definition at line 206 of file dca-txop.cc.
References m_stationManager, and NS_LOG_FUNCTION.
|
private |
Request access from DCF manager if needed.
Definition at line 308 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().
|
private |
Start transmission for the next fragment.
This is called for fragment only.
Definition at line 647 of file dca-txop.cc.
References ns3::MacLowTransmissionParameters::DisableNextData(), ns3::MacLowTransmissionParameters::DisableOverrideDurationId(), ns3::MacLowTransmissionParameters::DisableRts(), ns3::MacLowTransmissionParameters::EnableAck(), ns3::MacLowTransmissionParameters::EnableNextData(), GetFragmentPacket(), GetNextFragmentSize(), IsLastFragment(), Low(), m_transmissionListener, NextFragment(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::MacLow::StartTransmission().
Referenced by ns3::DcaTxop::TransmissionListener::StartNext().
|
friend |
Definition at line 161 of file dca-txop.h.
Referenced by DcaTxop().
|
friend |
Definition at line 163 of file dca-txop.h.
Referenced by DcaTxop().
|
private |
Definition at line 343 of file dca-txop.h.
|
private |
Definition at line 345 of file dca-txop.h.
Referenced by GetFragmentOffset(), GetFragmentPacket(), GetFragmentSize(), GetNextFragmentSize(), GotAck(), IsLastFragment(), MissedAck(), MissedCts(), NeedDataRetransmission(), NeedFragmentation(), NeedRtsRetransmission(), NotifyAccessGranted(), and NotifySleep().
Definition at line 344 of file dca-txop.h.
Referenced by EndTxNoAck(), GetFragmentOffset(), GetFragmentPacket(), GetFragmentSize(), GetNextFragmentSize(), GotAck(), IsLastFragment(), MissedAck(), MissedCts(), NeedDataRetransmission(), NeedFragmentation(), NeedRtsRetransmission(), NeedsAccess(), NotifyAccessGranted(), NotifyChannelSwitching(), NotifySleep(), RestartAccessIfNeeded(), and StartAccessIfNeeded().
|
private |
Definition at line 332 of file dca-txop.h.
Referenced by DcaTxop(), DoDispose(), DoInitialize(), EndTxNoAck(), GetAifsn(), GetMaxCw(), GetMinCw(), GotAck(), MissedAck(), MissedCts(), NotifyCollision(), RestartAccessIfNeeded(), SetAifsn(), SetManager(), SetMaxCw(), SetMinCw(), and StartAccessIfNeeded().
|
private |
Definition at line 346 of file dca-txop.h.
Referenced by GetFragmentOffset(), GetFragmentPacket(), GetFragmentSize(), GetNextFragmentSize(), IsLastFragment(), NextFragment(), and NotifyAccessGranted().
Definition at line 338 of file dca-txop.h.
Referenced by DoDispose(), Low(), and SetLow().
|
private |
Definition at line 333 of file dca-txop.h.
Referenced by RestartAccessIfNeeded(), SetManager(), and StartAccessIfNeeded().
|
private |
Definition at line 336 of file dca-txop.h.
Referenced by DcaTxop(), DoDispose(), GetQueue(), NeedsAccess(), NotifyAccessGranted(), NotifyChannelSwitching(), NotifySleep(), Queue(), RestartAccessIfNeeded(), and StartAccessIfNeeded().
|
private |
Definition at line 341 of file dca-txop.h.
Referenced by AssignStreams(), DcaTxop(), DoDispose(), DoInitialize(), EndTxNoAck(), GotAck(), MissedAck(), MissedCts(), and NotifyCollision().
|
private |
Definition at line 339 of file dca-txop.h.
Referenced by DoDispose(), GetFragmentOffset(), GetFragmentSize(), GetNextFragmentSize(), IsLastFragment(), MissedAck(), MissedCts(), NeedDataRetransmission(), NeedFragmentation(), NeedRts(), NeedRtsRetransmission(), NotifyAccessGranted(), Queue(), and SetWifiRemoteStationManager().
|
private |
Definition at line 340 of file dca-txop.h.
Referenced by DcaTxop(), DoDispose(), NotifyAccessGranted(), and StartNext().
|
private |
Definition at line 335 of file dca-txop.h.
Referenced by MissedAck(), MissedCts(), and SetTxFailedCallback().
|
private |
Definition at line 337 of file dca-txop.h.
Referenced by DoDispose(), NotifyAccessGranted(), and SetTxMiddle().
|
private |
Definition at line 334 of file dca-txop.h.
Referenced by GotAck(), and SetTxOkCallback().