16#include "ns3/tcp-congestion-ops.h"
17#include "ns3/tcp-socket-base.h"
18#include "ns3/tcp-yeah.h"
51 const std::string& name);
54 void DoRun()
override;
81 const std::string& name)
86 m_nextTxSeq(nextTxSeq),
87 m_lastAckedSeq(lastAckedSeq),
88 m_segmentsAcked(segmentsAcked),
144 cong->GetAttribute(
"StcpAiFactor", aiFactor);
155 adder = std::max(1.0, adder);
175 cong->GetAttribute(
"Alpha", alpha);
177 cong->GetAttribute(
"Phy", phy);
179 cong->GetAttribute(
"Gamma", gamma);
181 cong->GetAttribute(
"Epsilon",
epsilon);
183 cong->GetAttribute(
"Zeta", zeta);
185 if (queue > alpha.
Get() || L > (1 / phy.Get()))
192 segCwnd -= reduction;
196 NS_LOG_INFO(
"In Slow mode, after precautionary decongestion, "
231 const std::string& name);
234 void DoRun()
override;
261 const std::string& name)
264 m_ssThresh(ssThresh),
267 m_nextTxSeq(nextTxSeq),
268 m_lastAckedSeq(lastAckedSeq),
322 cong->GetAttribute(
"Delta", delta);
334 reduction = std::max(queue, segCwnd >> delta.Get());
335 reduction = std::min(reduction, std::max(segCwnd >> 1, (
uint32_t)2));
336 NS_LOG_INFO(
"Reduction amount for yeah upon loss = " << reduction);
340 reduction = std::max(segCwnd >> 1, (
uint32_t)2);
341 NS_LOG_INFO(
"Reduction amount for reno upon loss = " << reduction);
365 "YeAH test on cWnd when in slow start"),
366 TestCase::Duration::QUICK);
374 "YeAH test on cWnd when in Fast mode"),
375 TestCase::Duration::QUICK);
384 "YeAH test on cWnd when in slow mode without precautionary decongestion"),
385 TestCase::Duration::QUICK);
394 "YeAH test on cWnd when in slow mode with precautionary decongestion"),
395 TestCase::Duration::QUICK);
404 "YeAH test on ssThresh upon loss while competing with Reno flows"),
405 TestCase::Duration::QUICK);
414 "YeAH test on ssThresh upon loss while not competing with Reno flows"),
415 TestCase::Duration::QUICK);
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.
@ CA_OPEN
Normal state, no dubious events.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
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.
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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
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.