27#include "ns3/tcp-congestion-ops.h"
28#include "ns3/tcp-socket-base.h"
29#include "ns3/tcp-yeah.h"
63 const std::string& name);
66 void DoRun()
override;
93 const std::string& name)
98 m_nextTxSeq(nextTxSeq),
99 m_lastAckedSeq(lastAckedSeq),
100 m_segmentsAcked(segmentsAcked),
126 cong->CongestionStateSet(state, TcpSocketState::CA_OPEN);
156 cong->GetAttribute(
"StcpAiFactor", aiFactor);
187 cong->GetAttribute(
"Alpha", alpha);
189 cong->GetAttribute(
"Phy",
phy);
191 cong->GetAttribute(
"Gamma", gamma);
193 cong->GetAttribute(
"Epsilon",
epsilon);
195 cong->GetAttribute(
"Zeta", zeta);
197 if (queue > alpha.
Get() || L > (1 /
phy.Get()))
204 segCwnd -= reduction;
208 NS_LOG_INFO(
"In Slow mode, after precautionary decongestion, "
244 const std::string& name);
247 void DoRun()
override;
274 const std::string& name)
277 m_ssThresh(ssThresh),
280 m_nextTxSeq(nextTxSeq),
281 m_lastAckedSeq(lastAckedSeq),
308 cong->CongestionStateSet(state, TcpSocketState::CA_OPEN);
335 cong->GetAttribute(
"Delta", delta);
347 reduction =
std::max(queue, segCwnd >> delta.
Get());
349 NS_LOG_INFO(
"Reduction amount for yeah upon loss = " << reduction);
354 NS_LOG_INFO(
"Reduction amount for reno upon loss = " << reduction);
379 "YeAH test on cWnd when in slow start"),
388 "YeAH test on cWnd when in Fast mode"),
398 "YeAH test on cWnd when in slow mode without precautionary decongestion"),
408 "YeAH test on cWnd when in slow mode with precautionary decongestion"),
418 "YeAH test on ssThresh upon loss while competing with Reno flows"),
428 "YeAH test on ssThresh upon loss while not competing with Reno flows"),
Testing TcpYeah multiplicative decrease algorithm.
uint32_t m_cWnd
Congestion window.
void DoRun() override
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.
void DoRun() override
Implementation to actually run this TestCase.
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.
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() const
Get an approximation of the time stored in this instance in the indicated unit.
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_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.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#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.
static TcpYeahTestSuite g_tcpYeahTest
Static variable for test initialization.