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

control how a packet is transmitted. More...

#include "mac-low-transmission-parameters.h"

Public Member Functions

 MacLowTransmissionParameters ()
 
void DisableAck (void)
 Do not wait for Ack after data transmission. More...
 
void DisableBlockAckRequest (void)
 Do not send BlockAckRequest after data transmission. More...
 
void DisableNextData (void)
 Do not attempt to send data burst after current transmission. More...
 
void DisableRts (void)
 Do not send RTS and wait for CTS before sending data. More...
 
void EnableAck (void)
 Wait ACKTimeout for an Ack. More...
 
void EnableBlockAck (BlockAckType type)
 Wait the timeout corresponding to the given BlockAck response type. More...
 
void EnableBlockAckRequest (BlockAckType type)
 Schedule the transmission of a BlockAckRequest of the given type. More...
 
void EnableNextData (uint32_t size)
 
void EnableRts (void)
 Send a RTS, and wait CTSTimeout for a CTS. More...
 
BlockAckType GetBlockAckRequestType (void) const
 
BlockAckType GetBlockAckType (void) const
 
uint32_t GetNextPacketSize (void) const
 
bool HasNextPacket (void) const
 
bool MustSendBlockAckRequest (void) const
 
bool MustSendRts (void) const
 
bool MustWaitBlockAck (void) const
 
bool MustWaitNormalAck (void) const
 

Private Types

enum  {
  ACK_NONE, ACK_NORMAL, BLOCK_ACK_BASIC, BLOCK_ACK_COMPRESSED,
  BLOCK_ACK_EXTENDED_COMPRESSED, BLOCK_ACK_MULTI_TID
}
 wait Ack enumerated type More...
 
enum  {
  BLOCK_ACK_REQUEST_NONE, BLOCK_ACK_REQUEST_BASIC, BLOCK_ACK_REQUEST_COMPRESSED, BLOCK_ACK_REQUEST_EXTENDED_COMPRESSED,
  BLOCK_ACK_REQUEST_MULTI_TID
}
 send BAR enumerated type More...
 

Private Attributes

uint32_t m_nextSize
 the next size More...
 
enum ns3::MacLowTransmissionParameters:: { ... }  m_sendBar
 send BAR enumerated type More...
 
bool m_sendRts
 send an RTS? More...
 
enum ns3::MacLowTransmissionParameters:: { ... }  m_waitAck
 wait Ack enumerated type More...
 

Friends

std::ostream & operator<< (std::ostream &os, const MacLowTransmissionParameters &params)
 Serialize MacLowTransmissionParameters to ostream in a human-readable form. More...
 

Detailed Description

control how a packet is transmitted.

The ns3::MacLow::StartTransmission method expects an instance of this class to describe how the packet should be transmitted.

Definition at line 39 of file mac-low-transmission-parameters.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

wait Ack enumerated type

Enumerator
ACK_NONE 
ACK_NORMAL 
BLOCK_ACK_BASIC 
BLOCK_ACK_COMPRESSED 
BLOCK_ACK_EXTENDED_COMPRESSED 
BLOCK_ACK_MULTI_TID 

Definition at line 145 of file mac-low-transmission-parameters.h.

◆ anonymous enum

anonymous enum
private

send BAR enumerated type

Enumerator
BLOCK_ACK_REQUEST_NONE 
BLOCK_ACK_REQUEST_BASIC 
BLOCK_ACK_REQUEST_COMPRESSED 
BLOCK_ACK_REQUEST_EXTENDED_COMPRESSED 
BLOCK_ACK_REQUEST_MULTI_TID 

Definition at line 155 of file mac-low-transmission-parameters.h.

Constructor & Destructor Documentation

◆ MacLowTransmissionParameters()

ns3::MacLowTransmissionParameters::MacLowTransmissionParameters ( )

Definition at line 27 of file mac-low-transmission-parameters.cc.

Member Function Documentation

◆ DisableAck()

void ns3::MacLowTransmissionParameters::DisableAck ( void  )

Do not wait for Ack after data transmission.

Typically used for Broadcast and multicast frames.

Definition at line 108 of file mac-low-transmission-parameters.cc.

References ACK_NONE, and m_waitAck.

Referenced by ns3::QosTxop::GetTransmissionParameters(), ns3::Txop::NotifyAccessGranted(), ns3::MacLow::SendBlockAckResponse(), and ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ DisableBlockAckRequest()

void ns3::MacLowTransmissionParameters::DisableBlockAckRequest ( void  )

Do not send BlockAckRequest after data transmission.

Definition at line 114 of file mac-low-transmission-parameters.cc.

References BLOCK_ACK_REQUEST_NONE, and m_sendBar.

◆ DisableNextData()

void ns3::MacLowTransmissionParameters::DisableNextData ( void  )

Do not attempt to send data burst after current transmission.

Definition at line 42 of file mac-low-transmission-parameters.cc.

References m_nextSize.

Referenced by ns3::QosTxop::GetTransmissionParameters(), ns3::QosTxop::NotifyAccessGranted(), ns3::Txop::NotifyAccessGranted(), ns3::QosTxop::SendAddBaRequest(), ns3::MacLow::SendBlockAckResponse(), and ns3::Txop::StartNextFragment().

+ Here is the caller graph for this function:

◆ DisableRts()

void ns3::MacLowTransmissionParameters::DisableRts ( void  )

Do not send RTS and wait for CTS before sending data.

Definition at line 126 of file mac-low-transmission-parameters.cc.

References m_sendRts.

Referenced by ns3::QosTxop::GetTransmissionParameters(), ns3::QosTxop::NotifyAccessGranted(), ns3::Txop::NotifyAccessGranted(), ns3::QosTxop::SendAddBaRequest(), and ns3::Txop::StartNextFragment().

+ Here is the caller graph for this function:

◆ EnableAck()

void ns3::MacLowTransmissionParameters::EnableAck ( void  )

Wait ACKTimeout for an Ack.

If we get an Ack on time, call MacLowTransmissionListener::GotAck. Call MacLowTransmissionListener::MissedAck otherwise.

Definition at line 100 of file mac-low-transmission-parameters.cc.

References ACK_NORMAL, BLOCK_ACK_REQUEST_NONE, m_sendBar, and m_waitAck.

Referenced by ns3::QosTxop::GetTransmissionParameters(), ns3::Txop::NotifyAccessGranted(), ns3::QosTxop::SendAddBaRequest(), ns3::MacLow::SendBlockAckResponse(), ns3::Txop::StartNextFragment(), and ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ EnableBlockAck()

void ns3::MacLowTransmissionParameters::EnableBlockAck ( BlockAckType  type)

Wait the timeout corresponding to the given BlockAck response type.

Parameters
typethe BlockAck response type

Definition at line 48 of file mac-low-transmission-parameters.cc.

References ns3::BASIC_BLOCK_ACK, BLOCK_ACK_BASIC, BLOCK_ACK_COMPRESSED, BLOCK_ACK_EXTENDED_COMPRESSED, BLOCK_ACK_MULTI_TID, BLOCK_ACK_REQUEST_NONE, ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, m_sendBar, m_waitAck, ns3::MULTI_TID_BLOCK_ACK, and NS_FATAL_ERROR.

Referenced by ns3::QosTxop::GetTransmissionParameters(), and ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ EnableBlockAckRequest()

void ns3::MacLowTransmissionParameters::EnableBlockAckRequest ( BlockAckType  type)

Schedule the transmission of a BlockAckRequest of the given type.

Parameters
typethe BlockAckRequest type

Definition at line 74 of file mac-low-transmission-parameters.cc.

References ACK_NONE, ns3::BASIC_BLOCK_ACK, BLOCK_ACK_REQUEST_BASIC, BLOCK_ACK_REQUEST_COMPRESSED, BLOCK_ACK_REQUEST_EXTENDED_COMPRESSED, BLOCK_ACK_REQUEST_MULTI_TID, ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, m_sendBar, m_waitAck, ns3::MULTI_TID_BLOCK_ACK, and NS_FATAL_ERROR.

Referenced by ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ EnableNextData()

void ns3::MacLowTransmissionParameters::EnableNextData ( uint32_t  size)
Parameters
sizesize of next data to send after current packet is sent in bytes.

Add the transmission duration of the next data to the durationId of the outgoing packet and call MacLowTransmissionListener::StartNextFragment at the end of the current transmission + SIFS.

Definition at line 36 of file mac-low-transmission-parameters.cc.

References m_nextSize.

Referenced by ns3::QosTxop::NotifyAccessGranted(), ns3::Txop::NotifyAccessGranted(), and ns3::Txop::StartNextFragment().

+ Here is the caller graph for this function:

◆ EnableRts()

void ns3::MacLowTransmissionParameters::EnableRts ( void  )

Send a RTS, and wait CTSTimeout for a CTS.

If we get a CTS on time, call MacLowTransmissionListener::GotCts and send data. Otherwise, call MacLowTransmissionListener::MissedCts and do not send data.

Definition at line 120 of file mac-low-transmission-parameters.cc.

References m_sendRts.

Referenced by ns3::QosTxop::GetTransmissionParameters(), and ns3::Txop::NotifyAccessGranted().

+ Here is the caller graph for this function:

◆ GetBlockAckRequestType()

BlockAckType ns3::MacLowTransmissionParameters::GetBlockAckRequestType ( void  ) const
Returns
the selected BlockAckRequest variant.

Only call this method if a BlockAckRequest must be sent.

Definition at line 201 of file mac-low-transmission-parameters.cc.

References ns3::BASIC_BLOCK_ACK, BLOCK_ACK_REQUEST_BASIC, BLOCK_ACK_REQUEST_COMPRESSED, BLOCK_ACK_REQUEST_EXTENDED_COMPRESSED, BLOCK_ACK_REQUEST_MULTI_TID, ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, m_sendBar, ns3::MULTI_TID_BLOCK_ACK, and NS_FATAL_ERROR.

Referenced by ns3::MacLow::GetResponseDuration().

+ Here is the caller graph for this function:

◆ GetBlockAckType()

BlockAckType ns3::MacLowTransmissionParameters::GetBlockAckType ( void  ) const
Returns
the selected BlockAck variant.

Only call this method if the block ack mechanism is used.

Definition at line 157 of file mac-low-transmission-parameters.cc.

References ns3::BASIC_BLOCK_ACK, BLOCK_ACK_BASIC, BLOCK_ACK_COMPRESSED, BLOCK_ACK_EXTENDED_COMPRESSED, BLOCK_ACK_MULTI_TID, ns3::COMPRESSED_BLOCK_ACK, ns3::EXTENDED_COMPRESSED_BLOCK_ACK, m_waitAck, ns3::MULTI_TID_BLOCK_ACK, and NS_FATAL_ERROR.

Referenced by ns3::MacLow::GetResponseDuration().

+ Here is the caller graph for this function:

◆ GetNextPacketSize()

uint32_t ns3::MacLowTransmissionParameters::GetNextPacketSize ( void  ) const
Returns
the size specified by EnableNextData.

Definition at line 238 of file mac-low-transmission-parameters.cc.

References HasNextPacket(), m_nextSize, and NS_ASSERT.

Referenced by ns3::MacLow::CalculateTransmissionTime(), ns3::MacLow::SendCtsToSelf(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), and ns3::MacLow::SendRtsForPacket().

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

◆ HasNextPacket()

bool ns3::MacLowTransmissionParameters::HasNextPacket ( void  ) const

◆ MustSendBlockAckRequest()

bool ns3::MacLowTransmissionParameters::MustSendBlockAckRequest ( void  ) const
Returns
true if a BlockAckRequest must be sent, false otherwise.

Return true if a BlockAckRequest must be sent, false otherwise.

Definition at line 182 of file mac-low-transmission-parameters.cc.

References BLOCK_ACK_REQUEST_BASIC, BLOCK_ACK_REQUEST_COMPRESSED, BLOCK_ACK_REQUEST_EXTENDED_COMPRESSED, BLOCK_ACK_REQUEST_MULTI_TID, and m_sendBar.

Referenced by ns3::MacLow::GetResponseDuration(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), and ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ MustSendRts()

bool ns3::MacLowTransmissionParameters::MustSendRts ( void  ) const
Returns
true if RTS should be sent and CTS waited for before sending data, false otherwise.

Definition at line 226 of file mac-low-transmission-parameters.cc.

References m_sendRts.

Referenced by ns3::MacLow::CalculateOverheadTxTime(), ns3::MacLow::StartTransmission(), and ns3::ConstantWifiAckPolicySelector::UpdateTxParams().

+ Here is the caller graph for this function:

◆ MustWaitBlockAck()

bool ns3::MacLowTransmissionParameters::MustWaitBlockAck ( void  ) const
Returns
true if block ack mechanism is used, false otherwise.
See also
EnableBlockAck

Definition at line 138 of file mac-low-transmission-parameters.cc.

References BLOCK_ACK_BASIC, BLOCK_ACK_COMPRESSED, BLOCK_ACK_EXTENDED_COMPRESSED, BLOCK_ACK_MULTI_TID, and m_waitAck.

Referenced by ns3::MacLow::GetResponseDuration(), ns3::MacLow::ReceiveOk(), ns3::WifiAckPolicySelector::SetAckPolicy(), and ns3::MacLow::StartDataTxTimers().

+ Here is the caller graph for this function:

◆ MustWaitNormalAck()

bool ns3::MacLowTransmissionParameters::MustWaitNormalAck ( void  ) const
Returns
true if normal ack protocol should be used, false otherwise.
See also
EnableAck

Definition at line 132 of file mac-low-transmission-parameters.cc.

References ACK_NORMAL, and m_waitAck.

Referenced by ns3::MacLow::GetResponseDuration(), ns3::MacLow::ReceiveOk(), ns3::WifiAckPolicySelector::SetAckPolicy(), and ns3::MacLow::StartDataTxTimers().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const MacLowTransmissionParameters params 
)
friend

Serialize MacLowTransmissionParameters to ostream in a human-readable form.

Parameters
osstd::ostream
paramsMacLowTransmissionParameters
Returns
std::ostream

Definition at line 244 of file mac-low-transmission-parameters.cc.

Member Data Documentation

◆ m_nextSize

uint32_t ns3::MacLowTransmissionParameters::m_nextSize
private

◆ m_sendBar

enum { ... } ns3::MacLowTransmissionParameters::m_sendBar

◆ m_sendRts

bool ns3::MacLowTransmissionParameters::m_sendRts
private

send an RTS?

Definition at line 163 of file mac-low-transmission-parameters.h.

Referenced by DisableRts(), EnableRts(), MustSendRts(), and ns3::operator<<().

◆ m_waitAck

enum { ... } ns3::MacLowTransmissionParameters::m_waitAck

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