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");
virtual void ConfigureProperties()
Change the configuration of the socket properties.
Smart pointer class similar to boost::intrusive_ptr.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
bool m_windowUpdated
Window updated.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void FinalChecks()
Performs the (eventual) final checks through test asserts.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
bool m_receiverFinished
Receiver finished.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
EventId m_receivePktEvent
Receive packet event.
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
Hold an unsigned integer type.
#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.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
void NormalClose(SocketWho who)
Socket closed normally.
void IncreaseBufSize()
Increase the receiver buffer size.
Ptr< TcpSocketState > GetTcb(SocketWho who)
Get the TCB from selected socket.
bool m_senderFinished
Send finished.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TcpZeroWindowTest(const std::string &desc)
Constructor.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
EventId GetPersistentEvent(SocketWho who)
Get the persistent event of the selected socket.
void SetRcvBufSize(SocketWho who, uint32_t size)
Forcefully set a defined size for rx buffer.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
General infrastructure for TCP testing.
An identifier for simulation events.
Time Seconds(double value)
Construct a Time in the indicated unit.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
static TcpZeroWindowTestSuite g_tcpZeroWindowTestSuite
Static variable for test initialization.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
This test suite implements a Unit Test.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
bool m_zeroWindowProbe
ZeroWindow probe.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Testing the congestion avoidance increment on TCP ZeroWindow.
TCP ZeroWindow TestSuite.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.