11#include "ns3/simulator.h"
12#include "ns3/tcp-tx-buffer.h"
62 .SetGroupName(
"Internet")
190 receiver->SendDupAck();
199 if (p->GetSize() == 0)
212 "Retransmitted a segment that was not dropped");
277 "A segment is marked as lost when going back to CA_OPEN from "
281 "A guessed SACK is left when going back to CA_OPEN from "
Check that, without SACK, duplicate ACKs below the threshold do not cause a loss to be inferred (see ...
Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node) override
Create and install the socket to install on the receiver.
uint32_t m_recoveryEntries
Number of times the sender entered CA_RECOVERY.
void ConfigureProperties() override
Change the configuration of the socket properties.
uint32_t m_retransmissions
Data segments retransmitted by the sender.
void ConfigureEnvironment() override
Change the configuration of the environment.
uint32_t m_lossEntries
Number of times the sender entered CA_LOSS.
bool m_injecting
True while an additional duplicate ACK is being sent.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Packet transmitted down to IP layer.
uint32_t m_disorderEntries
Number of times the sender entered CA_DISORDER.
SequenceNumber32 m_highestSeqTx
Highest sequence number sent by the sender.
void FinalChecks() override
Performs the (eventual) final checks through test asserts.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create and return the error model to install in the receiver node.
void InjectDupAck()
Make the receiver send an additional duplicate ACK.
uint32_t m_advancingAcks
ACKs sent by the receiver that advance the ACK number.
TcpNoSackDupAckTest(const std::string &desc, uint32_t toDrop)
Constructor.
void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue) override
State on Ack state machine changes.
uint32_t m_receiverDupAcks
Duplicate ACKs generated by the receiver itself.
uint32_t m_injectedDupAcks
Additional duplicate ACKs injected by the test.
uint32_t m_toDrop
Sequence number to drop (0 to drop none).
SequenceNumber32 m_lastAckTx
Last ACK number sent by the receiver.
TestSuite: duplicate ACK handling when SACK is disabled.
TcpNoSackDupAckTestSuite()
A socket that can send an additional (duplicate) ACK on request.
TcpSocketDupAcker(const TcpSocketDupAcker &other)
Constructor.
Ptr< TcpSocketBase > Fork() override
Call CopyObject<> to clone me.
static TypeId GetTypeId()
Get the type ID.
void SendDupAck()
Send a pure ACK that repeats the current acknowledgment number.
Smart pointer class similar to boost::intrusive_ptr.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
Ptr< TcpTxBuffer > GetTxBuffer(SocketWho who)
Get the Tx buffer from selected socket.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
TypeId m_congControlTypeId
Congestion control.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
Ptr< TcpSocketMsgBase > GetReceiverSocket()
Get the pointer to a previously created receiver socket.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
virtual void SendEmptyPacket(uint8_t flags)
Send a empty packet that carries a flag, e.g., ACK.
static INTERNET_EXPORT const char *const TcpCongStateName[TcpSocketState::CA_LAST_STATE]
Literal names of TCP states for use in log messages.
TcpCongState_t
Definition of the Congestion state machine.
@ CA_RECOVERY
CWND was reduced, we are fast-retransmitting.
@ CA_DISORDER
In all the respects it is "Open", but requires a bit more attention.
@ CA_LOSS
CWND was reduced due to RTO timeout or SACK reneging.
@ CA_OPEN
Normal state, no dubious events.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
SequenceNumber< uint32_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.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
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.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Ptr< T > CopyObject(Ptr< const T > object)
static TcpNoSackDupAckTestSuite g_tcpNoSackDupAckTestSuite
Static variable for test initialization.