29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-vegas.h"
47 uint32_t segmentsAcked,
50 const std::string &name);
53 virtual void DoRun (
void);
71 uint32_t segmentsAcked,
74 const std::string &name)
77 m_segmentSize (segmentSize),
78 m_ssThresh (ssThresh),
80 m_segmentsAcked (segmentsAcked),
81 m_nextTxSeq (nextTxSeq),
82 m_lastAckedSeq (lastAckedSeq)
89 m_state = CreateObject<TcpSocketState> ();
117 "CWnd has not updated correctly");
119 "SsThresh has not updated correctly");
129 uint64_t expectedCwnd;
134 diff = segCwnd - expectedCwnd;
138 cong->GetAttribute (
"Alpha", alpha);
139 cong->GetAttribute (
"Beta", beta);
140 cong->GetAttribute (
"Gamma", gamma);
144 segCwnd =
std::min (segCwnd, (uint32_t) expectedCwnd + 1);
158 if (diff > beta.
Get ())
163 else if (diff < alpha.
Get ())
187 "Vegas test on cWnd and ssThresh when in slow start and diff > gamma"),
190 "Vegas test on cWnd and ssThresh when in slow start and diff < gamma"),
193 "Vegas test on cWnd and ssThresh when diff > beta"),
196 "Vegas test on cWnd and ssThresh when diff < alpha"),
199 "Vegas test on cWnd and ssThresh when alpha <= diff <= beta"),
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Normal state, no dubious events.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
SequenceNumber32 m_nextTxSeq
Hold an unsigned integer type.
#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.
ns3::TcpVegasTestSuite g_tcpVegasTest
SequenceNumber32 m_lastAckedSeq
virtual void DoRun(void)
Implementation to actually run this TestCase.
TcpVegasTest(uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, const std::string &name)
void IncreaseWindow(Ptr< TcpVegas > cong)
Ptr< TcpSocketState > m_state
Testing TcpVegas congestion control algorithm.
This test suite implements a Unit Test.
void GetSsThresh(Ptr< TcpVegas > cong)
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.