29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-yeah.h"
48 uint32_t segmentsAcked,
50 const std::string &name);
53 virtual void DoRun ();
74 uint32_t segmentsAcked,
76 const std::string &name)
79 m_ssThresh (ssThresh),
80 m_segmentSize (segmentSize),
81 m_nextTxSeq (nextTxSeq),
82 m_lastAckedSeq (lastAckedSeq),
83 m_segmentsAcked (segmentsAcked),
119 "CWnd has not updated correctly");
140 cong->GetAttribute (
"StcpAiFactor", aiFactor);
141 uint32_t
w =
std::min (segCwnd, (uint32_t) aiFactor.
Get ());
153 m_cWnd +=
static_cast<uint32_t
> (adder);
171 double L = rttQueue.
GetSeconds () / m_baseRtt.GetSeconds ();
174 cong->GetAttribute (
"Alpha", alpha);
176 cong->GetAttribute (
"Phy", phy);
178 cong->GetAttribute (
"Gamma", gamma);
180 cong->GetAttribute (
"Epsilon", epsilon);
182 cong->GetAttribute (
"Zeta", zeta);
184 if (queue > alpha.
Get () || L > (1 / phy.
Get ()) )
189 uint32_t reduction =
std::min (queue / (uint32_t) gamma.
Get (),
190 segCwnd >> (uint32_t) epsilon.
Get ());
191 segCwnd -= reduction;
195 NS_LOG_INFO (
"In Slow mode, after precautionary decongestion, "
196 "updated to cwnd " <<
m_cWnd <<
" ssthresh " <<
212 uint32_t segmentSize,
217 const std::string &name);
220 virtual void DoRun (
void);
237 uint32_t segmentSize,
242 const std::string &name)
245 m_ssThresh (ssThresh),
246 m_segmentSize (segmentSize),
248 m_nextTxSeq (nextTxSeq),
249 m_lastAckedSeq (lastAckedSeq),
287 uint32_t ssThresh = cong->GetSsThresh (state,
m_cWnd);
293 "SsThresh has not updated correctly");
304 cong->GetAttribute (
"Delta", delta);
316 reduction =
std::max (queue, segCwnd >> delta.
Get ());
318 NS_LOG_INFO (
"Reduction amount for yeah upon loss = " << reduction);
322 reduction =
std::max (segCwnd >> 1, (uint32_t) 2);
323 NS_LOG_INFO (
"Reduction amount for reno upon loss = " << reduction);
340 "YeAH test on cWnd when in slow start"),
344 "YeAH test on cWnd when in Fast mode"),
348 "YeAH test on cWnd when in slow mode without precautionary decongestion"),
352 "YeAH test on cWnd when in slow mode with precautionary decongestion"),
356 "YeAH test on ssThresh upon loss while competing with Reno flows"),
360 "YeAH test on ssThresh upon loss while not competing with Reno flows"),
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Normal state, no dubious events.
SequenceNumber32 m_lastAckedSeq
TcpYeahDecrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, Time minRtt, UintegerValue rho, const std::string &name)
uint32_t CalculateSsThresh(Ptr< TcpYeah > cong)
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void IncreaseWindow(Ptr< TcpYeah > cong)
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
SequenceNumber32 m_nextTxSeq
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.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
ns3::TcpYeahTestSuite g_tcpYeahTest
SequenceNumber32 m_nextTxSeq
Testing TcpYeah multiplicative decrease algorithm.
SequenceNumber32 m_lastAckedSeq
virtual void DoRun()
Implementation to actually run this TestCase.
TcpYeahIncrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, uint32_t segmentsAcked, Time minRtt, const std::string &name)
This test suite implements a Unit Test.
Testing TcpYeah additive increase algorithm.
virtual void DoRun(void)
Implementation to actually run this TestCase.