12#include "ns3/simple-channel.h"
13#include "ns3/tcp-header.h"
51 const std::string& desc);
81 const std::string& desc)
139 uint32_t increase = newValue - oldValue;
144 NS_LOG_INFO(
"Ignored update to " << newValue <<
" with a segsize of " << segSize);
152 NS_LOG_INFO(
"Incremented cWnd by " << segSize <<
" bytes in Slow Start "
153 <<
"achieving a value of " << newValue);
223 const TypeId& congControl,
224 const std::string& desc);
235 const std::string& msg)
245 socket->SetBytesToAck(125);
262 std::list<TypeId> types = {
266 for (
const auto& t : types)
268 std::string typeName = t.
GetName();
275 "slow start 500 byte, " + typeName),
276 TestCase::Duration::QUICK);
282 "slow start 1000 byte, " + typeName),
283 TestCase::Duration::QUICK);
289 "slow start small packets, " + typeName),
290 TestCase::Duration::QUICK);
297 "slow start ack attacker, 500 byte, " + typeName),
298 TestCase::Duration::QUICK);
305 "slow start ack attacker, 1000 byte, " + typeName),
306 TestCase::Duration::QUICK);
A slow start test using a socket which sends smaller ACKs.
TcpSlowStartAttackerTest(uint32_t segmentSize, uint32_t packetSize, uint32_t initSsTh, uint32_t packets, const TypeId &congControl, const std::string &desc)
Constructor.
Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node) override
Create and install the socket to install on the receiver.
Test the normal behavior for slow start.
bool m_initial
First cycle flag.
TcpSlowStartNormalTest(uint32_t segmentSize, uint32_t packetSize, uint32_t initSsTh, uint32_t packets, const TypeId &congControl, const std::string &desc)
Constructor.
void CWndTrace(uint32_t oldValue, uint32_t newValue) override
Trace the cWnd over the slow start.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_packetSize
Packet size.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
uint32_t m_packets
Packet counter.
uint32_t m_ackedBytes
ACKed bytes.
uint32_t m_segmentSize
Segment size.
void PhyDrop(SocketWho who) override
Link drop.
void QueueDrop(SocketWho who) override
Drop on the queue.
uint32_t m_sentBytes
Sent bytes.
uint32_t m_totalAckedBytes
Total ACKed bytes.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
void ConfigureProperties() override
Change the configuration of the socket properties.
uint32_t m_allowedIncrease
Allowed increase.
TCP Slow Start TestSuite.
Smart pointer class similar to boost::intrusive_ptr.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
static Time Now()
Return the current simulation virtual time.
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.
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
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.
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_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.
#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.
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
static TcpSlowStartTestSuite g_tcpSlowStartTestSuite
Static variable for test initialization.
static const uint32_t packetSize
Packet size generated at the AP.