27#include "ns3/tcp-congestion-ops.h"
28#include "ns3/tcp-socket-base.h"
29#include "ns3/tcp-veno.h"
61 const std::string& name);
64 void DoRun()
override;
123 const std::string& name)
127 m_ssThresh(ssThresh),
129 m_segmentsAcked(segmentsAcked),
138 m_state = CreateObject<TcpSocketState>();
152 cong->CongestionStateSet(
m_state, TcpSocketState::CA_OPEN);
159 expectedCwnd = segCwnd * tmp;
163 diff = segCwnd - expectedCwnd;
167 cong->GetAttribute(
"Beta", beta);
193 "Veno has not decremented cWnd correctly based on its"
194 "multiplicative decrease algo.");
210 "CWnd has not updated correctly based on Veno linear increase algorithm");
225 if (diff < beta.
Get())
250 if (diff < beta.
Get())
252 static double tmp = 4.0 / 5.0;
260 return calculatedSsThresh;
280 if (segmentsAcked >= 1)
283 return segmentsAcked - 1;
292 if (segmentsAcked > 0)
319 "Veno test on cWnd in slow start and non-congestive loss"),
327 "Veno test on cWnd with diff < beta"),
335 "Veno increment test on cWnd with diff > beta"),
Testing the additive increase and multiplicative decrease of TcpVeno.
void NewReno_CongestionAvoidance(Ptr< TcpSocketState > state, uint32_t segmentsAcked)
Mimics the NewReno Congestion Avoidance algorithm.
uint32_t m_numRtt
Number of RTT (i.e., rounds) of the test.
bool m_inc
Internal flag to increase every other round.
uint32_t MultiplicativeDecrease(uint32_t diff, const UintegerValue &beta, uint32_t bytesInFlight)
TCP Veno multiplicative decrease formula.
uint32_t m_segmentsAcked
Number of segments ACKed.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t NewReno_SlowStart(Ptr< TcpSocketState > state, uint32_t segmentsAcked)
Mimics the NewReno SlowStart algorithm.
uint32_t m_cWnd
Congestion window.
TcpVenoTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, uint32_t numRtt, const std::string &name)
Constructor.
uint32_t m_ssThresh
Slow Start Threshold.
Ptr< TcpSocketState > m_state
TCP socket state.
uint32_t m_segmentSize
Segment size.
void NewReno_IncreaseWindow(Ptr< TcpSocketState > state, uint32_t segmentsAcked)
Mimics the NewReno IncreaseWindow algorithm.
void AdditiveIncrease(Ptr< TcpSocketState > state, uint32_t diff, UintegerValue beta)
TCP Veno additive increase formula.
Data structure that records the congestion state of a connection.
uint32_t m_segmentSize
Segment size.
Time m_minRtt
Minimum RTT observed throughout the connection.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
T Get() const
Get the underlying value.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
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 TcpVenoTestSuite g_tcpVenoTest
Static variable for test initialization.