A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
rtt-estimator.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
//
3
// Copyright (c) 2006 Georgia Tech Research Corporation
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License version 2 as
7
// published by the Free Software Foundation;
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
//
18
// Author: Rajib Bhattacharjea<raj.b@gatech.edu>
19
//
20
21
// Georgia Tech Network Simulator - Round Trip Time Estimation Class
22
// George F. Riley. Georgia Tech, Spring 2002
23
24
25
#ifndef RTT_ESTIMATOR_H
26
#define RTT_ESTIMATOR_H
27
28
#include <deque>
29
#include "ns3/sequence-number.h"
30
#include "ns3/nstime.h"
31
#include "ns3/object.h"
32
33
namespace
ns3 {
34
40
class
RttHistory
{
41
public
:
42
RttHistory
(
SequenceNumber32
s, uint32_t c,
Time
t);
43
RttHistory
(
const
RttHistory
& h);
// Copy constructor
44
public
:
45
SequenceNumber32
seq;
// First sequence number in packet sent
46
uint32_t count;
// Number of bytes sent
47
Time
time;
// Time this one was sent
48
bool
retx;
// True if this has been retransmitted
49
};
50
51
typedef
std::deque<RttHistory> RttHistory_t;
52
58
class
RttEstimator
:
public
Object
{
59
public
:
60
static
TypeId
GetTypeId (
void
);
61
62
RttEstimator
();
63
RttEstimator
(
const
RttEstimator
&);
64
65
virtual
~
RttEstimator
();
66
67
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
68
74
virtual
void
SentSeq
(
SequenceNumber32
seq, uint32_t size);
75
81
virtual
Time
AckSeq
(
SequenceNumber32
ackSeq);
82
86
virtual
void
ClearSent
();
87
92
virtual
void
Measurement
(
Time
t) = 0;
93
98
virtual
Time
RetransmitTimeout
() = 0;
99
100
virtual
Ptr<RttEstimator>
Copy ()
const
= 0;
101
105
virtual
void
IncreaseMultiplier
();
106
110
virtual
void
ResetMultiplier
();
111
115
virtual
void
Reset
();
116
121
void
SetMinRto
(
Time
minRto);
122
127
Time
GetMinRto
(
void
)
const
;
128
133
void
SetCurrentEstimate
(
Time
estimate);
134
139
Time
GetCurrentEstimate
(
void
)
const
;
140
141
private
:
142
SequenceNumber32
m_next;
// Next expected sequence to be sent
143
RttHistory_t m_history;
// List of sent packet
144
uint16_t m_maxMultiplier;
145
Time
m_initialEstimatedRtt;
146
147
protected
:
148
Time
m_currentEstimatedRtt;
// Current estimate
149
Time
m_minRto;
// minimum value of the timeout
150
uint32_t m_nSamples;
// Number of samples
151
uint16_t m_multiplier;
// RTO Multiplier
152
};
153
164
class
RttMeanDeviation
:
public
RttEstimator
{
165
public
:
166
static
TypeId
GetTypeId (
void
);
167
168
RttMeanDeviation
();
169
170
RttMeanDeviation
(
const
RttMeanDeviation
&);
171
172
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
173
178
void
Measurement
(
Time
measure);
179
184
Time
RetransmitTimeout
();
185
186
Ptr<RttEstimator>
Copy ()
const
;
187
191
void
Reset
();
192
197
void
Gain
(
double
g);
198
199
private
:
200
double
m_gain;
// Filter gain
201
Time
m_variance;
// Current variance
202
};
203
}
// namespace ns3
204
205
#endif
/* RTT_ESTIMATOR_H */
ns3::Time
keep track of time unit.
Definition:
nstime.h:149
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::RttEstimator::RetransmitTimeout
virtual Time RetransmitTimeout()=0
Returns the estimated RTO. Pure virtual function.
ns3::RttMeanDeviation
The "Mean--Deviation" RTT estimator, as discussed by Van Jacobson.
Definition:
rtt-estimator.h:164
ns3::RttEstimator::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
rtt-estimator.cc:138
ns3::RttEstimator::ResetMultiplier
virtual void ResetMultiplier()
Resets the estimation multiplier to 1.
Definition:
rtt-estimator.cc:211
ns3::RttEstimator::GetCurrentEstimate
Time GetCurrentEstimate(void) const
gets the current RTT estimate.
Definition:
rtt-estimator.cc:86
ns3::RttEstimator
Base class for all RTT Estimators.
Definition:
rtt-estimator.h:58
ns3::RttEstimator::Measurement
virtual void Measurement(Time t)=0
Add a new measurement to the estimator. Pure virtual function.
ns3::SequenceNumber< uint32_t, int32_t >
ns3::RttEstimator::SentSeq
virtual void SentSeq(SequenceNumber32 seq, uint32_t size)
Note that a particular sequence has been sent.
Definition:
rtt-estimator.cc:143
ns3::RttEstimator::GetMinRto
Time GetMinRto(void) const
Get the Minimum RTO.
Definition:
rtt-estimator.cc:75
ns3::RttMeanDeviation::RetransmitTimeout
Time RetransmitTimeout()
Returns the estimated RTO.
Definition:
rtt-estimator.cc:291
ns3::RttEstimator::SetMinRto
void SetMinRto(Time minRto)
Sets the Minimum RTO.
Definition:
rtt-estimator.cc:69
ns3::RttEstimator::Reset
virtual void Reset()
Resets the estimation to its initial state.
Definition:
rtt-estimator.cc:217
ns3::RttMeanDeviation::Reset
void Reset()
Resets sthe estimator.
Definition:
rtt-estimator.cc:313
ns3::RttEstimator::IncreaseMultiplier
virtual void IncreaseMultiplier()
Increase the estimation multiplier up to MaxMultiplier.
Definition:
rtt-estimator.cc:204
ns3::RttMeanDeviation::Measurement
void Measurement(Time measure)
Add a new measurement to the estimator.
Definition:
rtt-estimator.cc:269
ns3::RttMeanDeviation::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
rtt-estimator.cc:264
ns3::RttHistory
Helper class to store RTT measurements.
Definition:
rtt-estimator.h:40
ns3::RttEstimator::SetCurrentEstimate
void SetCurrentEstimate(Time estimate)
Sets the current RTT estimate (forcefully).
Definition:
rtt-estimator.cc:80
ns3::RttEstimator::ClearSent
virtual void ClearSent()
Clear all history entries.
Definition:
rtt-estimator.cc:196
ns3::RttMeanDeviation::Gain
void Gain(double g)
Sets the estimator Gain.
Definition:
rtt-estimator.cc:320
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::RttEstimator::AckSeq
virtual Time AckSeq(SequenceNumber32 ackSeq)
Note that a particular ack sequence has been received.
Definition:
rtt-estimator.cc:171
src
internet
model
rtt-estimator.h
Generated on Sun Mar 16 2014 11:25:05 for ns-3 by
1.8.6