A Discrete-Event Network Simulator
API
tcp-rate-ops-test.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 NITK Surathkal
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  * Authors: Vivek Jain <jain.vivek.anand@gmail.com>
19  * Viyom Mittal <viyommittal@gmail.com>
20  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
21  */
22 
23 #include "ns3/test.h"
24 #include "ns3/tcp-tx-item.h"
25 #include "ns3/log.h"
26 #include "ns3/tcp-rate-ops.h"
27 #include "tcp-general-test.h"
28 #include "ns3/config.h"
29 #include "tcp-error-model.h"
30 #include "ns3/tcp-tx-buffer.h"
31 
32 using namespace ns3;
33 
34 NS_LOG_COMPONENT_DEFINE ("TcpRateOpsTestSuite");
35 
36 class MimicCongControl;
37 
45 {
46 public:
47 
56  TcpRateLinuxBasicTest (uint32_t cWnd, SequenceNumber32 tailSeq, SequenceNumber32 nextTx,
57  uint32_t testCase, std::string testName);
58 
59 private:
60  virtual void DoRun (void);
61 
66  void SendSkb (TcpTxItem * skb);
71  void SkbDelivered (TcpTxItem * skb);
72 
74  uint32_t m_cWnd;
75  uint32_t m_inFlight;
76  uint32_t m_segmentSize;
77  uint32_t m_delivered;
81  uint32_t m_testCase;
82  std::vector <TcpTxItem *> m_skbs;
83 };
84 
86  SequenceNumber32 nextTx,
87  uint32_t testCase, std::string testName)
88  : TestCase (testName),
89  m_cWnd (cWnd),
90  m_inFlight (0),
91  m_segmentSize (1),
92  m_delivered (0),
93  m_deliveredTime (Seconds (0)),
94  m_tailSeq (tailSeq),
95  m_nextTx (nextTx),
96  m_testCase (testCase)
97 {
98 }
99 
100 void
102 {
103  for (uint8_t i = 0; i < 100; ++i)
104  {
105  m_skbs.push_back (new TcpTxItem ());
106  Simulator::Schedule (Time (Seconds (i * 0.01)), &TcpRateLinuxBasicTest::SendSkb, this, m_skbs [i]);
107  }
108 
109  for (uint8_t i = 0; i < 100; ++i)
110  {
111  Simulator::Schedule (Time (Seconds ((i + 1) * 0.1)), &TcpRateLinuxBasicTest::SkbDelivered, this, m_skbs [i]);
112  }
113 
114  Simulator::Run ();
115  Simulator::Destroy ();
116 
117  for (uint8_t i = 0; i < 100; ++i)
118  {
119  delete m_skbs[i];
120  }
121 }
122 
123 void
125 {
126  bool isStartOfTransmission = m_inFlight == 0;
128  m_rateOps.SkbSent (skb, isStartOfTransmission);
129  m_inFlight += skb->GetSeqSize ();
130 
131  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_delivered, m_delivered, "SKB should have delivered equal to current value of total delivered");
132 
133  if (isStartOfTransmission)
134  {
135  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_deliveredTime, Simulator::Now (), "SKB should have updated the delivered time to current value");
136  }
137  else
138  {
139  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_deliveredTime, m_deliveredTime, "SKB should have updated the delivered time to current value");
140  }
141 }
142 
143 void
145 {
146  m_rateOps.SkbDelivered (skb);
147  m_inFlight -= skb->GetSeqSize ();
148  m_delivered += skb->GetSeqSize ();
150 
151  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_deliveredTime, Time::Max (), "SKB should have delivered time as Time::Max ()");
152 
153  if (m_testCase == 1)
154  {
155  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_isAppLimited, false, "Socket should not be applimited");
156  }
157  else if (m_testCase == 2)
158  {
159  NS_TEST_ASSERT_MSG_EQ (skb->GetRateInformation ().m_isAppLimited, true, "Socket should be applimited");
160  }
161 }
162 
170 {
171 public:
176  static TypeId GetTypeId (void);
177 
179  {
180  }
181 
182  virtual bool HasCongControl () const
183  {
184  return true;
185  }
186 
187 };
188 
189 TypeId
191 {
192  static TypeId tid = TypeId ("ns3::MimicCongControl")
193  .SetParent<TcpNewReno> ()
194  .AddConstructor<MimicCongControl> ()
195  .SetGroupName ("Internet")
196  ;
197  return tid;
198 }
199 
212 {
213 public:
220  TcpRateLinuxWithSocketsTest (const std::string &desc, bool sackEnabled,
221  std::vector<uint32_t> &toDrop);
222 
223 protected:
230 
236 
243  virtual void Rx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
244 
250  virtual void BytesInFlightTrace (uint32_t oldValue, uint32_t newValue);
251 
258  void PktDropped (const Ipv4Header &ipH, const TcpHeader& tcpH, Ptr<const Packet> p);
259 
263  void ConfigureEnvironment ();
264 
268  void FinalChecks ();
269 
274  virtual void RateUpdatedTrace (const TcpRateLinux::TcpRateConnection &rate);
275 
280  virtual void RateSampleUpdatedTrace (const TcpRateLinux::TcpRateSample &sample);
281 
282 private:
285  std::vector<uint32_t> m_toDrop;
286  uint32_t m_bytesInFlight {0};
288  bool m_isDupAck;
289  TcpRateLinux::TcpRateConnection m_prevRate;
290  TcpRateLinux::TcpRateSample m_prevRateSample;
291 };
292 
293 TcpRateLinuxWithSocketsTest::TcpRateLinuxWithSocketsTest (const std::string &desc, bool sackEnabled,
294  std::vector<uint32_t> &toDrop)
295  : TcpGeneralTest (desc),
296  m_sackEnabled (sackEnabled),
297  m_toDrop (toDrop)
298 {
299 }
300 
303 {
304  Ptr<TcpSocketMsgBase> s = TcpGeneralTest::CreateSenderSocket (node);
305  m_congCtl = CreateObject<MimicCongControl> ();
306  s->SetCongestionControlAlgorithm (m_congCtl);
307  return s;
308 }
309 
310 void
312 {
313  TcpGeneralTest::ConfigureEnvironment ();
314  SetAppPktCount (300);
316  SetTransmitStart (Seconds (2.0));
317 
318  Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (m_sackEnabled));
319 }
320 
323 {
324  Ptr<TcpSeqErrorModel> m_errorModel = CreateObject<TcpSeqErrorModel> ();
325  for (std::vector<uint32_t>::iterator it = m_toDrop.begin (); it != m_toDrop.end (); ++it)
326  {
327  m_errorModel->AddSeqToKill (SequenceNumber32 (*it));
328  }
329 
331 
332  return m_errorModel;
333 }
334 
335 void
338 {
339  NS_LOG_DEBUG ("Drop seq= " << tcpH.GetSequenceNumber () << " size " << p->GetSize ());
340 }
341 
342 void
344 {
345  if (who == SENDER)
346  {
347  if (h.GetAckNumber () == m_lastAckRecv
349  && (h.GetFlags () & TcpHeader::FIN) == 0)
350  {
351  m_isDupAck = true;
352  }
353  else
354  {
355  m_isDupAck = false;
357  }
358  }
359 }
360 
361 void
362 TcpRateLinuxWithSocketsTest::BytesInFlightTrace ([[maybe_unused]] uint32_t oldValue, uint32_t newValue)
363 {
364  m_bytesInFlight = newValue;
365 }
366 
367 void
368 TcpRateLinuxWithSocketsTest::RateUpdatedTrace (const TcpRateLinux::TcpRateConnection &rate)
369 {
370  NS_LOG_DEBUG ("Rate updated " << rate);
371  if (m_bytesInFlight == 0)
372  {
373  NS_TEST_ASSERT_MSG_EQ (rate.m_firstSentTime, Simulator::Now (), "FirstSentTime should be current time when bytes inflight is zero");
374  NS_TEST_ASSERT_MSG_EQ (rate.m_deliveredTime, Simulator::Now (), "Delivered time should be current time when bytes inflight is zero");
375  }
376  NS_TEST_ASSERT_MSG_GT_OR_EQ (rate.m_delivered, m_prevRate.m_delivered, "Total delivered should not be lesser than previous values");
377  m_prevRate = rate;
378 }
379 
380 void
381 TcpRateLinuxWithSocketsTest::RateSampleUpdatedTrace (const TcpRateLinux::TcpRateSample &sample)
382 {
383  NS_LOG_DEBUG ("Rate sample updated " << sample);
384  if (m_isDupAck)
385  {
386  if (!m_sackEnabled)
387  {
388  NS_TEST_ASSERT_MSG_EQ (m_prevRateSample, sample, "RateSample should not update due to DupAcks");
389  }
390  else
391  {
392  if (sample.m_ackedSacked == 0)
393  {
394  NS_TEST_ASSERT_MSG_EQ (m_prevRateSample, sample, "RateSample should not update as nothing is acked or sacked");
395  }
396  }
397  }
398  m_prevRateSample = sample;
399 }
400 
401 void
403 {
404 }
405 
414 {
415 public:
421  TcpRateLinuxWithBufferTest (uint32_t segmentSize, std::string desc);
422 
423 private:
424  virtual void DoRun (void);
425  virtual void DoTeardown (void);
426 
431  virtual void RateUpdatedTrace (const TcpRateLinux::TcpRateConnection &rate);
432 
437  virtual void RateSampleUpdatedTrace (const TcpRateLinux::TcpRateSample &sample);
438 
441 
443  void TestWithSackBlocks ();
444 
445  uint32_t m_expectedDelivered {0};
446  uint32_t m_expectedAckedSacked {0};
447  uint32_t m_segmentSize;
450 };
451 
453  std::string testString)
454  : TestCase (testString),
455  m_segmentSize (segmentSize)
456 {
457  m_rateOps = CreateObject <TcpRateLinux> ();
458  m_rateOps->TraceConnectWithoutContext ("TcpRateUpdated",
460  m_rateOps->TraceConnectWithoutContext ("TcpRateSampleUpdated",
462 }
463 
464 void
466 {
467  Simulator::Schedule (Seconds (0.0), &TcpRateLinuxWithBufferTest::TestWithSackBlocks, this);
468  Simulator::Run ();
469  Simulator::Destroy ();
470 }
471 
472 void
473 TcpRateLinuxWithBufferTest::RateUpdatedTrace (const TcpRateLinux::TcpRateConnection &rate)
474 {
475  NS_LOG_DEBUG ("Rate updated " << rate);
476  NS_TEST_ASSERT_MSG_EQ (rate.m_delivered, m_expectedDelivered, "Delivered data is not equal to expected delivered");
477 }
478 
479 void
480 TcpRateLinuxWithBufferTest::RateSampleUpdatedTrace (const TcpRateLinux::TcpRateSample &sample)
481 {
482  NS_LOG_DEBUG ("Rate sample updated " << sample);
483  NS_TEST_ASSERT_MSG_EQ (sample.m_ackedSacked, m_expectedAckedSacked, "AckedSacked bytes is not equal to expected AckedSacked bytes");
484 }
485 
486 void
488 {
489  SequenceNumber32 head (1);
490  m_txBuf.SetHeadSequence (head);
491  SequenceNumber32 ret;
492  Ptr<TcpOptionSack> sack = CreateObject<TcpOptionSack> ();
495 
496  m_txBuf.Add (Create<Packet> (10 * m_segmentSize));
497 
498  // Send 10 Segments
499  for (uint8_t i = 0; i < 10; ++i)
500  {
501  bool isStartOfTransmission = m_txBuf.BytesInFlight () == 0;
503  m_rateOps->SkbSent (outItem, isStartOfTransmission);
504  }
505 
506  uint32_t priorInFlight = m_txBuf.BytesInFlight ();
507  // ACK 2 Segments
508  for (uint8_t i = 1; i <= 2; ++i)
509  {
510  priorInFlight = m_txBuf.BytesInFlight ();
512  m_txBuf.DiscardUpTo (SequenceNumber32 (m_segmentSize * i + 1), MakeCallback (&TcpRateOps::SkbDelivered, m_rateOps));
514  m_rateOps->GenerateSample (m_segmentSize, 0, false, priorInFlight, Seconds (0));
515  }
516 
517  priorInFlight = m_txBuf.BytesInFlight ();
518  sack->AddSackBlock (TcpOptionSack::SackBlock (SequenceNumber32 (m_segmentSize * 4 + 1), SequenceNumber32 (m_segmentSize * 5 + 1)));
520  m_txBuf.Update (sack->GetSackList (), MakeCallback (&TcpRateOps::SkbDelivered, m_rateOps));
522  m_rateOps->GenerateSample (m_segmentSize, 0, false, priorInFlight, Seconds (0));
523 
524  priorInFlight = m_txBuf.BytesInFlight ();
525  sack->AddSackBlock (TcpOptionSack::SackBlock (SequenceNumber32 (m_segmentSize * 3 + 1), SequenceNumber32 (m_segmentSize * 4 + 1)));
527  m_txBuf.Update (sack->GetSackList (), MakeCallback (&TcpRateOps::SkbDelivered, m_rateOps));
528  m_rateOps->GenerateSample (m_segmentSize, 0, false, priorInFlight, Seconds (0));
529 
530  priorInFlight = m_txBuf.BytesInFlight ();
531  // Actual delivered should be increased by one segment even multiple blocks are acked.
533  m_txBuf.DiscardUpTo (SequenceNumber32 (m_segmentSize * 5 + 1), MakeCallback (&TcpRateOps::SkbDelivered, m_rateOps));
534  m_rateOps->GenerateSample (m_segmentSize, 0, false, priorInFlight, Seconds (0));
535 
536 
537  priorInFlight = m_txBuf.BytesInFlight ();
538  // ACK rest of the segments
539  for (uint8_t i = 6; i <= 10; ++i)
540  {
542  m_txBuf.DiscardUpTo (SequenceNumber32 (m_segmentSize * i + 1), MakeCallback (&TcpRateOps::SkbDelivered, m_rateOps));
543  }
545  TcpRateOps::TcpRateSample rateSample = m_rateOps->GenerateSample (5 * m_segmentSize, 0, false, priorInFlight, Seconds (0));
546 }
547 
548 void
550 {
551 }
552 
553 
561 {
562 public:
564  : TestSuite ("tcp-rate-ops", UNIT)
565  {
566  AddTestCase (new TcpRateLinuxBasicTest (1000, SequenceNumber32 (20), SequenceNumber32 (11), 1, "Testing SkbDelivered and SkbSent"), TestCase::QUICK);
567  AddTestCase (new TcpRateLinuxBasicTest (1000, SequenceNumber32 (11), SequenceNumber32 (11), 2, "Testing SkbDelivered and SkbSent with app limited data"), TestCase::QUICK);
568 
569  std::vector<uint32_t> toDrop;
570  toDrop.push_back (4001);
571  AddTestCase (new TcpRateLinuxWithSocketsTest ("Checking Rate sample value without SACK, one drop", false, toDrop),
572  TestCase::QUICK);
573 
574  AddTestCase (new TcpRateLinuxWithSocketsTest ("Checking Rate sample value with SACK, one drop", true, toDrop),
575  TestCase::QUICK);
576  toDrop.push_back (4001);
577  AddTestCase (new TcpRateLinuxWithSocketsTest ("Checking Rate sample value without SACK, two drop", false, toDrop),
578  TestCase::QUICK);
579 
580  AddTestCase (new TcpRateLinuxWithSocketsTest ("Checking Rate sample value with SACK, two drop", true, toDrop),
581  TestCase::QUICK);
582 
583  AddTestCase (new TcpRateLinuxWithBufferTest (1000, "Checking rate sample values with arbitary SACK Block"), TestCase::QUICK);
584 
585  AddTestCase (new TcpRateLinuxWithBufferTest (500, "Checking rate sample values with arbitary SACK Block"), TestCase::QUICK);
586 
587  }
588 };
589 
#define Max(a, b)
Behaves as NewReno except HasCongControl returns true.
static TypeId GetTypeId(void)
Get the type ID.
virtual bool HasCongControl() const
Returns true when Congestion Control Algorithm implements CongControl.
The TcpRateLinux Basic Test.
void SkbDelivered(TcpTxItem *skb)
Deliver an application packet.
uint32_t m_delivered
Number of segments delivered.
void SendSkb(TcpTxItem *skb)
Send an application packet.
uint32_t m_segmentSize
Segment size.
TcpRateLinux m_rateOps
Rate information for TCP.
std::vector< TcpTxItem * > m_skbs
Application packets.
Time m_deliveredTime
Last time of a delivery.
uint32_t m_testCase
Test case type.
uint32_t m_inFlight
Number of packets in-flight.
uint32_t m_cWnd
Congestion window size.
virtual void DoRun(void)
Implementation to actually run this TestCase.
TcpRateLinuxBasicTest(uint32_t cWnd, SequenceNumber32 tailSeq, SequenceNumber32 nextTx, uint32_t testCase, std::string testName)
Constructor.
SequenceNumber32 m_tailSeq
Tail sequence number.
SequenceNumber32 m_nextTx
Tx next sequence number.
The TcpRateLinuxWithBufferTest tests rate sample functionality with arbitary SACK scenario.
uint32_t m_expectedAckedSacked
Amount of expected acked sacked data.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void TestWithStraightAcks()
Test with acks without drop.
TcpTxBuffer m_txBuf
Tcp Tx buffer.
virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
TcpRateLinuxWithBufferTest(uint32_t segmentSize, std::string desc)
Constructor.
virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
void TestWithSackBlocks()
Test with arbitary SACK scenario.
Ptr< TcpRateOps > m_rateOps
Rate operations.
uint32_t m_expectedDelivered
Amount of expected delivered data.
uint32_t m_segmentSize
Segment size.
The TcpRateLinux Test uses sender-receiver model to test its functionality.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet is dropped.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Track the bytes in flight.
TcpRateLinuxWithSocketsTest(const std::string &desc, bool sackEnabled, std::vector< uint32_t > &toDrop)
Constructor.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create a receiver error model.
bool m_isDupAck
Whether ACK is DupAck.
SequenceNumber32 m_lastAckRecv
Last ACK received.
virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
TcpRateLinux::TcpRateSample m_prevRateSample
Previous rate sample.
std::vector< uint32_t > m_toDrop
List of SequenceNumber to drop.
void FinalChecks()
Do the final checks.
uint32_t m_bytesInFlight
Bytes inflight.
bool m_sackEnabled
Sack Variable.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Receive a packet.
TcpRateLinux::TcpRateConnection m_prevRate
Previous rate.
Ptr< MimicCongControl > m_congCtl
Dummy congestion control.
void ConfigureEnvironment()
Configure the test.
the TestSuite for the TcpRateLinux test case
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Packet header for IPv4.
Definition: ipv4-header.h:34
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:364
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:856
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
General infrastructure for TCP testing.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:45
SequenceNumber32 GetSequenceNumber() const
Get the sequence number.
Definition: tcp-header.cc:143
uint8_t GetFlags() const
Get the flags.
Definition: tcp-header.cc:173
SequenceNumber32 GetAckNumber() const
Get the ACK number.
Definition: tcp-header.cc:149
The NewReno implementation.
std::pair< SequenceNumber32, SequenceNumber32 > SackBlock
SACK block definition.
Linux management and generation of Rate information for TCP.
Definition: tcp-rate-ops.h:181
virtual void SkbDelivered(TcpTxItem *skb) override
Update the Rate information after an item is received.
virtual void SkbSent(TcpTxItem *skb, bool isStartOfTransmission) override
Put the rate information inside the sent skb.
virtual void CalculateAppLimited(uint32_t cWnd, uint32_t in_flight, uint32_t segmentSize, const SequenceNumber32 &tailSeq, const SequenceNumber32 &nextTx, const uint32_t lostOut, const uint32_t retransOut) override
If a gap is detected between sends, it means we are app-limited.
virtual void SkbSent(TcpTxItem *skb, bool isStartOfTransmission)=0
Put the rate information inside the sent skb.
virtual const TcpRateSample & GenerateSample(uint32_t delivered, uint32_t lost, bool is_sack_reneg, uint32_t priorInFlight, const Time &minRtt)=0
Generate a TcpRateSample to feed a congestion avoidance algorithm.
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
Tcp sender buffer.
bool Add(Ptr< Packet > p)
Append a data packet to the end of the buffer.
void SetSegmentSize(uint32_t segmentSize)
Set the segment size.
void SetDupAckThresh(uint32_t dupAckThresh)
Set the DupAckThresh.
TcpTxItem * CopyFromSequence(uint32_t numBytes, const SequenceNumber32 &seq)
Copy data from the range [seq, seq+numBytes) into a packet.
uint32_t Update(const TcpOptionSack::SackList &list, const Callback< void, TcpTxItem * > &sackedCb=m_nullCb)
Update the scoreboard.
uint32_t BytesInFlight() const
Return total bytes in flight.
void DiscardUpTo(const SequenceNumber32 &seq, const Callback< void, TcpTxItem * > &beforeDelCb=m_nullCb)
Discard data up to but not including this sequence number.
void SetHeadSequence(const SequenceNumber32 &seq)
Set the head sequence of the buffer.
Item that encloses the application packet and some flags for it.
Definition: tcp-tx-item.h:33
RateInformation & GetRateInformation(void)
Get (to modify) the Rate Information of this item.
Definition: tcp-tx-item.cc:98
uint32_t GetSeqSize(void) const
Get the size in the sequence number space.
Definition: tcp-tx-item.cc:62
encapsulates test code
Definition: test.h:994
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
A suite of tests to run.
Definition: test.h:1188
@ UNIT
This test suite implements a Unit Test.
Definition: test.h:1197
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
uint32_t segmentSize
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
#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:141
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not.
Definition: test.h:862
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:1648
Rate Sample structure.
Definition: tcp-rate-ops.h:134
bool m_isAppLimited
Connection's app limited at the time the packet was sent.
Definition: tcp-tx-item.h:92
uint64_t m_delivered
Connection's delivered data at the time the packet was sent.
Definition: tcp-tx-item.h:89
Time m_deliveredTime
Connection's delivered time at the time the packet was sent.
Definition: tcp-tx-item.h:90
static TcpRateOpsTestSuite g_TcpRateOpsTestSuite
Static variable for test initialization.