11#include "ns3/simple-channel.h"
58 const std::string& desc);
87 const std::string& desc)
135 NS_FATAL_ERROR(
"Drop on the queue; cannot validate congestion avoidance");
141 NS_FATAL_ERROR(
"Drop on the phy: cannot validate congestion avoidance");
153 "Increment exceeded segment size in one RTT");
181 std::list<TypeId> types = {
185 for (
const auto& t : types)
187 std::string typeName = t.
GetName();
189 for (
uint32_t i = 10; i <= 50; i += 10)
195 "cong avoid MSS=500, pkt_size=500," +
197 TestCase::Duration::QUICK);
202 "cong avoid MSS=500, pkt_size=1000," +
204 TestCase::Duration::QUICK);
Test the behavior of RFC congestion avoidance.
void Check()
Called each RTT (1.0 sec in the testing environment) and check that the overall increment in this RTT...
uint32_t m_segmentSize
Segment size.
uint32_t m_packets
Number of packets.
EventId m_event
Check event.
void CWndTrace(uint32_t oldValue, uint32_t newValue) override
Tracks the congestion window changes.
void NormalClose(SocketWho who) override
Socket closed normally.
void PhyDrop(SocketWho who) override
Link drop.
bool m_initial
True on first run.
TcpNewRenoCongAvoidNormalTest(uint32_t segmentSize, uint32_t packetSize, uint32_t packets, const TypeId &congControl, const std::string &desc)
Constructor.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_packetSize
Size of the packets.
void ConfigureProperties() override
Change the configuration of the socket properties.
void QueueDrop(SocketWho who) override
Drop on the queue.
uint32_t m_increment
Congestion window increment.
TestSuite for the behavior of RFC congestion avoidance.
TcpRenoCongAvoidTestSuite()
An identifier for simulation events.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsPending() const
This method is syntactic sugar for !IsExpired().
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
General infrastructure for TCP testing.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
TypeId m_congControlTypeId
Congestion control.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
static TypeId GetTypeId()
Get the type ID.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
a unique identifier for an interface.
std::string GetName() const
Get the name.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpRenoCongAvoidTestSuite g_tcpCongAvoidNormalTest
Static variable for test initialization.
static const uint32_t packetSize
Packet size generated at the AP.