blob: e8b419c32fb8e1b4d14641e526b8acc3b9cf6b07 [file] [log] [blame]
Alexander Afanasyevd9a7f192013-03-07 13:58:14 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2//
3// Copyright (c) 2006 Georgia Tech Research Corporation
4// (c) 2013 University of Arizona
5// (c) 2013 University of California, Los Angeles
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License version 2 as
9// published by the Free Software Foundation;
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// Author: Rajib Bhattacharjea<raj.b@gatech.edu>
21// Cheng Yi <yic@email.arizona.edu>
22// Alexander Afanasyev <alexander.afanasyev@ucla.edu>
23//
24
25// Georgia Tech Network Simulator - Round Trip Time Estimation Class
26// George F. Riley. Georgia Tech, Spring 2002
27
28
29#ifndef NDN_RTT_MEAN_DEVIATION_H
30#define NDN_RTT_MEAN_DEVIATION_H
31
32#include <ns3/ndnSIM/utils/ndn-rtt-estimator.h>
33
34namespace ns3 {
35namespace ndn {
36
37/**
38 * \ingroup ndn
39 *
40 * \brief The modified version of "Mean--Deviation" RTT estimator, as discussed by Van Jacobson that better suits NDN communication model
41 *
42 * This class implements the "Mean--Deviation" RTT estimator, as discussed
43 * by Van Jacobson and Michael J. Karels, in
44 * "Congestion Avoidance and Control", SIGCOMM 88, Appendix A
45 *
46 */
47class RttMeanDeviation : public RttEstimator {
48public:
49 static TypeId GetTypeId (void);
50
51 RttMeanDeviation ();
52 RttMeanDeviation (const RttMeanDeviation&);
53
Cheng Yi3089c472013-03-07 18:12:41 -070054 void SentSeq (SequenceNumber32 seq, uint32_t size);
Alexander Afanasyevd9a7f192013-03-07 13:58:14 -080055 Time AckSeq (SequenceNumber32 ackSeq);
56 void Measurement (Time measure);
57 Time RetransmitTimeout ();
58 Ptr<RttEstimator> Copy () const;
59 void Reset ();
60 void Gain (double g);
61
62private:
63 double m_gain; // Filter gain
64 double m_gain2; // Filter gain
65 Time m_variance; // Current variance
66};
67
68} // namespace ndn
69} // namespace ns3
70
71#endif // NDN_RTT_MEAN_DEVIATION