29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-vegas.h"
58 uint32_t segmentsAcked,
61 const std::string &name);
64 virtual void DoRun (
void);
91 uint32_t segmentsAcked,
94 const std::string &name)
98 m_ssThresh (ssThresh),
100 m_segmentsAcked (segmentsAcked),
101 m_nextTxSeq (nextTxSeq),
102 m_lastAckedSeq (lastAckedSeq)
109 m_state = CreateObject<TcpSocketState> ();
124 cong->CongestionStateSet (
m_state, TcpSocketState::CA_OPEN);
138 "CWnd has not updated correctly");
140 "SsThresh has not updated correctly");
150 uint64_t expectedCwnd;
155 diff = segCwnd - expectedCwnd;
159 cong->GetAttribute (
"Alpha",
alpha);
160 cong->GetAttribute (
"Beta", beta);
161 cong->GetAttribute (
"Gamma", gamma);
165 segCwnd =
std::min (segCwnd, (uint32_t) expectedCwnd + 1);
179 if (diff > beta.
Get ())
184 else if (diff <
alpha.Get ())
214 "Vegas test on cWnd and ssThresh when in slow start and diff > gamma"),
217 "Vegas test on cWnd and ssThresh when in slow start and diff < gamma"),
220 "Vegas test on cWnd and ssThresh when diff > beta"),
223 "Vegas test on cWnd and ssThresh when diff < alpha"),
226 "Vegas test on cWnd and ssThresh when alpha <= diff <= beta"),
TcpVegas congestion control algorithm test.
virtual void DoRun(void)
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.
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.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
T Get(void) 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_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.
float alpha
Plot alpha value (transparency)
static TcpVegasTestSuite g_tcpVegasTest
Static variable for test initialization.