29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-veno.h"
40 if (segmentsAcked >= 1)
43 return segmentsAcked - 1;
52 if (segmentsAcked > 0)
56 tcb->
m_cWnd +=
static_cast<uint32_t
> (adder);
84 uint32_t segmentsAcked,
86 const std::string &name);
89 virtual void DoRun (
void);
104 uint32_t segmentSize,
107 uint32_t segmentsAcked,
109 const std::string &name)
112 m_segmentSize (segmentSize),
113 m_ssThresh (ssThresh),
115 m_segmentsAcked (segmentsAcked),
124 m_state = CreateObject<TcpSocketState> ();
142 uint32_t expectedCwnd;
144 expectedCwnd = segCwnd * tmp;
148 diff = segCwnd - expectedCwnd;
152 cong->GetAttribute (
"Beta", beta);
177 "Veno has not decremented cWnd correctly based on its"
178 "multiplicative decrease algo.");
192 "CWnd has not updated correctly based on Veno linear increase algorithm");
207 if (diff < beta.
Get ())
228 uint32_t bytesInFlight)
230 uint32_t calculatedSsThresh;
231 if (diff < beta.
Get ())
233 static double tmp = 4.0 / 5.0;
240 return calculatedSsThresh;
251 "Veno test on cWnd in slow start and non-congestive loss"),
254 "Veno test on cWnd with diff < beta"),
257 "Veno increment test on cWnd with diff > beta"),
uint32_t MultiplicativeDecrease(uint32_t diff, const UintegerValue &beta, uint32_t bytesInFlight)
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Normal state, no dubious events.
static void NewReno_IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
#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.
static void NewReno_CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
uint32_t m_segmentSize
Segment size.
Data structure that records the congestion state of a connection.
This test suite implements a Unit Test.
T Get(void) const
Get the underlying value.
Ptr< TcpSocketState > m_state
Testing the additive increase and multiplicative decrease of TcpVeno.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
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.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AdditiveIncrease(Ptr< TcpSocketState > state, uint32_t diff, UintegerValue beta)
static uint32_t NewReno_SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
TcpVenoTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, uint32_t numRtt, const std::string &name)
TracedValue< uint32_t > m_cWnd
Congestion window.
virtual void DoRun(void)
Implementation to actually run this TestCase.
ns3::TcpVenoTestSuite g_tcpVenoTest