21 #include "ns3/simple-channel.h"
22 #include "ns3/internet-module.h"
23 #include "ns3/config.h"
36 const std::string &desc)
38 Seconds (10), initSsTh, 1, segmentSize, typeId, 1500),
41 m_totalAckedBytes (0),
42 m_allowedIncrease (0),
62 uint32_t increase = newValue - oldValue;
68 " with a segsize of " << segSize);
76 NS_LOG_INFO (
"Incremented cWnd by " << segSize <<
" bytes in Slow Start " <<
77 "achieving a value of " << newValue);
126 TypeId &typeId,
const std::string &msg)
139 socket->SetBytesToAck (125);
153 std::list<TypeId> types;
157 for (std::list<TypeId>::iterator it = types.begin (); it != types.end (); ++it)
160 "slow start 500 byte, " + (*it).GetName ()),
163 "slow start 1000 byte, " + (*it).GetName ()),
166 "slow start small packets, " + (*it).GetName ()),
169 "slow start ack attacker, 500 byte, " + (*it).GetName ()),
172 "slow start ack attacker, 1000 byte, " + (*it).GetName ()),
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
This test suite implements a Unit Test.
static TypeId GetTypeId(void)
Get the type ID.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
#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.
TcpSlowStartAttackerTest(uint32_t segmentSize, uint32_t packetSize, uint32_t initSsTh, uint32_t packets, TypeId &congControl, const std::string &desc)
TcpSlowStartNormalTest(uint32_t segmentSize, uint32_t packetSize, uint32_t initSsTh, uint32_t packets, TypeId &congControl, const std::string &desc)
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_allowedIncrease
static TypeId GetTypeId(void)
Get the type ID.
static Time Now(void)
Return the current simulation virtual time.
ns3::TcpSlowStartTestSuite g_tcpSlowStartTestSuite
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
General infrastructure for TCP testing.
uint32_t m_totalAckedBytes
static TypeId GetTypeId(void)
Time Seconds(double value)
Construct a Time in the indicated unit.
A slow start test using a socket which sends smaller ACKs.
#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...
static const uint32_t packetSize
uint32_t GetInitialSsThresh() const
Get the initial slow start threshold.
#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...
a unique identifier for an interface.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
Trace the cWnd over the slow start.
Test the normal behavior for slow start.
TypeId m_congControlTypeId
Congestion control.