21 #include "ns3/simple-channel.h"
23 #include "ns3/config.h"
24 #include "ns3/tcp-header.h"
26 #include "ns3/tcp-linux-reno.h"
63 uint32_t initialCwnd, uint32_t delayedAck,
64 uint32_t expectedCwnd,
65 TypeId& congControl,
const std::string &desc);
68 virtual void CWndTrace (uint32_t oldValue, uint32_t newValue);
72 virtual void ConfigureEnvironment ();
73 virtual void ConfigureProperties ();
74 virtual void DoTeardown ();
95 uint32_t expectedCwnd,
97 const std::string &desc)
103 m_initialCwnd (initialCwnd),
104 m_delayedAck (delayedAck),
106 m_expectedCwnd (expectedCwnd)
114 TcpGeneralTest::ConfigureEnvironment ();
123 TcpGeneralTest::ConfigureProperties ();
146 uint32_t segSize =
GetSegSize (TcpGeneralTest::SENDER);
147 uint32_t increase = newValue - oldValue;
167 "achieving a value of " << newValue);
187 TcpGeneralTest::DoTeardown ();
222 uint32_t packets, uint32_t initialCwnd,
223 uint32_t initialSSThresh, uint32_t delayedAck,
224 uint32_t expectedCwnd,
225 TypeId& congControl,
const std::string &desc);
228 virtual void CWndTrace (uint32_t oldValue, uint32_t newValue);
232 virtual void ConfigureEnvironment ();
233 virtual void ConfigureProperties ();
234 virtual void DoTeardown ();
257 uint32_t initialCwnd,
258 uint32_t initialSSThresh,
260 uint32_t expectedCwnd,
262 const std::string &desc)
267 m_initialCwnd (initialCwnd),
268 m_initialSSThresh (initialSSThresh),
269 m_delayedAck (delayedAck),
271 m_expectedCwnd (expectedCwnd),
274 m_inCongAvoidance (false),
275 m_inSlowStartPhase (true)
283 TcpGeneralTest::ConfigureEnvironment ();
291 TcpGeneralTest::ConfigureProperties ();
331 NS_FATAL_ERROR (
"Drop on the queue; cannot validate congestion avoidance");
337 NS_FATAL_ERROR (
"Drop on the phy: cannot validate congestion avoidance");
356 TcpGeneralTest::DoTeardown ();
370 TypeId cong_control_type = TcpLinuxReno::GetTypeId ();
401 "Slow Start MSS = 524, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
413 "Slow Start MSS = 524, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
427 "Slow Start MSS = 1500, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
438 "Slow Start MSS = 1500, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
477 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
505 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
522 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 1 " + cong_control_type.
GetName ()),
533 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 2 " + cong_control_type.
GetName ()),
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.
virtual void PhyDrop(SocketWho who)
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
uint32_t m_packets
Number of packets to send to the socket.
uint32_t m_expectedCwnd
Expected final cWnd value.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
uint32_t m_lastCwnd
Last cWnd value reported.
virtual void DoTeardown()
Teardown the TCP test.
uint32_t m_increment
Congestion window increment.
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.
virtual void QueueDrop(SocketWho who)
virtual void ConfigureProperties()
Change the configuration of the socket properties.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
uint32_t m_initialCwnd
Initial congestion window (segments)
This unit test checks that the slow start and congestion avoidance behavior matches Linux behavior as...
bool m_initial
First cycle flag.
uint32_t m_lastCwnd
Last cWnd value reported.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
uint32_t m_initialCwnd
Initial congestion window.
uint32_t m_delayedAck
Delayed Acknowledgement.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
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.
uint32_t m_expectedCwnd
Expected final cWnd value.
uint32_t m_packets
Packet counter.
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
virtual void ConfigureProperties()
Change the configuration of the socket properties.
void QueueDrop(SocketWho who)
void PhyDrop(SocketWho who)
uint32_t m_segmentSize
Segment size.
virtual void DoTeardown()
Teardown the TCP test.
TestSuite for the behavior of Linux Reno.
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.
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.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
a unique identifier for an interface.
std::string GetName(void) 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