A Discrete-Event Network Simulator
API
tcp-rto-test.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Natale Patriciello <natale.patriciello@gmail.com>
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * 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  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 
20 #include "ns3/node.h"
21 #include "ns3/log.h"
22 #include "ns3/tcp-westwood.h"
23 #include "ns3/simple-channel.h"
24 #include "ns3/rtt-estimator.h"
25 #include "tcp-general-test.h"
26 #include "tcp-error-model.h"
27 
28 NS_LOG_COMPONENT_DEFINE ("TcpRtoTest");
29 
30 using namespace ns3;
31 
45 class TcpRtoTest : public TcpGeneralTest
46 {
47 public:
53  TcpRtoTest (TypeId &congControl, const std::string &msg);
54 
55 protected:
56 
57  virtual Ptr<TcpSocketMsgBase> CreateSenderSocket (Ptr<Node> node);
58  virtual void AfterRTOExpired (const Ptr<const TcpSocketState> tcb, SocketWho who);
59  virtual void RcvAck (const Ptr<const TcpSocketState> tcb,
60  const TcpHeader& h, SocketWho who);
61  virtual void ProcessedAck (const Ptr<const TcpSocketState> tcb,
62  const TcpHeader& h, SocketWho who);
63  virtual void FinalChecks ();
64  virtual void ConfigureProperties ();
65  virtual void ConfigureEnvironment ();
66 
67 private:
70 };
71 
72 TcpRtoTest::TcpRtoTest (TypeId &congControl, const std::string &desc)
73  : TcpGeneralTest (desc),
74  m_afterRTOExpired (false),
75  m_segmentReceived (false)
76 {
77  m_congControlTypeId = congControl;
78 }
79 
80 void
82 {
83  TcpGeneralTest::ConfigureEnvironment ();
84  SetAppPktCount (100);
85 }
86 
87 void
89 {
90  TcpGeneralTest::ConfigureProperties ();
92 }
93 
96 {
97  // Get a really low RTO, and let them fire as soon as possible since
98  // we are interested only in what happen after it expires
99  Ptr<TcpSocketMsgBase> socket = TcpGeneralTest::CreateSenderSocket (node);
100  socket->SetAttribute ("MinRto", TimeValue (Seconds (0.5)));
101 
102  return socket;
103 }
104 
105 void
107 {
108  // In this test, the RTO fires for the first segment (and no more).
109  // This function is called after the management of the RTO expiration,
110  // and because of this we must check all the involved variables.
112  "Second RTO expired");
113  NS_TEST_ASSERT_MSG_EQ (GetCongStateFrom (tcb), TcpSocketState::CA_LOSS,
114  "Ack state machine not in LOSS state after a loss");
115 
116  m_afterRTOExpired = true;
117 }
118 
119 void
121  SocketWho who)
122 {
123  // Called after the first ack is received (the lost segment has been
124  // successfully retransmitted. We must check on the sender that variables
125  // are in the same state as they where after AfterRTOExpired if it is the first
126  // ACK after the loss; in every other case, all must be OPEN and the counter
127  // set to 0.
128 
129  if (m_afterRTOExpired && who == SENDER)
130  {
131  NS_TEST_ASSERT_MSG_EQ (GetCongStateFrom (tcb), TcpSocketState::CA_LOSS,
132  "Ack state machine not in LOSS state after a loss");
133  }
134  else
135  {
136  NS_TEST_ASSERT_MSG_EQ (GetCongStateFrom (tcb), TcpSocketState::CA_OPEN,
137  "Ack state machine not in OPEN state after recovering "
138  "from loss");
139  }
140 }
141 
142 void
144  SocketWho who)
145 {
146  // Called after the ACK processing. Every time we should be in OPEN state,
147  // without any packet lost or marked as retransmitted, in both the sockets
148 
149  NS_TEST_ASSERT_MSG_EQ (GetCongStateFrom (tcb), TcpSocketState::CA_OPEN,
150  "Ack state machine not in OPEN state after recovering "
151  "from loss");
152 
153  if (who == SENDER)
154  {
155  m_afterRTOExpired = false;
156  m_segmentReceived = true;
157  }
158 }
159 
160 void
162 {
163  // At least one time we should process an ACK; otherwise, the segment
164  // has not been retransmitted, and this is bad
165 
167  "Retransmission has not been done");
168 }
169 
170 
182 {
183 public:
191  TcpSsThreshRtoTest (TypeId &congControl, uint32_t seqToDrop, Time minRto, const std::string &msg);
192 
193 protected:
194 
197  virtual void BytesInFlightTrace (uint32_t oldValue, uint32_t newValue);
198  virtual void SsThreshTrace (uint32_t oldValue, uint32_t newValue);
199  virtual void BeforeRTOExpired (const Ptr<const TcpSocketState> tcb, SocketWho who);
200  virtual void AfterRTOExpired (const Ptr<const TcpSocketState> tcb, SocketWho who);
201 
202  virtual void ConfigureEnvironment ();
203 
210  void PktDropped (const Ipv4Header &ipH, const TcpHeader& tcpH, Ptr<const Packet> p);
211 
212 private:
213  uint32_t m_bytesInFlight;
215  uint32_t m_ssThreshSocket;
216  uint32_t m_seqToDrop;
218 };
219 
220 TcpSsThreshRtoTest::TcpSsThreshRtoTest (TypeId &congControl, uint32_t seqToDrop, Time minRto, const std::string &desc)
221  : TcpGeneralTest (desc),
222  m_seqToDrop (seqToDrop),
223  m_minRtoTime (minRto)
224 {
225  m_congControlTypeId = congControl;
226 }
227 
228 void
230 {
231  TcpGeneralTest::ConfigureEnvironment ();
232  SetAppPktCount (100);
235 }
236 
239 {
240  Ptr<TcpSocketMsgBase> socket = TcpGeneralTest::CreateSenderSocket (node);
241  socket->SetAttribute ("MinRto", TimeValue (m_minRtoTime));
242  NS_LOG_DEBUG("TcpSsThreshRtoTest create sender socket");
243 
244  return socket;
245 }
246 
249 {
250  NS_LOG_DEBUG("TcpSsThreshRtoTest create errorModel");
251 
252  Ptr<TcpSeqErrorModel> errorModel = CreateObject<TcpSeqErrorModel> ();
253 
254  for (uint32_t i = 0; i<3; ++i)
255  {
256  errorModel->AddSeqToKill (SequenceNumber32 (m_seqToDrop));
257  }
258 
260 
261  return errorModel;
262 }
263 
264 void
267 {
268  NS_LOG_DEBUG ("DROPPED! " << tcpH);
269 }
270 
271 void
272 TcpSsThreshRtoTest::BytesInFlightTrace (uint32_t oldValue, uint32_t newValue)
273 {
274  NS_LOG_DEBUG ("Socket BytesInFlight=" << newValue);
275  m_bytesInFlight = newValue;
276 }
277 
278 void
279 TcpSsThreshRtoTest::SsThreshTrace (uint32_t oldValue, uint32_t newValue)
280 {
281  NS_LOG_DEBUG ("Socket ssThresh=" << newValue);
282  m_ssThreshSocket = newValue;
283 }
284 
285 void
287 {
288  NS_LOG_DEBUG ("Before RTO for connection " << who);
289 
290  // Get the bytesInFlight value before the expiration of the RTO
291 
292  if (who == SENDER)
293  {
295  NS_LOG_DEBUG("BytesInFlight before RTO Expired " << m_bytesInFlight);
296  }
297 }
298 
299 void
301 {
302  NS_LOG_DEBUG ("After RTO for " << who);
303  Ptr<TcpSocketMsgBase> senderSocket = GetSenderSocket();
304 
305  // compute the ssThresh according to RFC 5681, using the
306  uint32_t ssThresh = std::max(m_bytesInFlightBeforeRto/2, 2*tcb->m_segmentSize);
307 
308  NS_LOG_DEBUG ("ssThresh " << ssThresh << " m_ssThreshSocket " << m_ssThreshSocket);
309 
311  "Slow Start Threshold is incorrect");
312 }
313 
314 
324 {
325 public:
331  TcpTimeRtoTest (TypeId &congControl, const std::string &msg);
332 
333 protected:
336  virtual void ErrorClose (SocketWho who);
337  virtual void AfterRTOExpired (const Ptr<const TcpSocketState> tcb, SocketWho who);
338  virtual void Tx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
339  virtual void FinalChecks ();
340 
341  virtual void ConfigureEnvironment ();
342 
349  void PktDropped (const Ipv4Header &ipH, const TcpHeader& tcpH, Ptr<const Packet> p);
350 
351 private:
354  bool m_closed;
355 };
356 
357 
358 TcpTimeRtoTest::TcpTimeRtoTest (TypeId &congControl, const std::string &desc)
359  : TcpGeneralTest (desc),
360  m_senderSentSegments (0),
361  m_closed (false)
362 {
363  m_congControlTypeId = congControl;
364 }
365 
366 void
368 {
369  TcpGeneralTest::ConfigureEnvironment ();
370  SetAppPktCount (100);
371 }
372 
373 
376 {
377  Ptr<TcpSocketMsgBase> s = TcpGeneralTest::CreateSenderSocket (node);
378  s->SetAttribute ("DataRetries", UintegerValue (6));
379 
380  return s;
381 }
382 
385 {
386  Ptr<TcpSeqErrorModel> errorModel = CreateObject<TcpSeqErrorModel> ();
387 
388  // Drop packet for 7 times. At the 7th, the connection should be dropped.
389  for (uint32_t i = 0; i<7; ++i)
390  {
391  errorModel->AddSeqToKill (SequenceNumber32 (1));
392  }
393 
395 
396  return errorModel;
397 }
398 
399 void
401 {
402  NS_LOG_FUNCTION (this << p << h << who);
403 
404  if (who == SENDER)
405  {
407  NS_LOG_INFO ("Measured RTO:" << GetRto (SENDER).GetSeconds ());
408 
409  if (h.GetFlags () & TcpHeader::SYN)
410  {
412 
413  Time s_rto = GetRto (SENDER);
415  "SYN packet sent without respecting "
416  "ConnTimeout attribute");
417  }
418  else
419  {
420  NS_LOG_INFO ("TX: " << h << m_senderSentSegments);
421 
423  "First packet has been correctly sent");
424 
425  // Remember, from RFC:
426  // m_rto = Max (m_rtt->GetEstimate () +
427  // Max (m_clockGranularity, m_rtt->GetVariation ()*4), m_minRto);
428 
429  if (m_senderSentSegments == 2)
430  { // ACK of SYN-ACK, rto set for the first time, since now we have
431  // an estimation of RTT
432 
433  Ptr<RttEstimator> rttEstimator = GetRttEstimator (SENDER);
434  Time clockGranularity = GetClockGranularity (SENDER);
435  m_previousRTO = rttEstimator->GetEstimate ();
436 
437  if (clockGranularity > rttEstimator->GetVariation ()*4)
438  {
439  m_previousRTO += clockGranularity;
440  }
441  else
442  {
443  m_previousRTO += rttEstimator->GetVariation ()*4;
444  }
445 
447 
449  "RTO value differs from calculation");
450  }
451  else if (m_senderSentSegments == 3)
452  { // First data packet. RTO should be the same as before
453 
455  "RTO value has changed unexpectedly");
456 
457  }
458  }
459  }
460  else if (who == RECEIVER)
461  {
462 
463  }
464 }
465 
466 void
468 {
469  m_closed = true;
470 }
471 
472 void
474 {
475  NS_TEST_ASSERT_MSG_EQ (who, SENDER, "RTO in Receiver. That's unexpected");
476 
477  Time actualRto = GetRto (SENDER);
478 
479  if (actualRto < Seconds (60))
480  {
482  "RTO has not doubled after an expiration");
484  }
485  else
486  {
487  NS_TEST_ASSERT_MSG_EQ (actualRto, Seconds (60),
488  "RTO goes beyond 60 second limit");
489  }
490 }
491 
492 void
495 {
496  NS_LOG_INFO ("DROPPED! " << tcpH);
497 }
498 
499 void
501 {
503  "Socket has not been closed after retrying data retransmissions");
504 }
505 
506 
514 {
515 public:
516  TcpRtoTestSuite () : TestSuite ("tcp-rto-test", UNIT)
517  {
518  std::list<TypeId> types;
519  types.insert (types.begin (), TcpNewReno::GetTypeId ());
520  types.insert (types.begin (), TcpWestwood::GetTypeId ());
521 
522  for (std::list<TypeId>::iterator it = types.begin (); it != types.end (); ++it)
523  {
524  AddTestCase (new TcpRtoTest ((*it), (*it).GetName () + " RTO retransmit testing"), TestCase::QUICK);
525  uint32_t seqToDrop = 25001;
526  Time minRto = Seconds (0.5);
527  // With RTO of 0.5 seconds, BytesInFlight winds down to zero before RTO
528  AddTestCase (new TcpSsThreshRtoTest ((*it), seqToDrop, minRto, (*it).GetName () + " RTO ssthresh testing, set to 2*MSL"), TestCase::QUICK);
529  // With RTO of 0.005 seconds, FlightSize/2 > 2*SMSS
530  minRto = Seconds (0.005);
531  AddTestCase (new TcpSsThreshRtoTest ((*it), seqToDrop, minRto, (*it).GetName () + " RTO ssthresh testing, set to half of BytesInFlight"), TestCase::QUICK);
532  AddTestCase (new TcpTimeRtoTest ((*it), (*it).GetName () + " RTO timing testing"), TestCase::QUICK);
533  }
534  }
535 };
536 
538 
539 
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
TcpSsThreshRtoTest::m_seqToDrop
uint32_t m_seqToDrop
the sequence number to drop
Definition: tcp-rto-test.cc:216
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::Ipv4Header
Packet header for IPv4.
Definition: ipv4-header.h:34
TcpRtoTest::ConfigureProperties
virtual void ConfigureProperties()
Change the configuration of the socket properties.
Definition: tcp-rto-test.cc:88
ns3::TcpGeneralTest::SocketWho
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
Definition: tcp-general-test.h:275
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
TcpSsThreshRtoTest::ConfigureEnvironment
virtual void ConfigureEnvironment()
Change the configuration of the environment.
Definition: tcp-rto-test.cc:229
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
TcpSsThreshRtoTest::CreateReceiverErrorModel
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
Definition: tcp-rto-test.cc:248
TcpRtoTest::TcpRtoTest
TcpRtoTest(TypeId &congControl, const std::string &msg)
Constructor.
Definition: tcp-rto-test.cc:72
TcpSsThreshRtoTest
Testing the ssthresh behavior after the RTO expires.
Definition: tcp-rto-test.cc:182
TcpRtoTest
Testing the moments after an RTO expiration.
Definition: tcp-rto-test.cc:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TcpGeneralTest::SENDER
@ SENDER
Sender node.
Definition: tcp-general-test.h:276
TcpSsThreshRtoTest::TcpSsThreshRtoTest
TcpSsThreshRtoTest(TypeId &congControl, uint32_t seqToDrop, Time minRto, const std::string &msg)
Constructor.
Definition: tcp-rto-test.cc:220
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
TcpRtoTestSuite
TCP RTO TestSuite.
Definition: tcp-rto-test.cc:514
ns3::TcpSocketState::m_segmentSize
uint32_t m_segmentSize
Segment size.
Definition: tcp-socket-state.h:177
ns3::TcpGeneralTest::SetAppPktCount
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
Definition: tcp-general-test.h:650
ns3::GetCongStateFrom
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
Definition: tcp-general-test.h:1175
TcpTimeRtoTest::CreateReceiverErrorModel
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
Definition: tcp-rto-test.cc:384
ns3::TcpGeneralTest::GetConnTimeout
Time GetConnTimeout(SocketWho who)
Get the retransmission time for the SYN segments.
Definition: tcp-general-test.cc:728
TcpSsThreshRtoTest::PktDropped
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet has been dropped.
Definition: tcp-rto-test.cc:265
g_TcpRtoTestSuite
static TcpRtoTestSuite g_TcpRtoTestSuite
Static variable for test initialization.
Definition: tcp-rto-test.cc:537
ns3::ObjectBase::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
ns3::RttEstimator::GetVariation
Time GetVariation(void) const
Note that this is not a formal statistical variance; it has the the same units as the estimate.
Definition: rtt-estimator.cc:66
ns3::TcpGeneralTest::GetSenderSocket
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
Definition: tcp-general-test.h:343
TcpRtoTest::ConfigureEnvironment
virtual void ConfigureEnvironment()
Change the configuration of the environment.
Definition: tcp-rto-test.cc:81
TcpTimeRtoTest::TcpTimeRtoTest
TcpTimeRtoTest(TypeId &congControl, const std::string &msg)
Constructor.
Definition: tcp-rto-test.cc:358
ns3::TcpGeneralErrorModel::SetDropCallback
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
Definition: tcp-error-model.h:52
TcpTimeRtoTest::AfterRTOExpired
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-rto-test.cc:473
TcpTimeRtoTest::CreateSenderSocket
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Definition: tcp-rto-test.cc:375
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
TcpSsThreshRtoTest::CreateSenderSocket
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Definition: tcp-rto-test.cc:238
TcpSsThreshRtoTest::BytesInFlightTrace
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Bytes in flight changes.
Definition: tcp-rto-test.cc:272
max
#define max(a, b)
Definition: 80211b.c:43
TcpTimeRtoTest::ErrorClose
virtual void ErrorClose(SocketWho who)
Socket closed with an error.
Definition: tcp-rto-test.cc:467
NS_LOG_INFO
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
NS_TEST_ASSERT_MSG_EQ_TOL
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition: test.h:378
TcpTimeRtoTest::m_closed
bool m_closed
True if the connection is closed.
Definition: tcp-rto-test.cc:354
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
TcpTimeRtoTest::PktDropped
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet has been dropped.
Definition: tcp-rto-test.cc:493
ns3::TcpGeneralTest::SetAppPktInterval
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
Definition: tcp-general-test.h:657
ns3::TcpGeneralTest::GetMinRto
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
Definition: tcp-general-test.cc:711
tcp-error-model.h
TcpSsThreshRtoTest::BeforeRTOExpired
virtual void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-rto-test.cc:286
ns3::TcpGeneralTest::RECEIVER
@ RECEIVER
Receiver node.
Definition: tcp-general-test.h:277
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::TcpHeader
Header for the Transmission Control Protocol.
Definition: tcp-header.h:45
TcpTimeRtoTest::Tx
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
Definition: tcp-rto-test.cc:400
TcpTimeRtoTest
Testing the timing of RTO.
Definition: tcp-rto-test.cc:324
TcpRtoTest::m_segmentReceived
bool m_segmentReceived
True if segments have been received.
Definition: tcp-rto-test.cc:69
TcpSsThreshRtoTest::m_minRtoTime
Time m_minRtoTime
the minimum RTO time
Definition: tcp-rto-test.cc:217
TcpSsThreshRtoTest::m_bytesInFlight
uint32_t m_bytesInFlight
Store the number of bytes in flight.
Definition: tcp-rto-test.cc:213
tcp-general-test.h
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
ns3::TcpGeneralTest
General infrastructure for TCP testing.
Definition: tcp-general-test.h:257
TcpTimeRtoTest::ConfigureEnvironment
virtual void ConfigureEnvironment()
Change the configuration of the environment.
Definition: tcp-rto-test.cc:367
TcpRtoTest::RcvAck
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
Definition: tcp-rto-test.cc:120
TcpRtoTest::FinalChecks
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Definition: tcp-rto-test.cc:161
TcpSsThreshRtoTest::m_ssThreshSocket
uint32_t m_ssThreshSocket
the ssThresh as computed by the socket
Definition: tcp-rto-test.cc:215
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1344
TcpRtoTest::AfterRTOExpired
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-rto-test.cc:106
ns3::SequenceNumber::GetValue
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
Definition: sequence-number.h:116
ns3::TcpGeneralTest::GetRto
Time GetRto(SocketWho who)
Get the retransmission time.
Definition: tcp-general-test.cc:694
NS_TEST_ASSERT_MSG_EQ
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:166
TcpTimeRtoTest::m_previousRTO
Time m_previousRTO
Previous RTO.
Definition: tcp-rto-test.cc:353
TcpRtoTestSuite::TcpRtoTestSuite
TcpRtoTestSuite()
Definition: tcp-rto-test.cc:516
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::TestSuite::UNIT
@ UNIT
This test suite implements a Unit Test.
Definition: test.h:1353
TcpRtoTest::m_afterRTOExpired
bool m_afterRTOExpired
True if RTO is expired.
Definition: tcp-rto-test.cc:68
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::TcpGeneralTest::m_congControlTypeId
TypeId m_congControlTypeId
Congestion control.
Definition: tcp-general-test.h:1036
TcpSsThreshRtoTest::AfterRTOExpired
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-rto-test.cc:300
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::TcpHeader::GetFlags
uint8_t GetFlags() const
Get the flags.
Definition: tcp-header.cc:173
ns3::RttEstimator::GetEstimate
Time GetEstimate(void) const
gets the RTT estimate.
Definition: rtt-estimator.cc:60
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
TcpRtoTest::CreateSenderSocket
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Definition: tcp-rto-test.cc:95
TcpTimeRtoTest::m_senderSentSegments
uint32_t m_senderSentSegments
Number of segments sent.
Definition: tcp-rto-test.cc:352
TcpSsThreshRtoTest::SsThreshTrace
virtual void SsThreshTrace(uint32_t oldValue, uint32_t newValue)
Slow start threshold changes.
Definition: tcp-rto-test.cc:279
TcpSsThreshRtoTest::m_bytesInFlightBeforeRto
uint32_t m_bytesInFlightBeforeRto
Store the number of bytes in flight before the RTO expiration.
Definition: tcp-rto-test.cc:214
ns3::TcpSeqErrorModel::AddSeqToKill
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
Definition: tcp-error-model.h:100
TcpRtoTest::ProcessedAck
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
Definition: tcp-rto-test.cc:143
Max
#define Max(a, b)
Definition: aarf-wifi-manager.cc:26
ns3::TcpGeneralTest::SetInitialSsThresh
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
Definition: tcp-general-test.cc:1022
ns3::TcpGeneralTest::GetClockGranularity
Time GetClockGranularity(SocketWho who)
Get the clock granularity attribute.
Definition: tcp-general-test.cc:762
ns3::SequenceNumber< uint32_t, int32_t >
TcpTimeRtoTest::FinalChecks
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Definition: tcp-rto-test.cc:500
ns3::TcpGeneralTest::GetRttEstimator
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
Definition: tcp-general-test.cc:745
ns3::TcpGeneralTest::SetPropagationDelay
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
Definition: tcp-general-test.h:664
ns3::TcpHeader::GetSequenceNumber
SequenceNumber32 GetSequenceNumber() const
Get the sequence number.
Definition: tcp-header.cc:143