30 #include "ns3/tcp-congestion-ops.h" 31 #include "ns3/tcp-socket-base.h" 32 #include "ns3/tcp-scalable.h" 55 uint32_t segmentsAcked,
56 const std::string &name);
59 virtual void DoRun (
void);
69 uint32_t segmentsAcked,
70 const std::string &name)
73 m_segmentSize (segmentSize),
74 m_segmentsAcked (segmentsAcked)
81 m_state = CreateObject<TcpSocketState> ();
97 uint32_t w =
std::min (segCwnd, (uint32_t) aiFactor.
Get ());
103 "CWnd has not increased");
122 const std::string &name);
125 virtual void DoRun (
void);
133 uint32_t segmentSize,
134 const std::string &name)
137 m_segmentSize (segmentSize)
144 m_state = CreateObject<TcpSocketState> ();
157 double b = 1.0 - mdFactor.
Get ();
159 uint32_t ssThresh =
std::max (2.0, segCwnd * b);
164 "Scalable decrement fn not used");
180 "Scalable increment test on cWnd = 38 segments and segmentSize = 536 bytes"),
183 "Scalable increment test on cWnd = 38 segments and segmentSize = 1 byte"),
186 "Scalable increment test on cWnd = 53 segments and segmentSize = 1446 bytes"),
190 "Scalable decrement test on cWnd = 38 segments and segmentSize = 1 byte"),
193 "Scalable decrement test on cWnd = 100 segments and segmentSize = 536 bytes"),
196 "Scalable decrement test on cWnd = 40 segments and segmentSize = 1446 bytes"),
uint32_t m_segmentsAcked
Segments ACKed.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_segmentSize
Segment size.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Try to increase the cWnd following the NewReno specification.
uint32_t m_cWnd
Congestion window.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
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 m_segmentSize
Segment size.
TcpScalableIncrementTest(uint32_t cWnd, uint32_t segmentSize, uint32_t segmentsAcked, const std::string &name)
Constructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpScalableTestSuite g_tcpScalableTest
Static variable for test initialization.
Ptr< TcpSocketState > m_state
TCP socket state.
TcpScalableDecrementTest(uint32_t cWnd, uint32_t segmentSize, const std::string &name)
Constructor.
TracedValue< uint32_t > m_cWnd
Congestion window.
Testing the congestion avoidance increment on TcpScalable.
T Get(void) const
Get the underlying value.
uint32_t m_segmentSize
Segment size.
Ptr< TcpSocketState > m_state
TCP socket state.
This test suite implements a Unit Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold following Scalable principle (Equation 2)
uint32_t m_cWnd
Congestion window.
Testing the multiplicative decrease on TcpScalable.