11#include "ns3/config.h"
69 :
TcpGeneralTest(
"Testing connection closing with retransmissions")
123 NS_LOG_INFO(
"Sender TX: " << h <<
" size " << p->GetSize());
127 NS_LOG_INFO(
"Receiver TX: " << h <<
" size " << p->GetSize());
136 NS_LOG_INFO(
"Sender RX: " << h <<
" size " << p->GetSize());
140 NS_LOG_INFO(
"Receiver RX: " << h <<
" size " << p->GetSize());
AttributeValue implementation for Boolean.
Smart pointer class similar to boost::intrusive_ptr.
Check if the TCP correctly close the connection after receiving previously lost data.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet received from IP layer.
Ptr< TcpSeqErrorModel > m_errorModel
The error model.
bool m_sackEnabled
true if sack should be enabled
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create and return the error model to install in the receiver node.
void FinalChecks() override
Performs the (eventual) final checks through test asserts.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
void ConfigureProperties() override
Change the configuration of the socket properties.
bool m_recvClose
true when the receiver has closed
bool m_sendClose
true when the sender has closed
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > pkt)
Called when a packet is dropped.
TcpCloseWithLossTestCase(bool sackEnabled)
Constructor.
void NormalClose(SocketWho who) override
Socket closed normally.
bool m_synReceived
true when the receiver gets SYN
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.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
Ptr< TcpSocketMsgBase > GetReceiverSocket()
Get the pointer to a previously created receiver socket.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
Check if the TCP is correctly closing its state.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#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.
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 TcpTcpCloseTestSuite g_tcpTcpCloseTestSuite
Static variable for test initialization.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...