OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 // | 2 // |
3 // Copyright (c) 2006 Georgia Tech Research Corporation | 3 // Copyright (c) 2006 Georgia Tech Research Corporation |
| 4 // Copyright (c) 2013 ResiliNets, ITTC, University of Kansas |
4 // | 5 // |
5 // This program is free software; you can redistribute it and/or modify | 6 // 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 // it under the terms of the GNU General Public License version 2 as |
7 // published by the Free Software Foundation; | 8 // published by the Free Software Foundation; |
8 // | 9 // |
9 // This program is distributed in the hope that it will be useful, | 10 // This program is distributed in the hope that it will be useful, |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 // GNU General Public License for more details. | 13 // GNU General Public License for more details. |
13 // | 14 // |
14 // You should have received a copy of the GNU General Public License | 15 // 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 // 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 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 // | 18 // |
18 // Author: Rajib Bhattacharjea<raj.b@gatech.edu> | 19 // Author: Rajib Bhattacharjea<raj.b@gatech.edu> |
19 // | 20 // |
20 | 21 |
21 // Georgia Tech Network Simulator - Round Trip Time Estimation Class | 22 // Georgia Tech Network Simulator - Round Trip Time Estimation Class |
22 // George F. Riley. Georgia Tech, Spring 2002 | 23 // George F. Riley. Georgia Tech, Spring 2002 |
23 | 24 |
| 25 /* Added EstimateRtt () to use the timestamp value for estimating RTT |
| 26 * |
| 27 * Author: Truc Anh N. Nguyen <annguyen@ittc.ku.edu> |
| 28 * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets |
| 29 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director |
| 30 */ |
| 31 |
24 | 32 |
25 #ifndef RTT_ESTIMATOR_H | 33 #ifndef RTT_ESTIMATOR_H |
26 #define RTT_ESTIMATOR_H | 34 #define RTT_ESTIMATOR_H |
27 | 35 |
28 #include <deque> | 36 #include <deque> |
29 #include "ns3/sequence-number.h" | 37 #include "ns3/sequence-number.h" |
30 #include "ns3/nstime.h" | 38 #include "ns3/nstime.h" |
31 #include "ns3/object.h" | 39 #include "ns3/object.h" |
32 | 40 |
33 namespace ns3 { | 41 namespace ns3 { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 * \return The measured RTT for this ack. | 87 * \return The measured RTT for this ack. |
80 */ | 88 */ |
81 virtual Time AckSeq (SequenceNumber32 ackSeq); | 89 virtual Time AckSeq (SequenceNumber32 ackSeq); |
82 | 90 |
83 /** | 91 /** |
84 * \brief Clear all history entries | 92 * \brief Clear all history entries |
85 */ | 93 */ |
86 virtual void ClearSent (); | 94 virtual void ClearSent (); |
87 | 95 |
88 /** | 96 /** |
| 97 * \brief Note that a particular ack sequence has been received |
| 98 * |
| 99 * \param echoTime the timestamp value echoed in this ack when TSopt is used |
| 100 * \return the measured RTT for this ack |
| 101 */ |
| 102 virtual Time EstimateRtt (uint32_t echoTime); |
| 103 |
| 104 /** |
89 * \brief Add a new measurement to the estimator. Pure virtual function. | 105 * \brief Add a new measurement to the estimator. Pure virtual function. |
90 * \param t the new RTT measure. | 106 * \param t the new RTT measure. |
91 */ | 107 */ |
92 virtual void Measurement (Time t) = 0; | 108 virtual void Measurement (Time t) = 0; |
93 | 109 |
94 /** | 110 /** |
95 * \brief Returns the estimated RTO. Pure virtual function. | 111 * \brief Returns the estimated RTO. Pure virtual function. |
96 * \return the estimated RTO. | 112 * \return the estimated RTO. |
97 */ | 113 */ |
98 virtual Time RetransmitTimeout () = 0; | 114 virtual Time RetransmitTimeout () = 0; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 */ | 212 */ |
197 void Gain (double g); | 213 void Gain (double g); |
198 | 214 |
199 private: | 215 private: |
200 double m_gain; // Filter gain | 216 double m_gain; // Filter gain |
201 Time m_variance; // Current variance | 217 Time m_variance; // Current variance |
202 }; | 218 }; |
203 } // namespace ns3 | 219 } // namespace ns3 |
204 | 220 |
205 #endif /* RTT_ESTIMATOR_H */ | 221 #endif /* RTT_ESTIMATOR_H */ |
OLD | NEW |