30 #include "ns3/tcp-congestion-ops.h" 31 #include "ns3/tcp-socket-base.h" 32 #include "ns3/tcp-htcp.h" 59 uint32_t segmentsAcked,
Time lastCongestion,
Time firstAck,
60 Time secondAck, uint32_t expectedCwnd,
const std::string &name);
63 virtual void DoRun (
void);
76 uint32_t segmentsAcked,
Time lastCongestion,
Time firstAck,
77 Time secondAck, uint32_t expectedCwnd,
const std::string &name)
80 m_segmentSize (segmentSize),
81 m_segmentsAcked (segmentsAcked),
82 m_lastCongestion (lastCongestion),
83 m_firstAck (firstAck),
84 m_secondAck (secondAck),
85 m_expectedCwnd (expectedCwnd)
99 m_state = CreateObject<TcpSocketState> ();
118 NS_LOG_DEBUG (
"Simulation ran for the scheduled events");
124 "CWnd has not updated correctly");
126 Simulator::Destroy ();
156 20383,
"TcpHtcp increment test on cWnd "), TestCase::QUICK);
160 40,
"TcpHtcp increment test on cWnd "), TestCase::QUICK);
164 76671,
"TcpHtcp increment test on cWnd "), TestCase::QUICK);
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t m_expectedCwnd
Expected cWnd.
Time m_firstAck
First ACK time.
Ptr< TcpSocketState > m_state
TCP socket state.
TcpHtcpIncrementTest(uint32_t cWnd, uint32_t segmentSize, uint32_t segmentsAcked, Time lastCongestion, Time firstAck, Time secondAck, uint32_t expectedCwnd, const std::string &name)
Constructor.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint32_t m_segmentSize
Segment size.
Time m_lastCongestion
Last congestion time.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Try to increase the cWnd following the NewReno specification.
Testing the congestion avoidance increment on TcpHtcp.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#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.
uint32_t m_cWnd
Congestion window.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoRun(void)
Since the calculation depends on the throughput and its associated timing, we schedule a few exact ev...
Time m_secondAck
Second ACK time.
static TcpHtcpTestSuite g_TcpHtcpTest
Static variable for test initialization.
TracedValue< uint32_t > m_cWnd
Congestion window.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
T Get(void) const
Get the underlying value.
uint32_t m_segmentsAcked
Segments already ACKed.
This test suite implements a Unit Test.