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),
98 m_segmentSize (segmentSize),
99 m_nextTxSeq (nextTxSeq),
100 m_lastAckedSeq (lastAckedSeq),
101 m_segmentsAcked (segmentsAcked),
138 "CWnd has not updated correctly");
160 uint32_t w =
std::min (segCwnd, (uint32_t) aiFactor.
Get ());
172 m_cWnd +=
static_cast<uint32_t
> (adder);
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 " <<
245 uint32_t segmentSize,
250 const std::string &name);
253 virtual void DoRun (
void);
275 uint32_t segmentSize,
280 const std::string &name)
283 m_ssThresh (ssThresh),
284 m_segmentSize (segmentSize),
286 m_nextTxSeq (nextTxSeq),
287 m_lastAckedSeq (lastAckedSeq),
331 "SsThresh has not updated correctly");
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"),
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t m_doingRenoNow
TCP Reno fallback.
uint32_t m_cWnd
Congestion window.
uint32_t m_renoCount
Reno counter.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
uint32_t m_segmentSize
Segment size.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable YeAH algorithm depending on the congestion state.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
#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.
uint32_t m_segmentsAcked
Number of segments ACKed.
uint32_t m_doingRenoNow
TCP Reno fallback.
uint32_t m_segmentSize
Segment size.
Testing TcpYeah multiplicative decrease algorithm.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Compute RTTs needed to execute YeAH algorithm.
TcpYeahIncrementTest(uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, uint32_t segmentsAcked, Time minRtt, const std::string &name)
Constructor.
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.
uint32_t m_ssThresh
Slow Start Threshold.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static TcpYeahTestSuite g_tcpYeahTest
Static variable for test initialization.
Hold an unsigned integer type.
uint32_t m_cntRtt
RTT counter.
#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.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_segmentsAcked
Number of segments ACKed.
uint32_t m_segmentSize
Segment size.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint32_t CalculateSsThresh(Ptr< TcpYeah > cong)
Calculate the Slow Start threshold.
TracedValue< uint32_t > m_cWnd
Congestion window.
Testing TcpYeah additive increase algorithm.
void IncreaseWindow(Ptr< TcpYeah > cong)
Increases the TCP window.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following YeAH dual-mode algorithm.
T Get(void) const
Get the underlying value.
Time m_minRtt
Minimum RTT observed throughout the connection.
virtual void DoRun()
Implementation to actually run this TestCase.
uint32_t m_cWnd
Congestion window.
This test suite implements a Unit Test.
uint32_t m_ssThresh
Slow Start Threshold.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold upon the receipt of 3 dupACKs.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.