29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-veno.h"
47 uint32_t segmentsAcked,
49 const std::string &name);
52 virtual void DoRun (
void);
70 uint32_t segmentsAcked,
72 const std::string &name)
75 m_segmentSize (segmentSize),
76 m_ssThresh (ssThresh),
78 m_segmentsAcked (segmentsAcked),
87 m_state = CreateObject<TcpSocketState> ();
109 uint64_t expectedCwnd;
114 diff = (segCwnd * 2) - expectedCwnd;
118 cong->GetAttribute (
"Beta", beta);
129 "CWnd has not updated correctly based on Veno linear increase algorithm");
140 "Veno has not decremented cWnd correctly based on its multiplicative decrease algo.");
156 if (diff < beta.
Get ())
162 m_cWnd +=
static_cast<uint32_t
> (adder);
173 m_cWnd +=
static_cast<uint32_t
> (adder);
189 uint32_t calculatedSsThresh;
190 if (diff < beta.
Get ())
198 return calculatedSsThresh;
209 "Veno test on cWnd in slow start and non-congestive loss"),
212 "Veno test on cWnd with diff < beta"),
215 "Veno increment test on cWnd with diff > beta"),
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Normal state, no dubious events.
#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.
Ptr< TcpSocketState > m_state
Testing the additive increase and multiplicative decrease of TcpVeno.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
#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 MultiplicativeDecrease(uint32_t diff, UintegerValue beta)
TcpVenoTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, uint32_t numRtt, const std::string &name)
virtual void DoRun(void)
Implementation to actually run this TestCase.
This test suite implements a Unit Test.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
uint32_t AdditiveIncrease(Ptr< TcpVeno > cong, uint32_t diff, UintegerValue beta)
ns3::TcpVenoTestSuite g_tcpVenoTest