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

control how a packet is transmitted. More...

#include "mac-low.h"

+ Collaboration diagram for ns3::MacLowTransmissionParameters:

Public Member Functions

 MacLowTransmissionParameters ()
 
void DisableAck (void)
 Do not wait for Ack after data transmission. More...
 
void DisableNextData (void)
 Do not attempt to send data burst after current transmission. More...
 
void DisableOverrideDurationId (void)
 Do not force the duration/id field of the packet: its value is automatically calculated by the MacLow before calling WifiPhy::Send. 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 EnableBasicBlockAck (void)
 Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame. More...
 
void EnableCompressedBlockAck (void)
 Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame. More...
 
void EnableFastAck (void)
 
void EnableMultiTidBlockAck (void)
 NOT IMPLEMENTED FOR NOW. More...
 
void EnableNextData (uint32_t size)
 
void EnableOverrideDurationId (Time durationId)
 
void EnableRts (void)
 Send a RTS, and wait CTSTimeout for a CTS. More...
 
void EnableSuperFastAck (void)
 
Time GetDurationId (void) const
 
uint32_t GetNextPacketSize (void) const
 
bool HasDurationId (void) const
 
bool HasNextPacket (void) const
 
bool MustSendRts (void) const
 
bool MustWaitAck (void) const
 
bool MustWaitBasicBlockAck (void) const
 
bool MustWaitCompressedBlockAck (void) const
 
bool MustWaitFastAck (void) const
 
bool MustWaitMultiTidBlockAck (void) const
 
bool MustWaitNormalAck (void) const
 
bool MustWaitSuperFastAck (void) const
 

Private Types

enum  {
  ACK_NONE, ACK_NORMAL, ACK_FAST, ACK_SUPER_FAST,
  BLOCK_ACK_BASIC, BLOCK_ACK_COMPRESSED, BLOCK_ACK_MULTI_TID
}
 wait ack enumerated type More...
 

Private Attributes

uint32_t m_nextSize
 the next size More...
 
Time m_overrideDurationId
 override duration ID 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 54 of file mac-low.h.

Constructor & Destructor Documentation

ns3::MacLowTransmissionParameters::MacLowTransmissionParameters ( )

Definition at line 40 of file mac-low.cc.

Member Function Documentation

void ns3::MacLowTransmissionParameters::DisableAck ( void  )

Do not wait for Ack after data transmission.

Typically used for Broadcast and multicast frames.

Definition at line 98 of file mac-low.cc.

References ACK_NONE, and m_waitAck.

Referenced by ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::MacLow::SendBlockAckResponse(), and ns3::EdcaTxopN::StartNextPacket().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::DisableNextData ( void  )

Do not attempt to send data burst after current transmission.

Definition at line 53 of file mac-low.cc.

References m_nextSize.

Referenced by ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::MacLow::SendBlockAckResponse(), ns3::DcaTxop::StartNextFragment(), and ns3::EdcaTxopN::StartNextPacket().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::DisableOverrideDurationId ( void  )

Do not force the duration/id field of the packet: its value is automatically calculated by the MacLow before calling WifiPhy::Send.

Definition at line 63 of file mac-low.cc.

References m_overrideDurationId, and ns3::Seconds().

Referenced by ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::DcaTxop::StartNextFragment(), and ns3::EdcaTxopN::StartNextPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::DisableRts ( void  )

Do not send rts and wait for cts before sending data.

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

References m_sendRts.

Referenced by ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::DcaTxop::StartNextFragment(), and ns3::MacLow::StartTransmission().

+ Here is the caller graph for this function:

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 93 of file mac-low.cc.

References ACK_NORMAL, and m_waitAck.

Referenced by ns3::EdcaTxopN::HasTxop(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::EdcaTxopN::SendAddBaRequest(), ns3::EdcaTxopN::SendBlockAckRequest(), ns3::MacLow::SendBlockAckResponse(), ns3::DcaTxop::StartNextFragment(), ns3::EdcaTxopN::StartNextPacket(), and ns3::MacLow::StartTransmission().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::EnableBasicBlockAck ( void  )

Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame.

Definition at line 73 of file mac-low.cc.

References BLOCK_ACK_BASIC, and m_waitAck.

Referenced by ns3::EdcaTxopN::SendBlockAckRequest().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::EnableCompressedBlockAck ( void  )

Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame.

Definition at line 78 of file mac-low.cc.

References BLOCK_ACK_COMPRESSED, and m_waitAck.

Referenced by ns3::EdcaTxopN::SendBlockAckRequest(), and ns3::MacLow::StartTransmission().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::EnableFastAck ( void  )
  • wait PIFS after end-of-tx. If idle, call MacLowTransmissionListener::MissedAck.
  • if busy at end-of-tx+PIFS, wait end-of-rx
  • if Ack ok at end-of-rx, call MacLowTransmissionListener::GotAck.
  • if Ack not ok at end-of-rx, report call MacLowTransmissionListener::MissedAck at end-of-rx+SIFS.

This is really complicated but it is needed for proper HCCA support.

Definition at line 88 of file mac-low.cc.

References ACK_FAST, and m_waitAck.

void ns3::MacLowTransmissionParameters::EnableMultiTidBlockAck ( void  )

NOT IMPLEMENTED FOR NOW.

Definition at line 83 of file mac-low.cc.

References BLOCK_ACK_MULTI_TID, and m_waitAck.

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

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 48 of file mac-low.cc.

References m_nextSize.

Referenced by ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), and ns3::DcaTxop::StartNextFragment().

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::EnableOverrideDurationId ( Time  durationId)
Parameters
durationIdthe value to set in the duration/Id field of the outgoing packet.

Ignore all other durationId calculation and simply force the packet's durationId field to this value.

Definition at line 58 of file mac-low.cc.

References m_overrideDurationId.

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 103 of file mac-low.cc.

References m_sendRts.

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

+ Here is the caller graph for this function:

void ns3::MacLowTransmissionParameters::EnableSuperFastAck ( void  )
  • if busy at end-of-tx+PIFS, call MacLowTransmissionListener::GotAck
  • if idle at end-of-tx+PIFS, call MacLowTransmissionListener::MissedAck

Definition at line 68 of file mac-low.cc.

References ACK_SUPER_FAST, and m_waitAck.

Time ns3::MacLowTransmissionParameters::GetDurationId ( void  ) const
Returns
the duration/id forced by EnableOverrideDurationId

Definition at line 158 of file mac-low.cc.

References ns3::Time::IsZero(), m_overrideDurationId, and NS_ASSERT.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 169 of file mac-low.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:

bool ns3::MacLowTransmissionParameters::HasDurationId ( void  ) const
Returns
true if a duration/id was forced with EnableOverrideDurationId, false otherwise.

Definition at line 153 of file mac-low.cc.

References ns3::Time::IsZero(), and m_overrideDurationId.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::MacLowTransmissionParameters::HasNextPacket ( void  ) const
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 148 of file mac-low.cc.

References m_sendRts.

Referenced by ns3::MacLow::AggregateToAmpdu(), ns3::MacLow::CalculateOverallTxFragmentTime(), ns3::MacLow::CalculateOverallTxTime(), and ns3::MacLow::StartTransmission().

+ Here is the caller graph for this function:

bool ns3::MacLowTransmissionParameters::MustWaitAck ( void  ) const
Returns
true if must wait for ACK after data transmission, false otherwise.

This methods returns true when any of MustWaitNormalAck, MustWaitFastAck, or MustWaitSuperFastAck return true.

Definition at line 113 of file mac-low.cc.

References ACK_NONE, and m_waitAck.

Referenced by ns3::MacLow::CalculateOverallTxFragmentTime(), ns3::MacLow::CalculateOverallTxTime(), ns3::MacLow::ReceiveOk(), ns3::MacLow::SendCtsToSelf(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), and ns3::MacLow::SendRtsForPacket().

+ Here is the caller graph for this function:

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

Definition at line 133 of file mac-low.cc.

References BLOCK_ACK_BASIC, and m_waitAck.

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

+ Here is the caller graph for this function:

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

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

References BLOCK_ACK_COMPRESSED, and m_waitAck.

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

+ Here is the caller graph for this function:

bool ns3::MacLowTransmissionParameters::MustWaitFastAck ( void  ) const
Returns
true if fast ack protocol should be used, false otherwise.
See also
EnableFastAck

Definition at line 123 of file mac-low.cc.

References ACK_FAST, and m_waitAck.

Referenced by ns3::MacLow::ReceiveError(), ns3::MacLow::ReceiveOk(), and ns3::MacLow::StartDataTxTimers().

+ Here is the caller graph for this function:

bool ns3::MacLowTransmissionParameters::MustWaitMultiTidBlockAck ( void  ) const
Returns
true if multi-tid block ack mechanism is used, false otherwise.
See also
EnableMultiTidBlockAck

Definition at line 143 of file mac-low.cc.

References BLOCK_ACK_MULTI_TID, and m_waitAck.

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

Definition at line 118 of file mac-low.cc.

References ACK_NORMAL, and m_waitAck.

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

+ Here is the caller graph for this function:

bool ns3::MacLowTransmissionParameters::MustWaitSuperFastAck ( void  ) const
Returns
true if super fast ack protocol should be used, false otherwise.
See also
EnableSuperFastAck

Definition at line 128 of file mac-low.cc.

References ACK_SUPER_FAST, and m_waitAck.

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

+ Here is the caller graph for this function:

Friends And Related Function Documentation

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 175 of file mac-low.cc.

Member Data Documentation

uint32_t ns3::MacLowTransmissionParameters::m_nextSize
private

the next size

Definition at line 214 of file mac-low.h.

Referenced by DisableNextData(), EnableNextData(), GetNextPacketSize(), HasNextPacket(), and ns3::operator<<().

Time ns3::MacLowTransmissionParameters::m_overrideDurationId
private

override duration ID

Definition at line 227 of file mac-low.h.

Referenced by DisableOverrideDurationId(), EnableOverrideDurationId(), GetDurationId(), HasDurationId(), and ns3::operator<<().

bool ns3::MacLowTransmissionParameters::m_sendRts
private

send an RTS?

Definition at line 226 of file mac-low.h.

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


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