A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
backoff.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 Emmanuelle Laprise
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca
18
* Derived from the p2p net device file
19
Transmi */
20
21
#ifndef BACKOFF_H
22
#define BACKOFF_H
23
24
#include "ns3/nstime.h"
25
#include "ns3/random-variable-stream.h"
26
27
#include <stdint.h>
28
29
namespace
ns3
30
{
31
38
class
Backoff
39
{
40
public
:
45
uint32_t
m_minSlots
;
46
51
uint32_t
m_maxSlots
;
52
56
uint32_t
m_ceiling
;
57
61
uint32_t
m_maxRetries
;
62
67
Time
m_slotTime
;
68
69
Backoff
();
78
Backoff
(
Time
slotTime,
79
uint32_t minSlots,
80
uint32_t maxSlots,
81
uint32_t ceiling,
82
uint32_t maxRetries);
83
88
Time
GetBackoffTime
();
89
95
void
ResetBackoffTime
();
96
100
bool
MaxRetriesReached
()
const
;
101
105
void
IncrNumRetries
();
106
115
int64_t
AssignStreams
(int64_t stream);
116
117
private
:
121
uint32_t
m_numBackoffRetries
;
122
126
Ptr<UniformRandomVariable>
m_rng
;
127
};
128
129
}
// namespace ns3
130
131
#endif
/* BACKOFF_H */
ns3::Backoff
The backoff class is used for calculating backoff times when many net devices can write to the same c...
Definition:
backoff.h:39
ns3::Backoff::ResetBackoffTime
void ResetBackoffTime()
Indicates to the backoff object that the last packet was successfully transmitted and that the number...
Definition:
backoff.cc:85
ns3::Backoff::m_maxRetries
uint32_t m_maxRetries
Maximum number of transmission retries before the packet is dropped.
Definition:
backoff.h:61
ns3::Backoff::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
backoff.cc:103
ns3::Backoff::m_maxSlots
uint32_t m_maxSlots
Maximum number of backoff slots (when multiplied by m_slotTime, determines maximum backoff time)
Definition:
backoff.h:51
ns3::Backoff::m_numBackoffRetries
uint32_t m_numBackoffRetries
Number of times that the transmitter has tried to unsuccessfuly transmit the current packet.
Definition:
backoff.h:121
ns3::Backoff::MaxRetriesReached
bool MaxRetriesReached() const
Definition:
backoff.cc:91
ns3::Backoff::IncrNumRetries
void IncrNumRetries()
Increments the number of retries by 1.
Definition:
backoff.cc:97
ns3::Backoff::m_minSlots
uint32_t m_minSlots
Minimum number of backoff slots (when multiplied by m_slotTime, determines minimum backoff time)
Definition:
backoff.h:45
ns3::Backoff::Backoff
Backoff()
Definition:
backoff.cc:29
ns3::Backoff::GetBackoffTime
Time GetBackoffTime()
Definition:
backoff.cc:58
ns3::Backoff::m_rng
Ptr< UniformRandomVariable > m_rng
Random number generator.
Definition:
backoff.h:126
ns3::Backoff::m_ceiling
uint32_t m_ceiling
Caps the exponential function when the number of retries reaches m_ceiling.
Definition:
backoff.h:56
ns3::Backoff::m_slotTime
Time m_slotTime
Length of one slot.
Definition:
backoff.h:67
ns3::Ptr< UniformRandomVariable >
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
csma
model
backoff.h
Generated on Sun Mar 3 2024 17:10:56 for ns-3 by
1.9.1