23 #include "ns3/tcp-header.h"
24 #include "ns3/tcp-rx-buffer.h"
25 #include "ns3/tcp-tx-buffer.h"
60 uint32_t maxRcvBufferSize,
61 uint32_t maxSndBufferSize,
76 uint32_t maxRcvBufferSize,
77 uint32_t maxSndBufferSize,
94 socket->SetAttribute(
"WindowScaling",
BooleanValue(
false));
98 socket->SetAttribute(
"WindowScaling",
BooleanValue(
true));
102 socket->SetAttribute(
"WindowScaling",
BooleanValue(
false));
106 socket->SetAttribute(
"WindowScaling",
BooleanValue(
true));
121 socket->SetAttribute(
"WindowScaling",
BooleanValue(
false));
125 socket->SetAttribute(
"WindowScaling",
BooleanValue(
false));
129 socket->SetAttribute(
"WindowScaling",
BooleanValue(
true));
133 socket->SetAttribute(
"WindowScaling",
BooleanValue(
true));
145 if (!(h.
GetFlags() & TcpHeader::SYN))
149 "wscale present in non-SYN packets");
157 "wscale disabled but option enabled");
163 "wscale enabled but option disabled");
187 "wscale disabled but option enabled");
193 "wscale enabled but option disabled");
214 "sender has not ws, but receiver sent anyway");
220 "receiver has not ws enabled but sent anyway");
243 "Window scaling not used, all enabled"),
250 "WS enabled client"),
255 "WS disabled client"),
273 "WS small window, sender"),
TCP Window Scaling TestSuite.
TCP Window Scaling enabling Test.
WScalingTestCase(WScalingTestCase::Configuration conf, uint32_t maxRcvBufferSize, uint32_t maxSndBufferSize, std::string name)
Constructor.
Configuration
Window Scaling configuration.
Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node) override
Create and install the socket to install on the receiver.
Configuration m_configuration
Test configuration.
Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node) override
Create and install the socket to install on the sender.
uint32_t m_maxRcvBufferSize
Maximum receiver buffer size.
uint32_t m_maxSndBufferSize
Maximum sender buffer size.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
Smart pointer class similar to boost::intrusive_ptr.
General infrastructure for TCP testing.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
Ptr< TcpRxBuffer > GetRxBuffer(SocketWho who)
Get the Rx buffer from selected socket.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#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.
#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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpWScalingTestSuite g_tcpWScalingTestSuite
Static variable for test initialization.