12#include "ns3/simple-channel.h"
13#include "ns3/tcp-header.h"
14#include "ns3/tcp-linux-reno.h"
56 const std::string& desc);
88 const std::string& desc)
94 m_initialCwnd(initialCwnd),
95 m_delayedAck(delayedAck),
97 m_expectedCwnd(expectedCwnd)
138 uint32_t increase = newValue - oldValue;
146 "The first update is for ACK of SYN and should initialize cwnd");
160 <<
"achieving a value of " << newValue);
180 "Congestion window did not evolve as expected");
221 const std::string& desc);
257 const std::string& desc)
262 m_initialCwnd(initialCwnd),
263 m_initialSSThresh(initialSSThresh),
264 m_delayedAck(delayedAck),
266 m_expectedCwnd(expectedCwnd),
269 m_inCongAvoidance(false),
270 m_inSlowStartPhase(true)
305 "The first update is for ACK of SYN and should initialize cwnd");
330 NS_FATAL_ERROR(
"Drop on the queue; cannot validate congestion avoidance");
336 NS_FATAL_ERROR(
"Drop on the phy: cannot validate congestion avoidance");
356 "Congestion window did not evolve as expected");
403 "Slow Start MSS = 524, socket send size = 524, delack = 1 " +
405 TestCase::Duration::QUICK);
417 "Slow Start MSS = 524, socket send size = 524, delack = 2 " +
419 TestCase::Duration::QUICK);
433 "Slow Start MSS = 1500, socket send size = 524, delack = 1 " +
435 TestCase::Duration::QUICK);
446 "Slow Start MSS = 1500, socket send size = 524, delack = 2 " +
448 TestCase::Duration::QUICK);
487 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 1 " +
489 TestCase::Duration::QUICK);
517 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 2 " +
519 TestCase::Duration::QUICK);
535 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 1 " +
537 TestCase::Duration::QUICK);
548 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 2 " +
550 TestCase::Duration::QUICK);
This unit test checks that the slow start and congestion avoidance behavior matches Linux behavior as...
bool m_inCongAvoidance
True if in congestion avoidance.
uint32_t m_initialSSThresh
Initial slow start threshold (bytes)
uint32_t m_segmentSize
Segment size.
bool m_inSlowStartPhase
True if in slow start.
uint32_t m_delayedAck
Delayed Acknowledgement.
uint32_t m_packetSize
Size of the packets used in socket writes.
bool m_initial
True on first run.
void DoTeardown() override
Teardown the TCP test.
void CWndTrace(uint32_t oldValue, uint32_t newValue) override
Tracks the congestion window changes.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
uint32_t m_packets
Number of packets to send to the socket.
uint32_t m_expectedCwnd
Expected final cWnd value.
void PhyDrop(SocketWho who) override
Link drop.
uint32_t m_lastCwnd
Last cWnd value reported.
uint32_t m_increment
Congestion window increment.
void ConfigureProperties() override
Change the configuration of the socket properties.
TcpLinuxRenoCongAvoidTest(uint32_t segmentSize, uint32_t packetSize, uint32_t packets, uint32_t initialCwnd, uint32_t initialSSThresh, uint32_t delayedAck, uint32_t expectedCwnd, TypeId &congControl, const std::string &desc)
Constructor.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_initialCwnd
Initial congestion window (segments)
void QueueDrop(SocketWho who) override
Drop on the queue.
This unit test checks that the slow start and congestion avoidance behavior matches Linux behavior as...
bool m_initial
First cycle flag.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
uint32_t m_lastCwnd
Last cWnd value reported.
void DoTeardown() override
Teardown the TCP test.
uint32_t m_initialCwnd
Initial congestion window.
uint32_t m_delayedAck
Delayed Acknowledgement.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
void ConfigureProperties() override
Change the configuration of the socket properties.
void ConfigureEnvironment() override
Change the configuration of the environment.
void CWndTrace(uint32_t oldValue, uint32_t newValue) override
Tracks the congestion window changes.
TcpLinuxRenoSSTest(uint32_t segmentSize, uint32_t packetSize, uint32_t packets, uint32_t initialCwnd, uint32_t delayedAck, uint32_t expectedCwnd, TypeId &congControl, const std::string &desc)
Constructor.
uint32_t m_packetSize
Packet size.
void QueueDrop(SocketWho who) override
Drop on the queue.
uint32_t m_expectedCwnd
Expected final cWnd value.
uint32_t m_packets
Packet counter.
uint32_t m_segmentSize
Segment size.
void PhyDrop(SocketWho who) override
Link drop.
TestSuite for the behavior of Linux Reno.
Smart pointer class similar to boost::intrusive_ptr.
General infrastructure for TCP testing.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
TypeId m_congControlTypeId
Congestion control.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
void DoTeardown() override
Teardown the TCP test.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
static TypeId GetTypeId()
Get the type ID.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
a unique identifier for an interface.
std::string GetName() const
Get the name.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.
#define NS_TEST_ASSERT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report and abort if not.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpLinuxRenoTestSuite g_tcpLinuxRenoTestSuite
Static variable for test initialization.
static const uint32_t packetSize
Packet size generated at the AP.