27#include "ns3/tcp-congestion-ops.h"
28#include "ns3/tcp-socket-base.h"
29#include "ns3/tcp-vegas.h"
60 const std::string& name);
63 void DoRun()
override;
93 const std::string& name)
99 m_segmentsAcked(segmentsAcked),
100 m_nextTxSeq(nextTxSeq),
101 m_lastAckedSeq(lastAckedSeq)
108 m_state = CreateObject<TcpSocketState>();
139 "SsThresh has not updated correctly");
149 uint64_t expectedCwnd;
155 diff = segCwnd - expectedCwnd;
161 cong->GetAttribute(
"Alpha", alpha);
162 cong->GetAttribute(
"Beta", beta);
163 cong->GetAttribute(
"Gamma", gamma);
167 segCwnd = std::min(segCwnd, (
uint32_t)expectedCwnd + 1);
181 if (diff > beta.
Get())
186 else if (diff < alpha.
Get())
222 "Vegas test on cWnd and ssThresh when in slow start and diff > gamma"),
232 "Vegas test on cWnd and ssThresh when in slow start and diff < gamma"),
241 "Vegas test on cWnd and ssThresh when diff > beta"),
250 "Vegas test on cWnd and ssThresh when diff < alpha"),
259 "Vegas test on cWnd and ssThresh when alpha <= diff <= beta"),
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.
uint32_t m_segmentSize
Segment size.
Time m_minRtt
Minimum RTT observed throughout the connection.
@ CA_OPEN
Normal state, no dubious events.
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() const
Get an approximation of the time stored in this instance in the indicated unit.
T Get() const
Get the underlying value.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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.