27 #include "ns3/tcp-congestion-ops.h"
28 #include "ns3/tcp-socket-base.h"
29 #include "ns3/tcp-yeah.h"
60 uint32_t segmentsAcked,
62 const std::string& name);
65 void DoRun()
override;
90 uint32_t segmentsAcked,
92 const std::string& name)
97 m_nextTxSeq(nextTxSeq),
98 m_lastAckedSeq(lastAckedSeq),
99 m_segmentsAcked(segmentsAcked),
125 cong->CongestionStateSet(state, TcpSocketState::CA_OPEN);
155 cong->GetAttribute(
"StcpAiFactor", aiFactor);
156 uint32_t w =
std::min(segCwnd, (uint32_t)aiFactor.
Get());
167 m_cWnd +=
static_cast<uint32_t
>(adder);
186 cong->GetAttribute(
"Alpha", alpha);
188 cong->GetAttribute(
"Phy",
phy);
190 cong->GetAttribute(
"Gamma", gamma);
192 cong->GetAttribute(
"Epsilon",
epsilon);
194 cong->GetAttribute(
"Zeta", zeta);
196 if (queue > alpha.
Get() || L > (1 /
phy.Get()))
203 segCwnd -= reduction;
207 NS_LOG_INFO(
"In Slow mode, after precautionary decongestion, "
242 const std::string& name);
245 void DoRun()
override;
272 const std::string& name)
275 m_ssThresh(ssThresh),
278 m_nextTxSeq(nextTxSeq),
279 m_lastAckedSeq(lastAckedSeq),
306 cong->CongestionStateSet(state, TcpSocketState::CA_OPEN);
317 uint32_t ssThresh = cong->GetSsThresh(state,
m_cWnd);
333 cong->GetAttribute(
"Delta",
delta);
347 NS_LOG_INFO(
"Reduction amount for yeah upon loss = " << reduction);
351 reduction =
std::max(segCwnd >> 1, (uint32_t)2);
352 NS_LOG_INFO(
"Reduction amount for reno upon loss = " << reduction);
376 "YeAH test on cWnd when in slow start"),
385 "YeAH test on cWnd when in Fast mode"),
395 "YeAH test on cWnd when in slow mode without precautionary decongestion"),
405 "YeAH test on cWnd when in slow mode with precautionary decongestion"),
415 "YeAH test on ssThresh upon loss while competing with Reno flows"),
425 "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.