36 m_rng = CreateObject<UniformRandomVariable> ();
41 Backoff::Backoff(
Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries)
49 m_rng = CreateObject<UniformRandomVariable> ();
67 uint32_t maxSlot = (uint32_t)pow (2, ceiling) - 1;
73 uint32_t backoffSlots = (uint32_t)
m_rng->
GetValue (minSlot, maxSlot);
Simulation virtual time values and global simulation resolution.
void ResetBackoffTime(void)
Indicates to the backoff object that the last packet was successfully transmitted and that the number...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
uint32_t m_maxSlots
Maximum number of backoff slots (when multiplied by m_slotTime, determines maximum backoff time) ...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_maxRetries
Maximum number of transmission retries before the packet is dropped.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
bool MaxRetriesReached(void)
Ptr< UniformRandomVariable > m_rng
Random number generator.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
uint32_t m_minSlots
Minimum number of backoff slots (when multiplied by m_slotTime, determines minimum backoff time) ...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time m_slotTime
Length of one slot.
void IncrNumRetries(void)
Increments the number of retries by 1.
uint32_t m_numBackoffRetries
Number of times that the transmitter has tried to unsuccessfully transmit the current packet...
uint32_t m_ceiling
Caps the exponential function when the number of retries reaches m_ceiling.