29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-yeah.h"
62 uint32_t segmentsAcked,
64 const std::string &name);
67 virtual void DoRun ();
92 uint32_t segmentsAcked,
94 const std::string &name)
97 m_ssThresh (ssThresh),
99 m_nextTxSeq (nextTxSeq),
100 m_lastAckedSeq (lastAckedSeq),
101 m_segmentsAcked (segmentsAcked),
127 cong->CongestionStateSet (state, TcpSocketState::CA_OPEN);
138 "CWnd has not updated correctly");
159 cong->GetAttribute (
"StcpAiFactor", aiFactor);
160 uint32_t w =
std::min (segCwnd, (uint32_t) aiFactor.
Get ());
172 m_cWnd +=
static_cast<uint32_t
> (adder);
193 cong->GetAttribute (
"Alpha",
alpha);
195 cong->GetAttribute (
"Phy",
phy);
197 cong->GetAttribute (
"Gamma", gamma);
199 cong->GetAttribute (
"Epsilon",
epsilon);
201 cong->GetAttribute (
"Zeta", zeta);
203 if (queue >
alpha.Get () || L > (1 /
phy.Get ()) )
208 uint32_t reduction =
std::min (queue / (uint32_t) gamma.
Get (),
209 segCwnd >> (uint32_t)
epsilon.Get ());
210 segCwnd -= reduction;
214 NS_LOG_INFO (
"In Slow mode, after precautionary decongestion, "
215 "updated to cwnd " <<
m_cWnd <<
" ssthresh " <<
250 const std::string &name);
253 virtual void DoRun (
void);
280 const std::string &name)
283 m_ssThresh (ssThresh),
286 m_nextTxSeq (nextTxSeq),
287 m_lastAckedSeq (lastAckedSeq),
314 cong->CongestionStateSet (state, TcpSocketState::CA_OPEN);
325 uint32_t ssThresh = cong->GetSsThresh (state,
m_cWnd);
331 "SsThresh has not updated correctly");
342 cong->GetAttribute (
"Delta", delta);
354 reduction =
std::max (queue, segCwnd >> delta.
Get ());
356 NS_LOG_INFO (
"Reduction amount for yeah upon loss = " << reduction);
360 reduction =
std::max (segCwnd >> 1, (uint32_t) 2);
361 NS_LOG_INFO (
"Reduction amount for reno upon loss = " << reduction);
383 "YeAH test on cWnd when in slow start"),
387 "YeAH test on cWnd when in Fast mode"),
391 "YeAH test on cWnd when in slow mode without precautionary decongestion"),
395 "YeAH test on cWnd when in slow mode with precautionary decongestion"),
399 "YeAH test on ssThresh upon loss while competing with Reno flows"),
403 "YeAH test on ssThresh upon loss while not competing with Reno flows"),
Testing TcpYeah multiplicative decrease algorithm.
uint32_t m_cWnd
Congestion window.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t m_segmentsAcked
Number of segments ACKed.
uint32_t m_ssThresh
Slow Start Threshold.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
uint32_t m_segmentSize
Segment size.
uint32_t m_doingRenoNow
TCP Reno fallback.
uint32_t CalculateSsThresh(Ptr< TcpYeah > cong)
Calculate the Slow Start threshold.
UintegerValue m_rho
TCP Yeah rho param.
TcpYeahDecrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, Time minRtt, UintegerValue rho, const std::string &name)
Constructor.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
Testing TcpYeah additive increase algorithm.
void IncreaseWindow(Ptr< TcpYeah > cong)
Increases the TCP window.
uint32_t m_segmentsAcked
Number of segments ACKed.
uint32_t m_cWnd
Congestion window.
uint32_t m_segmentSize
Segment size.
TcpYeahIncrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, uint32_t segmentsAcked, Time minRtt, const std::string &name)
Constructor.
uint32_t m_doingRenoNow
TCP Reno fallback.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
virtual void DoRun()
Implementation to actually run this TestCase.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
uint32_t m_ssThresh
Slow Start Threshold.
uint32_t m_renoCount
Reno counter.
uint32_t m_cntRtt
RTT counter.
Smart pointer class similar to boost::intrusive_ptr.
uint32_t m_segmentSize
Segment size.
Time m_minRtt
Minimum RTT observed throughout the connection.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
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.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
T Get(void) 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_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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 MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
float alpha
Plot alpha value (transparency)
static TcpYeahTestSuite g_tcpYeahTest
Static variable for test initialization.