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 // | 4 // |
5 // This program is free software; you can redistribute it and/or modify | 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 | 6 // it under the terms of the GNU General Public License version 2 as |
7 // published by the Free Software Foundation; | 7 // published by the Free Software Foundation; |
8 // | 8 // |
9 // This program is distributed in the hope that it will be useful, | 9 // This program is distributed in the hope that it will be useful, |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 { | 161 { |
162 m_next = seq + SequenceNumber32 (size); | 162 m_next = seq + SequenceNumber32 (size); |
163 i->count = ((seq + SequenceNumber32 (size)) - i->seq); // And
update count in hist | 163 i->count = ((seq + SequenceNumber32 (size)) - i->seq); // And
update count in hist |
164 } | 164 } |
165 break; | 165 break; |
166 } | 166 } |
167 } | 167 } |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 Time RttEstimator::AckSeq (SequenceNumber32 ackSeq) | 171 Time RttEstimator::EstimateRttFromSeq (SequenceNumber32 ackSeq) |
172 {· | 172 {· |
173 NS_LOG_FUNCTION (this << ackSeq); | 173 NS_LOG_FUNCTION (this << ackSeq); |
174 // An ack has been received, calculate rtt and log this measurement | 174 // An ack has been received, calculate rtt and log this measurement |
175 // Note we use a linear search (O(n)) for this since for the common | 175 // Note we use a linear search (O(n)) for this since for the common |
176 // case the ack'ed packet will be at the head of the list | 176 // case the ack'ed packet will be at the head of the list |
177 Time m = Seconds (0.0); | 177 Time m = Seconds (0.0); |
178 if (m_history.size () == 0) return (m); // No pending history, just exit | 178 if (m_history.size () == 0) return (m); // No pending history, just exit |
179 RttHistory& h = m_history.front (); | 179 RttHistory& h = m_history.front (); |
180 if (!h.retx && ackSeq >= (h.seq + SequenceNumber32 (h.count))) | 180 if (!h.retx && ackSeq >= (h.seq + SequenceNumber32 (h.count))) |
181 { // Ok to use this sample | 181 { // Ok to use this sample |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 RttEstimator::Reset (); | 318 RttEstimator::Reset (); |
319 } | 319 } |
320 void RttMeanDeviation::Gain (double g) | 320 void RttMeanDeviation::Gain (double g) |
321 { | 321 { |
322 NS_LOG_FUNCTION (this); | 322 NS_LOG_FUNCTION (this); |
323 NS_ASSERT_MSG( (g > 0) && (g < 1), "RttMeanDeviation: Gain must be less than 1
and greater than 0" ); | 323 NS_ASSERT_MSG( (g > 0) && (g < 1), "RttMeanDeviation: Gain must be less than 1
and greater than 0" ); |
324 m_gain = g; | 324 m_gain = g; |
325 } | 325 } |
326 | 326 |
327 } //namespace ns3 | 327 } //namespace ns3 |
OLD | NEW |