22 #include "ns3/tcp-congestion-ops.h"
23 #include "ns3/tcp-socket-base.h"
24 #include "ns3/tcp-hybla.h"
48 uint32_t segmentSize,
const Time& rtt,
49 const std::string &name);
52 virtual void DoRun (
void);
59 void RhoUpdated (
double oldVal,
double newVal);
70 uint32_t segmentSize,
const Time &rtt,
71 const std::string &name)
74 m_ssThresh (ssThresh),
75 m_segmentSize (segmentSize),
91 m_state = CreateObject<TcpSocketState> ();
113 "Rho never updated by implementation");
115 "Different rho values between implementation and test");
122 double inc = std::pow (2, calcRho) - 1.0;
125 "Congestion window has gone too far");
127 "Congestion window different than expected");
133 double inc = std::pow (
m_rho, 2) / ((double) segCwnd);
140 "Congestion window different than expected");
Simulation virtual time values and global simulation resolution.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void RhoUpdated(double oldVal, double newVal)
Tracks TCP Hybla rho parameter changes.
#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.
#define NS_UNUSED(x)
Mark a local variable as unused.
uint32_t m_segmentSize
Segment size.
double m_rho
TCP Hybla rho parameter.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Try to increase the cWnd following the NewReno specification.
This test suite implements a Unit Test.
T Get(void) const
Get the underlying value.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
uint32_t m_ssThresh
Slow Start Threshold.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
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.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TcpHyblaIncrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, const Time &rtt, const std::string &name)
Constructor.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
TracedValue< uint32_t > m_cWnd
Congestion window.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not...
Time m_rtt
Round trip time.
Ptr< TcpSocketState > m_state
TCP socket state.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time m_minRtt
Minimum RTT observed throughout the connection.
#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...
uint32_t m_segmentSize
Segment size.
static TcpHyblaTestSuite g_tcpHyblaTest
Static variable for test initialization.
Testing the congestion avoidance increment on TcpHybla.