21 #include "ns3/simple-channel.h" 23 #include "ns3/config.h" 24 #include "ns3/tcp-header.h" 26 #include "ns3/tcp-linux-reno.h" 57 uint32_t initialCwnd, uint32_t delayedAck,
58 uint32_t expectedCwnd,
59 TypeId& congControl,
const std::string &desc);
62 virtual void CWndTrace (uint32_t oldValue, uint32_t newValue);
66 virtual void ConfigureEnvironment ();
67 virtual void ConfigureProperties ();
68 virtual void DoTeardown ();
89 uint32_t expectedCwnd,
91 const std::string &desc)
97 m_initialCwnd (initialCwnd),
98 m_delayedAck (delayedAck),
100 m_expectedCwnd (expectedCwnd)
108 TcpGeneralTest::ConfigureEnvironment ();
117 TcpGeneralTest::ConfigureProperties ();
140 uint32_t segSize =
GetSegSize (TcpGeneralTest::SENDER);
141 uint32_t increase = newValue - oldValue;
161 "achieving a value of " << newValue);
181 TcpGeneralTest::DoTeardown ();
201 uint32_t packets, uint32_t initialCwnd,
202 uint32_t initialSSThresh, uint32_t delayedAck,
203 uint32_t expectedCwnd,
204 TypeId& congControl,
const std::string &desc);
207 virtual void CWndTrace (uint32_t oldValue, uint32_t newValue);
211 virtual void ConfigureEnvironment ();
212 virtual void ConfigureProperties ();
213 virtual void DoTeardown ();
236 uint32_t initialCwnd,
237 uint32_t initialSSThresh,
239 uint32_t expectedCwnd,
241 const std::string &desc)
246 m_initialCwnd (initialCwnd),
247 m_initialSSThresh (initialSSThresh),
248 m_delayedAck (delayedAck),
250 m_expectedCwnd (expectedCwnd),
253 m_inCongAvoidance (false),
254 m_inSlowStartPhase (true)
262 TcpGeneralTest::ConfigureEnvironment ();
270 TcpGeneralTest::ConfigureProperties ();
310 NS_FATAL_ERROR (
"Drop on the queue; cannot validate congestion avoidance");
316 NS_FATAL_ERROR (
"Drop on the phy: cannot validate congestion avoidance");
335 TcpGeneralTest::DoTeardown ();
349 TypeId cong_control_type = TcpLinuxReno::GetTypeId ();
380 "Slow Start MSS = 524, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
392 "Slow Start MSS = 524, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
406 "Slow Start MSS = 1500, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
417 "Slow Start MSS = 1500, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
456 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 1 " + cong_control_type.
GetName ()),
484 "Congestion Avoidance MSS = 524, socket send size = 524, delack = 2 " + cong_control_type.
GetName ()),
501 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 1 " + cong_control_type.
GetName ()),
512 "Congestion Avoidance MSS = 1500, socket send size = 1500, delack = 2 " + cong_control_type.
GetName ()),
uint32_t m_packetSize
Packet size.
std::string GetName(void) const
Get the name.
uint32_t m_lastCwnd
Last cWnd value reported.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
Tracks the congestion window changes.
static const uint32_t packetSize
virtual void DoTeardown()
Teardown the TCP test.
virtual void QueueDrop(SocketWho who)
Drop on the queue.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
virtual void DoTeardown()
Teardown the TCP test.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
TestSuite for the behavior of Linux Reno.
uint32_t m_delayedAck
Delayed Acknowledgement.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
static TcpLinuxRenoTestSuite g_tcpLinuxRenoTestSuite
Static variable for test initialization.
uint32_t m_initialSSThresh
Initial slow start threshold (bytes)
virtual void PhyDrop(SocketWho who)
Link drop.
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.
uint32_t m_initialCwnd
Initial congestion window (segments)
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
bool m_inSlowStartPhase
True if in slow start.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
#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.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
uint32_t m_initialCwnd
Initial congestion window.
uint32_t m_segmentSize
Segment size.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
uint32_t m_expectedCwnd
Expected final cWnd value.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_packets
Number of packets to send to the socket.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
bool m_initial
True on first run.
uint32_t m_expectedCwnd
Expected final cWnd value.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
uint32_t m_lastCwnd
Last cWnd value reported.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
uint32_t m_delayedAck
Delayed Acknowledgement.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
bool m_inCongAvoidance
True if in congestion avoidance.
uint32_t m_increment
Congestion window increment.
General infrastructure for TCP testing.
uint32_t m_packets
Packet counter.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
bool m_initial
First cycle flag.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
#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...
This test suite implements a Unit Test.
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.
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
Tracks the congestion window changes.
a unique identifier for an interface.
uint32_t m_packetSize
Size of the packets used in socket writes.
void PhyDrop(SocketWho who)
Link drop.
void QueueDrop(SocketWho who)
Drop on the queue.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
TypeId m_congControlTypeId
Congestion control.