A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
delay-jitter-estimation.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
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
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef DELAY_JITTER_ESTIMATION_H
20
#define DELAY_JITTER_ESTIMATION_H
21
22
#include "ns3/nstime.h"
23
#include "ns3/packet.h"
24
25
namespace
ns3
26
{
27
28
/**
29
* \ingroup stats
30
*
31
* \brief Quick and dirty delay and jitter estimation,
32
* implementing the jitter algorithm originally from
33
* \RFC{1889} (RTP), and unchanged in \RFC{3550}
34
*
35
* This implementation uses the integer variant of the algorithm
36
* given in RFC 1889 Appendix A.8 ,p. 71, and repeated in
37
* RFC 3550 Appendix A.8, p. 94.
38
*/
39
class
DelayJitterEstimation
40
{
41
public
:
42
DelayJitterEstimation
();
43
44
/**
45
* This method should be invoked once on each packet to
46
* record within the packet the tx time which is used upon
47
* packet reception to calculate the delay and jitter. The
48
* tx time is stored in the packet as an ns3::Tag which means
49
* that it does not use any network resources and is not
50
* taken into account in transmission delay calculations.
51
*
52
* \param packet the packet to send over a wire
53
*/
54
static
void
PrepareTx
(
Ptr<const Packet>
packet);
55
56
/**
57
* Invoke this method to update the delay and jitter calculations
58
* After a call to this method, \ref GetLastDelay and \ref GetLastJitter
59
* will return an updated delay and jitter.
60
*
61
* \param packet the packet received
62
*/
63
void
RecordRx
(
Ptr<const Packet>
packet);
64
65
/**
66
* Get the Last Delay object.
67
*
68
* \return the updated delay.
69
*/
70
Time
GetLastDelay
()
const
;
71
72
/**
73
* The jitter is calculated using the \RFC{1889} (RTP) jitter
74
* definition.
75
*
76
* \return the updated jitter.
77
*/
78
uint64_t
GetLastJitter
()
const
;
79
80
private
:
81
Time
m_jitter
{0};
//!< Jitter estimation
82
Time
m_transit
{0};
//!< Relative transit time for the previous packet
83
};
84
85
}
// namespace ns3
86
87
#endif
/* DELAY_JITTER_ESTIMATION_H */
ns3::DelayJitterEstimation
Quick and dirty delay and jitter estimation, implementing the jitter algorithm originally from RFC 18...
Definition:
delay-jitter-estimation.h:40
ns3::DelayJitterEstimation::GetLastDelay
Time GetLastDelay() const
Get the Last Delay object.
Definition:
delay-jitter-estimation.cc:67
ns3::DelayJitterEstimation::RecordRx
void RecordRx(Ptr< const Packet > packet)
Invoke this method to update the delay and jitter calculations After a call to this method,...
Definition:
delay-jitter-estimation.cc:41
ns3::DelayJitterEstimation::DelayJitterEstimation
DelayJitterEstimation()
Definition:
delay-jitter-estimation.cc:29
ns3::DelayJitterEstimation::GetLastJitter
uint64_t GetLastJitter() const
The jitter is calculated using the RFC 1889 (RTP) jitter definition.
Definition:
delay-jitter-estimation.cc:73
ns3::DelayJitterEstimation::PrepareTx
static void PrepareTx(Ptr< const Packet > packet)
This method should be invoked once on each packet to record within the packet the tx time which is us...
Definition:
delay-jitter-estimation.cc:34
ns3::DelayJitterEstimation::m_transit
Time m_transit
Relative transit time for the previous packet.
Definition:
delay-jitter-estimation.h:82
ns3::DelayJitterEstimation::m_jitter
Time m_jitter
Jitter estimation.
Definition:
delay-jitter-estimation.h:81
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
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
network
helper
delay-jitter-estimation.h
Generated on Tue May 28 2024 23:38:27 for ns-3 by
1.9.6