23#include "ns3/assert.h"
26#include "ns3/simple-channel.h"
27#include "ns3/tcp-header.h"
28#include "ns3/tcp-tx-buffer.h"
117 if (tcb->m_cWnd.Get() >= tcb->m_ssThresh)
120 uint32_t awnd = tcb->m_highTxMark.Get().GetValue() - sock->GetSndFack() +
121 sock->GetTxBuffer()->GetRetransmitsCount();
147 for (
const auto& s : sacks)
149 if (s.second > highest)
158 "snd_fack did not advance to highest SACKed seq");
185 new TcpFackTest(cca,
" Test snd.fack and awnd values after four packets are dropped."),
Test case for Forward Acknowledgment(FACK).
void ConfigureEnvironment() override
Change the configuration of the environment.
void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who) override
Processed ack.
uint32_t m_seqToKill
Sequence number to drop.
void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who) override
Received ack.
TcpFackTest(TypeId congControl, const std::string &desc)
Constructor.
Ptr< TcpSeqErrorModel > m_errorModel
Error model.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create and return the error model to install in the receiver node.
uint32_t m_pkts
Number of packets to drop.
Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node) override
Create and install the socket to install on the sender.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Count number of packets dropped.
uint32_t m_pktDropped
The Number of packets has been dropped.
TypeId m_congControlType
Congestion control algorithm type used for this test.
uint32_t m_startSeqToKill
Sequence number of the first packet to drop.
void ConfigureProperties() override
Change the configuration of the socket properties.
uint32_t m_pktSize
Sender Packet Size.
Test suite for verifying the behavior of the TCP FACK implementation under controlled packet loss sce...
AttributeValue implementation for Boolean.
Smart pointer class similar to boost::intrusive_ptr.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
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.
TypeId m_congControlTypeId
Congestion control.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
static TypeId GetTypeId()
Get the type ID.
std::list< SackBlock > SackList
SACK list definition.
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.
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...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
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_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
static TcpFackTestSuite g_tcpFackTestSuite
Static variable for test initialization.