A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-rate-ops-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 NITK Surathkal
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Vivek Jain <jain.vivek.anand@gmail.com>
18 * Viyom Mittal <viyommittal@gmail.com>
19 * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
20 */
21
22#include "tcp-error-model.h"
23#include "tcp-general-test.h"
24
25#include "ns3/config.h"
26#include "ns3/log.h"
27#include "ns3/tcp-rate-ops.h"
28#include "ns3/tcp-tx-buffer.h"
29#include "ns3/tcp-tx-item.h"
30#include "ns3/test.h"
31
32using namespace ns3;
33
34NS_LOG_COMPONENT_DEFINE("TcpRateOpsTestSuite");
35
37
38/**
39 * \ingroup internet-test
40 * \ingroup tests
41 *
42 * \brief The TcpRateLinux Basic Test
43 */
45{
46 public:
47 /**
48 * Constructor
49 * \param cWnd Congestion window size
50 * \param tailSeq Tail sequence number
51 * \param nextTx Tx next sequence number
52 * \param testCase test case type
53 * \param testName test name
54 */
56 SequenceNumber32 tailSeq,
57 SequenceNumber32 nextTx,
58 uint32_t testCase,
59 std::string testName);
60
61 private:
62 void DoRun() override;
63
64 /**
65 * Send an application packet
66 * \param skb the data to send
67 */
68 void SendSkb(TcpTxItem* skb);
69 /**
70 * Deliver an application packet
71 * \param skb the data to deliver
72 */
73 void SkbDelivered(TcpTxItem* skb);
74
75 TcpRateLinux m_rateOps; //!< Rate information for TCP
76 uint32_t m_cWnd; //!< Congestion window size
77 uint32_t m_inFlight; //!< Number of packets in-flight
78 uint32_t m_segmentSize; //!< Segment size
79 uint32_t m_delivered; //!< Number of segments delivered
80 Time m_deliveredTime; //!< Last time of a delivery
81 SequenceNumber32 m_tailSeq; //!< Tail sequence number
82 SequenceNumber32 m_nextTx; //!< Tx next sequence number
83 uint32_t m_testCase; //!< Test case type
84 std::vector<TcpTxItem*> m_skbs; //!< Application packets
85};
86
88 SequenceNumber32 tailSeq,
89 SequenceNumber32 nextTx,
90 uint32_t testCase,
91 std::string testName)
92 : TestCase(testName),
93 m_cWnd(cWnd),
94 m_inFlight(0),
95 m_segmentSize(1),
96 m_delivered(0),
97 m_deliveredTime(Seconds(0)),
98 m_tailSeq(tailSeq),
99 m_nextTx(nextTx),
100 m_testCase(testCase)
101{
102}
103
104void
106{
107 for (uint8_t i = 0; i < 100; ++i)
108 {
109 m_skbs.push_back(new TcpTxItem());
112 this,
113 m_skbs[i]);
114 }
115
116 for (uint8_t i = 0; i < 100; ++i)
117 {
118 Simulator::Schedule(Time(Seconds((i + 1) * 0.1)),
120 this,
121 m_skbs[i]);
122 }
123
126
127 for (uint8_t i = 0; i < 100; ++i)
128 {
129 delete m_skbs[i];
130 }
131}
132
133void
135{
136 bool isStartOfTransmission = m_inFlight == 0;
138 m_rateOps.SkbSent(skb, isStartOfTransmission);
139 m_inFlight += skb->GetSeqSize();
140
143 "SKB should have delivered equal to current value of total delivered");
144
145 if (isStartOfTransmission)
146 {
149 "SKB should have updated the delivered time to current value");
150 }
151 else
152 {
155 "SKB should have updated the delivered time to current value");
156 }
157}
158
159void
161{
163 m_inFlight -= skb->GetSeqSize();
164 m_delivered += skb->GetSeqSize();
166
168 Time::Max(),
169 "SKB should have delivered time as Time::Max ()");
170
171 if (m_testCase == 1)
172 {
174 false,
175 "Socket should not be applimited");
176 }
177 else if (m_testCase == 2)
178 {
180 true,
181 "Socket should be applimited");
182 }
183}
184
185/**
186 * \ingroup internet-test
187 *
188 * \brief Behaves as NewReno except HasCongControl returns true
189 */
191{
192 public:
193 /**
194 * \brief Get the type ID.
195 * \return the object TypeId
196 */
197 static TypeId GetTypeId();
198
200 {
201 }
202
203 bool HasCongControl() const override
204 {
205 return true;
206 }
207};
208
209TypeId
211{
212 static TypeId tid = TypeId("ns3::MimicCongControl")
214 .AddConstructor<MimicCongControl>()
215 .SetGroupName("Internet");
216 return tid;
217}
218
219/**
220 * \ingroup internet-test
221 * \ingroup tests
222 *
223 * \brief The TcpRateLinux Test uses sender-receiver model to test its functionality.
224 * This test case uses the bytes inflight trace to check whether rate sample
225 * correctly sets the value of m_deliveredTime and m_firstSentTime. This is
226 * done using rate trace. Further, Using Rx trace, m_isDupAck is maintained to
227 * track duplicate acknowledgments. This, in turn, is used to see whether rate
228 * sample is updated properly (in case of SACK) or not (in case of non SACK).
229 */
231{
232 public:
233 /**
234 * \brief Constructor.
235 * \param desc Description.
236 * \param sackEnabled To use SACK or not
237 * \param toDrop Packets to drop.
238 */
239 TcpRateLinuxWithSocketsTest(const std::string& desc,
240 bool sackEnabled,
241 std::vector<uint32_t>& toDrop);
242
243 protected:
244 /**
245 * \brief Create and install the socket to install on the sender
246 * \param node sender node pointer
247 * \return the socket to be installed in the sender
248 */
250
251 /**
252 * \brief Create a receiver error model.
253 * \returns The receiver error model.
254 */
256
257 /**
258 * \brief Receive a packet.
259 * \param p The packet.
260 * \param h The TCP header.
261 * \param who Who the socket belongs to (sender or receiver).
262 */
263 void Rx(const Ptr<const Packet> p, const TcpHeader& h, SocketWho who) override;
264
265 /**
266 * \brief Track the bytes in flight.
267 * \param oldValue previous value.
268 * \param newValue actual value.
269 */
270 void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue) override;
271
272 /**
273 * \brief Called when a packet is dropped.
274 * \param ipH The IP header.
275 * \param tcpH The TCP header.
276 * \param p The packet.
277 */
278 void PktDropped(const Ipv4Header& ipH, const TcpHeader& tcpH, Ptr<const Packet> p);
279
280 /**
281 * \brief Configure the test.
282 */
283 void ConfigureEnvironment() override;
284
285 /**
286 * \brief Do the final checks.
287 */
288 void FinalChecks() override;
289
290 /**
291 * \brief Track the rate value of TcpRateLinux.
292 * \param rate updated value of TcpRate.
293 */
294 void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection& rate) override;
295
296 /**
297 * \brief Track the rate sample value of TcpRateLinux.
298 * \param sample updated value of TcpRateSample.
299 */
300 void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample& sample) override;
301
302 private:
303 Ptr<MimicCongControl> m_congCtl; //!< Dummy congestion control.
304 bool m_sackEnabled; //!< Sack Variable
305 std::vector<uint32_t> m_toDrop; //!< List of SequenceNumber to drop
306 uint32_t m_bytesInFlight{0}; //!< Bytes inflight
308 bool m_isDupAck; //!< Whether ACK is DupAck
311};
312
314 bool sackEnabled,
315 std::vector<uint32_t>& toDrop)
316 : TcpGeneralTest(desc),
317 m_sackEnabled(sackEnabled),
318 m_toDrop(toDrop)
319{
320}
321
324{
326 m_congCtl = CreateObject<MimicCongControl>();
327 s->SetCongestionControlAlgorithm(m_congCtl);
328 return s;
329}
330
331void
333{
335 SetAppPktCount(300);
338
339 Config::SetDefault("ns3::TcpSocketBase::Sack", BooleanValue(m_sackEnabled));
340}
341
344{
345 Ptr<TcpSeqErrorModel> m_errorModel = CreateObject<TcpSeqErrorModel>();
346 for (auto it = m_toDrop.begin(); it != m_toDrop.end(); ++it)
347 {
348 m_errorModel->AddSeqToKill(SequenceNumber32(*it));
349 }
350
351 m_errorModel->SetDropCallback(MakeCallback(&TcpRateLinuxWithSocketsTest::PktDropped, this));
352
353 return m_errorModel;
354}
355
356void
358 const TcpHeader& tcpH,
360{
361 NS_LOG_DEBUG("Drop seq= " << tcpH.GetSequenceNumber() << " size " << p->GetSize());
362}
363
364void
366{
367 if (who == SENDER)
368 {
370 (h.GetFlags() & TcpHeader::FIN) == 0)
371 {
372 m_isDupAck = true;
373 }
374 else
375 {
376 m_isDupAck = false;
378 }
379 }
380}
381
382void
384{
385 m_bytesInFlight = newValue;
386}
387
388void
390{
391 NS_LOG_DEBUG("Rate updated " << rate);
392 if (m_bytesInFlight == 0)
393 {
396 "FirstSentTime should be current time when bytes inflight is zero");
399 "Delivered time should be current time when bytes inflight is zero");
400 }
402 m_prevRate.m_delivered,
403 "Total delivered should not be lesser than previous values");
404 m_prevRate = rate;
405}
406
407void
409{
410 NS_LOG_DEBUG("Rate sample updated " << sample);
411 if (m_isDupAck)
412 {
413 if (!m_sackEnabled)
414 {
416 sample,
417 "RateSample should not update due to DupAcks");
418 }
419 else
420 {
421 if (sample.m_ackedSacked == 0)
422 {
424 sample,
425 "RateSample should not update as nothing is acked or sacked");
426 }
427 }
428 }
429 m_prevRateSample = sample;
430}
431
432void
434{
435}
436
437/**
438 * \ingroup internet-test
439 * \ingroup tests
440 *
441 * \brief The TcpRateLinuxWithBufferTest tests rate sample functionality with arbitrary SACK
442 * scenario. Check the value of delivered against a home-made guess
443 */
445{
446 public:
447 /**
448 * \brief Constructor.
449 * \param segmentSize Segment size to use.
450 * \param desc Description.
451 */
453
454 private:
455 void DoRun() override;
456 void DoTeardown() override;
457
458 /**
459 * \brief Track the rate value of TcpRateLinux.
460 * \param rate updated value of TcpRate.
461 */
462 virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection& rate);
463
464 /**
465 * \brief Track the rate sample value of TcpRateLinux.
466 * \param sample updated value of TcpRateSample.
467 */
468 virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample& sample);
469
470 /** \brief Test with acks without drop */
472
473 /** \brief Test with arbitrary SACK scenario */
474 void TestWithSackBlocks();
475
476 uint32_t m_expectedDelivered{0}; //!< Amount of expected delivered data
477 uint32_t m_expectedAckedSacked{0}; //!< Amount of expected acked sacked data
478 uint32_t m_segmentSize; //!< Segment size
479 TcpTxBuffer m_txBuf; //!< Tcp Tx buffer
480 Ptr<TcpRateOps> m_rateOps; //!< Rate operations
481};
482
484 : TestCase(testString),
485 m_segmentSize(segmentSize)
486{
487 m_rateOps = CreateObject<TcpRateLinux>();
489 "TcpRateUpdated",
492 "TcpRateSampleUpdated",
494}
495
496void
498{
502}
503
504void
506{
507 NS_LOG_DEBUG("Rate updated " << rate);
510 "Delivered data is not equal to expected delivered");
511}
512
513void
515{
516 NS_LOG_DEBUG("Rate sample updated " << sample);
519 "AckedSacked bytes is not equal to expected AckedSacked bytes");
520}
521
522void
524{
525 SequenceNumber32 head(1);
528 Ptr<TcpOptionSack> sack = CreateObject<TcpOptionSack>();
531
532 m_txBuf.Add(Create<Packet>(10 * m_segmentSize));
533
534 // Send 10 Segments
535 for (uint8_t i = 0; i < 10; ++i)
536 {
537 bool isStartOfTransmission = m_txBuf.BytesInFlight() == 0;
538 TcpTxItem* outItem =
540 m_rateOps->SkbSent(outItem, isStartOfTransmission);
541 }
542
543 uint32_t priorInFlight = m_txBuf.BytesInFlight();
544 // ACK 2 Segments
545 for (uint8_t i = 1; i <= 2; ++i)
546 {
547 priorInFlight = m_txBuf.BytesInFlight();
552 m_rateOps->GenerateSample(m_segmentSize, 0, false, priorInFlight, Seconds(0));
553 }
554
555 priorInFlight = m_txBuf.BytesInFlight();
556 sack->AddSackBlock(TcpOptionSack::SackBlock(SequenceNumber32(m_segmentSize * 4 + 1),
561 m_rateOps->GenerateSample(m_segmentSize, 0, false, priorInFlight, Seconds(0));
562
563 priorInFlight = m_txBuf.BytesInFlight();
564 sack->AddSackBlock(TcpOptionSack::SackBlock(SequenceNumber32(m_segmentSize * 3 + 1),
568 m_rateOps->GenerateSample(m_segmentSize, 0, false, priorInFlight, Seconds(0));
569
570 priorInFlight = m_txBuf.BytesInFlight();
571 // Actual delivered should be increased by one segment even multiple blocks are acked.
575 m_rateOps->GenerateSample(m_segmentSize, 0, false, priorInFlight, Seconds(0));
576
577 priorInFlight = m_txBuf.BytesInFlight();
578 // ACK rest of the segments
579 for (uint8_t i = 6; i <= 10; ++i)
580 {
584 }
586 TcpRateOps::TcpRateSample rateSample =
587 m_rateOps->GenerateSample(5 * m_segmentSize, 0, false, priorInFlight, Seconds(0));
588}
589
590void
592{
593}
594
595/**
596 * \ingroup internet-test
597 *
598 * \brief the TestSuite for the TcpRateLinux test case
599 */
601{
602 public:
604 : TestSuite("tcp-rate-ops", Type::UNIT)
605 {
609 1,
610 "Testing SkbDelivered and SkbSent"),
611 TestCase::Duration::QUICK);
613 new TcpRateLinuxBasicTest(1000,
616 2,
617 "Testing SkbDelivered and SkbSent with app limited data"),
618 TestCase::Duration::QUICK);
619
620 std::vector<uint32_t> toDrop;
621 toDrop.push_back(4001);
623 new TcpRateLinuxWithSocketsTest("Checking Rate sample value without SACK, one drop",
624 false,
625 toDrop),
626 TestCase::Duration::QUICK);
627
629 new TcpRateLinuxWithSocketsTest("Checking Rate sample value with SACK, one drop",
630 true,
631 toDrop),
632 TestCase::Duration::QUICK);
633 toDrop.push_back(4001);
635 new TcpRateLinuxWithSocketsTest("Checking Rate sample value without SACK, two drop",
636 false,
637 toDrop),
638 TestCase::Duration::QUICK);
639
641 new TcpRateLinuxWithSocketsTest("Checking Rate sample value with SACK, two drop",
642 true,
643 toDrop),
644 TestCase::Duration::QUICK);
645
648 "Checking rate sample values with arbitrary SACK Block"),
649 TestCase::Duration::QUICK);
650
653 "Checking rate sample values with arbitrary SACK Block"),
654 TestCase::Duration::QUICK);
655 }
656};
657
658static TcpRateOpsTestSuite g_TcpRateOpsTestSuite; //!< Static variable for test initialization
Behaves as NewReno except HasCongControl returns true.
static TypeId GetTypeId()
Get the type ID.
bool HasCongControl() const override
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.
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.
TcpRateLinuxBasicTest(uint32_t cWnd, SequenceNumber32 tailSeq, SequenceNumber32 nextTx, uint32_t testCase, std::string testName)
Constructor.
SequenceNumber32 m_tailSeq
Tail sequence number.
void DoRun() override
Implementation to actually run this TestCase.
std::vector< TcpTxItem * > m_skbs
Application packets.
SequenceNumber32 m_nextTx
Tx next sequence number.
The TcpRateLinuxWithBufferTest tests rate sample functionality with arbitrary SACK scenario.
uint32_t m_expectedAckedSacked
Amount of expected acked sacked data.
void DoRun() override
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.
void TestWithSackBlocks()
Test with arbitrary SACK scenario.
Ptr< TcpRateOps > m_rateOps
Rate operations.
uint32_t m_expectedDelivered
Amount of expected delivered data.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
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.
TcpRateLinuxWithSocketsTest(const std::string &desc, bool sackEnabled, std::vector< uint32_t > &toDrop)
Constructor.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Receive a packet.
Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node) override
Create and install the socket to install on the sender.
bool m_isDupAck
Whether ACK is DupAck.
void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue) override
Track the bytes in flight.
void ConfigureEnvironment() override
Configure the test.
void FinalChecks() override
Do the final checks.
void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample) override
Track the rate sample value of TcpRateLinux.
SequenceNumber32 m_lastAckRecv
Last ACK received.
TcpRateLinux::TcpRateSample m_prevRateSample
Previous rate sample.
std::vector< uint32_t > m_toDrop
List of SequenceNumber to drop.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create a receiver error model.
uint32_t m_bytesInFlight
Bytes inflight.
bool m_sackEnabled
Sack Variable.
void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate) override
Track the rate value of TcpRateLinux.
TcpRateLinux::TcpRateConnection m_prevRate
Previous rate.
Ptr< MimicCongControl > m_congCtl
Dummy congestion control.
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:322
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:571
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:142
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
static void Run()
Run the simulation.
Definition: simulator.cc:178
General infrastructure for TCP testing.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
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.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
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:47
SequenceNumber32 GetSequenceNumber() const
Get the sequence number.
Definition: tcp-header.cc:118
uint8_t GetFlags() const
Get the flags.
Definition: tcp-header.cc:148
SequenceNumber32 GetAckNumber() const
Get the ACK number.
Definition: tcp-header.cc:124
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:196
void SkbDelivered(TcpTxItem *skb) override
Update the Rate information after an item is received.
void SkbSent(TcpTxItem *skb, bool isStartOfTransmission) override
Put the rate information inside the sent skb.
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 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.
virtual void SkbSent(TcpTxItem *skb, bool isStartOfTransmission)=0
Put the rate information inside the sent skb.
virtual void SkbDelivered(TcpTxItem *skb)=0
Update the Rate information after an item is received.
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
uint32_t GetSeqSize() const
Get the size in the sequence number space.
Definition: tcp-tx-item.cc:61
RateInformation & GetRateInformation()
Get (to modify) the Rate Information of this item.
Definition: tcp-tx-item.cc:97
encapsulates test code
Definition: test.h:1061
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:301
A suite of tests to run.
Definition: test.h:1268
Type
Type of test.
Definition: test.h:1275
static constexpr auto UNIT
Definition: test.h:1286
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:297
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
uint32_t segmentSize
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:894
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#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:145
#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:916
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:704
Information about the connection rate.
Definition: tcp-rate-ops.h:174
Time m_deliveredTime
Simulator time when m_delivered was last updated.
Definition: tcp-rate-ops.h:176
uint64_t m_delivered
The total amount of data in bytes delivered so far.
Definition: tcp-rate-ops.h:175
Time m_firstSentTime
The send time of the packet that was most recently marked as delivered.
Definition: tcp-rate-ops.h:177
Rate Sample structure.
Definition: tcp-rate-ops.h:140
uint32_t m_ackedSacked
The amount of data acked and sacked in the last received ack.
Definition: tcp-rate-ops.h:155
bool m_isAppLimited
Connection's app limited at the time the packet was sent.
Definition: tcp-tx-item.h:94
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.