ns-3
ns3::Backoff Class Reference

The backoff class is used for calculating backoff times when many net devices can write to the same channel. More...

#include <backoff.h>

Collaboration diagram for ns3::Backoff:

List of all members.

Public Member Functions

 Backoff (Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries)
Time GetBackoffTime ()
void ResetBackoffTime (void)
bool MaxRetriesReached (void)
void IncrNumRetries (void)

Public Attributes

uint32_t m_minSlots
uint32_t m_maxSlots
uint32_t m_ceiling
uint32_t m_maxRetries
Time m_slotTime

Detailed Description

The backoff class is used for calculating backoff times when many net devices can write to the same channel.


Member Function Documentation

Time ns3::Backoff::GetBackoffTime ( void  )
Returns:
The amount of time that the net device should wait before trying to retransmit the packet

References ns3::UniformVariable::GetValue(), m_ceiling, m_maxSlots, m_minSlots, and m_slotTime.

void ns3::Backoff::IncrNumRetries ( void  )

Increments the number of retries by 1.

bool ns3::Backoff::MaxRetriesReached ( void  )
Returns:
True if the maximum number of retries has been reached

References m_maxRetries.

void ns3::Backoff::ResetBackoffTime ( void  )

Indicates to the backoff object that the last packet was successfully transmitted and that the number of retries should be reset to 0.


Member Data Documentation

uint32_t ns3::Backoff::m_ceiling

Caps the exponential function when the number of retries reaches m_ceiling.

Referenced by GetBackoffTime(), and ns3::CsmaNetDevice::SetBackoffParams().

uint32_t ns3::Backoff::m_maxRetries

Maximum number of transmission retries before the packet is dropped.

Referenced by MaxRetriesReached(), and ns3::CsmaNetDevice::SetBackoffParams().

uint32_t ns3::Backoff::m_maxSlots

Maximum number of backoff slots (when multiplied by m_slotTime, determines maximum backoff time)

Referenced by GetBackoffTime(), and ns3::CsmaNetDevice::SetBackoffParams().

uint32_t ns3::Backoff::m_minSlots

Minimum number of backoff slots (when multiplied by m_slotTime, determines minimum backoff time)

Referenced by GetBackoffTime(), and ns3::CsmaNetDevice::SetBackoffParams().

Time ns3::Backoff::m_slotTime

Length of one slot. A slot time, it usually the packet transmission time, if the packet size is fixed.

Referenced by GetBackoffTime(), and ns3::CsmaNetDevice::SetBackoffParams().


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