22 #include "ns3/tcp-congestion-ops.h"
23 #include "ns3/tcp-socket-base.h"
24 #include "ns3/tcp-bic.h"
39 uint32_t segmentsAcked,
41 const std::string &name);
44 virtual void DoRun (
void);
59 uint32_t segmentsAcked,
61 const std::string &name)
64 m_segmentSize (segmentSize),
65 m_ssThresh (ssThresh),
66 m_segmentsAcked (segmentsAcked),
67 m_lastMaxCwnd (lastMaxCwnd)
74 m_state = CreateObject<TcpSocketState> ();
95 "Bic has not increment cWnd");
102 "Bic has modified cWnd");
109 uint32_t segCwnd = tcb->m_cWnd / tcb->m_segmentSize;
114 cong->GetAttribute (
"LowWnd", lowWindow);
115 cong->GetAttribute (
"BinarySearchCoefficient", bsCoeff);
116 cong->GetAttribute (
"MaxIncr", wMax);
117 cong->GetAttribute (
"SmoothPart", smoothPart);
123 if (segCwnd < lowWindow.
Get ())
131 if (midPt > wMax.
Get ())
134 ackCnt = segCwnd / wMax.
Get ();
138 ackCnt = (segCwnd * smoothPart.
Get ()) / bsCoeff.
Get ();
143 ackCnt = segCwnd / midPt;
151 ackCnt = (segCwnd * smoothPart.
Get ()) / bsCoeff.
Get ();
161 ackCnt = segCwnd / wMax.
Get ();
176 uint32_t segmentSize,
178 uint32_t lastMaxCwnd,
179 const std::string &name);
182 virtual void DoRun (
void);
193 uint32_t segmentSize,
195 uint32_t lastMaxCwnd,
196 const std::string &name)
199 m_segmentSize (segmentSize),
200 m_fastConvergence (fastConvergence),
201 m_lastMaxCwnd (lastMaxCwnd)
208 m_state = CreateObject<TcpSocketState> ();
226 uint32_t retSsThresh = cong->GetSsThresh (
m_state,
m_state->m_cWnd);
227 uint32_t retLastMaxCwnd = cong->m_lastMaxCwnd;
231 cong->GetAttribute (
"Beta", beta);
232 cong->GetAttribute (
"LowWnd", lowWindow);
234 uint32_t lastMaxCwnd, ssThresh;
238 lastMaxCwnd = beta.
Get () * segCwnd;
240 "Bic has not updated lastMaxCwnd during fast convergence");
244 lastMaxCwnd = segCwnd;
246 "Bic has not reset lastMaxCwnd to current cwnd (in segments)");
250 if (segCwnd < lowWindow.
Get ())
254 "Bic has not updated ssThresh when cWnd less than lowWindow");
260 "Bic has not updated ssThresh when cWnd greater than lowWindow");
273 "Bic increment test: under lowCwnd & enough ACKs received"),
276 "Bic increment test: under lowCwnd but not enough ACKs received"),
279 "Bic increment test: linear increase when distance exceeds S_max"),
282 "Bic increment test: binary search increase with smooth part"),
285 "Bic increment test: binary search increase"),
288 "Bic increment test: slow start AMD linear increase"),
291 "Bic increment test: slow start but not enough ACKs received"),
294 "Bic increment test: linear incrase but not enough ACKs received"),
298 "Bic decrement test: fast convergence & cwnd less than lowWindow"),
301 "Bic decrement test: not in fast convergence & cwnd less than lowWindow"),
304 "Bic decrement test: not in fast convergence & cwnd greater than lowWindow"),
Testing the congestion avoidance increment on TcpBic.
Smart pointer class similar to boost::intrusive_ptr.
AttributeValue implementation for Boolean.
static void Run(void)
Run the simulation.
Hold a signed integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Testing the congestion avoidance increment on TcpBic.
virtual void DoRun(void)
Implementation to actually run this TestCase.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
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.
ns3::TcpBicTestSuite g_tcpBicTest
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Ptr< TcpSocketState > m_state
uint32_t Update(Ptr< TcpSocketState > tcb)
Ptr< TcpSocketState > m_state
TcpBicIncrementTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, uint32_t segmentsAcked, uint32_t lastMaxCwnd, const std::string &name)
Time Seconds(double value)
Construct a Time in the indicated unit.
This test suite implements a Unit Test.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
TcpBicDecrementTest(uint32_t cWnd, uint32_t segmentSize, BooleanValue fastConvergence, uint32_t lastMaxCwnd, const std::string &name)
BooleanValue m_fastConvergence