56 virtual void ConfigureEnvironment ();
57 virtual void ConfigureProperties ();
62 void IncreaseBufSize ();
74 m_zeroWindowProbe (false),
75 m_windowUpdated (false),
76 m_senderFinished (false),
77 m_receiverFinished (false)
84 TcpGeneralTest::ConfigureEnvironment ();
94 TcpGeneralTest::ConfigureProperties ();
110 Simulator::Schedule (
Seconds (10.0),
126 "Data packet sent anyway");
136 "Data packet sent instead of window probe");
138 "Data packet sent instead of window probe");
145 NS_FATAL_ERROR (
"No packets should be sent before the window update");
155 "RECEIVER window size is not 0 in the SYN-ACK");
162 "Data packet sent instead of window probe");
164 "No zero window advertised by RECEIVER");
169 NS_FATAL_ERROR (
"No packets should be sent before the window update");
174 "Receiver window not updated");
179 "Sender State is not OPEN");
181 "Receiver State is not OPEN");
194 "RECEIVER window size is not 0 in the SYN-ACK");
200 "Receiver window not updated");
227 "Zero window probe not sent");
229 "Window has not updated during the connection");
231 "Connection not closed successfully (SENDER)");
233 "Connection not closed successfully (RECEIVER)");
246 "Persistent event not started");
Testing the congestion avoidance increment on TCP ZeroWindow.
void FinalChecks()
Performs the (eventual) final checks through test asserts.
bool m_windowUpdated
Window updated.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
bool m_senderFinished
Send finished.
bool m_receiverFinished
Receiver finished.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
void IncreaseBufSize()
Increase the receiver buffer size.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
bool m_zeroWindowProbe
ZeroWindow probe.
TcpZeroWindowTest(const std::string &desc)
Constructor.
EventId m_receivePktEvent
Receive packet event.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
void NormalClose(SocketWho who)
TCP ZeroWindow TestSuite.
An identifier for simulation events.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Smart pointer class similar to boost::intrusive_ptr.
General infrastructure for TCP testing.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
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.
Ptr< TcpSocketState > GetTcb(SocketWho who)
Get the TCB from selected socket.
void SetRcvBufSize(SocketWho who, uint32_t size)
Forcefully set a defined size for rx buffer.
EventId GetPersistentEvent(SocketWho who)
Get the persistent event of the selected socket.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
Hold an unsigned integer type.
#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_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#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.
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
Time Seconds(double value)
Construct a Time in the indicated unit.
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 TcpZeroWindowTestSuite g_tcpZeroWindowTestSuite
Static variable for test initialization.