26 #include "ns3/tcp-congestion-ops.h" 27 #include "ns3/tcp-recovery-ops.h" 28 #include "ns3/tcp-socket-base.h" 29 #include "ns3/tcp-prr-recovery.h" 30 #include "ns3/string.h" 57 uint32_t unAckDataCount,
58 uint32_t bytesInFlight,
59 uint32_t m_lastSackedBytes,
61 const std::string &reductionBound,
62 const std::string &name);
65 virtual void DoRun (
void);
82 uint32_t unAckDataCount,
83 uint32_t bytesInFlight,
84 uint32_t lastSackedBytes,
86 const std::string &reductionBound,
87 const std::string &name)
90 m_segmentSize (segmentSize),
91 m_ssThresh (ssThresh),
92 m_unAckDataCount (unAckDataCount),
93 m_bytesInFlight (bytesInFlight),
94 m_lastSackedBytes (lastSackedBytes),
95 m_bytesSent (bytesSent),
96 m_reductionBound (reductionBound)
103 m_state = CreateObject<TcpSocketState> ();
117 "There should be at least one transmission on entering recovery");
119 for (uint32_t iterator = 0; iterator <
m_bytesSent; )
133 "Updated cwnd should be less than or equal to the existing cwnd");
138 "Updated cwnd should be greater than or equal to the existing cwnd");
154 "Prr test on cWnd when bytesInFlight is greater than ssThresh with SSRB"),
157 "Prr test on cWnd when bytesInFlight is lower than ssThresh with SSRB"),
160 "Prr test on cWnd when bytesInFlight is greater than ssThresh with CRB"),
163 "Prr test on cWnd when bytesInFlight is lower than ssThresh with CRB"),
uint32_t m_segmentSize
Segment size.
virtual void UpdateBytesSent(uint32_t bytesSent) override
Keeps track of bytes sent during recovery phase.
Hold variables of type string.
uint32_t m_unAckDataCount
Unacknowledged data at the start of recovery.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_segmentSize
Segment size.
PrrRecoveryTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, uint32_t unAckDataCount, uint32_t bytesInFlight, uint32_t m_lastSackedBytes, uint32_t bytesSent, const std::string &reductionBound, const std::string &name)
Constructor.
TracedValue< uint32_t > m_cWndInfl
Inflated congestion window trace (used only for backward compatibility purpose)
uint32_t m_bytesSent
Bytes sent while in recovery phase.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
uint32_t m_ssThresh
Slow Start Threshold.
TracedValue< uint32_t > m_bytesInFlight
Bytes in flight.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t lastAckedBytes, uint32_t lastSackedBytes) override
Performs recovery based on the recovery algorithm.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
uint32_t m_bytesInFlight
Current bytes in flight.
uint32_t m_cWnd
Congestion window.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_lastSackedBytes
Bytes SACKed on last acknowledgment.
Ptr< TcpSocketState > m_state
TCP socket state.
TracedValue< uint32_t > m_cWnd
Congestion window.
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes) override
Performs variable initialization at the start of recovery.
static PrrRecoveryTestSuite g_TcpPrrRecoveryTest
Static variable for test initialization.
T Get(void) const
Get the underlying value.
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_ASSERT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report and abort if not...
const std::string m_reductionBound
Type of reduction bound to be used.
This test suite implements a Unit Test.
PRR Recovery algorithm test.
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not...
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.