16#include "ns3/tcp-congestion-ops.h"
17#include "ns3/tcp-socket-base.h"
18#include "ns3/tcp-vegas.h"
49 const std::string& name);
52 void DoRun()
override;
82 const std::string& name)
88 m_segmentsAcked(segmentsAcked),
89 m_nextTxSeq(nextTxSeq),
90 m_lastAckedSeq(lastAckedSeq)
128 "SsThresh has not updated correctly");
138 uint64_t expectedCwnd;
144 diff = segCwnd - expectedCwnd;
150 cong->GetAttribute(
"Alpha", alpha);
151 cong->GetAttribute(
"Beta", beta);
152 cong->GetAttribute(
"Gamma", gamma);
156 segCwnd = std::min(segCwnd, (
uint32_t)expectedCwnd + 1);
170 if (diff > beta.
Get())
175 else if (diff < alpha.
Get())
211 "Vegas test on cWnd and ssThresh when in slow start and diff > gamma"),
212 TestCase::Duration::QUICK);
221 "Vegas test on cWnd and ssThresh when in slow start and diff < gamma"),
222 TestCase::Duration::QUICK);
230 "Vegas test on cWnd and ssThresh when diff > beta"),
231 TestCase::Duration::QUICK);
239 "Vegas test on cWnd and ssThresh when diff < alpha"),
240 TestCase::Duration::QUICK);
248 "Vegas test on cWnd and ssThresh when alpha <= diff <= beta"),
249 TestCase::Duration::QUICK);
TcpVegas congestion control algorithm test.
void DoRun() override
Implementation to actually run this TestCase.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
void GetSsThresh(Ptr< TcpVegas > cong)
brief Get and check the SSH threshold.
Ptr< TcpSocketState > m_state
TCP socket state.
uint32_t m_cWnd
Congestion window.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
void IncreaseWindow(Ptr< TcpVegas > cong)
Increases the TCP window.
uint32_t m_segmentSize
Segment size.
TcpVegasTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, const std::string &name)
Constructor.
uint32_t m_segmentsAcked
Number of segments ACKed.
uint32_t m_ssThresh
Slow Start Threshold.
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.
int64_t GetMilliSeconds() 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.
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 TcpVegasTestSuite g_tcpVegasTest
Static variable for test initialization.