Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 1 | /* -*- 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 | |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 28 | #ifndef NDN_RTT_MEAN_DEVIATION_H |
| 29 | #define NDN_RTT_MEAN_DEVIATION_H |
| 30 | |
Alexander Afanasyev | 0c39537 | 2014-12-20 15:54:02 -0800 | [diff] [blame] | 31 | #include "ndn-rtt-estimator.hpp" |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 32 | |
| 33 | namespace ns3 { |
| 34 | namespace ndn { |
| 35 | |
| 36 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 37 | * \ingroup ndn-apps |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 38 | * |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 39 | * \brief The modified version of "Mean--Deviation" RTT estimator, as discussed by Van Jacobson that |
| 40 | *better suits NDN communication model |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 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 | */ |
| 47 | class RttMeanDeviation : public RttEstimator { |
| 48 | public: |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 49 | static TypeId |
| 50 | GetTypeId(void); |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 51 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 52 | RttMeanDeviation(); |
| 53 | RttMeanDeviation(const RttMeanDeviation&); |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 54 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 55 | virtual TypeId |
| 56 | GetInstanceTypeId(void) const; |
Yaogong Wang | 87cd065 | 2013-05-28 11:00:45 -0400 | [diff] [blame] | 57 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 58 | void |
| 59 | SentSeq(SequenceNumber32 seq, uint32_t size); |
| 60 | Time |
| 61 | AckSeq(SequenceNumber32 ackSeq); |
| 62 | void |
| 63 | Measurement(Time measure); |
| 64 | Time |
| 65 | RetransmitTimeout(); |
| 66 | Ptr<RttEstimator> |
| 67 | Copy() const; |
| 68 | void |
| 69 | Reset(); |
| 70 | void |
| 71 | Gain(double g); |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 72 | |
| 73 | private: |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 74 | double m_gain; // Filter gain |
| 75 | double m_gain2; // Filter gain |
| 76 | Time m_variance; // Current variance |
Alexander Afanasyev | d9a7f19 | 2013-03-07 13:58:14 -0800 | [diff] [blame] | 77 | }; |
| 78 | |
| 79 | } // namespace ndn |
| 80 | } // namespace ns3 |
| 81 | |
| 82 | #endif // NDN_RTT_MEAN_DEVIATION |