20#include "ns3/tcp-bic.h"
21#include "ns3/tcp-congestion-ops.h"
22#include "ns3/tcp-socket-base.h"
52 const std::string& name);
55 void DoRun()
override;
82 const std::string& name)
87 m_segmentsAcked(segmentsAcked),
88 m_lastMaxCwnd(lastMaxCwnd)
95 m_state = CreateObject<TcpSocketState>();
103 Simulator::Destroy();
117 "Bic has not increment cWnd");
125 "Bic has modified cWnd");
139 cong->GetAttribute(
"LowWnd", lowWindow);
140 cong->GetAttribute(
"BinarySearchCoefficient", bsCoeff);
141 cong->GetAttribute(
"MaxIncr", wMax);
142 cong->GetAttribute(
"SmoothPart", smoothPart);
148 if (segCwnd < lowWindow.
Get())
156 if (midPt > wMax.
Get())
159 ackCnt = segCwnd / wMax.
Get();
163 ackCnt = (segCwnd * smoothPart.
Get()) / bsCoeff.
Get();
168 ackCnt = segCwnd / midPt;
176 ackCnt = (segCwnd * smoothPart.
Get()) / bsCoeff.
Get();
186 ackCnt = segCwnd / wMax.
Get();
213 const std::string& name);
216 void DoRun()
override;
234 const std::string& name)
238 m_fastConvergence(fastConvergence),
239 m_lastMaxCwnd(lastMaxCwnd)
246 m_state = CreateObject<TcpSocketState>();
253 Simulator::Destroy();
265 uint32_t retLastMaxCwnd = cong->m_lastMaxCwnd;
269 cong->GetAttribute(
"Beta", beta);
270 cong->GetAttribute(
"LowWnd", lowWindow);
277 lastMaxCwnd = beta.
Get() * segCwnd;
280 "Bic has not updated lastMaxCwnd during fast convergence");
284 lastMaxCwnd = segCwnd;
287 "Bic has not reset lastMaxCwnd to current cwnd (in segments)");
290 if (segCwnd < lowWindow.
Get())
295 "Bic has not updated ssThresh when cWnd less than lowWindow");
302 "Bic has not updated ssThresh when cWnd greater than lowWindow");
324 "Bic increment test: under lowCwnd & enough ACKs received"),
332 "Bic increment test: under lowCwnd but not enough ACKs received"),
340 "Bic increment test: linear increase when distance exceeds S_max"),
348 "Bic increment test: binary search increase with smooth part"),
355 "Bic increment test: binary search increase"),
362 "Bic increment test: slow start AMD linear increase"),
370 "Bic increment test: slow start but not enough ACKs received"),
378 "Bic increment test: linear incrase but not enough ACKs received"),
386 "Bic decrement test: fast convergence & cwnd less than lowWindow"),
393 "Bic decrement test: not in fast convergence & cwnd less than lowWindow"),
401 "Bic decrement test: not in fast convergence & cwnd greater than lowWindow"),
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.
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
uint32_t m_segmentSize
Segment size.
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.
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 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.