9#include "ns3/tcp-bic.h"
10#include "ns3/tcp-congestion-ops.h"
11#include "ns3/tcp-socket-base.h"
40 const std::string& name);
43 void DoRun()
override;
70 const std::string& name)
75 m_segmentsAcked(segmentsAcked),
76 m_lastMaxCwnd(lastMaxCwnd)
105 "Bic has not increment cWnd");
113 "Bic has modified cWnd");
120 uint32_t segCwnd = tcb->m_cWnd / tcb->m_segmentSize;
127 cong->GetAttribute(
"LowWnd", lowWindow);
128 cong->GetAttribute(
"BinarySearchCoefficient", bsCoeff);
129 cong->GetAttribute(
"MaxIncr", wMax);
130 cong->GetAttribute(
"SmoothPart", smoothPart);
136 if (segCwnd < lowWindow.
Get())
144 if (midPt > wMax.
Get())
147 ackCnt = segCwnd / wMax.
Get();
151 ackCnt = (segCwnd * smoothPart.
Get()) / bsCoeff.
Get();
156 ackCnt = segCwnd / midPt;
164 ackCnt = (segCwnd * smoothPart.
Get()) / bsCoeff.
Get();
174 ackCnt = segCwnd / wMax.
Get();
200 const std::string& name);
203 void DoRun()
override;
221 const std::string& name)
225 m_fastConvergence(fastConvergence),
226 m_lastMaxCwnd(lastMaxCwnd)
252 uint32_t retLastMaxCwnd = cong->m_lastMaxCwnd;
256 cong->GetAttribute(
"Beta", beta);
257 cong->GetAttribute(
"LowWnd", lowWindow);
264 lastMaxCwnd = beta.
Get() * segCwnd;
267 "Bic has not updated lastMaxCwnd during fast convergence");
271 lastMaxCwnd = segCwnd;
274 "Bic has not reset lastMaxCwnd to current cwnd (in segments)");
277 if (segCwnd < lowWindow.
Get())
282 "Bic has not updated ssThresh when cWnd less than lowWindow");
289 "Bic has not updated ssThresh when cWnd greater than lowWindow");
310 "Bic increment test: under lowCwnd & enough ACKs received"),
311 TestCase::Duration::QUICK);
318 "Bic increment test: under lowCwnd but not enough ACKs received"),
319 TestCase::Duration::QUICK);
326 "Bic increment test: linear increase when distance exceeds S_max"),
327 TestCase::Duration::QUICK);
334 "Bic increment test: binary search increase with smooth part"),
335 TestCase::Duration::QUICK);
341 "Bic increment test: binary search increase"),
342 TestCase::Duration::QUICK);
348 "Bic increment test: slow start AMD linear increase"),
349 TestCase::Duration::QUICK);
356 "Bic increment test: slow start but not enough ACKs received"),
357 TestCase::Duration::QUICK);
364 "Bic increment test: linear increase but not enough ACKs received"),
365 TestCase::Duration::QUICK);
372 "Bic decrement test: fast convergence & cwnd less than lowWindow"),
373 TestCase::Duration::QUICK);
379 "Bic decrement test: not in fast convergence & cwnd less than lowWindow"),
380 TestCase::Duration::QUICK);
387 "Bic decrement test: not in fast convergence & cwnd greater than lowWindow"),
388 TestCase::Duration::QUICK);
Testing the congestion avoidance decrement on TcpBic.
uint32_t m_cWnd
Congestion window.
uint32_t m_segmentSize
Segment size.
void ExecuteTest()
Execute the test.
uint32_t m_lastMaxCwnd
Last max Cwnd.
Ptr< TcpSocketState > m_state
TCP socket state.
BooleanValue m_fastConvergence
Fast convergence.
TcpBicDecrementTest(uint32_t cWnd, uint32_t segmentSize, BooleanValue fastConvergence, uint32_t lastMaxCwnd, const std::string &name)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Testing the congestion avoidance increment on TcpBic.
uint32_t Update(Ptr< TcpSocketState > tcb)
Update the TCP socket state.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_ssThresh
Slow Start Threshold.
void ExecuteTest()
Execute the test.
uint32_t m_lastMaxCwnd
Last max Cwnd.
uint32_t m_segmentsAcked
Number of segments acked.
uint32_t m_cWnd
Congestion window.
Ptr< TcpSocketState > m_state
TCP socket state.
uint32_t m_segmentSize
Segment size.
TcpBicIncrementTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, uint32_t segmentsAcked, uint32_t lastMaxCwnd, const std::string &name)
Constructor.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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 Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpBicTestSuite g_tcpBicTest
Static variable for test initialization.